Tina4Stack  v1.0.1
The Tina4 Stack
Kim Class Reference

Public Member Functions

 __construct ()
 
 getDefaultPage ($pageName)
 
 createDatabase ()
 
 getCallParams ($input)
 
 parseValue ($search, $value, $template)
 
 getTemplate ($template, $data="")
 
 parseTemplate ($template, $data="", $nullVars=true)
 
 getPageTemplate ($title="Default")
 
 getSubMenus ($menuId=0, $systemMenu=1)
 
 getMenuList ($parentId=0, $systemMenu=1)
 
 getMenu ($parentId=0, $systemMenu=1)
 
 getInsertMenuItemForm ()
 
 insertMenuItem ()
 
 deleteMenuItem ()
 
 updateMenuItem ()
 
 getMenuItemForm ($menuId)
 
 getMenuTree ($filter="where parent_id = 0 and menu_id <> 0", $menuId=0)
 
 getUserList ($filter="")
 
 getMenuCreator ()
 
 getUsers ()
 
 getUserTypes ()
 
 getRouteTarget ($recordValue=null, $fieldName)
 
 getRoutes ()
 
 cacheRoutes ()
 
 loadDefines ()
 
 loadRoutes ()
 
 getGlobalSettings ()
 
 getFlushXCache ()
 
 getLogin ()
 
 authenticate ()
 
 getUserRecord ($userId=0)
 
 getProfileUpdate ()
 
 updatePOST ()
 
 matchConditions ($string)
 
 sortConditions ($originalString, $matches)
 
 matchSwitchConditions ($string)
 
 sortSwitchConditions ($originalString, $matches)
 
 getEditor ($recordValue=null, $fieldName)
 
 getContent ($contentId="0")
 
 getContentEditor ()
 
 display ()
 

Public Attributes

 $createDB
 
 $KIM
 
 $defaultPages = ["index.html", "index.php", "home.html"]
 
 $defaultExtensions = [".html", ".php"]
 
 $varRegex = '/{([a-zA-Z0-9\_\->\[\]\"\|\'\(\)\$]+)}/i'
 

Detailed Description

Kim is a class to handle the menu driven roles and routes for Tina4 http://localhost:12345/dokuwiki/kim

Constructor & Destructor Documentation

Kim::__construct ( )

Create a database connection for Kim to use.

Check if we need to be creating the database for the menus

Member Function Documentation

Kim::authenticate ( )
Kim::cacheRoutes ( )
Kim::createDatabase ( )

Function to create the tables for Kim to be used with roles, routes, menus

Kim::deleteMenuItem ( )
Kim::display ( )

Determines whether to show login screen etc.

Kim::getCallParams (   $input)

This is an string of variables in the form var1,var2 or enclosed in quotes "var1","var2"

Parameters
type$input
Returns
string
Kim::getContent (   $contentId = "0")
Kim::getContentEditor ( )

This code returns a grid for editing WYSIWYG content.

Returns
type
Kim::getDefaultPage (   $pageName)

Gets the default page to display where possible which will be found under assets

Parameters
String$pageNameThe page to try and load or the path to load
Returns
type
Kim::getEditor (   $recordValue = null,
  $fieldName 
)
Kim::getFlushXCache ( )

The function which flushes the XCache

Returns
String Message to indicate whether the cache has been cleared or not.
Kim::getGlobalSettings ( )
Kim::getInsertMenuItemForm ( )
Returns
string
Kim::getLogin ( )

Function for the login screen

Kim::getMenu (   $parentId = 0,
  $systemMenu = 1 
)
Kim::getMenuCreator ( )
Returns
type
Kim::getMenuItemForm (   $menuId)
Parameters
type$menuId
Kim::getMenuList (   $parentId = 0,
  $systemMenu = 1 
)
Kim::getMenuTree (   $filter = "where parent_id = 0 and menu_id <> 0",
  $menuId = 0 
)
Kim::getPageTemplate (   $title = "Default")

Return default bootstrap page

Kim::getProfileUpdate ( )
Kim::getRoutes ( )
Kim::getRouteTarget (   $recordValue = null,
  $fieldName 
)
Kim::getSubMenus (   $menuId = 0,
  $systemMenu = 1 
)
Kim::getTemplate (   $template,
  $data = "" 
)

The template parser of kim is quite important for rendering content, she takes a string of template and optionally record / object / array of data to use for parsing. A template may contain PHP code for whatever reason.

//default language is as follows

{variable}

Use of this is for when you have a variable in PHP and you want to display it. This will check defines etc

{OBJECT}

This is normally provided from the DATA parameter and will be parsed first.

{{Kim:phpinfo?1}} //call the Kim object phpinfo method, with first variable = 1

{{call:substr?test,1,2}} //call substr with variable params, this should return "es"

{{call:substr?"I am first, user's pet",1,2}} //call substr with params which have commas in

{{include:/path/to/file}} //This will include a kim file and parse it

Parameters
type$templatea string template of content
type$data- an array or object to itterate through with data for parsing
Kim::getUserList (   $filter = "")
Kim::getUserRecord (   $userId = 0)
Kim::getUsers ( )
Returns
type
Kim::getUserTypes ( )
Kim::insertMenuItem ( )
Kim::loadDefines ( )
Kim::loadRoutes ( )
Kim::matchConditions (   $string)
Parameters
type$string
Returns
array
Kim::matchSwitchConditions (   $string)

Match switch conditions

Parameters
type$string
Returns
array
Kim::parseTemplate (   $template,
  $data = "",
  $nullVars = true 
)

This section here needs to be updated if there are strange characters that get passed into the system via snippet calls in the templae

Kim::parseValue (   $search,
  $value,
  $template 
)
Kim::sortConditions (   $originalString,
  $matches 
)
Parameters
type$originalString
type$matches
Returns
type
Kim::sortSwitchConditions (   $originalString,
  $matches 
)

Sort Switch cases and convert to If-Else Statement

Parameters
type$originalString
type$matches
Returns
type
Kim::updateMenuItem ( )
Kim::updatePOST ( )

Member Data Documentation

Kim::$createDB
Kim::$defaultExtensions = [".html", ".php"]
Kim::$defaultPages = ["index.html", "index.php", "home.html"]
Kim::$KIM
Kim::$varRegex = '/{([a-zA-Z0-9\_\->\[\]\"\|\'\(\)\$]+)}/i'

The documentation for this class was generated from the following file: