Core

Following you'll find the kryn class. It contains static methods and variables which you can use to manipulate the current page (manipulate generated html, add css/js files), to get informations (like pages, contents, domains, current slot, theme properties) or to check the permission of your own defined ACLs.

 

Class kryn

Description

Kryn.core class

Located in /kryn.class.php (line 11)

baseModule
   |
   --kryn
Variable Summary
string kryn::$baseUrl
array kryn::$currentTheme
array kryn::$domain
array kryn::$page
string kryn::$pageHtml
array kryn::$publicProperties
array kryn::$slot
array kryn::$themeProperties
string kryn::$url
Method Summary
void kryn::addCss
void kryn::addHeader
void kryn::addJs
void kryn::addMenu
void kryn::bannUser
bool kryn::checkUrlAccess
bool kryn::compareVersion
string kryn::esc
string kryn::fileRead
void kryn::fileWrite
string kryn::getCache
array kryn::getDomain
void kryn::getDomainOfPage
array kryn::getModuleConfig
string kryn::getPageContent
array kryn::getPageContents
string kryn::getPhpCache
string kryn::pageUrl
array kryn::readFolder
string kryn::readTempFile
void kryn::redirect
void kryn::redirectToPage
void kryn::removeCache
void kryn::removePhpCache
void kryn::resetCss
void kryn::resetJs
void kryn::resizeImage
void kryn::sendMail
void kryn::setCache
void kryn::setPhpCache
string kryn::toModRewrite
void kryn::writeTempFile
Variables
string kryn::$baseUrl

Defines the current baseUrl (also use in html <header>)

  • access: public
array kryn::$currentTheme = array()

Contains the values of the properties from current theme.

Template: $currentTheme

  • access: public
array kryn::$domain

Contains the current domain with all information (as defined in the database system_domain)

  • access: public
array kryn::$page

Contains the current page with all information

  • access: public
string kryn::$pageHtml

Contains the complete builded HTML.

To change this, you can changed it on the destructor in your extension-class.

  • access: public
array kryn::$publicProperties = array()

Contains the values of the public properties from current theme.

Template: $publicProperties

  • deprecated: Use $themeProperties instead.
  • access: public
array kryn::$slot

Contains the current slot informations.

Items: index, maxItems, isFirst, isLast

  • access: public
array kryn::$themeProperties = array()

Contains the values of the properties from current theme.

Template: $themeProperties

  • access: public
string kryn::$url

Contains the current requested URL without http://, but filtered with ^a-Z0-9-/

  • access: public
Methods
kryn::addCss

Adds a new css file to the <header>. Use relative paths from inc/template without a / as start Absolute paths with http:// also possible.

  • access: public
static void addCss (string $pCss)
  • string $pCss
kryn::addHeader

Adds additional headers.

  • access: public
static void addHeader (string $pHeader)
  • string $pHeader
kryn::addJs

Adds a new javascript file to the <header>. Use relative paths from inc/template without a / as start

  • access: public
static void addJs (string $pJs)
  • string $pJs
kryn::addMenu

If you want to add own Page-Hierarchy-Item use Kryn::addMenu( $pName, $pUrl );

This array is use for

  • access: public
static void addMenu (string $pName, [string $pUrl = ""])
  • string $pName
  • string $pUrl
kryn::bannUser

Banns a user via IP

  • todo: implement
  • access: public
static void bannUser ()
kryn::checkUrlAccess

Checks the access to specified /admin pUrl.

  • access: public
static bool checkUrlAccess (string $pUrl, [array $pUser = false])
  • string $pUrl
  • array $pUser: If you want to use a other user object.
kryn::compareVersion

Function to compate two versions with a operator.

Max Version: 999.999.999 Min Version: 0.0.1

  • access: public
static bool compareVersion (string $pModuleVersion, string $pOp, string $pVersion)
  • string $pModuleVersion
  • string $pOp: <,<=,>,>=,=
  • string $pVersion
kryn::esc

Escape ' to \\' to use string in queries which uses ' as string delimiter.

  • return: Filtered string
  • deprecated: Use the global esc() instead
  • access: public
static string esc (string $pString)
  • string $pString
kryn::fileRead

Return the content of a file

  • access: public
static string fileRead (string $pPath)
  • string $pPath: Relative to installation dir
kryn::fileWrite

Writes content to a file

  • access: public
static void fileWrite (string $pPath, string $pContent)
  • string $pPath
  • string $pContent
kryn::getCache

