CMSimple_XH 開発者ドキュメント
functions.php ファイル

[ソースコード]

名前空間

 XH
 

関数

 geturl ($u)
 
 geturlwp ($u)
 
 h ($n)
 
 l ($n)
 
 evaluate_cmsimple_scripting ($__text, $__compat=true)
 
 evaluate_plugincall ($text)
 
 XH_evaluateSinglePluginCall ($___expression)
 
 XH_escapeCMSimpleScripting (array $matches)
 
 XH_spliceString (&$string, $offset, $length=0, $replacement='')
 
 evaluate_scripting ($text, $compat=true)
 
 newsbox ($heading)
 
 init_editor (array $elementClasses=array(), $initFile=false)
 
 include_editor ()
 
 editor_replace ($elementID=false, $config='')
 
 XH_finalCleanUp ($html)
 
 initvar ($name)
 
 sv ($s)
 
 rmnl ($t)
 
 XH_rmws ($str)
 
 rmanl ($t)
 
 stsl ($t)
 
 download ($fl)
 
 e ($et, $ft, $fn)
 
 rfc ()
 
 XH_readContents ($language=null)
 
 XH_findPreviousPage ()
 
 XH_findNextPage ()
 
 a ($i, $x)
 
 meta ($n)
 
 ml ($i)
 
 uenc ($s)
 
 XH_uenc ($s, array $search, array $replace)
 
 sortdir ($dir)
 
 cmscript ($script, $text)
 
 hide ($i)
 
 tag ($s)
 
 shead ($s)
 
 XH_debugmode ()
 
 XH_debug ($errno, $errstr, $errfile, $errline)
 
 XH_checkValidUtf8 (array $arr)
 
 XH_createLanguageFile ($dst)
 
 pluginFiles ($plugin)
 
 XH_plugins ($admin=false)
 
 gc ($s)
 
 logincheck ()
 
 XH_logMessage ($type, $module, $category, $description)
 
 loginforms ()
 
 XH_readFile ($filename)
 
 XH_writeFile ($filename, $contents)
 
 XH_afterPluginLoading ($callback=null)
 
 XH_afterFinalCleanUp ($param)
 
 XH_pluginStylesheet ()
 
 XH_adjustStylesheetURLs ($plugin, $css)
 
 XH_message ($type, $message)
 
 XH_backup ()
 
 XH_isLanguageFolder ($name)
 
 XH_title ($site, $subtitle)
 
 XH_builtinTemplate ($bodyClass)
 
 XH_helpIcon ($tooltip)
 
 XH_isContentBackup ($filename, $regularOnly=true)
 
 XH_templates ()
 
 XH_availableLocalizations ()
 
 XH_secondLanguages ()
 
 XH_isInternalPath ($path)
 
 XH_isInternalUrl ($urlParts)
 
 XH_convertToPrintUrl (array $matches)
 
 XH_convertPrintUrls ($pageContent)
 
 XH_decodeJson ($string)
 
 XH_encodeJson ($value)
 
 XH_lastJsonError ()
 
 XH_hsc ($string)
 
 XH_mailform ($subject=null)
 
 XH_includeVar ($_filename, $_varname)
 
 XH_numberSuffix ($count)
 
 XH_readConfiguration ($plugin=false, $language=false)
 
 XH_unionOf2DArrays (array $array1, array $array2)
 
 XH_renameFile ($oldname, $newname)
 
 XH_exit ($status=0)
 
 XH_getRootFolder ()
 
 XH_registerPluginType ($type, $plugin=null)
 
 XH_registeredEditorPlugins ()
 
 XH_registeredFilebrowserPlugins ()
 
 XH_registeredPagemanagerPlugins ()
 
 XH_registeredEditmenuPlugins ()
 
 XH_onShutdown ()
 
 XH_formatDate ($timestamp)
 
 XH_lockFile ($handle, $operation)
 
 XH_highlightSearchWords (array $words, $text)
 
 XH_autoload ($className)
 
 XH_startSession ()
 
 XH_poweredBy ()
 
 XH_pluginURL ($plugin)
 
 XH_getLocatorModel ()
 
 XH_getPageURL ($index)
 
 XH_redirectSelectedUrl ()
 

