public function __construct($base_dirname = 'sybase', $playgrounds = array()) { // version check global $my_version; self::$version = $my_sy_version; // register // root object registration. // do once if (empty(self::$pgs)) { if (!session_id()) { session_start(); } self::$pgs['ROOT PLAYGROUND'] = array($this, '_pg_note'); self::$pgs['AJAX LAUNCH PAD'] = array($this, '_pg_ajax'); self::$root = $this; // add hook, create playground page add_action('admin_menu', array($this, 'add_playground_page')); add_action('admin_init', array($this, 'register_playground_settings')); add_action('admin_notices', array($this, 'admin_notices')); } $class_name = get_class($this); define('SY_BASE_DIRNAME', $base_dirname); /* register sub class if provided */ if (is_string($class_name) && class_exists($class_name)) { // regist instance self::$children[$class_name] = $this; // sub classes registeration. if (empty($playgrounds)) { // default registration. self::$pgs[$class_name] = array($this, 'playground'); } elseif (is_array($playgrounds)) { // custom registration. foreach ($playgrounds as $caller) { self::$pgs[$class_name . '-' . $caller['label']] = array($this, $caller['fname']); } } else { throw new Exception('Bad initialize parameter: ONLY array contains "label" (string) and "fname" (string) OR plain class_name (string) are allowed.'); } $this->class_name = $class_name; } }
public function __construct() { parent::__construct(); }