function ocmx_layout_refresh() { global $theme_options; require_once get_template_directory() . "/ocmx/theme-setup/theme-options.php"; update_option("ocmx_home_page_layout", $_GET["layout"]); $use_option = $_GET["layout_option"]; if ($use_option != '' && isset($theme_options[$use_option])) { layout_form($theme_options[$use_option]); } die(""); }
function ocmx_layout_options($input) { global $theme_options; // Set the form value if (get_option($input["id"]) != '') { $layout_value = get_option($input["id"]); } elseif (isset($input["default"])) { $layout_value = $input["default"]; } else { $layout_value = ''; } // Set the layout form to null until we grab it from the layout loop below. $layout_form = ''; // Set the main label & description if (isset($input["main_section"])) { $label = $input["main_section"]; if (isset($input["main_description"])) { $desc = '<p>' . $input["main_description"] . '</p>'; } } else { $label = $input["label"]; if (isset($input["description"])) { $desc = '<p>' . $input["description"] . '</p>'; } } ?> <li class="admin-block-item"> <div class="admin-description"> <h4><?php echo $label; ?> </h4> <?php if (isset($desc)) { echo $desc; } ?> </div> <div class="layout-content"> <ul class="layout-options"> <?php foreach ($input["options"] as $layout_option => $option_list) { ?> <?php if (get_option($input["id"]) == $layout_option) { $class = 'class="layout-select"'; if (isset($option_list["load_options"])) { $layout_form = $option_list["load_options"]; } } else { $class = ''; } ?> <li <?php echo $class; ?> > <a href="#" id="ocmx_layout_<?php echo $layout_option; ?> " class="layout-image" data-layout="<?php echo $layout_option; ?> " data-input="<?php echo $input["id"]; ?> " data-options="<?php if (isset($option_list["load_options"])) { echo $option_list["load_options"]; } ?> "> <h4><?php echo $option_list["label"]; ?> </h4> <?php if (isset($option_list["description"]) != '') { ?> <p><?php echo $option_list["description"]; ?> </p> <?php } ?> </a> </li> <?php } ?> </ul> </div> <!-- Layout Option Value --> <input type="hidden" name="<?php echo $input["id"]; ?> " id="<?php echo $input["id"]; ?> " value="<?php echo $layout_value; ?> " /> <ul class="form-options contained-forms <?php if (empty($theme_options[$layout_form])) { ?> no_display<?php } ?> " id="<?php echo $input["id"]; ?> _form"> <?php if ($layout_form != '') { layout_form($theme_options[$layout_form]); } ?> </ul> </li> <?php }