詳解

General functions.

functions.php に定義があります。

関数詳解

◆ a()

a (   $i,
  $x 
)

Returns an opening a tag as link to a page.

引数
int$iThe page index.
string$xArbitrary appendix of the URL.

string The script name. array The URLs of the pages. array The configuration of the core.

戻り値
string HTML

functions.php931 行目に定義があります。

◆ cmscript()

cmscript (   $script,
  $text 
)

Returns the number of times a CMSimple script is found.

引数
string$scriptThe needle.
string$textThe haystack.
戻り値
int

functions.php1084 行目に定義があります。

◆ download()

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$flThe file name.

string The script name. string The file to download.

戻り値
void

functions.php623 行目に定義があります。

◆ e()

e (   $et,
  $ft,
  $fn 
)

Appends an error message about the file to $e.

引数
string$etA key in $tx['error'].
string$ftA key in $tx['filetype'].
string$fnThe file name.

string Error messages as HTML fragment consisting of LI Elements. array The localization of the core.

戻り値
void

functions.php655 行目に定義があります。

◆ editor_replace()

editor_replace (   $elementID = false,
  $config = '' 
)

Returns the result of calling *_replace() of the configured editor. Returns false on failure.

引数
string$elementIDThe element with this ID will become an editor.
string$configThe configuration.

array The paths of system files and folders. array The configuration of the core.

戻り値
void

1.5

functions.php424 行目に定義があります。

◆ evaluate_cmsimple_scripting()

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$__textThe text.
bool$__compatWhether only last CMSimple script should be evaluated.

string The output.

戻り値
string
から
1.5

functions.php134 行目に定義があります。

◆ evaluate_plugincall()

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$textThe text.
戻り値
string

array The localization of the core.

から
1.5

functions.php186 行目に定義があります。

◆ evaluate_scripting()

evaluate_scripting (   $text,
  $compat = true 
)

Returns a text with CMSimple scripting and plugin calls evaluated.

引数
string$textThe text.
bool$compatWhether only last CMSimple script will be evaluated.
戻り値
void
から
1.5

functions.php303 行目に定義があります。

◆ gc()

gc (   $s)

Returns the value of a cookie, or null if the cookie doesn't exist.

引数
string$sThe name of the cookie.
戻り値
string

functions.php1484 行目に定義があります。

◆ geturl()

geturl (   $u)

Returns the inner HTML of the body element of the given URL.

引数
string$uA URL.
戻り値
string HTML

functions.php45 行目に定義があります。

◆ geturlwp()

geturlwp (   $u)

Returns the contents of the given URL adding all current GET parameters.

引数
string$uA URL.
戻り値
string HTML

functions.php64 行目に定義があります。

◆ h()

h (   $n)

Returns a page heading.

引数
int$nThe index of the page.
戻り値
string
参照
$h
非推奨:
since 1.7. Use $h instead.

functions.php90 行目に定義があります。

◆ hide()

hide (   $i)

Returns whether a page is hidden.

引数
int$iThe page index.

array The content of the pages. bool Whether edit mode is active.

戻り値
bool

functions.php1100 行目に定義があります。

◆ include_editor()

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.

戻り値
bool

1.5

functions.php387 行目に定義があります。

◆ init_editor()

init_editor ( array  $elementClasses = array(),
  $initFile = false 
)

Calls init_*() of the configured editor. Returns whether that succeeded.

引数
array$elementClassesElements with these classes will become an editor.
mixed$initFileThe init file or configuration.

array The paths of system files and folders. array The configuration of the core.

戻り値
bool

1.5

functions.php354 行目に定義があります。

◆ initvar()

initvar (   $name)

Initializes a global variable according to a GET or POST parameter.

引数
string$nameThe name of the global variable.
戻り値
void
非推奨:
since 1.7.0

functions.php521 行目に定義があります。

◆ l()

l (   $n)

Returns a page's menu level.

