[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/includes/ -> core.classes.php (summary)

(no description)

Author: Mambo Foundation Inc see README.php
Copyright: (C) 2000 - 2009 Mambo Foundation Inc.
License: GNU/GPL Version 2, see LICENSE.php
File Size: 3736 lines (128 kb)
Included or required: 1 time
Referenced: 1 time
Includes or requires: 0 files

Defines 19 classes

mosError:: (1 method):
  mosError()

mosErrorSet:: (6 methods):
  addError()
  addErrorDetails()
  getErrors()
  getMaxLevel()
  getCount()
  mergeAnother()

mosErrorHandler:: (2 methods):
  mosErrorHandler()
  handler()

mamboCore:: (23 methods):
  mamboCore()
  getMamboCore()
  rootPath()
  get()
  is_set()
  set()
  checkConfig()
  getConfig()
  getFavIcon()
  offlineCheck()
  loadLanguage()
  fixLanguage()
  handleGlobals()
  determineOptionAndItemid()
  redirect()
  logMessage()
  handleLogin()
  handleLogout()
  standardHeaders()
  initGzip()
  doGzip()
  getLastPart()
  allButLast()

mosObjectSorter:: (3 methods):
  mosObjectSorter()
  mosObjectCompare()
  sort()

mosPathway:: (5 methods):
  mosPathway()
  getInstance()
  addItem()
  reduceToOne()
  makePathway()

mosMenu:: (2 methods):
  mosMenu()
  load()

mosFileManager:: (14 methods):
  getInstance()
  deleteFile()
  deleteDirectory()
  setPermissions()
  makeDirectory()
  createDirectory()
  containingDirectory()
  simpleCopy()
  forceCopy()
  lightCopy()
  acceptCopy()
  mosPathName()
  mosChmod()
  mosChmodRecursive()

mosDirectory:: (8 methods):
  mosDirectory()
  listAll()
  soleDir()
  deleteAll()
  createFresh()
  createIfNeeded()
  listFiles()
  getSize()

mosMenuHandler:: (22 methods):
  mosMenuHandler()
  getInstance()
  getMenuByID()
  getMenuCount()
  getMenusByType()
  getMenuTypes()
  getIDByTypeLink()
  getIDLikeLink()
  getIDByTypeCid()
  getSectionItemId()
  getCategoryItemId()
  getGlobalBlogSectionCount()
  getContentItemid()
  getBestQueryMatch()
  maxAccessLink()
  getByParentOrder()
  setPathway()
  menuCheck()
  mosGetMenuLink()
  mosShowVIMenu()
  mosRecurseVIMenu()
  mosShowHFMenu()

mosMambotHandler:: (11 methods):
  mosMambotHandler()
  getInstance()
  _botRegister()
  loadBotGroup()
  registerFunction()
  addListOption()
  getList()
  _runBots()
  trigger()
  call()
  getBot()

mosUser:: (8 methods):
  mosUser()
  isAdmin()
  getSessionData()
  getSession()
  getAccessGid()
  check()
  store()
  delete()

mosLoginDetails:: (4 methods):
  mosLoginDetails()
  getUser()
  getPassword()
  getRemember()

mosMainFrame:: (37 methods):
  mosMainFrame()
  getUser()
  logout()
  login()
  getInstance()
  setPageTitle()
  getPageTitle()
  addMetaTag()
  _getMetaTag()
  _tidyMetaData()
  appendMetaTag()
  prependMetaTag()
  addCustomHeadTag()
  getHead()
  getCustomPathWay()
  appendPathWay()
  getUserState()
  setUserState()
  getUserStateFromRequest()
  initSession()
  getCfg()
  _setTemplate()
  getTemplate()
  ImageCheck()
  tryFiles()
  getPath()
  detect()
  getItemid()
  liveBookMark()
  mosShowHead()
  getBlogSectionCount()
  getBlogCategoryCount()
  getGlobalBlogSectionCount()
  getStaticContentCount()
  getContentItemLinkCount()
  formId()
  validFormId()

mosCache:: (2 methods):
  getCache()
  cleanCache()

mosSession:: (8 methods):
  mosSession()
  validate()
  getCurrent()
  insert()
  update()
  generateId()
  getCookie()
  purge()

mosParameters:: (9 methods):
  mosParameters()
  getParams()
  set()
  def()
  get()
  getBracketed()
  parse()
  render()
  textareaHandling()

mosProfiler:: (3 methods):
  mosProfiler()
  mark()
  getmicrotime()

ConvertCharset:: (5 methods):
  UnicodeEntity()
  HexToUtf()
  MakeConvertTable()
  Convert()
  DebugOutput()


Class: mosError  - X-Ref

Enter description here...

mosError($text='', $level=_MOS_ERROR_INFORM)   X-Ref
Enter description here...

param: unknown_type $text
param: unknown_type $level
return: mosError

Class: mosErrorSet  - X-Ref

Mambo group of errors for some particular operation

addError($error)   X-Ref
Enter description here...

param: unknown_type $error

addErrorDetails($text='', $level=_MOS_ERROR_INFORM)   X-Ref
Enter description here...

param: unknown_type $text
param: unknown_type $level

getErrors()   X-Ref
Enter description here...

return: unknown

getMaxLevel()   X-Ref
Enter description here...

return: unknown

getCount()   X-Ref
Enter description here...

return: unknown

mergeAnother($errorset)   X-Ref
Enter description here...

param: unknown_type $errorset

Class: mosErrorHandler  - X-Ref

mosErrorHandler()   X-Ref
No description

handler($errno, $errstr, $errfile, $errline, $errcontext)   X-Ref
No description

Class: mamboCore  - X-Ref

Enter description here...

mamboCore()   X-Ref
Enter description here...

return: mamboCore

getMamboCore()   X-Ref
Enter description here...

return: unknown

rootPath()   X-Ref
Enter description here...

return: unknown

get($property)   X-Ref
Enter description here...

param: unknown_type $property
return: unknown

is_set($property)   X-Ref
Enter description here...

param: unknown_type $property
return: unknown

set($property, $value)   X-Ref
Enter description here...

param: unknown_type $property
param: unknown_type $value
return: unknown

checkConfig()   X-Ref
Enter description here...


getConfig()   X-Ref
Enter description here...


getFavIcon()   X-Ref
Enter description here...

return: unknown

offlineCheck(&$user, &$database)   X-Ref
Enter description here...

param: unknown_type $user
param: unknown_type $database

loadLanguage()   X-Ref
No description

fixLanguage()   X-Ref
Enter description here...


handleGlobals()   X-Ref
Enter description here...


determineOptionAndItemid()   X-Ref
Enter description here...

return: unknown

redirect($url, $msg='')   X-Ref
Enter description here...

param: unknown_type $url
param: unknown_type $msg

logMessage($text)   X-Ref
Enter description here...

param: unknown_type $text

handleLogin()   X-Ref
Enter description here...


handleLogout()   X-Ref
Enter description here...


standardHeaders()   X-Ref
Enter description here...


initGzip()   X-Ref
Enter description here...


doGzip()   X-Ref
Perform GZIP


getLastPart($separator, $field)   X-Ref
Enter description here...

param: unknown_type $separator
param: unknown_type $field
return: unknown

allButLast($separator, $field)   X-Ref
Enter description here...

param: unknown_type $separator
param: unknown_type $field
return: unknown

Class: mosObjectSorter  - X-Ref

Sorts an Array of objects

mosObjectSorter(&$a, $k, $sort_direction=1)   X-Ref
Enter description here...

param: unknown_type $a
param: unknown_type $k
param: unknown_type $sort_direction
return: mosObjectSorter

mosObjectCompare(&$a, &$b)   X-Ref
Enter description here...

param: unknown_type $a
param: unknown_type $b
return: unknown

sort()   X-Ref
Enter description here...


Class: mosPathway  - X-Ref

Pathway handler

mosPathway()   X-Ref
Constructor


getInstance()   X-Ref
Singleton accessor


addItem($name, $givenurl)   X-Ref
Add an item to the pathway


reduceToOne()   X-Ref
Enter description here...


makePathway()   X-Ref
Make a pathway string for display


Class: mosMenu  - X-Ref

Module database table class

mosMenu()   X-Ref

param: database A database connector object

load( $oid=null )   X-Ref
binds an array/hash to this object

param: int $oid optional argument, if not specifed then the value of current key is used
return: any result from the database operation

Class: mosFileManager  - X-Ref

File Manager including safe mode provision?

getInstance()   X-Ref
Singleton accessor


deleteFile($file)   X-Ref
Enter description here...

param: unknown_type $file
return: unknown

deleteDirectory($dir)   X-Ref
Enter description here...

param: unknown_type $dir
return: unknown

setPermissions($fileSysObject)   X-Ref
Enter description here...

param: unknown_type $fileSysObject

makeDirectory($dir)   X-Ref
Enter description here...

param: unknown_type $dir
return: unknown

createDirectory($dir, $onlyCheck=false)   X-Ref
Enter description here...

param: unknown_type $dir
param: unknown_type $onlyCheck
return: unknown

containingDirectory($dir)   X-Ref
Enter description here...

param: unknown_type $dir
return: unknown

simpleCopy($from, $to)   X-Ref
Enter description here...

param: unknown_type $from
param: unknown_type $to
return: unknown

forceCopy($from, $to)   X-Ref
Enter description here...

param: unknown_type $from
param: unknown_type $to
return: unknown

lightCopy($from, $to)   X-Ref
Enter description here...

param: unknown_type $from
param: unknown_type $to
return: unknown

acceptCopy($to)   X-Ref
Enter description here...

param: unknown_type $to
return: unknown

mosPathName($p_path, $p_addtrailingslash=true)   X-Ref
Function to strip additional / or \ in a path name

param: string The path
param: boolean Add trailing slash

mosChmod($path)   X-Ref
Chmods files and directories recursively to mos global permissions. Available from 4.5.2 up.

param: path The starting file or directory (no trailing slash)
param: filemode Integer value to chmod files. NULL = dont chmod files.
param: dirmode Integer value to chmod directories. NULL = dont chmod directories.
return: TRUE=all succeeded FALSE=one or more chmods failed

mosChmodRecursive($path, $filemode=NULL, $dirmode=NULL)   X-Ref
Chmods files and directories recursively to given permissions. Available from 4.5.2 up.

param: path The starting file or directory (no trailing slash)
param: filemode Integer value to chmod files. NULL = dont chmod files.
param: dirmode Integer value to chmod directories. NULL = dont chmod directories.
return: TRUE=all succeeded FALSE=one or more chmods failed

Class: mosDirectory  - X-Ref

Enter description here...

mosDirectory($path)   X-Ref
Enter description here...

param: unknown_type $path
return: mosDirectory

listAll($type='file', $recurse=false, $fullpath=false)   X-Ref
Enter description here...

param: unknown_type $type
param: unknown_type $recurse
param: unknown_type $fullpath
return: unknown

soleDir()   X-Ref
Enter description here...

return: unknown

deleteAll()   X-Ref
Enter description here...


createFresh()   X-Ref
Enter description here...

return: unknown

createIfNeeded()   X-Ref
Enter description here...


listFiles($pattern='', $type='file', $recurse=false, $fullpath=false)   X-Ref
Enter description here...

param: unknown_type $pattern
param: unknown_type $type
param: unknown_type $recurse
param: unknown_type $fullpath
return: unknown

getSize()   X-Ref
Enter description here...

return: unknown

Class: mosMenuHandler  - X-Ref

Menu handler

mosMenuHandler()   X-Ref
Constructor


getInstance()   X-Ref
Singleton accessor


getMenuByID($id)   X-Ref
Enter description here...

param: unknown_type $id
return: unknown

getMenuCount($type, $published)   X-Ref
Enter description here...

param: unknown_type $type
param: unknown_type $published
return: unknown

getMenusByType($types)   X-Ref
Enter description here...

param: unknown_type $types
return: unknown

getMenuTypes()   X-Ref
Enter description here...

return: unknown

getIDByTypeLink($type, $link)   X-Ref
Enter description here...

param: unknown_type $type
param: unknown_type $link
return: unknown

getIDLikeLink($link)   X-Ref
Enter description here...

param: unknown_type $link
return: unknown

getIDByTypeCid($type, $componentid)   X-Ref
Enter description here...

param: unknown_type $type
param: unknown_type $componentid
return: unknown

getSectionItemId($sectionid, $gbs = 1)   X-Ref
No description

getCategoryItemId($catid)   X-Ref
No description

getGlobalBlogSectionCount()   X-Ref
Enter description here...

return: unknown

getContentItemid($Itemid, $type, $id, $catid=0)   X-Ref
Enter description here...

param: unknown_type $Itemid
param: unknown_type $type
param: unknown_type $id
param: unknown_type $catid
return: unknown

getBestQueryMatch()   X-Ref
Enter description here...

return: unknown

maxAccessLink($link)   X-Ref
Enter description here...

param: unknown_type $link
return: unknown

getByParentOrder($Itemid, $menutype, $maxaccess=0, $noparent=false)   X-Ref
Enter description here...

param: unknown_type $Itemid
param: unknown_type $menutype
param: unknown_type $maxaccess
param: unknown_type $noparent
return: unknown

setPathway($Itemid)   X-Ref
Enter description here...

param: unknown_type $Itemid

menuCheck( $Itemid, $menu_option, $task, $gid )   X-Ref
Checks whether a menu option is within the users access level

param: int Item id number
param: string The menu option
param: int The users group ID number
param: database A database connector object
return: boolean True if the visitor's group at least equal to the menu access

mosGetMenuLink( &$mitem, $level=0, &$params, $Itemid )   X-Ref
Enter description here...

param: unknown_type $mitem
param: unknown_type $level
param: unknown_type $params
param: unknown_type $Itemid
return: unknown

mosShowVIMenu( &$params )   X-Ref
Vertically Indented Menu


mosRecurseVIMenu( $id, $level, &$children, &$open, &$indents, &$params )   X-Ref
Utility function to recursively work through a vertically indented
hierarchial menu


mosShowHFMenu( &$params, $style=0 )   X-Ref
Draws a horizontal 'flat' style menu (very simple case)


Class: mosMambotHandler  - X-Ref

Plugin handler

mosMambotHandler()   X-Ref
Constructor


getInstance()   X-Ref
Singleton accessor


_botRegister(&$botObject, &$selected, $i)   X-Ref
Register a class-type mambot, provided it has a perform method
- can register for multiple events if desired

param: object The mambot object
param: mixed string or array of strings - the mambot events to be registered
param: int the subscript for use in the main array of mambots

loadBotGroup( $group )   X-Ref
Loads all the bot files for a particular group

param: string The group name, relates to the sub-directory in the mambots directory

registerFunction( $event, $function )   X-Ref
Registers a function to a particular event group

param: string The event name
param: string The function name

addListOption( $group, $listName, $value, $text='' )   X-Ref
Makes a option for a particular list in a group

param: string The group name
param: string The list name
param: string The value for the list option
param: string The text for the list option

getList( $group, $listName )   X-Ref

param: string The group name
param: string The list name
return: array

_runBots($event, $args, $doUnpublished=false)   X-Ref
Calls all functions according to passed parameters

param: string The event name
param: array An array of arguments
param: boolean True is unpublished bots are to be processed
return: array An array of results from each function call

trigger( $event, $args=null, $doUnpublished=false )   X-Ref
Calls all functions associated with an event group

param: string The event name
param: array An array of arguments
param: boolean True is unpublished bots are to be processed
return: array An array of results from each function call

call( $event )   X-Ref
Same as trigger but only returns the first event and
allows for a variable argument list

param: string The event name
return: array The result of the first function call

getBot($element, $folder)   X-Ref
No description

Class: mosUser  - X-Ref

Users Table Class

Provides access to the mos_templates table
mosUser()   X-Ref

param: database A database connector object

isAdmin()   X-Ref
Return true if this user is an administrator, false otherwise


getSessionData()   X-Ref
Fill a user object with information from the current session


getSession()   X-Ref
No description

getAccessGid()   X-Ref
User access level


check()   X-Ref
Validation and filtering

return: boolean True is satisfactory

store( $updateNulls=false )   X-Ref
No description

delete($oid=null)   X-Ref
No description

Class: mosLoginDetails  - X-Ref

User login details class

mosLoginDetails($user, $password='', $remember='')   X-Ref
No description

getUser()   X-Ref
No description

getPassword()   X-Ref
No description

getRemember()   X-Ref
No description

Class: mosMainFrame  - X-Ref

Mambo Mainframe class

Provide many supporting API functions
mosMainFrame( &$db, $option, $basePath, $isAdmin=false )   X-Ref
Class constructor

param: database A database connection object
param: string The url option
param: string The path of the mos directory

getUser()   X-Ref
Get the current user - deprecated - use mamboCore instead


logout()   X-Ref
Logout the current user - deprecated - use the code here directly


login($username=null,$passwd=null)   X-Ref
Login a user given name and password - deprecated - use the code here directly


getInstance()   X-Ref

param: object

setPageTitle( $title=null )   X-Ref

param: string

getPageTitle()   X-Ref

return: string

addMetaTag( $name, $content, $prepend='', $append='' )   X-Ref

param: string The value of the name attibute
param: string The value of the content attibute
param: string Text to display before the tag
param: string Text to display after the tag

_getMetaTag($name)   X-Ref

param: string The value of the name attibute

_tidyMetaData($name, $content)   X-Ref

param: string The value of the name attibute
param: string The value of the content attibute to append to the existing

appendMetaTag( $name, $content, $ifEmpty=false )   X-Ref

param: string The value of the name attibute
param: string The value of the content attibute to append to the existing

prependMetaTag( $name, $content )   X-Ref

param: string The value of the name attibute
param: string The value of the content attibute to append to the existing

addCustomHeadTag( $html )   X-Ref
Adds a custom html string to the head block

param: string The html to add to the head

getHead()   X-Ref

return: string

getCustomPathWay()   X-Ref

return: string

appendPathWay($html)   X-Ref
No description

getUserState( $var_name )   X-Ref
Gets the value of a user state variable

param: string The name of the variable

setUserState( $var_name, $var_value )   X-Ref
Sets the value of a user state variable

param: string The name of the variable
param: string The value of the variable

getUserStateFromRequest( $var_name, $req_name, $var_default=null )   X-Ref
Gets the value of a user state variable

param: string The name of the user state variable
param: string The name of the variable passed in a request
param: string The default value for the variable if not found

initSession()   X-Ref
Initialises the user session

Old sessions are flushed based on the configuration value for the cookie
lifetime. If an existing session, then the last access time is updated.
If a new session, a session id is generated and a record is created in
the mos_sessions table.

getCfg( $varname )   X-Ref

param: string The name of the variable (from configuration.php)
return: mixed The value of the configuration variable or null if not found

_setTemplate( $isAdmin=false )   X-Ref
No description

getTemplate()   X-Ref
No description

ImageCheck( $file, $directory='/images/M_images/', $param=NULL, $param_directory='/images/M_images/', $alt=NULL, $name='image', $type=1, $align='middle' )   X-Ref
Checks to see if an image exists in the current templates image directory
if it does it loads this image.  Otherwise the default image is loaded.
Also can be used in conjunction with the menulist param to create the chosen image
load the default or use no image


tryFiles($first_choice, $second_choice=null, $third_choice=null)   X-Ref
Returns the first to be found of one or more files, or null


getPath( $varname, $option='' )   X-Ref
Returns a standard path variable


detect()   X-Ref
Detects a 'visit'

This function updates the agent and domain table hits for a particular
visitor.  The user agent is recorded/incremented if this is the first visit.
A cookie is set to mark the first visit.

getItemid($id, $typed=1, $link=1, $bs=1, $bc=1, $gbs=1)   X-Ref

return: correct Itemid for Content Item

liveBookMark()   X-Ref
No description

mosShowHead($keys='', $exclude='')   X-Ref
Render head tags
tags are assembled into an associative array with the following elements:
- title
- meta
- mambojavascript
- custom (custom head tags)
- livebookmark
- favicon

param: unknown keys - array elements to output (null = output all)
param: unknown exclude - array elements to exclude in output

getBlogSectionCount()   X-Ref
retained for backward compatability


getBlogCategoryCount()   X-Ref
No description

getGlobalBlogSectionCount()   X-Ref
No description

getStaticContentCount()   X-Ref
No description

getContentItemLinkCount()   X-Ref
No description

formId($option='', $task='', $my='')   X-Ref
No description

validFormId($option='', $task='', $my='')   X-Ref
No description

Class: mosCache  - X-Ref

Class to support function caching

getCache( $group='', $plugin = 'Function' )   X-Ref

return: object A function cache object

cleanCache($group=false)   X-Ref
Cleans the cache


Class: mosSession  - X-Ref

Session database table class

mosSession()   X-Ref

param: database A database connector object

validate($user)   X-Ref
No description

getCurrent()   X-Ref
No description

insert()   X-Ref
No description

update( $updateNulls=false )   X-Ref
No description

generateId()   X-Ref
No description

getCookie()   X-Ref
No description

purge()   X-Ref
No description

Class: mosParameters  - X-Ref

Parameters handler

mosParameters( $text, $process_sections = false)   X-Ref
Constructor

param: string The raw parms text
param: string Path to the xml setup file

getParams()   X-Ref
Get the result of parsing the string provided on creation

return: string parsed result

set( $key, $value='' )   X-Ref

param: string The name of the param
param: string The value of the parameter
return: string The set value

def( $key, $value='' )   X-Ref
Sets a default value if not alreay assigned

param: string The name of the param
param: string The value of the parameter
return: string The set value

get( $key, $default='' )   X-Ref

param: string The name of the param
param: mixed The default value if not found
return: string

getBracketed($text, $opener, $closer)   X-Ref
Look to see if string is bracketed by opener and closer
If so, extract and trim the bracketed string
Otherwise, return a null string


parse( $txt, $process_sections = false )   X-Ref
Parse an .ini string, based on phpDocumentor phpDocumentor_parse_ini_file function

param: mixed The ini string or array of lines
param: boolean add an associative index for each section [in brackets]
return: object

render( $name='params' )   X-Ref

param: string The name of the control, or the default text area if a setup file is not found
return: string HTML

textareaHandling( &$txt )   X-Ref
special handling for textarea param


Class: mosProfiler  - X-Ref

Page generation time

mosProfiler( $prefix='' )   X-Ref
No description

mark( $label )   X-Ref
No description

getmicrotime()   X-Ref
No description

Class: ConvertCharset  - X-Ref

-- 1.0 2004-07-28 --

-- The most important thing --
I want to thank all people who helped me fix all bugs, small and big once.
I hope that you don't mind that your names are in this file.

-- Some Apache issues --
I get info from Lukas Lisa, that in some cases with special apache configuration
you have to put header() function with proper encoding to get your result
displayed correctly.
If you want to see what I mean, go to demo.php and demo1.php

-- BETA 1.0 2003-10-21 --

-- You should know about... --
For good understanding this class you shouls read all this stuff first :) but if you are
in a hurry just start the demo.php and see what's inside.
1. That I'm not good in english at 03:45 :) - so forgive me all mistakes
2. This class is a BETA version because I haven't tested it enough
3. Feel free to contact me with questions, bug reports and mistakes in PHP and this documentation (email below)