Returns the content of the specified cache-key

  • access: public
static string getCache (string $pCode)
  • string $pCode
kryn::getDomain

Returns domain informations of the specified domain

  • access: public
static array getDomain (unknown_type $pDomainRsn)
  • unknown_type $pDomainRsn
kryn::getDomainOfPage

Returns the domain of the specified page

  • access: public
static void getDomainOfPage (integer $pRsn)
  • integer $pRsn: return integer
kryn::getModuleConfig

Returns the config hash of the specified extension.

  • return: All config values from the config.json
  • access: public
static array getModuleConfig (string $pModule)
  • string $pModule
kryn::getPageContent

Returns generated HTML of $pPageRsn.

$pIncludedRes: If true, Kryn includes also the proper css/js files: inc/template/css/_pages/<pPageRsn>.css and inc/template/js/_pages/<pPageRsn>.js

  • access: public
static string getPageContent (integer $pPageRsn, [bool $pIncludeRes = false])
  • integer $pPageRsn
  • bool $pIncludeRes: Defines whether the proper css and javascript files should also be included
kryn::getPageContents

Returns all contents of the slot of the specified page.

  • access: public
static array getPageContents (integer $pRsn, integer $pBoxId)
  • integer $pRsn
  • integer $pBoxId
kryn::getPhpCache

Gets the content of the specified cache-key

  • deprecated: Use getCache instead.
  • access: public
static string getPhpCache (string $pCode)
  • string $pCode
kryn::pageUrl

Returns the URL of the specified page

  • access: public
static string pageUrl ([integer $pRsn = 0], [bool $pDomainRsn = false], [boool $pWithoutHttp = false])
  • integer $pRsn
  • bool $pDomainRsn: With domain or without
  • boool $pWithoutHttp: With HTTP/S or without
kryn::readFolder

Reads all files of the specified folders.

  • access: public
static array readFolder (string $pPath, [bool $pWithExt = false])
  • string $pPath
  • bool $pWithExt: Return file extensions or not
kryn::readTempFile

Return the content of a template file.

  • access: public
static string readTempFile (string $pPath)
  • string $pPath: Path relative to inc/template/
kryn::redirect

Redirect the user to specified URL within the system.

Relative to the baseUrl.

  • access: public
static void redirect ([string $pUrl = ''])
  • string $pUrl
kryn::redirectToPage

Redirect the user to specified page

  • access: public
static void redirectToPage (integer $pRsn)
  • integer $pRsn
kryn::removeCache

Removes a value for the specified cache-key

  • access: public
static void removeCache (string $pCode)
  • string $pCode
kryn::removePhpCache

Removes the content of the specified cache-key

  • deprecated: Use removeCache instead.
  • access: public
static void removePhpCache (string $pCode)
  • string $pCode
kryn::resetCss

Resets all css files.

  • access: public
static void resetCss ()
kryn::resetJs

Resets all javascript files.

  • access: public
static void resetJs ()
kryn::resizeImage
  • access: public
static void resizeImage ( $pPath,  $pTarget,  $pResolution, [ $pFix = false])
  • $pPath
  • $pTarget
  • $pResolution
  • $pFix
kryn::sendMail

Sends a E-Mail in UTF-8

  • access: public
static void sendMail (string $pTo, string $pSubject, string $pBody, [string $pFrom = false])
  • string $pTo
  • string $pSubject
  • string $pBody
  • string $pFrom: If not set, the Email of the current domain is used. If both is not defined the scheme is info@<currentDomain>
kryn::setCache

Sets a content to the specified cache-key.

Kryn uses MemCache or PHP-Caching

  • access: public
static void setCache (string $pCode, string $pValue)
  • string $pCode
  • string $pValue
kryn::setPhpCache

Sets a content to the specified cache-key

  • deprecated: Use setCache instead.
  • access: public
static void setPhpCache (string $pCode, string $pValue)
  • string $pCode
  • string $pValue
kryn::toModRewrite

Convert a string to a mod-rewrite compatible string.

  • access: public
static string toModRewrite (string $pString)
  • string $pString
kryn::writeTempFile

Writes content to a template file

  • access: public
static void writeTempFile (string $pPath, string $pContent)
  • string $pPath
  • string $pContent

Inherited Methods

Inherited From baseModule

baseModule::admin()
baseModule::deinstall()
baseModule::getTitle()
baseModule::install()

Documentation generated on Tue, 18 Jan 2011 23:34:38 +0100 by phpDocumentor 1.4.3