ossn.lib.system.php File Reference

Go to the source code of this file.

Namespaces

 Informatikon\com
 

Functions

 ossn_recursive_array_search ($needle, $haystack)
 
 ossn_site_url ($extend= '', $action=false)
 
 ossn_get_userdata ($extend= '')
 
 ossn_database_settings ()
 
 ossn_package_information ()
 
 ossn_add_hook ($hook, $type, $callback, $priority=200)
 
 ossn_is_hook ($hook, $type)
 
 ossn_call_hook ($hook, $type, $params=null, $returnvalue=null)
 
 ossn_trigger_callback ($event, $type, $params=null)
 
 ossn_register_callback ($event, $type, $callback, $priority=200)
 
 ossn_site_settings ($setting)
 
 redirect ($new= '')
 
 ossn_access_types ()
 
 ossn_access_validate ($access, $owner)
 
 ossn_is_xhr ()
 
 arraySerialize ($array=NULL)
 
 strl ($str, $limit=NULL, $dots=true)
 
 ossn_site_setting_update ($name, $value, $id)
 
 ossn_system_message_add ($message=null, $register="success", $count=false)
 
 ossn_trigger_message ($message, $type= 'success')
 
 ossn_post_size_exceed_error ($error= 'ossn:post:size:exceed', $redirect=null)
 
 ossn_display_system_messages ()
 
 ossn_site_total_themes ()
 
 ossn_validate_filepath ($path, $append_slash=TRUE)
 
 ossn_error_page ()
 
 ossn_access_id_str ($id)
 
 ossn_validate_access_friends ($owner)
 
 ossn_string_encrypt ($string)
 
 ossn_string_decrypt ($string)
 
 ossn_errros ()
 
 _ossn_php_error_handler ($errno, $errmsg, $filename, $linenum, $vars)
 
 ossn_check_update ()
 
 _ossn_exception_handler ($exception)
 
 ossn_set_ajax_data (array $data=array())
 
 ossn_generate_server_config ($type)
 

Variables

const OSSN_FRIENDS 3
 
const OSSN_PUBLIC 2
 
const OSSN_PRIVATE 1
 
const REF true
 
global $Ossn
 
 $settings = new OssnSite
 
$Ossn siteSettings = $settings->getAllSettings()
 

Function Documentation

_ossn_exception_handler (   $exception)

Add exception handler

Returns
(html); public;

Definition at line 740 of file ossn.lib.system.php.

_ossn_php_error_handler (   $errno,
  $errmsg,
  $filename,
  $linenum,
  $vars 
)

Intercepts catchable PHP errors.

Warning
This function should never be called directly.

Definition at line 682 of file ossn.lib.system.php.

arraySerialize (   $array = NULL)

Serialize Array This starts array from key 1 Don't use this for multidemension arrays

Returns
array

Definition at line 367 of file ossn.lib.system.php.

ossn_access_id_str (   $id)

Acces id to string

Returns
string

Definition at line 588 of file ossn.lib.system.php.

ossn_access_types ( )

Get default access types

Returns
integer[]

Definition at line 322 of file ossn.lib.system.php.

ossn_access_validate (   $access,
  $owner 
)

Validate Access

Returns
bool

Definition at line 335 of file ossn.lib.system.php.

ossn_add_hook (   $hook,
  $type,
  $callback,
  $priority = 200 
)

Add a hook to system, hooks are usefull for callback returns

Parameters
string$hookThe name of the hook
string$typeThe type of the hook
callable$callbackThe name of a valid function or an array with object and method
int$priorityThe priority - 500 is default, lower numbers called first
Returns
bool

Definition at line 114 of file ossn.lib.system.php.

ossn_call_hook (   $hook,
  $type,
  $params = null,
  $returnvalue = null 
)

Call a hook

Parameters
string$hookThe name of the hook
string$typeThe type of the hook
mixed$paramsAdditional parameters to pass to the handlers
mixed$returnvalueAn initial return value
Returns
mix data

Definition at line 173 of file ossn.lib.system.php.

ossn_check_update ( )

Check ossn update version

Returns
(bool); public;

Definition at line 718 of file ossn.lib.system.php.

ossn_database_settings ( )

Get database settings

Returns
object

Definition at line 84 of file ossn.lib.system.php.

ossn_display_system_messages ( )

Display a system messages

$for => for site/frontend or admin/backend

Returns
string|null data

Definition at line 507 of file ossn.lib.system.php.

ossn_error_page ( )

Output Ossn Error page

Returns
mix data

Definition at line 569 of file ossn.lib.system.php.

ossn_errros ( )

Ossn php display erros settings

Returns
(void); pritvate;

Definition at line 645 of file ossn.lib.system.php.

ossn_generate_server_config (   $type)

Generate .htaccess file

Returns
ooolean;

Definition at line 763 of file ossn.lib.system.php.

ossn_get_userdata (   $extend = '')

Get data directory contaning user and system files

$extend => Extned data directory path like /home/htdocs/userdata/my/extend/path

Returns
string

Definition at line 74 of file ossn.lib.system.php.

