dev.obliquid.com: obliquid
[ class tree: obliquid ] [ index: obliquid ] [ all elements ]

Class: core

Source Location: Program_Root/classes/obliquid/core.php

Class Overview


implements some common functionalities needed by module core


Methods


Inherited Variables

Inherited Methods


Class Details

[line 32]
implements some common functionalities needed by module core





[ Top ]


Class Methods


method addPage [line 191]

true addPage( $name $name, $tpl $tpl, $frame $frame, $module $module)

Adds a local page. Input data is already checked and supposed correct.

If the local page doesn't have a common page is created empty, otherwise the common page is created in the local directory tree.




Tags:

return:  in case of successful creation, false otherwise


Parameters:

$name   $name   page name
$tpl   $tpl   tells if the frame template is common or local
$frame   $frame   name of the frame
$module   $module   name of an existing module

[ Top ]

method checkIds [line 43]

true checkIds( $idents $idents)

checks that the given strings are valid identifiers.

A valid identifier must be composed of lower case letters, underscore, numbers in any order. Perl Regular expression used is "/^[a-z0-9_]*$/"




Tags:

return:  if all identifiers are valid, false if at least one is not valid


Parameters:

$idents   $idents   an index array of identifiers

[ Top ]

method getPage [line 275]

void &getPage( mixed $name)

getPage returns an associative array with page attributes

Returns: Array([NAME] => core_configparms [TPL] => common [FRAME] => frame [GROUP] => core //module [is_common] => true //page is common or local [has_common] => true //true if common page exists, false otherwise [fname] => "home" //pagexml file, without extension [SLOT] => Array ( [0] => Array ( [NAME] => core/nav [NAME_PHP] => [NAME_TPL] => [PHP] => common [TPL] => common [FRAME] => frame [POSITION] => center1 [BLOCK] => none [FUNCTION"] => signup (optional) ) )






[ Top ]

method moduleList [line 559]

an moduleList( )

Returns an index array with a list of modules



Tags:

return:  index array, each item in it is an array with id_module in position 0 and name in position 1


[ Top ]

method pageComment [line 58]

string pageComment( $pagename $pagename, [$is_common $is_common = true])

Gets the page comment for a page in the db.

The comment is in the db table page.




Tags:

return:  the comment for the page or the string " "


Parameters:

$pagename   $pagename   string name of a page
$is_common   $is_common   boolean tells if to look for the local or common comment

[ Top ]

method pageInfo [line 228]

void pageInfo( mixed $name)

Returns an associative array with information about the page

[module] => "core" page module [fname] => "home" filename, without extension [is_common] => true true if the page is common [has_common] => false true if common page exists, false otherwise [path] => "common/pagexml/core/home.xml" full pathname






[ Top ]

method pageList [line 111]

an &pageList( [$fgroup $fgroup = ""])

Returns informations about common and local pages



Tags:

return:  index array with four members: 1) $plist an array with an associative array with pages names, each element of this array is an index array with slot names (slot names may be repeated even inside the same pages, pages cannot be repeated). Example: array("core_newpage" => array("core/newpage", "core/nav"), ...) 2) $frame an associative array with FRAME attributes Example: array("core_newpage" => "frame", ...) 3) $tpl an associative array with TPL attributes Example: array("core_newpage" => "common", ...) 4) $is_common an associative array telling if a page is common Example: array("core_newpage" => true, ...)


Parameters:

$fgroup   $fgroup   extracts only pages belonging to module $fgroup (string)

[ Top ]

method pageProcess [line 363]

getPage &pageProcess( $fpage $fpage, $function $function, [$args $args = array()])

Base function for page processing functions.

Function: addPage adds a page Example: pageProcess("", "addPage", array(array("NAME" => "cal_home2", "TPL" => "common", "GROUP" => "cal", "FRAME" => "frame")));

Function: modPage modifies page attributes. $args array must contain all page attributes (NAME, TPL, GROUP, FRAME), even if modifying only one of them. Example: pageProcess("home", "modPage", array("NAME" => "home2", "TPL" => "common", "GROUP" => "home", "FRAME" => "frame"));

Function: delSlot deletes a slot of the specified page in the position in the first element of $args array. ATTENTION: the first slot is slot 1, not 0 to avoid problems passing 0 in url parameters Example: pageProcess("home", "delSlot", array("2"));

Function: addSlot adds a slot to the specified page Example: pageProcess("home", "addSlot", array("NAME" => "core/nav", "NAME_PHP" => "", "NAME_TPL" => "", "PHP" => "local", "TPL" => "local", "POSITION" => "left3", "BLOCK" => "title"))

Function: modSlot modifies a slot. If an attribute doesn't exist in the associative array, it won't be modified. If it exists it will be modified. If it is empty it will be deleted. Example: pageProcess("home", "modSlot", array("SLOTORD" => 2, "NAME" => "core/nav", "NAME_PHP" => "", "NAME_TPL" => "", "PHP" => "local", "TPL" => "local", "POSITION" => "left3", "BLOCK" => "title"))




Tags:

return:  returns an associative array with page attributes (NAME, TPL, FRAME, GROUP, SLOT) where each element is a simple string except for SLOT that is an index array with each element is an associative array with keys NAME, PHP, TPL, POSITION


Parameters:

$fpage   $fpage   - string page to be processed
$function   $function   - which function must be performed any of getPage*, addPage, modPage*, delSlot*
$args   $args   - an optional array of arguments

[ Top ]

method slotComment [line 86]

string &slotComment( $slotname $slotname)

Gets the slot comment



Tags:

return:  - slot comment


Parameters:

$slotname   $slotname   string full slot name (ex. core/dbdoc)

[ Top ]

method write_mb [line 538]

true write_mb( $fname $fname, $dbname $dbname, $newdb $newdb, $tprefix $tprefix)

Writes a Metabase XML configuration file with variable replacement.

It's used in setup and in dev/dumpdb.




Tags:

return:  in case of success, false in case of failure


Parameters:

$fname   $fname   template file name
$dbname   $dbname   database name
$newdb   $newdb   0/1 boolean value telling if a new db has to be created or not
$tprefix   $tprefix   table prefix

[ Top ]


Documentation generated on Tue, 29 Mar 2005 09:03:43 -0800 by phpDocumentor 1.2.0rc2