<select id="mab-post-action-box" class="large-text" name="mabpostmeta[post-action-box]" > <?php $selected_action_box = isset($meta['post-action-box']) ? $meta['post-action-box'] : 'default'; ?> <option value="none" <?php selected($selected_action_box, 'none'); ?> >Disable</option> <option value="default" <?php selected($selected_action_box, 'default'); ?> >Use Default</option> <?php //Get action boxes available $action_boxes_obj = get_posts(array('numberposts' => -1, 'orderby' => 'title date', 'post_type' => $MabBase->get_post_type())); foreach (MAB_ActionBox::getAll() as $action_box) { ?> <option value="<?php echo $action_box->ID; ?> " <?php selected($selected_action_box, $action_box->ID); ?> ><?php echo $action_box->post_title; ?> </option> <?php } ?> </select>
function displayStyleSettingsPage() { global $mabStyleKey; $MabBase = MAB(); $MabDesign = MAB('design'); $data = array(); $key = isset($_GET['mab-style-key']) ? absint($_GET['mab-style-key']) : null; $mabStyleKey = $key; if ($key !== null && $this->isValidStyleKey($key)) { //edit a style $style = $MabDesign->getConfiguredStyle($key); $action = 'edit'; } else { //add new style $style = $MabDesign->getDefaultSettings(); $action = 'add'; } //TODO: add reset? $data['key'] = $key; $data['settings'] = $style; $data['action'] = $action; $data['actionboxes'] = MAB_ActionBox::getAll(); $data['base-styles'] = ProsulumMabDesign::baseStyles(); $filename = $this->getSettingsViewTemplate('style-settings'); $output = ProsulumMabCommon::getView($filename, $data); echo $output; }