File/utilities/functions.php

Description
Constants
_MOS_ALLOWHTML = 0x0002 (line 16)
_MOS_ALLOWRAW = 0x0004 (line 17)
_MOS_NOTRIM = 0x0001 (line 15)
Functions
ampReplace (line 127)

Replaces & with & for xhtml compliance

Needed to handle unicode conflicts due to unicode conflicts

  • since: 1.0
void ampReplace (mixed $text)
html_entity_decode (line 535)

html_entity_decode function for backward compatability in PHP

void html_entity_decode (string $string, [string $opt = ENT_COMPAT])
  • string $string
  • string $opt
josErrorAlert (line 239)
void josErrorAlert (mixed $text, [mixed $action = 'window.history.go(-1);'], [mixed $mode = 1])
josMail (line 573)

Mail function (uses phpMailer)

  • return: True on success
  • since: 1.1
boolean josMail (string $from, string $fromname, mixed $recipient, string $subject, string $body, [boolean $mode = 0], [mixed $cc = null], [mixed $bcc = null], [mixed $attachment = null], [mixed $replyto = null], [mixed $replytoname = null])
  • string $from: From e-mail address
  • string $fromname: From name
  • mixed $recipient: Recipient e-mail address(es)
  • string $subject: E-mail subject
  • string $body: Message body
  • boolean $mode: false = plain text, true = HTML
  • mixed $cc: CC e-mail address(es)
  • mixed $bcc: BCC e-mail address(es)
  • mixed $attachment: Attachment file name(s)
  • mixed $replyto: Reply to email address(es)
  • mixed $replytoname: Reply to name(s)
josRedirect (line 197)

Utility function redirect the browser location to another url

  • since: 1.0
void josRedirect (string $url, [string $msg = ''])
  • string $url: The URL to redirect to
  • string $msg: A message to display on redirect
josSendAdminMail (line 640)

Sends mail to administrator for approval of a user submission

  • return: True on success
  • since: 1.1
boolean josSendAdminMail (string $adminName, string $adminEmail, string $email, string $type, string $title, string $author, [mixed $url = null])
  • string $adminName: Name of administrator
  • string $adminEmail: Email address of administrator
  • string $email: [NOT USED TODO: Deprecate?]
  • string $type: Type of item to approve
  • string $title: Title of item to approve
  • string $author: Author of item to approve
josURL (line 673)

Method to process internal Joomla URLs

  • since: 1.1
void josURL (string $url, [int $ssl = 0], [int $sef = 1])
  • string $url: Absolute or Relative URL to Joomla resource
  • int $ssl: Secure state for the processed URL 1: Make URL secure using global secure site URL 0: Leave URL in the same secure state as it was passed to the function -1: Make URL unsecure using the global unsecure site URL
  • int $sef: Search engine friendly state for the processed URL 1: Make URL search engine friendly 0: Leave URL in the same sef state as it was passed to the function
mosArrayToInts (line 783)

Function to convert array to integer values

  • since: 1.0
array mosArrayToInts (array &$array, [int $default = null])
  • array &$array
  • int $default: A default value to assign if $array is not an array
mosBackTrace (line 267)

Format a backtrace error

  • since: 1.1
void mosBackTrace ()
mosBindArrayToObject (line 149)

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

  • since: 1.0
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
mosCompressID (line 509)
void mosCompressID (mixed $ID)
mosCreateGUID (line 501)
void mosCreateGUID ()
mosCurrentDate (line 434)

Returns current date according to current local and time offset

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

Returns formated date according to current local and adds time offset

  • return: date
  • since: 1.0
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
mosGetOrderingList (line 330)
  • since: 1.0
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
mosGetParam (line 29)

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

void mosGetParam (array &$arr, string $name, [mixed $def = null], [int $mask = 0])
  • array &$arr: A named array
  • string $name: The key to search for
  • mixed $def: The default value to give if no key found
  • int $mask: An options mask: _MOS_NOTRIM prevents trim, _MOS_ALLOWHTML allows safe html, _MOS_ALLOWRAW allows raw input
mosHash (line 525)

Provides a secure hash based on a seed

  • since: 1.0
string mosHash (string $seed)
  • string $seed: Seed string
mosMakeHtmlSafe (line 103)

Makes a variable safe to display in forms

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

  • since: 1.0
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)
mosMenuCheck (line 371)

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
  • since: 1.0
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 287)

Displays a not authorised message

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

  • since: 1.0
void mosNotAuth ()
mosObjectToArray (line 172)
void mosObjectToArray (mixed $p_obj)
mosPrepareSearchContent (line 743)

Prepares results from search for display

  • since: 1.1
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
mosSmartSubstr (line 764)

returns substring of characters around a searchword

  • since: 1.0
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 73)

Strip slashes from strings or arrays of strings

  • return: String or array stripped of slashes
  • since: 1.0
mixed mosStripslashes (mixed &$value)
  • mixed &$value: The input string or array
mosToolTip (line 453)

Utility function to provide ToolTips

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

Sorts an Array of objects

  • since: 1.0
void SortArrayObjects (mixed &$a, mixed $k, [integer $sort_direction = 1])
  • integer $sort_direction: [1 = Ascending] [-1 = Descending]
SortArrayObjects_cmp (line 804)

Sorts an Array of objects

  • since: 1.0
void SortArrayObjects_cmp (mixed &$a, mixed &$b)

Documentation generated on Sat, 4 Feb 2006 14:23:37 +0100 by phpDocumentor 1.3.0RC4