/includes/mambo.php

Description
  • license: GNU/GPL Mambo is Free Software
  • copyright: (C) 2000 - 2005 Miro International Pty Ltd
  • version: $Id: mambo.php,v 1.45 2005/02/16 17:06:08 eddieajau Exp $
Classes
Class Description
mosCache Class to support function caching
mosMainFrame Mambo Mainframe class
mosComponent Component database table class
mosHTML Utility class for all HTML drawing classes
mosCategory Category database table class
mosSection Section database table class
mosContent Module database table class
mosMenu Module database table class
mosUser Users Table Class
mosTemplate Template Table Class
mosMambot Class mosMambot
mosModule Module database table class
mosSession Session database table class
mosProfiler Page generation time
mosMambotHandler Plugin handler
mosTabs Tab Creation handler
mosAdminMenus Common HTML Output Files
mosCommonHTML
mosAbstractTasker Task routing class
Includes
require_once ($mosConfig_absolute_path."/includes/phpmailer/class.phpmailer.php") (line 41)
require_once ($mosConfig_absolute_path."/includes/version.php") (line 37)
require_once ($mosConfig_absolute_path.'/includes/compat.php42x.php') (line 18)
require_once ($mosConfig_absolute_path."/includes/gacl.class.php") (line 39)
require_once ($mosConfig_absolute_path."/includes/database.php") (line 38)
require_once ($mosConfig_absolute_path."/includes/gacl_api.class.php") (line 40)
require_once ($mosConfig_absolute_path.'/includes/compat.php41x.php') (line 15)
require_once ($mosConfig_absolute_path."/includes/mamboxml.php") (line 42)
Constants
_MOS_ALLOWHTML = 0x0002 (line 1823)
_MOS_MAMBO_INCLUDED = 1 (line 12)

ensure this file is being included by a parent file

_MOS_NOTRIM = 0x0001 (line 1822)

Utility function to return a value from a named array or a specified default

Variables
mosPlugin $_MAMBOTS (line 4162)
Functions
ampReplace (line 4059)

Replaces & with & for xhtml compliance

Needed to handle unicode conflicts due to unicode conflicts

void ampReplace (mixed $text)
doGzip (line 2623)

Perform GZIP

void doGzip ()
html_entity_decode (line 2667)

html_entity_decode function for backward compatability in PHP

void html_entity_decode (string $string, [string $opt = ENT_COMPAT])
  • string $string
  • string $opt
initGzip (line 2587)

Initialise GZIP

void initGzip ()
mosBindArrayToObject (line 1874)

Copy the named array content into the object as properties

only existing properties of object are filled. when undefined in hash, properties wont be deleted

void mosBindArrayToObject (array $array, obj &$obj, [string $ignore = ""], [boolean $prefix = NULL], [mixed $checkSlashes = true])
  • array $array: the input array
  • obj &$obj: byref the object to fill of any class
  • string $ignore
  • boolean $prefix
mosChmod (line 4142)

Chmods files and directories recursively to mos global permissions. Available from 4.5.2 up.

  • return: succeeded FALSE=one or more chmods failed
TRUE=all mosChmod (path $path, filemode 1, dirmode 2)
  • filemode 1: Integer value to chmod files. NULL = dont chmod files.
  • dirmode 2: Integer value to chmod directories. NULL = dont chmod directories.
  • path $path: The starting file or directory (no trailing slash)
mosChmodRecursive (line 4106)

Chmods files and directories recursively to given permissions. Available from 4.5.2 up.

  • return: succeeded FALSE=one or more chmods failed
TRUE=all mosChmodRecursive (path $path, [filemode $filemode = NULL], [dirmode $dirmode = NULL])
  • path $path: The starting file or directory (no trailing slash)
  • filemode $filemode: Integer value to chmod files. NULL = dont chmod files.
  • dirmode $dirmode: Integer value to chmod directories. NULL = dont chmod directories.
mosCompressID (line 2451)
void mosCompressID (mixed $ID)
mosCreateGUID (line 2443)
void mosCreateGUID ()
mosCreateMail (line 2490)

Function to create a mail object for futher use (uses phpMailer)

  • return: object
object Mail mosCreateMail ([string $from = ''], [string $fromname = ''], string $subject, string $body)
  • string $from: From e-mail address
  • string $fromname: From name
  • string $subject: E-mail subject
  • string $body: Message body
mosCurrentDate (line 2395)

Returns current date according to current local and time offset

  • return: date
current mosCurrentDate ([string $format = ""])
  • string $format: format optional format for strftime
mosExpandID (line 2455)
void mosExpandID (mixed $ID)
mosFormatDate (line 2374)

Returns formated date according to current local and adds time offset

  • return: date
formated mosFormatDate (string $date, [string $format = ""], [offset $offset = ""])
  • string $date: date in datetime format
  • string $format: format optional format for strftime
  • offset $offset: time offset if different than global one
mosGetBrowser (line 2228)

Checks the user agent string against known browsers

void mosGetBrowser (mixed $agent)
mosGetOrderingList (line 2283)
void mosGetOrderingList (string $sql, [integer $chop = '30'])
  • string $sql: SQL with ordering As value and 'name field' AS text
  • integer $chop: The length of the truncated headline
