Class PHPDS_core

Description

PHPDevShell is a RAD Framework aimed at developing administrative applications.

  • author: Jason Schoeman
  • version: 1.0.2 (greg)
  • copyright: Copyright (C) 2007 Jason Schoeman, All rights reserved.
  • link: http://www.phpdevshell.org
  • license: GNU/LGPL,

Located in /PHPDS_core.class.php (line 14)

PHPDS_dependant
   |
   --core
      |
      --PHPDS_core
Method Summary
string absolutePath ($relative_path $relative_path)
string activePlugin ()
string activeTemplate ()
string alertLink (string $alert_msg)
string alertSubmit (string $alert_msg)
string confirmLink (string $confirm_what)
string confirmSubmit (string $confirm_what)
string createRandomString ([integer $length = 4], [boolean $uppercase_only = false])
string formatLocale ([boolean $charset = true], [ $user_language = false], [ $user_region = false])
string formatTimeDate ( $time_stamp, [string $format_type_or_custom = 'default'], [string $custom_timezone = false], integer $timestamp)
string isConstant (string $is_variable_constant)
mixed, loadFile ( $path, [boolean $required = false], [boolean $relative = true], [boolean $once_only = true], string $file_location)
void loadTranslation (string $mo_directory, string $mo_filename, string $textdomain)
void logConfig ()
integer nameToId (string $convert_to_id)
void replaceAccents (string $string)
string rightTrim (string $str, [string $remove = null])
string safeName (string $name, [string $replace = '-'])
string SearchAndReplaceBetween (string $string, string $start, string $end, [string $replace = ''], [ $replace_char = '%'])
void userServerTzDiff ([ $custom_timestamp = false])
string __ (string $say_what, [string $domain = false])
Variables
Methods
absolutePath (line 422)

Turns any given relative path to the absolute version of the path.

  • access: public
string absolutePath ($relative_path $relative_path)
  • $relative_path $relative_path: Provide path like 'test/testpath'
activePlugin (line 320)

Function to return the current running/active plugin.

  • access: public
string activePlugin ()
activeTemplate (line 338)

Function to return the current running/active template.

  • access: public
string activeTemplate ()
alertLink (line 65)

This shows a simple "alert" box which notifies the user about a specified condition.

  • return: Javascript popup warning box.
  • author: Don Schoeman
  • access: public
string alertLink (string $alert_msg)
  • string $alert_msg: The actual warning message.
alertSubmit (line 51)

This shows a simple "alert" box which notifies the user about a specified condition.

  • return: Javascript popup warning box.
  • author: Don Schoeman
  • access: public
string alertSubmit (string $alert_msg)
  • string $alert_msg: The actual warning message.
confirmLink (line 23)

This creates a simple confirmation box to ask users input before performing a critical link click.

  • return: Javascript popup confirmation box.
  • author: Jason Schoeman
  • access: public
string confirmLink (string $confirm_what)
  • string $confirm_what: What is the question to be asked in the confirmation box.
confirmSubmit (line 37)

This creates a simple confirmation box to ask users input before performing a critical submit.

  • return: Javascript popup confirmation box.
  • author: Jason Schoeman
  • access: public
string confirmSubmit (string $confirm_what)
  • string $confirm_what: What is the question to be asked in the confirmation box.
createRandomString (line 185)

This method creates a random string with mixed alphabetic characters.

  • return: Will return required random string.
  • author: Andy Shellam, andy [at] andycc [dot] net
  • access: public
string createRandomString ([integer $length = 4], [boolean $uppercase_only = false])
  • integer $length: The lenght the string should be.
  • boolean $uppercase_only: Should the string be uppercase.
formatLocale (line 214)

Function formats locale according to logged in user settings else will default to system.

  • return: Will return formatted locale.
  • author: Jason Schoeman
  • access: public
string formatLocale ([boolean $charset = true], [ $user_language = false], [ $user_region = false])
  • boolean $charset: Whether the charset should be included in the format.
  • $user_language
  • $user_region
formatTimeDate (line 100)

This method will return the correct user time taking DST and users timezone into consideration.

  • return: Will return a formatted date string ex. 1 June 2011 18:05 PM
  • author: Jason Schoeman
  • version: 1.0.1 Converted to OOP
  • date: 2009/05/19
  • access: public
string formatTimeDate ( $time_stamp, [string $format_type_or_custom = 'default'], [string $custom_timezone = false], integer $timestamp)
  • integer $timestamp: Unix timestamp if empty it will return the current users time.
  • string $format_type_or_custom: User can choose which of the formats to load from the $this->configuration settings, 'default', 'short' or have a custom format.
  • string $custom_timezone: You can also provide a custom timezone to this method, if false, it will use current users timezone.
  • $time_stamp
isConstant (line 79)