引数
int$nThe index of the page.
戻り値
int
参照
$l
非推奨:
since 1.7. Use $l instead.

functions.php110 行目に定義があります。

◆ logincheck()

logincheck ( )

Returns wether the user is logged in.

array The configuration of the core.

戻り値
bool.

functions.php1498 行目に定義があります。

◆ loginforms()

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.

戻り値
string HTML

functions.php1556 行目に定義があります。

◆ meta()

meta (   $n)

Returns the meta element for name, if defined in $cf['meta']; null otherwise.

引数
string$nThe name attribute.

array The configuration of the core. array The localization of the core. bool Whether print mode is active.

戻り値
string HTML

functions.php957 行目に定義があります。

◆ ml()

ml (   $i)

Returns the link to a special CMSimple_XH page, e.g. sitemap.

引数
string$iA key of $tx['menu'].

string The requested special function. string The script name. array The localization of the core.

戻り値
string HTML

functions.php980 行目に定義があります。

◆ newsbox()

newsbox (   $heading)

最初のページの見出しと $見出しの内容を返します。見出しは削除され、すべてのスクリプトが評価されます。ページが存在しない場合はfalseを返します。.

引数
string$headingThe page heading.

global
$c array The content of the pages.
$cl int The number of pages.
$h array The headings of the pages.
,$edit bool Whether edit mode is active.

戻り値
string HTML

<?php echo newsbox('News01');?>

functions.php322 行目に定義があります。

◆ pluginFiles()

pluginFiles (   $plugin)

Set plugin paths.

引数
string$pluginThe name of the plugin.

array The paths of system files and folders. string The active language.

戻り値
void

array The help filename cache.

functions.php1377 行目に定義があります。

◆ rfc()

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.

戻り値
void

functions.php681 行目に定義があります。

◆ rmanl()

rmanl (   $t)

Returns $t with all line endings removed.

引数
string$tA string.
戻り値
string

functions.php591 行目に定義があります。

◆ rmnl()

rmnl (   $t)

Returns $t with all (consecutive) line endings replaced by a single newline.

引数
string$tA string.
戻り値
string

functions.php559 行目に定義があります。

◆ shead()

shead (   $s)

Sends error header and sets $title and $o accordingly.

引数
int$sThe 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.

戻り値
void.

functions.php1144 行目に定義があります。

◆ sortdir()

sortdir (   $dir)

Returns the alphabetically sorted content of a directory.

Caveat: the result includes '.' and '..'.

引数
string$dirAn existing directory path.
戻り値
array

functions.php1063 行目に定義があります。

◆ stsl()

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$tA string.
戻り値
string

functions.php606 行目に定義があります。

◆ sv()

sv (   $s)

Returns the value of a $_SERVER key.

引数
string$sThe key.
戻り値
string

functions.php543 行目に定義があります。

◆ tag()

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$sThe contents of the tag.
戻り値
string HTML

array The configuration of the core.

非推奨:
since 1.7
todo:
Add deprecation warning (XH 1.8?)

functions.php1126 行目に定義があります。

◆ uenc()

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$sThe URL component.

array The localization of the core.

戻り値
string
参照
XH_uenc()

functions.php1009 行目に定義があります。

◆ XH_adjustStylesheetURLs()

XH_adjustStylesheetURLs (   $plugin,
  $css 
)

Adjusts all relative url(...) in a stylesheet to be used in the combined plugin stylesheet.

引数
string$pluginThe name of the plugin.
string$cssThe content of the stylesheet.
戻り値
string
から
1.6

functions.php1787 行目に定義があります。

◆ XH_afterFinalCleanUp()

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$paramA parameter.
戻り値
void
から
1.7

functions.php1683 行目に定義があります。

◆ XH_afterPluginLoading()

XH_afterPluginLoading (   $callback = null)

Registers a callback for execution after all plugins were loaded, if $callback is given; otherwise executes these callbacks.

引数
callable$callbackThe callback.
戻り値
void

array The callbacks for later execution.

から
1.6

functions.php1654 行目に定義があります。

◆ XH_autoload()

XH_autoload (   $className)

