function section_opts() { $opts = array(array('type' => 'select', 'key' => 'format', 'label' => __('Listen Section Format', 'pl-section-listen'), 'opts' => array('masthead' => array('name' => __('Media On Top', 'pl-section-listen')), 'masthead-flip' => array('name' => __('Media On Bottom', 'pl-section-listen')), 'hero' => array('name' => __('Media On Right', 'pl-section-listen')), 'hero-flip' => array('name' => __('Media On Left', 'pl-section-listen')), 'callout' => array('name' => __('Inline Player Left', 'pl-section-listen')), 'callout-flip' => array('name' => __('Inline Player Right', 'pl-section-listen')))), array('type' => 'multi', 'opts' => array(array('key' => 'header', 'default' => 'Listen Title.', 'type' => 'text', 'label' => __('Listen Title', 'pl-section-listen'), 'help' => __('Put the name of your audio / video file here.', 'pl-section-listen')), array('key' => 'subheader', 'type' => 'html', 'label' => __('Audio / Video File Location', 'pl-section-listen'), 'help' => __('Place any HTML5 audio file location or Flash Player Code Here. Please visit http://shoutcastwidgets.com/flash_player_generator.php to generate this code.', 'pl-section-listen')), array('type' => 'image_upload', 'key' => 'media', 'label' => __('Logo Or Media Image', 'pl-section-listen')))), array('type' => 'multi', 'title' => __('Listen Links', 'pl-section-listen'), 'opts' => array(array('title' => __('Listen Link One', 'pl-section-listen'), 'type' => 'multi', 'stylize' => 'button-config', 'opts' => pl_button_link_options('button_primary')), array('title' => __('Listen Link Two', 'pl-section-listen'), 'type' => 'multi', 'stylize' => 'button-config', 'opts' => pl_button_link_options('button_secondary')))), array('type' => 'multi', 'title' => __('Footer And Player Scripts Region', 'pl-section-listen'), 'opts' => array(array('key' => 'text', 'type' => 'richtext', 'label' => __('Footer Area Text', 'pl-section-listen'), 'help' => __('Put any additional information about your audio / video file. This will be placed below content.', 'pl-section-listen')), array('type' => 'html', 'key' => 'media_html', 'label' => __('Shoutcast And Other Scripts Area', 'pl-section-listen'), 'help' => __('Use CentroCast or other hosting scripts here to display your stream information', 'pl-section-listen'))))); return $opts; }
function section_opts() { $opts = array(array('title' => __('Button Setup', 'pl-platform'), 'type' => 'multi', 'stylize' => 'button-config', 'opts' => pl_button_link_options('button', array('button_text' => __('Click me', 'pl-platform'), 'button' => '#')))); return $opts; }
/** * Return the option array information * for a commonly used option type */ function pl_std_opt($type, $additions = array()) { if ('image' == $type) { $o = array('type' => 'image_upload'); } elseif ('icons' == $type) { $o = array('type' => 'textarea', 'place' => "facebook http://facebook.com/pagelines\ntwitter http://twitter.com/pagelines", 'ref' => __('<p>Add linked icons using slug/url pairs.</p><p>Add each on a new line. <br/><strong>Format:</strong><br/> [icon slug] [link url]</p><p/><strong>Example:</strong><br/> facebook http://facebook.com/you</p> <p>Use <a href="https://fortawesome.github.io/Font-Awesome/icons/">Font Awesome</a> to get the icon slug.</p>', 'pl-platform')); } elseif ('icon' == $type) { $o = array('type' => 'select_icon', 'default' => 'ok'); } elseif ('title' == $type) { $o = array('type' => 'text', 'default' => 'Hello.'); } elseif ('text' == $type) { $o = array('type' => 'richtext', 'default' => 'Just some text.'); } elseif ('html' == $type) { $o = array('type' => 'textarea', 'default' => '<p>Just some html.</p>'); } elseif ('link' == $type || 'header' == $type) { $o = array('type' => 'text'); } elseif ('logo' == $type) { $o = array('type' => 'image_upload', 'has_alt' => true); } elseif ('menu' == $type) { $o = array('type' => 'select_menu', 'label' => __('Select Menu', 'pl-platform')); } elseif ('search' == $type) { $o = array('type' => 'check', 'label' => __('Show Search?', 'pl-platform')); } elseif ('button' == $type) { $key = isset($additions['key']) ? $additions['key'] : $type; $o = array('title' => __('Button / Link', 'pl-platform'), 'type' => 'multi', 'stylize' => 'button-config', 'opts' => pl_button_link_options($key, $additions)); } elseif ('background_image' == $type) { $o = array('type' => 'image_upload'); } elseif ('background_color' == $type) { $o = array('type' => 'color'); } elseif ('columns' == $type) { $o = array('type' => 'select', 'opts' => array('2' => array('name' => __('2 of 12 Columns', 'pl-platform')), '3' => array('name' => __('3 of 12 Columns', 'pl-platform')), '4' => array('name' => __('4 of 12 Columns', 'pl-platform')), '6' => array('name' => __('6 of 12 Columns', 'pl-platform')), '12' => array('name' => __('12 of 12 Columns', 'pl-platform')))); } elseif ('posts_per_page' == $type) { $o = array('type' => 'count_select', 'count_start' => 1, 'count_number' => 36); } elseif ('text_alignment' == $type) { $o = array('type' => 'radio', 'opts' => array(array('txt' => '<i class="pl-icon pl-icon-minus"></i>', 'val' => ''), array('txt' => '<i class="pl-icon pl-icon-align-left"></i>', 'val' => 'pl-alignment-left'), array('txt' => '<i class="pl-icon pl-icon-align-center"></i>', 'val' => 'pl-alignment-center'), array('txt' => '<i class="pl-icon pl-icon-align-right"></i>', 'val' => 'pl-alignment-right'))); } elseif ('section_alignment' == $type) { $o = array('type' => 'radio', 'opts' => array(array('txt' => '<i class="pl-icon pl-icon-minus"></i>', 'val' => ''), array('txt' => '<i class="pl-icon pl-icon-long-arrow-left"></i>', 'val' => 'pl-section-left'), array('txt' => '<i class="pl-icon pl-icon-arrows-h"></i>', 'val' => 'pl-section-center'), array('txt' => '<i class="pl-icon pl-icon-long-arrow-right"></i>', 'val' => 'pl-section-right'))); } elseif ('scheme' == $type) { $o = array('label' => __('Text/Element Color Scheme', 'pl-platform'), 'type' => 'select', 'default' => 'pl-scheme-default', 'opts' => array('pl-scheme-default' => array('name' => __('Default', 'pl-platform')), 'pl-scheme-light' => array('name' => __('White', 'pl-platform')), 'pl-scheme-dark' => array('name' => __('Black', 'pl-platform'))), 'help' => 'Note: This will override link colors if set.'); } $o = wp_parse_args($additions, $o); $key = isset($o['key']) ? $o['key'] : $type; $o = wp_parse_args($o, array('key' => $key, 'label' => pl_ui_key($key))); return $o; }