-- In a few words... --
Why ConvertCharset class?

I have made this class because I had a lot of problems with diferent charsets. First because people
from Microsoft wanted to have thair own encoding, second because people from Macromedia didn't
thought about other languages, third because sometimes I need to use text written on MAC, and of course
it has its own encoding :)

Notice & remember:
- When I'm saying 1 byte string I mean 1 byte per char.
- When I'm saying multibyte string I mean more than one byte per char.

So, this are main FEATURES of this class:
- conversion between 1 byte charsets
- conversion from 1 byte to multi byte charset (utf-8)
- conversion from multibyte charset (utf-8) to 1 byte charset
- every conversion output can be save with numeric entities (browser charset independent - not a full truth)

This is a list of charsets you can operate with, the basic rule is that a char have to be in both charsets,
otherwise you'll get an error.

- WINDOWS
- windows-1250 - Central Europe
- windows-1251 - Cyrillic
- windows-1252 - Latin I
- windows-1253 - Greek
- windows-1254 - Turkish
- windows-1255 - Hebrew
- windows-1256 - Arabic
- windows-1257 - Baltic
- windows-1258 - Viet Nam
- cp874 - Thai - this file is also for DOS

- DOS
- cp437 - Latin US
- cp737 - Greek
- cp775 - BaltRim
- cp850 - Latin1
- cp852 - Latin2
- cp855 - Cyrylic
- cp857 - Turkish
- cp860 - Portuguese
- cp861 - Iceland
- cp862 - Hebrew
- cp863 - Canada
- cp864 - Arabic
- cp865 - Nordic
- cp866 - Cyrylic Russian (this is the one, used in IE "Cyrillic (DOS)" )
- cp869 - Greek2