Autoloads classes named after CMSimple_XH/PEAR coding standards.

引数
string$classNameA class name.
戻り値
void

array The paths of system files and folders.

から
1.7

functions.php2616 行目に定義があります。

◆ XH_availableLocalizations()

XH_availableLocalizations ( )

Returns an array of available languages (in cmsimple/languages/).

戻り値
array

array The paths of system files and folders.

から
1.6

functions.php1993 行目に定義があります。

◆ XH_backup()

XH_backup ( )

Creates backups of all content files.

Surplus old backups will be deleted. Returns an appropriate message.

戻り値
string HTML

array The paths of system files and folders.

から
1.6

functions.php1826 行目に定義があります。

◆ XH_builtinTemplate()

XH_builtinTemplate (   $bodyClass)

A minimal built-in template for some special functions. Currently used for the print view and the login screen.

引数
string$bodyClassThe CSS class of the BODY element.
戻り値
string HTML
から
1.6

XH_CSRFProtection The CSRF protector.

functions.php1895 行目に定義があります。

◆ XH_checkValidUtf8()

XH_checkValidUtf8 ( array  $arr)

Checks $arr recursively for valid UTF-8. Otherwise it exits the script.

Useful for checking user input.

引数
array$arrArray to check.
戻り値
void

array The localization of the core.

から
1.5.5

functions.php1318 行目に定義があります。

◆ XH_convertPrintUrls()

XH_convertPrintUrls (   $pageContent)

Convert all internal URLs in a text to print URLs.

引数
string$pageContentSome HTML.
戻り値
string
から
1.6

functions.php2132 行目に定義があります。

◆ XH_convertToPrintUrl()

XH_convertToPrintUrl ( array  $matches)

Returns a single URL converted to a print URL, if appropriate. Serves as helper for

参照
XH_convertPrintUrls().
引数
array$matchesThe matches of a PREG.
戻り値
string
から
1.6

functions.php2107 行目に定義があります。

◆ XH_createLanguageFile()

XH_createLanguageFile (   $dst)

Copies default file, if actual language file is missing. Returns whether the language file exists afterwards.

引数
string$dstThe destination filename.
戻り値
bool
から
1.6
todo:
Remove handling of LANGconfigs, unless they won't get reintroduced.

functions.php1352 行目に定義があります。

◆ XH_debug()

XH_debug (   $errno,
  $errstr,
  $errfile,
  $errline 
)

Writes all recoverable PHP errors to $e.

引数
int$errnoLevel of the error.
string$errstrAn error message.
string$errfileFilename where error was raised.
int$errlineLine number where error was raised.

array The list of PHP errors formatted as HTML fragment.

戻り値
void

functions.php1252 行目に定義があります。

◆ XH_debugmode()

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:

  • 0: Turn off all error reporting
  • 1: Runtime errors except warnings
  • 2: Runtime errors
  • 3: Runtime errors + notices
  • 4: All errors except notices and warnings
  • 5: All errors except notices
  • 6: All errors

array The paths of system files and folders.

戻り値
boolean Whether error_reporting is enabled.
著者
Holger
から
1.0rc3

functions.php1192 行目に定義があります。

◆ XH_decodeJson()

XH_decodeJson (   $string)

Returns the JSON string decoded as PHP value.

引数
string$stringA JSON string.
戻り値
mixed

object The JSON codec.

から
1.6
todo:
Deprecate starting with 1.8.

functions.php2152 行目に定義があります。

◆ XH_encodeJson()

XH_encodeJson (   $value)

Returns the JSON representation of a value.

引数
mixed$valueA PHP value.
戻り値
string

object The JSON codec.

から
1.6
todo:
Deprecate starting with 1.8.

functions.php2170 行目に定義があります。

◆ XH_escapeCMSimpleScripting()

XH_escapeCMSimpleScripting ( array  $matches)

Escapes CMSimple scripting returned from a plugin call.

引数
array$matchesAn array of matches.
戻り値
string
から
1.6.6

functions.php261 行目に定義があります。