ossn_is_hook (   $hook,
  $type 
)

Check if the hook exists or not

Parameters
string$hookThe name of the hook
string$typeThe type of the hook
Returns
bool

Definition at line 154 of file ossn.lib.system.php.

ossn_is_xhr ( )

Check if the request is ajax or not

Returns
bool

Definition at line 352 of file ossn.lib.system.php.

ossn_package_information ( )

Get version package file

Returns
SimpleXMLElement

Definition at line 100 of file ossn.lib.system.php.

ossn_post_size_exceed_error (   $error = 'ossn:post:size:exceed',
  $redirect = null 
)

Display a error if post size exceed

Parameters
string$errorLangauge string
string$redirectCustom redirect url

Definition at line 491 of file ossn.lib.system.php.

ossn_recursive_array_search (   $needle,
  $haystack 
)

ossn_recursive_array_search Searches the array for a given value and returns the corresponding key if successful : http://php.net/manual/en/function.array-search.php

Parameters
mixed$needleThe searched value. If needle is a string, the comparison is done in a case-sensitive manner.
array$haystackThe array
Returns
false|integer

Definition at line 42 of file ossn.lib.system.php.

ossn_register_callback (   $event,
  $type,
  $callback,
  $priority = 200 
)

Register a callback

Parameters
string$eventCallback event name
string$typeThe type of the callback $priority callback priority
string$callback
Returns
bool

Definition at line 244 of file ossn.lib.system.php.

ossn_set_ajax_data ( array  $data = array())

Set Ajax Data Use only in action files

Parameters
array$dataA data array
Returns
void

Definition at line 752 of file ossn.lib.system.php.

ossn_site_setting_update (   $name,
  $value,
  $id 
)

Update site settings

$name => settings name $value => new value $id => $settings name

Todo:
remove $id and update without having $id as settings names must be unique
Returns
bool

Definition at line 411 of file ossn.lib.system.php.

ossn_site_settings (   $setting)

Get a site settings

Parameters
string$settingSettings Name like (site_name, language)
Returns
string or null

Definition at line 283 of file ossn.lib.system.php.

ossn_site_total_themes ( )

Count total themes

Returns
(int)

Definition at line 538 of file ossn.lib.system.php.

ossn_site_url (   $extend = '',
  $action = false 
)

Get site url

$extend => Extned site url like http://site.com/my/extended/path

Returns
string

Definition at line 58 of file ossn.lib.system.php.

ossn_string_decrypt (   $string)

Ossn decrypt string

$string a string you want to decrypt

Parameters
string$string
Returns
string string

Definition at line 634 of file ossn.lib.system.php.

ossn_string_encrypt (   $string)

Ossn encrypt string

$string a string you want to encrypt

Parameters
string$string
Returns
string string

Definition at line 621 of file ossn.lib.system.php.

ossn_system_message_add (   $message = null,
  $register = "success",
  $count = false 
)

Add a system messages for users

$messages => Message for user $type = message type $for => for site/frontend or admin/backend $count => count the message

Returns
bool

Definition at line 430 of file ossn.lib.system.php.

ossn_trigger_callback (   $event,
  $type,
  $params = null 
)

Trigger a callback

Parameters
string$eventCallback event name
string$typeThe type of the callback
mixed$paramsAdditional parameters to pass to the handlers
Returns
bool

Definition at line 210 of file ossn.lib.system.php.

ossn_trigger_message (   $message,
  $type = 'success' 
)

Add a system messages for users

$messages => Message for user $type = message type

Returns
void

Definition at line 477 of file ossn.lib.system.php.

ossn_validate_access_friends (   $owner)

Check if loggedin is friend with item owner or if owner is loggedin user;

Returns
bool;

Definition at line 605 of file ossn.lib.system.php.

ossn_validate_filepath (   $path,
  $append_slash = TRUE 
)

Validate filepath , add backslash to end of path

Parameters
string$path
Returns
string;

Definition at line 549 of file ossn.lib.system.php.

redirect (   $new = '')

Redirect a user to specific url

Parameters
string$newuri of page. If it is REF then user redirected to the url that user just came from.
Returns
return

Definition at line 299 of file ossn.lib.system.php.

strl (   $str,
  $limit = NULL,
  $dots = true 
)

Limit a words in a string $str = string; $limit = words limit;

Parameters
integer$limitedit: $arsalanshah
Returns
bool

Definition at line 384 of file ossn.lib.system.php.

Variable Documentation

global $Ossn

Definition at line 25 of file ossn.lib.system.php.

$settings = new OssnSite

Definition at line 26 of file ossn.lib.system.php.

const OSSN_FRIENDS 3

Definition at line 15 of file ossn.lib.system.php.

const OSSN_PRIVATE 1

Definition at line 17 of file ossn.lib.system.php.

const OSSN_PUBLIC 2

Definition at line 16 of file ossn.lib.system.php.

const REF true

Constants

Definition at line 21 of file ossn.lib.system.php.

$Ossn siteSettings = $settings->getAllSettings()

Definition at line 27 of file ossn.lib.system.php.