- MAC (Apple)
- x-mac-cyrillic
- x-mac-greek
- x-mac-icelandic
- x-mac-ce
- x-mac-roman

- ISO (Unix/Linux)
- iso-8859-1
- iso-8859-2
- iso-8859-3
- iso-8859-4
- iso-8859-5
- iso-8859-6
- iso-8859-7
- iso-8859-8
- iso-8859-9
- iso-8859-10
- iso-8859-11
- iso-8859-12
- iso-8859-13
- iso-8859-14
- iso-8859-15
- iso-8859-16

- MISCELLANEOUS
- gsm0338 (ETSI GSM 03.38)
- cp037
- cp424
- cp500
- cp856
- cp875
- cp1006
- cp1026
- koi8-r (Cyrillic)
- koi8-u (Cyrillic Ukrainian)
- nextstep
- us-ascii
- us-ascii-quotes

- DSP implementation for NeXT
- stdenc
- symbol
- zdingbat

- And specially for old Polish programs
- mazovia

-- Now, to the point... --
Here are main variables.

DEBUG_MODE

You can set this value to:
- -1 - No errors or comments
- 0  - Only error messages, no comments
- 1  - Error messages and comments

Default value is 1, and during first steps with class it should be left as is.

CONVERT_TABLES_DIR

This is a place where you store all files with charset encodings. Filenames should have
the same names as encodings. My advise is to keep existing names, because thay
were taken from unicode.org (www.unicode.org), and after update to unicode 3.0 or 4.0
the names of files will be the same, so if you want to save your time...uff, leave the
names as thay are for future updates.

