Absolut Engine PHP Cross Reference Web Portal Systems

Source: /docs/admin-classengine.php.html - 102 lines - 14176 bytes - Text - Print

   1  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   2      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   3  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   4  
   5  <head>
   6  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
   7  <meta name="licence" content="GNU General Public Licence" />
   8  <meta name="robots" content="all" />
   9  <title>Documentation: class CEngine extends CAuth
  10  </title>
  11  <style type="text/css">@import "styles.css";</style>
  12  </head>
  13  
  14  <body><h1>class CEngine extends CAuth
  15  </h1><a href="index.html">^ INDEX</a><br /><a name="TOC-MAIN"></a><h1>Table of contents</h1><a href="#fmod">fmod</a><br /><a href="#AddFormError">AddFormError</a><br /><a href="#AddRewriteRule">AddRewriteRule</a><br /><a href="#CEngine">CEngine</a><br /><a href="#CheckFormErrors">CheckFormErrors</a><br /><a href="#CreateCleanURL">CreateCleanURL</a><br /><a href="#DateConversion">DateConversion</a><br /><a href="#DeleteCleanURL">DeleteCleanURL</a><br /><a href="#DeleteFile">DeleteFile</a><br /><a href="#DeleteImage">DeleteImage</a><br /><a href="#DeletePhysicalFile">DeletePhysicalFile</a><br /><a href="#DeleteRewriteRule">DeleteRewriteRule</a><br /><a href="#DisplayEngineModuleParts">DisplayEngineModuleParts</a><br /><a href="#DisplayError">DisplayError</a><br /><a href="#EngineInfo">EngineInfo</a><br /><a href="#EngineInitialize">EngineInitialize</a><br /><a href="#ExecuteHook">ExecuteHook</a><br /><a href="#FileError">FileError</a><br /><a href="#GenerateFilename">GenerateFilename</a><br /><a href="#GeneratePhysicalFile">GeneratePhysicalFile</a><br /><a href="#GetThumbnailName">GetThumbnailName</a><br /><a href="#InsertCleanURL">InsertCleanURL</a><br /><a href="#InstallHooks">InstallHooks</a><br /><a href="#InstallSQL">InstallSQL</a><br /><a href="#LookUpCleanURL">LookUpCleanURL</a><br /><a href="#PrintDebugText">PrintDebugText</a><br /><a href="#PublicInitialize">PublicInitialize</a><br /><a href="#ReadHtaccess">ReadHtaccess</a><br /><a href="#RedirectOnError">RedirectOnError</a><br /><a href="#RequestLanguageVersions">RequestLanguageVersions</a><br /><a href="#RequestVariables">RequestVariables</a><br /><a href="#RetrieveModules">RetrieveModules</a><br /><a href="#SaveTempData">SaveTempData</a><br /><a href="#SerializeObject">SerializeObject</a><br /><a href="#SetHook">SetHook</a><br /><a href="#SubmitFile">SubmitFile</a><br /><a href="#SubmitImage">SubmitImage</a><br /><a href="#UninstallHooks">UninstallHooks</a><br /><a href="#UninstallSQL">UninstallSQL</a><br /><a href="#UnserializeObject">UnserializeObject</a><br /><a href="#WYSIWYGtoXHTML">WYSIWYGtoXHTML</a><br /><a href="#WriteHtaccess">WriteHtaccess</a><br /><p class="text"></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="fmod"></a><h2>      fmod($x,$y)
  16  </h2><p class="text"></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="AddFormError"></a><h2>   AddFormError($message)
  17  </h2><p class="text">Add form error to queue</p><p class="param">string variable name</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="AddRewriteRule"></a><h2>   AddRewriteRule($elementID,$type="showarticle.php?articleID",$prefix="",$suffix="")
  18  </h2><p class="text">Generate .htaccess file (with new rules) if $cleanurls is set to 2</p><p class="param">integer $elementID ID of element<br />
  19  string $prefix string to prefix clean URL with<br />
  20  string $suffix string to suffix clean URL with</p><p class="todo">TO-DO:!!!! test whether syndication is enabled and section is part of the central website<br />
  21  if not return and do not create rule!!!</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="CEngine"></a><h2>   CEngine()
  22  </h2><h3>absolutengine
  23  </h3><p class="text">Core engine class / base functions<br />
  24  <br />
  25  Constructor<br />
  26  Set all variables</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="CheckFormErrors"></a><h2>   CheckFormErrors()
  27  </h2><p class="text">Check for form errors (if manadatory fields have been filled)<br />
  28  unlimited number of parameters available, parameters should contain variable name<br />
  29  to check (e.g. title, sectionID, etc...)</p><p class="param">mixed ,...</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="CreateCleanURL"></a><h2>   CreateCleanURL($input)
  30  </h2><p class="text">Create clean URL based on input string</p><p class="param">string $input string to create valid clean URL from</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="DateConversion"></a><h2>   DateConversion($adate,$direction=1)
  31  </h2><p class="text">Perform date conversion from custom date format (set in settings.php) to MySQL date format and back</p><p class="param">string $adate date to be converted<br />
  32  integer $direction to DB = 1, to form = 2</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="DeleteCleanURL"></a><h2>   DeleteCleanURL($url)
  33  </h2><p class="text">Delete clean URL from clean URLs pool</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="DeleteFile"></a><h2>   DeleteFile($file)
  34  </h2><p class="text">Delete a file</p><p class="param">$file filename</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="DeleteImage"></a><h2>   DeleteImage($file,$path)
  35  </h2><p class="text">Delete image and its thumbnail</p><p class="param">string $file image filename</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="DeletePhysicalFile"></a><h2>   DeletePhysicalFile($articleID)
  36  </h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
  37  </p><p class="text">Deletes physical files from articles if $cleanurls set to 1<br />
  38  If you server support Apache mod_rewrite module, use $cleanurls=2 instead!</p><p class="todo">TO-DO:prepare some static URL schema use - $cleanurls=3 in future</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="DeleteRewriteRule"></a><h2>   DeleteRewriteRule($elementID,$table="",$type="showarticle.php?articleID",$prefix="",$suffix="")
  39  </h2><p class="text">Delete rewrite rule for element</p><p class="param">integer $elementID ID of element to be deleted<br />
  40  string $table table where to search for the filename, if empty article table is assumed<br />
  41  string $prefix string to prefix clean URL with<br />
  42  string $suffix string to suffix clean URL with</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="DisplayEngineModuleParts"></a><h2>   DisplayEngineModuleParts()
  43  </h2><p class="text">Display parts of the pages (boxes) that should be added to the currently visited page<br />
  44  Modules are able to insert their parts (forms, boxes, DB listings) into other parts of the system</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="DisplayError"></a><h2>   DisplayError($errorcode=0,$stop=0,$moduledir="")
  45  </h2><p class="text">Display error message and optionally stop execution of the script</p><p class="param">boolean $stop 0 to continue with script execution, otherwise 1 to stop/exit<br />
  46  string $required "title,sectionID" - comma delimited list of mandatory fields<br />
  47  string moduledir - when called from module, state module directory</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="EngineInfo"></a><h2>   EngineInfo()
  48  </h2><p class="text">Display basic information about Absolut Engine</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="EngineInitialize"></a><h2>   EngineInitialize()
  49  </h2><p class="text">Initialize engine<br />
  50  Connect to database and select user language</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="ExecuteHook"></a><h2>   ExecuteHook()
  51  </h2><p class="text">Execute currently set hook</p><p class="see">SEE: <a href="#SetHook">SetHook()</a></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="FileError"></a><h2>   FileError()
  52  </h2><p class="text">Check for file handling error and stop the script on failure</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GenerateFilename"></a><h2>   GenerateFilename($filename,$path)
  53  </h2><p class="text">Generate filename for file upload purposes<br />
  54  if filename exists, add -X, where X is previous existinf file number</p><p class="param">string $filename original filename<br />
  55  string $path filepath (relative to admin/ directory)</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GeneratePhysicalFile"></a><h2>   GeneratePhysicalFile($articleID)
  56  </h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
  57  </p><p class="text">Genereates physical files from articles if $cleanurls set to 1<br />
  58  If you server support Apache mod_rewrite module, use $cleanurls=2 instead!</p><p class="todo">TO-DO:prepare some static URL schema use - $cleanurls=3 in future</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetThumbnailName"></a><h2>   GetThumbnailName($file)
  59  </h2><p class="text">Create thumbnail name from image name</p><p class="param">string $file image name</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="InsertCleanURL"></a><h2>   InsertCleanURL($url)
  60  </h2><p class="text">Insert clean URL in clean URLs pool</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="InstallHooks"></a><h2>   InstallHooks($moduledir="")
  61  </h2><p class="text">Install hooks for the module entered, if no module, then core hooks ???</p><p class="param">string module module directory</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="InstallSQL"></a><h2>   InstallSQL($moduledir="")
  62  </h2><p class="text">Install system.sql for the module entered, if no module, then core system.sql</p><p class="param">string module module directory</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="LookUpCleanURL"></a><h2>   LookUpCleanURL($url)
  63  </h2><p class="text">Look into clean URLs pool to check if URL exists</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="PrintDebugText"></a><h2>   PrintDebugText($text)
  64  </h2><p class="text">Print debug text</p><p class="param">$text message to be printed</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="PublicInitialize"></a><h2>   PublicInitialize()
  65  </h2><p class="text"></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="ReadHtaccess"></a><h2>   ReadHtaccess()
  66  </h2><p class="text">Open and read .htaccess file for further processing by AddRewriteRule, DeleteRewriteRule etc.<br />
  67  if $cleanurls is set to 2</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="RedirectOnError"></a><h2>   RedirectOnError($objectID)
  68  </h2><p class="text">Redirect user on error back to form page (e.g. missing form field etc.)</p><p class="param">integer $objectID ID of temporary object to put into URL</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="RequestLanguageVersions"></a><h2>   RequestLanguageVersions()
  69  </h2><p class="text">Create array of system message translations available</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="RequestVariables"></a><h2>   RequestVariables($mode=0)
  70  </h2><p class="text"></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="RetrieveModules"></a><h2>   RetrieveModules($requestedmodules="")
  71  </h2><p class="text">BUGGY - memery being exhausted sometimes when using:<br />
  72  $text[$i]=strtolower($text[$i]);<br />
  73  HACK for the strtolower<br />
  74  <br />
  75  UNFINISHED: Post-processing - double breaks are converted to paragraphs<br />
  76  $text=str_replace('<br /><br />','</p><p>',$text);<br />
  77  paragraph counting is done to ensure both opening and closing tags are present<br />
  78  <br />
  79  Searches for modules available in the system<br />
  80  if empty, then traverse the module directory to fetch all modules</p><p class="param">array $requestedmodules requested modules for (un)installation (directory name)</p><p class="todo">TO-DO:@todo: complete paragraph counting with stack and jumps</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="SaveTempData"></a><h2>   SaveTempData($tempstring)
  81  </h2><p class="text">Save temporary data to table temporary</p><p class="param">string $tempstring temporary data</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="SerializeObject"></a><h2>   SerializeObject($object)
  82  </h2><p class="text">Serialize object for saving to database<br />
  83  used for keeping serialized copy of object for checking errors<br />
  84  when form error is encountered, use header to send back</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="SetHook"></a><h2>   SetHook($hook)
  85  </h2><p class="text">Set hook</p><p class="param">string $hook hook to set</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="SubmitFile"></a><h2>   SubmitFile($file,$filenametmp,$size)
  86  </h2><p class="text">Upload file</p><p class="param">string $file original filename of the file to be uploaded<br />
  87  string $filenametmp temporary filename created by server during upload<br />
  88  integer $size size in bytes for maxsize check</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="SubmitImage"></a><h2>   SubmitImage($file,$filenametmp,$filetype,$size,$path="")
  89  </h2><p class="text">Upload image, create thumbnail from image</p><p class="param">string $file original filename of the file to be uploaded<br />
  90  string $filenametmp temporary filename created by server during upload<br />
  91  string $filetype filetype of image (GIF/PNG/JPEG)<br />
  92  integer $size size in bytes for maxsize check</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="UninstallHooks"></a><h2>   UninstallHooks($moduledir="")
  93  </h2><p class="text">Uninstall hooks for the module entered, if no module, then core hooks ???</p><p class="param">string module module directory</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="UninstallSQL"></a><h2>   UninstallSQL($moduledir="")
  94  </h2><p class="text">Uninstall database tables for the module entered, if no module, then core tables</p><p class="param">string module module directory</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="UnserializeObject"></a><h2>   UnserializeObject($object)
  95  </h2><p class="text">Serialize object for saving to database<br />
  96  used for keeping serialized copy of object for checking errors<br />
  97  when form error is encountered, use header to send back</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="WYSIWYGtoXHTML"></a><h2>   WYSIWYGtoXHTML($text)
  98  </h2><p class="text">Cleans up the HTML code created by WYSIWYG editor (Richt text editor)<br />
  99  Tries to make the code XHTML 1.0 Strict (web standards compliant)</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="WriteHtaccess"></a><h2>   WriteHtaccess()
 100  </h2><p class="text">Write content to and close .htaccess file<br />
 101  if $cleanurls is set to 2</p><p><a href="#TOC-MAIN">^ Top</a></p></body>
 102  </html>

title

Description

title

Description

title

Description

title

title

Body