名前空間 | |
XH | |
General functions.
functions.php に定義があります。
a | ( | $i, | |
$x | |||
) |
Returns an opening a tag as link to a page.
int | $i | The page index. |
string | $x | Arbitrary appendix of the URL. |
string The script name. array The URLs of the pages. array The configuration of the core.
functions.php の 931 行目に定義があります。
cmscript | ( | $script, | |
$text | |||
) |
Returns the number of times a CMSimple script is found.
string | $script | The needle. |
string | $text | The haystack. |
functions.php の 1084 行目に定義があります。
download | ( | $fl | ) |
Makes the file available for download.
If the file can't be downloaded, an HTTP 404 Not found response will be generated.
string | $fl | The file name. |
string The script name. string The file to download.
functions.php の 623 行目に定義があります。
e | ( | $et, | |
$ft, | |||
$fn | |||
) |
Appends an error message about the file to $e.
string | $et | A key in $tx['error']. |
string | $ft | A key in $tx['filetype']. |
string | $fn | The file name. |
string Error messages as HTML fragment consisting of LI Elements. array The localization of the core.
functions.php の 655 行目に定義があります。
editor_replace | ( | $elementID = false , |
|
$config = '' |
|||
) |
Returns the result of calling *_replace() of the configured editor. Returns false on failure.
string | $elementID | The element with this ID will become an editor. |
string | $config | The configuration. |
array The paths of system files and folders. array The configuration of the core.
functions.php の 424 行目に定義があります。
evaluate_cmsimple_scripting | ( | $__text, | |
$__compat = true |
|||
) |
Returns a text with CMSimple scripting evaluated.
Scripts are evaluated as if they were in the global scope, except that no new global variables can be defined (unless via $GLOBALS).
string | $__text | The text. |
bool | $__compat | Whether only last CMSimple script should be evaluated. |
string The output.
functions.php の 134 行目に定義があります。
evaluate_plugincall | ( | $text | ) |
Returns a text with all plugin calls evaluatated.
All Plugins which are called through a function-call can use this. At the moment it is not possible to do this with class-based plugins. They need to be called through standard-CMSimple-Scripting. Alternatively one can offer a functional wrapper.
To call a plugin, place the following on a CMSimple_XH page (example): {{{pluginfunction('parameters');}}}
About the scope rules see XH_evaluateSinglePluginCall.
string | $text | The text. |
array The localization of the core.
functions.php の 186 行目に定義があります。
evaluate_scripting | ( | $text, | |
$compat = true |
|||
) |
Returns a text with CMSimple scripting and plugin calls evaluated.
string | $text | The text. |
bool | $compat | Whether only last CMSimple script will be evaluated. |
functions.php の 303 行目に定義があります。
gc | ( | $s | ) |
Returns the value of a cookie, or null if the cookie doesn't exist.
string | $s | The name of the cookie. |
functions.php の 1484 行目に定義があります。
geturl | ( | $u | ) |
Returns the inner HTML of the body element of the given URL.
string | $u | A URL. |
functions.php の 45 行目に定義があります。
geturlwp | ( | $u | ) |
Returns the contents of the given URL adding all current GET parameters.
string | $u | A URL. |
functions.php の 64 行目に定義があります。
h | ( | $n | ) |
Returns a page heading.
int | $n | The index of the page. |
functions.php の 90 行目に定義があります。
hide | ( | $i | ) |
Returns whether a page is hidden.
int | $i | The page index. |
array The content of the pages. bool Whether edit mode is active.
functions.php の 1100 行目に定義があります。
include_editor | ( | ) |
Calls include_*() of the configured editor. Returns whether that succeeded.
array The paths of system files and folders. array The configuration of the core.
functions.php の 387 行目に定義があります。
init_editor | ( | array | $elementClasses = array() , |
$initFile = false |
|||
) |
Calls init_*() of the configured editor. Returns whether that succeeded.
array | $elementClasses | Elements with these classes will become an editor. |
mixed | $initFile | The init file or configuration. |
array The paths of system files and folders. array The configuration of the core.
functions.php の 354 行目に定義があります。
initvar | ( | $name | ) |
Initializes a global variable according to a GET or POST parameter.
string | $name | The name of the global variable. |
functions.php の 521 行目に定義があります。
l | ( | $n | ) |
Returns a page's menu level.
int | $n | The index of the page. |
functions.php の 110 行目に定義があります。
logincheck | ( | ) |
Returns wether the user is logged in.
array The configuration of the core.
functions.php の 1498 行目に定義があります。
loginforms | ( | ) |
Returns the login form.
array The configuration of the core. array The localization of the core. string JavaScript for the onload event of the BODY element. string The requested special function. string The HTML of the contents area. int The index of the requested page. string The script name. string The URL of the selected page.
functions.php の 1556 行目に定義があります。
meta | ( | $n | ) |
Returns the meta element for name, if defined in $cf['meta']; null otherwise.
string | $n | The name attribute. |
array The configuration of the core. array The localization of the core. bool Whether print mode is active.
functions.php の 957 行目に定義があります。
ml | ( | $i | ) |
Returns the link to a special CMSimple_XH page, e.g. sitemap.
string | $i | A key of $tx['menu']. |
string The requested special function. string The script name. array The localization of the core.
functions.php の 980 行目に定義があります。
newsbox | ( | $heading | ) |
Returns content of the first page with the heading $heading with the heading removed and all scripting evaluated. Returns false, if the page doesn't exist.
string | $heading | The page heading. |
array The content of the pages. int The number of pages. array The headings of the pages. bool Whether edit mode is active.
functions.php の 322 行目に定義があります。
pluginFiles | ( | $plugin | ) |
Set plugin paths.
string | $plugin | The name of the plugin. |
array The paths of system files and folders. string The active language.
array The help filename cache.
functions.php の 1377 行目に定義があります。
rfc | ( | ) |
Reads and parses the content file and sets global variables accordingly.
bool Whether we're in edit mode. array The contents of the pages. int The number of pages. array The headings of the pages. array The URLs of the pages. array The menu levels of the pages. string The URL of the current page. string The index of the current page. array The localization of the core. string Error messages as HTML fragment consisting of LI Elements. object The pagedata router. object The publisher.
functions.php の 681 行目に定義があります。
rmanl | ( | $t | ) |
Returns $t with all line endings removed.
string | $t | A string. |
functions.php の 591 行目に定義があります。
rmnl | ( | $t | ) |
Returns $t with all (consecutive) line endings replaced by a single newline.
string | $t | A string. |
functions.php の 559 行目に定義があります。
shead | ( | $s | ) |
Sends error header and sets $title and $o accordingly.
int | $s | The HTTP status response code (401, 403, 404). |
bool Whether the server is IIS. bool Whether the API is CGI. array The localization of the core. string The page title. string The HTML of the contents area.
functions.php の 1144 行目に定義があります。
sortdir | ( | $dir | ) |
Returns the alphabetically sorted content of a directory.
Caveat: the result includes '.' and '..'.
string | $dir | An existing directory path. |
functions.php の 1063 行目に定義があります。
stsl | ( | $t | ) |
Returns the un-quoted $t, i.e. reverses the effect of magic_quotes_gpc/magic_quotes_sybase.
If in doubt, use on all user input (but at most once!).
string | $t | A string. |
functions.php の 606 行目に定義があります。
sv | ( | $s | ) |
tag | ( | $s | ) |
Returns an HTML stand alone tag.
Used to returns an (X)HTML compliant stand alone tag according to the settings of $cf['xhtml']['endtags'].
string | $s | The contents of the tag. |
array The configuration of the core.
functions.php の 1126 行目に定義があります。
uenc | ( | $s | ) |
Returns a percent encoded URL component.
Additionally all character sequences in $tx['urichar']['org'] will be replaced by their according character sequences in $tx['urichar']['new'].
string | $s | The URL component. |
array The localization of the core.
functions.php の 1009 行目に定義があります。
XH_adjustStylesheetURLs | ( | $plugin, | |
$css | |||
) |
Adjusts all relative url(...) in a stylesheet to be used in the combined plugin stylesheet.
string | $plugin | The name of the plugin. |
string | $css | The content of the stylesheet. |
functions.php の 1787 行目に定義があります。
XH_afterFinalCleanUp | ( | $param | ) |
Registers or executes registered callbacks at the end of XH_finalCleanUp().
Registers a callback for execution at the end of XH_finalCleanUp(), if $param is a callable; otherwise executes these callbacks, passing $param as parameter to the callback function. The latter variant is supposed to be called only by the core, and in this case will invoke the callback with the page HTML, and expects the callback to return the possibly modified HTML.
mixed | $param | A parameter. |
functions.php の 1683 行目に定義があります。
XH_afterPluginLoading | ( | $callback = null | ) |
Registers a callback for execution after all plugins were loaded, if $callback is given; otherwise executes these callbacks.
callable | $callback | The callback. |
array The callbacks for later execution.
functions.php の 1654 行目に定義があります。
XH_autoload | ( | $className | ) |
Autoloads classes named after CMSimple_XH/PEAR coding standards.
string | $className | A class name. |
array The paths of system files and folders.
functions.php の 2616 行目に定義があります。
XH_availableLocalizations | ( | ) |
Returns an array of available languages (in cmsimple/languages/).
array The paths of system files and folders.
functions.php の 1993 行目に定義があります。
XH_backup | ( | ) |
Creates backups of all content files.
Surplus old backups will be deleted. Returns an appropriate message.
array The paths of system files and folders.
functions.php の 1826 行目に定義があります。
XH_builtinTemplate | ( | $bodyClass | ) |
A minimal built-in template for some special functions. Currently used for the print view and the login screen.
string | $bodyClass | The CSS class of the BODY element. |
XH_CSRFProtection The CSRF protector.
functions.php の 1895 行目に定義があります。
XH_checkValidUtf8 | ( | array | $arr | ) |
Checks $arr recursively for valid UTF-8. Otherwise it exits the script.
Useful for checking user input.
array | $arr | Array to check. |
array The localization of the core.
functions.php の 1318 行目に定義があります。
XH_convertPrintUrls | ( | $pageContent | ) |
Convert all internal URLs in a text to print URLs.
string | $pageContent | Some HTML. |
functions.php の 2132 行目に定義があります。
XH_convertToPrintUrl | ( | array | $matches | ) |
Returns a single URL converted to a print URL, if appropriate. Serves as helper for
array | $matches | The matches of a PREG. |
functions.php の 2107 行目に定義があります。
XH_createLanguageFile | ( | $dst | ) |
Copies default file, if actual language file is missing. Returns whether the language file exists afterwards.
string | $dst | The destination filename. |
functions.php の 1352 行目に定義があります。
XH_debug | ( | $errno, | |
$errstr, | |||
$errfile, | |||
$errline | |||
) |
Writes all recoverable PHP errors to $e.
int | $errno | Level of the error. |
string | $errstr | An error message. |
string | $errfile | Filename where error was raised. |
int | $errline | Line number where error was raised. |
array The list of PHP errors formatted as HTML fragment.
functions.php の 1252 行目に定義があります。
XH_debugmode | ( | ) |
Debug-Mode
Check if file "_XHdebug.txt" exists to turn on debug-mode with default debug level 1. The level of the debug mode can be adjusted by placing an integer-value within the file using following values:
array The paths of system files and folders.
functions.php の 1192 行目に定義があります。
XH_decodeJson | ( | $string | ) |
Returns the JSON string decoded as PHP value.
string | $string | A JSON string. |
object The JSON codec.
functions.php の 2152 行目に定義があります。
XH_encodeJson | ( | $value | ) |
Returns the JSON representation of a value.
mixed | $value | A PHP value. |
object The JSON codec.
functions.php の 2170 行目に定義があります。
XH_escapeCMSimpleScripting | ( | array | $matches | ) |
Escapes CMSimple scripting returned from a plugin call.
array | $matches | An array of matches. |
functions.php の 261 行目に定義があります。
XH_evaluateSinglePluginCall | ( | $___expression | ) |
Returns the result of evaluating a single plugin call expression.
The expression is evaluated as if it where in the global namespace. To avoid clashes with local variables of this function, these are prefixed with a triple underscore. Reference parameters of the function do not modify the global scope.
string | $___expression | The expression to evaluate. |
functions.php の 242 行目に定義があります。
XH_exit | ( | $status = 0 | ) |
Exits the running script.
Simple wrapper for exit for testing purposes.
mixed | $status | A status message or code. |
functions.php の 2401 行目に定義があります。
XH_finalCleanUp | ( | $html | ) |
Callback for output buffering. Returns the postprocessed HTML.
Currently debug information and admin menu are prepended, and $bjs is appended to the body element.
string | $html | The HTML generated so far. |
array array The configuration of the core. array The localization of the core. string HTML to be preprended to the closing BODY tag.
functions.php の 464 行目に定義があります。
XH_findNextPage | ( | ) |
Finds the index of the next page.
int The index of the current page. int The number of pages.
functions.php の 907 行目に定義があります。
XH_findPreviousPage | ( | ) |
Finds the index of the previous page.
int The index of the current page.
functions.php の 885 行目に定義があります。
XH_formatDate | ( | $timestamp | ) |
Returns a timestamp formatted according to config and lang.
int | $timestamp | A UNIX timestamp. |
array The configuration of the core. array The localization of the core.
functions.php の 2547 行目に定義があります。
XH_getLocatorModel | ( | ) |
Returns the locator (breadcrumb navigation) model.
The locator model is an ordered list of breadcrumb items, where each item is an array of the title and the URL. If there is no appropriate URL, the element is null.
string The title of the page. array The headings of the pages. int The index of the current page. string The requested special function. array The menu levels of the pages. array The localization of the core. array The configuration of the core. object The publisher.
functions.php の 2786 行目に定義があります。
XH_getPageURL | ( | $index | ) |
Returns the full URL of a page.
int | $index | A valid page index. |
string The script name. array The page URLs.
functions.php の 2846 行目に定義があります。
XH_getRootFolder | ( | ) |
Returns the root (= installation) folder of the system.
string The script name. string The current language.
functions.php の 2416 行目に定義があります。
XH_helpIcon | ( | $tooltip | ) |
Returns a help icon which displays a tooltip on hover.
string | $tooltip | A tooltip in HTML. |
array The paths of system files and folders. array The localization of the core.
functions.php の 1927 行目に定義があります。
XH_highlightSearchWords | ( | array | $words, |
$text | |||
) |
Highlights the search words in a text.
array | $words | An array of search words. |
string | $text | A text. |
functions.php の 2589 行目に定義があります。
XH_hsc | ( | $string | ) |
Converts special characters to HTML entities.
Same as htmlspecialchars($string, ENT_COMPAT | ENT_SUBSTITUTE, 'UTF-8'), but works for PHP < 5.4 as well.
string | $string | A string. |
functions.php の 2204 行目に定義があります。
XH_includeVar | ( | $_filename, | |
$_varname | |||
) |
Includes a PHP data file and returns the value of the variable. Returns false, if including failed. During the inclusion, the file is locked for shared access.
string | $_filename | A filename. |
string | $_varname | A variable name. |
functions.php の 2251 行目に定義があります。
XH_isContentBackup | ( | $filename, | |
$regularOnly = true |
|||
) |
Returns whether a file is a content backup by checking the filename.
string | $filename | A filename. |
string | $regularOnly | Whether to check for regalur backup names only. |
functions.php の 1949 行目に定義があります。
XH_isInternalPath | ( | $path | ) |
Returns whether a path refers to a CMSimple index.php.
string | $path | A relative path. |
functions.php の 2049 行目に定義があります。
XH_isInternalUrl | ( | $urlParts | ) |
Returns whether a URL points to this CMSimple installation.
string | $urlParts | Parts of an URL. |
functions.php の 2086 行目に定義があります。
XH_isLanguageFolder | ( | $name | ) |
Returns whether $name is a language folder.
string | $name | The name to check. |
array The paths of system files and folders.
functions.php の 1850 行目に定義があります。
XH_lastJsonError | ( | ) |
Returns whether an error has occurred during the last XH_decodeJSON().
object The JSON codec.
functions.php の 2187 行目に定義があります。
XH_lockFile | ( | $handle, | |
$operation | |||
) |
Implements portable advisory file locking.
For now it is just a simple wrapper around flock().
resource | $handle | A file handle. |
int | $operation | A lock operation (use LOCK_SH, LOCK_EX or LOCK_UN). |
functions.php の 2574 行目に定義があります。
XH_logMessage | ( | $type, | |
$module, | |||
$category, | |||
$description | |||
) |
Appends a message to the log file, and returns whether that succeeded.
string | $type | A message type ("info", "warning", "error"). |
string | $module | A module name ("XH" or plugin name). |
string | $category | A category. |
string | $description | A description. |
array The paths of system files and folders.
functions.php の 1523 行目に定義があります。
XH_mailform | ( | $subject = null | ) |
Handles a mailform embedded in a CMSimple_XH page.
string | $subject | An alternative subject field preset text instead of the subject default in localization. |
array The configuration of the core.
functions.php の 2227 行目に定義があります。
XH_message | ( | $type, | |
$message | |||
) |
Returns an HTML element formatted as message.
string | $type | The type of message ('success', 'info', 'warning', 'fail'). |
string | $message | A message format to print in an printf() style. |
functions.php の 1806 行目に定義があります。
XH_numberSuffix | ( | $count | ) |
Returns a suffix for a language string key according to the number (singular, paucal or plural).
int | $count | Count of the items. |
functions.php の 2278 行目に定義があります。
XH_onShutdown | ( | ) |
Handles the shutdown of the script.
array The localization of the core.
functions.php の 2520 行目に定義があります。
XH_plugins | ( | $admin = false | ) |
Returns a list of all active plugins.
bool | $admin | Whether to return only plugins with a admin.php |
array The paths of system files and folders. array The configuration of the core.
array The plugin name cache. array The admin plugin name cache.
Might be optimized to set $admPlugins only when necessary.
with PHP 5.4.0 replace array_values() by sort($plugins, SORT_NATURAL | SORT_FLAG_CASE)
functions.php の 1443 行目に定義があります。
XH_pluginStylesheet | ( | ) |
Returns the path of the combined plugin stylesheet. If necessary, this stylesheet will be created/updated.
array The paths of system files and folders.
functions.php の 1707 行目に定義があります。
XH_pluginURL | ( | $plugin | ) |
Returns The link to a plugin download site.
One of the 3 functions to show "Site/CMS Info".
string | $plugin | The plugin name. |
array The paths of system files and folders.
functions.php の 2743 行目に定義があります。
XH_poweredBy | ( | ) |
Returns The content of the generated page "Site/CMS Info".
One of the 3 functions to show "Site/CMS Info".
array The configuration of the core. array The language localization of the core. array The paths of system files and folders.
functions.php の 2687 行目に定義があります。
XH_readConfiguration | ( | $plugin = false , |
|
$language = false |
|||
) |
Returns the configuration resp. language array of the core resp. a plugin.
For plugins pluginFiles() has to be called before.
bool | $plugin | Whether to return plugin information (opposed to core). |
bool | $language | Whether to return the language array (opposed to config). |
array The paths of system files and folders.
functions.php の 2304 行目に定義があります。
XH_readContents | ( | $language = null | ) |
Reads and parses a content file.
Returns an associative array containing the following information:
string | $language | The language to read. null means the default language. |
array The paths of system files and folders. array The configuration of the core. bool Whether edit mode is active.
functions.php の 765 行目に定義があります。
XH_readFile | ( | $filename | ) |
Reads a file and returns its contents; false on failure. During reading, the file is locked for shared access.
string | $filename | A file path. |
functions.php の 1601 行目に定義があります。
XH_redirectSelectedUrl | ( | ) |
Returns the URL where to redirect selected
GEt requests.
string The value of the selected
GP parameter.
functions.php の 2862 行目に定義があります。
XH_registeredEditmenuPlugins | ( | ) |
Returns the names of the registered editmenu plugins.
functions.php の 2501 行目に定義があります。
XH_registeredEditorPlugins | ( | ) |
Returns the names of the registered editor plugins.
functions.php の 2465 行目に定義があります。
XH_registeredFilebrowserPlugins | ( | ) |
Returns the names of the registered filebrowser plugins.
functions.php の 2477 行目に定義があります。
XH_registeredPagemanagerPlugins | ( | ) |
Returns the names of the registered pagemanager plugins.
functions.php の 2489 行目に定義があります。
XH_registerPluginType | ( | $type, | |
$plugin = null |
|||
) |
Registers the type of a plugin resp. returns the registered plugins of a certain type.
string | $type | A plugin type ('editor', 'filebrowser', 'pagemanager', 'editmenu'). |
string | $plugin | A plugin name or null. |
array The registered plugins.
functions.php の 2441 行目に定義があります。
XH_renameFile | ( | $oldname, | |
$newname | |||
) |
Attempts to rename oldname to newname, and returns whether that succeeded.
The file is moved between directories if necessary. If newname exists, it will be overwritten.
This is a wrapper around rename(), which offers a fallback for the limitation of PHP < 5.3 on Windows that the rename operation fails, if $newfile already exists. Note, that the fallback solution is not atomic.
string | $oldname | A filename. |
string | $newname | A filename. |
functions.php の 2385 行目に定義があります。
XH_rmws | ( | $str | ) |
Returns $str with all (consecutive) whitespaces replaced by a single space.
string | $str | A string. |
functions.php の 573 行目に定義があります。
XH_secondLanguages | ( | ) |
Returns the installed second languages in alphabetic order.
array The paths of system files and folders.
array The language names cache.
functions.php の 2021 行目に定義があります。
XH_spliceString | ( | & | $string, |
$offset, | |||
$length = 0 , |
|||
$replacement = '' |
|||
) |
Removes a portion of a string and replaces it with something else. This does basically the same to strings as array_splice() for arrays. Note that the behavior of negative values for $offset and $length is not defined.
string | $string | The string to manipulate. |
int | $offset | Offset of the string where to start the replacement. |
int | $length | The number of characters to be replaced. |
string | $replacement | The string to replace the removed characters. |
functions.php の 285 行目に定義があります。
XH_startSession | ( | ) |
Starts a named session.
If session is already started, nothing happens.
functions.php の 2662 行目に定義があります。
XH_templates | ( | ) |
Returns an array of installed templates.
array The paths of system files and folders.
functions.php の 1964 行目に定義があります。
XH_title | ( | $site, | |
$subtitle | |||
) |
Returns the text content for a TITLE element.
string | $site | A site name. |
string | $subtitle | A subtitle (e.g. the page heading). |
functions.php の 1869 行目に定義があります。
XH_uenc | ( | $s, | |
array | $search, | ||
array | $replace | ||
) |
Returns a percent encoded URL component.
Additionally all character sequences in $search will be replaced by their according character sequences in $replace, spaces will be replaced by the configured word_separator and leading, trailing and multiple consecutive word_separators will be trimmed.
string | $s | The URL component. |
array | $search | Strings to search for. |
array | $replace | Replacement strings. |
array The configuration of the core.
functions.php の 1042 行目に定義があります。
XH_unionOf2DArrays | ( | array | $array1, |
array | $array2 | ||
) |
Returns the union of two "2-dimensional" arrays in the same manner as the union operator (i.e. keys and subkeys in the first array have higher priority).
array | $array1 | A "2-dimensional" array. |
array | $array2 | A "2-dimensional" array. |
functions.php の 2356 行目に定義があります。
XH_writeFile | ( | $filename, | |
$contents | |||
) |
Writes $contents to the file $filename. During writing the file is locked exclusively.
string | $filename | The filename. |
string | $contents | The content to write. |
functions.php の 1626 行目に定義があります。