◆ XH_evaluateSinglePluginCall()

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$___expressionThe expression to evaluate.
戻り値
srting
から
1.6

functions.php242 行目に定義があります。

◆ XH_exit()

XH_exit (   $status = 0)

Exits the running script.

Simple wrapper for exit for testing purposes.

引数
mixed$statusA status message or code.
戻り値
void
から
1.6.2

functions.php2401 行目に定義があります。

◆ XH_finalCleanUp()

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$htmlThe 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.

戻り値
string
から
1.6

functions.php464 行目に定義があります。

◆ XH_findNextPage()

XH_findNextPage ( )

Finds the index of the next page.

戻り値
int

int The index of the current page. int The number of pages.

から
1.6.3

functions.php907 行目に定義があります。

◆ XH_findPreviousPage()

XH_findPreviousPage ( )

Finds the index of the previous page.

戻り値
int

int The index of the current page.

から
1.6.3

functions.php885 行目に定義があります。

◆ XH_formatDate()

XH_formatDate (   $timestamp)

Returns a timestamp formatted according to config and lang.

引数
int$timestampA UNIX timestamp.
戻り値
string

array The configuration of the core. array The localization of the core.

から
1.6.3

functions.php2547 行目に定義があります。

◆ XH_getLocatorModel()

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.

戻り値
array

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.

から
1.7

functions.php2786 行目に定義があります。

◆ XH_getPageURL()

XH_getPageURL (   $index)

Returns the full URL of a page.

引数
int$indexA valid page index.
戻り値
string

string The script name. array The page URLs.

から
1.7

functions.php2846 行目に定義があります。

◆ XH_getRootFolder()

XH_getRootFolder ( )

Returns the root (= installation) folder of the system.

戻り値
string

string The script name. string The current language.

から
1.6.2

functions.php2416 行目に定義があります。

◆ XH_helpIcon()

XH_helpIcon (   $tooltip)

Returns a help icon which displays a tooltip on hover.

引数
string$tooltipA tooltip in HTML.
戻り値
string HTML

array The paths of system files and folders. array The localization of the core.

から
1.6
todo:
Change the DIVs to SPANs and require the $tooltip to be an inline fragment (requires block level elements to be removed from all help texts–even $plugin_tx).

functions.php1927 行目に定義があります。

◆ XH_highlightSearchWords()

XH_highlightSearchWords ( array  $words,
  $text 
)

Highlights the search words in a text.

引数
array$wordsAn array of search words.
string$textA text.
戻り値
string HTML
から
1.6.5

functions.php2589 行目に定義があります。

◆ XH_hsc()

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$stringA string.
戻り値
string
から
1.5.8

functions.php2204 行目に定義があります。

◆ XH_includeVar()

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$_filenameA filename.
string$_varnameA variable name.
戻り値
mixed
から
1.6

functions.php2251 行目に定義があります。

◆ XH_isContentBackup()

XH_isContentBackup (   $filename,
  $regularOnly = true 
)

Returns whether a file is a content backup by checking the filename.

引数
string$filenameA filename.
string$regularOnlyWhether to check for regalur backup names only.
戻り値
bool
から
1.6

functions.php1949 行目に定義があります。

◆ XH_isInternalPath()

XH_isInternalPath (   $path)

Returns whether a path refers to a CMSimple index.php.

引数
string$pathA relative path.
戻り値
string
から
1.6

functions.php2049 行目に定義があります。

◆ XH_isInternalUrl()

XH_isInternalUrl (   $urlParts)

Returns whether a URL points to this CMSimple installation.

引数
string$urlPartsParts of an URL.
戻り値
bool
から
1.6

functions.php2086 行目に定義があります。

◆ XH_isLanguageFolder()

XH_isLanguageFolder (   $name)

Returns whether $name is a language folder.

引数
string$nameThe name to check.
戻り値
bool

array The paths of system files and folders.

から
1.6

functions.php1850 行目に定義があります。

◆ XH_lastJsonError()

XH_lastJsonError ( )

Returns whether an error has occurred during the last XH_decodeJSON().

戻り値
bool

object The JSON codec.