The directory with edings files should be in a class location directory by default,
but of course you can change it if you like.

UnicodeEntity($UnicodeString)   X-Ref
CharsetChange::NumUnicodeEntity()

Unicode encoding bytes, bits representation.
Each b represents a bit that can be used to store character data.
- bytes, bits, binary representation
- 1,   7,  0bbbbbbb
- 2,  11,  110bbbbb 10bbbbbb
- 3,  16,  1110bbbb 10bbbbbb 10bbbbbb
- 4,  21,  11110bbb 10bbbbbb 10bbbbbb 10bbbbbb

This function is written in a "long" way, for everyone who woluld like to analize
the process of unicode encoding and understand it. All other functions like HexToUtf
will be written in a "shortest" way I can write tham :) it does'n mean thay are short
of course. You can chech it in HexToUtf() (link below) - very similar function.

IMPORTANT: Remember that $UnicodeString input CANNOT have single byte upper half
extended ASCII codes, why? Because there is a posibility that this function will eat
the following char thinking it's miltibyte unicode char.

param: string $UnicodeString Input Unicode string (1 char can take more than 1 byte)
return: string This is an input string olso with unicode chars, bus saved as entities

HexToUtf($UtfCharInHex)   X-Ref
ConvertCharset::HexToUtf()

This simple function gets unicode  char up to 4 bytes and return it as a regular char.
It is very similar to  UnicodeEntity function (link below). There is one difference
in returned format. This time it's a regular char(s), in most cases it will be one or two chars.

