/** * Output the widgets settings form */ function form($opts) { //get default settings $opts = wp_parse_args((array) $opts, $this->defaults()); $f = new WidgetForm(); echo '<div>'; # show title echo $f->text(array('name' => $this->get_field_name('title'), 'id' => $this->get_field_id('title'), 'descr' => __('Title', 'widgetKing'), 'title' => __('The title above this widget', 'widgetKing'), 'val' => esc_html($opts['title']))); #sort Column echo '<p>'; echo $f->label_tag($this->get_field_id('orderby'), __('Sort by', 'widgetKing'), __('Sort the choosen column ASCending or DESCending.', 'widgetKing')); echo '<br/>'; echo $f->select_tag($this->get_field_name('orderby'), $opts['orderby'], array('post_title', 'menu_order', 'post_date', 'post_modified', 'ID', 'post_author', 'post_name'), $this->get_field_id('orderby')); echo $f->select_tag($this->get_field_name('order'), $opts['order'], array('asc', 'desc'), $this->get_field_id('order')); echo '</p>'; # devider echo '</div> <h3><a href="#">' . __('Advanced', 'widgetKing') . '</a></h3> <div>'; #exclude echo $f->text(array('name' => $this->get_field_name('exclude'), 'id' => $this->get_field_id('exclude'), 'descr' => __('Exlude Pages with IDs (1,2,3)', 'widgetKing'), 'title' => __('Comma separated list of numeric IDs to be excluded from the list. E.g: 10, 20, 30', 'widgetKing'), 'val' => $opts['exclude'])); #show child_of echo $f->text(array('name' => $this->get_field_name('child_of'), 'id' => $this->get_field_id('child_of'), 'descr' => __('Show children of page', 'widgetKing'), 'title' => __('Show only subpages of the given page id.', 'widgetKing'), 'val' => $opts['child_of'])); #show depth echo $f->text(array('name' => $this->get_field_name('depth'), 'id' => $this->get_field_id('depth'), 'descr' => __('Page tree depth', 'widgetKing'), 'title' => __('Numeric value for how many levels of hierarchy (sub-pages) to display. Defaults to 0 - display all pages', 'widgetKing'), 'val' => $opts['depth'])); /* #show_date echo king_select_p(array( 'name' => $this->get_field_name('show_date'), 'id' => $this->get_field_id('show_date'), 'descr' => __('Show Date', 'widgetKing'), 'title' => __('Display creation or last modified date next to each Page. if Empty -> Display no date. modified -> Display the date last modified. post_date -> Date Page was first created.', 'widgetKing'), 'options'=> array('', 'modified','post_date'), 'val' => $opts['show_date'] )); #date_format echo king_text_p(array( 'name' => $this->get_field_name('date_format'), 'id' => $this->get_field_id('date_format'), 'descr' => __('Date format', 'widgetKing'), 'title' => __('Defaults to the date format configured in your WordPress options. Custom values need to be in php Time Format. You can google on that..can you?', 'widgetKing'), 'val' => $opts['date_format'])); */ echo '</div> <h3><a href="#">' . __('Show', 'widgetKing') . '</a></h3> <div>'; # Where To Show Options Panel $f->where_to_show($this, $opts); echo '</div> <h3><a href="#">' . __('HTML', 'widgetKing') . '</a></h3> <div>'; # show html options $f->html_opts($this, $opts); echo '</div> <h3><a href="#">' . __('Import / Export', 'widgetKing') . '</a></h3> <div>'; #import $f->export_opts($this, $opts); echo '</div>'; }
/** * Output the widgets settings form */ function form($opts) { //get default settings $opts = wp_parse_args((array) $opts, $this->defaults()); $f = new WidgetForm(); echo '<div>'; # show title echo $f->text(array('name' => $this->get_field_name('title'), 'id' => $this->get_field_id('title'), 'descr' => __('Title', 'widgetKing'), 'title' => __('The title above this widget', 'widgetKing'), 'val' => esc_html($opts['title']))); echo $f->checkbox(array('name' => $this->get_field_name('use_php'), 'id' => $this->get_field_id('use_php'), 'descr' => __('Use PHP in Text', 'widgetKing'), 'title' => __('If checked the inserted code is evaluated as php. PHP Code MUST be enclosed in <?php and ?> tags! You can also insert Wordpress Code if you have not found a Widget for it yet.', 'widgetKing'), 'val' => $opts['use_php'])); // if ( !current_user_can('unfiltered_html') ) // $newoptions[$number]['text'] = stripslashes(wp_filter_post_kses($newoptions[$number]['text'])); echo $f->textarea(array('name' => $this->get_field_name('text'), 'id' => $this->get_field_id('text'), 'descr' => __('Text or HTML', 'widgetKing'), 'title' => __('Insert your Text Freely. This can be bannercode, images or whatever you like. The HTML gets stripped if you do not have the right to insert unfiltered html.', 'widgetKing'), 'val' => $opts['text'], 'cols' => "20", 'rows' => "16")); echo '</div> <h3><a href="#">' . __('Show', 'widgetKing') . '</a></h3> <div>'; # Where To Show Options Panel $f->where_to_show($this, $opts); echo '</div> <h3><a href="#">' . __('HTML', 'widgetKing') . '</a></h3> <div>'; # show html options $f->html_opts($this, $opts); echo '</div> <h3><a href="#">' . __('Import / Export', 'widgetKing') . '</a></h3> <div>'; #import $f->export_opts($this, $opts); echo '</div>'; }
/** * Output the widgets settings form */ function form($opts) { //get default settings $opts = wp_parse_args((array) $opts, $this->defaults()); $f = new WidgetForm(); echo '<div>'; # show title echo $f->text(array('name' => $this->get_field_name('title'), 'id' => $this->get_field_id('title'), 'descr' => __('Title', 'widgetKing'), 'title' => __('The title above this widget', 'widgetKing'), 'val' => esc_html($opts['title']))); #sort Column echo '<p>'; echo $f->label_tag($this->get_field_id('orderby'), __('Sort by', 'widgetKing'), __('Sort the choosen column ASCending or DESCending.', 'widgetKing')); echo '<br/>'; echo $f->select_tag($this->get_field_name('orderby'), $opts['orderby'], array('name', 'ID', 'count', 'term_group', 'slug'), $this->get_field_id('orderby')); echo $f->select_tag($this->get_field_name('order'), $opts['order'], array('asc', 'desc'), $this->get_field_id('order')); echo '</p>'; #show category Count echo $f->checkbox(array('name' => $this->get_field_name('show_count'), 'id' => $this->get_field_id('show_count'), 'descr' => __('Show post counts', 'widgetKing'), 'title' => __('Show number of posts in category', 'widgetKing'), 'val' => $opts['show_count'])); #show empty echo $f->checkbox(array('name' => $this->get_field_name('hide_empty'), 'id' => $this->get_field_id('hide_empty'), 'descr' => __('Hide Empty Categories', 'widgetKing'), 'title' => __('Categories without articles are not shown.', 'widgetKing'), 'val' => $opts['hide_empty'])); # devider echo '</div> <h3><a href="#">' . __('Advanced', 'widgetKing') . '</a></h3> <div>'; #exclude categories echo $f->text(array('name' => $this->get_field_name('exclude'), 'id' => $this->get_field_id('exclude'), 'descr' => __('Exclude Categories (1,2,3)', 'widgetKing'), 'title' => __('Comma separated list of numeric IDs to be excluded from the list. E.g: 10, 20, 30', 'widgetKing'), 'val' => $opts['exclude'])); #show child_of echo $f->text(array('name' => $this->get_field_name('child_of'), 'id' => $this->get_field_id('child_of'), 'descr' => __('Show Children of Category', 'widgetKing'), 'title' => __('Show only children of this category(id).', 'widgetKing'), 'val' => $opts['child_of'])); #show cat depth echo $f->text(array('name' => $this->get_field_name('depth'), 'id' => $this->get_field_id('depth'), 'descr' => __('Category tree depth', 'widgetKing'), 'title' => __('Descend to depth(number) into the category tree: 0 = All, -1 = All Flat(no indent), 1 = only top-level, n = number/levels to descend', 'widgetKing'), 'val' => $opts['depth'])); // #insert feed text echo $f->text(array('name' => $this->get_field_name('feed'), 'id' => $this->get_field_id('feed'), 'descr' => __('Show Category Feed Text', 'widgetKing'), 'title' => __('Text to display for the link to each Categorys RSS2 feed. Default is no text, and no feed displayed.', 'widgetKing'), 'val' => $opts['feed'])); // #name of feed image Path/filename echo $f->text(array('name' => $this->get_field_name('feed_image'), 'id' => $this->get_field_id('feed_image'), 'descr' => __('Show Category Feed Image', 'widgetKing'), 'title' => __('URL Path/filename for a graphic to act as a link to each Categories RSS2 feed.Overrides the feed parameter.', 'widgetKing'), 'val' => $opts['feed_image'])); #show show_date // echo $f->checkbox(array( // 'name' => $this->get_field_name('show_date'), // 'id' => $this->get_field_id('show_date'), // 'descr' =>__('Date of the last post', 'widgetKing'), // 'title' => __('Sets whether to display the date of the last post in each Category.', 'widgetKing'), // 'val' => $opts['show_date'] )); #description as title echo $f->checkbox(array('name' => $this->get_field_name('use_desc_for_title'), 'id' => $this->get_field_id('use_desc_for_title'), 'descr' => __('Use Description as Title', 'widgetKing'), 'title' => __('Sets whether to display the Category Description in the links title tag.', 'widgetKing'), 'val' => $opts['use_desc_for_title'])); #list style echo $f->checkbox(array('name' => $this->get_field_name('style'), 'id' => $this->get_field_id('style'), 'descr' => __('Show as List (li)', 'widgetKing'), 'title' => __('Sets whether the Categories are enclosed by style points ->li', 'widgetKing'), 'val' => $opts['style'])); #show hirachical echo $f->checkbox(array('name' => $this->get_field_name('hierarchical'), 'id' => $this->get_field_id('hierarchical'), 'descr' => __('Show hierarchical', 'widgetKing'), 'title' => __('Shows Categories hierarchical with sub-categories indented -> Depending on your CSS', 'widgetKing'), 'val' => $opts['hierarchical'])); echo '</div> <h3><a href="#">' . __('Show', 'widgetKing') . '</a></h3> <div>'; # Where To Show Options Panel $f->where_to_show($this, $opts['show_category'], $opts['cat_ids'], $opts['show_on_site_area'], $opts['show_not_on_site_area'], $opts['site_area'], $opts['site_area_id']); echo '</div> <h3><a href="#">' . __('HTML', 'widgetKing') . '</a></h3> <div>'; # show html options $f->html_opts($this, $opts); echo '</div> <h3><a href="#">' . __('Import / Export', 'widgetKing') . '</a></h3> <div>'; #import $f->export_opts($this, $opts); echo '</div>'; }