Packageindex Classtrees Elementlist XML Files

File: admin/iware.php
iWare Professional - iWare Professional

IWARE

IWARE

Core iWare application class

 

public class IWARE

Core iWare application class

AuthorsDavid N. Simmons (http://www.dsiware.com)
Version3.0.9
CopyrightiWare

 

Private Method Summary

void

IWARE()

Class constructor (runs upon intialization of the class). Establishes a datbase connection and selectes the database for use by the application.
void

connectDb(string $host, string $user, string $pwd)

Connects to the configured MySQL database and stores the connection handle returned to class variable
void

closeDb()

Closes an open connection to the MySQL database (if open)
void

selectDb(string $dbname)

Selects the configured MySQL database for use
array

query(string $sql)

Issues a MySQL query and returns the returned result from the query where applicable
void

result(array $result, integer $row, string $field)

Returns the data present in a result set for a specific row number and field name
void

countResult(array $result)

Returns the total number of rows returned from a sql query
void

freeResult(array $result)

Frees a existing MySQL result set from memory
string

StatDB()

Returns the current version of the installed MySQL server software
boolean

tableExists(string $tablename)

Checks if a given table exists in the configured database. Returns TRUE if the table exists, false otherwise.
boolean

alreadyLoggedIn()

Checks if a user is already logged into the application by checking for the presence of a defined PHP session variable. If the variable is defined then the method will return TRUE
string

getId()

Returns the value of an existing PHP session variable
boolean

maybeOpenLogInWindow()

Determines whether or not to display the login interface based on whether or not a user has logged into the system and established a valid PHP session variable. If a sesion variable has been defined ( the user is logged in ) then the method will simply return. If the session has not yet been defined then the login dialog will be displayed.
boolean

authUserControl()

This method is now deprecated
boolean

logon(string $user, string $userpwd)

Attempts to authenticate a user by credentials posted from the login interface. If authentication is sucessfull then this method will return FALSE, otherwise it will return TRUE
void

logoff()

Log a user out of the application by destroying the existing PHP session variable
void

displayLogInDialog(boolean $badLogIn)

Outputs the user login interface in two states - first time login and failed login
string

EncryptPassword(string $input)

Returns an encrypted versionof a supplied password string
void

SystemSummary()

Outputs the system summary interface
void

Users_Manager()

Outputs the user management interface
void

Users_AddForm()

Outputs the add new user interface
void

Users_Add(string $realname, string $group_id, string $username, string $password)

Adds a user account to the system
void

Users_UpdateForm(string $id)

Outputs the edit user account interface
void

Users_Update(string $id, string $realname, string $group_id, string $username, string $password)

Updates an existing user account in the system
void

Users_Delete(string $id)

Deletes a user account from the system
integer

Users_GetCount()

Returns a total count of all user accounts defined in the system
string

Users_GetUserName(string $id)

Returns the name of a user account by the user accounts record ID
string

Users_GetUserGroup(string $id)

Returns the ID of a user group of which a user account belongs by the user accounts record ID
void

Group_Manager()

Outputs the group management interface
void

Group_AddForm()

Outputs the add new group interface
void

Group_Add()

Adds a user group to the system
void

Group_UpdateForm(string $id)

Outputs the edit user group interface
void

Group_Update(string $id)

Updates an existing user group in the system
void

Group_Delete(string $id)

Deletes a user group from the system
integer

Group_GetCount()

Returns a total count of all user groups defined in the system
array

Group_GetGroupList()

Returns an array containing the record ID of all user groups defined in the system
string

Group_GetGroupName(string $id)

Retuns the name of a user group by its record ID
array

Group_GetGroupAuth(string $id)

Returns an associative array of permission levels for control panel functions for a given user group
void

Header_Manager()

Outputs the site header management interface
void

Header_Update()

Updates changes made to the site header
void

Header_ImageListBox()

Outputs a number of HTML form option tags containing names of images present in the system from the files/ directory of the installation
void

Header_FontListBox()

This method is an alias to LoadFontsListBox ()
void

Header_FontSizeListBox()

Outputs a number of HTML form option elements containing font size in points from 1 to 8
void

Footer_Manager()

Outputs the site footer management interface
void

Footer_Update()

Updates changes made to the site footer
void

Skins_Manager()

Outputs the choose active skin interface
void

Skins_Choose()

Sets the active skin for the site at a global level
void

Skins_ListBox()

Outputs a number of HTML form option elements containing names of skins available to the system from the skins/ directory of the installation
void

Skins_PreviewImage(string $skin)

Outputs a thumbnail screenshot of the currently active skin in the system. If a thumbnail is not available for the given skin name then a no screenshot available message will be displayed instead. The thumbnail image for a given skin must be named screenshot.jpg.
integer

Skins_GetCount()

Returns a total count of all skins available to the system
void

Docs_Recurse(string $id, [ integer $indent ])

Works with Docs_Manager () to recursively output the site document structure to the user
void

Docs_Manager()

Outputs the documents manager interface
integer

Docs_GetNextDocOrder()

Returns the next available document navigation ordering value for use when creating a new document in the system
string

Docs_GetName(string $id)

Returns the link text for a given document by its record ID
void

Docs_Add([ integer $use_text ])

Adds a document to the system
void

Docs_Update(string $id)

Updates changes made to an existing document in the system
void

Docs_Delete(string $id)

Deletes an existing document from the system
integer

Docs_GetCount()

Returns a total count of all documents defined within the system
void

Docs_ListBox()

Outputs a number of HTML form option elements containing names of documents defined in the system
void

Nav_Manager()

Outputs the navigation manager interface
void

Nav_Choose()

Updates the active navigation for the site at a global level
void

Nav_ListBox()

Outputs a number of HTML form option elements containing navigation styles available to the system form the navbar/ directory of the installation
void

Nav_Recurse(string $id, [ integer $indent ])

Works with Nav_Order () to recursively output the site document structure to the user
void

Nav_Order()

Outputs the navigation ordering interface
void

Nav_OrderUpdateRecurse(string $id)

Works with Nav_OrderUpdate () to recursively update the site document structure navigation ordering
void

Nav_OrderUpdate()

Updates changes made to the site navigation order
string

Nav_GetLinkText(string $id)

Returns the link text for a given document by its record ID
array

Nav_GetNav()

Returns an array containg the ID of all documents defined in the system for use with navigation
array

Nav_GetSubNav(string $id)

Returns an array containg the ID of all documents defined in the system beneath a given document by its record ID
boolean

Nav_HasSubNav(string $id)

Returns TRUE if a given document has existing documents defined as child documents beneath it, returns FALSE otherwise
integer

Nav_GetCount()

Retuns a total count of all navigation styles availabkle to the system from the navbar/ directory of the installation
void

LoadFontsListBox()

Ouputs a number of HTML form option elements containing names of fonts available to the system from the fonts/DEFAULT support file
array

GetFontsArray()

Returns an array of font names avaialble to the system from the fonts/DEFAULT support file
void

File_UploadForm()

Outputs the file upload interface
void

File_Upload()

Uploads a file from the users local hard disk to the webserver and if indicated to do so uses resizeImage () to resixze an image to the specified dimensions after upload
void

File_Manager()

Outputs the file management interface
void

File_Delete(string $filename)

Deletes a file from the files/ directory of the installation
void

File_ListBox()

Outputs a number of HTML form option elements containg file names from the files/ directory of the installation
void

File_GetCount()

Returns a total count of files available to the system located in the files/ directory of the installation
void

Mod_Manager()

Outputs the initial modules management interface to the user, if no modules are present in the mods/ directory of the installation the interface will not be displayed
void

Mod_ListBox()

Outputs a number of HTML form option elements containing names of modules avaialable to the system from the mods/ directory of the installation
void

Mod_GetCount()

Returns a total count of all modules avalable to the system from the mods/ directory of the installation
void

Mod_MissingDB()

This method is now deprecated
boolean

resizeImage(string $image_path, string $thumb_path, string $image_name, integer $thumb_width, integer $thumb_height, string $type)

Uses GDLib supprt in PHP to resize an uploaded image to specified dimensions. Returns FALSE if the required GDLib support is not enabled for PHP, TRUE otherwise.
string

Client_GetMETATitle(string $id)

Returns the META title for a given document by its record ID
string

Client_GetMETAKeywords(string $id)

Returns the META keywords for a given document by its record ID
string

Client_GetMETADescription(string $id)

Returns the META description for a given document by its record ID
string

Client_GetSkin()

Returns the current active skin name for the site
string

Client_GetNav()

Returns the current active navigation style for the site
void

Client_GetContent(string $D, [ string $modVars ])

Outputs the content for a requested document, and also optionally processes variables posted for use with any embedded modules in a given doument
void

Client_GetHeader()

Ouputs the site header as HTML / text or as an image dependingon the configured header display mode
void

Client_GetFooter()

Outputs the site footer as HTML / text

Private Field Summary

integer

$dbcon

Variable used to store the active database connection handle

Private Method Details

IWARE

private void IWARE( )

  Class constructor (runs upon intialization of the class). Establishes a datbase connection and selectes the database for use by the application.

Returns void


connectDb

private void connectDb( string $host, string $user, string $pwd )

  Connects to the configured MySQL database and stores the connection handle returned to class variable

Parameter
string $host
MySQL server hostname or IP address
string $user
MySQL server username
string $pwd
MySQL server password
Returns void


closeDb

private void closeDb( )

  Closes an open connection to the MySQL database (if open)

Returns void


selectDb

private void selectDb( string $dbname )

  Selects the configured MySQL database for use

Parameter
string $dbname
Database name to select for use by the application
Returns void


query

private array query( string $sql )

  Issues a MySQL query and returns the returned result from the query where applicable

Parameter
string $sql
MySQL query string to be executed
Returns array


result

private void result( array $result, integer $row, string $field )

  Returns the data present in a result set for a specific row number and field name

Parameter
array $result
Sql result set to be used
integer $row
Result set row number to be used when fetching the requested data
string $field
Result set field name to be used when fetching the requested data
Returns void


countResult

private void countResult( array $result )

  Returns the total number of rows returned from a sql query

Parameter
array $result
Result set returned from a sql query to be used
Returns void


freeResult

private void freeResult( array $result )

  Frees a existing MySQL result set from memory

Parameter
array $result
Result set returned from a sql query that should be freed from memory
Returns void


StatDB

private string StatDB( )

  Returns the current version of the installed MySQL server software

Returns string


tableExists

private boolean tableExists( string $tablename )

  Checks if a given table exists in the configured database. Returns TRUE if the table exists, false otherwise.

Parameter
string $tablename
The database table name to check for existance in the configured database
Returns boolean


alreadyLoggedIn

private boolean alreadyLoggedIn( )

  Checks if a user is already logged into the application by checking for the presence of a defined PHP session variable. If the variable is defined then the method will return TRUE

Returns boolean


getId

private string getId( )

  Returns the value of an existing PHP session variable

Returns string


maybeOpenLogInWindow

private boolean maybeOpenLogInWindow( )

  Determines whether or not to display the login interface based on whether or not a user has logged into the system and established a valid PHP session variable. If a sesion variable has been defined ( the user is logged in ) then the method will simply return. If the session has not yet been defined then the login dialog will be displayed.

Returns boolean


authUserControl

private boolean authUserControl( )

  This method is now deprecated

Returns boolean


logon

private boolean logon( string $user, string $userpwd )

  Attempts to authenticate a user by credentials posted from the login interface. If authentication is sucessfull then this method will return FALSE, otherwise it will return TRUE

Parameter
string $user
Username to authenticate
string $userpwd
Password to authenticate
Returns boolean


logoff

private void logoff( )

  Log a user out of the application by destroying the existing PHP session variable

Returns void


displayLogInDialog

private void displayLogInDialog( boolean $badLogIn )

  Outputs the user login interface in two states - first time login and failed login

Parameter
boolean $badLogIn
Variable to define the state of the login interface if TRUE then the login interface will be in failed login state, otherwise the login interface will be in first time login state
Returns void


EncryptPassword

private string EncryptPassword( string $input )

  Returns an encrypted versionof a supplied password string

Parameter
string $input
Password string to encrypt
Returns string


SystemSummary

private void SystemSummary( )

  Outputs the system summary interface

Returns void


Users_Manager

private void Users_Manager( )

  Outputs the user management interface

Returns void


Users_AddForm

private void Users_AddForm( )

  Outputs the add new user interface

Returns void


Users_Add

private void Users_Add( string $realname, string $group_id, string $username, string $password )

  Adds a user account to the system

Parameter
string $realname
The desired name for the user account
string $group_id
The desired group ID for the user account
string $username
The desired username for the user account
string $password
The desired password for the user account
Returns void


Users_UpdateForm

private void Users_UpdateForm( string $id )

  Outputs the edit user account interface

Parameter
string $id
The record ID of the user account to be displayed for editing
Returns void


Users_Update

private void Users_Update( string $id, string $realname, string $group_id, string $username, string $password )

  Updates an existing user account in the system

Parameter
string $id
The record ID for the user account that is to be updated
string $realname
The desired name for the user account
string $group_id
The desired group ID for the user account
string $username
The desired username for the user account
string $password
The desired password for the user account
Returns void


Users_Delete

private void Users_Delete( string $id )

  Deletes a user account from the system

Parameter
string $id
The record ID of the user account to be deleted from the system
Returns void


Users_GetCount

private integer Users_GetCount( )

  Returns a total count of all user accounts defined in the system

Returns integer


Users_GetUserName

private string Users_GetUserName( string $id )

  Returns the name of a user account by the user accounts record ID

Parameter
string $id
The record ID of the user account
Returns string


Users_GetUserGroup

private string Users_GetUserGroup( string $id )

  Returns the ID of a user group of which a user account belongs by the user accounts record ID

Parameter
string $id
The record ID of the user account
Returns string


Group_Manager

private void Group_Manager( )

  Outputs the group management interface

Returns void


Group_AddForm

private void Group_AddForm( )

  Outputs the add new group interface

Returns void


Group_Add

private void Group_Add( )

  Adds a user group to the system

Returns void


Group_UpdateForm

private void Group_UpdateForm( string $id )

  Outputs the edit user group interface

Parameter
string $id
The record ID of the user group to be displayed for editing
Returns void


Group_Update

private void Group_Update( string $id )

  Updates an existing user group in the system

Parameter
string $id
The record ID for the user group that is to be updated
Returns void


Group_Delete

private void Group_Delete( string $id )

  Deletes a user group from the system

Parameter
string $id
The record ID of the user group to be deleted from the system
Returns void


Group_GetCount

private integer Group_GetCount( )

  Returns a total count of all user groups defined in the system

Returns integer


Group_GetGroupList

private array Group_GetGroupList( )

  Returns an array containing the record ID of all user groups defined in the system

Returns array


Group_GetGroupName

private string Group_GetGroupName( string $id )

  Retuns the name of a user group by its record ID

Parameter
string $id
The record ID of the user group
Returns string


Group_GetGroupAuth

private array Group_GetGroupAuth( string $id )

  Returns an associative array of permission levels for control panel functions for a given user group

Parameter
string $id
The record ID of the user group
Returns array


Header_Manager

private void Header_Manager( )

  Outputs the site header management interface

Returns void


Header_Update

private void Header_Update( )

  Updates changes made to the site header

Returns void


Header_ImageListBox

private void Header_ImageListBox( )

  Outputs a number of HTML form option tags containing names of images present in the system from the files/ directory of the installation

Returns void


Header_FontListBox

private void Header_FontListBox( )

  This method is an alias to LoadFontsListBox ()

Returns void


Header_FontSizeListBox

private void Header_FontSizeListBox( )

  Outputs a number of HTML form option elements containing font size in points from 1 to 8

Returns void


Footer_Manager

private void Footer_Manager( )

  Outputs the site footer management interface

Returns void


Footer_Update

private void Footer_Update( )

  Updates changes made to the site footer

Returns void


Skins_Manager

private void Skins_Manager( )

  Outputs the choose active skin interface

Returns void


Skins_Choose

private void Skins_Choose( )

  Sets the active skin for the site at a global level

Returns void


Skins_ListBox

private void Skins_ListBox( )

  Outputs a number of HTML form option elements containing names of skins available to the system from the skins/ directory of the installation

Returns void


Skins_PreviewImage

private void Skins_PreviewImage( string $skin )

  Outputs a thumbnail screenshot of the currently active skin in the system. If a thumbnail is not available for the given skin name then a no screenshot available message will be displayed instead. The thumbnail image for a given skin must be named screenshot.jpg.

Parameter
string $skin
The name of the skin to display a thumbnail for
Returns void


Skins_GetCount

private integer Skins_GetCount( )

  Returns a total count of all skins available to the system

Returns integer


Docs_Recurse

private void Docs_Recurse( string $id, [ integer $indent ] )

  Works with Docs_Manager () to recursively output the site document structure to the user

Parameter
string $id
The record ID of a given document to recurse from, the supplied record will be used as the starting point for the document recursion
integer $indent = >>0<<
The curent indice of the recursion used to create a spacer to form the document tree view
Returns void


Docs_Manager

private void Docs_Manager( )

  Outputs the documents manager interface

Returns void


Docs_GetNextDocOrder

private integer Docs_GetNextDocOrder( )

  Returns the next available document navigation ordering value for use when creating a new document in the system

Returns integer


Docs_GetName

private string Docs_GetName( string $id )

  Returns the link text for a given document by its record ID

Parameter
string $id
The record ID of the document
Returns string


Docs_Add

private void Docs_Add( [ integer $use_text ] )

  Adds a document to the system

Parameter
integer $use_text = >>0<<
Optional vlue to indicate whether to use a 32 char key or the link text as the document ID, 1 uses the documents link text, 0 creates a 32 char ID. If this value is not given the default of 0 will be used.
Returns void


Docs_Update

private void Docs_Update( string $id )

  Updates changes made to an existing document in the system

Parameter
string $id
The record ID of the document to be displayed for editing
Returns void


Docs_Delete

private void Docs_Delete( string $id )

  Deletes an existing document from the system

Parameter
string $id
The record ID of the document to be deleted from the system
Returns void


Docs_GetCount

private integer Docs_GetCount( )

  Returns a total count of all documents defined within the system

Returns integer


Docs_ListBox

private void Docs_ListBox( )

  Outputs a number of HTML form option elements containing names of documents defined in the system

Returns void


Nav_Manager

private void Nav_Manager( )

  Outputs the navigation manager interface

Returns void


Nav_Choose

private void Nav_Choose( )

  Updates the active navigation for the site at a global level

Returns void


Nav_ListBox

private void Nav_ListBox( )

  Outputs a number of HTML form option elements containing navigation styles available to the system form the navbar/ directory of the installation

Returns void


Nav_Recurse

private void Nav_Recurse( string $id, [ integer $indent ] )

  Works with Nav_Order () to recursively output the site document structure to the user

Parameter
string $id
The record ID of a given document to recurse from, the supplied record will be used as the starting point for the document recursion
integer $indent = >>0<<
The curent indice of the recursion used to create a spacer to form the document tree view
Returns void


Nav_Order

private void Nav_Order( )

  Outputs the navigation ordering interface

Returns void


Nav_OrderUpdateRecurse

private void Nav_OrderUpdateRecurse( string $id )

  Works with Nav_OrderUpdate () to recursively update the site document structure navigation ordering

Parameter
string $id
The record ID of a given document to recurse from, the supplied record will be used as the starting point for the document recursion
Returns void


Nav_OrderUpdate

private void Nav_OrderUpdate( )

  Updates changes made to the site navigation order

Returns void


Nav_GetLinkText

private string Nav_GetLinkText( string $id )

  Returns the link text for a given document by its record ID

Parameter
string $id
The record ID of the document
Returns string


Nav_GetNav

private array Nav_GetNav( )

  Returns an array containg the ID of all documents defined in the system for use with navigation

Returns array


Nav_GetSubNav

private array Nav_GetSubNav( string $id )

  Returns an array containg the ID of all documents defined in the system beneath a given document by its record ID

Parameter
string $id
The record ID of a document
Returns array


Nav_HasSubNav

private boolean Nav_HasSubNav( string $id )

  Returns TRUE if a given document has existing documents defined as child documents beneath it, returns FALSE otherwise

Parameter
string $id
The record ID of a document
Returns boolean


Nav_GetCount

private integer Nav_GetCount( )

  Retuns a total count of all navigation styles availabkle to the system from the navbar/ directory of the installation

Returns integer


LoadFontsListBox

private void LoadFontsListBox( )

  Ouputs a number of HTML form option elements containing names of fonts available to the system from the fonts/DEFAULT support file

Returns void


GetFontsArray

private array GetFontsArray( )

  Returns an array of font names avaialble to the system from the fonts/DEFAULT support file

Returns array


File_UploadForm

private void File_UploadForm( )

  Outputs the file upload interface

Returns void


File_Upload

private void File_Upload( )

  Uploads a file from the users local hard disk to the webserver and if indicated to do so uses resizeImage () to resixze an image to the specified dimensions after upload

Returns void


File_Manager

private void File_Manager( )

  Outputs the file management interface

Returns void


File_Delete

private void File_Delete( string $filename )

  Deletes a file from the files/ directory of the installation

Parameter
string $filename
The filename of the file that is to be deleted from the files/ directory
Returns void


File_ListBox

private void File_ListBox( )

  Outputs a number of HTML form option elements containg file names from the files/ directory of the installation

Returns void


File_GetCount

private void File_GetCount( )

  Returns a total count of files available to the system located in the files/ directory of the installation

Returns void


Mod_Manager

private void Mod_Manager( )

  Outputs the initial modules management interface to the user, if no modules are present in the mods/ directory of the installation the interface will not be displayed

Returns void


Mod_ListBox

private void Mod_ListBox( )

  Outputs a number of HTML form option elements containing names of modules avaialable to the system from the mods/ directory of the installation

Returns void


Mod_GetCount

private void Mod_GetCount( )

  Returns a total count of all modules avalable to the system from the mods/ directory of the installation

Returns void


Mod_MissingDB

private void Mod_MissingDB( )

  This method is now deprecated

Returns void


resizeImage

private boolean resizeImage( string $image_path, string $thumb_path, string $image_name, integer $thumb_width, integer $thumb_height, string $type )

  Uses GDLib supprt in PHP to resize an uploaded image to specified dimensions. Returns FALSE if the required GDLib support is not enabled for PHP, TRUE otherwise.

Parameter
string $image_path
The source path of the original image
string $thumb_path
The output path of the new image
string $image_name
The filename of the uploaded image
integer $thumb_width
The new width dimension to resize to
integer $thumb_height
The new height dimension to resize to
string $type
String specifying which image MIME type to use either image/gif or image/pjpeg
Returns boolean


Client_GetMETATitle

private string Client_GetMETATitle( string $id )

  Returns the META title for a given document by its record ID

Parameter
string $id
The record ID of the document
Returns string


Client_GetMETAKeywords

private string Client_GetMETAKeywords( string $id )

  Returns the META keywords for a given document by its record ID

Parameter
string $id
The record ID of the document
Returns string


Client_GetMETADescription

private string Client_GetMETADescription( string $id )

  Returns the META description for a given document by its record ID

Parameter
string $id
The record ID of the document
Returns string


Client_GetSkin

private string Client_GetSkin( )

  Returns the current active skin name for the site

Returns string


Client_GetNav

private string Client_GetNav( )

  Returns the current active navigation style for the site

Returns string


Client_GetContent

private void Client_GetContent( string $D, [ string $modVars ] )

  Outputs the content for a requested document, and also optionally processes variables posted for use with any embedded modules in a given doument

Parameter
string $D
The record ID of the requested document content to be displayed
string $modVars = >>""<<
The rA pipe (|) delimited string of variable names posted by a document for use with a given module. If not supplied no module variables will be processed and a default empty string will be used.
Returns void


Client_GetHeader

private void Client_GetHeader( )

  Ouputs the site header as HTML / text or as an image dependingon the configured header display mode

Returns void


Client_GetFooter

private void Client_GetFooter( )

  Outputs the site footer as HTML / text

Returns void


Private Field Details

$dbcon

private integer $dbcon

>><<

Variable used to store the active database connection handle



Packageindex Classtrees Elementlist XML Files
PHPDoc 1.0beta