param: string $UtfCharInHex Hexadecimal value of a unicode char.
return: string Encoded hexadecimal value as a regular char.

MakeConvertTable($FirstEncoding, $SecondEncoding = "")   X-Ref
CharsetChange::MakeConvertTable()

This function creates table with two SBCS (Single Byte Character Set). Every conversion
is through this table.

- The file with encoding tables have to be save in "Format A" of unicode.org charset table format! This is usualy writen in a header of every charset file.
- BOTH charsets MUST be SBCS
- The files with encoding tables have to be complet (Non of chars can be missing, unles you are sure you are not going to use it)

"Format A" encoding file, if you have to build it by yourself should aplly these rules:
- you can comment everything with #
- first column contains 1 byte chars in hex starting from 0x..
- second column contains unicode equivalent in hex starting from 0x....
- then every next column is optional, but in "Format A" it should contain unicode char name or/and your own comment
- the columns can be splited by "spaces", "tabs", "," or any combination of these
- below is an example

<code>
#
#    The entries are in ANSI X3.4 order.
#
0x00    0x0000    #    NULL end extra comment, if needed
0x01    0x0001    #    START OF HEADING
# Oh, one more thing, you can make comments inside of a rows if you like.
0x02    0x0002    #    START OF TEXT
0x03    0x0003    #    END OF TEXT
next line, and so on...
</code>

