private static function get_instance() { if (false === self::$instance) { self::$instance = new self(); } return self::$instance; }
public function load() { $this->settings = ITSEC_Storage::get($this->get_id()); $defaults = $this->get_defaults(); if (!is_array($this->settings)) { $this->settings = array(); } $this->settings = array_merge($defaults, $this->settings); }
/** * Save the validated form input data. * * This function should be left as-is in subclasses unless widget-specific handling is required. An example where a * custom function could be useful is a widget which stores some input in different locations. * * @access public * * @param array Array of data to be saved. */ protected function save($data) { ITSEC_Storage::set($this->id, $data); }