から
1.6
todo:
Deprecate starting with 1.8.

functions.php2187 行目に定義があります。

◆ XH_lockFile()

XH_lockFile (   $handle,
  $operation 
)

Implements portable advisory file locking.

For now it is just a simple wrapper around flock().

引数
resource$handleA file handle.
int$operationA lock operation (use LOCK_SH, LOCK_EX or LOCK_UN).
戻り値
bool
から
1.6.3

functions.php2574 行目に定義があります。

◆ XH_logMessage()

XH_logMessage (   $type,
  $module,
  $category,
  $description 
)

Appends a message to the log file, and returns whether that succeeded.

引数
string$typeA message type ("info", "warning", "error").
string$moduleA module name ("XH" or plugin name).
string$categoryA category.
string$descriptionA description.
戻り値
bool

array The paths of system files and folders.

から
1.6

functions.php1523 行目に定義があります。

◆ XH_mailform()

XH_mailform (   $subject = null)

Handles a mailform embedded in a CMSimple_XH page.

引数
string$subjectAn alternative subject field preset text instead of the subject default in localization.
戻り値
string HTML

array The configuration of the core.

から
1.6

functions.php2227 行目に定義があります。

◆ XH_message()

XH_message (   $type,
  $message 
)

Returns an HTML element formatted as message.

引数
string$typeThe type of message ('success', 'info', 'warning', 'fail').
string$messageA message format to print in an printf() style.
戻り値
string
から
1.6

functions.php1806 行目に定義があります。

◆ XH_numberSuffix()

XH_numberSuffix (   $count)

Returns a suffix for a language string key according to the number (singular, paucal or plural).

引数
int$countCount of the items.
戻り値
string
から
1.6

functions.php2278 行目に定義があります。

◆ XH_onShutdown()

XH_onShutdown ( )

Handles the shutdown of the script.

  • Unsets erroneously set password in session (backdoor mitigation).
  • Displays a message if a fatal error occurred.
戻り値
void

array The localization of the core.

から
1.6.3

functions.php2520 行目に定義があります。

◆ XH_plugins()

XH_plugins (   $admin = false)

Returns a list of all active plugins.

引数
bool$adminWhether to return only plugins with a admin.php
戻り値
array

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.

から
1.6
todo:

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.php1443 行目に定義があります。

◆ XH_pluginStylesheet()

XH_pluginStylesheet ( )

Returns the path of the combined plugin stylesheet. If necessary, this stylesheet will be created/updated.

戻り値
string

array The paths of system files and folders.

から
1.6

functions.php1707 行目に定義があります。

◆ XH_pluginURL()

XH_pluginURL (   $plugin)

Returns The link to a plugin download site.

One of the 3 functions to show "Site/CMS Info".

引数
string$pluginThe plugin name.
戻り値
string The URL

array The paths of system files and folders.

から
1.7

functions.php2743 行目に定義があります。

◆ XH_poweredBy()

XH_poweredBy ( )

Returns The content of the generated page "Site/CMS Info".

One of the 3 functions to show "Site/CMS Info".

戻り値
The HTML.

array The configuration of the core. array The language localization of the core. array The paths of system files and folders.

から
1.7

functions.php2687 行目に定義があります。

◆ XH_readConfiguration()

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$pluginWhether to return plugin information (opposed to core).
bool$languageWhether to return the language array (opposed to config).
戻り値
array

array The paths of system files and folders.

から
1.6

functions.php2304 行目に定義があります。

◆ XH_readContents()

XH_readContents (   $language = null)

Reads and parses a content file.

Returns an associative array containing the following information:

  • urls: The URLs of the pages.
  • too_long: Flags, whether URLs were too long.
  • headings: The headings of the pages.
  • levels: The menu levels of the pages.
  • pages: The contents of the pages.
  • pd_router: A page data router object.
  • removed: Flags whether pages are removed. Returns FALSE, if the file couldn't be read.
引数
string$languageThe 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.

戻り値
array
から
1.6

functions.php765 行目に定義があります。

◆ XH_readFile()

XH_readFile (   $filename)

