public function options_init()
 {
     $fm = new Fieldmanager_Group(array('name' => 'option_fields', 'limit' => 0, 'add_more_label' => 'Add another Meta Box', 'sortable' => true, 'collapsible' => true, 'label' => 'Meta Box', 'children' => array('repeatable_group' => new Fieldmanager_Group(array('limit' => 0, 'add_more_label' => 'Add another set of fields', 'sortable' => true, 'label' => 'Fields', 'children' => array('text' => new Fieldmanager_Textfield('Text Field'), 'autocomplete' => new Fieldmanager_Autocomplete('Autocomplete', array('datasource' => new Fieldmanager_Datasource_Post())), 'local_data' => new Fieldmanager_Autocomplete('Autocomplete without ajax', array('datasource' => new Fieldmanager_Datasource(array('options' => $this->months)))), 'textarea' => new Fieldmanager_TextArea('TextArea'), 'media' => new Fieldmanager_Media('Media File'), 'checkbox' => new Fieldmanager_Checkbox('Checkbox'), 'radios' => new Fieldmanager_Radios('Radio Buttons', array('options' => array('One', 'Two', 'Three'))), 'select' => new Fieldmanager_Select('Select Dropdown', array('options' => array('One', 'Two', 'Three'))), 'richtextarea' => new Fieldmanager_RichTextArea('Rich Text Area')))))));
     $fm->activate_submenu_page();
 }
 /**
  * Add in a FM_Byline meta box w/ all it's bells and whistles
  * @param string $type
  * @param string. Optional label
  * @param array $args
  */
 function add_byline_meta_box($type = 'author', $label = null, $args = array())
 {
     if (is_admin()) {
         $context = fm_get_context();
         $fm_context = $context[0];
         $fm_context_type = $context[1];
         $label = empty($label) ? fm_bylines_wordify_slug($type) : $label;
         $defaults = array('name' => 'fm_bylines_' . sanitize_title_with_dashes($type), 'limit' => 0, 'add_more_label' => __('Add another', 'fm_bylines'), 'sortable' => true, 'label' => __('Name', 'fm_bylines'), 'children' => array('byline_id' => new Fieldmanager_Autocomplete(array('default_value' => null, 'datasource' => new Fieldmanager_Datasource_Post(array('query_args' => array('post_type' => $this->name, 'no_found_rows' => true, 'ignore_sticky_posts' => true, 'post_status' => 'publish', 'suppress_filters' => false))))), 'fm_byline_type' => new Fieldmanager_Hidden(array('default_value' => sanitize_title_with_dashes($type)))));
         $fm_byline_box = new Fieldmanager_Group(wp_parse_args($args, $defaults));
         if ('post' == $fm_context) {
             $fm_byline_box->add_meta_box($label, $fm_context_type, apply_filters('fm_bylines_' . sanitize_title_with_dashes($type) . '_filter_post_metabox_context', 'normal'), apply_filters('fm_bylines_' . sanitize_title_with_dashes($type) . '_filter_post_metabox_priority', 'default'));
         } elseif ('term' == $fm_context) {
             $fm_byline_box->add_term_form($label, $fm_context_type);
         } elseif ('submenu' == $fm_context) {
             fm_register_submenu_page('fm_bylines_' . sanitize_title_with_dashes($type), apply_filters('fm_bylines_' . sanitize_title_with_dashes($type) . '_filter_metabox_submenu', 'tools.php'), $label);
             $fm_byline_box->activate_submenu_page();
         } elseif ('user' == $fm_context) {
             $fm_byline_box->add_user_form($label);
         } elseif ('quickedit' == $fm_context) {
             $fm_byline_box->add_quickedit_box($label, $fm_context_type, function ($post_id, $data) {
                 return !empty($data['fm_bylines_' . sanitize_title_with_dashes($type)]) ? $data['fm_bylines_' . sanitize_title_with_dashes($type)] : 'not set';
             });
         }
     }
 }
 /**
  * Add the ad layer priority management page.
  *
  * @access public
  */
 public function add_layer_priority_settings()
 {
     $fm_priority = new Fieldmanager_Group(array('name' => 'ad_layers', 'sortable' => true, 'collapsible' => true, 'collapsed' => true, 'limit' => 0, 'extra_elements' => 0, 'label' => __('Ad Layer', 'ad-layers'), 'label_macro' => array(__('%s', 'ad-layers'), 'title'), 'children' => array('post_id' => new Fieldmanager_Hidden(), 'title' => new Fieldmanager_Textfield(array('label' => __('Title', 'ad-layers'), 'attributes' => array('readonly' => 'readonly'))))));
     $fm_priority->activate_submenu_page();
 }
 public function settings()
 {
     $fm = new Fieldmanager_Group(array('name' => 'rss_datasource_settings', 'children' => array('urls' => new Fieldmanager_Link(array('label' => __('Feed URLs', 'fm-datasource-rss'), 'one_label_per_item' => false, 'limit' => 0, 'extra_elements' => 0, 'minimum_count' => 1, 'add_more_label' => __('Add another feed', 'fm-datasource-rss'))))));
     $fm->activate_submenu_page();
 }
 /**
  * Add the ad server settings page.
  *
  * @access public
  */
 public function add_settings_page($args = array())
 {
     // Provide basic ad server selection.
     $args = array('name' => $this->option_name, 'label' => __('Ad Server Settings', 'ad-layers'), 'children' => array('ad_server' => new Fieldmanager_Select(array('label' => __('Ad Server', 'ad-layers'), 'options' => $this->get_ad_server_options(), 'first_empty' => true))));
     // Child classes can add additional functionality.
     $args['children'] = array_merge($args['children'], $this->get_settings_fields());
     $fm_ad_servers = new Fieldmanager_Group($args);
     $fm_ad_servers->activate_submenu_page();
 }
示例#6
0
 /**
  * Sets up admin page.
  * @return void
  */
 public function settings()
 {
     $fm = new \Fieldmanager_Group(array('name' => self::OPTION, 'limit' => 10, 'add_more_label' => __('Add another item', 'mindseyesociety'), 'sortable' => true, 'label' => __('Carousel Item', 'mindseyesociety'), 'children' => array('image' => new \Fieldmanager_Media(array('label' => __('Image', 'mindseyesociety'), 'preview_size' => 'thumbnail')), 'link' => new \Fieldmanager_Link(array('label' => __('URL', 'mindseyesociety'), 'inline_label' => true)), 'external' => new \Fieldmanager_Checkbox(array('label' => __('Open in new window', 'mindseyesociety'), 'inline_label' => true)))));
     $fm->activate_submenu_page();
 }