Version Description
Download this release
Release Info
Developer | petervanderdoes |
Plugin | AVH Extended Categories Widgets |
Version | 2.2 |
Comparing to | |
See all releases |
Code changes from version 2.1 to 2.2
- 2.8/avh-ec.client.php +5 -0
- 2.8/class/avh-ec.admin.php +163 -0
- 2.8/class/avh-ec.core.php +55 -1
- 2.8/class/avh-ec.widgets.php +69 -51
- 2.8/lang/avh-ec.pot +150 -0
- readme.txt +10 -1
- widget-pre2.8.php +3 -3
- widget_extended_categories.php +1 -1
2.8/avh-ec.client.php
CHANGED
@@ -9,6 +9,11 @@ require (dirname( __FILE__ ) . '/class/avh-ec.widgets.php');
|
|
9 |
*/
|
10 |
function avhextendedcategories_init ()
|
11 |
{
|
|
|
|
|
|
|
|
|
|
|
12 |
add_action( 'widgets_init', 'avhextendedcategories_widgets_init' );
|
13 |
|
14 |
} // End avhamazon_init()
|
9 |
*/
|
10 |
function avhextendedcategories_init ()
|
11 |
{
|
12 |
+
// Admin
|
13 |
+
if ( is_admin() ) {
|
14 |
+
require (dirname( __FILE__ ) . '/class/avh-ec.admin.php');
|
15 |
+
$avhec_admin = & new AVH_EC_Admin( );
|
16 |
+
}
|
17 |
add_action( 'widgets_init', 'avhextendedcategories_widgets_init' );
|
18 |
|
19 |
} // End avhamazon_init()
|
2.8/class/avh-ec.admin.php
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class AVH_EC_Admin
|
3 |
+
{
|
4 |
+
var $core;
|
5 |
+
|
6 |
+
function __construct ()
|
7 |
+
{
|
8 |
+
// Initialize the plugin
|
9 |
+
$this->core = & AVHExtendedCategoriesCore::getInstance();
|
10 |
+
|
11 |
+
// Admin menu
|
12 |
+
add_action( 'admin_menu', array (&$this, 'actionAdminMenu' ) );
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Inject CSS and Javascript on the right pages
|
16 |
+
*
|
17 |
+
* Main Action: admin_print_styles-, admin_print-scripts-
|
18 |
+
* Top level page: toplevel_page_avh-first-defense-against-spam
|
19 |
+
* Sub menus: avh-f-d-a-s_page_avh-fdas-general
|
20 |
+
*
|
21 |
+
*/
|
22 |
+
add_action( 'admin_print_styles', array (&$this, 'actionInjectCSS' ) );
|
23 |
+
add_action( 'admin_print_scripts', array (&$this, 'actionInjectJS' ) );
|
24 |
+
|
25 |
+
return;
|
26 |
+
}
|
27 |
+
|
28 |
+
function AVH_EC_Admin ()
|
29 |
+
{
|
30 |
+
$this->__construct();
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Add the Tools and Options to the Management and Options page repectively
|
35 |
+
*
|
36 |
+
* @WordPress Action admin_menu
|
37 |
+
*
|
38 |
+
*/
|
39 |
+
function actionAdminMenu ()
|
40 |
+
{
|
41 |
+
|
42 |
+
add_options_page( 'AVH Extended Categories', 'AVH Extended Categories', 'manage_options', 'avhec_options', array (&$this, 'pageOptions' ) );
|
43 |
+
add_filter( 'plugin_action_links_extended-categories-widget/widget_extended_categories.php', array (&$this, 'filterPluginActions' ), 10, 2 );
|
44 |
+
// Add metaboxes
|
45 |
+
add_meta_box( 'dashboard_right_now', 'Translation', array (&$this, 'metaboxTranslation' ), 'avhec-translation', 'left', 'core' );
|
46 |
+
add_meta_box( 'dashboard_right_now', 'Donations', array (&$this, 'metaboxDonations' ), 'avhec-donation', 'left', 'core' );
|
47 |
+
}
|
48 |
+
|
49 |
+
function pageOptions ()
|
50 |
+
{
|
51 |
+
echo '<div class="wrap avhfdas-wrap">';
|
52 |
+
echo $this->displayIcon( 'index' );
|
53 |
+
echo '<h2>' . 'AVH Extended Categories' . '</h2>';
|
54 |
+
echo '<div id="dashboard-widgets-wrap" class="avhec-meta">';
|
55 |
+
echo ' <div id="dashboard-widgets" class="metabox-holder">';
|
56 |
+
echo ' <div id="post-body">';
|
57 |
+
echo ' <div id="dashboard-widgets-main-content">';
|
58 |
+
echo ' <div class="postbox-container" style="width:49%;">';
|
59 |
+
do_meta_boxes( 'avhec-translation', 'left', '' );
|
60 |
+
echo ' </div>';
|
61 |
+
echo ' <div class="postbox-container" style="width:49%;">';
|
62 |
+
do_meta_boxes( 'avhec-donation', 'left', '' );
|
63 |
+
echo ' </div>';
|
64 |
+
|
65 |
+
echo ' </div>';
|
66 |
+
echo ' </div>';
|
67 |
+
echo ' </div>';
|
68 |
+
echo '</div>';
|
69 |
+
echo '</div>';
|
70 |
+
echo '<script type="text/javascript">' . "\n";
|
71 |
+
echo ' //<![CDATA[' . "\n";
|
72 |
+
echo ' jQuery(document).ready( function($) {' . "\n";
|
73 |
+
echo ' // postboxes setup' . "\n";
|
74 |
+
echo ' postboxes.add_postbox_toggles(\'avhec-meta\');' . "\n";
|
75 |
+
echo ' });' . "\n";
|
76 |
+
echo ' //]]>' . "\n";
|
77 |
+
echo '</script>';
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Donation Metabox
|
82 |
+
* @return unknown_type
|
83 |
+
*/
|
84 |
+
function metaboxDonations ()
|
85 |
+
{
|
86 |
+
echo '<p>If you enjoy this plug-in please consider a donation. There are several ways you can show your appreciation</p>';
|
87 |
+
echo '<div class="versions">';
|
88 |
+
echo '<p>';
|
89 |
+
echo '<span class="b">Amazon Wish List</span><br />';
|
90 |
+
echo 'You can send me something from my <a href="http://www.amazon.com/gp/registry/wishlist/1U3DTWZ72PI7W?tag=avh-donation-20">Amazon Wish List</a>';
|
91 |
+
echo '</p>';
|
92 |
+
echo '<p>';
|
93 |
+
echo '<span class="b">Through Paypal.</span><br />';
|
94 |
+
echo 'Click on the Donate button and you will be directed to Paypal where you can make your donation and you don\'t need to have a Paypal account to make a donation.';
|
95 |
+
echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input name="cmd" type="hidden" value="_donations" /> <input name="business" type="hidden" value="paypal@avirtualhome.com" /> <input name="item_name" type="hidden" value="AVH Plugins" /> <input name="no_shipping" type="hidden" value="1" /> <input name="no_note" type="hidden" value="1" /> <input name="currency_code" type="hidden" value="USD" /> <input name="tax" type="hidden" value="0" /> <input name="lc" type="hidden" value="US" /> <input name="bn" type="hidden" value="PP-DonationsBF" /> <input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" type="image" /> </form>';
|
96 |
+
echo '</p></div>';
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Donation Metabox
|
101 |
+
* @return unknown_type
|
102 |
+
*/
|
103 |
+
function metaboxTranslation ()
|
104 |
+
{
|
105 |
+
echo '<p>A language pack can be created for this plugin. The .pot file is included with the plugin and can be found in the directory extended-categories-widget/2.8/lang</p>';
|
106 |
+
echo '<div class="versions">';
|
107 |
+
echo '<p>';
|
108 |
+
echo 'If you have created a language pack you can send the .po, and if you have it the .mo file, to me and I will include the files with the plugin';
|
109 |
+
echo '</p>';
|
110 |
+
echo '<p>';
|
111 |
+
echo 'More information about translating can found at http://codex.wordpress.org/Translating_WordPress . This page is dedicated for translating WordPress but the instructions are the same for this plugin.';
|
112 |
+
echo '</p></div>';
|
113 |
+
}
|
114 |
+
function displayIcon ( $icon )
|
115 |
+
{
|
116 |
+
return ('<div class="icon32" id="icon-' . $icon . '"><br/></div>');
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Insert link to CSS
|
121 |
+
*
|
122 |
+
*/
|
123 |
+
function actionInjectCSS ()
|
124 |
+
{
|
125 |
+
wp_admin_css( 'css/dashboard' );
|
126 |
+
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Insert link to JS
|
131 |
+
*
|
132 |
+
*/
|
133 |
+
function actionInjectJS ()
|
134 |
+
{
|
135 |
+
wp_enqueue_script( 'postbox' );
|
136 |
+
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Adds Settings next to the plugin actions
|
141 |
+
*
|
142 |
+
* @WordPress Filter plugin_action_links_avh-amazon/avh-amazon.php
|
143 |
+
*
|
144 |
+
*/
|
145 |
+
function filterPluginActions ( $links, $file )
|
146 |
+
{
|
147 |
+
static $this_plugin;
|
148 |
+
|
149 |
+
if ( ! $this_plugin )
|
150 |
+
$this_plugin = $this->core->getBaseDirectory( plugin_basename( $this->core->info['plugin_dir'] ) );
|
151 |
+
if ( $file )
|
152 |
+
$file = $this->core->getBaseDirectory( $file );
|
153 |
+
if ( $file == $this_plugin ) {
|
154 |
+
$settings_link = '<a href="options-general.php?page=avhec_options">' . __( 'Settings', 'avh-ec' ) . '</a>';
|
155 |
+
array_unshift( $links, $settings_link ); // before other links
|
156 |
+
//$links = array_merge ( array ( $settings_link ), $links ); // before other links
|
157 |
+
}
|
158 |
+
return $links;
|
159 |
+
|
160 |
+
}
|
161 |
+
|
162 |
+
}
|
163 |
+
?>
|
2.8/class/avh-ec.core.php
CHANGED
@@ -3,6 +3,7 @@ class AVHExtendedCategoriesCore
|
|
3 |
{
|
4 |
var $version;
|
5 |
var $comment;
|
|
|
6 |
|
7 |
/**
|
8 |
* PHP5 constructor
|
@@ -10,8 +11,29 @@ class AVHExtendedCategoriesCore
|
|
10 |
*/
|
11 |
function __construct ()
|
12 |
{
|
13 |
-
$this->version = '2.
|
14 |
$this->comment = '<!-- AVH Extended Categories version ' . $this->version . ' | http://blog.avirtualhome.com/wordpress-plugins/ -->';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
|
17 |
/**
|
@@ -38,6 +60,18 @@ class AVHExtendedCategoriesCore
|
|
38 |
return $_instance;
|
39 |
}
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
/**
|
42 |
* Used in forms to set the checked option.
|
43 |
*
|
@@ -54,5 +88,25 @@ class AVHExtendedCategoriesCore
|
|
54 |
}
|
55 |
return ('');
|
56 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
?>
|
3 |
{
|
4 |
var $version;
|
5 |
var $comment;
|
6 |
+
var $info;
|
7 |
|
8 |
/**
|
9 |
* PHP5 constructor
|
11 |
*/
|
12 |
function __construct ()
|
13 |
{
|
14 |
+
$this->version = '2.2';
|
15 |
$this->comment = '<!-- AVH Extended Categories version ' . $this->version . ' | http://blog.avirtualhome.com/wordpress-plugins/ -->';
|
16 |
+
|
17 |
+
// Determine installation path & url
|
18 |
+
$path = str_replace( '\\', '/', dirname( __FILE__ ) );
|
19 |
+
$path = substr( $path, strpos( $path, 'plugins' ) + 8, strlen( $path ) );
|
20 |
+
$path = substr( $path, 0, strlen( $path ) - 6 );
|
21 |
+
|
22 |
+
$info['siteurl'] = get_option( 'siteurl' );
|
23 |
+
|
24 |
+
$info['plugin_url'] = WP_PLUGIN_URL;
|
25 |
+
$info['plugin_dir'] = WP_PLUGIN_DIR;
|
26 |
+
|
27 |
+
if ( $path != 'plugins' ) {
|
28 |
+
$info['plugin_url'] .= '/' . $path;
|
29 |
+
$info['plugin_dir'] .= '/' . $path;
|
30 |
+
}
|
31 |
+
|
32 |
+
$info['lang_dir'] = $path . '/lang';
|
33 |
+
// Set class property for info
|
34 |
+
$this->info = array ('home' => get_option( 'home' ), 'siteurl' => $info['siteurl'], 'plugin_url' => $info['plugin_url'], 'plugin_dir' => $info['plugin_dir'], 'lang_dir' => $info['lang_dir'] );
|
35 |
+
|
36 |
+
$this->handleTextdomain();
|
37 |
}
|
38 |
|
39 |
/**
|
60 |
return $_instance;
|
61 |
}
|
62 |
|
63 |
+
/**
|
64 |
+
* Loads the i18n
|
65 |
+
*
|
66 |
+
* @return
|
67 |
+
*/
|
68 |
+
function handleTextdomain ()
|
69 |
+
{
|
70 |
+
|
71 |
+
load_plugin_textdomain( 'avh-ec', false, $this->info['lang_dir'] );
|
72 |
+
|
73 |
+
}
|
74 |
+
|
75 |
/**
|
76 |
* Used in forms to set the checked option.
|
77 |
*
|
88 |
}
|
89 |
return ('');
|
90 |
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Get the base directory of a directory structure
|
94 |
+
*
|
95 |
+
* @param string $directory
|
96 |
+
* @return string
|
97 |
+
*
|
98 |
+
*/
|
99 |
+
function getBaseDirectory ( $directory )
|
100 |
+
{
|
101 |
+
//get public directory structure eg "/top/second/third"
|
102 |
+
$public_directory = dirname( $directory );
|
103 |
+
//place each directory into array
|
104 |
+
$directory_array = explode( '/', $public_directory );
|
105 |
+
//get highest or top level in array of directory strings
|
106 |
+
$public_base = max( $directory_array );
|
107 |
+
|
108 |
+
return $public_base;
|
109 |
+
}
|
110 |
+
|
111 |
}
|
112 |
?>
|
2.8/class/avh-ec.widgets.php
CHANGED
@@ -21,8 +21,8 @@ class WP_Widget_AVH_ExtendedCategories_Normal extends WP_Widget
|
|
21 |
update_option( 'widget_extended-categories', $old );
|
22 |
delete_option( 'widget_extended_categories' );
|
23 |
}
|
24 |
-
$widget_ops = array ('description' => __( "An extended version of the default Categories widget." ) );
|
25 |
-
WP_Widget::__construct( 'extended-categories',
|
26 |
}
|
27 |
|
28 |
function WP_Widget_AVH_ExtendedCategories_Normal ()
|
@@ -48,6 +48,8 @@ class WP_Widget_AVH_ExtendedCategories_Normal extends WP_Widget
|
|
48 |
$o = $instance['sort_order'] ? $instance['sort_order'] : 'asc';
|
49 |
$r = $instance['rssfeed'] ? 'RSS' : '';
|
50 |
$i = $instance['rssimage'] ? $instance['rssimage'] : '';
|
|
|
|
|
51 |
if ( empty( $r ) ) {
|
52 |
$i = '';
|
53 |
}
|
@@ -56,20 +58,26 @@ class WP_Widget_AVH_ExtendedCategories_Normal extends WP_Widget
|
|
56 |
$d = 0;
|
57 |
}
|
58 |
|
59 |
-
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title'] );
|
60 |
$style = empty( $instance['style'] ) ? 'list' : $instance['style'];
|
|
|
61 |
if ( $instance['post_category'] ) {
|
62 |
$post_category = unserialize( $instance['post_category'] );
|
63 |
$included_cats = implode( ",", $post_category );
|
64 |
}
|
65 |
-
|
|
|
|
|
|
|
|
|
66 |
echo $before_widget;
|
67 |
echo $this->core->comment;
|
68 |
echo $before_title . $title . $after_title;
|
69 |
-
echo '<ul>';
|
70 |
|
71 |
if ( $style == 'list' ) {
|
|
|
72 |
wp_list_categories( $cat_args );
|
|
|
73 |
} else {
|
74 |
wp_dropdown_categories( $cat_args );
|
75 |
echo '<script type=\'text/javascript\'>' . "\n";
|
@@ -84,7 +92,6 @@ class WP_Widget_AVH_ExtendedCategories_Normal extends WP_Widget
|
|
84 |
echo '/* ]]> */' . "\n";
|
85 |
echo '</script>' . "\n";
|
86 |
}
|
87 |
-
echo '</ul>';
|
88 |
echo $after_widget;
|
89 |
}
|
90 |
|
@@ -122,6 +129,8 @@ class WP_Widget_AVH_ExtendedCategories_Normal extends WP_Widget
|
|
122 |
if ( $instance['depth'] < 0 || 11 < $instance['depth'] ) {
|
123 |
$instance['depth'] = 0;
|
124 |
}
|
|
|
|
|
125 |
return $instance;
|
126 |
}
|
127 |
|
@@ -151,13 +160,14 @@ class WP_Widget_AVH_ExtendedCategories_Normal extends WP_Widget
|
|
151 |
$rssfeed = ( bool ) $instance['rssfeed'];
|
152 |
$rssimage = esc_attr( $instance['rssimage'] );
|
153 |
$selected_cats = ($instance['post_category'] != '') ? unserialize( $instance['post_category'] ) : false;
|
|
|
154 |
|
155 |
if ( $depth < 0 || 11 < $depth ) {
|
156 |
$depth = 0;
|
157 |
}
|
158 |
echo '<p>';
|
159 |
echo '<label for="' . $this->get_field_id( 'title' ) . '">';
|
160 |
-
_e( 'Title
|
161 |
echo '<input class="widefat" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" type="text" value="' . $title . '" /> ';
|
162 |
echo '</label>';
|
163 |
echo '</p>';
|
@@ -166,60 +176,60 @@ class WP_Widget_AVH_ExtendedCategories_Normal extends WP_Widget
|
|
166 |
|
167 |
echo '<label for="' . $this->get_field_id( 'count' ) . '">';
|
168 |
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'count' ) . '" name="' . $this->get_field_name( 'count' ) . '" ' . $this->core->isChecked( true, $count ) . ' /> ';
|
169 |
-
_e( 'Show post counts' );
|
170 |
echo '</label>';
|
171 |
echo '<br />';
|
172 |
|
173 |
echo '<label for="' . $this->get_field_id( 'hierachical' ) . '">';
|
174 |
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'hierachical' ) . '" name="' . $this->get_field_name( 'hierarchical' ) . '" ' . $this->core->isChecked( true, $hierarchical ) . ' /> ';
|
175 |
-
_e( 'Show hierarchy' );
|
176 |
echo '</label>';
|
177 |
echo '<br />';
|
178 |
|
179 |
echo '<label for="' . $this->get_field_id( 'depth' ) . '">';
|
180 |
-
_e( 'How many levels to show' );
|
181 |
echo '</label>';
|
182 |
echo '<select id="' . $this->get_field_id( 'depth' ) . '" name="' . $this->get_field_name( 'depth' ) . '"> ';
|
183 |
-
echo '<option value="0" ' . (0 == $depth ? "selected='selected'" : '') . '>' . __( 'All Levels' ) . '</option>';
|
184 |
-
echo '<option value="1" ' . (1 == $depth ? "selected='selected'" : '') . '>' . __( 'Toplevel only' ) . '</option>';
|
185 |
for ( $i = 2; $i <= 11; $i ++ ) {
|
186 |
-
echo '<option value="' . $i . '" ' . ($i == $depth ? "selected='selected'" : '') . '>' . __( 'Child ' ) . ($i - 1) . '</option>';
|
187 |
}
|
188 |
echo '</select>';
|
189 |
echo '<br />';
|
190 |
|
191 |
echo '<label for="' . $this->get_field_id( 'hide_empty' ) . '">';
|
192 |
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'hide_empty' ) . '" name="' . $this->get_field_name( 'hide_empty' ) . '" ' . $this->core->isChecked( true, $hide_empty ) . '/> ';
|
193 |
-
_e( 'Hide empty categories' );
|
194 |
echo '</label>';
|
195 |
echo '<br />';
|
196 |
echo '</p>';
|
197 |
|
198 |
echo '<p>';
|
199 |
echo '<label for="' . $this->get_field_id( 'sort_column' ) . '">';
|
200 |
-
_e( 'Sort by ' );
|
201 |
echo '<select id="' . $this->get_field_id( 'sort_column' ) . '" name="' . $this->get_field_name( 'sort_column' ) . '"> ';
|
202 |
-
echo '<option value="ID" ' . $sort_id . '>' . __( 'ID' ) . '</option>';
|
203 |
-
echo '<option value="name" ' . $sort_name . '>' . __( 'Name' ) . '</option>';
|
204 |
-
echo '<option value="count" ' . $sort_count . '>' . __( 'Count' ) . '</option>';
|
205 |
echo '</select>';
|
206 |
echo '</label>';
|
207 |
echo '<br />';
|
208 |
|
209 |
echo '<label for="' . $this->get_field_id( 'sort_order' ) . '">';
|
210 |
-
_e( 'Sort order ' );
|
211 |
echo '<select id="' . $this->get_field_id( 'sort_order' ) . '" name="' . $this->get_field_name( 'sort_order' ) . '"> ';
|
212 |
-
echo '<option value="asc" ' . $sort_order_a . '>' . __( 'Ascending' ) . '</option>';
|
213 |
-
echo '<option value="desc" ' . $sort_order_d . '>' . __( 'Descending' ) . '</option>';
|
214 |
echo '</select>';
|
215 |
echo '</label>';
|
216 |
echo '<br />';
|
217 |
|
218 |
echo '<label for="' . $this->get_field_id( 'style' ) . '">';
|
219 |
-
_e( 'Display style ' );
|
220 |
echo '<select id="' . $this->get_field_id( 'style' ) . '" name="' . $this->get_field_name( 'style' ) . '"> ';
|
221 |
-
echo '<option value="list" ' . $style_list . '>' . __( 'List' ) . '</option>';
|
222 |
-
echo '<option value="drop" ' . $style_drop . '>' . __( 'Drop down' ) . '</option>';
|
223 |
echo '</select>';
|
224 |
echo '</label>';
|
225 |
echo '<br />';
|
@@ -229,29 +239,37 @@ class WP_Widget_AVH_ExtendedCategories_Normal extends WP_Widget
|
|
229 |
|
230 |
echo '<label for="' . $this->get_field_id( 'rssfeed' ) . '">';
|
231 |
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'rssfeed' ) . '" name="' . $this->get_field_name( 'rssfeed' ) . '" ' . $this->core->isChecked( true, $rssfeed ) . '/> ';
|
232 |
-
_e( 'Show RSS Feed' );
|
233 |
echo '</label>';
|
234 |
echo '<br />';
|
235 |
|
236 |
echo '<label for="">';
|
237 |
-
_e( '
|
238 |
echo '<input class="widefat" id="' . $this->get_field_id( 'rssimage' ) . '" name="' . $this->get_field_name( 'rssimage' ) . '" type="text" value="' . $rssimage . '" />';
|
239 |
echo '</label>';
|
240 |
echo '</p>';
|
241 |
|
242 |
echo '<p>';
|
243 |
-
echo '<b>' . __( '
|
244 |
echo '<ul id="categorychecklist" class="list:category categorychecklist form-no-clear" style="list-style-type: none; margin-left: 5px; padding-left: 0px; margin-bottom: 20px;">';
|
245 |
echo '<li id="' . $this->get_field_id( 'category--1' ) . '" class="popular-category">';
|
246 |
echo '<label for="' . $this->get_field_id( 'post_category' ) . '" class="selectit">';
|
247 |
echo '<input value="all" id="' . $this->get_field_id( 'post_category' ) . '" name="' . $this->get_field_name( 'post_category' ) . '[all]" type="checkbox" ' . $this->core->isChecked( false, $selected_cats ) . '> ';
|
248 |
-
_e( '
|
249 |
echo '</label>';
|
250 |
echo '</li>';
|
251 |
$this->avh_wp_category_checklist( 0, 0, $selected_cats, false, $this->number );
|
252 |
echo '</ul>';
|
253 |
echo '</p>';
|
254 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
echo '<input type="hidden" id="' . $this->get_field_id( 'submit' ) . '" name="' . $this->get_field_name( 'submit' ) . '" value="1" />';
|
256 |
}
|
257 |
|
@@ -276,16 +294,16 @@ class WP_Widget_AVH_ExtendedCategories_Normal extends WP_Widget
|
|
276 |
|
277 |
$args = array ();
|
278 |
if ( is_array( $selected_cats ) )
|
279 |
-
|
280 |
elseif ( $post_id )
|
281 |
-
|
282 |
else
|
283 |
-
|
284 |
|
285 |
if ( is_array( $popular_cats ) )
|
286 |
-
|
287 |
else
|
288 |
-
|
289 |
|
290 |
if ( $descendants_and_self ) {
|
291 |
$categories = get_categories( "child_of=$descendants_and_self&hierarchical=0&hide_empty=0" );
|
@@ -327,7 +345,7 @@ class WP_Widget_AVH_ExtendedCategories_Top extends WP_Widget
|
|
327 |
{
|
328 |
$this->core = & AVHExtendedCategoriesCore::getInstance();
|
329 |
|
330 |
-
$widget_ops = array ('description' => __( "Shows the top categories." ) );
|
331 |
WP_Widget::__construct( false, __( 'AVH Extended Categories Top' ), $widget_ops );
|
332 |
}
|
333 |
|
@@ -348,7 +366,7 @@ class WP_Widget_AVH_ExtendedCategories_Top extends WP_Widget
|
|
348 |
|
349 |
extract( $args );
|
350 |
|
351 |
-
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title'] );
|
352 |
$style = empty( $instance['style'] ) ? 'list' : $instance['style'];
|
353 |
if ( ! $a = ( int ) $instance['amount'] ) {
|
354 |
$a = 5;
|
@@ -372,7 +390,7 @@ class WP_Widget_AVH_ExtendedCategories_Top extends WP_Widget
|
|
372 |
$top_cats = get_terms( 'category', array ('fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => $a, 'hierarchical' => false ) );
|
373 |
$included_cats = implode( ",", $top_cats );
|
374 |
|
375 |
-
$cat_args = array ('include' => $included_cats, 'orderby' => $s, 'order' => $o, 'show_count' => $c, 'hide_empty' => 0, 'hierarchical' => 0, 'depth' => - 1, 'title_li' => '', 'show_option_none' => __( 'Select Category' ), 'feed' => $r, 'feed_image' => $i, 'name' => 'extended-categories-top-select-' . $this->number );
|
376 |
echo $before_widget;
|
377 |
echo $this->core->comment;
|
378 |
echo $before_title . $title . $after_title;
|
@@ -459,14 +477,14 @@ class WP_Widget_AVH_ExtendedCategories_Top extends WP_Widget
|
|
459 |
}
|
460 |
echo '<p>';
|
461 |
echo '<label for="' . $this->get_field_id( 'title' ) . '">';
|
462 |
-
_e( 'Title
|
463 |
echo '<input class="widefat" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" type="text" value="' . $title . '" /> ';
|
464 |
echo '</label>';
|
465 |
echo '</p>';
|
466 |
|
467 |
echo '<p>';
|
468 |
echo '<label for="' . $this->get_field_id( 'amount' ) . '">';
|
469 |
-
_e( 'How many categories to show' );
|
470 |
echo '</label>';
|
471 |
echo '<input class="widefat" id="' . $this->get_field_id( 'amount' ) . '" name="' . $this->get_field_name( 'amount' ) . '" type="text" value="' . $amount . '" /> ';
|
472 |
echo '</select>';
|
@@ -475,34 +493,34 @@ class WP_Widget_AVH_ExtendedCategories_Top extends WP_Widget
|
|
475 |
echo '<p>';
|
476 |
echo '<label for="' . $this->get_field_id( 'count' ) . '">';
|
477 |
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'count' ) . '" name="' . $this->get_field_name( 'count' ) . '" ' . $this->core->isChecked( true, $count ) . ' /> ';
|
478 |
-
_e( 'Show post counts' );
|
479 |
echo '</label>';
|
480 |
echo '<br />';
|
481 |
|
482 |
echo '<label for="' . $this->get_field_id( 'sort_column' ) . '">';
|
483 |
-
_e( 'Sort by ' );
|
484 |
echo '<select id="' . $this->get_field_id( 'sort_column' ) . '" name="' . $this->get_field_name( 'sort_column' ) . '"> ';
|
485 |
-
echo '<option value="ID" ' . $sort_id . '>' . __( 'ID' ) . '</option>';
|
486 |
-
echo '<option value="name" ' . $sort_name . '>' . __( 'Name' ) . '</option>';
|
487 |
-
echo '<option value="count" ' . $sort_count . '>' . __( 'Count' ) . '</option>';
|
488 |
echo '</select>';
|
489 |
echo '</label>';
|
490 |
echo '<br />';
|
491 |
|
492 |
echo '<label for="' . $this->get_field_id( 'sort_order' ) . '">';
|
493 |
-
_e( 'Sort order ' );
|
494 |
echo '<select id="' . $this->get_field_id( 'sort_order' ) . '" name="' . $this->get_field_name( 'sort_order' ) . '"> ';
|
495 |
-
echo '<option value="asc" ' . $sort_order_a . '>' . __( 'Ascending' ) . '</option>';
|
496 |
-
echo '<option value="desc" ' . $sort_order_d . '>' . __( 'Descending' ) . '</option>';
|
497 |
echo '</select>';
|
498 |
echo '</label>';
|
499 |
echo '<br />';
|
500 |
|
501 |
echo '<label for="' . $this->get_field_id( 'style' ) . '">';
|
502 |
-
_e( 'Display style ' );
|
503 |
echo '<select id="' . $this->get_field_id( 'style' ) . '" name="' . $this->get_field_name( 'style' ) . '"> ';
|
504 |
-
echo '<option value="list" ' . $style_list . '>' . __( 'List' ) . '</option>';
|
505 |
-
echo '<option value="drop" ' . $style_drop . '>' . __( 'Drop down' ) . '</option>';
|
506 |
echo '</select>';
|
507 |
echo '</label>';
|
508 |
echo '<br />';
|
@@ -512,12 +530,12 @@ class WP_Widget_AVH_ExtendedCategories_Top extends WP_Widget
|
|
512 |
|
513 |
echo '<label for="' . $this->get_field_id( 'rssfeed' ) . '">';
|
514 |
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'rssfeed' ) . '" name="' . $this->get_field_name( 'rssfeed' ) . '" ' . $this->core->isChecked( true, $rssfeed ) . '/> ';
|
515 |
-
_e( 'Show RSS Feed' );
|
516 |
echo '</label>';
|
517 |
echo '<br />';
|
518 |
|
519 |
echo '<label for="">';
|
520 |
-
_e( 'Path (URI) to RSS image
|
521 |
echo '<input class="widefat" id="' . $this->get_field_id( 'rssimage' ) . '" name="' . $this->get_field_name( 'rssimage' ) . '" type="text" value="' . $rssimage . '" />';
|
522 |
echo '</label>';
|
523 |
echo '</p>';
|
21 |
update_option( 'widget_extended-categories', $old );
|
22 |
delete_option( 'widget_extended_categories' );
|
23 |
}
|
24 |
+
$widget_ops = array ('description' => __( "An extended version of the default Categories widget.", 'avh-ec' ) );
|
25 |
+
WP_Widget::__construct( 'extended-categories', 'AVH Extended Categories', $widget_ops );
|
26 |
}
|
27 |
|
28 |
function WP_Widget_AVH_ExtendedCategories_Normal ()
|
48 |
$o = $instance['sort_order'] ? $instance['sort_order'] : 'asc';
|
49 |
$r = $instance['rssfeed'] ? 'RSS' : '';
|
50 |
$i = $instance['rssimage'] ? $instance['rssimage'] : '';
|
51 |
+
$invert = $instance['invert_included'] ? '1' : '0';
|
52 |
+
|
53 |
if ( empty( $r ) ) {
|
54 |
$i = '';
|
55 |
}
|
58 |
$d = 0;
|
59 |
}
|
60 |
|
61 |
+
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Categories','avh-ec' ) : $instance['title'] );
|
62 |
$style = empty( $instance['style'] ) ? 'list' : $instance['style'];
|
63 |
+
$included_cats = '';
|
64 |
if ( $instance['post_category'] ) {
|
65 |
$post_category = unserialize( $instance['post_category'] );
|
66 |
$included_cats = implode( ",", $post_category );
|
67 |
}
|
68 |
+
|
69 |
+
|
70 |
+
if ($invert) {$inc_exc = 'exclude';}
|
71 |
+
else {$inc_exc = 'include';}
|
72 |
+
$cat_args = array ($inc_exc => $included_cats, 'orderby' => $s, 'order' => $o, 'show_count' => $c, 'hide_empty' => $e, 'hierarchical' => $h, 'depth' => $d, 'title_li' => '', 'show_option_none' => __( 'Select Category','avh-ec' ), 'feed' => $r, 'feed_image' => $i, 'name' => 'extended-categories-select-' . $this->number );
|
73 |
echo $before_widget;
|
74 |
echo $this->core->comment;
|
75 |
echo $before_title . $title . $after_title;
|
|
|
76 |
|
77 |
if ( $style == 'list' ) {
|
78 |
+
echo '<ul>';
|
79 |
wp_list_categories( $cat_args );
|
80 |
+
echo '</ul>';
|
81 |
} else {
|
82 |
wp_dropdown_categories( $cat_args );
|
83 |
echo '<script type=\'text/javascript\'>' . "\n";
|
92 |
echo '/* ]]> */' . "\n";
|
93 |
echo '</script>' . "\n";
|
94 |
}
|
|
|
95 |
echo $after_widget;
|
96 |
}
|
97 |
|
129 |
if ( $instance['depth'] < 0 || 11 < $instance['depth'] ) {
|
130 |
$instance['depth'] = 0;
|
131 |
}
|
132 |
+
$instance['invert_included'] = $new_instance['invert_included'] ? 1 : 0;
|
133 |
+
|
134 |
return $instance;
|
135 |
}
|
136 |
|
160 |
$rssfeed = ( bool ) $instance['rssfeed'];
|
161 |
$rssimage = esc_attr( $instance['rssimage'] );
|
162 |
$selected_cats = ($instance['post_category'] != '') ? unserialize( $instance['post_category'] ) : false;
|
163 |
+
$invert_included = ( bool ) $instance['invert_included'];
|
164 |
|
165 |
if ( $depth < 0 || 11 < $depth ) {
|
166 |
$depth = 0;
|
167 |
}
|
168 |
echo '<p>';
|
169 |
echo '<label for="' . $this->get_field_id( 'title' ) . '">';
|
170 |
+
_e( 'Title','avh-ec' );
|
171 |
echo '<input class="widefat" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" type="text" value="' . $title . '" /> ';
|
172 |
echo '</label>';
|
173 |
echo '</p>';
|
176 |
|
177 |
echo '<label for="' . $this->get_field_id( 'count' ) . '">';
|
178 |
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'count' ) . '" name="' . $this->get_field_name( 'count' ) . '" ' . $this->core->isChecked( true, $count ) . ' /> ';
|
179 |
+
_e( 'Show post counts','avh-ec' );
|
180 |
echo '</label>';
|
181 |
echo '<br />';
|
182 |
|
183 |
echo '<label for="' . $this->get_field_id( 'hierachical' ) . '">';
|
184 |
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'hierachical' ) . '" name="' . $this->get_field_name( 'hierarchical' ) . '" ' . $this->core->isChecked( true, $hierarchical ) . ' /> ';
|
185 |
+
_e( 'Show hierarchy','avh-ec' );
|
186 |
echo '</label>';
|
187 |
echo '<br />';
|
188 |
|
189 |
echo '<label for="' . $this->get_field_id( 'depth' ) . '">';
|
190 |
+
_e( 'How many levels to show','avh-ec' );
|
191 |
echo '</label>';
|
192 |
echo '<select id="' . $this->get_field_id( 'depth' ) . '" name="' . $this->get_field_name( 'depth' ) . '"> ';
|
193 |
+
echo '<option value="0" ' . (0 == $depth ? "selected='selected'" : '') . '>' . __( 'All Levels','avh-ec' ) . '</option>';
|
194 |
+
echo '<option value="1" ' . (1 == $depth ? "selected='selected'" : '') . '>' . __( 'Toplevel only','avh-ec' ) . '</option>';
|
195 |
for ( $i = 2; $i <= 11; $i ++ ) {
|
196 |
+
echo '<option value="' . $i . '" ' . ($i == $depth ? "selected='selected'" : '') . '>' . __( 'Child ','avh-ec' ) . ($i - 1) . '</option>';
|
197 |
}
|
198 |
echo '</select>';
|
199 |
echo '<br />';
|
200 |
|
201 |
echo '<label for="' . $this->get_field_id( 'hide_empty' ) . '">';
|
202 |
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'hide_empty' ) . '" name="' . $this->get_field_name( 'hide_empty' ) . '" ' . $this->core->isChecked( true, $hide_empty ) . '/> ';
|
203 |
+
_e( 'Hide empty categories','avh-ec' );
|
204 |
echo '</label>';
|
205 |
echo '<br />';
|
206 |
echo '</p>';
|
207 |
|
208 |
echo '<p>';
|
209 |
echo '<label for="' . $this->get_field_id( 'sort_column' ) . '">';
|
210 |
+
_e( 'Sort by ','avh-ec' );
|
211 |
echo '<select id="' . $this->get_field_id( 'sort_column' ) . '" name="' . $this->get_field_name( 'sort_column' ) . '"> ';
|
212 |
+
echo '<option value="ID" ' . $sort_id . '>' . __( 'ID' ,'avh-ec' ) . '</option>';
|
213 |
+
echo '<option value="name" ' . $sort_name . '>' . __( 'Name','avh-ec' ) . '</option>';
|
214 |
+
echo '<option value="count" ' . $sort_count . '>' . __( 'Count','avh-ec' ) . '</option>';
|
215 |
echo '</select>';
|
216 |
echo '</label>';
|
217 |
echo '<br />';
|
218 |
|
219 |
echo '<label for="' . $this->get_field_id( 'sort_order' ) . '">';
|
220 |
+
_e( 'Sort order ','avh-ec' );
|
221 |
echo '<select id="' . $this->get_field_id( 'sort_order' ) . '" name="' . $this->get_field_name( 'sort_order' ) . '"> ';
|
222 |
+
echo '<option value="asc" ' . $sort_order_a . '>' . __( 'Ascending','avh-ec' ) . '</option>';
|
223 |
+
echo '<option value="desc" ' . $sort_order_d . '>' . __( 'Descending','avh-ec' ) . '</option>';
|
224 |
echo '</select>';
|
225 |
echo '</label>';
|
226 |
echo '<br />';
|
227 |
|
228 |
echo '<label for="' . $this->get_field_id( 'style' ) . '">';
|
229 |
+
_e( 'Display style ','avh-ec' );
|
230 |
echo '<select id="' . $this->get_field_id( 'style' ) . '" name="' . $this->get_field_name( 'style' ) . '"> ';
|
231 |
+
echo '<option value="list" ' . $style_list . '>' . __( 'List','avh-ec' ) . '</option>';
|
232 |
+
echo '<option value="drop" ' . $style_drop . '>' . __( 'Drop down','avh-ec' ) . '</option>';
|
233 |
echo '</select>';
|
234 |
echo '</label>';
|
235 |
echo '<br />';
|
239 |
|
240 |
echo '<label for="' . $this->get_field_id( 'rssfeed' ) . '">';
|
241 |
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'rssfeed' ) . '" name="' . $this->get_field_name( 'rssfeed' ) . '" ' . $this->core->isChecked( true, $rssfeed ) . '/> ';
|
242 |
+
_e( 'Show RSS Feed','avh-ec' );
|
243 |
echo '</label>';
|
244 |
echo '<br />';
|
245 |
|
246 |
echo '<label for="">';
|
247 |
+
_e( 'Path (URI) to RSS image','avh-ec' );
|
248 |
echo '<input class="widefat" id="' . $this->get_field_id( 'rssimage' ) . '" name="' . $this->get_field_name( 'rssimage' ) . '" type="text" value="' . $rssimage . '" />';
|
249 |
echo '</label>';
|
250 |
echo '</p>';
|
251 |
|
252 |
echo '<p>';
|
253 |
+
echo '<b>' . __( 'Select categories','avh-ec' ) . '</b><hr />';
|
254 |
echo '<ul id="categorychecklist" class="list:category categorychecklist form-no-clear" style="list-style-type: none; margin-left: 5px; padding-left: 0px; margin-bottom: 20px;">';
|
255 |
echo '<li id="' . $this->get_field_id( 'category--1' ) . '" class="popular-category">';
|
256 |
echo '<label for="' . $this->get_field_id( 'post_category' ) . '" class="selectit">';
|
257 |
echo '<input value="all" id="' . $this->get_field_id( 'post_category' ) . '" name="' . $this->get_field_name( 'post_category' ) . '[all]" type="checkbox" ' . $this->core->isChecked( false, $selected_cats ) . '> ';
|
258 |
+
_e( 'All Categories','avh-ec' );
|
259 |
echo '</label>';
|
260 |
echo '</li>';
|
261 |
$this->avh_wp_category_checklist( 0, 0, $selected_cats, false, $this->number );
|
262 |
echo '</ul>';
|
263 |
echo '</p>';
|
264 |
|
265 |
+
echo '<p>';
|
266 |
+
echo '<label for="' . $this->get_field_id( 'invert_included' ) . '">';
|
267 |
+
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'invert_included' ) . '" name="' . $this->get_field_name( 'invert_included' ) . '" ' . $this->core->isChecked( true, $invert_included ) . '/> ';
|
268 |
+
_e( 'Exclude the selected categories','avh-ec' );
|
269 |
+
echo '</label>';
|
270 |
+
echo '<br />';
|
271 |
+
echo '</p>';
|
272 |
+
|
273 |
echo '<input type="hidden" id="' . $this->get_field_id( 'submit' ) . '" name="' . $this->get_field_name( 'submit' ) . '" value="1" />';
|
274 |
}
|
275 |
|
294 |
|
295 |
$args = array ();
|
296 |
if ( is_array( $selected_cats ) )
|
297 |
+
$args['selected_cats'] = $selected_cats;
|
298 |
elseif ( $post_id )
|
299 |
+
$args['selected_cats'] = wp_get_post_categories( $post_id );
|
300 |
else
|
301 |
+
$args['selected_cats'] = array ();
|
302 |
|
303 |
if ( is_array( $popular_cats ) )
|
304 |
+
$args['popular_cats'] = $popular_cats;
|
305 |
else
|
306 |
+
$args['popular_cats'] = get_terms( 'category', array ('fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
|
307 |
|
308 |
if ( $descendants_and_self ) {
|
309 |
$categories = get_categories( "child_of=$descendants_and_self&hierarchical=0&hide_empty=0" );
|
345 |
{
|
346 |
$this->core = & AVHExtendedCategoriesCore::getInstance();
|
347 |
|
348 |
+
$widget_ops = array ('description' => __( "Shows the top categories.",'avh-ec' ) );
|
349 |
WP_Widget::__construct( false, __( 'AVH Extended Categories Top' ), $widget_ops );
|
350 |
}
|
351 |
|
366 |
|
367 |
extract( $args );
|
368 |
|
369 |
+
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Categories','avh-ec' ) : $instance['title'] );
|
370 |
$style = empty( $instance['style'] ) ? 'list' : $instance['style'];
|
371 |
if ( ! $a = ( int ) $instance['amount'] ) {
|
372 |
$a = 5;
|
390 |
$top_cats = get_terms( 'category', array ('fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => $a, 'hierarchical' => false ) );
|
391 |
$included_cats = implode( ",", $top_cats );
|
392 |
|
393 |
+
$cat_args = array ('include' => $included_cats, 'orderby' => $s, 'order' => $o, 'show_count' => $c, 'hide_empty' => 0, 'hierarchical' => 0, 'depth' => - 1, 'title_li' => '', 'show_option_none' => __( 'Select Category','avh-ec' ), 'feed' => $r, 'feed_image' => $i, 'name' => 'extended-categories-top-select-' . $this->number );
|
394 |
echo $before_widget;
|
395 |
echo $this->core->comment;
|
396 |
echo $before_title . $title . $after_title;
|
477 |
}
|
478 |
echo '<p>';
|
479 |
echo '<label for="' . $this->get_field_id( 'title' ) . '">';
|
480 |
+
_e( 'Title','avh-ec' );
|
481 |
echo '<input class="widefat" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" type="text" value="' . $title . '" /> ';
|
482 |
echo '</label>';
|
483 |
echo '</p>';
|
484 |
|
485 |
echo '<p>';
|
486 |
echo '<label for="' . $this->get_field_id( 'amount' ) . '">';
|
487 |
+
_e( 'How many categories to show','avh-ec' );
|
488 |
echo '</label>';
|
489 |
echo '<input class="widefat" id="' . $this->get_field_id( 'amount' ) . '" name="' . $this->get_field_name( 'amount' ) . '" type="text" value="' . $amount . '" /> ';
|
490 |
echo '</select>';
|
493 |
echo '<p>';
|
494 |
echo '<label for="' . $this->get_field_id( 'count' ) . '">';
|
495 |
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'count' ) . '" name="' . $this->get_field_name( 'count' ) . '" ' . $this->core->isChecked( true, $count ) . ' /> ';
|
496 |
+
_e( 'Show post counts','avh-ec' );
|
497 |
echo '</label>';
|
498 |
echo '<br />';
|
499 |
|
500 |
echo '<label for="' . $this->get_field_id( 'sort_column' ) . '">';
|
501 |
+
_e( 'Sort by ','avh-ec' );
|
502 |
echo '<select id="' . $this->get_field_id( 'sort_column' ) . '" name="' . $this->get_field_name( 'sort_column' ) . '"> ';
|
503 |
+
echo '<option value="ID" ' . $sort_id . '>' . __( 'ID','avh-ec' ) . '</option>';
|
504 |
+
echo '<option value="name" ' . $sort_name . '>' . __( 'Name','avh-ec' ) . '</option>';
|
505 |
+
echo '<option value="count" ' . $sort_count . '>' . __( 'Count','avh-ec' ) . '</option>';
|
506 |
echo '</select>';
|
507 |
echo '</label>';
|
508 |
echo '<br />';
|
509 |
|
510 |
echo '<label for="' . $this->get_field_id( 'sort_order' ) . '">';
|
511 |
+
_e( 'Sort order ','avh-ec' );
|
512 |
echo '<select id="' . $this->get_field_id( 'sort_order' ) . '" name="' . $this->get_field_name( 'sort_order' ) . '"> ';
|
513 |
+
echo '<option value="asc" ' . $sort_order_a . '>' . __( 'Ascending','avh-ec' ) . '</option>';
|
514 |
+
echo '<option value="desc" ' . $sort_order_d . '>' . __( 'Descending','avh-ec' ) . '</option>';
|
515 |
echo '</select>';
|
516 |
echo '</label>';
|
517 |
echo '<br />';
|
518 |
|
519 |
echo '<label for="' . $this->get_field_id( 'style' ) . '">';
|
520 |
+
_e( 'Display style ','avh-ec' );
|
521 |
echo '<select id="' . $this->get_field_id( 'style' ) . '" name="' . $this->get_field_name( 'style' ) . '"> ';
|
522 |
+
echo '<option value="list" ' . $style_list . '>' . __( 'List','avh-ec' ) . '</option>';
|
523 |
+
echo '<option value="drop" ' . $style_drop . '>' . __( 'Drop down','avh-ec' ) . '</option>';
|
524 |
echo '</select>';
|
525 |
echo '</label>';
|
526 |
echo '<br />';
|
530 |
|
531 |
echo '<label for="' . $this->get_field_id( 'rssfeed' ) . '">';
|
532 |
echo '<input class="checkbox" type="checkbox" id="' . $this->get_field_id( 'rssfeed' ) . '" name="' . $this->get_field_name( 'rssfeed' ) . '" ' . $this->core->isChecked( true, $rssfeed ) . '/> ';
|
533 |
+
_e( 'Show RSS Feed','avh-ec' );
|
534 |
echo '</label>';
|
535 |
echo '<br />';
|
536 |
|
537 |
echo '<label for="">';
|
538 |
+
_e( 'Path (URI) to RSS image','avh-ec' );
|
539 |
echo '<input class="widefat" id="' . $this->get_field_id( 'rssimage' ) . '" name="' . $this->get_field_name( 'rssimage' ) . '" type="text" value="' . $rssimage . '" />';
|
540 |
echo '</label>';
|
541 |
echo '</p>';
|
2.8/lang/avh-ec.pot
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: AVH Extended Categories\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2009-08-26 20:46-0500\n"
|
6 |
+
"PO-Revision-Date: \n"
|
7 |
+
"Last-Translator: Peter van der Does <peter@avirtualhome.com>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
13 |
+
"X-Poedit-KeywordsList: __ngettext:1,2;__;_e\n"
|
14 |
+
"X-Poedit-Basepath: .\n"
|
15 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
16 |
+
"X-Poedit-SearchPath-0: .\n"
|
17 |
+
"X-Poedit-SearchPath-1: ..\n"
|
18 |
+
|
19 |
+
#: ../class/avh-ec.widgets.php:24
|
20 |
+
msgid "An extended version of the default Categories widget."
|
21 |
+
msgstr ""
|
22 |
+
|
23 |
+
#: ../class/avh-ec.widgets.php:61
|
24 |
+
#: ../class/avh-ec.widgets.php:369
|
25 |
+
msgid "Categories"
|
26 |
+
msgstr ""
|
27 |
+
|
28 |
+
#: ../class/avh-ec.widgets.php:72
|
29 |
+
#: ../class/avh-ec.widgets.php:393
|
30 |
+
msgid "Select Category"
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
#: ../class/avh-ec.widgets.php:170
|
34 |
+
#: ../class/avh-ec.widgets.php:480
|
35 |
+
msgid "Title"
|
36 |
+
msgstr ""
|
37 |
+
|
38 |
+
#: ../class/avh-ec.widgets.php:179
|
39 |
+
#: ../class/avh-ec.widgets.php:496
|
40 |
+
msgid "Show post counts"
|
41 |
+
msgstr ""
|
42 |
+
|
43 |
+
#: ../class/avh-ec.widgets.php:185
|
44 |
+
msgid "Show hierarchy"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: ../class/avh-ec.widgets.php:190
|
48 |
+
msgid "How many levels to show"
|
49 |
+
msgstr ""
|
50 |
+
|
51 |
+
#: ../class/avh-ec.widgets.php:193
|
52 |
+
msgid "All Levels"
|
53 |
+
msgstr ""
|
54 |
+
|
55 |
+
#: ../class/avh-ec.widgets.php:194
|
56 |
+
msgid "Toplevel only"
|
57 |
+
msgstr ""
|
58 |
+
|
59 |
+
#: ../class/avh-ec.widgets.php:196
|
60 |
+
msgid "Child "
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
#: ../class/avh-ec.widgets.php:203
|
64 |
+
msgid "Hide empty categories"
|
65 |
+
msgstr ""
|
66 |
+
|
67 |
+
#: ../class/avh-ec.widgets.php:210
|
68 |
+
#: ../class/avh-ec.widgets.php:501
|
69 |
+
msgid "Sort by "
|
70 |
+
msgstr ""
|
71 |
+
|
72 |
+
#: ../class/avh-ec.widgets.php:212
|
73 |
+
#: ../class/avh-ec.widgets.php:503
|
74 |
+
msgid "ID"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: ../class/avh-ec.widgets.php:213
|
78 |
+
#: ../class/avh-ec.widgets.php:504
|
79 |
+
msgid "Name"
|
80 |
+
msgstr ""
|
81 |
+
|
82 |
+
#: ../class/avh-ec.widgets.php:214
|
83 |
+
#: ../class/avh-ec.widgets.php:505
|
84 |
+
msgid "Count"
|
85 |
+
msgstr ""
|
86 |
+
|
87 |
+
#: ../class/avh-ec.widgets.php:220
|
88 |
+
#: ../class/avh-ec.widgets.php:511
|
89 |
+
msgid "Sort order "
|
90 |
+
msgstr ""
|
91 |
+
|
92 |
+
#: ../class/avh-ec.widgets.php:222
|
93 |
+
#: ../class/avh-ec.widgets.php:513
|
94 |
+
msgid "Ascending"
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: ../class/avh-ec.widgets.php:223
|
98 |
+
#: ../class/avh-ec.widgets.php:514
|
99 |
+
msgid "Descending"
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: ../class/avh-ec.widgets.php:229
|
103 |
+
#: ../class/avh-ec.widgets.php:520
|
104 |
+
msgid "Display style "
|
105 |
+
msgstr ""
|
106 |
+
|
107 |
+
#: ../class/avh-ec.widgets.php:231
|
108 |
+
#: ../class/avh-ec.widgets.php:522
|
109 |
+
msgid "List"
|
110 |
+
msgstr ""
|
111 |
+
|
112 |
+
#: ../class/avh-ec.widgets.php:232
|
113 |
+
#: ../class/avh-ec.widgets.php:523
|
114 |
+
msgid "Drop down"
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#: ../class/avh-ec.widgets.php:242
|
118 |
+
#: ../class/avh-ec.widgets.php:533
|
119 |
+
msgid "Show RSS Feed"
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: ../class/avh-ec.widgets.php:247
|
123 |
+
#: ../class/avh-ec.widgets.php:538
|
124 |
+
msgid "Path (URI) to RSS image"
|
125 |
+
msgstr ""
|
126 |
+
|
127 |
+
#: ../class/avh-ec.widgets.php:253
|
128 |
+
msgid "Select categories"
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: ../class/avh-ec.widgets.php:258
|
132 |
+
msgid "All Categories"
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: ../class/avh-ec.widgets.php:268
|
136 |
+
msgid "Exclude the selected categories"
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: ../class/avh-ec.widgets.php:348
|
140 |
+
msgid "Shows the top categories."
|
141 |
+
msgstr ""
|
142 |
+
|
143 |
+
#: ../class/avh-ec.widgets.php:349
|
144 |
+
msgid "AVH Extended Categories Top"
|
145 |
+
msgstr ""
|
146 |
+
|
147 |
+
#: ../class/avh-ec.widgets.php:487
|
148 |
+
msgid "How many categories to show"
|
149 |
+
msgstr ""
|
150 |
+
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://blog.avirtualhome.com/wordpress-plugins/
|
|
4 |
Tags: extended, categories, widget, top categories
|
5 |
Requires at least: 2.3
|
6 |
Tested up to: 2.8
|
7 |
-
Stable tag: 2.
|
8 |
|
9 |
The AVH Extended Categories Widget gives you two widgets for displaying categories. One is a replacement of the default category widget to allow for greater customization. The second is a Top Categories widget.
|
10 |
|
@@ -62,10 +62,19 @@ Starting with version 2.0 and WordPress 2.8 you can select how many levels deep
|
|
62 |
Here is how it works: Say you have 5 top level categories and each top level has a number of children. You could manually select all the Top Level categories you want to show but now you can do the following:
|
63 |
You select to display all categories, select to Show hierarchy and select how many levels you want to show, in this case Toplevel only.
|
64 |
|
|
|
|
|
|
|
|
|
|
|
65 |
== Screenshots ==
|
66 |
None
|
67 |
|
68 |
== Changelog ==
|
|
|
|
|
|
|
|
|
69 |
|
70 |
= Version 2.1 =
|
71 |
* RFC: The path for the RSS image can be URI.
|
4 |
Tags: extended, categories, widget, top categories
|
5 |
Requires at least: 2.3
|
6 |
Tested up to: 2.8
|
7 |
+
Stable tag: 2.2
|
8 |
|
9 |
The AVH Extended Categories Widget gives you two widgets for displaying categories. One is a replacement of the default category widget to allow for greater customization. The second is a Top Categories widget.
|
10 |
|
62 |
Here is how it works: Say you have 5 top level categories and each top level has a number of children. You could manually select all the Top Level categories you want to show but now you can do the following:
|
63 |
You select to display all categories, select to Show hierarchy and select how many levels you want to show, in this case Toplevel only.
|
64 |
|
65 |
+
= I want to help and translate the plugin =
|
66 |
+
The .pot file is included with the plugin.
|
67 |
+
If you have created a language pack, or have an update of an existing one, you can send the [gettext .po and .mo files](http://codex.wordpress.org/Translating_WordPress) to me so that I can include them in future releases.
|
68 |
+
I'll keep a list of translators and their websites here in the readme.txt and on my website.
|
69 |
+
|
70 |
== Screenshots ==
|
71 |
None
|
72 |
|
73 |
== Changelog ==
|
74 |
+
= Version 2.2 =
|
75 |
+
* RFC: Internationalization of the plugin.
|
76 |
+
* Bugfix: W3 Validation Errors when using dropdown categories.
|
77 |
+
* Added option to exclude categories from displaying instead of including them. (Compliments to: Jose Luis Moya - http://www.alsur.es )
|
78 |
|
79 |
= Version 2.1 =
|
80 |
* RFC: The path for the RSS image can be URI.
|
widget-pre2.8.php
CHANGED
@@ -7,7 +7,7 @@ function widget_extended_categories_init() {
|
|
7 |
}
|
8 |
|
9 |
function widget_extended_categories($args, $number = 1) {
|
10 |
-
$version = '2.
|
11 |
// Check for version
|
12 |
require (ABSPATH . WPINC . '/version.php');
|
13 |
if ( version_compare($wp_version, '2.5.1', '<') ) {
|
@@ -64,10 +64,11 @@ function widget_extended_categories_init() {
|
|
64 |
echo $before_widget;
|
65 |
echo '<!-- AVH Extended Categories version ' . $version .' | http://blog.avirtualhome.com/wordpress-plugins/ -->';
|
66 |
echo $before_title . $title . $after_title;
|
67 |
-
echo '<ul>';
|
68 |
|
69 |
if ($style == 'list') {
|
|
|
70 |
wp_list_categories ( $cat_args );
|
|
|
71 |
} else {
|
72 |
wp_dropdown_categories ( $cat_args );
|
73 |
?>
|
@@ -82,7 +83,6 @@ function widget_extended_categories_init() {
|
|
82 |
--></script>
|
83 |
<?php
|
84 |
}
|
85 |
-
echo '</ul>';
|
86 |
echo $after_widget;
|
87 |
}
|
88 |
|
7 |
}
|
8 |
|
9 |
function widget_extended_categories($args, $number = 1) {
|
10 |
+
$version = '2.2';
|
11 |
// Check for version
|
12 |
require (ABSPATH . WPINC . '/version.php');
|
13 |
if ( version_compare($wp_version, '2.5.1', '<') ) {
|
64 |
echo $before_widget;
|
65 |
echo '<!-- AVH Extended Categories version ' . $version .' | http://blog.avirtualhome.com/wordpress-plugins/ -->';
|
66 |
echo $before_title . $title . $after_title;
|
|
|
67 |
|
68 |
if ($style == 'list') {
|
69 |
+
echo '<ul>';
|
70 |
wp_list_categories ( $cat_args );
|
71 |
+
echo '</ul>';
|
72 |
} else {
|
73 |
wp_dropdown_categories ( $cat_args );
|
74 |
?>
|
83 |
--></script>
|
84 |
<?php
|
85 |
}
|
|
|
86 |
echo $after_widget;
|
87 |
}
|
88 |
|
widget_extended_categories.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Extended Category Widget
|
4 |
Plugin URI: http://blog.avirtualhome.com/wordpress-plugins
|
5 |
Description: Replacement of the category widget to allow for greater customization of the category widget.
|
6 |
-
Version: 2.
|
7 |
Author: Peter van der Does
|
8 |
Author URI: http://blog.avirtualhome.com/
|
9 |
|
3 |
Plugin Name: Extended Category Widget
|
4 |
Plugin URI: http://blog.avirtualhome.com/wordpress-plugins
|
5 |
Description: Replacement of the category widget to allow for greater customization of the category widget.
|
6 |
+
Version: 2.2
|
7 |
Author: Peter van der Does
|
8 |
Author URI: http://blog.avirtualhome.com/
|
9 |
|