Version Description
- internationalization
Download this release
Release Info
Developer | wizzud |
Plugin | Custom Menu Wizard Widget |
Version | 3.2.0 |
Comparing to | |
See all releases |
Code changes from version 3.1.5 to 3.2.0
- custom-menu-wizard.php +24 -13
- doc/cmw-doc.html +8 -2
- include/class.widget.php +238 -238
- readme.txt +7 -1
custom-menu-wizard.php
CHANGED
@@ -3,13 +3,17 @@
|
|
3 |
* Plugin Name: Custom Menu Wizard
|
4 |
* Plugin URI: http://wordpress.org/plugins/custom-menu-wizard/
|
5 |
* Description: Show any part of a custom menu in a Widget, or in content using a Shortcode. Customise the output with extra classes or html; filter by current menu item or a specific item; set a depth, show the parent(s), change the list style, etc. Use the included emulator to assist with the filter settings.
|
6 |
-
* Version: 3.
|
7 |
* Author: Roger Barrett
|
8 |
* Author URI: http://www.wizzud.com/
|
9 |
* License: GPL2+
|
|
|
10 |
*/
|
11 |
defined( 'ABSPATH' ) or exit();
|
12 |
/*
|
|
|
|
|
|
|
13 |
* v3.1.5 change log
|
14 |
* - expanded Title From to allow absolute ancestor levels (besides root) and relative ancestor levels
|
15 |
* - added a fallback option to switch determination of Current Item from first-found to last-found
|
@@ -160,7 +164,7 @@ if( !class_exists( 'Custom_Menu_Wizard_Plugin' ) ){
|
|
160 |
//declare the main plugin class...
|
161 |
class Custom_Menu_Wizard_Plugin {
|
162 |
|
163 |
-
public static $version = '3.
|
164 |
public static $script_handle = 'custom-menu-wizard-plugin-script';
|
165 |
public static $widget_class = 'Custom_Menu_Wizard_Widget';
|
166 |
protected static $instance;
|
@@ -170,6 +174,8 @@ if( !class_exists( 'Custom_Menu_Wizard_Plugin' ) ){
|
|
170 |
*/
|
171 |
public function __construct(){
|
172 |
|
|
|
|
|
173 |
add_action( 'widgets_init', array( &$this, 'widget_and_shortcode' ) );
|
174 |
add_action( 'wp_ajax_cmw-find-shortcodes', array( &$this, 'ajax_find_shortcodes' ) );
|
175 |
add_action( 'admin_enqueue_scripts', array( &$this, 'register_scripts' ) );
|
@@ -249,7 +255,7 @@ if( !class_exists( 'Custom_Menu_Wizard_Plugin' ) ){
|
|
249 |
*/
|
250 |
public function plugin_actions( $actions, $plugin_file, $plugin_data, $context ) {
|
251 |
|
252 |
-
$doc = array( 'documentation' => '<a href="' . plugins_url( '/doc/cmw-doc.html', __FILE__ ) . '" target="_blank">' . __('Documentation') . '</a>' );
|
253 |
$actions = array_merge( $actions, $doc );
|
254 |
return $actions;
|
255 |
|
@@ -290,9 +296,14 @@ if( !class_exists( 'Custom_Menu_Wizard_Plugin' ) ){
|
|
290 |
'vertical-align:text-bottom',
|
291 |
'white-space:nowrap'
|
292 |
) ) . ';';
|
|
|
|
|
|
|
|
|
|
|
293 |
|
294 |
?>
|
295 |
-
<p style="<?php echo $style; ?>"><em><?php
|
296 |
<?php
|
297 |
|
298 |
} //end update_message()
|
@@ -357,7 +368,7 @@ if( !class_exists( 'Custom_Menu_Wizard_Plugin' ) ){
|
|
357 |
$post_ids = array_merge( $post_ids_meta, $post_ids_post );
|
358 |
|
359 |
if( empty( $post_ids ) ){
|
360 |
-
$html .= '<p>' . __('No CMW shortcodes found.') . '</p>';
|
361 |
}else{
|
362 |
$args = array(
|
363 |
'ignore_sticky_posts' => true,
|
@@ -402,23 +413,23 @@ if( !class_exists( 'Custom_Menu_Wizard_Plugin' ) ){
|
|
402 |
}
|
403 |
$anchorTarget = get_post_type( $id );
|
404 |
if( empty( $anchorTarget ) ){
|
405 |
-
$anchorTarget = __('unknown type');
|
406 |
}else{
|
407 |
$anchorTarget = (string)$anchorTarget;
|
408 |
}
|
409 |
-
$content = $inPost ? ( $inMeta ? __( 'content+meta' ) : __( 'content' ) ) : __( 'meta' );
|
410 |
-
$anchorTitle = $anchorTarget . ' #' . $id . ', ' . $content . ', ' . implode( __('
|
411 |
$anchorTarget = '';
|
412 |
if( $shortcodeInst === false ){
|
413 |
//is from assistant via ajax...
|
414 |
$anchorTarget = 'target="_blank"';
|
415 |
-
$anchorTitle .= ' ... ' . __('opens new tab/window');
|
416 |
}
|
417 |
$html .= '<dt class="' . implode( ' ', array_keys( $dtClass ) ) . '"><a href="' . get_permalink() . '" ' . $anchorTarget . ' title="' . $anchorTitle . '">' . get_the_title() . '</a></dt>';
|
418 |
}
|
419 |
$html .= '</dl>';
|
420 |
}else{
|
421 |
-
$html .= '<p>' . __('No CMW shortcodes found.') . '</p>';
|
422 |
}
|
423 |
|
424 |
wp_reset_postdata();
|
@@ -530,14 +541,14 @@ if( !class_exists( 'Custom_Menu_Wizard_Plugin' ) ){
|
|
530 |
//re-register the widget...
|
531 |
register_widget( self::$widget_class );
|
532 |
if( !$this->widget_registered() ){
|
533 |
-
return WP_DEBUG ?
|
534 |
}
|
535 |
}else{
|
536 |
-
return WP_DEBUG ?
|
537 |
}
|
538 |
}else{
|
539 |
//hasn't had a chance to register yet!...
|
540 |
-
return WP_DEBUG ?
|
541 |
}
|
542 |
}
|
543 |
|
3 |
* Plugin Name: Custom Menu Wizard
|
4 |
* Plugin URI: http://wordpress.org/plugins/custom-menu-wizard/
|
5 |
* Description: Show any part of a custom menu in a Widget, or in content using a Shortcode. Customise the output with extra classes or html; filter by current menu item or a specific item; set a depth, show the parent(s), change the list style, etc. Use the included emulator to assist with the filter settings.
|
6 |
+
* Version: 3.2.0
|
7 |
* Author: Roger Barrett
|
8 |
* Author URI: http://www.wizzud.com/
|
9 |
* License: GPL2+
|
10 |
+
* Text Domain: custom-menu-wizard
|
11 |
*/
|
12 |
defined( 'ABSPATH' ) or exit();
|
13 |
/*
|
14 |
+
* v3.2.0 change log
|
15 |
+
* - internationalization
|
16 |
+
*
|
17 |
* v3.1.5 change log
|
18 |
* - expanded Title From to allow absolute ancestor levels (besides root) and relative ancestor levels
|
19 |
* - added a fallback option to switch determination of Current Item from first-found to last-found
|
164 |
//declare the main plugin class...
|
165 |
class Custom_Menu_Wizard_Plugin {
|
166 |
|
167 |
+
public static $version = '3.2.0';
|
168 |
public static $script_handle = 'custom-menu-wizard-plugin-script';
|
169 |
public static $widget_class = 'Custom_Menu_Wizard_Widget';
|
170 |
protected static $instance;
|
174 |
*/
|
175 |
public function __construct(){
|
176 |
|
177 |
+
load_plugin_textdomain( basename( dirname( __FILE__ ) ), false, basename( dirname( __FILE__ ) ) . '/languages' );
|
178 |
+
|
179 |
add_action( 'widgets_init', array( &$this, 'widget_and_shortcode' ) );
|
180 |
add_action( 'wp_ajax_cmw-find-shortcodes', array( &$this, 'ajax_find_shortcodes' ) );
|
181 |
add_action( 'admin_enqueue_scripts', array( &$this, 'register_scripts' ) );
|
255 |
*/
|
256 |
public function plugin_actions( $actions, $plugin_file, $plugin_data, $context ) {
|
257 |
|
258 |
+
$doc = array( 'documentation' => '<a href="' . plugins_url( '/doc/cmw-doc.html', __FILE__ ) . '" target="_blank">' . __('Documentation', 'custom-menu-wizard') . '</a>' );
|
259 |
$actions = array_merge( $actions, $doc );
|
260 |
return $actions;
|
261 |
|
296 |
'vertical-align:text-bottom',
|
297 |
'white-space:nowrap'
|
298 |
) ) . ';';
|
299 |
+
/* translators: 1: anchor starttag, 2: anchor endtag */
|
300 |
+
$msg = sprintf( __('Please %1$sread the Changelog%2$s before updating!', 'custom-menu-wizard'),
|
301 |
+
'<a href="' . $url . '" style="color:#FFFFFF;text-decoration:underline;" target="_blank">',
|
302 |
+
'</a>'
|
303 |
+
);
|
304 |
|
305 |
?>
|
306 |
+
<p style="<?php echo $style; ?>"><em><?php $msg; ?></em></p>
|
307 |
<?php
|
308 |
|
309 |
} //end update_message()
|
368 |
$post_ids = array_merge( $post_ids_meta, $post_ids_post );
|
369 |
|
370 |
if( empty( $post_ids ) ){
|
371 |
+
$html .= '<p>' . __('No CMW shortcodes found.', 'custom-menu-wizard') . '</p>';
|
372 |
}else{
|
373 |
$args = array(
|
374 |
'ignore_sticky_posts' => true,
|
413 |
}
|
414 |
$anchorTarget = get_post_type( $id );
|
415 |
if( empty( $anchorTarget ) ){
|
416 |
+
$anchorTarget = __('unknown type', 'custom-menu-wizard');
|
417 |
}else{
|
418 |
$anchorTarget = (string)$anchorTarget;
|
419 |
}
|
420 |
+
$content = $inPost ? ( $inMeta ? __( 'content+meta' , 'custom-menu-wizard') : __( 'content' , 'custom-menu-wizard') ) : __( 'meta' , 'custom-menu-wizard');
|
421 |
+
$anchorTitle = $anchorTarget . ' #' . $id . ', ' . $content . ', ' . implode( ' ' . __('and', 'custom-menu-wizard') . ' ', array_keys( $anchorTitle ) );
|
422 |
$anchorTarget = '';
|
423 |
if( $shortcodeInst === false ){
|
424 |
//is from assistant via ajax...
|
425 |
$anchorTarget = 'target="_blank"';
|
426 |
+
$anchorTitle .= ' ... ' . __('opens new tab/window', 'custom-menu-wizard');
|
427 |
}
|
428 |
$html .= '<dt class="' . implode( ' ', array_keys( $dtClass ) ) . '"><a href="' . get_permalink() . '" ' . $anchorTarget . ' title="' . $anchorTitle . '">' . get_the_title() . '</a></dt>';
|
429 |
}
|
430 |
$html .= '</dl>';
|
431 |
}else{
|
432 |
+
$html .= '<p>' . __('No CMW shortcodes found.', 'custom-menu-wizard') . '</p>';
|
433 |
}
|
434 |
|
435 |
wp_reset_postdata();
|
541 |
//re-register the widget...
|
542 |
register_widget( self::$widget_class );
|
543 |
if( !$this->widget_registered() ){
|
544 |
+
return WP_DEBUG ? '[cmwizard ' . __('PROBLEM="widget de-registered, and failed to re-register!"', 'custom-menu-wizard') . '/]' : '';
|
545 |
}
|
546 |
}else{
|
547 |
+
return WP_DEBUG ? '[cmwizard ' . __('PROBLEM="widget de-registered, and not allowed to re-register!"', 'custom-menu-wizard') . '/]' : '';
|
548 |
}
|
549 |
}else{
|
550 |
//hasn't had a chance to register yet!...
|
551 |
+
return WP_DEBUG ? '[cmwizard ' . __('PROBLEM="widgets have not been initialised yet!"', 'custom-menu-wizard') . '/]' : '';
|
552 |
}
|
553 |
}
|
554 |
|
doc/cmw-doc.html
CHANGED
@@ -119,7 +119,7 @@ div > ul > li > ul, div > ol > li > ul {
|
|
119 |
<p>
|
120 |
<strong>Tested up to:</strong> 4.3</p>
|
121 |
<p>
|
122 |
-
<strong>Stable tag:</strong> 3.
|
123 |
<p>
|
124 |
<strong>License:</strong> GPLv2 or Later </p>
|
125 |
|
@@ -1209,7 +1209,13 @@ because Version 2 will <strong>not</strong> be supported beyond Version 3.</p>
|
|
1209 |
</div></div></div></div> </div>
|
1210 |
<div role="tabpanel" class="tab-pane fade" id="Changelog">
|
1211 |
<h2>Changelog</h2>
|
1212 |
-
<h4>3.
|
|
|
|
|
|
|
|
|
|
|
|
|
1213 |
|
1214 |
<ul>
|
1215 |
<li>addition : expanded Title From to allow absolute ancestor levels (besides root) and relative ancestor levels</li>
|
119 |
<p>
|
120 |
<strong>Tested up to:</strong> 4.3</p>
|
121 |
<p>
|
122 |
+
<strong>Stable tag:</strong> 3.2.0</p>
|
123 |
<p>
|
124 |
<strong>License:</strong> GPLv2 or Later </p>
|
125 |
|
1209 |
</div></div></div></div> </div>
|
1210 |
<div role="tabpanel" class="tab-pane fade" id="Changelog">
|
1211 |
<h2>Changelog</h2>
|
1212 |
+
<h4>3.2.0</h4>
|
1213 |
+
|
1214 |
+
<ul>
|
1215 |
+
<li>internationalization</li>
|
1216 |
+
</ul>
|
1217 |
+
|
1218 |
+
<h4>3.1.5</h4>
|
1219 |
|
1220 |
<ul>
|
1221 |
<li>addition : expanded Title From to allow absolute ancestor levels (besides root) and relative ancestor levels</li>
|
include/class.widget.php
CHANGED
@@ -16,7 +16,7 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
16 |
'Custom Menu Wizard',
|
17 |
array(
|
18 |
'classname' => 'widget_custom_menu_wizard',
|
19 |
-
'description' => __('Add a custom menu, or part of one, as a widget'),
|
20 |
'customizer_support' => true
|
21 |
)
|
22 |
);
|
@@ -65,7 +65,7 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
65 |
if( ( $menus = $this->cmw_scan_menus( $instance['menu'], $instance['branch'] ) ) === false ){
|
66 |
?>
|
67 |
<p class="widget-<?php echo $this->id_base; ?>-no-menus">
|
68 |
-
<em><?php printf( __('No populated menus have been created yet! <a href="%s">Create one...</a>'), admin_url('nav-menus.php') ); ?></em>
|
69 |
<input id="<?php echo $this->get_field_id('cmwv'); ?>" name="<?php echo $this->get_field_name('cmwv'); ?>"
|
70 |
type="hidden" value="<?php echo Custom_Menu_Wizard_Plugin::$version; ?>" />
|
71 |
<?php foreach( array('filters', 'fallbacks', 'output', 'container', 'classes', 'links') as $v ){ ?>
|
@@ -102,21 +102,21 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
102 |
}
|
103 |
}
|
104 |
//start with the middle option of the relatives (the level of the branch item)...
|
105 |
-
$relGroup[] = '<option value="" ' . selected( $branchLevel, '', false ) . '>' . __('the Branch') . '</option>';
|
106 |
//now do the absolutes and relatives...
|
107 |
for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){
|
108 |
-
//topmost of the absolutes
|
109 |
-
$t = $i
|
110 |
//append to the absolutes...
|
111 |
$absGroup[] = '<option value="' . $i . '" ' . selected( $branchLevel, "$i", false ) . '>' . $t . '</option>';
|
112 |
//for anything LESS THAN the number of levels...
|
113 |
if( $i < $menus['selectedLevels'] ){
|
114 |
-
//immediately above the branch item
|
115 |
-
$t = $i
|
116 |
//prepend to the relatives...
|
117 |
array_unshift( $relGroup, '<option value="-' . $i . '" ' . selected( $branchLevel, "-$i", false ) . '>' . $t . '</option>' );
|
118 |
-
//immediately below the branch item
|
119 |
-
$t = $i
|
120 |
//append to the relatives...
|
121 |
array_push( $relGroup, '<option value="+' . $i . '" ' . selected( $branchLevel, "+$i", false ) . '>' . $t . '</option>' );
|
122 |
}
|
@@ -135,16 +135,16 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
135 |
<div id="<?php echo $this->get_field_id('onchange'); ?>"
|
136 |
class="widget-<?php echo $this->id_base; ?>-onchange<?php echo $this->cmw_wp_version('3.8') ? ' cmw-pre-wp-v38' : ''; ?>"
|
137 |
data-cmw-v36plus='<?php echo $this->cmw_wp_version('3.6', true) ? 'true' : 'false'; ?>'
|
138 |
-
data-cmw-dialog-prompt='<?php _e('Click an item to toggle "Current Menu Item"'); ?>'
|
139 |
-
data-cmw-dialog-output='<?php _e('Basic Output'); ?>'
|
140 |
-
data-cmw-dialog-alternative='<?php _e('Alternative settings'); ?>'
|
141 |
-
data-cmw-dialog-fallback='<?php _e('Fallback invoked'); ?>'
|
142 |
-
data-cmw-dialog-inclusions='<?php _e('Inclusions
|
143 |
-
data-cmw-dialog-exclusions='<?php _e('Exclusions
|
144 |
-
data-cmw-dialog-set-current='<?php _e('No Current Item!'); ?>'
|
145 |
-
data-cmw-dialog-shortcodes='<?php _e('Find posts/pages containing a CMW shortcode'); ?>'
|
146 |
-
data-cmw-dialog-untitled='<?php _e('untitled'); ?>'
|
147 |
-
data-cmw-dialog-fixed='<?php _e('fixed'); ?>'
|
148 |
data-cmw-dialog-nonce='<?php echo wp_create_nonce( 'cmw-find-shortcodes' ); ?>'
|
149 |
data-cmw-dialog-version='<?php echo Custom_Menu_Wizard_Plugin::$version; ?>'
|
150 |
data-cmw-dialog-id='<?php echo $this->get_field_id('dialog'); ?>'>
|
@@ -157,10 +157,10 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
157 |
<p>
|
158 |
<input id="<?php echo $this->get_field_id('cmwv'); ?>" name="<?php echo $this->get_field_name('cmwv'); ?>"
|
159 |
type="hidden" value="<?php echo Custom_Menu_Wizard_Plugin::$version; ?>" />
|
160 |
-
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
161 |
<?php $this->cmw_formfield_checkbox( $instance, 'hide_title',
|
162 |
array(
|
163 |
-
'label' =>
|
164 |
'lclass' => 'alignright'
|
165 |
) ); ?>
|
166 |
<?php $this->cmw_formfield_textbox( $instance, 'title',
|
@@ -170,7 +170,7 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
170 |
</p>
|
171 |
|
172 |
<p>
|
173 |
-
<label for="<?php echo $this->get_field_id('menu'); ?>"><?php _e('Select Menu:'); ?></label>
|
174 |
<select id="<?php echo $this->get_field_id('menu'); ?>"
|
175 |
class="cmw-select-menu cmw-listen" name="<?php echo $this->get_field_name('menu'); ?>">
|
176 |
<?php echo $menus['names']; ?>
|
@@ -181,23 +181,23 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
181 |
/**
|
182 |
* start collapsible section : 'Filter'
|
183 |
*/
|
184 |
-
$this->cmw_open_a_field_section( $instance, __('Filters'), 'fs_filters' ); ?>
|
185 |
|
186 |
<div>
|
187 |
<?php $this->cmw_assist_link(); ?>
|
188 |
-
<strong><?php _e('Primary Filter'); ?></strong>
|
189 |
|
190 |
<div class="cmw-indented">
|
191 |
<label class="cmw-verticalalign-baseline">
|
192 |
<input id="<?php echo $this->get_field_id('filter'); ?>_0" class="cmw-bylevel cmw-listen"
|
193 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('filter'); ?>"
|
194 |
type="radio" value="" <?php checked( $instance['filter'], '' ); ?>
|
195 |
-
/><?php _e('Level:'); ?></label>
|
196 |
<select id="<?php echo $this->get_field_id('level'); ?>" class="cmw-level cmw-set-levels cmw-listen"
|
197 |
<?php $this->cmw_disableif(); ?> data-cmw-set-levels="0"
|
198 |
name="<?php echo $this->get_field_name('level'); ?>">
|
199 |
<?php for( $i = 1, $j = $instance['level'] > $menus['selectedLevels'] ? 1 : $instance['level']; $i <= $menus['selectedLevels']; $i++ ){ ?>
|
200 |
-
<option value="<?php echo $i; ?>" <?php selected( $j, $i ); ?>><?php echo $i > 1 ? $i :
|
201 |
<?php } ?>
|
202 |
</select>
|
203 |
</div>
|
@@ -207,10 +207,10 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
207 |
<input id="<?php echo $this->get_field_id('filter'); ?>_1" class="cmw-bybranch cmw-listen"
|
208 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('filter'); ?>"
|
209 |
type="radio" value="branch" <?php checked( $instance['filter'], 'branch' ); ?>
|
210 |
-
/><?php _e('Branch:'); ?></label>
|
211 |
<select id="<?php echo $this->get_field_id('branch'); ?>" class="cmw-branches cmw-assist-items cmw-listen"
|
212 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('branch'); ?>">
|
213 |
-
<option value="0" <?php selected( $instance['branch'], 0 ); ?>><?php _e('Current Item'); ?></option>
|
214 |
<?php echo $menus['selectedOptgroup']; ?>
|
215 |
</select>
|
216 |
<select id="<?php echo $this->get_field_id('branch_ignore'); ?>" class='cmw-off-the-page' disabled="disabled"
|
@@ -224,7 +224,7 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
224 |
<input id="<?php echo $this->get_field_id('filter'); ?>_2" class="cmw-byitems cmw-listen"
|
225 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('filter'); ?>"
|
226 |
type="radio" value="items" <?php checked( $instance['filter'], 'items' ); ?>
|
227 |
-
/><?php _e('Items:'); ?></label>
|
228 |
<?php $this->cmw_formfield_textbox( $instance, 'items',
|
229 |
array(
|
230 |
'fclass' => 'cmw-maxwidth-twothirds cmw-setitems cmw-listen'
|
@@ -234,17 +234,17 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
234 |
|
235 |
<div class="cmw-disableif-ss<?php $this->cmw_disableif( 'push', $isByItems ); ?>">
|
236 |
<?php $this->cmw_assist_link(); ?>
|
237 |
-
<strong><?php _e('Secondary Filter'); ?></strong>
|
238 |
|
239 |
<div class="cmw-indented">
|
240 |
-
<label class="cmw-disableifnot-br<?php $this->cmw_disableif( 'push', $isNotByBranch ); ?>"><?php _e('Starting at:'); ?>
|
241 |
<select id="<?php echo $this->get_field_id('branch_start'); ?>" class="cmw-branch-start cmw-listen"
|
242 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('branch_start'); ?>">
|
243 |
-
<optgroup label="<?php
|
244 |
-
data-cmw-text-parent="<?php _e('parent'); ?>">
|
245 |
<?php echo implode( '', $relGroup ); ?>
|
246 |
</optgroup>
|
247 |
-
<optgroup label="<?php _e('absolute...'); ?>">
|
248 |
<?php echo implode( '', $absGroup ); ?>
|
249 |
</optgroup>
|
250 |
</select></label><!-- end .cmw-disableifnot-br --><?php $this->cmw_disableif( 'pop' ); ?>
|
@@ -255,36 +255,36 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
255 |
<input id="<?php echo $this->get_field_id('start_mode'); ?>_0"
|
256 |
name="<?php echo $this->get_field_name('start_mode'); ?>"
|
257 |
<?php $this->cmw_disableif(); ?> type="radio" value="" <?php checked( $instance['start_mode'] !== 'level' ); ?>
|
258 |
-
/><?php
|
259 |
|
260 |
<label class="cmw-followed-by cmw-whitespace-nowrap">
|
261 |
<input id="<?php echo $this->get_field_id('start_mode'); ?>_1" name="<?php echo $this->get_field_name('start_mode'); ?>"
|
262 |
<?php $this->cmw_disableif(); ?> type="radio" value="level" <?php checked( $instance['start_mode'] === 'level' ); ?>
|
263 |
-
/><?php _e('Level'); ?></label>
|
264 |
|
265 |
<?php $this->cmw_formfield_checkbox( $instance, 'allow_all_root',
|
266 |
array(
|
267 |
-
'label' => __('Allow all Root Items'),
|
268 |
'lclass' => 'cmw-whitespace-nowrap'
|
269 |
) ); ?>
|
270 |
</span><!-- end .cmw-disableifnot-br --><?php $this->cmw_disableif( 'pop' ); ?>
|
271 |
</div>
|
272 |
|
273 |
<div class="cmw-indented">
|
274 |
-
<label class="cmw-followed-by"><?php _e('For Depth:'); ?>
|
275 |
-
<select id="<?php echo $this->get_field_id('depth'); ?>" data-cmw-text-levels="<?php _e(' levels'); ?>"
|
276 |
data-cmw-set-levels="1" <?php $this->cmw_disableif(); ?>
|
277 |
class="cmw-depth cmw-set-levels cmw-listen" name="<?php echo $this->get_field_name('depth'); ?>">
|
278 |
-
<option value="0" <?php selected( $instance['depth'] > $menus['selectedLevels'] ? 0 : $instance['depth'], 0 ); ?>><?php _e('unlimited'); ?></option>
|
279 |
<?php for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){ ?>
|
280 |
-
<option value="<?php echo $i; ?>" <?php selected( $instance['depth'], $i ); ?>><?php printf( _n('%d level', '%d levels', $i), $i ); ?></option>
|
281 |
<?php } ?>
|
282 |
</select></label>
|
283 |
|
284 |
|
285 |
<?php $this->cmw_formfield_checkbox( $instance, 'depth_rel_current',
|
286 |
array(
|
287 |
-
'label' => __('Relative to Current Item'),
|
288 |
'lclass' => 'cmw-disableif-ud cmw-whitespace-nowrap',
|
289 |
'disableif' => $isUnlimitedDepth
|
290 |
) ); ?>
|
@@ -293,50 +293,50 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
293 |
|
294 |
<div>
|
295 |
<?php $this->cmw_assist_link(); ?>
|
296 |
-
<strong><?php _e('Inclusions'); ?></strong>
|
297 |
|
298 |
<div class="cmw-indented">
|
299 |
-
<label class="cmw-disableifnot-br<?php $this->cmw_disableif( 'push', $isNotByBranch ); ?>"><?php _e('Branch Ancestors:'); ?>
|
300 |
<select id="<?php echo $this->get_field_id('ancestors'); ?>" class="cmw-ancestors cmw-set-rel-abs-levels cmw-listen"
|
301 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('ancestors'); ?>"
|
302 |
-
data-cmw-text-tolevel="<?php _e('to level'); ?>">
|
303 |
<option value="0" <?php selected( $j, 0 ); ?>> </option>
|
304 |
<?php
|
305 |
$j = $instance['ancestors'];
|
306 |
$j = max( min( $j, $menus['selectedLevels'] - 1 ), 1 - $menus['selectedLevels'] ); ?>
|
307 |
-
<optgroup label="<?php
|
308 |
-
<option value="-1" <?php selected( $j, -1 ); ?>><?php
|
309 |
<?php for( $i = -2; $i > 0 - $menus['selectedLevels']; $i-- ){ ?>
|
310 |
-
<option value="<?php echo $i; ?>" <?php selected( $j, $i ); ?>><?php printf( __('%d levels'), $i ); ?></option>
|
311 |
<?php } ?>
|
312 |
</optgroup>
|
313 |
-
<optgroup label="<?php _e('absolute...'); ?>" data-cmw-text-for-option="<?php _e('to level %d'); ?> ">
|
314 |
-
<option value="1" <?php selected( $j, 1 ); ?>><?php
|
315 |
<?php for( $i = 2; $i < $menus['selectedLevels']; $i++ ){ ?>
|
316 |
-
<option value="<?php echo $i; ?>" <?php selected( $j, $i ); ?>><?php printf( __('to level %d'), $i ); ?></option>
|
317 |
<?php } ?>
|
318 |
</optgroup>
|
319 |
</select></label><!-- end .cmw-disableifnot-br --><?php $this->cmw_disableif( 'pop' ); ?>
|
320 |
|
321 |
<br />
|
322 |
<span class="cmw-disableifnot-br<?php $this->cmw_disableif( 'push', $isNotByBranch ); ?>">
|
323 |
-
<label><?php _e('... with Siblings:'); ?>
|
324 |
<select id="<?php echo $this->get_field_id('ancestor_siblings'); ?>" class="cmw-ancestor-siblings cmw-set-rel-abs-levels cmw-listen"
|
325 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('ancestor_siblings'); ?>">
|
326 |
<option value="0" <?php selected( $j, 0 ); ?>> </option>
|
327 |
<?php
|
328 |
$j = $instance['ancestor_siblings'];
|
329 |
$j = max( min( $j, $menus['selectedLevels'] - 1 ), 1 - $menus['selectedLevels'] ); ?>
|
330 |
-
<optgroup label="<?php
|
331 |
-
<option value="-1" <?php selected( $j, -1 ); ?>><?php
|
332 |
<?php for( $i = -2; $i > 0 - $menus['selectedLevels']; $i-- ){ ?>
|
333 |
-
<option value="<?php echo $i; ?>" <?php selected( $j, $i ); ?>><?php printf( __('%d levels'), $i ); ?></option>
|
334 |
<?php } ?>
|
335 |
</optgroup>
|
336 |
-
<optgroup label="<?php _e('absolute...'); ?>" data-cmw-text-for-option="<?php _e('to level %d'); ?> ">
|
337 |
-
<option value="1" <?php selected( $j, 1 ); ?>><?php
|
338 |
<?php for( $i = 2; $i < $menus['selectedLevels']; $i++ ){ ?>
|
339 |
-
<option value="<?php echo $i; ?>" <?php selected( $j, $i ); ?>><?php printf( __('to level %d'), $i ); ?></option>
|
340 |
<?php } ?>
|
341 |
</optgroup>
|
342 |
</select></label>
|
@@ -345,21 +345,21 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
345 |
|
346 |
<?php $this->cmw_formfield_checkbox( $instance, 'siblings',
|
347 |
array(
|
348 |
-
'label' => __('Branch Siblings'),
|
349 |
'lclass' => 'cmw-disableifnot-br',
|
350 |
'disableif' => $isNotByBranch
|
351 |
) ); ?>
|
352 |
|
353 |
<div class="cmw-indented">
|
354 |
-
<label><?php _e('Level:'); ?>
|
355 |
<select id="<?php echo $this->get_field_id('include_level'); ?>" class="cmw-include-level"
|
356 |
name="<?php echo $this->get_field_name('include_level'); ?>">
|
357 |
<?php $j = intval($instance['include_level']) > $menus['selectedLevels'] ? '' : $instance['include_level']; ?>
|
358 |
<option value="" <?php selected( $j, '' ); ?>> </option>
|
359 |
<?php for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){ ?>
|
360 |
<option value="<?php echo $i; ?>" <?php selected( $j, "$i" ); ?>><?php echo $i; ?></option>
|
361 |
-
<option value="<?php echo $i . '-'; ?>" <?php selected( $j, $i . '-' ); ?>> <?php echo $i . __('
|
362 |
-
<option value="<?php echo $i . '+'; ?>" <?php selected( $j, $i . '+' ); ?>> <?php echo $i . __('
|
363 |
<?php } ?>
|
364 |
</select></label>
|
365 |
</div>
|
@@ -367,26 +367,26 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
367 |
|
368 |
<div>
|
369 |
<?php $this->cmw_assist_link(); ?>
|
370 |
-
<strong><?php _e('Exclusions'); ?></strong>
|
371 |
|
372 |
<div class="cmw-indented">
|
373 |
<?php $this->cmw_formfield_textbox( $instance, 'exclude',
|
374 |
array(
|
375 |
-
'label' => __('Item Ids:'),
|
376 |
'fclass' => 'cmw-maxwidth-twothirds cmw-exclusions'
|
377 |
) ); ?>
|
378 |
</div>
|
379 |
|
380 |
<div class="cmw-indented">
|
381 |
-
<label><?php _e('Level:'); ?>
|
382 |
<select id="<?php echo $this->get_field_id('exclude_level'); ?>" class="cmw-exclude-level"
|
383 |
name="<?php echo $this->get_field_name('exclude_level'); ?>">
|
384 |
<?php $j = intval($instance['exclude_level']) > $menus['selectedLevels'] ? '' : $instance['exclude_level']; ?>
|
385 |
<option value="" <?php selected( $j, '' ); ?>> </option>
|
386 |
<?php for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){ ?>
|
387 |
<option value="<?php echo $i; ?>" <?php selected( $j, "$i" ); ?>><?php echo $i; ?></option>
|
388 |
-
<option value="<?php echo $i . '-'; ?>" <?php selected( $j, $i . '-' ); ?>> <?php echo $i . __('
|
389 |
-
<option value="<?php echo $i . '+'; ?>" <?php selected( $j, $i . '+' ); ?>> <?php echo $i . __('
|
390 |
<?php } ?>
|
391 |
</select></label>
|
392 |
</div>
|
@@ -394,16 +394,16 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
394 |
|
395 |
<div>
|
396 |
<?php $this->cmw_assist_link(); ?>
|
397 |
-
<strong><?php _e('Qualifier'); ?></strong>
|
398 |
-
<br /><label for="<?php echo $this->get_field_id('contains_current'); ?>"><?php _e('Current Item is in:'); ?></label>
|
399 |
<select id="<?php echo $this->get_field_id('contains_current'); ?>"
|
400 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('contains_current'); ?>">
|
401 |
<option value="" <?php selected( $instance['contains_current'], '' ); ?>> </option>
|
402 |
-
<option value="menu" <?php selected( $instance['contains_current'], 'menu' ); ?>><?php echo _e('Menu'); ?></option>
|
403 |
-
<option value="primary" <?php selected( $instance['contains_current'], 'primary' ); ?>><?php echo _e('Primary Filter'); ?></option>
|
404 |
-
<option value="secondary" <?php selected( $instance['contains_current'], 'secondary' ); ?>><?php echo _e('Secondary Filter'); ?></option>
|
405 |
-
<option value="inclusions" <?php selected( $instance['contains_current'], 'inclusions' ); ?>><?php echo _e('Inclusions'); ?></option>
|
406 |
-
<option value="output" <?php selected( $instance['contains_current'], 'output' ); ?>><?php echo _e('Final Output'); ?></option>
|
407 |
</select>
|
408 |
</div>
|
409 |
|
@@ -413,63 +413,63 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
413 |
/**
|
414 |
* v1.2.0 start collapsible section : 'Fallbacks'
|
415 |
*/
|
416 |
-
$this->cmw_open_a_field_section( $instance, __('Fallbacks'), 'fs_fallbacks' ); ?>
|
417 |
|
418 |
<div class="cmw-disableifnot-br-ci<?php $this->cmw_disableif( 'push', $isNotBranchCurrentItem ); ?>">
|
419 |
<?php $this->cmw_assist_link(); ?>
|
420 |
|
421 |
<div class="cmw-indented">
|
422 |
-
<label for="<?php echo $this->get_field_id('fallback'); ?>"><strong><?php _e('If Current Item has no children:'); ?></strong></label>
|
423 |
<select id="<?php echo $this->get_field_id('fallback'); ?>" class="cmw-fallback cmw-listen"
|
424 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('fallback'); ?>">
|
425 |
<option value="" <?php selected( $instance['fallback'], '' ); ?>> </option>
|
426 |
-
<option value="parent" <?php selected( $instance['fallback'], 'parent' ); ?>><?php _e('Start at : -1 (parent)'); ?></option>
|
427 |
-
<option value="current" <?php selected( $instance['fallback'], 'current' ); ?>><?php _e('Start at : the Current Item'); ?></option>
|
428 |
-
<option value="quit" <?php selected( $instance['fallback'], 'quit' ); ?>><?php _e('No output!'); ?></option>
|
429 |
</select>
|
430 |
|
431 |
<br />
|
432 |
<span class="cmw-disableifnot-fb-pc<?php $this->cmw_disableif( 'push', $isNotFallbackParentCurrent ); ?>">
|
433 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_siblings',
|
434 |
array(
|
435 |
-
'label' => '…' . __('and Include its Siblings')
|
436 |
) ); ?>
|
437 |
|
438 |
<br />
|
439 |
-
<label><?php _e('For Depth:'); ?>
|
440 |
-
<select id="<?php echo $this->get_field_id('fallback_depth'); ?>" data-cmw-text-levels="<?php _e(' levels'); ?>"
|
441 |
data-cmw-set-levels="1" <?php $this->cmw_disableif(); ?>
|
442 |
class="cmw-set-levels" name="<?php echo $this->get_field_name('fallback_depth'); ?>">
|
443 |
<option value="0" <?php selected( $instance['fallback_depth'] > $menus['selectedLevels'] ? 0 : $instance['fallback_depth'], 0 ); ?>> </option>
|
444 |
<?php for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){ ?>
|
445 |
-
<option value="<?php echo $i; ?>" <?php selected( $instance['fallback_depth'], $i ); ?>><?php printf( _n('%d level', '%d levels', $i), $i ); ?></option>
|
446 |
<?php } ?>
|
447 |
</select></label>
|
448 |
-
<span class="cmw-small-block cmw-indented"><em class="cmw-colour-grey"><?php _e('Fallback Depth is Relative to Current Item!'); ?></em></span>
|
449 |
</span><!-- end .cmw-disableifnot-fb-pc --><?php $this->cmw_disableif( 'pop' ); ?>
|
450 |
</div>
|
451 |
|
452 |
</div><!-- end .cmw-disableifnot-br-ci --><?php $this->cmw_disableif( 'pop' ); ?>
|
453 |
|
454 |
<div>
|
455 |
-
<div class="cmw-indented"><strong><?php _e('If no Current Item can be found:'); ?></strong>
|
456 |
<br />
|
457 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_ci_parent',
|
458 |
array(
|
459 |
-
'label' => __('Try items marked Parent of Current')
|
460 |
) ); ?>
|
461 |
-
<span class="cmw-small-block cmw-indented"><em class="cmw-colour-grey"><?php _e('This is a last resort to determine a "Current Item"'); ?></em></span>
|
462 |
</div>
|
463 |
</div>
|
464 |
|
465 |
<div>
|
466 |
-
<div class="cmw-indented"><strong><?php _e('If more than 1 possible Current Item:'); ?></strong>
|
467 |
<br />
|
468 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_ci_lifo',
|
469 |
array(
|
470 |
-
'label' => __('Use the <strong>last</strong> one found')
|
471 |
) ); ?>
|
472 |
-
<span class="cmw-small-block cmw-indented"><em class="cmw-colour-grey"><?php _e('The default is to use the first candidate found'); ?></em></span>
|
473 |
</div>
|
474 |
</div>
|
475 |
|
@@ -479,7 +479,7 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
479 |
/**
|
480 |
* start collapsible section : 'Output'
|
481 |
*/
|
482 |
-
$this->cmw_open_a_field_section( $instance, __('Output'), 'fs_output' ); ?>
|
483 |
|
484 |
<div>
|
485 |
<?php $this->cmw_assist_link(); ?>
|
@@ -487,83 +487,83 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
487 |
<input id="<?php echo $this->get_field_id('flat_output'); ?>_0"
|
488 |
name="<?php echo $this->get_field_name('flat_output'); ?>"
|
489 |
<?php $this->cmw_disableif(); ?> type="radio" value="0" <?php checked( !$instance['flat_output'] ); ?>
|
490 |
-
/><?php _e('Hierarchical'); ?></label>
|
491 |
<label class="cmw-whitespace-nowrap">
|
492 |
<input id="<?php echo $this->get_field_id('flat_output'); ?>_1"
|
493 |
name="<?php echo $this->get_field_name('flat_output'); ?>"
|
494 |
<?php $this->cmw_disableif(); ?> type="radio" value="1" <?php checked( $instance['flat_output'] ); ?>
|
495 |
-
/><?php _e('Flat'); ?></label>
|
496 |
</div>
|
497 |
|
498 |
<div>
|
499 |
-
<strong><?php _e('Set Title from'); ?></strong>
|
500 |
|
501 |
<div class="cmw-indented">
|
502 |
-
<label><?php _e('Current Item:'); $j = $instance['title_current']; ?>
|
503 |
<select id="<?php echo $this->get_field_id('title_current'); ?>" class="cmw-title-from cmw-set-rel-abs-levels cmw-listen"
|
504 |
name="<?php echo $this->get_field_name('title_current'); ?>"
|
505 |
-
data-cmw-text-level="<?php _e('level'); ?>">
|
506 |
<option value="" <?php selected( $j, "" ); ?>> </option>
|
507 |
-
<option value="0" <?php selected( $j, "0" ); ?>><?php _e('the Current Item'); ?></option>
|
508 |
<?php
|
509 |
$j = is_numeric( $j ) ? max( min( $j, $menus['selectedLevels'] - 1 ), 1 - $menus['selectedLevels'] ) : $j; ?>
|
510 |
-
<optgroup label="<?php
|
511 |
-
<option value="-1" <?php selected( $j, "-1" ); ?>><?php
|
512 |
<?php for( $i = -2; $i > 0 - $menus['selectedLevels']; $i-- ){ ?>
|
513 |
-
<option value="<?php echo $i; ?>" <?php selected( $j, "$i" ); ?>><?php printf( __('%d levels'), $i ); ?></option>
|
514 |
<?php } ?>
|
515 |
</optgroup>
|
516 |
-
<optgroup label="<?php _e('absolute...'); ?>" data-cmw-text-for-option="<?php _e('level %d'); ?> ">
|
517 |
-
<option value="1" <?php selected( $j, "1" ); ?>><?php
|
518 |
<?php for( $i = 2; $i < $menus['selectedLevels']; $i++ ){ ?>
|
519 |
-
<option value="<?php echo $i; ?>" <?php selected( $j, "$i" ); ?>><?php printf( __('level %d'), $i ); ?></option>
|
520 |
<?php } ?>
|
521 |
</optgroup>
|
522 |
</select></label>
|
523 |
</div>
|
524 |
<div class="cmw-indented">
|
525 |
-
<label class="cmw-disableifnot-br<?php $this->cmw_disableif( 'push', $isNotByBranch ); ?>"><?php _e('Branch Item:'); $j = $instance['title_branch']; ?>
|
526 |
<select id="<?php echo $this->get_field_id('title_branch'); ?>" class="cmw-title-from cmw-set-rel-abs-levels cmw-listen"
|
527 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('title_branch'); ?>"
|
528 |
-
data-cmw-text-level="<?php _e('level'); ?>">
|
529 |
<option value="" <?php selected( $j, "" ); ?>> </option>
|
530 |
-
<option value="0" <?php selected( $j, "0" ); ?>><?php _e('the Branch Item'); ?></option>
|
531 |
<?php
|
532 |
$j = is_numeric( $j ) ? max( min( $j, $menus['selectedLevels'] - 1 ), 1 - $menus['selectedLevels'] ) : $j; ?>
|
533 |
-
<optgroup label="<?php
|
534 |
-
<option value="-1" <?php selected( $j, "-1" ); ?>><?php
|
535 |
<?php for( $i = -2; $i > 0 - $menus['selectedLevels']; $i-- ){ ?>
|
536 |
-
<option value="<?php echo $i; ?>" <?php selected( $j, "$i" ); ?>><?php printf( __('%d levels'), $i ); ?></option>
|
537 |
<?php } ?>
|
538 |
</optgroup>
|
539 |
-
<optgroup label="<?php _e('absolute...'); ?>" data-cmw-text-for-option="<?php _e('level %d'); ?> ">
|
540 |
-
<option value="1" <?php selected( $j, "1" ); ?>><?php
|
541 |
<?php for( $i = 2; $i < $menus['selectedLevels']; $i++ ){ ?>
|
542 |
-
<option value="<?php echo $i; ?>" <?php selected( $j, "$i" ); ?>><?php printf( __('level %d'), $i ); ?></option>
|
543 |
<?php } ?>
|
544 |
</optgroup>
|
545 |
</select></label><!-- end .cmw-disableifnot-br --><?php $this->cmw_disableif( 'pop' ); ?>
|
546 |
</div>
|
547 |
<div class="cmw-indented">
|
548 |
-
… <?php _e('and
|
549 |
<?php $this->cmw_formfield_checkbox( $instance, 'title_linked',
|
550 |
array(
|
551 |
-
'label' => __('Make it a Link')
|
552 |
) ); ?>
|
553 |
</div>
|
554 |
</div>
|
555 |
|
556 |
<div>
|
557 |
-
<strong><?php _e('Change UL to OL'); ?></strong>
|
558 |
<br />
|
559 |
<?php $this->cmw_formfield_checkbox( $instance, 'ol_root',
|
560 |
array(
|
561 |
-
'label' => __('Top Level'),
|
562 |
'lclass' => 'cmw-followed-by'
|
563 |
) ); ?>
|
564 |
<?php $this->cmw_formfield_checkbox( $instance, 'ol_sub',
|
565 |
array(
|
566 |
-
'label' => __('Sub-Levels'),
|
567 |
'lclass' => 'cmw-whitespace-nowrap'
|
568 |
) ); ?>
|
569 |
</div>
|
@@ -577,8 +577,8 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
577 |
<div>
|
578 |
<?php $this->cmw_formfield_checkbox( $instance, 'hide_empty',
|
579 |
array(
|
580 |
-
'label' => __('Hide Widget if Empty'),
|
581 |
-
'desc' => __('Prevents any output when no items are found')
|
582 |
) ); ?>
|
583 |
</div>
|
584 |
<?php }else{ ?>
|
@@ -592,27 +592,27 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
592 |
/**
|
593 |
* start collapsible section : 'Container'
|
594 |
*/
|
595 |
-
$this->cmw_open_a_field_section( $instance, __('Container'), 'fs_container' ); ?>
|
596 |
|
597 |
<div>
|
598 |
<?php $this->cmw_formfield_textbox( $instance, 'container',
|
599 |
array(
|
600 |
-
'label' => __('Element:'),
|
601 |
-
'desc' => __('Eg. div or nav; leave empty for no container')
|
602 |
) ); ?>
|
603 |
</div>
|
604 |
<div>
|
605 |
<?php $this->cmw_formfield_textbox( $instance, 'container_id',
|
606 |
array(
|
607 |
-
'label' => __('Unique ID:'),
|
608 |
-
'desc' => __('An optional ID for the container')
|
609 |
) ); ?>
|
610 |
</div>
|
611 |
<div>
|
612 |
<?php $this->cmw_formfield_textbox( $instance, 'container_class',
|
613 |
array(
|
614 |
-
'label' => __('Class:'),
|
615 |
-
'desc' => __('Extra class for the container')
|
616 |
) ); ?>
|
617 |
</div>
|
618 |
|
@@ -622,20 +622,20 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
622 |
/**
|
623 |
* start collapsible section : 'Classes'
|
624 |
*/
|
625 |
-
$this->cmw_open_a_field_section( $instance, __('Classes'), 'fs_classes' ); ?>
|
626 |
|
627 |
<div>
|
628 |
<?php $this->cmw_formfield_textbox( $instance, 'menu_class',
|
629 |
array(
|
630 |
-
'label' => __('Menu Class:'),
|
631 |
-
'desc' => __('Class for the list element forming the menu')
|
632 |
) ); ?>
|
633 |
</div>
|
634 |
<div>
|
635 |
<?php $this->cmw_formfield_textbox( $instance, 'widget_class',
|
636 |
array(
|
637 |
-
'label' => __('Widget Class:'),
|
638 |
-
'desc' => __('Extra class for the widget itself')
|
639 |
) ); ?>
|
640 |
</div>
|
641 |
|
@@ -645,37 +645,37 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
645 |
/**
|
646 |
* start collapsible section : 'Links'
|
647 |
*/
|
648 |
-
$this->cmw_open_a_field_section( $instance, __('Links'), 'fs_links' ); ?>
|
649 |
|
650 |
<div>
|
651 |
<?php $this->cmw_formfield_textbox( $instance, 'before',
|
652 |
array(
|
653 |
-
'label' => __('Before the Link:'),
|
654 |
-
'desc' =>__( htmlspecialchars('Text/HTML to go before the </a> of the link') ),
|
655 |
'fclass' => 'widefat'
|
656 |
) ); ?>
|
657 |
</div>
|
658 |
<div>
|
659 |
<?php $this->cmw_formfield_textbox( $instance, 'after',
|
660 |
array(
|
661 |
-
'label' => __('After the Link:'),
|
662 |
-
'desc' => __( htmlspecialchars('Text/HTML to go after the </a> of the link') ),
|
663 |
'fclass' => 'widefat'
|
664 |
) ); ?>
|
665 |
</div>
|
666 |
<div>
|
667 |
<?php $this->cmw_formfield_textbox( $instance, 'link_before',
|
668 |
array(
|
669 |
-
'label' => __('Before the Link Text:'),
|
670 |
-
'desc' => __('Text/HTML to go before the link text'),
|
671 |
'fclass' => 'widefat'
|
672 |
) ); ?>
|
673 |
</div>
|
674 |
<div>
|
675 |
<?php $this->cmw_formfield_textbox( $instance, 'link_after',
|
676 |
array(
|
677 |
-
'label' => __('After the Link Text:'),
|
678 |
-
'desc' => __('Text/HTML to go after the link text'),
|
679 |
'fclass' => 'widefat'
|
680 |
) ); ?>
|
681 |
</div>
|
@@ -686,32 +686,32 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
686 |
/**
|
687 |
* v3.1.0 start collapsible section : 'Alternative'
|
688 |
*/
|
689 |
-
$this->cmw_open_a_field_section( $instance, __('Alternative'), 'fs_alternative' ); ?>
|
690 |
|
691 |
<div>
|
692 |
<?php $this->cmw_assist_link(); ?>
|
693 |
|
694 |
-
<label for="<?php echo $this->get_field_id('switch_if'); ?>" class="cmw-followed-by"><?php _e('On condition:'); ?></label>
|
695 |
<br /><select id="<?php echo $this->get_field_id('switch_if'); ?>" class="cmw-switchable cmw-listen"
|
696 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('switch_if'); ?>">
|
697 |
<option value="" <?php selected( $instance['switch_if'], '' ); ?>> </option>
|
698 |
-
<option value="current" <?php selected( $instance['switch_if'], 'current' ); ?>><?php _e('Current Item is in...'); ?></option>
|
699 |
-
<option value="no-current" <?php selected( $instance['switch_if'], 'no-current' ); ?>><?php _e('Current Item is NOT in...'); ?></option>
|
700 |
-
<option value="no-output" <?php selected( $instance['switch_if'], 'no-output' ); ?>><?php _e('No Output from...'); ?></option>
|
701 |
</select>
|
702 |
|
703 |
<select id="<?php echo $this->get_field_id('switch_at'); ?>" class="cmw-switchable cmw-listen"
|
704 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('switch_at'); ?>">
|
705 |
<option value="" <?php selected( $instance['switch_at'], '' ); ?>> </option>
|
706 |
-
<option value="menu" <?php selected( $instance['switch_at'], 'menu' ); ?>><?php echo _e('Menu'); ?></option>
|
707 |
-
<option value="primary" <?php selected( $instance['switch_at'], 'primary' ); ?>><?php echo _e('Primary Filter'); ?></option>
|
708 |
-
<option value="secondary" <?php selected( $instance['switch_at'], 'secondary' ); ?>><?php echo _e('Secondary Filter'); ?></option>
|
709 |
-
<option value="inclusions" <?php selected( $instance['switch_at'], 'inclusions' ); ?>><?php echo _e('Inclusions'); ?></option>
|
710 |
-
<option value="output" <?php selected( $instance['switch_at'], 'output' ); ?>><?php echo _e('Final Output'); ?></option>
|
711 |
</select>
|
712 |
|
713 |
<br />
|
714 |
-
<label class="cmw-disableifnot-sw<?php $this->cmw_disableif( 'push', $isNotSwitchable ); ?>"><?php _e('Then switch settings to:'); ?>
|
715 |
<br /><textarea rows="3" cols="20" <?php $this->cmw_disableif(); ?> id="<?php echo $this->get_field_id('switch_to'); ?>"
|
716 |
name="<?php echo $this->get_field_name('switch_to'); ?>"
|
717 |
class="widefat"><?php echo $instance['switch_to']; ?></textarea>
|
@@ -722,16 +722,16 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
722 |
|
723 |
<?php $this->cmw_close_a_field_section(); ?>
|
724 |
|
725 |
-
<div class="cmw-mock-fieldset"><?php _e('Shortcodes'); ?></div>
|
726 |
<div class="cmw-the-shortcodes">
|
727 |
-
<div class="cmw-small-block"><em class="cmw-colour-grey"><?php _e('The equivalent shortcode for this configuration...'); ?></em></div>
|
728 |
-
<div class="cmw-shortcode-nojs cmw-small-block"><?php _e('With Javascript disabled, this is only guaranteed to be accurate when you <em>initially enter</em> Edit mode!'); ?></div>
|
729 |
<div class="cmw-shortcode-wrap"><code class="widget-<?php echo $this->id_base; ?>-shortcode ui-corner-all"
|
730 |
-
title="<?php
|
731 |
<?php if( is_numeric( $this->number ) && $this->number > 0 ){ ?>
|
732 |
-
<div class="cmw-small-block"><em class="cmw-colour-grey"><?php _e('This <u>specific widget</u> can also be included using...'); ?></em></div>
|
733 |
<div class="cmw-shortcode-wrap"><code class="widget-<?php echo $this->id_base; ?>-shortcode cmw-instance-shortcode ui-corner-all"
|
734 |
-
title="<?php
|
735 |
<?php } ?>
|
736 |
</div>
|
737 |
|
@@ -965,7 +965,7 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
965 |
//button, but it doesn't hurt so I've left it in...
|
966 |
$hashid = $this->get_field_id( 'cmw' . ++$this->_cmw_hash_ct );
|
967 |
?>
|
968 |
-
<a class="widget-<?php echo $this->id_base; ?>-assist button" id="<?php echo $hashid; ?>" href="#<?php echo $hashid; ?>"><?php _e('assist'); ?></a>
|
969 |
<?php
|
970 |
|
971 |
}
|
@@ -1193,7 +1193,7 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
1193 |
'names' => array(), //HTML of OPTIONs, for selecting a menu (returned as a string)
|
1194 |
'optgroups' => array(), //HTML of OPTGROUPs & contained OPTIONs, for selecting an item (returned as a string)
|
1195 |
'selectedOptgroup' => array(''), //HTML of currently selected menu's OPTGROUP and its OPTIONs (returned as string)
|
1196 |
-
'selectedBranchName' => __('the Current Item'), //title of currently selected menu item
|
1197 |
'selectedLevels' => 1 //number of levels in the currently selected menu
|
1198 |
);
|
1199 |
|
@@ -1712,7 +1712,7 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
1712 |
if( ( $menus = $this->cmw_scan_menus( $instance['menu'], $instance['filter_item'] ) ) === false ){
|
1713 |
?>
|
1714 |
<p class="widget-<?php echo $this->id_base; ?>-no-menus">
|
1715 |
-
<?php printf( __('No populated menus have been created yet
|
1716 |
</p>
|
1717 |
<?php
|
1718 |
return;
|
@@ -1728,13 +1728,13 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
1728 |
<div id="<?php echo $this->get_field_id('onchange'); ?>"
|
1729 |
class="widget-<?php echo $this->id_base; ?>-onchange<?php echo $this->cmw_wp_version('3.8') ? ' cmw-pre-wp-v38' : ''; ?>"
|
1730 |
data-cmw-v36plus='<?php echo $this->cmw_wp_version('3.6', true) ? 'true' : 'false'; ?>'
|
1731 |
-
data-cmw-dialog-prompt='<?php _e('Click an item to toggle "Current Menu Item"'); ?>'
|
1732 |
-
data-cmw-dialog-output='<?php _e('Basic Output'); ?>'
|
1733 |
-
data-cmw-dialog-fallback='<?php _e('Fallback invoked'); ?>'
|
1734 |
-
data-cmw-dialog-set-current='<?php _e('Set Current Item?'); ?>'
|
1735 |
-
data-cmw-dialog-shortcodes='<?php _e('Find posts/pages containing a CMW shortcode'); ?>'
|
1736 |
-
data-cmw-dialog-untitled='<?php _e('untitled'); ?>'
|
1737 |
-
data-cmw-dialog-fixed='<?php _e('fixed'); ?>'
|
1738 |
data-cmw-dialog-nonce='<?php echo wp_create_nonce( 'cmw-find-shortcodes' ); ?>'
|
1739 |
data-cmw-dialog-version='2.1.0'
|
1740 |
data-cmw-dialog-id='<?php echo $this->get_field_id('dialog'); ?>'>
|
@@ -1744,19 +1744,19 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
1744 |
*/
|
1745 |
?>
|
1746 |
<p class="cmw-legacy-warn">
|
1747 |
-
<a class="widget-<?php echo $this->id_base; ?>-legacy-close cmw-legacy-close" title="<?php _e('Dismiss'); ?>" href="#">X</a>
|
1748 |
-
<em><?php _e('This is an old version of the widget!'); ?>
|
1749 |
<?php
|
1750 |
//allow a filter to return true, whereby updates to legacy widgets are disallowed...
|
1751 |
//eg. apply_filter( 'custom_menu_wizard_prevent_legacy_updates', [filter function], 10, 1 ) => true
|
1752 |
if( apply_filters( 'custom_menu_wizard_prevent_legacy_updates', false ) ){
|
1753 |
?>
|
1754 |
-
<br /><?php _e('Any changes you make will NOT be Saved!'); ?>
|
1755 |
<?php
|
1756 |
}
|
1757 |
?>
|
1758 |
-
<br /><?php _e('Please consider creating a new instance of the widget to replace this one.'); ?>
|
1759 |
-
<a href="<?php echo $this->_cmw_legacy_warnreadmore; ?>" target="_blank"><?php _e('read more'); ?></a></em>
|
1760 |
</p>
|
1761 |
<?php
|
1762 |
|
@@ -1765,22 +1765,22 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
1765 |
*/
|
1766 |
?>
|
1767 |
<p>
|
1768 |
-
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
1769 |
<?php $this->cmw_formfield_checkbox( $instance, 'hide_title',
|
1770 |
array(
|
1771 |
-
'label' =>
|
1772 |
'lclass' => 'alignright'
|
1773 |
) ); ?>
|
1774 |
<?php $this->cmw_formfield_textbox( $instance, 'title',
|
1775 |
array(
|
1776 |
-
'desc' => __('Title can be set, but need not be displayed'),
|
1777 |
'fclass' => 'widefat cmw-widget-title'
|
1778 |
) ); ?>
|
1779 |
</p>
|
1780 |
|
1781 |
<p>
|
1782 |
<?php $this->cmw_assist_link(); ?>
|
1783 |
-
<label for="<?php echo $this->get_field_id('menu'); ?>"><?php _e('Select Menu:'); ?></label>
|
1784 |
<select id="<?php echo $this->get_field_id('menu'); ?>" <?php $this->cmw_disableif(); ?>
|
1785 |
class="cmw-select-menu cmw-listen" name="<?php echo $this->get_field_name('menu'); ?>">
|
1786 |
<?php echo $menus['names']; ?>
|
@@ -1791,29 +1791,29 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
1791 |
/**
|
1792 |
* start collapsible section : 'Filter'
|
1793 |
*/
|
1794 |
-
$this->cmw_open_a_field_section( $instance, __('Filter'), 'fs_filter' );
|
1795 |
?>
|
1796 |
<p>
|
1797 |
<?php $this->cmw_assist_link(); ?>
|
1798 |
<label>
|
1799 |
<input id="<?php echo $this->get_field_id('filter'); ?>_0" class="cmw-showall cmw-listen" <?php $this->cmw_disableif(); ?>
|
1800 |
name="<?php echo $this->get_field_name('filter'); ?>" type="radio" value="0" <?php checked( $instance['filter'], 0 ); ?> />
|
1801 |
-
<?php _e('Show all'); ?></label>
|
1802 |
<br /><label>
|
1803 |
<input id="<?php echo $this->get_field_id('filter'); ?>_1" class="cmw-listen" <?php $this->cmw_disableif(); ?>
|
1804 |
name="<?php echo $this->get_field_name('filter'); ?>" type="radio" value="1" <?php checked( $instance['filter'], 1 ); ?> />
|
1805 |
-
<?php _e('Children of:'); ?></label>
|
1806 |
<select id="<?php echo $this->get_field_id('filter_item'); ?>" class="cmw-childrenof cmw-assist-items cmw-listen"
|
1807 |
name="<?php echo $this->get_field_name('filter_item'); ?>" <?php $this->cmw_disableif(); ?>>
|
1808 |
-
<option value="0" <?php selected( $instance['filter_item'], 0 ); ?>><?php _e('Current Item'); ?></option>
|
1809 |
-
<option value="-2" <?php selected( $instance['filter_item'], -2 ); ?>><?php _e('Current Root Item'); ?></option>
|
1810 |
-
<option value="-1" <?php selected( $instance['filter_item'], -1 ); ?>><?php _e('Current Parent Item'); ?></option>
|
1811 |
<?php echo $menus['selectedOptgroup']; ?>
|
1812 |
</select>
|
1813 |
<br /><label>
|
1814 |
<input id="<?php echo $this->get_field_id('filter'); ?>_2" class="cmw-showspecific cmw-listen" <?php $this->cmw_disableif(); ?>
|
1815 |
name="<?php echo $this->get_field_name('filter'); ?>" type="radio" value="-1" <?php checked( $instance['filter'], -1 ); ?> />
|
1816 |
-
<?php _e('Items:'); ?></label>
|
1817 |
<?php $this->cmw_formfield_textbox( $instance, 'items',
|
1818 |
array(
|
1819 |
'fclass' => 'cmw-setitems'
|
@@ -1826,33 +1826,33 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
1826 |
</p>
|
1827 |
|
1828 |
<p class="cmw-disableif-ss<?php $this->cmw_disableif( 'push', $isShowSpecific ); ?>">
|
1829 |
-
<label for="<?php echo $this->get_field_id('start_level'); ?>"><?php _e('Starting Level:'); ?></label>
|
1830 |
<select id="<?php echo $this->get_field_id('start_level'); ?>" <?php $this->cmw_disableif(); ?>
|
1831 |
class="cmw-start-level" name="<?php echo $this->get_field_name('start_level'); ?>">
|
1832 |
<?php for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){ ?>
|
1833 |
<option value="<?php echo $i; ?>" <?php selected( $instance['start_level'] > $menus['selectedLevels'] ? 1 : $instance['start_level'], $i ); ?>><?php echo $i; ?></option>
|
1834 |
<?php } ?>
|
1835 |
</select>
|
1836 |
-
<span class="cmw-small-block"><em><?php _e('Level to start testing items for inclusion'); ?></em></span>
|
1837 |
</p><!-- end .cmw-disableif-ss --><?php $this->cmw_disableif( 'pop' ); ?>
|
1838 |
|
1839 |
<p class="cmw-disableif-ss<?php $this->cmw_disableif( 'push', $isShowSpecific ); ?>">
|
1840 |
-
<label for="<?php echo $this->get_field_id('depth'); ?>"><?php _e('For Depth:'); ?></label>
|
1841 |
-
<select id="<?php echo $this->get_field_id('depth'); ?>" class="cmw-depth" data-cmw-text-levels="<?php _e(' levels'); ?>"
|
1842 |
name="<?php echo $this->get_field_name('depth'); ?>" <?php $this->cmw_disableif(); ?>>
|
1843 |
-
<option value="0" <?php selected( $instance['depth'] > $menus['selectedLevels'] ? 0 : $instance['depth'], 0 ); ?>><?php _e('unlimited'); ?></option>
|
1844 |
<?php
|
1845 |
for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){
|
1846 |
?>
|
1847 |
-
<option value="<?php echo $i; ?>" <?php selected( $instance['depth'], $i ); ?>><?php
|
1848 |
<?php
|
1849 |
}
|
1850 |
?>
|
1851 |
</select>
|
1852 |
-
<span class="cmw-small-block"><em><?php _e('Relative to first Filter item found, <strong>unless</strong>…'); ?></em></span>
|
1853 |
<?php $this->cmw_formfield_checkbox( $instance, 'depth_rel_current',
|
1854 |
array(
|
1855 |
-
'label' =>
|
1856 |
) ); ?>
|
1857 |
</p><!-- end .cmw-disableif-ss --><?php $this->cmw_disableif( 'pop' ); ?>
|
1858 |
|
@@ -1862,41 +1862,41 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
1862 |
/**
|
1863 |
* v1.2.0 start collapsible section : 'Fallbacks'
|
1864 |
*/
|
1865 |
-
$this->cmw_open_a_field_section( $instance, __('Fallbacks'), 'fs_fallbacks' );
|
1866 |
?>
|
1867 |
<p class="cmw-disableifnot-rp<?php $this->cmw_disableif( 'push', $isNotCurrentRootParent ); ?>">
|
1868 |
<?php $this->cmw_assist_link(); ?>
|
1869 |
-
<span class="cmw-small-block"><strong><?php _e( 'If "Children of" is <em>Current Root / Parent Item</em>, and no ancestor exists' ); ?> :</strong></span>
|
1870 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_no_ancestor',
|
1871 |
array(
|
1872 |
-
'label' => __('Switch to Current Item, and')
|
1873 |
) ); ?>
|
1874 |
<br />
|
1875 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_include_parent',
|
1876 |
array(
|
1877 |
-
'label' => __('Include Parent...')
|
1878 |
) ); ?>
|
1879 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_include_parent_siblings',
|
1880 |
array(
|
1881 |
-
'label' => __('with Siblings'),
|
1882 |
'lclass' => 'cmw-whitespace-nowrap'
|
1883 |
) ); ?>
|
1884 |
</p><!-- end .cmw-disableifnot-rp --><?php $this->cmw_disableif( 'pop' ); ?>
|
1885 |
|
1886 |
<p class="cmw-disableifnot-ci<?php $this->cmw_disableif( 'push', $isNotCurrentItem ); ?>">
|
1887 |
-
<span class="cmw-small-block"><strong><?php _e( 'If "Children of" is <em>Current Item</em>, and current item has no children' ); ?> :</strong></span>
|
1888 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_no_children',
|
1889 |
array(
|
1890 |
-
'label' => __('Switch to Current Parent Item, and')
|
1891 |
) ); ?>
|
1892 |
<br />
|
1893 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_nc_include_parent',
|
1894 |
array(
|
1895 |
-
'label' => __('Include Parent...')
|
1896 |
) ); ?>
|
1897 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_nc_include_parent_siblings',
|
1898 |
array(
|
1899 |
-
'label' => __('with Siblings'),
|
1900 |
'lclass' => 'cmw-whitespace-nowrap'
|
1901 |
) ); ?>
|
1902 |
</p><!-- end .cmw-disableifnot-ci --><?php $this->cmw_disableif( 'pop' ); ?>
|
@@ -1907,70 +1907,70 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
1907 |
/**
|
1908 |
* start collapsible section : 'Output'
|
1909 |
*/
|
1910 |
-
$this->cmw_open_a_field_section( $instance, __('Output'), 'fs_output' );
|
1911 |
?>
|
1912 |
<p>
|
1913 |
<?php $this->cmw_assist_link(); ?>
|
1914 |
<label>
|
1915 |
<input id="<?php echo $this->get_field_id('flat_output'); ?>_0" name="<?php echo $this->get_field_name('flat_output'); ?>"
|
1916 |
type="radio" value="0" <?php checked(!$instance['flat_output']); ?> <?php $this->cmw_disableif(); ?> />
|
1917 |
-
<?php _e('Hierarchical'); ?></label>
|
1918 |
<label class="cmw-whitespace-nowrap">
|
1919 |
<input id="<?php echo $this->get_field_id('flat_output'); ?>_1" name="<?php echo $this->get_field_name('flat_output'); ?>"
|
1920 |
type="radio" value="1" <?php checked($instance['flat_output']); ?> <?php $this->cmw_disableif(); ?> />
|
1921 |
-
<?php _e('Flat'); ?></label>
|
1922 |
</p>
|
1923 |
|
1924 |
<p>
|
1925 |
<?php $this->cmw_formfield_checkbox( $instance, 'contains_current',
|
1926 |
array(
|
1927 |
-
'label' => __('Must Contain "Current" Item'),
|
1928 |
-
'desc' => __('Checks both Filtered and Included items')
|
1929 |
) ); ?>
|
1930 |
</p>
|
1931 |
|
1932 |
<p class="cmw-disableif<?php $this->cmw_disableif( 'push', $isNotChildrenOf ); ?>">
|
1933 |
<?php $this->cmw_formfield_checkbox( $instance, 'include_parent',
|
1934 |
array(
|
1935 |
-
'label' => __('Include Parent...')
|
1936 |
) ); ?>
|
1937 |
<?php $this->cmw_formfield_checkbox( $instance, 'include_parent_siblings',
|
1938 |
array(
|
1939 |
-
'label' => __('with Siblings'),
|
1940 |
'lclass' => 'cmw-whitespace-nowrap'
|
1941 |
) ); ?>
|
1942 |
<br />
|
1943 |
<?php $this->cmw_formfield_checkbox( $instance, 'include_ancestors',
|
1944 |
array(
|
1945 |
-
'label' => __('Include Ancestors')
|
1946 |
) ); ?>
|
1947 |
<br />
|
1948 |
<?php $this->cmw_formfield_checkbox( $instance, 'title_from_parent',
|
1949 |
array(
|
1950 |
-
'label' => __('Title from Parent'),
|
1951 |
-
'desc' => __('Only if the "Children of" Filter returns items')
|
1952 |
) ); ?>
|
1953 |
</p><!-- end .cmw-disableif --><?php $this->cmw_disableif( 'pop' ); ?>
|
1954 |
|
1955 |
<p>
|
1956 |
<?php $this->cmw_formfield_checkbox( $instance, 'title_from_current',
|
1957 |
array(
|
1958 |
-
'label' => __('Title from "Current" Item'),
|
1959 |
-
'desc' => __('Lower priority than "Title from Parent"')
|
1960 |
) ); ?>
|
1961 |
</p>
|
1962 |
|
1963 |
<p>
|
1964 |
-
<?php _e('Change UL to OL:'); ?>
|
1965 |
<br />
|
1966 |
<?php $this->cmw_formfield_checkbox( $instance, 'ol_root',
|
1967 |
array(
|
1968 |
-
'label' => __('Top Level')
|
1969 |
) ); ?>
|
1970 |
|
1971 |
<?php $this->cmw_formfield_checkbox( $instance, 'ol_sub',
|
1972 |
array(
|
1973 |
-
'label' => __('Sub-Levels')
|
1974 |
) ); ?>
|
1975 |
</p>
|
1976 |
|
@@ -1983,8 +1983,8 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
1983 |
<p>
|
1984 |
<?php $this->cmw_formfield_checkbox( $instance, 'hide_empty',
|
1985 |
array(
|
1986 |
-
'label' => __('Hide Widget if Empty'),
|
1987 |
-
'desc' => __('Prevents any output when no items are found')
|
1988 |
) ); ?>
|
1989 |
</p>
|
1990 |
<?php }else{ ?>
|
@@ -1998,27 +1998,27 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
1998 |
/**
|
1999 |
* start collapsible section : 'Container'
|
2000 |
*/
|
2001 |
-
$this->cmw_open_a_field_section( $instance, __('Container'), 'fs_container' );
|
2002 |
?>
|
2003 |
<p>
|
2004 |
<?php $this->cmw_formfield_textbox( $instance, 'container',
|
2005 |
array(
|
2006 |
-
'label' => __('Element:'),
|
2007 |
-
'desc' => __('Eg. div or nav; leave empty for no container')
|
2008 |
) ); ?>
|
2009 |
</p>
|
2010 |
<p>
|
2011 |
<?php $this->cmw_formfield_textbox( $instance, 'container_id',
|
2012 |
array(
|
2013 |
-
'label' => __('Unique ID:'),
|
2014 |
-
'desc' => __('An optional ID for the container')
|
2015 |
) ); ?>
|
2016 |
</p>
|
2017 |
<p>
|
2018 |
<?php $this->cmw_formfield_textbox( $instance, 'container_class',
|
2019 |
array(
|
2020 |
-
'label' => __('Class:'),
|
2021 |
-
'desc' => __('Extra class for the container')
|
2022 |
) ); ?>
|
2023 |
</p>
|
2024 |
|
@@ -2028,20 +2028,20 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
2028 |
/**
|
2029 |
* start collapsible section : 'Classes'
|
2030 |
*/
|
2031 |
-
$this->cmw_open_a_field_section( $instance, __('Classes'), 'fs_classes' );
|
2032 |
?>
|
2033 |
<p>
|
2034 |
<?php $this->cmw_formfield_textbox( $instance, 'menu_class',
|
2035 |
array(
|
2036 |
-
'label' => __('Menu Class:'),
|
2037 |
-
'desc' => __('Class for the list element forming the menu')
|
2038 |
) ); ?>
|
2039 |
</p>
|
2040 |
<p>
|
2041 |
<?php $this->cmw_formfield_textbox( $instance, 'widget_class',
|
2042 |
array(
|
2043 |
-
'label' => __('Widget Class:'),
|
2044 |
-
'desc' => __('Extra class for the widget itself')
|
2045 |
) ); ?>
|
2046 |
</p>
|
2047 |
|
@@ -2051,37 +2051,37 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
|
|
2051 |
/**
|
2052 |
* start collapsible section : 'Links'
|
2053 |
*/
|
2054 |
-
$this->cmw_open_a_field_section( $instance, __('Links'), 'fs_links' );
|
2055 |
?>
|
2056 |
<p>
|
2057 |
<?php $this->cmw_formfield_textbox( $instance, 'before',
|
2058 |
array(
|
2059 |
-
'label' => __('Before the Link:'),
|
2060 |
-
'desc' => __( htmlspecialchars('Text/HTML to go before the <a> of the link') ),
|
2061 |
'fclass' => 'widefat'
|
2062 |
) ); ?>
|
2063 |
</p>
|
2064 |
<p>
|
2065 |
<?php $this->cmw_formfield_textbox( $instance, 'after',
|
2066 |
array(
|
2067 |
-
'label' => __('After the Link:'),
|
2068 |
-
'desc' => __( htmlspecialchars('Text/HTML to go after the <a> of the link') ),
|
2069 |
'fclass' => 'widefat'
|
2070 |
) ); ?>
|
2071 |
</p>
|
2072 |
<p>
|
2073 |
<?php $this->cmw_formfield_textbox( $instance, 'link_before',
|
2074 |
array(
|
2075 |
-
'label' => __('Before the Link Text:'),
|
2076 |
-
'desc' => __('Text/HTML to go before the link text'),
|
2077 |
'fclass' => 'widefat'
|
2078 |
) ); ?>
|
2079 |
</p>
|
2080 |
<p>
|
2081 |
<?php $this->cmw_formfield_textbox( $instance, 'link_after',
|
2082 |
array(
|
2083 |
-
'label' => __('After the Link Text:'),
|
2084 |
-
'desc' => __('Text/HTML to go after the link text'),
|
2085 |
'fclass' => 'widefat'
|
2086 |
) ); ?>
|
2087 |
</p>
|
16 |
'Custom Menu Wizard',
|
17 |
array(
|
18 |
'classname' => 'widget_custom_menu_wizard',
|
19 |
+
'description' => __('Add a custom menu, or part of one, as a widget', 'custom-menu-wizard'),
|
20 |
'customizer_support' => true
|
21 |
)
|
22 |
);
|
65 |
if( ( $menus = $this->cmw_scan_menus( $instance['menu'], $instance['branch'] ) ) === false ){
|
66 |
?>
|
67 |
<p class="widget-<?php echo $this->id_base; ?>-no-menus">
|
68 |
+
<em><?php printf( wp_kses( __('No populated menus have been created yet! <a href="%s">Create one...</a>', 'custom-menu-wizard'), array('a'=>array('href'=>array())) ), admin_url('nav-menus.php') ); ?></em>
|
69 |
<input id="<?php echo $this->get_field_id('cmwv'); ?>" name="<?php echo $this->get_field_name('cmwv'); ?>"
|
70 |
type="hidden" value="<?php echo Custom_Menu_Wizard_Plugin::$version; ?>" />
|
71 |
<?php foreach( array('filters', 'fallbacks', 'output', 'container', 'classes', 'links') as $v ){ ?>
|
102 |
}
|
103 |
}
|
104 |
//start with the middle option of the relatives (the level of the branch item)...
|
105 |
+
$relGroup[] = '<option value="" ' . selected( $branchLevel, '', false ) . '>' . __('the Branch', 'custom-menu-wizard') . '</option>';
|
106 |
//now do the absolutes and relatives...
|
107 |
for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){
|
108 |
+
//topmost of the absolutes, the descriptor becomes '1 (root)'...
|
109 |
+
$t = $i > 1 ? $i : __('1 (root)', 'custom-menu-wizard');
|
110 |
//append to the absolutes...
|
111 |
$absGroup[] = '<option value="' . $i . '" ' . selected( $branchLevel, "$i", false ) . '>' . $t . '</option>';
|
112 |
//for anything LESS THAN the number of levels...
|
113 |
if( $i < $menus['selectedLevels'] ){
|
114 |
+
//immediately above the branch item, the descriptor becomes '-1 (parent)'...
|
115 |
+
$t = $i > 1 ? "-$i" : __('-1 (parent)', 'custom-menu-wizard');
|
116 |
//prepend to the relatives...
|
117 |
array_unshift( $relGroup, '<option value="-' . $i . '" ' . selected( $branchLevel, "-$i", false ) . '>' . $t . '</option>' );
|
118 |
+
//immediately below the branch item, the descriptor becomes '+1 (children)'...
|
119 |
+
$t = $i > 1 ? "+$i" : __('+1 (children)', 'custom-menu-wizard');
|
120 |
//append to the relatives...
|
121 |
array_push( $relGroup, '<option value="+' . $i . '" ' . selected( $branchLevel, "+$i", false ) . '>' . $t . '</option>' );
|
122 |
}
|
135 |
<div id="<?php echo $this->get_field_id('onchange'); ?>"
|
136 |
class="widget-<?php echo $this->id_base; ?>-onchange<?php echo $this->cmw_wp_version('3.8') ? ' cmw-pre-wp-v38' : ''; ?>"
|
137 |
data-cmw-v36plus='<?php echo $this->cmw_wp_version('3.6', true) ? 'true' : 'false'; ?>'
|
138 |
+
data-cmw-dialog-prompt='<?php _e('Click an item to toggle "Current Menu Item"', 'custom-menu-wizard'); ?>'
|
139 |
+
data-cmw-dialog-output='<?php _e('Basic Output', 'custom-menu-wizard'); ?>'
|
140 |
+
data-cmw-dialog-alternative='<?php _e('Alternative settings', 'custom-menu-wizard'); ?>'
|
141 |
+
data-cmw-dialog-fallback='<?php _e('Fallback invoked', 'custom-menu-wizard'); ?>'
|
142 |
+
data-cmw-dialog-inclusions='<?php _e('Inclusions', 'custom-menu-wizard'); ?> : 0'
|
143 |
+
data-cmw-dialog-exclusions='<?php _e('Exclusions', 'custom-menu-wizard'); ?> : 0'
|
144 |
+
data-cmw-dialog-set-current='<?php _e('No Current Item!', 'custom-menu-wizard'); ?>'
|
145 |
+
data-cmw-dialog-shortcodes='<?php _e('Find posts/pages containing a CMW shortcode', 'custom-menu-wizard'); ?>'
|
146 |
+
data-cmw-dialog-untitled='<?php _e('untitled', 'custom-menu-wizard'); ?>'
|
147 |
+
data-cmw-dialog-fixed='<?php _e('fixed', 'custom-menu-wizard'); ?>'
|
148 |
data-cmw-dialog-nonce='<?php echo wp_create_nonce( 'cmw-find-shortcodes' ); ?>'
|
149 |
data-cmw-dialog-version='<?php echo Custom_Menu_Wizard_Plugin::$version; ?>'
|
150 |
data-cmw-dialog-id='<?php echo $this->get_field_id('dialog'); ?>'>
|
157 |
<p>
|
158 |
<input id="<?php echo $this->get_field_id('cmwv'); ?>" name="<?php echo $this->get_field_name('cmwv'); ?>"
|
159 |
type="hidden" value="<?php echo Custom_Menu_Wizard_Plugin::$version; ?>" />
|
160 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'custom-menu-wizard') ?></label>
|
161 |
<?php $this->cmw_formfield_checkbox( $instance, 'hide_title',
|
162 |
array(
|
163 |
+
'label' => _x('Hide', 'verb', 'custom-menu-wizard'),
|
164 |
'lclass' => 'alignright'
|
165 |
) ); ?>
|
166 |
<?php $this->cmw_formfield_textbox( $instance, 'title',
|
170 |
</p>
|
171 |
|
172 |
<p>
|
173 |
+
<label for="<?php echo $this->get_field_id('menu'); ?>"><?php _e('Select Menu:', 'custom-menu-wizard'); ?></label>
|
174 |
<select id="<?php echo $this->get_field_id('menu'); ?>"
|
175 |
class="cmw-select-menu cmw-listen" name="<?php echo $this->get_field_name('menu'); ?>">
|
176 |
<?php echo $menus['names']; ?>
|
181 |
/**
|
182 |
* start collapsible section : 'Filter'
|
183 |
*/
|
184 |
+
$this->cmw_open_a_field_section( $instance, __('Filters', 'custom-menu-wizard'), 'fs_filters' ); ?>
|
185 |
|
186 |
<div>
|
187 |
<?php $this->cmw_assist_link(); ?>
|
188 |
+
<strong><?php _e('Primary Filter', 'custom-menu-wizard'); ?></strong>
|
189 |
|
190 |
<div class="cmw-indented">
|
191 |
<label class="cmw-verticalalign-baseline">
|
192 |
<input id="<?php echo $this->get_field_id('filter'); ?>_0" class="cmw-bylevel cmw-listen"
|
193 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('filter'); ?>"
|
194 |
type="radio" value="" <?php checked( $instance['filter'], '' ); ?>
|
195 |
+
/><?php _e('Level:', 'custom-menu-wizard'); ?></label>
|
196 |
<select id="<?php echo $this->get_field_id('level'); ?>" class="cmw-level cmw-set-levels cmw-listen"
|
197 |
<?php $this->cmw_disableif(); ?> data-cmw-set-levels="0"
|
198 |
name="<?php echo $this->get_field_name('level'); ?>">
|
199 |
<?php for( $i = 1, $j = $instance['level'] > $menus['selectedLevels'] ? 1 : $instance['level']; $i <= $menus['selectedLevels']; $i++ ){ ?>
|
200 |
+
<option value="<?php echo $i; ?>" <?php selected( $j, $i ); ?>><?php echo $i > 1 ? $i : __('1 (root)', 'custom-menu-wizard'); ?></option>
|
201 |
<?php } ?>
|
202 |
</select>
|
203 |
</div>
|
207 |
<input id="<?php echo $this->get_field_id('filter'); ?>_1" class="cmw-bybranch cmw-listen"
|
208 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('filter'); ?>"
|
209 |
type="radio" value="branch" <?php checked( $instance['filter'], 'branch' ); ?>
|
210 |
+
/><?php _e('Branch:', 'custom-menu-wizard'); ?></label>
|
211 |
<select id="<?php echo $this->get_field_id('branch'); ?>" class="cmw-branches cmw-assist-items cmw-listen"
|
212 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('branch'); ?>">
|
213 |
+
<option value="0" <?php selected( $instance['branch'], 0 ); ?>><?php _e('Current Item', 'custom-menu-wizard'); ?></option>
|
214 |
<?php echo $menus['selectedOptgroup']; ?>
|
215 |
</select>
|
216 |
<select id="<?php echo $this->get_field_id('branch_ignore'); ?>" class='cmw-off-the-page' disabled="disabled"
|
224 |
<input id="<?php echo $this->get_field_id('filter'); ?>_2" class="cmw-byitems cmw-listen"
|
225 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('filter'); ?>"
|
226 |
type="radio" value="items" <?php checked( $instance['filter'], 'items' ); ?>
|
227 |
+
/><?php _e('Items:', 'custom-menu-wizard'); ?></label>
|
228 |
<?php $this->cmw_formfield_textbox( $instance, 'items',
|
229 |
array(
|
230 |
'fclass' => 'cmw-maxwidth-twothirds cmw-setitems cmw-listen'
|
234 |
|
235 |
<div class="cmw-disableif-ss<?php $this->cmw_disableif( 'push', $isByItems ); ?>">
|
236 |
<?php $this->cmw_assist_link(); ?>
|
237 |
+
<strong><?php _e('Secondary Filter', 'custom-menu-wizard'); ?></strong>
|
238 |
|
239 |
<div class="cmw-indented">
|
240 |
+
<label class="cmw-disableifnot-br<?php $this->cmw_disableif( 'push', $isNotByBranch ); ?>"><?php _e('Starting at:', 'custom-menu-wizard'); ?>
|
241 |
<select id="<?php echo $this->get_field_id('branch_start'); ?>" class="cmw-branch-start cmw-listen"
|
242 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('branch_start'); ?>">
|
243 |
+
<optgroup label="<?php _ex('relative...', 'adjective: cf. absolute', 'custom-menu-wizard'); ?>" data-cmw-text-children="<?php _e('children', 'custom-menu-wizard'); ?>"
|
244 |
+
data-cmw-text-parent="<?php _e('parent', 'custom-menu-wizard'); ?>">
|
245 |
<?php echo implode( '', $relGroup ); ?>
|
246 |
</optgroup>
|
247 |
+
<optgroup label="<?php _e('absolute...', 'custom-menu-wizard'); ?>">
|
248 |
<?php echo implode( '', $absGroup ); ?>
|
249 |
</optgroup>
|
250 |
</select></label><!-- end .cmw-disableifnot-br --><?php $this->cmw_disableif( 'pop' ); ?>
|
255 |
<input id="<?php echo $this->get_field_id('start_mode'); ?>_0"
|
256 |
name="<?php echo $this->get_field_name('start_mode'); ?>"
|
257 |
<?php $this->cmw_disableif(); ?> type="radio" value="" <?php checked( $instance['start_mode'] !== 'level' ); ?>
|
258 |
+
/><?php _e('Item <small>(if possible)</small>', 'custom-menu-wizard'); ?></label>
|
259 |
|
260 |
<label class="cmw-followed-by cmw-whitespace-nowrap">
|
261 |
<input id="<?php echo $this->get_field_id('start_mode'); ?>_1" name="<?php echo $this->get_field_name('start_mode'); ?>"
|
262 |
<?php $this->cmw_disableif(); ?> type="radio" value="level" <?php checked( $instance['start_mode'] === 'level' ); ?>
|
263 |
+
/><?php _e('Level', 'custom-menu-wizard'); ?></label>
|
264 |
|
265 |
<?php $this->cmw_formfield_checkbox( $instance, 'allow_all_root',
|
266 |
array(
|
267 |
+
'label' => __('Allow all Root Items', 'custom-menu-wizard'),
|
268 |
'lclass' => 'cmw-whitespace-nowrap'
|
269 |
) ); ?>
|
270 |
</span><!-- end .cmw-disableifnot-br --><?php $this->cmw_disableif( 'pop' ); ?>
|
271 |
</div>
|
272 |
|
273 |
<div class="cmw-indented">
|
274 |
+
<label class="cmw-followed-by"><?php _e('For Depth:', 'custom-menu-wizard'); ?>
|
275 |
+
<select id="<?php echo $this->get_field_id('depth'); ?>" data-cmw-text-levels="<?php _e(' levels', 'custom-menu-wizard'); ?>"
|
276 |
data-cmw-set-levels="1" <?php $this->cmw_disableif(); ?>
|
277 |
class="cmw-depth cmw-set-levels cmw-listen" name="<?php echo $this->get_field_name('depth'); ?>">
|
278 |
+
<option value="0" <?php selected( $instance['depth'] > $menus['selectedLevels'] ? 0 : $instance['depth'], 0 ); ?>><?php _e('unlimited', 'custom-menu-wizard'); ?></option>
|
279 |
<?php for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){ ?>
|
280 |
+
<option value="<?php echo $i; ?>" <?php selected( $instance['depth'], $i ); ?>><?php printf( _n('%d level', '%d levels', $i, 'custom-menu-wizard'), $i ); ?></option>
|
281 |
<?php } ?>
|
282 |
</select></label>
|
283 |
|
284 |
|
285 |
<?php $this->cmw_formfield_checkbox( $instance, 'depth_rel_current',
|
286 |
array(
|
287 |
+
'label' => __('Relative to Current Item', 'custom-menu-wizard'),
|
288 |
'lclass' => 'cmw-disableif-ud cmw-whitespace-nowrap',
|
289 |
'disableif' => $isUnlimitedDepth
|
290 |
) ); ?>
|
293 |
|
294 |
<div>
|
295 |
<?php $this->cmw_assist_link(); ?>
|
296 |
+
<strong><?php _e('Inclusions', 'custom-menu-wizard'); ?></strong>
|
297 |
|
298 |
<div class="cmw-indented">
|
299 |
+
<label class="cmw-disableifnot-br<?php $this->cmw_disableif( 'push', $isNotByBranch ); ?>"><?php _e('Branch Ancestors:', 'custom-menu-wizard'); ?>
|
300 |
<select id="<?php echo $this->get_field_id('ancestors'); ?>" class="cmw-ancestors cmw-set-rel-abs-levels cmw-listen"
|
301 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('ancestors'); ?>"
|
302 |
+
data-cmw-text-tolevel="<?php _e('to level', 'custom-menu-wizard'); ?>">
|
303 |
<option value="0" <?php selected( $j, 0 ); ?>> </option>
|
304 |
<?php
|
305 |
$j = $instance['ancestors'];
|
306 |
$j = max( min( $j, $menus['selectedLevels'] - 1 ), 1 - $menus['selectedLevels'] ); ?>
|
307 |
+
<optgroup label="<?php _ex('relative...', 'adjective: cf. absolute', 'custom-menu-wizard'); ?>" data-cmw-text-for-option=" <?php _e('%d levels', 'custom-menu-wizard'); ?>">
|
308 |
+
<option value="-1" <?php selected( $j, -1 ); ?>><?php _e('-1 level (parent)', 'custom-menu-wizard'); ?></option>
|
309 |
<?php for( $i = -2; $i > 0 - $menus['selectedLevels']; $i-- ){ ?>
|
310 |
+
<option value="<?php echo $i; ?>" <?php selected( $j, $i ); ?>><?php printf( __('%d levels', 'custom-menu-wizard'), $i ); ?></option>
|
311 |
<?php } ?>
|
312 |
</optgroup>
|
313 |
+
<optgroup label="<?php _e('absolute...', 'custom-menu-wizard'); ?>" data-cmw-text-for-option="<?php _e('to level %d', 'custom-menu-wizard'); ?> ">
|
314 |
+
<option value="1" <?php selected( $j, 1 ); ?>><?php _e('to level 1 (root)', 'custom-menu-wizard'); ?></option>
|
315 |
<?php for( $i = 2; $i < $menus['selectedLevels']; $i++ ){ ?>
|
316 |
+
<option value="<?php echo $i; ?>" <?php selected( $j, $i ); ?>><?php printf( __('to level %d', 'custom-menu-wizard'), $i ); ?></option>
|
317 |
<?php } ?>
|
318 |
</optgroup>
|
319 |
</select></label><!-- end .cmw-disableifnot-br --><?php $this->cmw_disableif( 'pop' ); ?>
|
320 |
|
321 |
<br />
|
322 |
<span class="cmw-disableifnot-br<?php $this->cmw_disableif( 'push', $isNotByBranch ); ?>">
|
323 |
+
<label><?php _e('... with Siblings:', 'custom-menu-wizard'); ?>
|
324 |
<select id="<?php echo $this->get_field_id('ancestor_siblings'); ?>" class="cmw-ancestor-siblings cmw-set-rel-abs-levels cmw-listen"
|
325 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('ancestor_siblings'); ?>">
|
326 |
<option value="0" <?php selected( $j, 0 ); ?>> </option>
|
327 |
<?php
|
328 |
$j = $instance['ancestor_siblings'];
|
329 |
$j = max( min( $j, $menus['selectedLevels'] - 1 ), 1 - $menus['selectedLevels'] ); ?>
|
330 |
+
<optgroup label="<?php _ex('relative...', 'adjective: cf. absolute', 'custom-menu-wizard'); ?>" data-cmw-text-for-option=" <?php _e('%d levels', 'custom-menu-wizard'); ?>">
|
331 |
+
<option value="-1" <?php selected( $j, -1 ); ?>><?php _e('-1 level (parent)', 'custom-menu-wizard'); ?></option>
|
332 |
<?php for( $i = -2; $i > 0 - $menus['selectedLevels']; $i-- ){ ?>
|
333 |
+
<option value="<?php echo $i; ?>" <?php selected( $j, $i ); ?>><?php printf( __('%d levels', 'custom-menu-wizard'), $i ); ?></option>
|
334 |
<?php } ?>
|
335 |
</optgroup>
|
336 |
+
<optgroup label="<?php _e('absolute...', 'custom-menu-wizard'); ?>" data-cmw-text-for-option="<?php _e('to level %d', 'custom-menu-wizard'); ?> ">
|
337 |
+
<option value="1" <?php selected( $j, 1 ); ?>><?php _e('to level 1 (root)', 'custom-menu-wizard'); ?></option>
|
338 |
<?php for( $i = 2; $i < $menus['selectedLevels']; $i++ ){ ?>
|
339 |
+
<option value="<?php echo $i; ?>" <?php selected( $j, $i ); ?>><?php printf( __('to level %d', 'custom-menu-wizard'), $i ); ?></option>
|
340 |
<?php } ?>
|
341 |
</optgroup>
|
342 |
</select></label>
|
345 |
|
346 |
<?php $this->cmw_formfield_checkbox( $instance, 'siblings',
|
347 |
array(
|
348 |
+
'label' => __('Branch Siblings', 'custom-menu-wizard'),
|
349 |
'lclass' => 'cmw-disableifnot-br',
|
350 |
'disableif' => $isNotByBranch
|
351 |
) ); ?>
|
352 |
|
353 |
<div class="cmw-indented">
|
354 |
+
<label><?php _e('Level:', 'custom-menu-wizard'); ?>
|
355 |
<select id="<?php echo $this->get_field_id('include_level'); ?>" class="cmw-include-level"
|
356 |
name="<?php echo $this->get_field_name('include_level'); ?>">
|
357 |
<?php $j = intval($instance['include_level']) > $menus['selectedLevels'] ? '' : $instance['include_level']; ?>
|
358 |
<option value="" <?php selected( $j, '' ); ?>> </option>
|
359 |
<?php for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){ ?>
|
360 |
<option value="<?php echo $i; ?>" <?php selected( $j, "$i" ); ?>><?php echo $i; ?></option>
|
361 |
+
<option value="<?php echo $i . '-'; ?>" <?php selected( $j, $i . '-' ); ?>> <?php echo "$i " . __('and above', 'custom-menu-wizard'); ?></option>
|
362 |
+
<option value="<?php echo $i . '+'; ?>" <?php selected( $j, $i . '+' ); ?>> <?php echo "$i " . __('and below', 'custom-menu-wizard'); ?></option>
|
363 |
<?php } ?>
|
364 |
</select></label>
|
365 |
</div>
|
367 |
|
368 |
<div>
|
369 |
<?php $this->cmw_assist_link(); ?>
|
370 |
+
<strong><?php _e('Exclusions', 'custom-menu-wizard'); ?></strong>
|
371 |
|
372 |
<div class="cmw-indented">
|
373 |
<?php $this->cmw_formfield_textbox( $instance, 'exclude',
|
374 |
array(
|
375 |
+
'label' => __('Item Ids:', 'custom-menu-wizard'),
|
376 |
'fclass' => 'cmw-maxwidth-twothirds cmw-exclusions'
|
377 |
) ); ?>
|
378 |
</div>
|
379 |
|
380 |
<div class="cmw-indented">
|
381 |
+
<label><?php _e('Level:', 'custom-menu-wizard'); ?>
|
382 |
<select id="<?php echo $this->get_field_id('exclude_level'); ?>" class="cmw-exclude-level"
|
383 |
name="<?php echo $this->get_field_name('exclude_level'); ?>">
|
384 |
<?php $j = intval($instance['exclude_level']) > $menus['selectedLevels'] ? '' : $instance['exclude_level']; ?>
|
385 |
<option value="" <?php selected( $j, '' ); ?>> </option>
|
386 |
<?php for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){ ?>
|
387 |
<option value="<?php echo $i; ?>" <?php selected( $j, "$i" ); ?>><?php echo $i; ?></option>
|
388 |
+
<option value="<?php echo $i . '-'; ?>" <?php selected( $j, $i . '-' ); ?>> <?php echo "$i " . __('and above', 'custom-menu-wizard'); ?></option>
|
389 |
+
<option value="<?php echo $i . '+'; ?>" <?php selected( $j, $i . '+' ); ?>> <?php echo "$i " . __('and below', 'custom-menu-wizard'); ?></option>
|
390 |
<?php } ?>
|
391 |
</select></label>
|
392 |
</div>
|
394 |
|
395 |
<div>
|
396 |
<?php $this->cmw_assist_link(); ?>
|
397 |
+
<strong><?php _e('Qualifier', 'custom-menu-wizard'); ?></strong>
|
398 |
+
<br /><label for="<?php echo $this->get_field_id('contains_current'); ?>"><?php _e('Current Item is in:', 'custom-menu-wizard'); ?></label>
|
399 |
<select id="<?php echo $this->get_field_id('contains_current'); ?>"
|
400 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('contains_current'); ?>">
|
401 |
<option value="" <?php selected( $instance['contains_current'], '' ); ?>> </option>
|
402 |
+
<option value="menu" <?php selected( $instance['contains_current'], 'menu' ); ?>><?php echo _e('Menu', 'custom-menu-wizard'); ?></option>
|
403 |
+
<option value="primary" <?php selected( $instance['contains_current'], 'primary' ); ?>><?php echo _e('Primary Filter', 'custom-menu-wizard'); ?></option>
|
404 |
+
<option value="secondary" <?php selected( $instance['contains_current'], 'secondary' ); ?>><?php echo _e('Secondary Filter', 'custom-menu-wizard'); ?></option>
|
405 |
+
<option value="inclusions" <?php selected( $instance['contains_current'], 'inclusions' ); ?>><?php echo _e('Inclusions', 'custom-menu-wizard'); ?></option>
|
406 |
+
<option value="output" <?php selected( $instance['contains_current'], 'output' ); ?>><?php echo _e('Final Output', 'custom-menu-wizard'); ?></option>
|
407 |
</select>
|
408 |
</div>
|
409 |
|
413 |
/**
|
414 |
* v1.2.0 start collapsible section : 'Fallbacks'
|
415 |
*/
|
416 |
+
$this->cmw_open_a_field_section( $instance, __('Fallbacks', 'custom-menu-wizard'), 'fs_fallbacks' ); ?>
|
417 |
|
418 |
<div class="cmw-disableifnot-br-ci<?php $this->cmw_disableif( 'push', $isNotBranchCurrentItem ); ?>">
|
419 |
<?php $this->cmw_assist_link(); ?>
|
420 |
|
421 |
<div class="cmw-indented">
|
422 |
+
<label for="<?php echo $this->get_field_id('fallback'); ?>"><strong><?php _e('If Current Item has no children:', 'custom-menu-wizard'); ?></strong></label>
|
423 |
<select id="<?php echo $this->get_field_id('fallback'); ?>" class="cmw-fallback cmw-listen"
|
424 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('fallback'); ?>">
|
425 |
<option value="" <?php selected( $instance['fallback'], '' ); ?>> </option>
|
426 |
+
<option value="parent" <?php selected( $instance['fallback'], 'parent' ); ?>><?php _e('Start at : -1 (parent)', 'custom-menu-wizard'); ?></option>
|
427 |
+
<option value="current" <?php selected( $instance['fallback'], 'current' ); ?>><?php _e('Start at : the Current Item', 'custom-menu-wizard'); ?></option>
|
428 |
+
<option value="quit" <?php selected( $instance['fallback'], 'quit' ); ?>><?php _e('No output!', 'custom-menu-wizard'); ?></option>
|
429 |
</select>
|
430 |
|
431 |
<br />
|
432 |
<span class="cmw-disableifnot-fb-pc<?php $this->cmw_disableif( 'push', $isNotFallbackParentCurrent ); ?>">
|
433 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_siblings',
|
434 |
array(
|
435 |
+
'label' => '…' . __('and Include its Siblings', 'custom-menu-wizard')
|
436 |
) ); ?>
|
437 |
|
438 |
<br />
|
439 |
+
<label><?php _e('For Depth:', 'custom-menu-wizard'); ?>
|
440 |
+
<select id="<?php echo $this->get_field_id('fallback_depth'); ?>" data-cmw-text-levels="<?php _e(' levels', 'custom-menu-wizard'); ?>"
|
441 |
data-cmw-set-levels="1" <?php $this->cmw_disableif(); ?>
|
442 |
class="cmw-set-levels" name="<?php echo $this->get_field_name('fallback_depth'); ?>">
|
443 |
<option value="0" <?php selected( $instance['fallback_depth'] > $menus['selectedLevels'] ? 0 : $instance['fallback_depth'], 0 ); ?>> </option>
|
444 |
<?php for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){ ?>
|
445 |
+
<option value="<?php echo $i; ?>" <?php selected( $instance['fallback_depth'], $i ); ?>><?php printf( _n('%d level', '%d levels', $i, 'custom-menu-wizard'), $i ); ?></option>
|
446 |
<?php } ?>
|
447 |
</select></label>
|
448 |
+
<span class="cmw-small-block cmw-indented"><em class="cmw-colour-grey"><?php _e('Fallback Depth is Relative to Current Item!', 'custom-menu-wizard'); ?></em></span>
|
449 |
</span><!-- end .cmw-disableifnot-fb-pc --><?php $this->cmw_disableif( 'pop' ); ?>
|
450 |
</div>
|
451 |
|
452 |
</div><!-- end .cmw-disableifnot-br-ci --><?php $this->cmw_disableif( 'pop' ); ?>
|
453 |
|
454 |
<div>
|
455 |
+
<div class="cmw-indented"><strong><?php _e('If no Current Item can be found:', 'custom-menu-wizard'); ?></strong>
|
456 |
<br />
|
457 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_ci_parent',
|
458 |
array(
|
459 |
+
'label' => __('Try items marked Parent of Current', 'custom-menu-wizard')
|
460 |
) ); ?>
|
461 |
+
<span class="cmw-small-block cmw-indented"><em class="cmw-colour-grey"><?php _e('This is a last resort to determine a "Current Item"', 'custom-menu-wizard'); ?></em></span>
|
462 |
</div>
|
463 |
</div>
|
464 |
|
465 |
<div>
|
466 |
+
<div class="cmw-indented"><strong><?php _e('If more than 1 possible Current Item:', 'custom-menu-wizard'); ?></strong>
|
467 |
<br />
|
468 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_ci_lifo',
|
469 |
array(
|
470 |
+
'label' => __('Use the <strong>last</strong> one found', 'custom-menu-wizard')
|
471 |
) ); ?>
|
472 |
+
<span class="cmw-small-block cmw-indented"><em class="cmw-colour-grey"><?php _e('The default is to use the first candidate found', 'custom-menu-wizard'); ?></em></span>
|
473 |
</div>
|
474 |
</div>
|
475 |
|
479 |
/**
|
480 |
* start collapsible section : 'Output'
|
481 |
*/
|
482 |
+
$this->cmw_open_a_field_section( $instance, __('Output', 'custom-menu-wizard'), 'fs_output' ); ?>
|
483 |
|
484 |
<div>
|
485 |
<?php $this->cmw_assist_link(); ?>
|
487 |
<input id="<?php echo $this->get_field_id('flat_output'); ?>_0"
|
488 |
name="<?php echo $this->get_field_name('flat_output'); ?>"
|
489 |
<?php $this->cmw_disableif(); ?> type="radio" value="0" <?php checked( !$instance['flat_output'] ); ?>
|
490 |
+
/><?php _e('Hierarchical', 'custom-menu-wizard'); ?></label>
|
491 |
<label class="cmw-whitespace-nowrap">
|
492 |
<input id="<?php echo $this->get_field_id('flat_output'); ?>_1"
|
493 |
name="<?php echo $this->get_field_name('flat_output'); ?>"
|
494 |
<?php $this->cmw_disableif(); ?> type="radio" value="1" <?php checked( $instance['flat_output'] ); ?>
|
495 |
+
/><?php _e('Flat', 'custom-menu-wizard'); ?></label>
|
496 |
</div>
|
497 |
|
498 |
<div>
|
499 |
+
<strong><?php _e('Set Title from', 'custom-menu-wizard'); ?></strong>
|
500 |
|
501 |
<div class="cmw-indented">
|
502 |
+
<label><?php _e('Current Item:', 'custom-menu-wizard'); $j = $instance['title_current']; ?>
|
503 |
<select id="<?php echo $this->get_field_id('title_current'); ?>" class="cmw-title-from cmw-set-rel-abs-levels cmw-listen"
|
504 |
name="<?php echo $this->get_field_name('title_current'); ?>"
|
505 |
+
data-cmw-text-level="<?php _e('level', 'custom-menu-wizard'); ?>">
|
506 |
<option value="" <?php selected( $j, "" ); ?>> </option>
|
507 |
+
<option value="0" <?php selected( $j, "0" ); ?>><?php _e('the Current Item', 'custom-menu-wizard'); ?></option>
|
508 |
<?php
|
509 |
$j = is_numeric( $j ) ? max( min( $j, $menus['selectedLevels'] - 1 ), 1 - $menus['selectedLevels'] ) : $j; ?>
|
510 |
+
<optgroup label="<?php _ex('relative...', 'adjective: cf. absolute', 'custom-menu-wizard'); ?>" data-cmw-text-for-option=" <?php _e('%d levels', 'custom-menu-wizard'); ?>">
|
511 |
+
<option value="-1" <?php selected( $j, "-1" ); ?>><?php _e('-1 level (parent)', 'custom-menu-wizard'); ?></option>
|
512 |
<?php for( $i = -2; $i > 0 - $menus['selectedLevels']; $i-- ){ ?>
|
513 |
+
<option value="<?php echo $i; ?>" <?php selected( $j, "$i" ); ?>><?php printf( __('%d levels', 'custom-menu-wizard'), $i ); ?></option>
|
514 |
<?php } ?>
|
515 |
</optgroup>
|
516 |
+
<optgroup label="<?php _e('absolute...', 'custom-menu-wizard'); ?>" data-cmw-text-for-option="<?php _e('level %d', 'custom-menu-wizard'); ?> ">
|
517 |
+
<option value="1" <?php selected( $j, "1" ); ?>><?php _e('level 1 (root)', 'custom-menu-wizard'); ?></option>
|
518 |
<?php for( $i = 2; $i < $menus['selectedLevels']; $i++ ){ ?>
|
519 |
+
<option value="<?php echo $i; ?>" <?php selected( $j, "$i" ); ?>><?php printf( __('level %d', 'custom-menu-wizard'), $i ); ?></option>
|
520 |
<?php } ?>
|
521 |
</optgroup>
|
522 |
</select></label>
|
523 |
</div>
|
524 |
<div class="cmw-indented">
|
525 |
+
<label class="cmw-disableifnot-br<?php $this->cmw_disableif( 'push', $isNotByBranch ); ?>"><?php _e('Branch Item:', 'custom-menu-wizard'); $j = $instance['title_branch']; ?>
|
526 |
<select id="<?php echo $this->get_field_id('title_branch'); ?>" class="cmw-title-from cmw-set-rel-abs-levels cmw-listen"
|
527 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('title_branch'); ?>"
|
528 |
+
data-cmw-text-level="<?php _e('level', 'custom-menu-wizard'); ?>">
|
529 |
<option value="" <?php selected( $j, "" ); ?>> </option>
|
530 |
+
<option value="0" <?php selected( $j, "0" ); ?>><?php _e('the Branch Item', 'custom-menu-wizard'); ?></option>
|
531 |
<?php
|
532 |
$j = is_numeric( $j ) ? max( min( $j, $menus['selectedLevels'] - 1 ), 1 - $menus['selectedLevels'] ) : $j; ?>
|
533 |
+
<optgroup label="<?php _ex('relative...', 'adjective: cf. absolute', 'custom-menu-wizard'); ?>" data-cmw-text-for-option=" <?php _e('%d levels', 'custom-menu-wizard'); ?>">
|
534 |
+
<option value="-1" <?php selected( $j, "-1" ); ?>><?php _e('-1 level (parent)', 'custom-menu-wizard'); ?></option>
|
535 |
<?php for( $i = -2; $i > 0 - $menus['selectedLevels']; $i-- ){ ?>
|
536 |
+
<option value="<?php echo $i; ?>" <?php selected( $j, "$i" ); ?>><?php printf( __('%d levels', 'custom-menu-wizard'), $i ); ?></option>
|
537 |
<?php } ?>
|
538 |
</optgroup>
|
539 |
+
<optgroup label="<?php _e('absolute...', 'custom-menu-wizard'); ?>" data-cmw-text-for-option="<?php _e('level %d', 'custom-menu-wizard'); ?> ">
|
540 |
+
<option value="1" <?php selected( $j, "1" ); ?>><?php _e('level 1 (root)', 'custom-menu-wizard'); ?></option>
|
541 |
<?php for( $i = 2; $i < $menus['selectedLevels']; $i++ ){ ?>
|
542 |
+
<option value="<?php echo $i; ?>" <?php selected( $j, "$i" ); ?>><?php printf( __('level %d', 'custom-menu-wizard'), $i ); ?></option>
|
543 |
<?php } ?>
|
544 |
</optgroup>
|
545 |
</select></label><!-- end .cmw-disableifnot-br --><?php $this->cmw_disableif( 'pop' ); ?>
|
546 |
</div>
|
547 |
<div class="cmw-indented">
|
548 |
+
… <?php _e('and', 'custom-menu-wizard'); ?>:
|
549 |
<?php $this->cmw_formfield_checkbox( $instance, 'title_linked',
|
550 |
array(
|
551 |
+
'label' => __('Make it a Link', 'custom-menu-wizard')
|
552 |
) ); ?>
|
553 |
</div>
|
554 |
</div>
|
555 |
|
556 |
<div>
|
557 |
+
<strong><?php _e('Change UL to OL', 'custom-menu-wizard'); ?></strong>
|
558 |
<br />
|
559 |
<?php $this->cmw_formfield_checkbox( $instance, 'ol_root',
|
560 |
array(
|
561 |
+
'label' => __('Top Level', 'custom-menu-wizard'),
|
562 |
'lclass' => 'cmw-followed-by'
|
563 |
) ); ?>
|
564 |
<?php $this->cmw_formfield_checkbox( $instance, 'ol_sub',
|
565 |
array(
|
566 |
+
'label' => __('Sub-Levels', 'custom-menu-wizard'),
|
567 |
'lclass' => 'cmw-whitespace-nowrap'
|
568 |
) ); ?>
|
569 |
</div>
|
577 |
<div>
|
578 |
<?php $this->cmw_formfield_checkbox( $instance, 'hide_empty',
|
579 |
array(
|
580 |
+
'label' => __('Hide Widget if Empty', 'custom-menu-wizard'),
|
581 |
+
'desc' => __('Prevents any output when no items are found', 'custom-menu-wizard')
|
582 |
) ); ?>
|
583 |
</div>
|
584 |
<?php }else{ ?>
|
592 |
/**
|
593 |
* start collapsible section : 'Container'
|
594 |
*/
|
595 |
+
$this->cmw_open_a_field_section( $instance, __('Container', 'custom-menu-wizard'), 'fs_container' ); ?>
|
596 |
|
597 |
<div>
|
598 |
<?php $this->cmw_formfield_textbox( $instance, 'container',
|
599 |
array(
|
600 |
+
'label' => __('Element:', 'custom-menu-wizard'),
|
601 |
+
'desc' => __('Eg. div or nav; leave empty for no container', 'custom-menu-wizard')
|
602 |
) ); ?>
|
603 |
</div>
|
604 |
<div>
|
605 |
<?php $this->cmw_formfield_textbox( $instance, 'container_id',
|
606 |
array(
|
607 |
+
'label' => __('Unique ID:', 'custom-menu-wizard'),
|
608 |
+
'desc' => __('An optional ID for the container', 'custom-menu-wizard')
|
609 |
) ); ?>
|
610 |
</div>
|
611 |
<div>
|
612 |
<?php $this->cmw_formfield_textbox( $instance, 'container_class',
|
613 |
array(
|
614 |
+
'label' => __('Class:', 'custom-menu-wizard'),
|
615 |
+
'desc' => __('Extra class for the container', 'custom-menu-wizard')
|
616 |
) ); ?>
|
617 |
</div>
|
618 |
|
622 |
/**
|
623 |
* start collapsible section : 'Classes'
|
624 |
*/
|
625 |
+
$this->cmw_open_a_field_section( $instance, __('Classes', 'custom-menu-wizard'), 'fs_classes' ); ?>
|
626 |
|
627 |
<div>
|
628 |
<?php $this->cmw_formfield_textbox( $instance, 'menu_class',
|
629 |
array(
|
630 |
+
'label' => __('Menu Class:', 'custom-menu-wizard'),
|
631 |
+
'desc' => __('Class for the list element forming the menu', 'custom-menu-wizard')
|
632 |
) ); ?>
|
633 |
</div>
|
634 |
<div>
|
635 |
<?php $this->cmw_formfield_textbox( $instance, 'widget_class',
|
636 |
array(
|
637 |
+
'label' => __('Widget Class:', 'custom-menu-wizard'),
|
638 |
+
'desc' => __('Extra class for the widget itself', 'custom-menu-wizard')
|
639 |
) ); ?>
|
640 |
</div>
|
641 |
|
645 |
/**
|
646 |
* start collapsible section : 'Links'
|
647 |
*/
|
648 |
+
$this->cmw_open_a_field_section( $instance, __('Links', 'custom-menu-wizard'), 'fs_links' ); ?>
|
649 |
|
650 |
<div>
|
651 |
<?php $this->cmw_formfield_textbox( $instance, 'before',
|
652 |
array(
|
653 |
+
'label' => __('Before the Link:', 'custom-menu-wizard'),
|
654 |
+
'desc' =>__( htmlspecialchars('Text/HTML to go before the </a> of the link') , 'custom-menu-wizard'),
|
655 |
'fclass' => 'widefat'
|
656 |
) ); ?>
|
657 |
</div>
|
658 |
<div>
|
659 |
<?php $this->cmw_formfield_textbox( $instance, 'after',
|
660 |
array(
|
661 |
+
'label' => __('After the Link:', 'custom-menu-wizard'),
|
662 |
+
'desc' => __( htmlspecialchars('Text/HTML to go after the </a> of the link') , 'custom-menu-wizard'),
|
663 |
'fclass' => 'widefat'
|
664 |
) ); ?>
|
665 |
</div>
|
666 |
<div>
|
667 |
<?php $this->cmw_formfield_textbox( $instance, 'link_before',
|
668 |
array(
|
669 |
+
'label' => __('Before the Link Text:', 'custom-menu-wizard'),
|
670 |
+
'desc' => __('Text/HTML to go before the link text', 'custom-menu-wizard'),
|
671 |
'fclass' => 'widefat'
|
672 |
) ); ?>
|
673 |
</div>
|
674 |
<div>
|
675 |
<?php $this->cmw_formfield_textbox( $instance, 'link_after',
|
676 |
array(
|
677 |
+
'label' => __('After the Link Text:', 'custom-menu-wizard'),
|
678 |
+
'desc' => __('Text/HTML to go after the link text', 'custom-menu-wizard'),
|
679 |
'fclass' => 'widefat'
|
680 |
) ); ?>
|
681 |
</div>
|
686 |
/**
|
687 |
* v3.1.0 start collapsible section : 'Alternative'
|
688 |
*/
|
689 |
+
$this->cmw_open_a_field_section( $instance, __('Alternative', 'custom-menu-wizard'), 'fs_alternative' ); ?>
|
690 |
|
691 |
<div>
|
692 |
<?php $this->cmw_assist_link(); ?>
|
693 |
|
694 |
+
<label for="<?php echo $this->get_field_id('switch_if'); ?>" class="cmw-followed-by"><?php _e('On condition:', 'custom-menu-wizard'); ?></label>
|
695 |
<br /><select id="<?php echo $this->get_field_id('switch_if'); ?>" class="cmw-switchable cmw-listen"
|
696 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('switch_if'); ?>">
|
697 |
<option value="" <?php selected( $instance['switch_if'], '' ); ?>> </option>
|
698 |
+
<option value="current" <?php selected( $instance['switch_if'], 'current' ); ?>><?php _e('Current Item is in...', 'custom-menu-wizard'); ?></option>
|
699 |
+
<option value="no-current" <?php selected( $instance['switch_if'], 'no-current' ); ?>><?php _e('Current Item is NOT in...', 'custom-menu-wizard'); ?></option>
|
700 |
+
<option value="no-output" <?php selected( $instance['switch_if'], 'no-output' ); ?>><?php _e('No Output from...', 'custom-menu-wizard'); ?></option>
|
701 |
</select>
|
702 |
|
703 |
<select id="<?php echo $this->get_field_id('switch_at'); ?>" class="cmw-switchable cmw-listen"
|
704 |
<?php $this->cmw_disableif(); ?> name="<?php echo $this->get_field_name('switch_at'); ?>">
|
705 |
<option value="" <?php selected( $instance['switch_at'], '' ); ?>> </option>
|
706 |
+
<option value="menu" <?php selected( $instance['switch_at'], 'menu' ); ?>><?php echo _e('Menu', 'custom-menu-wizard'); ?></option>
|
707 |
+
<option value="primary" <?php selected( $instance['switch_at'], 'primary' ); ?>><?php echo _e('Primary Filter', 'custom-menu-wizard'); ?></option>
|
708 |
+
<option value="secondary" <?php selected( $instance['switch_at'], 'secondary' ); ?>><?php echo _e('Secondary Filter', 'custom-menu-wizard'); ?></option>
|
709 |
+
<option value="inclusions" <?php selected( $instance['switch_at'], 'inclusions' ); ?>><?php echo _e('Inclusions', 'custom-menu-wizard'); ?></option>
|
710 |
+
<option value="output" <?php selected( $instance['switch_at'], 'output' ); ?>><?php echo _e('Final Output', 'custom-menu-wizard'); ?></option>
|
711 |
</select>
|
712 |
|
713 |
<br />
|
714 |
+
<label class="cmw-disableifnot-sw<?php $this->cmw_disableif( 'push', $isNotSwitchable ); ?>"><?php _e('Then switch settings to:', 'custom-menu-wizard'); ?>
|
715 |
<br /><textarea rows="3" cols="20" <?php $this->cmw_disableif(); ?> id="<?php echo $this->get_field_id('switch_to'); ?>"
|
716 |
name="<?php echo $this->get_field_name('switch_to'); ?>"
|
717 |
class="widefat"><?php echo $instance['switch_to']; ?></textarea>
|
722 |
|
723 |
<?php $this->cmw_close_a_field_section(); ?>
|
724 |
|
725 |
+
<div class="cmw-mock-fieldset"><?php _e('Shortcodes', 'custom-menu-wizard'); ?></div>
|
726 |
<div class="cmw-the-shortcodes">
|
727 |
+
<div class="cmw-small-block"><em class="cmw-colour-grey"><?php _e('The equivalent shortcode for this configuration...', 'custom-menu-wizard'); ?></em></div>
|
728 |
+
<div class="cmw-shortcode-nojs cmw-small-block"><?php _e('With Javascript disabled, this is only guaranteed to be accurate when you <em>initially enter</em> Edit mode!', 'custom-menu-wizard'); ?></div>
|
729 |
<div class="cmw-shortcode-wrap"><code class="widget-<?php echo $this->id_base; ?>-shortcode ui-corner-all"
|
730 |
+
title="<?php esc_attr_e('stand-alone shortcode', 'custom-menu-wizard'); ?>"><?php echo self::cmw_shortcode( array_merge( $instance, array( 'menu' => $menus['selectedMenu'] ) ) ); ?></code></div>
|
731 |
<?php if( is_numeric( $this->number ) && $this->number > 0 ){ ?>
|
732 |
+
<div class="cmw-small-block"><em class="cmw-colour-grey"><?php _e('This <u>specific widget</u> can also be included using...', 'custom-menu-wizard'); ?></em></div>
|
733 |
<div class="cmw-shortcode-wrap"><code class="widget-<?php echo $this->id_base; ?>-shortcode cmw-instance-shortcode ui-corner-all"
|
734 |
+
title="<?php esc_attr_e('dependent shortcode', 'custom-menu-wizard'); ?>">[cmwizard widget=<?php echo $this->number; ?>/]</code></div>
|
735 |
<?php } ?>
|
736 |
</div>
|
737 |
|
965 |
//button, but it doesn't hurt so I've left it in...
|
966 |
$hashid = $this->get_field_id( 'cmw' . ++$this->_cmw_hash_ct );
|
967 |
?>
|
968 |
+
<a class="widget-<?php echo $this->id_base; ?>-assist button" id="<?php echo $hashid; ?>" href="#<?php echo $hashid; ?>"><?php _e('assist', 'custom-menu-wizard'); ?></a>
|
969 |
<?php
|
970 |
|
971 |
}
|
1193 |
'names' => array(), //HTML of OPTIONs, for selecting a menu (returned as a string)
|
1194 |
'optgroups' => array(), //HTML of OPTGROUPs & contained OPTIONs, for selecting an item (returned as a string)
|
1195 |
'selectedOptgroup' => array(''), //HTML of currently selected menu's OPTGROUP and its OPTIONs (returned as string)
|
1196 |
+
'selectedBranchName' => __('the Current Item', 'custom-menu-wizard'), //title of currently selected menu item
|
1197 |
'selectedLevels' => 1 //number of levels in the currently selected menu
|
1198 |
);
|
1199 |
|
1712 |
if( ( $menus = $this->cmw_scan_menus( $instance['menu'], $instance['filter_item'] ) ) === false ){
|
1713 |
?>
|
1714 |
<p class="widget-<?php echo $this->id_base; ?>-no-menus">
|
1715 |
+
<?php printf( wp_kses( __('No populated menus have been created yet! <a href="%s">Create one...</a>', 'custom-menu-wizard'), array('a'=>array('href'=>array())) ), admin_url('nav-menus.php') ); ?>
|
1716 |
</p>
|
1717 |
<?php
|
1718 |
return;
|
1728 |
<div id="<?php echo $this->get_field_id('onchange'); ?>"
|
1729 |
class="widget-<?php echo $this->id_base; ?>-onchange<?php echo $this->cmw_wp_version('3.8') ? ' cmw-pre-wp-v38' : ''; ?>"
|
1730 |
data-cmw-v36plus='<?php echo $this->cmw_wp_version('3.6', true) ? 'true' : 'false'; ?>'
|
1731 |
+
data-cmw-dialog-prompt='<?php _e('Click an item to toggle "Current Menu Item"', 'custom-menu-wizard'); ?>'
|
1732 |
+
data-cmw-dialog-output='<?php _e('Basic Output', 'custom-menu-wizard'); ?>'
|
1733 |
+
data-cmw-dialog-fallback='<?php _e('Fallback invoked', 'custom-menu-wizard'); ?>'
|
1734 |
+
data-cmw-dialog-set-current='<?php _e('Set Current Item?', 'custom-menu-wizard'); ?>'
|
1735 |
+
data-cmw-dialog-shortcodes='<?php _e('Find posts/pages containing a CMW shortcode', 'custom-menu-wizard'); ?>'
|
1736 |
+
data-cmw-dialog-untitled='<?php _e('untitled', 'custom-menu-wizard'); ?>'
|
1737 |
+
data-cmw-dialog-fixed='<?php _e('fixed', 'custom-menu-wizard'); ?>'
|
1738 |
data-cmw-dialog-nonce='<?php echo wp_create_nonce( 'cmw-find-shortcodes' ); ?>'
|
1739 |
data-cmw-dialog-version='2.1.0'
|
1740 |
data-cmw-dialog-id='<?php echo $this->get_field_id('dialog'); ?>'>
|
1744 |
*/
|
1745 |
?>
|
1746 |
<p class="cmw-legacy-warn">
|
1747 |
+
<a class="widget-<?php echo $this->id_base; ?>-legacy-close cmw-legacy-close" title="<?php _e('Dismiss', 'custom-menu-wizard'); ?>" href="#">X</a>
|
1748 |
+
<em><?php _e('This is an old version of the widget!', 'custom-menu-wizard'); ?>
|
1749 |
<?php
|
1750 |
//allow a filter to return true, whereby updates to legacy widgets are disallowed...
|
1751 |
//eg. apply_filter( 'custom_menu_wizard_prevent_legacy_updates', [filter function], 10, 1 ) => true
|
1752 |
if( apply_filters( 'custom_menu_wizard_prevent_legacy_updates', false ) ){
|
1753 |
?>
|
1754 |
+
<br /><?php _e('Any changes you make will NOT be Saved!', 'custom-menu-wizard'); ?>
|
1755 |
<?php
|
1756 |
}
|
1757 |
?>
|
1758 |
+
<br /><?php _e('Please consider creating a new instance of the widget to replace this one.', 'custom-menu-wizard'); ?>
|
1759 |
+
<a href="<?php echo $this->_cmw_legacy_warnreadmore; ?>" target="_blank"><?php _e('read more', 'custom-menu-wizard'); ?></a></em>
|
1760 |
</p>
|
1761 |
<?php
|
1762 |
|
1765 |
*/
|
1766 |
?>
|
1767 |
<p>
|
1768 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'custom-menu-wizard') ?></label>
|
1769 |
<?php $this->cmw_formfield_checkbox( $instance, 'hide_title',
|
1770 |
array(
|
1771 |
+
'label' => _x('Hide', 'verb', 'custom-menu-wizard'),
|
1772 |
'lclass' => 'alignright'
|
1773 |
) ); ?>
|
1774 |
<?php $this->cmw_formfield_textbox( $instance, 'title',
|
1775 |
array(
|
1776 |
+
'desc' => __('Title can be set, but need not be displayed', 'custom-menu-wizard'),
|
1777 |
'fclass' => 'widefat cmw-widget-title'
|
1778 |
) ); ?>
|
1779 |
</p>
|
1780 |
|
1781 |
<p>
|
1782 |
<?php $this->cmw_assist_link(); ?>
|
1783 |
+
<label for="<?php echo $this->get_field_id('menu'); ?>"><?php _e('Select Menu:', 'custom-menu-wizard'); ?></label>
|
1784 |
<select id="<?php echo $this->get_field_id('menu'); ?>" <?php $this->cmw_disableif(); ?>
|
1785 |
class="cmw-select-menu cmw-listen" name="<?php echo $this->get_field_name('menu'); ?>">
|
1786 |
<?php echo $menus['names']; ?>
|
1791 |
/**
|
1792 |
* start collapsible section : 'Filter'
|
1793 |
*/
|
1794 |
+
$this->cmw_open_a_field_section( $instance, __('Filter', 'custom-menu-wizard'), 'fs_filter' );
|
1795 |
?>
|
1796 |
<p>
|
1797 |
<?php $this->cmw_assist_link(); ?>
|
1798 |
<label>
|
1799 |
<input id="<?php echo $this->get_field_id('filter'); ?>_0" class="cmw-showall cmw-listen" <?php $this->cmw_disableif(); ?>
|
1800 |
name="<?php echo $this->get_field_name('filter'); ?>" type="radio" value="0" <?php checked( $instance['filter'], 0 ); ?> />
|
1801 |
+
<?php _e('Show all', 'custom-menu-wizard'); ?></label>
|
1802 |
<br /><label>
|
1803 |
<input id="<?php echo $this->get_field_id('filter'); ?>_1" class="cmw-listen" <?php $this->cmw_disableif(); ?>
|
1804 |
name="<?php echo $this->get_field_name('filter'); ?>" type="radio" value="1" <?php checked( $instance['filter'], 1 ); ?> />
|
1805 |
+
<?php _e('Children of:', 'custom-menu-wizard'); ?></label>
|
1806 |
<select id="<?php echo $this->get_field_id('filter_item'); ?>" class="cmw-childrenof cmw-assist-items cmw-listen"
|
1807 |
name="<?php echo $this->get_field_name('filter_item'); ?>" <?php $this->cmw_disableif(); ?>>
|
1808 |
+
<option value="0" <?php selected( $instance['filter_item'], 0 ); ?>><?php _e('Current Item', 'custom-menu-wizard'); ?></option>
|
1809 |
+
<option value="-2" <?php selected( $instance['filter_item'], -2 ); ?>><?php _e('Current Root Item', 'custom-menu-wizard'); ?></option>
|
1810 |
+
<option value="-1" <?php selected( $instance['filter_item'], -1 ); ?>><?php _e('Current Parent Item', 'custom-menu-wizard'); ?></option>
|
1811 |
<?php echo $menus['selectedOptgroup']; ?>
|
1812 |
</select>
|
1813 |
<br /><label>
|
1814 |
<input id="<?php echo $this->get_field_id('filter'); ?>_2" class="cmw-showspecific cmw-listen" <?php $this->cmw_disableif(); ?>
|
1815 |
name="<?php echo $this->get_field_name('filter'); ?>" type="radio" value="-1" <?php checked( $instance['filter'], -1 ); ?> />
|
1816 |
+
<?php _e('Items:', 'custom-menu-wizard'); ?></label>
|
1817 |
<?php $this->cmw_formfield_textbox( $instance, 'items',
|
1818 |
array(
|
1819 |
'fclass' => 'cmw-setitems'
|
1826 |
</p>
|
1827 |
|
1828 |
<p class="cmw-disableif-ss<?php $this->cmw_disableif( 'push', $isShowSpecific ); ?>">
|
1829 |
+
<label for="<?php echo $this->get_field_id('start_level'); ?>"><?php _e('Starting Level:', 'custom-menu-wizard'); ?></label>
|
1830 |
<select id="<?php echo $this->get_field_id('start_level'); ?>" <?php $this->cmw_disableif(); ?>
|
1831 |
class="cmw-start-level" name="<?php echo $this->get_field_name('start_level'); ?>">
|
1832 |
<?php for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){ ?>
|
1833 |
<option value="<?php echo $i; ?>" <?php selected( $instance['start_level'] > $menus['selectedLevels'] ? 1 : $instance['start_level'], $i ); ?>><?php echo $i; ?></option>
|
1834 |
<?php } ?>
|
1835 |
</select>
|
1836 |
+
<span class="cmw-small-block"><em><?php _e('Level to start testing items for inclusion', 'custom-menu-wizard'); ?></em></span>
|
1837 |
</p><!-- end .cmw-disableif-ss --><?php $this->cmw_disableif( 'pop' ); ?>
|
1838 |
|
1839 |
<p class="cmw-disableif-ss<?php $this->cmw_disableif( 'push', $isShowSpecific ); ?>">
|
1840 |
+
<label for="<?php echo $this->get_field_id('depth'); ?>"><?php _e('For Depth:', 'custom-menu-wizard'); ?></label>
|
1841 |
+
<select id="<?php echo $this->get_field_id('depth'); ?>" class="cmw-depth" data-cmw-text-levels="<?php _e(' levels', 'custom-menu-wizard'); ?>"
|
1842 |
name="<?php echo $this->get_field_name('depth'); ?>" <?php $this->cmw_disableif(); ?>>
|
1843 |
+
<option value="0" <?php selected( $instance['depth'] > $menus['selectedLevels'] ? 0 : $instance['depth'], 0 ); ?>><?php _e('unlimited', 'custom-menu-wizard'); ?></option>
|
1844 |
<?php
|
1845 |
for( $i = 1; $i <= $menus['selectedLevels']; $i++ ){
|
1846 |
?>
|
1847 |
+
<option value="<?php echo $i; ?>" <?php selected( $instance['depth'], $i ); ?>><?php printf( _n('%d level', '%d levels', $i, 'custom-menu-wizard'), $i ); ?></option>
|
1848 |
<?php
|
1849 |
}
|
1850 |
?>
|
1851 |
</select>
|
1852 |
+
<span class="cmw-small-block"><em><?php _e('Relative to first Filter item found, <strong>unless</strong>…', 'custom-menu-wizard'); ?></em></span>
|
1853 |
<?php $this->cmw_formfield_checkbox( $instance, 'depth_rel_current',
|
1854 |
array(
|
1855 |
+
'label' => __('Relative to Current Item <small><em>(if found)</em></small>', 'custom-menu-wizard')
|
1856 |
) ); ?>
|
1857 |
</p><!-- end .cmw-disableif-ss --><?php $this->cmw_disableif( 'pop' ); ?>
|
1858 |
|
1862 |
/**
|
1863 |
* v1.2.0 start collapsible section : 'Fallbacks'
|
1864 |
*/
|
1865 |
+
$this->cmw_open_a_field_section( $instance, __('Fallbacks', 'custom-menu-wizard'), 'fs_fallbacks' );
|
1866 |
?>
|
1867 |
<p class="cmw-disableifnot-rp<?php $this->cmw_disableif( 'push', $isNotCurrentRootParent ); ?>">
|
1868 |
<?php $this->cmw_assist_link(); ?>
|
1869 |
+
<span class="cmw-small-block"><strong><?php _e( 'If "Children of" is <em>Current Root / Parent Item</em>, and no ancestor exists' , 'custom-menu-wizard'); ?> :</strong></span>
|
1870 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_no_ancestor',
|
1871 |
array(
|
1872 |
+
'label' => __('Switch to Current Item, and', 'custom-menu-wizard')
|
1873 |
) ); ?>
|
1874 |
<br />
|
1875 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_include_parent',
|
1876 |
array(
|
1877 |
+
'label' => __('Include Parent...', 'custom-menu-wizard')
|
1878 |
) ); ?>
|
1879 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_include_parent_siblings',
|
1880 |
array(
|
1881 |
+
'label' => __('with Siblings', 'custom-menu-wizard'),
|
1882 |
'lclass' => 'cmw-whitespace-nowrap'
|
1883 |
) ); ?>
|
1884 |
</p><!-- end .cmw-disableifnot-rp --><?php $this->cmw_disableif( 'pop' ); ?>
|
1885 |
|
1886 |
<p class="cmw-disableifnot-ci<?php $this->cmw_disableif( 'push', $isNotCurrentItem ); ?>">
|
1887 |
+
<span class="cmw-small-block"><strong><?php _e( 'If "Children of" is <em>Current Item</em>, and current item has no children' , 'custom-menu-wizard'); ?> :</strong></span>
|
1888 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_no_children',
|
1889 |
array(
|
1890 |
+
'label' => __('Switch to Current Parent Item, and', 'custom-menu-wizard')
|
1891 |
) ); ?>
|
1892 |
<br />
|
1893 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_nc_include_parent',
|
1894 |
array(
|
1895 |
+
'label' => __('Include Parent...', 'custom-menu-wizard')
|
1896 |
) ); ?>
|
1897 |
<?php $this->cmw_formfield_checkbox( $instance, 'fallback_nc_include_parent_siblings',
|
1898 |
array(
|
1899 |
+
'label' => __('with Siblings', 'custom-menu-wizard'),
|
1900 |
'lclass' => 'cmw-whitespace-nowrap'
|
1901 |
) ); ?>
|
1902 |
</p><!-- end .cmw-disableifnot-ci --><?php $this->cmw_disableif( 'pop' ); ?>
|
1907 |
/**
|
1908 |
* start collapsible section : 'Output'
|
1909 |
*/
|
1910 |
+
$this->cmw_open_a_field_section( $instance, __('Output', 'custom-menu-wizard'), 'fs_output' );
|
1911 |
?>
|
1912 |
<p>
|
1913 |
<?php $this->cmw_assist_link(); ?>
|
1914 |
<label>
|
1915 |
<input id="<?php echo $this->get_field_id('flat_output'); ?>_0" name="<?php echo $this->get_field_name('flat_output'); ?>"
|
1916 |
type="radio" value="0" <?php checked(!$instance['flat_output']); ?> <?php $this->cmw_disableif(); ?> />
|
1917 |
+
<?php _e('Hierarchical', 'custom-menu-wizard'); ?></label>
|
1918 |
<label class="cmw-whitespace-nowrap">
|
1919 |
<input id="<?php echo $this->get_field_id('flat_output'); ?>_1" name="<?php echo $this->get_field_name('flat_output'); ?>"
|
1920 |
type="radio" value="1" <?php checked($instance['flat_output']); ?> <?php $this->cmw_disableif(); ?> />
|
1921 |
+
<?php _e('Flat', 'custom-menu-wizard'); ?></label>
|
1922 |
</p>
|
1923 |
|
1924 |
<p>
|
1925 |
<?php $this->cmw_formfield_checkbox( $instance, 'contains_current',
|
1926 |
array(
|
1927 |
+
'label' => __('Must Contain "Current" Item', 'custom-menu-wizard'),
|
1928 |
+
'desc' => __('Checks both Filtered and Included items', 'custom-menu-wizard')
|
1929 |
) ); ?>
|
1930 |
</p>
|
1931 |
|
1932 |
<p class="cmw-disableif<?php $this->cmw_disableif( 'push', $isNotChildrenOf ); ?>">
|
1933 |
<?php $this->cmw_formfield_checkbox( $instance, 'include_parent',
|
1934 |
array(
|
1935 |
+
'label' => __('Include Parent...', 'custom-menu-wizard')
|
1936 |
) ); ?>
|
1937 |
<?php $this->cmw_formfield_checkbox( $instance, 'include_parent_siblings',
|
1938 |
array(
|
1939 |
+
'label' => __('with Siblings', 'custom-menu-wizard'),
|
1940 |
'lclass' => 'cmw-whitespace-nowrap'
|
1941 |
) ); ?>
|
1942 |
<br />
|
1943 |
<?php $this->cmw_formfield_checkbox( $instance, 'include_ancestors',
|
1944 |
array(
|
1945 |
+
'label' => __('Include Ancestors', 'custom-menu-wizard')
|
1946 |
) ); ?>
|
1947 |
<br />
|
1948 |
<?php $this->cmw_formfield_checkbox( $instance, 'title_from_parent',
|
1949 |
array(
|
1950 |
+
'label' => __('Title from Parent', 'custom-menu-wizard'),
|
1951 |
+
'desc' => __('Only if the "Children of" Filter returns items', 'custom-menu-wizard')
|
1952 |
) ); ?>
|
1953 |
</p><!-- end .cmw-disableif --><?php $this->cmw_disableif( 'pop' ); ?>
|
1954 |
|
1955 |
<p>
|
1956 |
<?php $this->cmw_formfield_checkbox( $instance, 'title_from_current',
|
1957 |
array(
|
1958 |
+
'label' => __('Title from "Current" Item', 'custom-menu-wizard'),
|
1959 |
+
'desc' => __('Lower priority than "Title from Parent"', 'custom-menu-wizard')
|
1960 |
) ); ?>
|
1961 |
</p>
|
1962 |
|
1963 |
<p>
|
1964 |
+
<?php _e('Change UL to OL:', 'custom-menu-wizard'); ?>
|
1965 |
<br />
|
1966 |
<?php $this->cmw_formfield_checkbox( $instance, 'ol_root',
|
1967 |
array(
|
1968 |
+
'label' => __('Top Level', 'custom-menu-wizard')
|
1969 |
) ); ?>
|
1970 |
|
1971 |
<?php $this->cmw_formfield_checkbox( $instance, 'ol_sub',
|
1972 |
array(
|
1973 |
+
'label' => __('Sub-Levels', 'custom-menu-wizard')
|
1974 |
) ); ?>
|
1975 |
</p>
|
1976 |
|
1983 |
<p>
|
1984 |
<?php $this->cmw_formfield_checkbox( $instance, 'hide_empty',
|
1985 |
array(
|
1986 |
+
'label' => __('Hide Widget if Empty', 'custom-menu-wizard'),
|
1987 |
+
'desc' => __('Prevents any output when no items are found', 'custom-menu-wizard')
|
1988 |
) ); ?>
|
1989 |
</p>
|
1990 |
<?php }else{ ?>
|
1998 |
/**
|
1999 |
* start collapsible section : 'Container'
|
2000 |
*/
|
2001 |
+
$this->cmw_open_a_field_section( $instance, __('Container', 'custom-menu-wizard'), 'fs_container' );
|
2002 |
?>
|
2003 |
<p>
|
2004 |
<?php $this->cmw_formfield_textbox( $instance, 'container',
|
2005 |
array(
|
2006 |
+
'label' => __('Element:', 'custom-menu-wizard'),
|
2007 |
+
'desc' => __('Eg. div or nav; leave empty for no container', 'custom-menu-wizard')
|
2008 |
) ); ?>
|
2009 |
</p>
|
2010 |
<p>
|
2011 |
<?php $this->cmw_formfield_textbox( $instance, 'container_id',
|
2012 |
array(
|
2013 |
+
'label' => __('Unique ID:', 'custom-menu-wizard'),
|
2014 |
+
'desc' => __('An optional ID for the container', 'custom-menu-wizard')
|
2015 |
) ); ?>
|
2016 |
</p>
|
2017 |
<p>
|
2018 |
<?php $this->cmw_formfield_textbox( $instance, 'container_class',
|
2019 |
array(
|
2020 |
+
'label' => __('Class:', 'custom-menu-wizard'),
|
2021 |
+
'desc' => __('Extra class for the container', 'custom-menu-wizard')
|
2022 |
) ); ?>
|
2023 |
</p>
|
2024 |
|
2028 |
/**
|
2029 |
* start collapsible section : 'Classes'
|
2030 |
*/
|
2031 |
+
$this->cmw_open_a_field_section( $instance, __('Classes', 'custom-menu-wizard'), 'fs_classes' );
|
2032 |
?>
|
2033 |
<p>
|
2034 |
<?php $this->cmw_formfield_textbox( $instance, 'menu_class',
|
2035 |
array(
|
2036 |
+
'label' => __('Menu Class:', 'custom-menu-wizard'),
|
2037 |
+
'desc' => __('Class for the list element forming the menu', 'custom-menu-wizard')
|
2038 |
) ); ?>
|
2039 |
</p>
|
2040 |
<p>
|
2041 |
<?php $this->cmw_formfield_textbox( $instance, 'widget_class',
|
2042 |
array(
|
2043 |
+
'label' => __('Widget Class:', 'custom-menu-wizard'),
|
2044 |
+
'desc' => __('Extra class for the widget itself', 'custom-menu-wizard')
|
2045 |
) ); ?>
|
2046 |
</p>
|
2047 |
|
2051 |
/**
|
2052 |
* start collapsible section : 'Links'
|
2053 |
*/
|
2054 |
+
$this->cmw_open_a_field_section( $instance, __('Links', 'custom-menu-wizard'), 'fs_links' );
|
2055 |
?>
|
2056 |
<p>
|
2057 |
<?php $this->cmw_formfield_textbox( $instance, 'before',
|
2058 |
array(
|
2059 |
+
'label' => __('Before the Link:', 'custom-menu-wizard'),
|
2060 |
+
'desc' => __( htmlspecialchars('Text/HTML to go before the <a> of the link') , 'custom-menu-wizard'),
|
2061 |
'fclass' => 'widefat'
|
2062 |
) ); ?>
|
2063 |
</p>
|
2064 |
<p>
|
2065 |
<?php $this->cmw_formfield_textbox( $instance, 'after',
|
2066 |
array(
|
2067 |
+
'label' => __('After the Link:', 'custom-menu-wizard'),
|
2068 |
+
'desc' => __( htmlspecialchars('Text/HTML to go after the <a> of the link') , 'custom-menu-wizard'),
|
2069 |
'fclass' => 'widefat'
|
2070 |
) ); ?>
|
2071 |
</p>
|
2072 |
<p>
|
2073 |
<?php $this->cmw_formfield_textbox( $instance, 'link_before',
|
2074 |
array(
|
2075 |
+
'label' => __('Before the Link Text:', 'custom-menu-wizard'),
|
2076 |
+
'desc' => __('Text/HTML to go before the link text', 'custom-menu-wizard'),
|
2077 |
'fclass' => 'widefat'
|
2078 |
) ); ?>
|
2079 |
</p>
|
2080 |
<p>
|
2081 |
<?php $this->cmw_formfield_textbox( $instance, 'link_after',
|
2082 |
array(
|
2083 |
+
'label' => __('After the Link Text:', 'custom-menu-wizard'),
|
2084 |
+
'desc' => __('Text/HTML to go after the link text', 'custom-menu-wizard'),
|
2085 |
'fclass' => 'widefat'
|
2086 |
) ); ?>
|
2087 |
</p>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: menu,widget,navigation,custom menu,partial menu,current item,current page,menu level,menu branch,menu shortcode,menu widget,advanced,enhanced
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 4.3
|
7 |
-
Stable tag: 3.
|
8 |
License: GPLv2 or Later
|
9 |
|
10 |
Show branches or levels of your menu in a widget, or in content using a shortcode, with full customisation.
|
@@ -876,6 +876,9 @@ because Version 2 will **not** be supported beyond Version 3.
|
|
876 |
|
877 |
== Changelog ==
|
878 |
|
|
|
|
|
|
|
879 |
= 3.1.5 =
|
880 |
* addition : expanded Title From to allow absolute ancestor levels (besides root) and relative ancestor levels
|
881 |
* addition : added a fallback option to switch determination of Current Item from first-found to last-found
|
@@ -1023,6 +1026,9 @@ because Version 2 will **not** be supported beyond Version 3.
|
|
1023 |
|
1024 |
== Upgrade Notice ==
|
1025 |
|
|
|
|
|
|
|
1026 |
= 3.1.5 =
|
1027 |
Expanded Title From to allow absolute ancestor levels (besides root) and relative ancestor levels.
|
1028 |
Added a fallback option to switch determination of Current Item from first-found to last-found.
|
4 |
Tags: menu,widget,navigation,custom menu,partial menu,current item,current page,menu level,menu branch,menu shortcode,menu widget,advanced,enhanced
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 4.3
|
7 |
+
Stable tag: 3.2.0
|
8 |
License: GPLv2 or Later
|
9 |
|
10 |
Show branches or levels of your menu in a widget, or in content using a shortcode, with full customisation.
|
876 |
|
877 |
== Changelog ==
|
878 |
|
879 |
+
= 3.2.0 =
|
880 |
+
* internationalization
|
881 |
+
|
882 |
= 3.1.5 =
|
883 |
* addition : expanded Title From to allow absolute ancestor levels (besides root) and relative ancestor levels
|
884 |
* addition : added a fallback option to switch determination of Current Item from first-found to last-found
|
1026 |
|
1027 |
== Upgrade Notice ==
|
1028 |
|
1029 |
+
= 3.2.0 =
|
1030 |
+
Internationalization.
|
1031 |
+
|
1032 |
= 3.1.5 =
|
1033 |
Expanded Title From to allow absolute ancestor levels (besides root) and relative ancestor levels.
|
1034 |
Added a fallback option to switch determination of Current Item from first-found to last-found.
|