* */ function Main() { global $wpdb,$flutter_domain; //FlutterLayoutBlock::UpdateModuleSettings(get_template_directory().'/configure.xml', -1, '-', get_option('template')); $template = get_option('template'); $template_module_id = $wpdb->get_var("SELECT module_id FROM ".FLUTTER_TABLE_LAYOUT_MODULES." WHERE theme = '{$template}'"); $moduleSettings = FlutterLayoutBlock::GetModuleSettings($template_module_id); if (!$moduleSettings) die(__('This theme has no settings', $flutter_domain)); if (isset($_POST['_savesetttings'])){ foreach($moduleSettings->variables as $varKey => $variable) { $moduleSettings->variables[$varKey]->value = $_POST[$variable->variable_name]; } $moduleSettings->SaveValues(); } ?>
';
}
/**
* Remove a setting layout option
*/
function remove_layout_setting(){
global $wpdb;
if (!is_user_logged_in()){
wp_redirect('?page=' . urlencode(FLUTTER_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'RCCWP_Menu.php'));
}
if(empty($_GET['element_id']) || !is_int($_GET['element_id'])){
wp_redirect('?page=' . urlencode(FLUTTER_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'RCCWP_Menu.php'));
}
$wpdb->query("DELETE FROM ".FLUTTER_TABLE_LAYOUT_VARIABLES." WHERE variable_id = ".$_GET['element_id']);
wp_redirect('?page=RCCWP_ThemeSettingsPage');
}
function finish_create_layout_element(){
global $flutter_domain,$wpdb;
$template = get_option('template');
$layout_id = $wpdb->get_var("SELECT block_id FROM ".FLUTTER_TABLE_LAYOUT_MODULES." WHERE theme = '{$template}'");
if(!empty($_POST['variable_name'])){
$types = array(
1 => 'textbox',
2 => 'multiline Textbox',
3 => 'checkbox',
4 => 'checkbox List',
5 => 'radiobutton List',
6 => 'dropdown List',
7 => 'listbox',
8 => 'file',
9 => 'image',
10 => 'date',
11 => 'audio' ,
12 => 'Color Picker',
13 => 'Slider'
);
$_POST['variable_name'] = trim($_POST['variable_name']);
$_POST['variable_name'] = str_replace(" ","_",$_POST['variable_name']);
$wpdb->query("INSERT INTO ".FLUTTER_TABLE_LAYOUT_VARIABLES." (variable_name,type,description,parent) VALUES ('{$_POST['variable_name']}','{$types[$_POST['custom-field-type']]}','{$_POST['description']}',{$layout_id});");
wp_redirect('?page=RCCWP_ThemeSettingsPage');
}
}
function create_layout_element(){
global $flutter_domain;
?>