Reads a file and returns its contents; false on failure. During reading, the file is locked for shared access.

引数
string$filenameA file path.
戻り値
string
から
1.6

functions.php1601 行目に定義があります。

◆ XH_redirectSelectedUrl()

XH_redirectSelectedUrl ( )

Returns the URL where to redirect selected GEt requests.

戻り値
string

string The value of the selected GP parameter.

から
1.7.0

functions.php2862 行目に定義があります。

◆ XH_registeredEditmenuPlugins()

XH_registeredEditmenuPlugins ( )

Returns the names of the registered editmenu plugins.

戻り値
array
から
1.6.2

functions.php2501 行目に定義があります。

◆ XH_registeredEditorPlugins()

XH_registeredEditorPlugins ( )

Returns the names of the registered editor plugins.

戻り値
array
から
1.6.2

functions.php2465 行目に定義があります。

◆ XH_registeredFilebrowserPlugins()

XH_registeredFilebrowserPlugins ( )

Returns the names of the registered filebrowser plugins.

戻り値
array
から
1.6.2

functions.php2477 行目に定義があります。

◆ XH_registeredPagemanagerPlugins()

XH_registeredPagemanagerPlugins ( )

Returns the names of the registered pagemanager plugins.

戻り値
array
から
1.6.2

functions.php2489 行目に定義があります。

◆ XH_registerPluginType()

XH_registerPluginType (   $type,
  $plugin = null 
)

Registers the type of a plugin resp. returns the registered plugins of a certain type.

引数
string$typeA plugin type ('editor', 'filebrowser', 'pagemanager', 'editmenu').
string$pluginA plugin name or null.
戻り値
mixed

array The registered plugins.

から
1.6.2

functions.php2441 行目に定義があります。

◆ XH_renameFile()

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$oldnameA filename.
string$newnameA filename.
戻り値
bool
から
1.6
todo:
Deprecate for 1.8.

functions.php2385 行目に定義があります。

◆ XH_rmws()

XH_rmws (   $str)

Returns $str with all (consecutive) whitespaces replaced by a single space.

引数
string$strA string.
戻り値
string
から
1.5.4

functions.php573 行目に定義があります。

◆ XH_secondLanguages()

XH_secondLanguages ( )

Returns the installed second languages in alphabetic order.

戻り値
array

array The paths of system files and folders.

array The language names cache.

から
1.6

functions.php2021 行目に定義があります。

◆ XH_spliceString()

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$stringThe string to manipulate.
int$offsetOffset of the string where to start the replacement.
int$lengthThe number of characters to be replaced.
string$replacementThe string to replace the removed characters.
戻り値
string The replaced characters.
から
1.6

functions.php285 行目に定義があります。

◆ XH_startSession()

XH_startSession ( )

Starts a named session.

If session is already started, nothing happens.

戻り値
void
から
1.7

functions.php2662 行目に定義があります。

◆ XH_templates()

XH_templates ( )

Returns an array of installed templates.

戻り値
array

array The paths of system files and folders.

から
1.6

functions.php1964 行目に定義があります。

◆ XH_title()

XH_title (   $site,
  $subtitle 
)

Returns the text content for a TITLE element.

引数
string$siteA site name.
string$subtitleA subtitle (e.g. the page heading).
戻り値
string
から
1.6

functions.php1869 行目に定義があります。

◆ XH_uenc()

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$sThe URL component.
array$searchStrings to search for.
array$replaceReplacement strings.
戻り値
string

array The configuration of the core.

参照
uenc()
から
1.6

functions.php1042 行目に定義があります。

◆ XH_unionOf2DArrays()

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$array1A "2-dimensional" array.
array$array2A "2-dimensional" array.
戻り値
array
から
1.6

functions.php2356 行目に定義があります。

◆ XH_writeFile()

XH_writeFile (   $filename,
  $contents 
)

Writes $contents to the file $filename. During writing the file is locked exclusively.

引数
string$filenameThe filename.
string$contentsThe content to write.
戻り値
int The number of bytes written, or false on failure.
から
1.6

functions.php1626 行目に定義があります。