You can get full tables with encodings from http://www.unicode.org

param: string $FirstEncoding Name of first encoding and first encoding filename (thay have to be the same)
param: string $SecondEncoding Name of second encoding and second encoding filename (thay have to be the same). Optional for building a joined table.
return: array Table necessary to change one encoding to another.

Convert($StringToChange, $FromCharset, $ToCharset, $TurnOnEntities = false)   X-Ref
ConvertCharset::Convert()

This is a basic function you are using. I hope that you can figure out this function syntax :-)

param: string $StringToChange The string you want to change :)
param: string $FromCharset Name of $StringToChange encoding, you have to know it.
param: string $ToCharset Name of a charset you want to get for $StringToChange.
param: boolean $TurnOnEntities Set to true or 1 if you want to use numeric entities insted of regular chars.
return: string Converted string in brand new encoding :)

DebugOutput($Group, $Number, $Value = false)   X-Ref
ConvertCharset::DebugOutput()

This function is not really necessary, the debug output could stay inside of
source code but like this, it's easier to manage and translate.
Besides I couldn't find good coment/debug class :-) Maybe I'll write one someday...

All messages depend on DEBUG_MODE level, as I was writing before you can set this value to:
- -1 - No errors or notces are shown
- 0  - Only error messages are shown, no notices
- 1  - Error messages and notices are shown

param: int $Group Message groupe: error - 0, notice - 1
param: int $Number Following message number
param: mix $Value This walue is whatever you want, usualy it's some parameter value, for better message understanding.
return: string String with a proper message.