/** * Settings for the jQuery Nivo slider * * Extract from jQuery Nivo slider below * The setting selection field has been set for each line marked with an 'x' x effect: 'random', x slices: 15, x boxCols: 8, x boxRows: 4, x animSpeed: 500, x pauseTime: 3000, startSlide: 0, x directionNav: true, x directionNavHide: true, x controlNav: true, x controlNavThumbs: false, controlNavThumbsFromRel: false, controlNavThumbsSearch: '.jpg', controlNavThumbsReplace: '_thumb.jpg', keyboardNav: true, x pauseOnHover: true, x manualAdvance: false, x captionOpacity: 0.8, prevText: 'Prev', nextText: 'Next', randomStart: false, beforeChange: function(){}, afterChange: function(){}, slideshowEnd: function(){}, lastSlide: function(){}, afterLoad: function(){} */ function oik_nivo_slider_options() { bw_form("options.php"); $option = "bw_nivo_slider"; $options = get_option($option); stag('table class="form-table"'); bw_flush(); settings_fields('oik_nivo_options'); $effect_options = array('random', 'sliceDownRight', 'sliceDownLeft', 'sliceUpRight', 'sliceUpLeft', 'sliceUpDown', 'sliceUpDownLeft', 'fold', 'fade', 'boxRandom', 'boxRain', 'boxRainReverse', 'boxRainGrow', 'boxRainGrowReverse', 'slideInLeft', 'slideInRight'); $effect_options_assoc = bw_assoc($effect_options); bw_select_arr($option, "Effect (effect=<i>effect</i>)", $options, 'effect', array("#options" => $effect_options_assoc)); bw_textfield_arr($option, "Slices", $options, 'slices', 2); bw_textfield_arr($option, "Box cols", $options, 'boxCols', 2); bw_textfield_arr($option, "Box rows", $options, 'boxRows', 2); bw_textfield_arr($option, "Anim speed", $options, 'animSpeed', 4); bw_textfield_arr($option, "Pause time (pause=<i>nnnn</i>)", $options, 'pauseTime', 4); bw_checkbox_arr($option, "Control nav (nav=n|y)", $options, 'controlNav'); bw_checkbox_arr($option, "Control nav thumbs (thumbs=n|y)", $options, 'controlNavThumbs'); //bw_textfield_arr( $option, "Control nav thumbs search", $options, 'controlNavThumbsSearch', 20 ); //bw_textfield_arr( $option, "Control nav thumbs replace", $options, 'controlNavThumbsReplace', 20 ); bw_checkbox_arr($option, "Direction nav", $options, 'directionNav'); bw_checkbox_arr($option, "Direction nav hide", $options, 'directionNavHide'); bw_checkbox_arr($option, "Pause on hover", $options, 'pauseOnHover'); bw_checkbox_arr($option, "Manual advance (manual=n|y)", $options, 'manualAdvance'); bw_textfield_arr($option, "Caption opacity", $options, 'captionOpacity', 4); //bw_tablerow( array( "", "<input type=\"submit\" name=\"ok\" value=\"Save changes\" class=\"button-primary\"/>") ); etag("table"); e(isubmit("ok", __("Save changes", "oik"), null, "button-primary")); etag("form"); bw_flush(); }
/** * Is this option selected? * * Return the selected value if the $option_key or $option_value == $value or the $option_key is IN the $value array * * ` [0] => _oik_api_calls [1] => Array ( [0] => 6410 [1] => 6251 [2] => 6409 ) [2] => Array ( [#type] => oik_api [#multiple] => 1 [#options] => Array ( [6410] => aalt() - aalt [6251] => abbr() - Create an <abbr> tag [6409] => aclass() - aclass * ` * * @param string $option_key * @param string $option_value * @param mixed $value */ function is_selected($option_key, $option_value, $value) { if (is_array($value)) { $vals = bw_assoc($value); $val = bw_array_get($vals, $option_key, null); } else { $val = $value; } $selected = selected($option_key, $val, false); if (!$selected) { $selected = selected($option_value, $val, false); } return $selected; }
/** * Check if we should be skipping shortcodes in content * * @TODO This is just a prototype using a known shortcode where we don't expect shortcodes since the content is CSS. * We could use the 'no_texturize_shortcodes' filter * * Other examples: * - code - is in $default_no_texturize_shortcodes * - bw_geshi * - bw_graphviz * * * @param string $code - the code we're testing for */ function check_code_skip($code) { static $no_texturize_shortcodes = null; if (!$no_texturize_shortcodes) { $no_texturize_shortcodes = apply_filters("no_texturize_shortcodes", array("codes")); $no_texturize_shortcodes = bw_assoc($no_texturize_shortcodes); } if (bw_array_get($no_texturize_shortcodes, $code, null)) { $this->skipping_to = "/{$code}"; } }