Exemplo n.º 1
0
 /**
  * Load plugin settings
  * 
  * @access public
  * @return array
  */
 public function plugin_settings()
 {
     $this->settings = chimpy_lite_plugin_settings();
     $results = array();
     // Iterate over settings array and extract values
     foreach ($this->settings as $page => $page_value) {
         foreach ($page_value['children'] as $subpage => $subpage_value) {
             foreach ($subpage_value['children'] as $section => $section_value) {
                 foreach ($section_value['children'] as $field => $field_value) {
                     if (isset($field_value['default'])) {
                         $results['chimpy_lite_' . $field] = $field_value['default'];
                     }
                 }
             }
         }
     }
     return array_merge($results, get_option('chimpy_lite_options', $results));
 }
Exemplo n.º 2
0
 /**
  * Loads (and sets) configuration values from structure file and database
  * 
  * @access public
  * @return void
  */
 public function get_config()
 {
     // Settings tree
     $this->settings = chimpy_lite_plugin_settings();
     // Load some data from config
     $this->hints = $this->options('hint');
     $this->validation = $this->options('validation', true);
     $this->titles = $this->options('title');
     $this->options = $this->options('values');
     $this->section_info = $this->get_section_info();
     $this->default_tabs = $this->get_default_tabs();
 }