Check and returns constant if constant is defined or returns normal variable if no constant defined.

  • return: The actual assigned constant value.
  • author: Jason Schoeman
  • access: public
string isConstant (string $is_variable_constant)
  • string $is_variable_constant: The string to check whether variable or constant.
loadCoreLanguage (line 276)

This method loads the core language array and assigns it to a variable.

  • author: Jason Schoeman
  • access: public
void loadCoreLanguage ()
loadDefaultPluginLanguage (line 307)

This method loads the plugin language with default items and icons array.

  • author: Jason Schoeman
  • access: public
void loadDefaultPluginLanguage ()
loadFile (line 443)

Assumes role of loading files.

  • return: whatever the file returned when executed or false if it couldn't be found
  • author: jason
  • version: 1.1
  • date: 20100106 (v1.1) (greg) moved from core to PHPDS_core and added a few checks
  • access: public
mixed, loadFile ( $path, [boolean $required = false], [boolean $relative = true], [boolean $once_only = true], string $file_location)
  • string $file_location
  • boolean $required: Should the file be required or else included.
  • boolean $relative: Is this a relative path, if true, it will be converted to absolute path.
  • boolean $once_only: Should it be called only once?
  • $path
loadMenuLanguage (line 287)

This method loads the default menu language array and assigns it to a variable.

  • author: Jason Schoeman
  • access: public
void loadMenuLanguage ()
loadTranslation (line 248)

This methods allows you to load translation by giving their locations and name.

  • author: Jason Schoeman
  • access: public
void loadTranslation (string $mo_directory, string $mo_filename, string $textdomain)
  • string $mo_directory: This is the location where language mo file is found.
  • string $mo_filename: The mo filename the translation is compiled in.
  • string $textdomain: The actual text domain identifier.
logConfig (line 548)

Will log current configuration data to firephp.

  • access: public
void logConfig ()
nameToId (line 357)

Convert string unsigned CRC32 value. This is unique and can help predict a entries id beforehand.

Use for folder names insuring unique id's.

  • author: Jason Schoeman
  • access: public
integer nameToId (string $convert_to_id)
  • string $convert_to_id: To convert to integer.
replaceAccents (line 412)

Replaces accents with plain text for a given string.

  • access: public
void replaceAccents (string $string)
  • string $string
rightTrim (line 371)

Strip a string from the end of a string.

Is there no such function in PHP?

  • return: the modified string.
  • access: public
string rightTrim (string $str, [string $remove = null])
  • string $str: The input string.
  • string $remove: OPTIONAL string to remove.
safeName (line 395)

This method simply renames a string to safe unix standards.

  • access: public
string safeName (string $name, [string $replace = '-'])
  • string $name
  • string $replace: Replace odd characters with what?
SearchAndReplaceBetween (line 509)

This is a handy little function to strip out a string between two specified pieces of text.

This could be used to parse XML text, bbCode, or any other delimited code/text for that matter. Can also return all text with replaced string between tags.

  • access: public
string SearchAndReplaceBetween (string $string, string $start, string $end, [string $replace = ''], [ $replace_char = '%'])
  • string $string
  • string $start
  • string $end
  • string $replace: Use %s to be replaced with the string between tags.
  • $replace_char
userServerTzDiff (line 154)
  • access: public
void userServerTzDiff ([ $custom_timestamp = false])
  • $custom_timestamp
__ (line 539)

Method is used to wrap the gettext international language conversion tool inside PHPDevShell.

Converts text to use gettext PO system.

  • return: Will return converted string or same string if not available.
  • author: Jason Schoeman
  • access: public
string __ (string $say_what, [string $domain = false])
  • string $say_what: The string required to output or convert.
  • string $domain: Override textdomain that should be looked under for this text string.

Inherited Methods

Inherited From core

core::absolute_path()
core::active_plugin()
core::active_template()
core::alert_link()
core::alert_submit()
core::confirm_link()
core::confirm_submit()
core::create_random_string()
core::define_lang()
core::format_locale()
core::format_time_date()
core::is_constant()
core::load_core_language()
core::load_default_plugin_language()
core::load_file()
core::load_menu_language()
core::load_translation()
core::log_config()
core::name_to_id()
core::replace_accents()
core::right_trim()
core::safe_name()
core::user_server_tz_diff()

Inherited From PHPDS_dependant

PHPDS_dependant::__construct()
PHPDS_dependant::construct()
PHPDS_dependant::debugInstance()
PHPDS_dependant::factory()
PHPDS_dependant::factoryWith()
PHPDS_dependant::info()
PHPDS_dependant::log()
PHPDS_dependant::PHPDS_dependance()
PHPDS_dependant::_log()
PHPDS_dependant::__call()
PHPDS_dependant::__get()
PHPDS_dependant::__set()

Documentation generated on Tue, 09 Aug 2011 09:05:02 +0200 by phpDocumentor 1.4.3