* */ 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(); } ?>

variables as $variable) { $variable->properties = array(); $inputName = $variable->variable_name; $variableValue = $variable->value; ?>
description ?> type) { case 'textbox' : $variable->properties['size'] = ""; RCCWP_WritePostPage::TextboxInterface($variable, $inputName, 0, 0, $variableValue); break; case 'multiline_textbox' : $variable->properties['height'] = "10"; $variable->properties['width'] = "10"; RCCWP_WritePostPage::MultilineTextboxInterface($variable, $inputName, 0, 0, $variableValue); break; case 'checkbox' : RCCWP_WritePostPage::CheckboxInterface($variable, $inputName, 0, 0, $variableValue); break; case 'checkbox_list' : RCCWP_WritePostPage::CheckboxListInterface($variable, $inputName, 0, 0, $variableValue); break; case 'radiobutton_list' : RCCWP_WritePostPage::RadiobuttonListInterface($variable, $inputName, 0, 0, $variableValue); break; case 'dropdown_list' : RCCWP_WritePostPage::DropdownListInterface($variable, $inputName, 0, 0, $variableValue); break; case 'listbox' : $variable->properties['size'] = ""; RCCWP_WritePostPage::ListboxInterface($variable, $inputName, 0, 0, $variableValue); break; case 'file' : RCCWP_WritePostPage::FileInterface($variable, $inputName, 0, 0, $variableValue); break; case 'image' : RCCWP_WritePostPage::PhotoInterface($variable, $inputName, 0, 0, $variableValue); break; case 'date' : $variable->properties['format'] = "m.d.y"; RCCWP_WritePostPage::DateInterface($variable, $inputName, 0, 0, $variableValue); break; case 'audio' : RCCWP_WritePostPage::AudioInterface($variable, $inputName, 0, 0, $variableValue); break; case 'Color Picker' : RCCWP_WritePostPage::ColorPickerInterface($customField, $inputName, 0, 0,$variableValue); break; case 'Slider' : RCCWP_WritePostPage::SliderInterface($customField, $inputName, 0, 0,$variableValue); break; } ?>

*/ function show_layout_settings(){ global $flutter_domain,$wpdb; $template = get_option('template'); $registered_layout = $wpdb->get_var("SELECT COUNT(*) FROM ".FLUTTER_TABLE_LAYOUT_MODULES." WHERE theme = '{$template}'"); if($registered_layout == 0){ $wpdb->query("INSERT INTO ".FLUTTER_TABLE_LAYOUT_MODULES." (module_id,theme,page,duplicate_id) VALUES (-1,'{$template}','-',0)"); }else{ $template_module_id = $wpdb->get_var("SELECT module_id FROM ".FLUTTER_TABLE_LAYOUT_MODULES." WHERE theme = '{$template}'"); } if(!empty($_GET['flutter_action']) && $_GET['flutter_action'] == "create-layout-setting"){ RCCWP_ThemeSettingsPage::create_layout_element(); exit(); } ?> "; $table_header .= "".__('Name',$flutter_domain)."".__('Actions',$flutter_domain).""; $table_body = ""; $table_footer = ""; if(empty($modules->variables)){ echo "

".__("You don't have any setting created, start creating one",$flutter_domain)."

"; echo "
Add new layout setting"; exit(); } foreach($modules->variables as $varkey => $variable){ if(empty($class)){ $class = ""; } $class = $class == '' ? 'alternate' : ''; $table_body .= ""; $table_body .= "{$variable->variable_name}"; $table_body .= ""; $table_body .= "".__("Delete",$flutter_domain).""; $table_body .= ""; } echo $table_header.$table_body.$table_footer; echo "

". __('add new template option',$flutter_domain).""; echo "

"; echo ''; } /** * 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; ?>


name == RCCWP_CustomField::GetDefaultCustomFieldType() ? 'checked="checked"' : ''; ?>