Exemple #1
1
 public function _settings_form_save($data)
 {
     fw_set_db_settings_option(null, array_merge((array) fw_get_db_settings_option(), fw_get_options_values_from_input(fw()->theme->get_settings_options())));
     FW_Flash_Messages::add('fw_settings_form_saved', __('Options successfuly saved', 'fw'), 'success');
     $data['redirect'] = fw_current_url();
     return $data;
 }
function delete_builder_template()
{
    $path = 'builder_template/' . $_POST['builder_type'];
    $db_options = fw_get_db_settings_option($path);
    fw_aku(FW_Request::POST('uniqid'), $db_options);
    fw_set_db_settings_option($path, $db_options);
}
Exemple #3
0
 public function _settings_form_save($data)
 {
     $flash_id = 'fw_settings_form_save';
     $old_values = (array) fw_get_db_settings_option();
     if (!empty($_POST['_fw_reset_options'])) {
         // The "Reset" button was pressed
         fw_set_db_settings_option(null, array());
         FW_Flash_Messages::add($flash_id, __('The options were successfully reset', 'fw'), 'success');
         do_action('fw_settings_form_reset', $old_values);
     } else {
         // The "Save" button was pressed
         fw_set_db_settings_option(null, fw_get_options_values_from_input(fw()->theme->get_settings_options()));
         FW_Flash_Messages::add($flash_id, __('The options were successfully saved', 'fw'), 'success');
         do_action('fw_settings_form_saved', $old_values);
     }
     $redirect_url = fw_current_url();
     $data['redirect'] = $redirect_url;
     return $data;
 }
Exemple #4
-5
 public function _settings_form_save($data)
 {
     $flash_id = 'fw_settings_form_save';
     $old_values = (array) fw_get_db_settings_option();
     if (!empty($_POST['_fw_reset_options'])) {
         // The "Reset" button was pressed
         fw_set_db_settings_option(null, array());
         FW_Flash_Messages::add($flash_id, __('The options were successfully reset', 'fw'), 'success');
         do_action('fw_settings_form_reset', $old_values);
     } else {
         // The "Save" button was pressed
         fw_set_db_settings_option(null, array_merge($old_values, fw_get_options_values_from_input(fw()->theme->get_settings_options())));
         FW_Flash_Messages::add($flash_id, __('The options were successfully saved', 'fw'), 'success');
         do_action('fw_settings_form_saved', $old_values);
     }
     $redirect_url = fw_current_url();
     $focus_tab_input_name = '_focus_tab';
     $focus_tab_id = trim(FW_Request::POST($focus_tab_input_name));
     if (!empty($focus_tab_id)) {
         $redirect_url = add_query_arg($focus_tab_input_name, $focus_tab_id, remove_query_arg($focus_tab_input_name, $redirect_url));
     }
     $data['redirect'] = $redirect_url;
     return $data;
 }