Exemple #1
0
 function _save_custom_config()
 {
     foreach ($this->_custom_config as $local_key => $constant_pattern) {
         $config_constant = sprintf($constant_pattern, $this->id);
         $new_value = $this->getData($local_key);
         //if the constant is defined and doesn't match the new value, redefine it'
         if (defined($config_constant) && constant($config_constant) != $new_value) {
             AMP_config_write($config_constant, $new_value);
             continue;
         }
         //if a value has been defined and no constant exists, write it to the custom folder
         if ($new_value && !defined($config_constant)) {
             AMP_config_write($config_constant, $new_value);
         }
     }
     /*
     if( defined( 'AMP_RENDER_SEARCH_LIST_SECTION_'.$this->id)) {
         if( constant( 'AMP_RENDER_SEARCH_LIST_SECTION_' . $this->id ) != $this->getData( 'search_custom')) {
             AMP_config_write( 'AMP_RENDER_SEARCH_LIST_SECTION_' . $this->id , $this->getData( 'search_custom'));
         }
     } elseif ( $this->getData( 'search_custom')) {
         AMP_config_write( 'AMP_RENDER_SEARCH_LIST_SECTION_' . $this->id, $this->getData( 'search_custom'));
     }
     */
 }
Exemple #2
0
 function _save_custom_config()
 {
     foreach ($this->_custom_config as $local_key => $constant) {
         $new_value = $this->getData($local_key);
         //if the constant is defined and doesn't match the new value, redefine it'
         if (defined($constant) && constant($constant) != $new_value) {
             AMP_config_write($constant, $new_value);
             continue;
         }
         //if a value has been defined and no constant exists, write it to the custom folder
         if ($new_value && !defined($constant)) {
             AMP_config_write($constant, $new_value);
         }
     }
 }