Skip to content

Commit

Permalink
KingPages menu widget updated to new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
schorsch committed Nov 12, 2011
1 parent d12c41f commit 6e576a0
Show file tree
Hide file tree
Showing 5 changed files with 303 additions and 413 deletions.
2 changes: 1 addition & 1 deletion king-framework/js/king_widget.js
Expand Up @@ -13,7 +13,7 @@ jQuery(document).ready(function () {
return false;
}).next().hide();

//hide cat id input when showcatategory is not selected
//hide cat id input when showcategory is not selected
var cat_ids = jQuery("div[id*='_king_'].widget input[id*='show_category']");
cat_ids.each(function(){
if ( !jQuery(this).is(':checked') ) { jQuery(this).nextAll('input').hide(); };
Expand Down
2 changes: 1 addition & 1 deletion king-framework/king-framework.php
Expand Up @@ -7,7 +7,7 @@
Version: 0.73
Author URI: http://www.blog.mediaprojekte.de
*/
/* Copyright 2006 georg leciejewski (email : georg@mediaprojekte.de)
/* Copyright 2006-2012 Georg Leciejewski
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions king-framework/library/king_widget_functions.php
Expand Up @@ -7,7 +7,7 @@
*/


/* Copyright 2006 georg leciejewski (email : georg@mediaprojekte.de)
/* Copyright 2006-2012 Georg Leciejewski
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -60,7 +60,7 @@ function where_to_show_widget($widget, $show_category, $cat_ids, $show_on_site_a
__('The box is only shown on Area of the following select. Dont use together with following Show-Not-in Area checkbox!', 'widgetKing') );
echo '<br/>';
echo king_checkbox( $widget->get_field_name('show_not_on_site_area'), $show_not_on_site_area, $widget->get_field_id('show_not_on_site_area') );
echo king_label( $widget->get_field_id('show_category'), __('DO NOT show on Special Page Area', 'widgetKing'),
echo king_label( $widget->get_field_id('show_not_on_site_area'), __('DO NOT show on Special Page Area', 'widgetKing'),
__('The box is shown on all Areas BUT the one from the following selectbox or the ID/URL/Title field below. !! Do NOT use together with previous checkbox Show on Site Area !!', 'widgetKing') );

// // ID Name of special website area
Expand Down
21 changes: 10 additions & 11 deletions king-widgets/king-categories.php
Expand Up @@ -9,6 +9,8 @@
*/

/*
Copyright 2006-2012 Georg Leciejewski
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
Expand Down Expand Up @@ -44,11 +46,10 @@ function WP_Widget_King_Categories() {
/**
* Output of the widget
* @param <type> $args is an array of strings that help widgets to conform to
# the active theme: before_widget, before_title, after_widget,
# and after_title are the array keys. Default tags: li and h2.
* the active theme: before_widget, before_title, after_widget,
* and after_title are the array keys. Default tags: li and h2.
* @param <type> $opts
*/

function widget( $args, $opts ) {
global $wp_query;
extract( $args );
Expand All @@ -62,8 +63,7 @@ function widget( $args, $opts ) {
$opts['after_widget'] = empty($opts['after_widget']) ? $after_widget : stripslashes($opts['after_widget']) ;

$already_out = false;
# These lines generate our output. Widgets can be very complex
# but as you can see here, they can also be very, very simple.
# Show only in category
if( !empty($opts['show_category']) ) {
$post = $wp_query->post;
if ( king_in_category($opts['cat_ids']) ) {
Expand All @@ -89,7 +89,7 @@ function widget( $args, $opts ) {
}
}

/** Update a particular instance.
/** Update a particular instance.
*
* This function should check that $new_opts is set correctly.
* The newly calculated value of $opts should be returned.
Expand Down Expand Up @@ -146,13 +146,13 @@ function form( $opts ) {
'name' => $this->get_field_name('title'),
'id' => $this->get_field_id('title'),
'descr' => __('Title', 'widgetKing'),
'title' => __('The title above your category menu', 'widgetKing'),
'title' => __('The title above this widget', 'widgetKing'),
'val' => esc_html($opts['title']) ));

#sort Column
echo '<p>';
echo king_label( $this->get_field_id('orderby'), __('Sort by', 'widgetKing'),
__('Sort Categories ascending or descending depending on choosen sort column.', 'widgetKing') );
__('Sort the choosen column ASCending or DESCending.', 'widgetKing') );
echo '<br/>';
echo king_select( $this->get_field_name('orderby'), $opts['orderby'],
array('name', 'ID', 'count', 'term_group', 'slug'),
Expand Down Expand Up @@ -184,7 +184,7 @@ function form( $opts ) {
'name' => $this->get_field_name('exclude'),
'id' => $this->get_field_id('exclude'),
'descr' => __('Exclude Categories (1,2,3)', 'widgetKing'),
'title' => __('Sets the Categories to be excluded. This must be in the form of an array (ex: 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
Expand Down Expand Up @@ -286,8 +286,7 @@ function form( $opts ) {

/**
* @desc the actual output of the category menu
* @param array $data - holding the switches
* @param int $number - the current widget number
* @param array $data - widget options
*/
function output($data) {
echo '<!-- Start King Cat ' .$this->id_base . ' -->'."\n";
Expand Down

0 comments on commit 6e576a0

Please sign in to comment.