Esempio n. 1
0
 /**
  * <p><b>Desc:</b> Method handler for restoring the original plugin
  * preset defaults</p>
  * @access public
  * 
  * @since 0.1.0
  * 
  * @uses APLPresetDbObj::set_to_defaults()
  * @uses APLPresetDbObj::options_save_db()
  * 
  * @tutorial 
  *  <ol>
  * <li value="1">Grab the javascript ajax reference.</li>
  * <li value="2">Get preset options for a temp and a current varible.</li>
  * <li value="3">Set temp to default preset_database_object.</li>
  * <li value="4">Add default presets to current preset_database_object.</li>
  * <li value="5">Save current preset database varible.</li>
  * <li value="6"><i>Echo/Return</i> preset values.</li>
  * </ol>
  */
 public function APL_handler_restore_preset()
 {
     //STEP 1
     check_ajax_referer("APL_handler_restore_preset");
     //STEP 2
     $presetDbObj = new APLPresetDbObj('default');
     $tmpDbObj = new APLPresetDbObj('default');
     //STEP 3
     $tmpDbObj->set_to_defaults();
     //STEP 4
     foreach ($tmpDbObj->_preset_db as $key => $value) {
         $presetDbObj->_preset_db->{$key} = $value;
     }
     //STEP 5
     $presetDbObj->options_save_db();
     //STEP 6
     echo json_encode($presetDbObj->_preset_db);
 }