Class core

Description

This class contains general functions to use all over the system.

  • author: Jason Schoeman
  • version: 1.0.2 (greg)
  • deprecated:

Located in /legacy/core.class.php (line 19)

PHPDS_dependant
   |
   --core
Direct descendents
Class Description
PHPDS_core PHPDevShell is a RAD Framework aimed at developing administrative applications.
Method Summary
string absolute_path ($relative_path $relative_path)
string active_plugin ()
string active_template ()
string alert_link (string $alert_msg)
string alert_submit (string $alert_msg)
string confirm_link (string $confirm_what)
string confirm_submit (string $confirm_what)
string create_random_string ([integer $length = 4], [boolean $uppercase_only = false])
void define_lang ()
string format_locale ([boolean $charset = true], [ $user_language = false], [ $user_region = false])
string format_time_date ( $time_stamp, [string $format_type_or_custom = 'default'], [string $custom_timezone = false], integer $timestamp)
string is_constant (string $is_variable_constant)
mixed load_file ( $path, [boolean $required = false], [boolean $relative = true], [boolean $once_only = true], string $file_location)
void load_translation (string $mo_directory, string $mo_filename, string $textdomain)
void log_config ()
integer name_to_id (string $convert_to_id)
string replace_accents (string $string)
string right_trim (string $str, [string $remove = null])
string safe_name (string $name, [string $replace = '-'])
integer user_server_tz_diff ([integer $custom_timestamp = false])
Variables
Methods
absolute_path (line 294)

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

  • deprecated: use absolutePath
  • access: public
string absolute_path ($relative_path $relative_path)
  • $relative_path $relative_path: Provide path like 'test/testpath'
active_plugin (line 214)

Function to return the current running/active plugin.

  • deprecated: use activePlugin
  • access: public
string active_plugin ()
active_template (line 226)

Function to return the current running/active template.

  • deprecated: use activeTemplate
  • access: public
string active_template ()
alert_link (line 68)

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

  • return: Javascript popup warning box.
  • author: Don Schoeman
  • deprecated: use alertLink
  • access: public
string alert_link (string $alert_msg)
  • string $alert_msg: The actual warning message.
alert_submit (line 55)

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

  • return: Javascript popup warning box.
  • author: Don Schoeman
  • deprecated: use alertSubmit
  • access: public
string alert_submit (string $alert_msg)
  • string $alert_msg: The actual warning message.
confirm_link (line 29)

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

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

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

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

This method creates a random string with mixed alphabetic characters.

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

Turn $lang variables into constants.

  • author: Jason Schoeman
  • deprecated:
  • access: public
void define_lang ()
format_locale (line 142)

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

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

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
  • deprecated: use formatTimeDate
  • date: 2009/05/19
  • access: public
string format_time_date ( $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
is_constant (line 81)

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
  • deprecated: use isConstant
  • access: public
string is_constant (string $is_variable_constant)
  • string $is_variable_constant: The string to check whether variable or constant.
load_core_language (line 166)

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

  • author: Jason Schoeman
  • deprecated: use loadCoreLanguage
  • access: public
void load_core_language ()
load_default_plugin_language (line 188)

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

  • author: Jason Schoeman
  • deprecated: use loadDefaultPluginLanguage
  • access: public
void load_default_plugin_language ()
load_file (line 314)

Assumes role of loading files.

  • author: jason
  • version: 1.1
  • deprecated: use loadFile
  • date: 2010106 (v1.1) (greg) moved from core to PHPDS_core and added a few checks
  • access: public
mixed load_file ( $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
load_menu_language (line 177)

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

  • author: Jason Schoeman
  • deprecated: use loadMenuLanguage
  • access: public
void load_menu_language ()
load_translation (line 156)

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

  • author: Jason Schoeman
  • deprecated: use loadTranslation
  • access: public
void load_translation (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.
log_config (line 325)

Will log current configuration data to firephp.

  • deprecated: use logConfig
  • access: public
void log_config ()
name_to_id (line 241)

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
  • deprecated: use nameToId
  • access: public
integer name_to_id (string $convert_to_id)
  • string $convert_to_id: To convert to integer.
replace_accents (line 282)

Replaces accents with plain text for a given string.

  • deprecated: use replaceAccents
  • access: public
string replace_accents (string $string)
  • string $string
right_trim (line 256)

Strip a string from the end of a string.

Is there no such function in PHP?

  • return: the modified string.
  • deprecated: use rightTrim
  • access: public
string right_trim (string $str, [string $remove = null])
  • string $str: The input string.
  • string $remove: OPTIONAL string to remove.
safe_name (line 270)

This method simply renames a string to safe unix standards.

  • deprecated: use safeName
  • access: public
string safe_name (string $name, [string $replace = '-'])
  • string $name
  • string $replace: Replace odd characters with what?
user_server_tz_diff (line 114)

and the server's configured timezone (under General Settings). If the server timezone is 2 hours behind the user timezone, it will return -7200 for example. If the server timezone is 2 hours ahead of the user timezone, it will return 7200.

  • return: The difference between the user's timezone and server timezone (in seconds).
  • author: Don Schoeman
  • deprecated: use userServerTzDiff
  • access: public
integer user_server_tz_diff ([integer $custom_timestamp = false])
  • integer $custom_timestamp: Timestamp to compare dates timezones in the future or past.

Inherited Methods

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:04:45 +0200 by phpDocumentor 1.4.3