mosGetOS (line 2266)

Checks the user agent string against known operating systems

void mosGetOS (mixed $agent)
mosGetParam (line 1824)
void mosGetParam (mixed &$arr, mixed $name, [mixed $def = null], [mixed $mask = 0])
mosMail (line 2538)

Mail function (uses phpMailer)

void mosMail (string $from, string $fromname, string/array $recipient, string $subject, string $body, [boolean $mode = 0], [string/array $cc = NULL], [string/array $bcc = NULL], [string/array $attachment = NULL])
  • string $from: From e-mail address
  • string $fromname: From name
  • string/array $recipient: Recipient e-mail address(es)
  • string $subject: E-mail subject
  • string $body: Message body
  • boolean $mode: false = plain text, true = HTML
  • string/array $cc: CC e-mail address(es)
  • string/array $bcc: BCC e-mail address(es)
  • string/array $attachment: Attachment file name(s)
mosMakeHtmlSafe (line 2323)

Makes a variable safe to display in forms

Object parameters that are non-string, array, object or start with underscore will be converted

void mosMakeHtmlSafe (object An &$mixed, [int $quote_style = ENT_QUOTES], [string|array $exclude_keys = ''])
  • object An &$mixed: object to be parsed
  • int $quote_style: The optional quote style for the htmlspecialchars function
  • string|array $exclude_keys: An optional single field name or array of field names not to be parsed (eg, for a textarea)
mosMakePassword (line 2651)

Random password generator

password mosMakePassword ()
mosMenuCheck (line 2347)

Checks whether a menu option is within the users access level

  • return: True if the visitor's group at least equal to the menu access
boolean mosMenuCheck (int $Itemid, string $menu_option, int $task, database $gid)
  • int $Itemid: Item id number
  • string $menu_option: The menu option
  • int $task: The users group ID number
  • database $gid: A database connector object
mosNotAuth (line 4045)

Displays a not authorised message

If the user is not logged in then an addition message is displayed.

void mosNotAuth ()
mosObjectToArray (line 2209)
void mosObjectToArray (mixed $p_obj)
mosPathName (line 1994)

Function to strip additional / or \ in a path name

void mosPathName (string $p_path, [boolean $p_addtrailingslash = true])
  • string $p_path: The path
  • boolean $p_addtrailingslash: Add trailing slash
mosPathWay (line 4035)
void mosPathWay ()
mosPrepareSearchContent (line 4074)

Prepares results from search for display

string mosPrepareSearchContent (string $text, [int $length = 200], string $searchword)
  • string $text: The source string
  • int $length: Number of chars to trim
  • string $searchword: The searchword to select around
mosReadDirectory (line 1907)

Utility function to read the files in a directory

void mosReadDirectory (string $path, [string $filter = '.'], [boolean $recurse = false], [boolean $fullpath = false])
  • string $path: The file system path
  • string $filter: A filter for the names
  • boolean $recurse: Recurse search into sub-directories
  • boolean $fullpath: True if to prepend the full path to the file name
mosRedirect (line 1943)

Utility function redirect the browser location to another url

Can optionally provide a message.

void mosRedirect (string $url, [string $msg = ''])
  • string $url: The file system path
  • string $msg: A filter for the names
mosSendAdminMail (line 4023)

Sends mail to admin

void mosSendAdminMail (mixed $adminName, mixed $adminEmail, mixed $email, mixed $type, mixed $title, mixed $author)
mosSmartSubstr (line 4089)

returns substring of characters around a searchword

string mosSmartSubstr (string $text, [int $length = 200], string $searchword)
  • string $text: The source string
  • int $length: Number of chars to return
  • string $searchword: The searchword to select around
mosStripslashes (line 1848)

Strip slashes from strings or arrays of strings

void mosStripslashes (value &$value)
  • value &$value: the input string or array
mosToolTip (line 2410)

Utility function to provide ToolTips

  • return: code for ToolTip
HTML mosToolTip (string $tooltip, [string $title = ''], [mixed $width = ''], [mixed $image = 'tooltip.png'], [mixed $text = ''], [mixed $href = '#'])
  • string $tooltip: ToolTip text
  • string $title: Box title
mosTreeRecurse (line 1961)
void mosTreeRecurse (mixed $id, mixed $indent, mixed $list, mixed &$children, [mixed $maxlevel = 9999], [mixed $level = 0], [mixed $type = 1])
mosWarning (line 2437)

Utility function to provide Warning Icons

  • return: code for Warning
HTML mosWarning (string $warning, [string $title = 'Mambo Warning'])
  • string $warning: Warning text
  • string $title: Box title
SortArrayObjects (line 4007)

Sorts an Array of objects

sort_direction [1 = Ascending] [-1 = Descending]

void SortArrayObjects (mixed &$a, mixed $k, [mixed $sort_direction = 1])
SortArrayObjects_cmp (line 3989)

Sorts an Array of objects

void SortArrayObjects_cmp (mixed &$a, mixed &$b)

Documentation generated on Fri, 4 Mar 2005 13:56:26 +1000 by phpDocumentor 1.3.0RC3