Esempio n. 1
0
 private static function get_instance()
 {
     if (false === self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 /**
  * 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);
 }