mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-07 16:11:59 +01:00
Trim trailing whites
git-svn-id: http://svn.automattic.com/wordpress/trunk@13268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
622ae1dff8
commit
dbfb51c6e0
@ -249,7 +249,7 @@ case 'unapprovecomment' :
|
|||||||
wp_set_comment_status( $comment_id, 'hold' );
|
wp_set_comment_status( $comment_id, 'hold' );
|
||||||
$redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
|
$redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
wp_redirect( $redir );
|
wp_redirect( $redir );
|
||||||
die;
|
die;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* @package WordPress
|
* @package WordPress
|
||||||
* @subpackage Administration
|
* @subpackage Administration
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.fix{clear: both;height: 1px;margin: -1px 0 0;overflow: hidden;}
|
.fix{clear: both;height: 1px;margin: -1px 0 0;overflow: hidden;}
|
||||||
|
|
||||||
#no-js {display:block;}
|
#no-js {display:block;}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* @package WordPress
|
* @package WordPress
|
||||||
* @subpackage Administration
|
* @subpackage Administration
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once('admin.php');
|
require_once('admin.php');
|
||||||
|
|
||||||
wp_admin_css( 'custom-navigation' );
|
wp_admin_css( 'custom-navigation' );
|
||||||
@ -28,9 +28,9 @@ wp_custom_navigation();
|
|||||||
|
|
||||||
function wp_custom_nav_reset() {
|
function wp_custom_nav_reset() {
|
||||||
wp_custom_navigation_setup(true);
|
wp_custom_navigation_setup(true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -46,20 +46,20 @@ function wp_custom_navigation() {
|
|||||||
|
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<div id="no-js"><h3>You do not have JavaScript enabled in your browser. Please enable it to access the Custom Menu functionality.</h3></div>
|
<div id="no-js"><h3>You do not have JavaScript enabled in your browser. Please enable it to access the Custom Menu functionality.</h3></div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$messagesdiv = '';
|
$messagesdiv = '';
|
||||||
$menu_id_in_edit = 0;
|
$menu_id_in_edit = 0;
|
||||||
|
|
||||||
// Get the theme name
|
// Get the theme name
|
||||||
$themename = get_current_theme();
|
$themename = get_current_theme();
|
||||||
|
|
||||||
// Check which menu is selected and if menu is in edit already
|
// Check which menu is selected and if menu is in edit already
|
||||||
if ( isset( $_POST['switch_menu'] ) )
|
if ( isset( $_POST['switch_menu'] ) )
|
||||||
$menu_selected_id = $_POST['menu_select'];
|
$menu_selected_id = $_POST['menu_select'];
|
||||||
elseif ( isset( $_POST['menu_id_in_edit'] ) )
|
elseif ( isset( $_POST['menu_id_in_edit'] ) )
|
||||||
$menu_selected_id = $_POST['menu_id_in_edit'];
|
$menu_selected_id = $_POST['menu_id_in_edit'];
|
||||||
|
|
||||||
// Default Menu to show
|
// Default Menu to show
|
||||||
$custom_menus = get_terms( 'menu', array( 'hide_empty' => false ) );
|
$custom_menus = get_terms( 'menu', array( 'hide_empty' => false ) );
|
||||||
if ( !empty( $custom_menus ) )
|
if ( !empty( $custom_menus ) )
|
||||||
@ -74,12 +74,12 @@ function wp_custom_navigation() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $_POST['set_wp_menu'] ) ) {
|
if ( isset( $_POST['set_wp_menu'] ) ) {
|
||||||
update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] );
|
update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] );
|
||||||
$messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been updated!</p></div>';
|
$messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been updated!</p></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $_POST['licount'] ) )
|
if ( isset( $_POST['licount'] ) )
|
||||||
$postCounter = $_POST['licount'];
|
$postCounter = $_POST['licount'];
|
||||||
else
|
else
|
||||||
@ -93,13 +93,13 @@ function wp_custom_navigation() {
|
|||||||
$existing_term = get_term_by( 'name', $insert_menu_name, 'menu' );
|
$existing_term = get_term_by( 'name', $insert_menu_name, 'menu' );
|
||||||
if ( $existing_term ) {
|
if ( $existing_term ) {
|
||||||
$messagesdiv = '<div id="message" class="error fade below-h2"><p>'.$insert_menu_name.' Menu has already created - please try another name</p></div>';
|
$messagesdiv = '<div id="message" class="error fade below-h2"><p>'.$insert_menu_name.' Menu has already created - please try another name</p></div>';
|
||||||
} else {
|
} else {
|
||||||
$term = wp_insert_term( $insert_menu_name, 'menu' );
|
$term = wp_insert_term( $insert_menu_name, 'menu' );
|
||||||
if ( $term ) {
|
if ( $term ) {
|
||||||
$custom_menus[$term['term_id']] = $term;
|
$custom_menus[$term['term_id']] = $term;
|
||||||
$menu_selected_id = $term['term_id'];
|
$menu_selected_id = $term['term_id'];
|
||||||
$menu_id_in_edit = $menu_selected_id;
|
$menu_id_in_edit = $menu_selected_id;
|
||||||
$messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$insert_menu_name.' Menu has been created!</p></div>';
|
$messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$insert_menu_name.' Menu has been created!</p></div>';
|
||||||
|
|
||||||
$postCounter = 0;
|
$postCounter = 0;
|
||||||
}
|
}
|
||||||
@ -108,8 +108,8 @@ function wp_custom_navigation() {
|
|||||||
$messagesdiv = '<div id="message" class="error fade below-h2"><p>Please enter a valid Menu name</p></div>';
|
$messagesdiv = '<div id="message" class="error fade below-h2"><p>Please enter a valid Menu name</p></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset($_POST['reset_wp_menu']) ) {
|
if ( isset($_POST['reset_wp_menu']) ) {
|
||||||
$success = wp_custom_nav_reset();
|
$success = wp_custom_nav_reset();
|
||||||
if ($success) {
|
if ($success) {
|
||||||
// DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly
|
// DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly
|
||||||
@ -128,7 +128,7 @@ function wp_custom_navigation() {
|
|||||||
$update_fields = array( 'menu_order', 'guid', 'post_content', 'post_title', 'post_excerpt', 'post_content_filtered' );
|
$update_fields = array( 'menu_order', 'guid', 'post_content', 'post_title', 'post_excerpt', 'post_content_filtered' );
|
||||||
//Loop through all POST variables
|
//Loop through all POST variables
|
||||||
for ($k = 1;$k<= $postCounter; $k++) {
|
for ($k = 1;$k<= $postCounter; $k++) {
|
||||||
|
|
||||||
if (isset($_POST['dbid'.$k])) { $db_id = $_POST['dbid'.$k]; } else { $db_id = 0; }
|
if (isset($_POST['dbid'.$k])) { $db_id = $_POST['dbid'.$k]; } else { $db_id = 0; }
|
||||||
if (isset($_POST['postmenu'.$k])) { $post_id = $_POST['postmenu'.$k]; } else { $post_id = 0; }
|
if (isset($_POST['postmenu'.$k])) { $post_id = $_POST['postmenu'.$k]; } else { $post_id = 0; }
|
||||||
//@todo implement heirarchy
|
//@todo implement heirarchy
|
||||||
@ -142,7 +142,7 @@ function wp_custom_navigation() {
|
|||||||
if (isset($_POST['linktype'.$k])) { $linktype = $_POST['linktype'.$k]; } else { $linktype = 'custom'; }
|
if (isset($_POST['linktype'.$k])) { $linktype = $_POST['linktype'.$k]; } else { $linktype = 'custom'; }
|
||||||
if (isset($_POST['anchortitle'.$k])) { $custom_anchor_title = stripslashes($_POST['anchortitle'.$k]); } else { $custom_anchor_title = $custom_title; }
|
if (isset($_POST['anchortitle'.$k])) { $custom_anchor_title = stripslashes($_POST['anchortitle'.$k]); } else { $custom_anchor_title = $custom_title; }
|
||||||
if (isset($_POST['newwindow'.$k])) { $new_window = $_POST['newwindow'.$k]; } else { $new_window = 0; }
|
if (isset($_POST['newwindow'.$k])) { $new_window = $_POST['newwindow'.$k]; } else { $new_window = 0; }
|
||||||
|
|
||||||
$post = array( 'post_status' => 'publish', 'post_type' => 'menu_item', 'post_author' => $user_ID,
|
$post = array( 'post_status' => 'publish', 'post_type' => 'menu_item', 'post_author' => $user_ID,
|
||||||
'ping_status' => 0, 'post_parent' => $post_id, '`menu_order' => $position,
|
'ping_status' => 0, 'post_parent' => $post_id, '`menu_order' => $position,
|
||||||
'guid' => $custom_linkurl, 'post_excerpt' => $custom_anchor_title, 'tax_input' => array( 'menu' => $menu_title ),
|
'guid' => $custom_linkurl, 'post_excerpt' => $custom_anchor_title, 'tax_input' => array( 'menu' => $menu_title ),
|
||||||
@ -175,43 +175,43 @@ function wp_custom_navigation() {
|
|||||||
//DISPLAY SUCCESS MESSAGE IF POST CORRECT
|
//DISPLAY SUCCESS MESSAGE IF POST CORRECT
|
||||||
$messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been updated!</p></div>';
|
$messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been updated!</p></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
//DISPLAY Custom Navigation
|
//DISPLAY Custom Navigation
|
||||||
?>
|
?>
|
||||||
<div id="pages-left">
|
<div id="pages-left">
|
||||||
<div class="inside">
|
<div class="inside">
|
||||||
<h2 class="maintitle">Custom Navigation</h2>
|
<h2 class="maintitle">Custom Navigation</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//CHECK if custom menu has been enabled
|
//CHECK if custom menu has been enabled
|
||||||
$enabled_menu = get_option('wp_custom_nav_menu');
|
$enabled_menu = get_option('wp_custom_nav_menu');
|
||||||
$checked = strtolower($enabled_menu);
|
$checked = strtolower($enabled_menu);
|
||||||
|
|
||||||
if ($checked == 'true') {
|
if ($checked == 'true') {
|
||||||
} else {
|
} else {
|
||||||
echo '<div id="message-enabled" class="error fade below-h2"><p><strong>The Custom Menu has not been Enabled yet. Please enable it in order to use it --------></strong></p></div>';
|
echo '<div id="message-enabled" class="error fade below-h2"><p><strong>The Custom Menu has not been Enabled yet. Please enable it in order to use it --------></strong></p></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?php echo $messagesdiv; ?>
|
<?php echo $messagesdiv; ?>
|
||||||
<form onsubmit="updatepostdata()" action="custom-navigation.php" method="post" enctype="multipart/form-data">
|
<form onsubmit="updatepostdata()" action="custom-navigation.php" method="post" enctype="multipart/form-data">
|
||||||
|
|
||||||
<input type="hidden" name="licount" id="licount" value="0" />
|
<input type="hidden" name="licount" id="licount" value="0" />
|
||||||
<input type="hidden" name="menu_id_in_edit" id="menu_id_in_edit" value="<?php echo $menu_selected_id; ?>" />
|
<input type="hidden" name="menu_id_in_edit" id="menu_id_in_edit" value="<?php echo $menu_selected_id; ?>" />
|
||||||
|
|
||||||
<div class="sidebar-name">
|
<div class="sidebar-name">
|
||||||
|
|
||||||
<div class="sidebar-name-arrow">
|
<div class="sidebar-name-arrow">
|
||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
<h3><?php echo $menu_title; ?></h3>
|
<h3><?php echo $menu_title; ?></h3>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="nav-container">
|
<div id="nav-container">
|
||||||
<ul id="custom-nav">
|
<ul id="custom-nav">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
//DISPLAY existing menu
|
//DISPLAY existing menu
|
||||||
if ( $menu_selected_id > 0 ) {
|
if ( $menu_selected_id > 0 ) {
|
||||||
@ -219,59 +219,59 @@ function wp_custom_navigation() {
|
|||||||
$output_type = "backend";
|
$output_type = "backend";
|
||||||
//MAIN OUTPUT FUNCTION
|
//MAIN OUTPUT FUNCTION
|
||||||
wp_custom_navigation_output( 'type='.$output_type.'&name='.$menu_title.'&id='.$menu_selected_id );
|
wp_custom_navigation_output( 'type='.$output_type.'&name='.$menu_title.'&id='.$menu_selected_id );
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div><!-- /#nav-container -->
|
</div><!-- /#nav-container -->
|
||||||
|
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
updatepostdata();
|
updatepostdata();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<input id="save_bottom" name="save_bottom" type="submit" value="Save All Changes" /></p>
|
<input id="save_bottom" name="save_bottom" type="submit" value="Save All Changes" /></p>
|
||||||
</div><!-- /.inside -->
|
</div><!-- /.inside -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="menu-right">
|
<div id="menu-right">
|
||||||
|
|
||||||
<h2 class="heading">Options</h2>
|
<h2 class="heading">Options</h2>
|
||||||
|
|
||||||
<div class="widgets-holder-wrap">
|
<div class="widgets-holder-wrap">
|
||||||
<div class="sidebar-name">
|
<div class="sidebar-name">
|
||||||
<div class="sidebar-name-arrow"></div>
|
<div class="sidebar-name-arrow"></div>
|
||||||
<h3>Setup Custom Menu</h3>
|
<h3>Setup Custom Menu</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="widget-holder">
|
<div class="widget-holder">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//SETUP Custom Menu
|
//SETUP Custom Menu
|
||||||
|
|
||||||
$enabled_menu = get_option('wp_custom_nav_menu');
|
$enabled_menu = get_option('wp_custom_nav_menu');
|
||||||
|
|
||||||
$checked = strtolower($enabled_menu);
|
$checked = strtolower($enabled_menu);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<span >
|
<span >
|
||||||
<label>Enable</label><input type="radio" name="enable_wp_menu" value="true" <?php if ($checked=='true') { echo 'checked="checked"'; } ?> />
|
<label>Enable</label><input type="radio" name="enable_wp_menu" value="true" <?php if ($checked=='true') { echo 'checked="checked"'; } ?> />
|
||||||
<label>Disable</label><input type="radio" name="enable_wp_menu" value="false" <?php if ($checked=='true') { } else { echo 'checked="checked"'; } ?> />
|
<label>Disable</label><input type="radio" name="enable_wp_menu" value="false" <?php if ($checked=='true') { } else { echo 'checked="checked"'; } ?> />
|
||||||
</span><!-- /.checkboxes -->
|
</span><!-- /.checkboxes -->
|
||||||
|
|
||||||
<input id="set_wp_menu" type="submit" value="Set Menu" name="set_wp_menu" class="button" /><br />
|
<input id="set_wp_menu" type="submit" value="Set Menu" name="set_wp_menu" class="button" /><br />
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
<label>Reset Menu to Default</label>
|
<label>Reset Menu to Default</label>
|
||||||
<input id="reset_wp_menu" type="submit" value="Reset" name="reset_wp_menu" class="button" onclick="return confirm('Are you sure you want to RESET the Custom Navigation Menu to its Default Settings?');" />
|
<input id="reset_wp_menu" type="submit" value="Reset" name="reset_wp_menu" class="button" onclick="return confirm('Are you sure you want to RESET the Custom Navigation Menu to its Default Settings?');" />
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div class="fix"></div>
|
<div class="fix"></div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.widgets-holder-wrap -->
|
</div><!-- /.widgets-holder-wrap -->
|
||||||
|
|
||||||
<div class="widgets-holder-wrap">
|
<div class="widgets-holder-wrap">
|
||||||
<div class="sidebar-name">
|
<div class="sidebar-name">
|
||||||
<div class="sidebar-name-arrow"></div>
|
<div class="sidebar-name-arrow"></div>
|
||||||
@ -279,8 +279,8 @@ function wp_custom_navigation() {
|
|||||||
</div>
|
</div>
|
||||||
<div class="widget-holder">
|
<div class="widget-holder">
|
||||||
<select id="menu_select" name="menu_select">
|
<select id="menu_select" name="menu_select">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//DISPLAY SELECT OPTIONS
|
//DISPLAY SELECT OPTIONS
|
||||||
foreach( $custom_menus as $menu ) {
|
foreach( $custom_menus as $menu ) {
|
||||||
$menu_term = get_term( $menu, 'menu' );
|
$menu_term = get_term( $menu, 'menu' );
|
||||||
@ -291,15 +291,15 @@ function wp_custom_navigation() {
|
|||||||
?>
|
?>
|
||||||
<option value="<?php echo $menu_term->term_id; ?>" <?php echo $selected_option; ?>><?php echo $menu_term->name; ?></option>
|
<option value="<?php echo $menu_term->term_id; ?>" <?php echo $selected_option; ?>><?php echo $menu_term->name; ?></option>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<input id="switch_menu" type="submit" value="Switch" name="switch_menu" class="button" />
|
<input id="switch_menu" type="submit" value="Switch" name="switch_menu" class="button" />
|
||||||
<input id="add_menu_name" name="add_menu_name" type="text" value="" />
|
<input id="add_menu_name" name="add_menu_name" type="text" value="" />
|
||||||
<input id="add_menu" type="submit" value="Add Menu" name="add_menu" class="button" />
|
<input id="add_menu" type="submit" value="Add Menu" name="add_menu" class="button" />
|
||||||
|
|
||||||
<div class="fix"></div>
|
<div class="fix"></div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.widgets-holder-wrap -->
|
</div><!-- /.widgets-holder-wrap -->
|
||||||
@ -309,25 +309,25 @@ function wp_custom_navigation() {
|
|||||||
<div class="sidebar-name-arrow"></div>
|
<div class="sidebar-name-arrow"></div>
|
||||||
<h3>Top Level Menu Descriptions</h3>
|
<h3>Top Level Menu Descriptions</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="widget-holder">
|
<div class="widget-holder">
|
||||||
<span>Display Descriptions in Top Level Menu?</span>
|
<span>Display Descriptions in Top Level Menu?</span>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//UPDATE and DISPLAY Menu Description Option
|
//UPDATE and DISPLAY Menu Description Option
|
||||||
if (isset($_POST['menu-descriptions']))
|
if (isset($_POST['menu-descriptions']))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (isset($_POST['switch_menu'])) {
|
if (isset($_POST['switch_menu'])) {
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$menu_options_to_edit = $_POST['menu_id_in_edit'];
|
$menu_options_to_edit = $_POST['menu_id_in_edit'];
|
||||||
update_option('wp_settings_custom_nav_'.$menu_options_to_edit.'_descriptions',$_POST['menu-descriptions']);
|
update_option('wp_settings_custom_nav_'.$menu_options_to_edit.'_descriptions',$_POST['menu-descriptions']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($menu_id_in_edit > 0)
|
if ($menu_id_in_edit > 0)
|
||||||
{
|
{
|
||||||
$checkedraw = get_option('wp_settings_custom_nav_'.$menu_id_in_edit.'_descriptions');
|
$checkedraw = get_option('wp_settings_custom_nav_'.$menu_id_in_edit.'_descriptions');
|
||||||
@ -335,16 +335,16 @@ function wp_custom_navigation() {
|
|||||||
else {
|
else {
|
||||||
$checkedraw = get_option('wp_settings_custom_nav_'.$menu_selected_id.'_descriptions');
|
$checkedraw = get_option('wp_settings_custom_nav_'.$menu_selected_id.'_descriptions');
|
||||||
}
|
}
|
||||||
|
|
||||||
$checked = strtolower($checkedraw);
|
$checked = strtolower($checkedraw);
|
||||||
|
|
||||||
if ($advanced_option_descriptions == 'no')
|
if ($advanced_option_descriptions == 'no')
|
||||||
{
|
{
|
||||||
$checked = 'no';
|
$checked = 'no';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<span class="checkboxes">
|
<span class="checkboxes">
|
||||||
<label>Yes</label><input type="radio" name="menu-descriptions" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
|
<label>Yes</label><input type="radio" name="menu-descriptions" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
|
||||||
<label>No</label><input type="radio" name="menu-descriptions" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
|
<label>No</label><input type="radio" name="menu-descriptions" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
|
||||||
@ -353,16 +353,16 @@ function wp_custom_navigation() {
|
|||||||
<div class="fix"></div>
|
<div class="fix"></div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.widgets-holder-wrap -->
|
</div><!-- /.widgets-holder-wrap -->
|
||||||
|
|
||||||
<div class="widgets-holder-wrap">
|
<div class="widgets-holder-wrap">
|
||||||
<div class="sidebar-name">
|
<div class="sidebar-name">
|
||||||
<div class="sidebar-name-arrow"></div>
|
<div class="sidebar-name-arrow"></div>
|
||||||
<h3>Add an Existing Page</h3>
|
<h3>Add an Existing Page</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="widget-holder">
|
<div class="widget-holder">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$pages_args = array(
|
$pages_args = array(
|
||||||
'child_of' => 0,
|
'child_of' => 0,
|
||||||
'sort_order' => 'ASC',
|
'sort_order' => 'ASC',
|
||||||
@ -377,8 +377,8 @@ function wp_custom_navigation() {
|
|||||||
'exclude_tree' => '',
|
'exclude_tree' => '',
|
||||||
'number' => '',
|
'number' => '',
|
||||||
'offset' => 0 );
|
'offset' => 0 );
|
||||||
|
|
||||||
//GET all pages
|
//GET all pages
|
||||||
$pages_array = get_pages($pages_args);
|
$pages_array = get_pages($pages_args);
|
||||||
$page_name = '';
|
$page_name = '';
|
||||||
//CHECK if pages exist
|
//CHECK if pages exist
|
||||||
@ -386,7 +386,7 @@ function wp_custom_navigation() {
|
|||||||
{
|
{
|
||||||
foreach ($pages_array as $post)
|
foreach ($pages_array as $post)
|
||||||
{
|
{
|
||||||
//Add page name to
|
//Add page name to
|
||||||
$page_name .= htmlentities($post->post_title).'|';
|
$page_name .= htmlentities($post->post_title).'|';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -394,43 +394,43 @@ function wp_custom_navigation() {
|
|||||||
{
|
{
|
||||||
$page_name = "No pages available";
|
$page_name = "No pages available";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
jQuery(document).ready(function(){
|
jQuery(document).ready(function(){
|
||||||
|
|
||||||
//GET PHP pages
|
//GET PHP pages
|
||||||
var dataposts = "<?php echo $page_name; ?>".split("|");
|
var dataposts = "<?php echo $page_name; ?>".split("|");
|
||||||
|
|
||||||
//Set autocomplete
|
//Set autocomplete
|
||||||
jQuery("#page-search").autocomplete(dataposts);
|
jQuery("#page-search").autocomplete(dataposts);
|
||||||
|
|
||||||
//Handle autocomplete result
|
//Handle autocomplete result
|
||||||
jQuery("#page-search").result(function(event, data, formatted) {
|
jQuery("#page-search").result(function(event, data, formatted) {
|
||||||
jQuery('#existing-pages').css('display','block');
|
jQuery('#existing-pages').css('display','block');
|
||||||
jQuery("#existing-pages dt:contains('" + data + "')").css("display", "block");
|
jQuery("#existing-pages dt:contains('" + data + "')").css("display", "block");
|
||||||
|
|
||||||
jQuery('#show-pages').hide();
|
jQuery('#show-pages').hide();
|
||||||
jQuery('#hide-pages').show();
|
jQuery('#hide-pages').show();
|
||||||
|
|
||||||
});
|
});
|
||||||
jQuery('#existing-pages').css('display','none');
|
jQuery('#existing-pages').css('display','none');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<input type="text" onfocus="jQuery('#page-search').attr('value','');" id="page-search" value="Search Pages" />
|
<input type="text" onfocus="jQuery('#page-search').attr('value','');" id="page-search" value="Search Pages" />
|
||||||
|
|
||||||
<a id="show-pages" style="cursor:pointer;" onclick="jQuery('#existing-pages').css('display','block');jQuery('#page-search').attr('value','');jQuery('#existing-pages dt').css('display','block');jQuery('#show-pages').hide();jQuery('#hide-pages').show();">View All</a>
|
<a id="show-pages" style="cursor:pointer;" onclick="jQuery('#existing-pages').css('display','block');jQuery('#page-search').attr('value','');jQuery('#existing-pages dt').css('display','block');jQuery('#show-pages').hide();jQuery('#hide-pages').show();">View All</a>
|
||||||
<a id="hide-pages" style="cursor:pointer;" onclick="jQuery('#existing-pages').css('display','none');jQuery('#page-search').attr('value','Search Pages');jQuery('#existing-pages dt').css('display','none');jQuery('#show-pages').show();jQuery('#hide-pages').hide();">Hide All</a>
|
<a id="hide-pages" style="cursor:pointer;" onclick="jQuery('#existing-pages').css('display','none');jQuery('#page-search').attr('value','Search Pages');jQuery('#existing-pages dt').css('display','none');jQuery('#show-pages').show();jQuery('#hide-pages').hide();">Hide All</a>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
jQuery('#hide-pages').hide();
|
jQuery('#hide-pages').hide();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ul id="existing-pages" class="list">
|
<ul id="existing-pages" class="list">
|
||||||
<?php
|
<?php
|
||||||
$intCounter = 0;
|
$intCounter = 0;
|
||||||
@ -438,40 +438,40 @@ function wp_custom_navigation() {
|
|||||||
$intCounter = wp_custom_nav_get_pages($intCounter,'default');
|
$intCounter = wp_custom_nav_get_pages($intCounter,'default');
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="fix"></div>
|
<div class="fix"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.widgets-holder-wrap -->
|
</div><!-- /.widgets-holder-wrap -->
|
||||||
|
|
||||||
<div class="widgets-holder-wrap">
|
<div class="widgets-holder-wrap">
|
||||||
<div class="sidebar-name">
|
<div class="sidebar-name">
|
||||||
<div class="sidebar-name-arrow"></div>
|
<div class="sidebar-name-arrow"></div>
|
||||||
<h3>Add an Existing Category</h3>
|
<h3>Add an Existing Category</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="widget-holder">
|
<div class="widget-holder">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//Custom GET categories query
|
//Custom GET categories query
|
||||||
$categories = $wpdb->get_results("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC");
|
$categories = $wpdb->get_results("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC");
|
||||||
$cat_name = '';
|
$cat_name = '';
|
||||||
//CHECK for results
|
//CHECK for results
|
||||||
if ($categories)
|
if ($categories)
|
||||||
{
|
{
|
||||||
foreach($categories as $category)
|
foreach($categories as $category)
|
||||||
{
|
{
|
||||||
$cat_id = $category->term_id;
|
$cat_id = $category->term_id;
|
||||||
|
|
||||||
$cat_args=array(
|
$cat_args=array(
|
||||||
'orderby' => 'name',
|
'orderby' => 'name',
|
||||||
'include' => $cat_id,
|
'include' => $cat_id,
|
||||||
'hierarchical' => 1,
|
'hierarchical' => 1,
|
||||||
'order' => 'ASC'
|
'order' => 'ASC'
|
||||||
);
|
);
|
||||||
|
|
||||||
$category_names=get_categories($cat_args);
|
$category_names=get_categories($cat_args);
|
||||||
|
|
||||||
if (isset($category_names[0]->name))
|
if (isset($category_names[0]->name))
|
||||||
{
|
{
|
||||||
//Add category name to data string
|
//Add category name to data string
|
||||||
@ -483,7 +483,7 @@ function wp_custom_navigation() {
|
|||||||
{
|
{
|
||||||
$cat_name = "No categories available";
|
$cat_name = "No categories available";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -491,48 +491,48 @@ function wp_custom_navigation() {
|
|||||||
|
|
||||||
//GET PHP categories
|
//GET PHP categories
|
||||||
var datacats = "<?php echo $cat_name; ?>".split("|");
|
var datacats = "<?php echo $cat_name; ?>".split("|");
|
||||||
|
|
||||||
//Set autocomplete
|
//Set autocomplete
|
||||||
jQuery("#cat-search").autocomplete(datacats);
|
jQuery("#cat-search").autocomplete(datacats);
|
||||||
|
|
||||||
//Handle autocomplete result
|
//Handle autocomplete result
|
||||||
jQuery("#cat-search").result(function(event, data, formatted) {
|
jQuery("#cat-search").result(function(event, data, formatted) {
|
||||||
jQuery('#existing-categories').css('display','block');
|
jQuery('#existing-categories').css('display','block');
|
||||||
jQuery("#existing-categories dt:contains('" + data + "')").css("display", "block");
|
jQuery("#existing-categories dt:contains('" + data + "')").css("display", "block");
|
||||||
|
|
||||||
jQuery('#show-cats').hide();
|
jQuery('#show-cats').hide();
|
||||||
jQuery('#hide-cats').show();
|
jQuery('#hide-cats').show();
|
||||||
|
|
||||||
});
|
});
|
||||||
jQuery('#existing-categories').css('display','none');
|
jQuery('#existing-categories').css('display','none');
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<input type="text" onfocus="jQuery('#cat-search').attr('value','');" id="cat-search" value="Search Categories" />
|
<input type="text" onfocus="jQuery('#cat-search').attr('value','');" id="cat-search" value="Search Categories" />
|
||||||
|
|
||||||
<a id="show-cats" style="cursor:pointer;" onclick="jQuery('#existing-categories').css('display','block');jQuery('#cat-search').attr('value','');jQuery('#existing-categories dt').css('display','block');jQuery('#show-cats').hide();jQuery('#hide-cats').show();">View All</a>
|
<a id="show-cats" style="cursor:pointer;" onclick="jQuery('#existing-categories').css('display','block');jQuery('#cat-search').attr('value','');jQuery('#existing-categories dt').css('display','block');jQuery('#show-cats').hide();jQuery('#hide-cats').show();">View All</a>
|
||||||
<a id="hide-cats" style="cursor:pointer;" onclick="jQuery('#existing-categories').css('display','none');jQuery('#cat-search').attr('value','Search Categories');jQuery('#existing-categories dt').css('display','none');jQuery('#show-cats').show();jQuery('#hide-cats').hide();">Hide All</a>
|
<a id="hide-cats" style="cursor:pointer;" onclick="jQuery('#existing-categories').css('display','none');jQuery('#cat-search').attr('value','Search Categories');jQuery('#existing-categories dt').css('display','none');jQuery('#show-cats').show();jQuery('#hide-cats').hide();">Hide All</a>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
jQuery('#hide-cats').hide();
|
jQuery('#hide-cats').hide();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ul id="existing-categories" class="list">
|
<ul id="existing-categories" class="list">
|
||||||
<?php
|
<?php
|
||||||
//Get default Categories
|
//Get default Categories
|
||||||
$intCounter = wp_custom_nav_get_categories($intCounter,'default');
|
$intCounter = wp_custom_nav_get_categories($intCounter,'default');
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="fix"></div>
|
<div class="fix"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.widgets-holder-wrap -->
|
</div><!-- /.widgets-holder-wrap -->
|
||||||
|
|
||||||
<div class="widgets-holder-wrap">
|
<div class="widgets-holder-wrap">
|
||||||
<div class="sidebar-name">
|
<div class="sidebar-name">
|
||||||
<div class="sidebar-name-arrow"></div>
|
<div class="sidebar-name-arrow"></div>
|
||||||
@ -551,16 +551,16 @@ function wp_custom_navigation() {
|
|||||||
<div class="fix"></div>
|
<div class="fix"></div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.widgets-holder-wrap -->
|
</div><!-- /.widgets-holder-wrap -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.getElementById('pages-left').style.display='block';
|
document.getElementById('pages-left').style.display='block';
|
||||||
document.getElementById('menu-right').style.display='block';
|
document.getElementById('menu-right').style.display='block';
|
||||||
document.getElementById('no-js').style.display='none';
|
document.getElementById('no-js').style.display='none';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="dialog-confirm" title="Edit Menu Item">
|
<div id="dialog-confirm" title="Edit Menu Item">
|
||||||
</label><input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle">Menu Title</label><br />
|
</label><input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle">Menu Title</label><br />
|
||||||
<input id="editlink" type="text" name="editlink" value="" /><label class="editlabel" for="editlink">URL</label><br />
|
<input id="editlink" type="text" name="editlink" value="" /><label class="editlabel" for="editlink">URL</label><br />
|
||||||
|
@ -224,7 +224,7 @@ if ( empty($tags_per_page) || $tags_per_page < 1 )
|
|||||||
if ( 'post_tag' == $taxonomy ) {
|
if ( 'post_tag' == $taxonomy ) {
|
||||||
$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
|
$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
|
||||||
$tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
|
$tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
|
||||||
} elseif ( 'category' == $taxonomy ) {
|
} elseif ( 'category' == $taxonomy ) {
|
||||||
$tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter
|
$tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter
|
||||||
} else {
|
} else {
|
||||||
$tags_per_page = apply_filters( 'edit_' . $taxonomy . '_per_page', $tags_per_page );
|
$tags_per_page = apply_filters( 'edit_' . $taxonomy . '_per_page', $tags_per_page );
|
||||||
@ -304,10 +304,10 @@ if ( $page_links )
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php if ( 'category' == $taxonomy ) : ?>
|
<?php if ( 'category' == $taxonomy ) : ?>
|
||||||
<div class="form-wrap">
|
<div class="form-wrap">
|
||||||
<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?></p>
|
<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?></p>
|
||||||
<p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'admin.php?import=wp-cat2tag') ?></p>
|
<p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'admin.php?import=wp-cat2tag') ?></p>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* @package WordPress
|
* @package WordPress
|
||||||
* @subpackage Administration
|
* @subpackage Administration
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Init Functions
|
* Init Functions
|
||||||
*/
|
*/
|
||||||
@ -23,37 +23,37 @@ jQuery(function($)
|
|||||||
modal: true,
|
modal: true,
|
||||||
buttons: {
|
buttons: {
|
||||||
'Save': function() {
|
'Save': function() {
|
||||||
|
|
||||||
titletosave = $('#edittitle').attr('value');
|
titletosave = $('#edittitle').attr('value');
|
||||||
linktosave = $('#editlink').attr('value');
|
linktosave = $('#editlink').attr('value');
|
||||||
anchortitletosave = $('#editanchortitle').attr('value');
|
anchortitletosave = $('#editanchortitle').attr('value');
|
||||||
newwindowtosave = $('#editnewwindow').attr('value');
|
newwindowtosave = $('#editnewwindow').attr('value');
|
||||||
desctosave = $('#editdescription').attr('value');
|
desctosave = $('#editdescription').attr('value');
|
||||||
|
|
||||||
$('#title' + $(this).dialog('option', 'itemID')).attr('value',titletosave);
|
$('#title' + $(this).dialog('option', 'itemID')).attr('value',titletosave);
|
||||||
$('#linkurl' + $(this).dialog('option', 'itemID')).attr('value',linktosave);
|
$('#linkurl' + $(this).dialog('option', 'itemID')).attr('value',linktosave);
|
||||||
$('#anchortitle' + $(this).dialog('option', 'itemID')).attr('value',anchortitletosave);
|
$('#anchortitle' + $(this).dialog('option', 'itemID')).attr('value',anchortitletosave);
|
||||||
$('#newwindow' + $(this).dialog('option', 'itemID')).attr('value',newwindowtosave);
|
$('#newwindow' + $(this).dialog('option', 'itemID')).attr('value',newwindowtosave);
|
||||||
$('#description' + $(this).dialog('option', 'itemID')).attr('value',desctosave);
|
$('#description' + $(this).dialog('option', 'itemID')).attr('value',desctosave);
|
||||||
|
|
||||||
$('#menu-' + $(this).dialog('option', 'itemID') + ' > dl > dt > span.title').text(titletosave);
|
$('#menu-' + $(this).dialog('option', 'itemID') + ' > dl > dt > span.title').text(titletosave);
|
||||||
|
|
||||||
$('#view' + + $(this).dialog('option', 'itemID')).attr('href', linktosave);
|
$('#view' + + $(this).dialog('option', 'itemID')).attr('href', linktosave);
|
||||||
|
|
||||||
$(this).dialog('close');
|
$(this).dialog('close');
|
||||||
|
|
||||||
},
|
},
|
||||||
Cancel: function() {
|
Cancel: function() {
|
||||||
$(this).dialog('close');
|
$(this).dialog('close');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ $(this).remove();});
|
$('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ $(this).remove();});
|
||||||
|
|
||||||
//Add dropzone
|
//Add dropzone
|
||||||
$('#custom-nav li').prepend('<div class="dropzone"></div>');
|
$('#custom-nav li').prepend('<div class="dropzone"></div>');
|
||||||
|
|
||||||
//Make li items draggable
|
//Make li items draggable
|
||||||
$('#custom-nav li').draggable({
|
$('#custom-nav li').draggable({
|
||||||
handle: ' > dl',
|
handle: ' > dl',
|
||||||
@ -68,70 +68,70 @@ jQuery(function($)
|
|||||||
{
|
{
|
||||||
accept: '#custom-nav li',
|
accept: '#custom-nav li',
|
||||||
tolerance: 'pointer',
|
tolerance: 'pointer',
|
||||||
drop: function(e, ui)
|
drop: function(e, ui)
|
||||||
{
|
{
|
||||||
var li = $(this).parent();
|
var li = $(this).parent();
|
||||||
var child = !$(this).hasClass('dropzone');
|
var child = !$(this).hasClass('dropzone');
|
||||||
//Add UL to first child
|
//Add UL to first child
|
||||||
if (child && li.children('ul').length == 0)
|
if (child && li.children('ul').length == 0)
|
||||||
{
|
{
|
||||||
li.append('<ul id="sub-menu" />');
|
li.append('<ul id="sub-menu" />');
|
||||||
}
|
}
|
||||||
//Make it draggable
|
//Make it draggable
|
||||||
if (child)
|
if (child)
|
||||||
{
|
{
|
||||||
li.children('ul').append(ui.draggable);
|
li.children('ul').append(ui.draggable);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
li.before(ui.draggable);
|
li.before(ui.draggable);
|
||||||
}
|
}
|
||||||
|
|
||||||
li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
|
li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
|
||||||
|
|
||||||
var draggablevalue = ui.draggable.attr('value');
|
var draggablevalue = ui.draggable.attr('value');
|
||||||
var droppablevalue = li.attr('value');
|
var droppablevalue = li.attr('value');
|
||||||
li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
|
li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
|
||||||
$(this).parent().find("dt").removeAttr('style');
|
$(this).parent().find("dt").removeAttr('style');
|
||||||
$(this).parent().find("div:first").removeAttr('style');
|
$(this).parent().find("div:first").removeAttr('style');
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
over: function()
|
over: function()
|
||||||
{
|
{
|
||||||
//Add child
|
//Add child
|
||||||
if ($(this).attr('class') == 'dropzone ui-droppable')
|
if ($(this).attr('class') == 'dropzone ui-droppable')
|
||||||
{
|
{
|
||||||
$(this).parent().find("div:first").css('background', 'none').css('height', '50px');
|
$(this).parent().find("div:first").css('background', 'none').css('height', '50px');
|
||||||
}
|
}
|
||||||
//Add above
|
//Add above
|
||||||
else if ($(this).attr('class') == 'ui-droppable')
|
else if ($(this).attr('class') == 'ui-droppable')
|
||||||
{
|
{
|
||||||
$(this).parent().find("dt:first").css('background', '#d8d8d8');
|
$(this).parent().find("dt:first").css('background', '#d8d8d8');
|
||||||
}
|
}
|
||||||
//do nothing
|
//do nothing
|
||||||
else {
|
else {
|
||||||
|
|
||||||
}
|
}
|
||||||
var parentid = $(this).parent().attr('id');
|
var parentid = $(this).parent().attr('id');
|
||||||
|
|
||||||
},
|
},
|
||||||
out: function()
|
out: function()
|
||||||
{
|
{
|
||||||
$(this).parent().find("dt").removeAttr('style');
|
$(this).parent().find("dt").removeAttr('style');
|
||||||
$(this).parent().find("div:first").removeAttr('style');
|
$(this).parent().find("div:first").removeAttr('style');
|
||||||
$(this).filter('.dropzone').css({ borderColor: '' });
|
$(this).filter('.dropzone').css({ borderColor: '' });
|
||||||
},
|
},
|
||||||
deactivate: function()
|
deactivate: function()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//Handle Save Button Clicks
|
//Handle Save Button Clicks
|
||||||
$('#save_top').click(function()
|
$('#save_top').click(function()
|
||||||
{
|
{
|
||||||
updatepostdata();
|
updatepostdata();
|
||||||
@ -140,7 +140,7 @@ jQuery(function($)
|
|||||||
{
|
{
|
||||||
updatepostdata();
|
updatepostdata();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -8,22 +8,22 @@
|
|||||||
* @package WordPress
|
* @package WordPress
|
||||||
* @subpackage Administration
|
* @subpackage Administration
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Removes menu items from current menu
|
* Removes menu items from current menu
|
||||||
* @param int o - the id of the menu li to remove.
|
* @param int o - the id of the menu li to remove.
|
||||||
*/
|
*/
|
||||||
function removeitem(o)
|
function removeitem(o)
|
||||||
{
|
{
|
||||||
|
|
||||||
var todelete = document.getElementById('menu-' + o);
|
var todelete = document.getElementById('menu-' + o);
|
||||||
|
|
||||||
if (todelete)
|
if (todelete)
|
||||||
{
|
{
|
||||||
var parenttodelete = document.getElementById('menu-' + o).parentNode;
|
var parenttodelete = document.getElementById('menu-' + o).parentNode;
|
||||||
throwaway_node = parenttodelete.removeChild(todelete);
|
throwaway_node = parenttodelete.removeChild(todelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
updatepostdata();
|
updatepostdata();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -31,50 +31,50 @@ function removeitem(o)
|
|||||||
* Loads dialog window to edit menu items from current menu
|
* Loads dialog window to edit menu items from current menu
|
||||||
* @param int o - the id of the menu li to edit.
|
* @param int o - the id of the menu li to edit.
|
||||||
*/
|
*/
|
||||||
function edititem(o)
|
function edititem(o)
|
||||||
{
|
{
|
||||||
|
|
||||||
itemTitle = jQuery('#title' + o).attr('value');
|
itemTitle = jQuery('#title' + o).attr('value');
|
||||||
itemURL = jQuery('#linkurl' + o).attr('value');
|
itemURL = jQuery('#linkurl' + o).attr('value');
|
||||||
itemAnchorTitle = jQuery('#anchortitle' + o).attr('value');
|
itemAnchorTitle = jQuery('#anchortitle' + o).attr('value');
|
||||||
itemNewWindow = jQuery('#newwindow' + o).attr('value');
|
itemNewWindow = jQuery('#newwindow' + o).attr('value');
|
||||||
itemDesc = jQuery('#description' + o).attr('value');
|
itemDesc = jQuery('#description' + o).attr('value');
|
||||||
|
|
||||||
jQuery('#dialog-confirm').dialog( 'option' , 'itemID' , o )
|
jQuery('#dialog-confirm').dialog( 'option' , 'itemID' , o )
|
||||||
|
|
||||||
jQuery('#dialog-confirm').dialog('open');
|
jQuery('#dialog-confirm').dialog('open');
|
||||||
|
|
||||||
jQuery('#edittitle').attr('value', itemTitle);
|
jQuery('#edittitle').attr('value', itemTitle);
|
||||||
jQuery('#editlink').attr('value', itemURL);
|
jQuery('#editlink').attr('value', itemURL);
|
||||||
jQuery('#editanchortitle').attr('value', itemAnchorTitle);
|
jQuery('#editanchortitle').attr('value', itemAnchorTitle);
|
||||||
jQuery("#editnewwindow option[value='" + itemNewWindow + "']").attr('selected', 'selected');
|
jQuery("#editnewwindow option[value='" + itemNewWindow + "']").attr('selected', 'selected');
|
||||||
jQuery('#editdescription').attr('value', itemDesc);
|
jQuery('#editdescription').attr('value', itemDesc);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prepares menu items for POST
|
* Prepares menu items for POST
|
||||||
*/
|
*/
|
||||||
function updatepostdata()
|
function updatepostdata()
|
||||||
{
|
{
|
||||||
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
jQuery("#custom-nav").find("li").each(function(i) {
|
jQuery("#custom-nav").find("li").each(function(i) {
|
||||||
i = i + 1;
|
i = i + 1;
|
||||||
var j = jQuery(this).attr('value');
|
var j = jQuery(this).attr('value');
|
||||||
|
|
||||||
jQuery(this).find('#position' + j).attr('value', i);
|
jQuery(this).find('#position' + j).attr('value', i);
|
||||||
jQuery(this).attr('id','menu-' + i);
|
jQuery(this).attr('id','menu-' + i);
|
||||||
jQuery(this).attr('value', i);
|
jQuery(this).attr('value', i);
|
||||||
|
|
||||||
jQuery(this).find('#dbid' + j).attr('name','dbid' + i);
|
jQuery(this).find('#dbid' + j).attr('name','dbid' + i);
|
||||||
jQuery(this).find('#dbid' + j).attr('id','dbid' + i);
|
jQuery(this).find('#dbid' + j).attr('id','dbid' + i);
|
||||||
|
|
||||||
jQuery(this).find('#postmenu' + j).attr('name','postmenu' + i);
|
jQuery(this).find('#postmenu' + j).attr('name','postmenu' + i);
|
||||||
jQuery(this).find('#postmenu' + j).attr('id','postmenu' + i);
|
jQuery(this).find('#postmenu' + j).attr('id','postmenu' + i);
|
||||||
|
|
||||||
var p = jQuery(this).find('#parent' + j).parent().parent().parent().attr('value');
|
var p = jQuery(this).find('#parent' + j).parent().parent().parent().attr('value');
|
||||||
|
|
||||||
jQuery(this).find('#parent' + j).attr('name','parent' + i);
|
jQuery(this).find('#parent' + j).attr('name','parent' + i);
|
||||||
jQuery(this).find('#parent' + j).attr('id','parent' + i);
|
jQuery(this).find('#parent' + j).attr('id','parent' + i);
|
||||||
if (p) {
|
if (p) {
|
||||||
@ -84,33 +84,33 @@ function updatepostdata()
|
|||||||
//reset p to be top level
|
//reset p to be top level
|
||||||
p = 0;
|
p = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery(this).find('#parent' + j).attr('value', p);
|
jQuery(this).find('#parent' + j).attr('value', p);
|
||||||
|
|
||||||
jQuery(this).find('#title' + j).attr('name','title' + i);
|
jQuery(this).find('#title' + j).attr('name','title' + i);
|
||||||
jQuery(this).find('#title' + j).attr('id','title' + i);
|
jQuery(this).find('#title' + j).attr('id','title' + i);
|
||||||
|
|
||||||
jQuery(this).find('#linkurl' + j).attr('name','linkurl' + i);
|
jQuery(this).find('#linkurl' + j).attr('name','linkurl' + i);
|
||||||
jQuery(this).find('#linkurl' + j).attr('id','linkurl' + i);
|
jQuery(this).find('#linkurl' + j).attr('id','linkurl' + i);
|
||||||
|
|
||||||
jQuery(this).find('#description' + j).attr('name','description' + i);
|
jQuery(this).find('#description' + j).attr('name','description' + i);
|
||||||
jQuery(this).find('#description' + j).attr('id','description' + i);
|
jQuery(this).find('#description' + j).attr('id','description' + i);
|
||||||
|
|
||||||
jQuery(this).find('#icon' + j).attr('name','icon' + i);
|
jQuery(this).find('#icon' + j).attr('name','icon' + i);
|
||||||
jQuery(this).find('#icon' + j).attr('id','icon' + i);
|
jQuery(this).find('#icon' + j).attr('id','icon' + i);
|
||||||
|
|
||||||
jQuery(this).find('#position' + j).attr('name','position' + i);
|
jQuery(this).find('#position' + j).attr('name','position' + i);
|
||||||
jQuery(this).find('#position' + j).attr('id','position' + i);
|
jQuery(this).find('#position' + j).attr('id','position' + i);
|
||||||
|
|
||||||
jQuery(this).find('#linktype' + j).attr('name','linktype' + i);
|
jQuery(this).find('#linktype' + j).attr('name','linktype' + i);
|
||||||
jQuery(this).find('#linktype' + j).attr('id','linktype' + i);
|
jQuery(this).find('#linktype' + j).attr('id','linktype' + i);
|
||||||
|
|
||||||
jQuery(this).find('#anchortitle' + j).attr('name','anchortitle' + i);
|
jQuery(this).find('#anchortitle' + j).attr('name','anchortitle' + i);
|
||||||
jQuery(this).find('#anchortitle' + j).attr('id','anchortitle' + i);
|
jQuery(this).find('#anchortitle' + j).attr('id','anchortitle' + i);
|
||||||
|
|
||||||
jQuery(this).find('#newwindow' + j).attr('name','newwindow' + i);
|
jQuery(this).find('#newwindow' + j).attr('name','newwindow' + i);
|
||||||
jQuery(this).find('#newwindow' + j).attr('id','newwindow' + i);
|
jQuery(this).find('#newwindow' + j).attr('id','newwindow' + i);
|
||||||
|
|
||||||
jQuery(this).find('dl > dt > span > #remove' + j).attr('value', i);
|
jQuery(this).find('dl > dt > span > #remove' + j).attr('value', i);
|
||||||
jQuery(this).find('dl > dt > span > #remove' + j).attr('onClick', 'removeitem(' + i + ')');
|
jQuery(this).find('dl > dt > span > #remove' + j).attr('onClick', 'removeitem(' + i + ')');
|
||||||
jQuery(this).find('dl > dt > span > #remove' + j).attr('id','remove' + i);
|
jQuery(this).find('dl > dt > span > #remove' + j).attr('id','remove' + i);
|
||||||
@ -118,10 +118,10 @@ function updatepostdata()
|
|||||||
jQuery('#licount').attr('value',i);
|
jQuery('#licount').attr('value',i);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adds item from Page, Category, or Custom options menu
|
* Adds item from Page, Category, or Custom options menu
|
||||||
@ -132,8 +132,8 @@ function updatepostdata()
|
|||||||
* @param int itemid - menu id.
|
* @param int itemid - menu id.
|
||||||
* @param int itemparentid - default 0.
|
* @param int itemparentid - default 0.
|
||||||
* @param string itemdescription - the description of the menu item.
|
* @param string itemdescription - the description of the menu item.
|
||||||
*/
|
*/
|
||||||
function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparentid,itemdescription)
|
function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparentid,itemdescription)
|
||||||
{
|
{
|
||||||
var inputvaluevarname = '';
|
var inputvaluevarname = '';
|
||||||
var inputvaluevarurl = '';
|
var inputvaluevarurl = '';
|
||||||
@ -142,7 +142,7 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
|
|||||||
var inputdescription = '';
|
var inputdescription = '';
|
||||||
var inputicon = '';
|
var inputicon = '';
|
||||||
|
|
||||||
if (additemtype == 'Custom')
|
if (additemtype == 'Custom')
|
||||||
{
|
{
|
||||||
inputvaluevarname = document.getElementById('custom_menu_item_name').value;
|
inputvaluevarname = document.getElementById('custom_menu_item_name').value;
|
||||||
inputvaluevarurl = document.getElementById('custom_menu_item_url').value;
|
inputvaluevarurl = document.getElementById('custom_menu_item_url').value;
|
||||||
@ -159,7 +159,7 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
|
|||||||
inputparentid = '0';
|
inputparentid = '0';
|
||||||
inputlinktype = 'page';
|
inputlinktype = 'page';
|
||||||
inputdescription = htmlentities(itemdescription.toString());
|
inputdescription = htmlentities(itemdescription.toString());
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (additemtype == 'Category')
|
else if (additemtype == 'Category')
|
||||||
{
|
{
|
||||||
@ -170,7 +170,7 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
|
|||||||
inputlinktype = 'category';
|
inputlinktype = 'category';
|
||||||
inputdescription = htmlentities(itemdescription.toString());
|
inputdescription = htmlentities(itemdescription.toString());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
inputvaluevarname = '';
|
inputvaluevarname = '';
|
||||||
inputvaluevarname = '';
|
inputvaluevarname = '';
|
||||||
@ -179,40 +179,40 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
|
|||||||
inputlinktype = 'custom';
|
inputlinktype = 'custom';
|
||||||
inputdescription = '';
|
inputdescription = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
var count=document.getElementById('custom-nav').getElementsByTagName('li').length;
|
var count=document.getElementById('custom-nav').getElementsByTagName('li').length;
|
||||||
|
|
||||||
var randomnumber = count;
|
var randomnumber = count;
|
||||||
|
|
||||||
var validatetest = 0;
|
var validatetest = 0;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var test=document.getElementById("menu-" + randomnumber.toString()).value;
|
var test=document.getElementById("menu-" + randomnumber.toString()).value;
|
||||||
}
|
}
|
||||||
catch (err)
|
catch (err)
|
||||||
{
|
{
|
||||||
validatetest = 1;
|
validatetest = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (validatetest == 0)
|
while (validatetest == 0)
|
||||||
{
|
{
|
||||||
randomnumber = randomnumber + 1;
|
randomnumber = randomnumber + 1;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var test2=document.getElementById("menu-" + randomnumber.toString()).value;
|
var test2=document.getElementById("menu-" + randomnumber.toString()).value;
|
||||||
}
|
}
|
||||||
catch (err)
|
catch (err)
|
||||||
{
|
{
|
||||||
validatetest = 1;
|
validatetest = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Notification Message
|
//Notification Message
|
||||||
jQuery('.maintitle').after('<div id="message" class="updated fade below-h2"><p>Menu Item added!</p></div>');
|
jQuery('.maintitle').after('<div id="message" class="updated fade below-h2"><p>Menu Item added!</p></div>');
|
||||||
jQuery('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ jQuery(this).remove();});
|
jQuery('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ jQuery(this).remove();});
|
||||||
|
|
||||||
//Appends HTML to the menu
|
//Appends HTML to the menu
|
||||||
jQuery('#custom-nav').append('<li id="menu-' + randomnumber + '" value="' + randomnumber + '"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="title">' + inputvaluevarname + '</span><span class="controls"><span class="type">' + additemtype + '</span><a id="edit' + randomnumber + '" onclick="edititem(' + randomnumber + ')" value="' + randomnumber +'"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="' + templatedir + '/wp-admin/images/ico-edit.png" /></a> <a id="remove' + randomnumber + '" onclick="removeitem(' + randomnumber + ')" value="' + randomnumber +'"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="' + templatedir + '/wp-admin/images/ico-close.png" /></a> <a href="' + inputvaluevarurl + '" target="_blank"><img alt="View Custom Link" title="View Custom Link" src="' + templatedir + '/wp-admin/images/ico-viewpage.png" /></a></span></dt></dl><a class="hide" href="' + inputvaluevarurl + '">' + inputvaluevarname + '</a><input type="hidden" name="postmenu' + randomnumber + '" id="postmenu' + randomnumber + '" value="' + inputitemid + '" /><input type="hidden" name="parent' + randomnumber + '" id="parent' + randomnumber + '" value="' + inputparentid + '" /><input type="hidden" name="title' + randomnumber + '" id="title' + randomnumber + '" value="' + inputvaluevarname + '" /><input type="hidden" name="linkurl' + randomnumber + '" id="linkurl' + randomnumber + '" value="' + inputvaluevarurl + '" /><input type="hidden" name="description' + randomnumber + '" id="description' + randomnumber + '" value="' + inputdescription + '" /><input type="hidden" name="icon' + randomnumber + '" id="icon' + randomnumber + '" value="' + inputicon + '" /><input type="hidden" name="position' + randomnumber + '" id="position' + randomnumber + '" value="' + randomnumber + '" /><input type="hidden" name="linktype' + randomnumber + '" id="linktype' + randomnumber + '" value="' + inputlinktype + '" /><input type="hidden" name="anchortitle' + randomnumber + '" id="anchortitle' + randomnumber + '" value="' + inputvaluevarname + '" /><input type="hidden" name="newwindow' + randomnumber + '" id="newwindow' + randomnumber + '" value="0" /></li>');
|
jQuery('#custom-nav').append('<li id="menu-' + randomnumber + '" value="' + randomnumber + '"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="title">' + inputvaluevarname + '</span><span class="controls"><span class="type">' + additemtype + '</span><a id="edit' + randomnumber + '" onclick="edititem(' + randomnumber + ')" value="' + randomnumber +'"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="' + templatedir + '/wp-admin/images/ico-edit.png" /></a> <a id="remove' + randomnumber + '" onclick="removeitem(' + randomnumber + ')" value="' + randomnumber +'"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="' + templatedir + '/wp-admin/images/ico-close.png" /></a> <a href="' + inputvaluevarurl + '" target="_blank"><img alt="View Custom Link" title="View Custom Link" src="' + templatedir + '/wp-admin/images/ico-viewpage.png" /></a></span></dt></dl><a class="hide" href="' + inputvaluevarurl + '">' + inputvaluevarname + '</a><input type="hidden" name="postmenu' + randomnumber + '" id="postmenu' + randomnumber + '" value="' + inputitemid + '" /><input type="hidden" name="parent' + randomnumber + '" id="parent' + randomnumber + '" value="' + inputparentid + '" /><input type="hidden" name="title' + randomnumber + '" id="title' + randomnumber + '" value="' + inputvaluevarname + '" /><input type="hidden" name="linkurl' + randomnumber + '" id="linkurl' + randomnumber + '" value="' + inputvaluevarurl + '" /><input type="hidden" name="description' + randomnumber + '" id="description' + randomnumber + '" value="' + inputdescription + '" /><input type="hidden" name="icon' + randomnumber + '" id="icon' + randomnumber + '" value="' + inputicon + '" /><input type="hidden" name="position' + randomnumber + '" id="position' + randomnumber + '" value="' + randomnumber + '" /><input type="hidden" name="linktype' + randomnumber + '" id="linktype' + randomnumber + '" value="' + inputlinktype + '" /><input type="hidden" name="anchortitle' + randomnumber + '" id="anchortitle' + randomnumber + '" value="' + inputvaluevarname + '" /><input type="hidden" name="newwindow' + randomnumber + '" id="newwindow' + randomnumber + '" value="0" /></li>');
|
||||||
|
|
||||||
@ -230,54 +230,54 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
|
|||||||
jQuery('#menu-' + randomnumber + ' dl, #menu-' + randomnumber + ' .dropzone').droppable({
|
jQuery('#menu-' + randomnumber + ' dl, #menu-' + randomnumber + ' .dropzone').droppable({
|
||||||
accept: '#' + randomnumber + ', #custom-nav li',
|
accept: '#' + randomnumber + ', #custom-nav li',
|
||||||
tolerance: 'pointer',
|
tolerance: 'pointer',
|
||||||
drop: function(e, ui)
|
drop: function(e, ui)
|
||||||
{
|
{
|
||||||
var li = jQuery(this).parent();
|
var li = jQuery(this).parent();
|
||||||
var child = !jQuery(this).hasClass('dropzone');
|
var child = !jQuery(this).hasClass('dropzone');
|
||||||
//Append UL to first child
|
//Append UL to first child
|
||||||
if (child && li.children('ul').length == 0)
|
if (child && li.children('ul').length == 0)
|
||||||
{
|
{
|
||||||
li.append('<ul/>');
|
li.append('<ul/>');
|
||||||
}
|
}
|
||||||
//Make it draggable
|
//Make it draggable
|
||||||
if (child)
|
if (child)
|
||||||
{
|
{
|
||||||
li.children('ul').append(ui.draggable);
|
li.children('ul').append(ui.draggable);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
li.before(ui.draggable);
|
li.before(ui.draggable);
|
||||||
}
|
}
|
||||||
|
|
||||||
li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
|
li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
|
||||||
|
|
||||||
var draggablevalue = ui.draggable.attr('value');
|
var draggablevalue = ui.draggable.attr('value');
|
||||||
var droppablevalue = li.attr('value');
|
var droppablevalue = li.attr('value');
|
||||||
li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
|
li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
|
||||||
jQuery(this).parent().find("dt").removeAttr('style');
|
jQuery(this).parent().find("dt").removeAttr('style');
|
||||||
jQuery(this).parent().find("div:first").removeAttr('style');
|
jQuery(this).parent().find("div:first").removeAttr('style');
|
||||||
|
|
||||||
},
|
},
|
||||||
over: function()
|
over: function()
|
||||||
{
|
{
|
||||||
//Add child
|
//Add child
|
||||||
if (jQuery(this).attr('class') == 'dropzone ui-droppable')
|
if (jQuery(this).attr('class') == 'dropzone ui-droppable')
|
||||||
{
|
{
|
||||||
jQuery(this).parent().find("div:first").css('background', 'none').css('height', '50px');
|
jQuery(this).parent().find("div:first").css('background', 'none').css('height', '50px');
|
||||||
}
|
}
|
||||||
//Add above
|
//Add above
|
||||||
else if (jQuery(this).attr('class') == 'ui-droppable')
|
else if (jQuery(this).attr('class') == 'ui-droppable')
|
||||||
{
|
{
|
||||||
jQuery(this).parent().find("dt:first").css('background', '#d8d8d8');
|
jQuery(this).parent().find("dt:first").css('background', '#d8d8d8');
|
||||||
}
|
}
|
||||||
//do nothing
|
//do nothing
|
||||||
else {
|
else {
|
||||||
|
|
||||||
}
|
}
|
||||||
var parentid = jQuery(this).parent().attr('id');
|
var parentid = jQuery(this).parent().attr('id');
|
||||||
|
|
||||||
},
|
},
|
||||||
out: function()
|
out: function()
|
||||||
{
|
{
|
||||||
jQuery(this).parent().find("dt").removeAttr('style');
|
jQuery(this).parent().find("dt").removeAttr('style');
|
||||||
jQuery(this).parent().find("div:first").removeAttr('style');
|
jQuery(this).parent().find("div:first").removeAttr('style');
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* More info at: http://phpjs.org
|
* More info at: http://phpjs.org
|
||||||
*
|
*
|
||||||
* This is version: 3.08
|
* This is version: 3.08
|
||||||
* php.js is copyright 2010 Kevin van Zonneveld.
|
* php.js is copyright 2010 Kevin van Zonneveld.
|
||||||
*
|
*
|
||||||
* Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld
|
* Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld
|
||||||
* (http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White
|
* (http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White
|
||||||
* (http://getsprink.com), Waldo Malqui Silva, Paulo Ricardo F. Santos, Jack,
|
* (http://getsprink.com), Waldo Malqui Silva, Paulo Ricardo F. Santos, Jack,
|
||||||
@ -84,10 +84,10 @@
|
|||||||
* taith, Matt Bradley, FremyCompany, T.J. Leahy, Greg Frazier, Valentina De
|
* taith, Matt Bradley, FremyCompany, T.J. Leahy, Greg Frazier, Valentina De
|
||||||
* Rosa, Tod Gentille, Riddler (http://www.frontierwebdev.com/), Alexander M
|
* Rosa, Tod Gentille, Riddler (http://www.frontierwebdev.com/), Alexander M
|
||||||
* Beedie
|
* Beedie
|
||||||
*
|
*
|
||||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||||
* and GPL (GPL-LICENSE.txt) licenses.
|
* and GPL (GPL-LICENSE.txt) licenses.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the
|
* copy of this software and associated documentation files (the
|
||||||
* "Software"), to deal in the Software without restriction, including
|
* "Software"), to deal in the Software without restriction, including
|
||||||
@ -95,10 +95,10 @@
|
|||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
* the following conditions:
|
* the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included
|
* The above copyright notice and this permission notice shall be included
|
||||||
* in all copies or substantial portions of the Software.
|
* in all copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
@ -106,7 +106,7 @@
|
|||||||
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function get_html_translation_table (table, quote_style) {
|
function get_html_translation_table (table, quote_style) {
|
||||||
// http://kevin.vanzonneveld.net
|
// http://kevin.vanzonneveld.net
|
||||||
@ -128,11 +128,11 @@ function get_html_translation_table (table, quote_style) {
|
|||||||
// % note: chooses to create the constants themselves.
|
// % note: chooses to create the constants themselves.
|
||||||
// * example 1: get_html_translation_table('HTML_SPECIALCHARS');
|
// * example 1: get_html_translation_table('HTML_SPECIALCHARS');
|
||||||
// * returns 1: {'"': '"', '&': '&', '<': '<', '>': '>'}
|
// * returns 1: {'"': '"', '&': '&', '<': '<', '>': '>'}
|
||||||
|
|
||||||
var entities = {}, hash_map = {}, decimal = 0, symbol = '';
|
var entities = {}, hash_map = {}, decimal = 0, symbol = '';
|
||||||
var constMappingTable = {}, constMappingQuoteStyle = {};
|
var constMappingTable = {}, constMappingQuoteStyle = {};
|
||||||
var useTable = {}, useQuoteStyle = {};
|
var useTable = {}, useQuoteStyle = {};
|
||||||
|
|
||||||
// Translate arguments
|
// Translate arguments
|
||||||
constMappingTable[0] = 'HTML_SPECIALCHARS';
|
constMappingTable[0] = 'HTML_SPECIALCHARS';
|
||||||
constMappingTable[1] = 'HTML_ENTITIES';
|
constMappingTable[1] = 'HTML_ENTITIES';
|
||||||
@ -263,7 +263,7 @@ function get_html_translation_table (table, quote_style) {
|
|||||||
symbol = String.fromCharCode(decimal);
|
symbol = String.fromCharCode(decimal);
|
||||||
hash_map[symbol] = entities[decimal];
|
hash_map[symbol] = entities[decimal];
|
||||||
}
|
}
|
||||||
|
|
||||||
return hash_map;
|
return hash_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ function htmlentities (string, quote_style) {
|
|||||||
|
|
||||||
var hash_map = {}, symbol = '', tmp_str = '', entity = '';
|
var hash_map = {}, symbol = '', tmp_str = '', entity = '';
|
||||||
tmp_str = string.toString();
|
tmp_str = string.toString();
|
||||||
|
|
||||||
if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) {
|
if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -295,6 +295,6 @@ function htmlentities (string, quote_style) {
|
|||||||
entity = hash_map[symbol];
|
entity = hash_map[symbol];
|
||||||
tmp_str = tmp_str.split(symbol).join(entity);
|
tmp_str = tmp_str.split(symbol).join(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
return tmp_str;
|
return tmp_str;
|
||||||
}
|
}
|
@ -38,7 +38,7 @@ jQuery(document).ready(function($) {
|
|||||||
if ( ! res )
|
if ( ! res )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var parent = form.find('select#parent').val();
|
var parent = form.find('select#parent').val();
|
||||||
|
|
||||||
if ( parent > 0 && $('#tag-' + parent ).length > 0 ) // If the parent exists on this page, insert it below. Else insert it at the top of the list.
|
if ( parent > 0 && $('#tag-' + parent ).length > 0 ) // If the parent exists on this page, insert it below. Else insert it at the top of the list.
|
||||||
$('#the-list #tag-' + parent).after( res.responses[0].supplemental['noparents'] ); // As the parent exists, Insert the version with - - - prefixed
|
$('#the-list #tag-' + parent).after( res.responses[0].supplemental['noparents'] ); // As the parent exists, Insert the version with - - - prefixed
|
||||||
|
@ -545,10 +545,10 @@ function print_plugins_table($plugins, $context = '') {
|
|||||||
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
|
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
|
||||||
if ( is_multisite() && is_super_admin() )
|
if ( is_multisite() && is_super_admin() )
|
||||||
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
|
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
|
||||||
|
|
||||||
if ( !is_multisite() && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
|
if ( !is_multisite() && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
|
||||||
$actions[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
|
$actions[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
|
||||||
|
|
||||||
if ( ! $is_active && current_user_can('delete_plugins') )
|
if ( ! $is_active && current_user_can('delete_plugins') )
|
||||||
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
|
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
|
|||||||
$redirect['query'] = remove_query_arg( array( 'category_name', 'tag', 'cat', 'tag_id', 'term', 'taxonomy'), $redirect['query']);
|
$redirect['query'] = remove_query_arg( array( 'category_name', 'tag', 'cat', 'tag_id', 'term', 'taxonomy'), $redirect['query']);
|
||||||
if ( is_tax() ) { // Custom taxonomies will have a custom query var, remove those too:
|
if ( is_tax() ) { // Custom taxonomies will have a custom query var, remove those too:
|
||||||
$tax = get_taxonomy( $obj->taxonomy );
|
$tax = get_taxonomy( $obj->taxonomy );
|
||||||
if ( false !== $tax->query_var)
|
if ( false !== $tax->query_var)
|
||||||
$redirect['query'] = remove_query_arg($tax->query_var, $redirect['query']);
|
$redirect['query'] = remove_query_arg($tax->query_var, $redirect['query']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,12 +364,12 @@ function wp_dropdown_categories( $args = '' ) {
|
|||||||
$output = "<select name='$name' id='$name' class='$class' $tab_index_attribute>\n";
|
$output = "<select name='$name' id='$name' class='$class' $tab_index_attribute>\n";
|
||||||
else
|
else
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
if ( empty($categories) && ! $r['hide_if_empty'] && !empty($show_option_none) ) {
|
if ( empty($categories) && ! $r['hide_if_empty'] && !empty($show_option_none) ) {
|
||||||
$show_option_none = apply_filters( 'list_cats', $show_option_none );
|
$show_option_none = apply_filters( 'list_cats', $show_option_none );
|
||||||
$output .= "\t<option value='-1' selected='selected'>$show_option_none</option>\n";
|
$output .= "\t<option value='-1' selected='selected'>$show_option_none</option>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! empty( $categories ) ) {
|
if ( ! empty( $categories ) ) {
|
||||||
|
|
||||||
if ( $show_option_all ) {
|
if ( $show_option_all ) {
|
||||||
|
@ -1469,13 +1469,13 @@ function comment_form( $args = array(), $post_id = null ) {
|
|||||||
$defaults = array( 'fields' => apply_filters( 'comment_form_default_fields', array( 'author' => '<p class="comment-form-author">' .
|
$defaults = array( 'fields' => apply_filters( 'comment_form_default_fields', array( 'author' => '<p class="comment-form-author">' .
|
||||||
'<label for="author">' . __( 'Name' ) . '</label> ' .
|
'<label for="author">' . __( 'Name' ) . '</label> ' .
|
||||||
( $req ? '<span class="required">*</span>' : '' ) .
|
( $req ? '<span class="required">*</span>' : '' ) .
|
||||||
'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" tabindex="1"' . $aria_req . ' />' .
|
'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" tabindex="1"' . $aria_req . ' />' .
|
||||||
'</p><!-- #form-section-author .form-section -->',
|
'</p><!-- #form-section-author .form-section -->',
|
||||||
'email' => '<p class="comment-form-email">' .
|
'email' => '<p class="comment-form-email">' .
|
||||||
'<label for="email">' . __( 'Email' ) . '</label> ' .
|
'<label for="email">' . __( 'Email' ) . '</label> ' .
|
||||||
( $req ? '<span class="required">*</span>' : '' ) .
|
( $req ? '<span class="required">*</span>' : '' ) .
|
||||||
'<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" tabindex="2"' . $aria_req . ' />' .
|
'<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" tabindex="2"' . $aria_req . ' />' .
|
||||||
'</p><!-- #form-section-email .form-section -->',
|
'</p><!-- #form-section-email .form-section -->',
|
||||||
'url' => '<p class="comment-form-url">' .
|
'url' => '<p class="comment-form-url">' .
|
||||||
'<label for="url">' . __( 'Website' ) . '</label>' .
|
'<label for="url">' . __( 'Website' ) . '</label>' .
|
||||||
'<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" tabindex="3" />' .
|
'<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" tabindex="3" />' .
|
||||||
@ -1486,7 +1486,7 @@ function comment_form( $args = array(), $post_id = null ) {
|
|||||||
'</p><!-- #form-section-comment .form-section -->',
|
'</p><!-- #form-section-comment .form-section -->',
|
||||||
'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
|
'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
|
||||||
'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%s">%s</a>. <a href="%s" title="Log out of this account">Log out?</a></p>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ),
|
'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%s">%s</a>. <a href="%s" title="Log out of this account">Log out?</a></p>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ),
|
||||||
'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email is <em>never</em> published nor shared.' ) . ( $req ? __( ' Required fields are marked <span class="required">*</span>' ) : '' ) . '</p>',
|
'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email is <em>never</em> published nor shared.' ) . ( $req ? __( ' Required fields are marked <span class="required">*</span>' ) : '' ) . '</p>',
|
||||||
'comment_notes_after' => '<dl class="form-allowed-tags"><dt>' . __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:' ) . '</dt> <dd><code>' . allowed_tags() . '</code></dd></dl>',
|
'comment_notes_after' => '<dl class="form-allowed-tags"><dt>' . __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:' ) . '</dt> <dd><code>' . allowed_tags() . '</code></dd></dl>',
|
||||||
'id_form' => 'commentform',
|
'id_form' => 'commentform',
|
||||||
'id_submit' => 'submit',
|
'id_submit' => 'submit',
|
||||||
|
@ -31,10 +31,10 @@ function wp_custom_navigation_get_menu_items( $menu_objects, $key = 'ID' ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function wp_custom_navigation_setup($override = false) {
|
function wp_custom_navigation_setup($override = false) {
|
||||||
|
|
||||||
$nav_version = '1.1.0';
|
$nav_version = '1.1.0';
|
||||||
//Custom Navigation Menu Setup
|
//Custom Navigation Menu Setup
|
||||||
|
|
||||||
//Check for Upgrades
|
//Check for Upgrades
|
||||||
if (get_option('wp_settings_custom_nav_version') <> '') {
|
if (get_option('wp_settings_custom_nav_version') <> '') {
|
||||||
$nav_version_in_db = get_option('wp_settings_custom_nav_version');
|
$nav_version_in_db = get_option('wp_settings_custom_nav_version');
|
||||||
@ -42,11 +42,11 @@ function wp_custom_navigation_setup($override = false) {
|
|||||||
else {
|
else {
|
||||||
$nav_version_in_db = '0';
|
$nav_version_in_db = '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
//Override for menu descriptions
|
//Override for menu descriptions
|
||||||
update_option('wp_settings_custom_nav_advanced_options','yes');
|
update_option('wp_settings_custom_nav_advanced_options','yes');
|
||||||
|
|
||||||
if(($nav_version_in_db <> $nav_version) || ($override))
|
if(($nav_version_in_db <> $nav_version) || ($override))
|
||||||
update_option('wp_settings_custom_nav_version',$nav_version);
|
update_option('wp_settings_custom_nav_version',$nav_version);
|
||||||
|
|
||||||
$custom_menus = get_terms( 'menu', array( 'hide_empty' => false ) );
|
$custom_menus = get_terms( 'menu', array( 'hide_empty' => false ) );
|
||||||
@ -84,20 +84,20 @@ function wp_custom_navigation_setup($override = false) {
|
|||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
function wp_custom_navigation_output($args = array()) {
|
function wp_custom_navigation_output($args = array()) {
|
||||||
|
|
||||||
//DEFAULT ARGS
|
//DEFAULT ARGS
|
||||||
$type = 'frontend';
|
$type = 'frontend';
|
||||||
$name = 'Menu 1';
|
$name = 'Menu 1';
|
||||||
$id = 0;
|
$id = 0;
|
||||||
$desc = 2;
|
$desc = 2;
|
||||||
$before_title = '';
|
$before_title = '';
|
||||||
$after_title = '';
|
$after_title = '';
|
||||||
|
|
||||||
if (isset($args)) {
|
if (isset($args)) {
|
||||||
|
|
||||||
if ( !is_array($args) )
|
if ( !is_array($args) )
|
||||||
parse_str( $args, $args );
|
parse_str( $args, $args );
|
||||||
|
|
||||||
extract($args);
|
extract($args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ function wp_custom_navigation_output($args = array()) {
|
|||||||
{
|
{
|
||||||
$desc = 2;
|
$desc = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
$queried_id = 0;
|
$queried_id = 0;
|
||||||
global $wp_query;
|
global $wp_query;
|
||||||
if ( is_page() )
|
if ( is_page() )
|
||||||
@ -145,14 +145,14 @@ function wp_custom_navigation_output($args = array()) {
|
|||||||
$link = get_category_link( $menu_item->post_parent );
|
$link = get_category_link( $menu_item->post_parent );
|
||||||
else
|
else
|
||||||
$link = $menu_item->guid;
|
$link = $menu_item->guid;
|
||||||
|
|
||||||
if ( $menu_item->post_title == '' ) {
|
if ( $menu_item->post_title == '' ) {
|
||||||
$title_raw = get_categories( 'include='.$menu_item->post_parent );
|
$title_raw = get_categories( 'include='.$menu_item->post_parent );
|
||||||
$title = htmlentities($title_raw[0]->cat_name);
|
$title = htmlentities($title_raw[0]->cat_name);
|
||||||
} else {
|
} else {
|
||||||
$title = htmlentities( $menu_item->post_title );
|
$title = htmlentities( $menu_item->post_title );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $menu_item->post_content == '' )
|
if ( $menu_item->post_content == '' )
|
||||||
$description = htmlentities( strip_tags( category_description( $menu_item->post_parent ) ) );
|
$description = htmlentities( strip_tags( category_description( $menu_item->post_parent ) ) );
|
||||||
else
|
else
|
||||||
@ -176,14 +176,14 @@ function wp_custom_navigation_output($args = array()) {
|
|||||||
else {
|
else {
|
||||||
$anchor_title = $title;
|
$anchor_title = $title;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($queried_id == $wp_custom_nav_menu_items->post_id) {
|
if ($queried_id == $wp_custom_nav_menu_items->post_id) {
|
||||||
$li_class = 'class="current_page_item"';
|
$li_class = 'class="current_page_item"';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$li_class = '';
|
$li_class = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($wp_custom_nav_menu_items->new_window)) {
|
if (isset($wp_custom_nav_menu_items->new_window)) {
|
||||||
if ($wp_custom_nav_menu_items->new_window > 0) {
|
if ($wp_custom_nav_menu_items->new_window > 0) {
|
||||||
$target = 'target="_blank"';
|
$target = 'target="_blank"';
|
||||||
@ -192,30 +192,30 @@ function wp_custom_navigation_output($args = array()) {
|
|||||||
$target = '';
|
$target = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
//List Items
|
//List Items
|
||||||
?><li id="menu-<?php echo $menu_item->ID; ?>" value="<?php echo $menu_item->ID; ?>" <?php echo $li_class; ?>><?php
|
?><li id="menu-<?php echo $menu_item->ID; ?>" value="<?php echo $menu_item->ID; ?>" <?php echo $li_class; ?>><?php
|
||||||
//@todo: update front end to use post data
|
//@todo: update front end to use post data
|
||||||
//FRONTEND Link
|
//FRONTEND Link
|
||||||
if ($type == "frontend")
|
if ($type == "frontend")
|
||||||
{
|
{
|
||||||
?><a title="<?php echo $anchor_title; ?>" href="<?php echo $link; ?>" <?php echo $target; ?>><?php echo $before_title.$title.$after_title; ?><?php
|
?><a title="<?php echo $anchor_title; ?>" href="<?php echo $link; ?>" <?php echo $target; ?>><?php echo $before_title.$title.$after_title; ?><?php
|
||||||
|
|
||||||
if ( $advanced_option_descriptions == 'no' )
|
if ( $advanced_option_descriptions == 'no' )
|
||||||
{
|
{
|
||||||
// 2 widget override do NOT display descriptions
|
// 2 widget override do NOT display descriptions
|
||||||
// 1 widget override display descriptions
|
// 1 widget override display descriptions
|
||||||
// 0 widget override not set
|
// 0 widget override not set
|
||||||
if (($desc == 1) || ($desc == 0) )
|
if (($desc == 1) || ($desc == 0) )
|
||||||
{
|
{
|
||||||
?><span class="nav-description"><?php echo $description; ?></span><?php
|
?><span class="nav-description"><?php echo $description; ?></span><?php
|
||||||
}
|
}
|
||||||
elseif ($desc == 2)
|
elseif ($desc == 2)
|
||||||
{ }
|
{ }
|
||||||
else
|
else
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 2 widget override do NOT display descriptions
|
// 2 widget override do NOT display descriptions
|
||||||
// 1 widget override display descriptions
|
// 1 widget override display descriptions
|
||||||
@ -223,21 +223,21 @@ function wp_custom_navigation_output($args = array()) {
|
|||||||
if ($desc == 1)
|
if ($desc == 1)
|
||||||
{
|
{
|
||||||
?><span class="nav-description"><?php echo $description; ?></span><?php
|
?><span class="nav-description"><?php echo $description; ?></span><?php
|
||||||
}
|
}
|
||||||
elseif (($desc == 2) || ($desc == 0))
|
elseif (($desc == 2) || ($desc == 0))
|
||||||
{ }
|
{ }
|
||||||
else
|
else
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
|
|
||||||
?></a><?php
|
?></a><?php
|
||||||
}
|
}
|
||||||
//BACKEND draggable and droppable elements
|
//BACKEND draggable and droppable elements
|
||||||
elseif ($type == "backend")
|
elseif ($type == "backend")
|
||||||
$link_type = substr( $menu_item->post_status, 5 );
|
$link_type = substr( $menu_item->post_status, 5 );
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>
|
<dt>
|
||||||
<span class="title"><?php echo $title; ?></span>
|
<span class="title"><?php echo $title; ?></span>
|
||||||
@ -249,7 +249,7 @@ function wp_custom_navigation_output($args = array()) {
|
|||||||
</span>
|
</span>
|
||||||
</dt>
|
</dt>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<a><span class=""></span></a>
|
<a><span class=""></span></a>
|
||||||
<input type="hidden" name="dbid<?php echo $menu_item->menu_order; ?>" id="dbid<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->ID; ?>" />
|
<input type="hidden" name="dbid<?php echo $menu_item->menu_order; ?>" id="dbid<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->ID; ?>" />
|
||||||
<input type="hidden" name="postmenu<?php echo $menu_item->menu_order; ?>" id="postmenu<?php echo $menu_item->menu_order; ?>" value="<?php echo $id; ?>" />
|
<input type="hidden" name="postmenu<?php echo $menu_item->menu_order; ?>" id="postmenu<?php echo $menu_item->menu_order; ?>" value="<?php echo $id; ?>" />
|
||||||
@ -262,44 +262,44 @@ function wp_custom_navigation_output($args = array()) {
|
|||||||
<input type="hidden" name="linktype<?php echo $menu_item->menu_order; ?>" id="linktype<?php echo $menu_item->menu_order; ?>" value="<?php echo $link_type; ?>" />
|
<input type="hidden" name="linktype<?php echo $menu_item->menu_order; ?>" id="linktype<?php echo $menu_item->menu_order; ?>" value="<?php echo $link_type; ?>" />
|
||||||
<input type="hidden" name="anchortitle<?php echo $menu_item->menu_order; ?>" id="anchortitle<?php echo $menu_item->menu_order; ?>" value="<?php echo esc_html( $menu_item->post_excerpt ); ?>" />
|
<input type="hidden" name="anchortitle<?php echo $menu_item->menu_order; ?>" id="anchortitle<?php echo $menu_item->menu_order; ?>" value="<?php echo esc_html( $menu_item->post_excerpt ); ?>" />
|
||||||
<input type="hidden" name="newwindow<?php echo $menu_item->menu_order; ?>" id="newwindow<?php echo $menu_item->menu_order; ?>" value="<?php echo ( '' == $menu_item->post_content_filtered ? '0' : '1' ); ?>" />
|
<input type="hidden" name="newwindow<?php echo $menu_item->menu_order; ?>" id="newwindow<?php echo $menu_item->menu_order; ?>" value="<?php echo ( '' == $menu_item->post_content_filtered ? '0' : '1' ); ?>" />
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
//@todo: implement menu heirarchy
|
//@todo: implement menu heirarchy
|
||||||
/* //DISPLAY menu sub items
|
/* //DISPLAY menu sub items
|
||||||
if ($wp_custom_nav_menu_items->parent_id == 0)
|
if ($wp_custom_nav_menu_items->parent_id == 0)
|
||||||
{
|
{
|
||||||
//FRONTEND
|
//FRONTEND
|
||||||
if ($type == 'frontend')
|
if ($type == 'frontend')
|
||||||
{
|
{
|
||||||
//Recursive function
|
//Recursive function
|
||||||
$intj = wp_custom_navigation_sub_items($wp_custom_nav_menu_items->id,$wp_custom_nav_menu_items->link_type,$table_name,$type,$wp_custom_nav_menu_id);
|
$intj = wp_custom_navigation_sub_items($wp_custom_nav_menu_items->id,$wp_custom_nav_menu_items->link_type,$table_name,$type,$wp_custom_nav_menu_id);
|
||||||
}
|
}
|
||||||
//BACKEND
|
//BACKEND
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Recursive function
|
//Recursive function
|
||||||
$intj = wp_custom_navigation_sub_items($wp_custom_nav_menu_items->id,$wp_custom_nav_menu_items->link_type,$table_name,$type,$id);
|
$intj = wp_custom_navigation_sub_items($wp_custom_nav_menu_items->id,$wp_custom_nav_menu_items->link_type,$table_name,$type,$id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/ ?></li>
|
*/ ?></li>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//@todo: implement menu heirarchy
|
//@todo: implement menu heirarchy
|
||||||
//RECURSIVE Sub Menu Items
|
//RECURSIVE Sub Menu Items
|
||||||
function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,$menu_id = 0) {
|
function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,$menu_id = 0) {
|
||||||
|
|
||||||
$parent_id = 0;
|
$parent_id = 0;
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
//GET sub menu items
|
//GET sub menu items
|
||||||
$wp_custom_nav_menu = $wpdb->get_results("SELECT id,post_id,parent_id,position,custom_title,custom_link,custom_description,menu_icon,link_type,custom_anchor_title,new_window FROM ".$table_name." WHERE parent_id = '".$post_id."' AND menu_id='".$menu_id."' ORDER BY position ASC");
|
$wp_custom_nav_menu = $wpdb->get_results("SELECT id,post_id,parent_id,position,custom_title,custom_link,custom_description,menu_icon,link_type,custom_anchor_title,new_window FROM ".$table_name." WHERE parent_id = '".$post_id."' AND menu_id='".$menu_id."' ORDER BY position ASC");
|
||||||
|
|
||||||
if (empty($wp_custom_nav_menu))
|
if (empty($wp_custom_nav_menu))
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -317,26 +317,26 @@ function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,
|
|||||||
|
|
||||||
}
|
}
|
||||||
//DISPLAY Loop
|
//DISPLAY Loop
|
||||||
foreach ($wp_custom_nav_menu as $sub_item)
|
foreach ($wp_custom_nav_menu as $sub_item)
|
||||||
{
|
{
|
||||||
//Figure out where the menu item sits
|
//Figure out where the menu item sits
|
||||||
$counter=$sub_item->position;
|
$counter=$sub_item->position;
|
||||||
|
|
||||||
//Prepare Menu Data
|
//Prepare Menu Data
|
||||||
//Category Menu Item
|
//Category Menu Item
|
||||||
if ($sub_item->link_type == 'category')
|
if ($sub_item->link_type == 'category')
|
||||||
{
|
{
|
||||||
|
|
||||||
$parent_id = $sub_item->parent_id;
|
$parent_id = $sub_item->parent_id;
|
||||||
$post_id = $sub_item->post_id;
|
$post_id = $sub_item->post_id;
|
||||||
|
|
||||||
if ($sub_item->custom_link == '') {
|
if ($sub_item->custom_link == '') {
|
||||||
$link = get_category_link($sub_item->post_id);
|
$link = get_category_link($sub_item->post_id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$link = $sub_item->custom_link;
|
$link = $sub_item->custom_link;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sub_item->custom_title == '') {
|
if ($sub_item->custom_title == '') {
|
||||||
$title_raw = get_categories('include='.$sub_item->post_id);
|
$title_raw = get_categories('include='.$sub_item->post_id);
|
||||||
$title = htmlentities($title_raw[0]->cat_name);
|
$title = htmlentities($title_raw[0]->cat_name);
|
||||||
@ -344,7 +344,7 @@ function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,
|
|||||||
else {
|
else {
|
||||||
$title = htmlentities($sub_item->custom_title);
|
$title = htmlentities($sub_item->custom_title);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sub_item->custom_description == '') {
|
if ($sub_item->custom_description == '') {
|
||||||
$description = strip_tags(category_description($sub_item->post_id));
|
$description = strip_tags(category_description($sub_item->post_id));
|
||||||
}
|
}
|
||||||
@ -356,10 +356,10 @@ function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,
|
|||||||
//Page Menu Item
|
//Page Menu Item
|
||||||
elseif ($sub_item->link_type == 'page')
|
elseif ($sub_item->link_type == 'page')
|
||||||
{
|
{
|
||||||
|
|
||||||
$parent_id = $sub_item->parent_id;
|
$parent_id = $sub_item->parent_id;
|
||||||
$post_id = $sub_item->post_id;
|
$post_id = $sub_item->post_id;
|
||||||
|
|
||||||
if ($sub_item->custom_link == '') {
|
if ($sub_item->custom_link == '') {
|
||||||
$link = get_permalink($sub_item->post_id);
|
$link = get_permalink($sub_item->post_id);
|
||||||
}
|
}
|
||||||
@ -373,7 +373,7 @@ function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,
|
|||||||
else {
|
else {
|
||||||
$title = htmlentities($sub_item->custom_title);
|
$title = htmlentities($sub_item->custom_title);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sub_item->custom_description == '') {
|
if ($sub_item->custom_description == '') {
|
||||||
$description = get_post_meta($sub_item->post_id, 'page-description', true);
|
$description = get_post_meta($sub_item->post_id, 'page-description', true);
|
||||||
}
|
}
|
||||||
@ -381,7 +381,7 @@ function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,
|
|||||||
$description = $sub_item->custom_description;
|
$description = $sub_item->custom_description;
|
||||||
}
|
}
|
||||||
$target = '';
|
$target = '';
|
||||||
|
|
||||||
}
|
}
|
||||||
//Custom Menu Item
|
//Custom Menu Item
|
||||||
else
|
else
|
||||||
@ -399,7 +399,7 @@ function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,
|
|||||||
else {
|
else {
|
||||||
$li_class = '';
|
$li_class = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
//SET anchor title
|
//SET anchor title
|
||||||
if (isset($sub_item->custom_anchor_title)) {
|
if (isset($sub_item->custom_anchor_title)) {
|
||||||
$anchor_title = htmlentities($sub_item->custom_anchor_title);
|
$anchor_title = htmlentities($sub_item->custom_anchor_title);
|
||||||
@ -407,19 +407,19 @@ function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,
|
|||||||
else {
|
else {
|
||||||
$anchor_title = $title;
|
$anchor_title = $title;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($sub_item->new_window)) {
|
if (isset($sub_item->new_window)) {
|
||||||
if ($sub_item->new_window > 0) {
|
if ($sub_item->new_window > 0) {
|
||||||
$target = 'target="_blank"';
|
$target = 'target="_blank"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//List Items
|
//List Items
|
||||||
?><li id="menu-<?php echo $counter; ?>" value="<?php echo $counter; ?>" <?php echo $li_class; ?>><?php
|
?><li id="menu-<?php echo $counter; ?>" value="<?php echo $counter; ?>" <?php echo $li_class; ?>><?php
|
||||||
//FRONTEND
|
//FRONTEND
|
||||||
if ($output_type == "frontend")
|
if ($output_type == "frontend")
|
||||||
{
|
{
|
||||||
?><a title="<?php echo $anchor_title; ?>" href="<?php echo $link; ?>" <?php echo $target; ?>><?php echo $title; ?></a><?php
|
?><a title="<?php echo $anchor_title; ?>" href="<?php echo $link; ?>" <?php echo $target; ?>><?php echo $title; ?></a><?php
|
||||||
}
|
}
|
||||||
//BACKEND
|
//BACKEND
|
||||||
elseif ($output_type == "backend")
|
elseif ($output_type == "backend")
|
||||||
@ -430,7 +430,7 @@ function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,
|
|||||||
<span class="title"><?php echo $title; ?></span>
|
<span class="title"><?php echo $title; ?></span>
|
||||||
<span class="controls">
|
<span class="controls">
|
||||||
<span class="type"><?php echo $sub_item->link_type; ?></span>
|
<span class="type"><?php echo $sub_item->link_type; ?></span>
|
||||||
<a id="edit<?php echo $counter; ?>" onclick="edititem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
|
<a id="edit<?php echo $counter; ?>" onclick="edititem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
|
||||||
<a id="remove<?php echo $counter; ?>" onclick="removeitem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" /></a>
|
<a id="remove<?php echo $counter; ?>" onclick="removeitem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" /></a>
|
||||||
<a id="view<?php echo $counter; ?>" target="_blank" href="<?php echo $link; ?>"><img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" /></a>
|
<a id="view<?php echo $counter; ?>" target="_blank" href="<?php echo $link; ?>"><img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" /></a>
|
||||||
</span>
|
</span>
|
||||||
@ -448,23 +448,23 @@ function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,
|
|||||||
<input type="hidden" name="linktype<?php echo $counter; ?>" id="linktype<?php echo $counter; ?>" value="<?php echo $sub_item->link_type; ?>" />
|
<input type="hidden" name="linktype<?php echo $counter; ?>" id="linktype<?php echo $counter; ?>" value="<?php echo $sub_item->link_type; ?>" />
|
||||||
<input type="hidden" name="anchortitle<?php echo $counter; ?>" id="anchortitle<?php echo $counter; ?>" value="<?php echo $anchor_title; ?>" />
|
<input type="hidden" name="anchortitle<?php echo $counter; ?>" id="anchortitle<?php echo $counter; ?>" value="<?php echo $anchor_title; ?>" />
|
||||||
<input type="hidden" name="newwindow<?php echo $counter; ?>" id="newwindow<?php echo $counter; ?>" value="<?php echo $sub_item->new_window; ?>" />
|
<input type="hidden" name="newwindow<?php echo $counter; ?>" id="newwindow<?php echo $counter; ?>" value="<?php echo $sub_item->new_window; ?>" />
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
//Do recursion
|
//Do recursion
|
||||||
wp_custom_navigation_sub_items($sub_item->id,$sub_item->link_type,$table_name,$output_type,$menu_id);
|
wp_custom_navigation_sub_items($sub_item->id,$sub_item->link_type,$table_name,$output_type,$menu_id);
|
||||||
?></li>
|
?></li>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?></ul>
|
?></ul>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $parent_id;
|
return $parent_id;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -485,19 +485,19 @@ function wp_custom_nav_get_pages($counter,$type) {
|
|||||||
'exclude_tree' => '',
|
'exclude_tree' => '',
|
||||||
'number' => '',
|
'number' => '',
|
||||||
'offset' => 0 );
|
'offset' => 0 );
|
||||||
|
|
||||||
//GET all pages
|
//GET all pages
|
||||||
$pages_array = get_pages($pages_args);
|
$pages_array = get_pages($pages_args);
|
||||||
|
|
||||||
$intCounter = $counter;
|
$intCounter = $counter;
|
||||||
$parentli = $intCounter;
|
$parentli = $intCounter;
|
||||||
|
|
||||||
if ($pages_array)
|
if ($pages_array)
|
||||||
{
|
{
|
||||||
//DISPLAY Loop
|
//DISPLAY Loop
|
||||||
foreach ($pages_array as $post)
|
foreach ($pages_array as $post)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($post->post_parent == 0)
|
if ($post->post_parent == 0)
|
||||||
{
|
{
|
||||||
//Custom Menu
|
//Custom Menu
|
||||||
@ -505,15 +505,15 @@ function wp_custom_nav_get_pages($counter,$type) {
|
|||||||
{
|
{
|
||||||
$description = get_post_meta($post->ID, 'page-description', true);
|
$description = get_post_meta($post->ID, 'page-description', true);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<li id="menu-<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>">
|
<li id="menu-<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>">
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>
|
<dt>
|
||||||
<span class="title"><?php echo $post->post_title; ?></span>
|
<span class="title"><?php echo $post->post_title; ?></span>
|
||||||
<span class="controls">
|
<span class="controls">
|
||||||
<span class="type">page</span>
|
<span class="type">page</span>
|
||||||
<a id="edit<?php echo $intCounter; ?>" onclick="edititem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
|
<a id="edit<?php echo $intCounter; ?>" onclick="edititem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
|
||||||
<a id="remove<?php echo $intCounter; ?>" onclick="removeitem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>">
|
<a id="remove<?php echo $intCounter; ?>" onclick="removeitem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>">
|
||||||
<img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" />
|
<img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" />
|
||||||
</a>
|
</a>
|
||||||
@ -521,7 +521,7 @@ function wp_custom_nav_get_pages($counter,$type) {
|
|||||||
<img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" />
|
<img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" />
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</dt>
|
</dt>
|
||||||
</dl>
|
</dl>
|
||||||
<a class="hide" href="<?php echo get_permalink($post->ID); ?>"><span class="title"><?php echo $post->post_title; ?></span>
|
<a class="hide" href="<?php echo get_permalink($post->ID); ?>"><span class="title"><?php echo $post->post_title; ?></span>
|
||||||
@ -536,26 +536,26 @@ function wp_custom_nav_get_pages($counter,$type) {
|
|||||||
<input type="hidden" name="linktype<?php echo $intCounter; ?>" id="linktype<?php echo $intCounter; ?>" value="page" />
|
<input type="hidden" name="linktype<?php echo $intCounter; ?>" id="linktype<?php echo $intCounter; ?>" value="page" />
|
||||||
<input type="hidden" name="anchortitle<?php echo $intCounter; ?>" id="anchortitle<?php echo $intCounter; ?>" value="<?php echo htmlentities($post->post_title); ?>" />
|
<input type="hidden" name="anchortitle<?php echo $intCounter; ?>" id="anchortitle<?php echo $intCounter; ?>" value="<?php echo htmlentities($post->post_title); ?>" />
|
||||||
<input type="hidden" name="newwindow<?php echo $intCounter; ?>" id="newwindow<?php echo $intCounter; ?>" value="0" />
|
<input type="hidden" name="newwindow<?php echo $intCounter; ?>" id="newwindow<?php echo $intCounter; ?>" value="0" />
|
||||||
|
|
||||||
<?php $parentli = $post->ID; ?>
|
<?php $parentli = $post->ID; ?>
|
||||||
<?php $intCounter++; ?>
|
<?php $intCounter++; ?>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//Recursive function
|
//Recursive function
|
||||||
$intCounter = wp_custom_navigation_default_sub_items($post->ID, $intCounter, $parentli, 'pages', 'menu');
|
$intCounter = wp_custom_navigation_default_sub_items($post->ID, $intCounter, $parentli, 'pages', 'menu');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
//Sidebar Menu
|
//Sidebar Menu
|
||||||
elseif ($type == 'default')
|
elseif ($type == 'default')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>
|
<dt>
|
||||||
@ -564,36 +564,36 @@ function wp_custom_nav_get_pages($counter,$type) {
|
|||||||
$post_url = get_permalink($post->ID);
|
$post_url = get_permalink($post->ID);
|
||||||
$post_id = $post->ID;
|
$post_id = $post->ID;
|
||||||
$post_parent_id = $post->post_parent;
|
$post_parent_id = $post->post_parent;
|
||||||
|
|
||||||
$description = htmlentities(get_post_meta($post_id, 'page-description', true));
|
$description = htmlentities(get_post_meta($post_id, 'page-description', true));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?php $templatedir = get_bloginfo('url'); ?>
|
<?php $templatedir = get_bloginfo('url'); ?>
|
||||||
|
|
||||||
<span class="title"><?php echo $post->post_title; ?></span> <a onclick="appendToList('<?php echo $templatedir; ?>','Page','<?php echo $post_text; ?>','<?php echo $post_url; ?>','<?php echo $post_id; ?>','<?php echo $post_parent_id ?>','<?php echo $description; ?>')" name="<?php echo $post_text; ?>" value="<?php echo get_permalink($post->ID); ?>"><img alt="Add to Custom Menu" title="Add to Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-add.png" /></a></dt>
|
<span class="title"><?php echo $post->post_title; ?></span> <a onclick="appendToList('<?php echo $templatedir; ?>','Page','<?php echo $post_text; ?>','<?php echo $post_url; ?>','<?php echo $post_id; ?>','<?php echo $post_parent_id ?>','<?php echo $description; ?>')" name="<?php echo $post_text; ?>" value="<?php echo get_permalink($post->ID); ?>"><img alt="Add to Custom Menu" title="Add to Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-add.png" /></a></dt>
|
||||||
</dl>
|
</dl>
|
||||||
<?php $parentli = $post->ID; ?>
|
<?php $parentli = $post->ID; ?>
|
||||||
<?php $intCounter++; ?>
|
<?php $intCounter++; ?>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//Recursive function
|
//Recursive function
|
||||||
$intCounter = wp_custom_navigation_default_sub_items($post_id, $intCounter, $parentli, 'pages', 'default');
|
$intCounter = wp_custom_navigation_default_sub_items($post_id, $intCounter, $parentli, 'pages', 'default');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo 'Not Found';
|
echo 'Not Found';
|
||||||
}
|
}
|
||||||
@ -616,14 +616,14 @@ function wp_custom_nav_get_categories($counter, $type) {
|
|||||||
'include' => '',
|
'include' => '',
|
||||||
'number' => '',
|
'number' => '',
|
||||||
'pad_counts' => false );
|
'pad_counts' => false );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$intCounter = $counter;
|
$intCounter = $counter;
|
||||||
|
|
||||||
//GET all categories
|
//GET all categories
|
||||||
$categories_array = get_categories($category_args);
|
$categories_array = get_categories($category_args);
|
||||||
|
|
||||||
if ($categories_array)
|
if ($categories_array)
|
||||||
{
|
{
|
||||||
//DISPLAY Loop
|
//DISPLAY Loop
|
||||||
@ -636,14 +636,14 @@ function wp_custom_nav_get_categories($counter, $type) {
|
|||||||
if ($type == 'menu')
|
if ($type == 'menu')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<li id="menu-<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>">
|
<li id="menu-<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>">
|
||||||
<dl>
|
<dl>
|
||||||
<dt>
|
<dt>
|
||||||
<span class="title"><?php echo $cat_item->cat_name; ?></span>
|
<span class="title"><?php echo $cat_item->cat_name; ?></span>
|
||||||
<span class="controls">
|
<span class="controls">
|
||||||
<span class="type">category</span>
|
<span class="type">category</span>
|
||||||
<a id="edit<?php echo $intCounter; ?>" onclick="edititem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
|
<a id="edit<?php echo $intCounter; ?>" onclick="edititem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
|
||||||
<a id="remove<?php echo $intCounter; ?>" onclick="removeitem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>">
|
<a id="remove<?php echo $intCounter; ?>" onclick="removeitem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>">
|
||||||
<img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" />
|
<img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" />
|
||||||
</a>
|
</a>
|
||||||
@ -651,11 +651,11 @@ function wp_custom_nav_get_categories($counter, $type) {
|
|||||||
<img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" />
|
<img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" />
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</dt>
|
</dt>
|
||||||
</dl>
|
</dl>
|
||||||
<a class="hide" href="<?php echo get_category_link($cat_item->cat_ID); ?>"><span class="title"><?php echo $cat_item->cat_name; ?></span>
|
<a class="hide" href="<?php echo get_category_link($cat_item->cat_ID); ?>"><span class="title"><?php echo $cat_item->cat_name; ?></span>
|
||||||
<?php
|
<?php
|
||||||
$use_cats_raw = get_option('wp_settings_custom_nav_descriptions');
|
$use_cats_raw = get_option('wp_settings_custom_nav_descriptions');
|
||||||
$use_cats = strtolower($use_cats_raw);
|
$use_cats = strtolower($use_cats_raw);
|
||||||
if ($use_cats == 'yes') { ?>
|
if ($use_cats == 'yes') { ?>
|
||||||
@ -672,19 +672,19 @@ function wp_custom_nav_get_categories($counter, $type) {
|
|||||||
<input type="hidden" name="linktype<?php echo $intCounter; ?>" id="linktype<?php echo $intCounter; ?>" value="category" />
|
<input type="hidden" name="linktype<?php echo $intCounter; ?>" id="linktype<?php echo $intCounter; ?>" value="category" />
|
||||||
<input type="hidden" name="anchortitle<?php echo $intCounter; ?>" id="anchortitle<?php echo $intCounter; ?>" value="<?php echo htmlentities($cat_item->cat_name); ?>" />
|
<input type="hidden" name="anchortitle<?php echo $intCounter; ?>" id="anchortitle<?php echo $intCounter; ?>" value="<?php echo htmlentities($cat_item->cat_name); ?>" />
|
||||||
<input type="hidden" name="newwindow<?php echo $intCounter; ?>" id="newwindow<?php echo $intCounter; ?>" value="0" />
|
<input type="hidden" name="newwindow<?php echo $intCounter; ?>" id="newwindow<?php echo $intCounter; ?>" value="0" />
|
||||||
|
|
||||||
<?php $parentli = $cat_item->cat_ID; ?>
|
<?php $parentli = $cat_item->cat_ID; ?>
|
||||||
<?php $intCounter++; ?>
|
<?php $intCounter++; ?>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//Recursive function
|
//Recursive function
|
||||||
$intCounter = wp_custom_navigation_default_sub_items($cat_item->cat_ID, $intCounter, $parentli, 'categories','menu');
|
$intCounter = wp_custom_navigation_default_sub_items($cat_item->cat_ID, $intCounter, $parentli, 'categories','menu');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
//Sidebar Menu
|
//Sidebar Menu
|
||||||
elseif ($type == 'default')
|
elseif ($type == 'default')
|
||||||
@ -704,24 +704,24 @@ function wp_custom_nav_get_categories($counter, $type) {
|
|||||||
<span class="title"><?php echo $cat_item->cat_name; ?></span> <a onclick="appendToList('<?php echo $templatedir; ?>','Category','<?php echo $post_text; ?>','<?php echo $post_url; ?>','<?php echo $post_id; ?>','<?php echo $post_parent_id ?>','<?php echo $description; ?>')" name="<?php echo $post_text; ?>" value="<?php echo $post_url; ?>"><img alt="Add to Custom Menu" title="Add to Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-add.png" /></a> </dt>
|
<span class="title"><?php echo $cat_item->cat_name; ?></span> <a onclick="appendToList('<?php echo $templatedir; ?>','Category','<?php echo $post_text; ?>','<?php echo $post_url; ?>','<?php echo $post_id; ?>','<?php echo $post_parent_id ?>','<?php echo $description; ?>')" name="<?php echo $post_text; ?>" value="<?php echo $post_url; ?>"><img alt="Add to Custom Menu" title="Add to Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-add.png" /></a> </dt>
|
||||||
</dl>
|
</dl>
|
||||||
<?php $parentli = $cat_item->cat_ID; ?>
|
<?php $parentli = $cat_item->cat_ID; ?>
|
||||||
<?php $intCounter++; ?>
|
<?php $intCounter++; ?>
|
||||||
<?php
|
<?php
|
||||||
//Recursive function
|
//Recursive function
|
||||||
$intCounter = wp_custom_navigation_default_sub_items($cat_item->cat_ID, $intCounter, $parentli, 'categories','default');
|
$intCounter = wp_custom_navigation_default_sub_items($cat_item->cat_ID, $intCounter, $parentli, 'categories','default');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo 'Not Found';
|
echo 'Not Found';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $intCounter;
|
return $intCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -729,9 +729,9 @@ function wp_custom_nav_get_categories($counter, $type) {
|
|||||||
function wp_custom_navigation_default_sub_items($childof, $intCounter, $parentli, $type, $output_type) {
|
function wp_custom_navigation_default_sub_items($childof, $intCounter, $parentli, $type, $output_type) {
|
||||||
|
|
||||||
$counter = $intCounter;
|
$counter = $intCounter;
|
||||||
|
|
||||||
//Custom Menu
|
//Custom Menu
|
||||||
if ($output_type == 'menu')
|
if ($output_type == 'menu')
|
||||||
{
|
{
|
||||||
$sub_args = array(
|
$sub_args = array(
|
||||||
'child_of' => $childof,
|
'child_of' => $childof,
|
||||||
@ -739,43 +739,43 @@ function wp_custom_navigation_default_sub_items($childof, $intCounter, $parentli
|
|||||||
'parent' => $childof);
|
'parent' => $childof);
|
||||||
}
|
}
|
||||||
//Sidebar Menu
|
//Sidebar Menu
|
||||||
elseif ($output_type == 'default')
|
elseif ($output_type == 'default')
|
||||||
{
|
{
|
||||||
$sub_args = array(
|
$sub_args = array(
|
||||||
'child_of' => $childof,
|
'child_of' => $childof,
|
||||||
'hide_empty' => false,
|
'hide_empty' => false,
|
||||||
'parent' => $childof);
|
'parent' => $childof);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get Sub Category Items
|
//Get Sub Category Items
|
||||||
if ($type == 'categories')
|
if ($type == 'categories')
|
||||||
{
|
{
|
||||||
$sub_array = get_categories($sub_args);
|
$sub_array = get_categories($sub_args);
|
||||||
}
|
}
|
||||||
//Get Sub Page Items
|
//Get Sub Page Items
|
||||||
elseif ($type == 'pages')
|
elseif ($type == 'pages')
|
||||||
{
|
{
|
||||||
$sub_array = get_pages($sub_args);
|
$sub_array = get_pages($sub_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($sub_array)
|
if ($sub_array)
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<ul id="sub-custom-nav-<?php echo $type ?>">
|
<ul id="sub-custom-nav-<?php echo $type ?>">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
//DISPLAY Loop
|
//DISPLAY Loop
|
||||||
foreach ($sub_array as $sub_item)
|
foreach ($sub_array as $sub_item)
|
||||||
{
|
{
|
||||||
//Prepare Menu Data
|
//Prepare Menu Data
|
||||||
//Category Menu Item
|
//Category Menu Item
|
||||||
if ($type == 'categories')
|
if ($type == 'categories')
|
||||||
{
|
{
|
||||||
$link = get_category_link($sub_item->cat_ID);
|
$link = get_category_link($sub_item->cat_ID);
|
||||||
$title = htmlentities($sub_item->cat_name);
|
$title = htmlentities($sub_item->cat_name);
|
||||||
@ -783,7 +783,7 @@ function wp_custom_navigation_default_sub_items($childof, $intCounter, $parentli
|
|||||||
$itemid = $sub_item->cat_ID;
|
$itemid = $sub_item->cat_ID;
|
||||||
$linktype = 'category';
|
$linktype = 'category';
|
||||||
$appendtype = 'Category';
|
$appendtype = 'Category';
|
||||||
$description = htmlentities(strip_tags($sub_item->description));
|
$description = htmlentities(strip_tags($sub_item->description));
|
||||||
}
|
}
|
||||||
//Page Menu Item
|
//Page Menu Item
|
||||||
elseif ($type == 'pages')
|
elseif ($type == 'pages')
|
||||||
@ -797,13 +797,13 @@ function wp_custom_navigation_default_sub_items($childof, $intCounter, $parentli
|
|||||||
$description = htmlentities(get_post_meta($itemid, 'page-description', true));
|
$description = htmlentities(get_post_meta($itemid, 'page-description', true));
|
||||||
}
|
}
|
||||||
//Custom Menu Item
|
//Custom Menu Item
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$title = '';
|
$title = '';
|
||||||
$linktype = 'custom';
|
$linktype = 'custom';
|
||||||
$appendtype= 'Custom';
|
$appendtype= 'Custom';
|
||||||
}
|
}
|
||||||
|
|
||||||
//Custom Menu
|
//Custom Menu
|
||||||
if ($output_type == 'menu')
|
if ($output_type == 'menu')
|
||||||
{
|
{
|
||||||
@ -814,7 +814,7 @@ function wp_custom_navigation_default_sub_items($childof, $intCounter, $parentli
|
|||||||
<span class="title"><?php echo $title; ?></span>
|
<span class="title"><?php echo $title; ?></span>
|
||||||
<span class="controls">
|
<span class="controls">
|
||||||
<span class="type"><?php echo $linktype; ?></span>
|
<span class="type"><?php echo $linktype; ?></span>
|
||||||
<a id="edit<?php echo $counter; ?>" onclick="edititem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
|
<a id="edit<?php echo $counter; ?>" onclick="edititem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
|
||||||
<a id="remove<?php echo $counter; ?>" onclick="removeitem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>">
|
<a id="remove<?php echo $counter; ?>" onclick="removeitem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>">
|
||||||
<img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" />
|
<img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" />
|
||||||
</a>
|
</a>
|
||||||
@ -822,7 +822,7 @@ function wp_custom_navigation_default_sub_items($childof, $intCounter, $parentli
|
|||||||
<img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" />
|
<img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" />
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</dt>
|
</dt>
|
||||||
</dl>
|
</dl>
|
||||||
<a class="hide" href="<?php echo $link; ?>"><?php echo $title; ?></a>
|
<a class="hide" href="<?php echo $link; ?>"><?php echo $title; ?></a>
|
||||||
@ -837,49 +837,49 @@ function wp_custom_navigation_default_sub_items($childof, $intCounter, $parentli
|
|||||||
<input type="hidden" name="linktype<?php echo $counter; ?>" id="linktype<?php echo $counter; ?>" value="<?php echo $linktype; ?>" />
|
<input type="hidden" name="linktype<?php echo $counter; ?>" id="linktype<?php echo $counter; ?>" value="<?php echo $linktype; ?>" />
|
||||||
<input type="hidden" name="anchortitle<?php echo $counter; ?>" id="anchortitle<?php echo $counter; ?>" value="<?php echo $title; ?>" />
|
<input type="hidden" name="anchortitle<?php echo $counter; ?>" id="anchortitle<?php echo $counter; ?>" value="<?php echo $title; ?>" />
|
||||||
<input type="hidden" name="newwindow<?php echo $counter; ?>" id="newwindow<?php echo $counter; ?>" value="0" />
|
<input type="hidden" name="newwindow<?php echo $counter; ?>" id="newwindow<?php echo $counter; ?>" value="0" />
|
||||||
|
|
||||||
<?php $counter++; ?>
|
<?php $counter++; ?>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//Do recursion
|
//Do recursion
|
||||||
$counter = wp_custom_navigation_default_sub_items($parent_id, $counter, $parent_id, $type, 'menu');
|
$counter = wp_custom_navigation_default_sub_items($parent_id, $counter, $parent_id, $type, 'menu');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
//Sidebar Menu
|
//Sidebar Menu
|
||||||
elseif ($output_type == 'default')
|
elseif ($output_type == 'default')
|
||||||
{
|
{
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<li>
|
<li>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<?php $templatedir = get_bloginfo('url'); ?>
|
<?php $templatedir = get_bloginfo('url'); ?>
|
||||||
<span class="title"><?php echo $title; ?></span> <a onclick="appendToList('<?php echo $templatedir; ?>','<?php echo $appendtype; ?>','<?php echo $title; ?>','<?php echo $link; ?>','<?php echo $itemid; ?>','<?php echo $parent_id ?>','<?php echo $description; ?>')" name="<?php echo $title; ?>" value="<?php echo $link; ?>"><img alt="Add to Custom Menu" title="Add to Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-add.png" /></a> </dt>
|
<span class="title"><?php echo $title; ?></span> <a onclick="appendToList('<?php echo $templatedir; ?>','<?php echo $appendtype; ?>','<?php echo $title; ?>','<?php echo $link; ?>','<?php echo $itemid; ?>','<?php echo $parent_id ?>','<?php echo $description; ?>')" name="<?php echo $title; ?>" value="<?php echo $link; ?>"><img alt="Add to Custom Menu" title="Add to Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-add.png" /></a> </dt>
|
||||||
</dl>
|
</dl>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//Do recursion
|
//Do recursion
|
||||||
$counter = wp_custom_navigation_default_sub_items($itemid, $counter, $parent_id, $type, 'default');
|
$counter = wp_custom_navigation_default_sub_items($itemid, $counter, $parent_id, $type, 'default');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
return $counter;
|
return $counter;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -891,19 +891,19 @@ function wp_custom_navigation_default_sub_items($childof, $intCounter, $parentli
|
|||||||
function get_children_menu_elements($childof, $intCounter, $parentli, $type, $menu_id, $table_name) {
|
function get_children_menu_elements($childof, $intCounter, $parentli, $type, $menu_id, $table_name) {
|
||||||
|
|
||||||
$counter = $intCounter;
|
$counter = $intCounter;
|
||||||
|
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Get Sub Category Items
|
//Get Sub Category Items
|
||||||
if ($type == 'categories')
|
if ($type == 'categories')
|
||||||
{
|
{
|
||||||
$sub_args = array(
|
$sub_args = array(
|
||||||
'child_of' => $childof,
|
'child_of' => $childof,
|
||||||
'hide_empty' => false,
|
'hide_empty' => false,
|
||||||
'parent' => $childof);
|
'parent' => $childof);
|
||||||
$sub_array = get_categories($sub_args);
|
$sub_array = get_categories($sub_args);
|
||||||
}
|
}
|
||||||
//Get Sub Page Items
|
//Get Sub Page Items
|
||||||
elseif ($type == 'pages')
|
elseif ($type == 'pages')
|
||||||
@ -911,14 +911,14 @@ function get_children_menu_elements($childof, $intCounter, $parentli, $type, $me
|
|||||||
$sub_args = array(
|
$sub_args = array(
|
||||||
'child_of' => $childof,
|
'child_of' => $childof,
|
||||||
'parent' => $childof);
|
'parent' => $childof);
|
||||||
|
|
||||||
$sub_array = get_pages($sub_args);
|
$sub_array = get_pages($sub_args);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sub_array)
|
if ($sub_array)
|
||||||
{
|
{
|
||||||
//DISPLAY Loop
|
//DISPLAY Loop
|
||||||
@ -928,7 +928,7 @@ function get_children_menu_elements($childof, $intCounter, $parentli, $type, $me
|
|||||||
$sub_item_parent = $sub_item->parent;
|
$sub_item_parent = $sub_item->parent;
|
||||||
}
|
}
|
||||||
elseif (isset($sub_item->post_parent)) {
|
elseif (isset($sub_item->post_parent)) {
|
||||||
$sub_item_parent = $sub_item->post_parent;
|
$sub_item_parent = $sub_item->post_parent;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
}
|
}
|
||||||
@ -937,7 +937,7 @@ function get_children_menu_elements($childof, $intCounter, $parentli, $type, $me
|
|||||||
{
|
{
|
||||||
//Prepare Menu Data
|
//Prepare Menu Data
|
||||||
//Category Menu Item
|
//Category Menu Item
|
||||||
if ($type == 'categories')
|
if ($type == 'categories')
|
||||||
{
|
{
|
||||||
$link = get_category_link($sub_item->cat_ID);
|
$link = get_category_link($sub_item->cat_ID);
|
||||||
$title = htmlentities($sub_item->cat_name);
|
$title = htmlentities($sub_item->cat_name);
|
||||||
@ -957,13 +957,13 @@ function get_children_menu_elements($childof, $intCounter, $parentli, $type, $me
|
|||||||
$appendtype= 'Page';
|
$appendtype= 'Page';
|
||||||
}
|
}
|
||||||
//Custom Menu Item
|
//Custom Menu Item
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$title = '';
|
$title = '';
|
||||||
$linktype = 'custom';
|
$linktype = 'custom';
|
||||||
$appendtype= 'Custom';
|
$appendtype= 'Custom';
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK for existing parent records
|
//CHECK for existing parent records
|
||||||
//echo $parent_id;
|
//echo $parent_id;
|
||||||
$wp_result = $wpdb->get_results("SELECT id FROM ".$table_name." WHERE post_id='".$parent_id."' AND link_type='".$linktype."' AND menu_id='".$menu_id."'");
|
$wp_result = $wpdb->get_results("SELECT id FROM ".$table_name." WHERE post_id='".$parent_id."' AND link_type='".$linktype."' AND menu_id='".$menu_id."'");
|
||||||
@ -973,17 +973,17 @@ function get_children_menu_elements($childof, $intCounter, $parentli, $type, $me
|
|||||||
else {
|
else {
|
||||||
//$parent_id = 0;
|
//$parent_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//INSERT item
|
//INSERT item
|
||||||
$insert = "INSERT INTO ".$table_name." (position,post_id,parent_id,custom_title,custom_link,custom_description,menu_icon,link_type,menu_id,custom_anchor_title) "."VALUES ('".$counter."','".$itemid."','".$parent_id."','".$title."','".$link."','','','".$linktype."','".$menu_id."','".$title."')";
|
$insert = "INSERT INTO ".$table_name." (position,post_id,parent_id,custom_title,custom_link,custom_description,menu_icon,link_type,menu_id,custom_anchor_title) "."VALUES ('".$counter."','".$itemid."','".$parent_id."','".$title."','".$link."','','','".$linktype."','".$menu_id."','".$title."')";
|
||||||
$results = $wpdb->query( $insert );
|
$results = $wpdb->query( $insert );
|
||||||
|
|
||||||
$counter++;
|
$counter++;
|
||||||
$counter = get_children_menu_elements($itemid, $counter, $parent_id, $type, $menu_id, $table_name);
|
$counter = get_children_menu_elements($itemid, $counter, $parent_id, $type, $menu_id, $table_name);
|
||||||
}
|
}
|
||||||
//Do nothing
|
//Do nothing
|
||||||
else {
|
else {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1009,10 +1009,10 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
|||||||
|
|
||||||
function WP_CustomNavWidget() {
|
function WP_CustomNavWidget() {
|
||||||
$widget_ops = array('description' => 'Use this widget to add one of your Custom Navigation Menus as a widget.' );
|
$widget_ops = array('description' => 'Use this widget to add one of your Custom Navigation Menus as a widget.' );
|
||||||
parent::WP_Widget(false, __('Custom Navigation Menu'),$widget_ops);
|
parent::WP_Widget(false, __('Custom Navigation Menu'),$widget_ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
function widget($args, $instance) {
|
function widget($args, $instance) {
|
||||||
$navmenu = $instance['navmenu'];
|
$navmenu = $instance['navmenu'];
|
||||||
$navtitle = $instance['navtitle'];
|
$navtitle = $instance['navtitle'];
|
||||||
$navdeveloper = strtolower($instance['navdeveloper']);
|
$navdeveloper = strtolower($instance['navdeveloper']);
|
||||||
@ -1022,21 +1022,21 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
|||||||
$navdivclass = $instance['navdivclass'];
|
$navdivclass = $instance['navdivclass'];
|
||||||
$navulid = $instance['navulid'];
|
$navulid = $instance['navulid'];
|
||||||
$navulclass = $instance['navulclass'];
|
$navulclass = $instance['navulclass'];
|
||||||
|
|
||||||
//Override for menu descriptions
|
//Override for menu descriptions
|
||||||
$advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options');
|
$advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options');
|
||||||
if ($advanced_option_descriptions == 'no')
|
if ($advanced_option_descriptions == 'no')
|
||||||
{
|
{
|
||||||
$navwidgetdescription = 2;
|
$navwidgetdescription = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$navwidgetdescription = $instance['navwidgetdescription'];
|
$navwidgetdescription = $instance['navwidgetdescription'];
|
||||||
}
|
}
|
||||||
$menuexists = false;
|
$menuexists = false;
|
||||||
|
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
//GET menu name
|
//GET menu name
|
||||||
if ($navmenu > 0)
|
if ($navmenu > 0)
|
||||||
{
|
{
|
||||||
@ -1046,108 +1046,108 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
|||||||
$menuexists = true;
|
$menuexists = true;
|
||||||
}
|
}
|
||||||
//Do nothing
|
//Do nothing
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$menuexists = false;
|
$menuexists = false;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
//DEVELOPER settings enabled
|
//DEVELOPER settings enabled
|
||||||
if ($navdeveloper == 'yes')
|
if ($navdeveloper == 'yes')
|
||||||
{
|
{
|
||||||
//DISPLAY Custom DIV
|
//DISPLAY Custom DIV
|
||||||
if ($navdiv == 'yes')
|
if ($navdiv == 'yes')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<div id="<?php echo $navdivid; ?>" class="<?php echo $navdivclass; ?>">
|
<div id="<?php echo $navdivid; ?>" class="<?php echo $navdivclass; ?>">
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
//Do NOT display DIV
|
//Do NOT display DIV
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//DISPLAY default DIV
|
//DISPLAY default DIV
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<div class="widget">
|
<div class="widget">
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h3><?php echo $navtitle; ?></h3>
|
<h3><?php echo $navtitle; ?></h3>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($menuexists)
|
if ($menuexists)
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//DEVELOPER settings enabled
|
//DEVELOPER settings enabled
|
||||||
if ($navdeveloper == 'yes')
|
if ($navdeveloper == 'yes')
|
||||||
{
|
{
|
||||||
//DISPLAY Custom UL
|
//DISPLAY Custom UL
|
||||||
if ($navul == 'yes')
|
if ($navul == 'yes')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<ul id="<?php echo $navulid; ?>" class="<?php echo $navulclass; ?>">
|
<ul id="<?php echo $navulid; ?>" class="<?php echo $navulclass; ?>">
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
//Do NOT display UL
|
//Do NOT display UL
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//DISPLAY default UL
|
//DISPLAY default UL
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<ul class="custom-nav">
|
<ul class="custom-nav">
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
//DISPLAY custom navigation menu
|
//DISPLAY custom navigation menu
|
||||||
if (get_option('wp_custom_nav_menu') == 'true') {
|
if (get_option('wp_custom_nav_menu') == 'true') {
|
||||||
custom_nav('name='.$wp_custom_nav_menu_name.'&desc='.$navwidgetdescription);
|
custom_nav('name='.$wp_custom_nav_menu_name.'&desc='.$navwidgetdescription);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//DEVELOPER settings enabled
|
//DEVELOPER settings enabled
|
||||||
if ($navdeveloper == 'yes')
|
if ($navdeveloper == 'yes')
|
||||||
{
|
{
|
||||||
//DISPLAY Custom UL
|
//DISPLAY Custom UL
|
||||||
if ($navul == 'yes')
|
if ($navul == 'yes')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
//Do NOT display UL
|
//Do NOT display UL
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//DISPLAY default UL
|
//DISPLAY default UL
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@ -1156,41 +1156,41 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
|||||||
echo "You have not setup the custom navigation widget correctly, please check your settings in the backend.";
|
echo "You have not setup the custom navigation widget correctly, please check your settings in the backend.";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?php
|
<?php
|
||||||
//DEVELOPER settings enabled
|
//DEVELOPER settings enabled
|
||||||
if ($navdeveloper == 'yes')
|
if ($navdeveloper == 'yes')
|
||||||
{
|
{
|
||||||
//DISPLAY Custom DIV
|
//DISPLAY Custom DIV
|
||||||
if ($navdiv == 'yes')
|
if ($navdiv == 'yes')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
//Do NOT display DIV
|
//Do NOT display DIV
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//DISPLAY default DIV
|
//DISPLAY default DIV
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?><!-- /#nav-container -->
|
?><!-- /#nav-container -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
function update($new_instance, $old_instance) {
|
function update($new_instance, $old_instance) {
|
||||||
return $new_instance;
|
return $new_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
function form($instance) {
|
function form($instance) {
|
||||||
$navmenu = esc_attr($instance['navmenu']);
|
$navmenu = esc_attr($instance['navmenu']);
|
||||||
$navtitle = esc_attr($instance['navtitle']);
|
$navtitle = esc_attr($instance['navtitle']);
|
||||||
$navdeveloper = esc_attr($instance['navdeveloper']);
|
$navdeveloper = esc_attr($instance['navdeveloper']);
|
||||||
@ -1201,25 +1201,25 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
|||||||
$navulid = esc_attr($instance['navulid']);
|
$navulid = esc_attr($instance['navulid']);
|
||||||
$navulclass = esc_attr($instance['navulclass']);
|
$navulclass = esc_attr($instance['navulclass']);
|
||||||
$navwidgetdescription = esc_attr($instance['navwidgetdescription']);
|
$navwidgetdescription = esc_attr($instance['navwidgetdescription']);
|
||||||
|
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
//GET Menu Items for SELECT OPTIONS
|
//GET Menu Items for SELECT OPTIONS
|
||||||
$table_name_custom_menus = $wpdb->prefix . "custom_nav_menus";
|
$table_name_custom_menus = $wpdb->prefix . "custom_nav_menus";
|
||||||
$custom_menu_records = $wpdb->get_results("SELECT id,menu_name FROM ".$table_name_custom_menus);
|
$custom_menu_records = $wpdb->get_results("SELECT id,menu_name FROM ".$table_name_custom_menus);
|
||||||
|
|
||||||
//CHECK if menus exist
|
//CHECK if menus exist
|
||||||
if ($custom_menu_records > 0)
|
if ($custom_menu_records > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<label for="<?php echo $this->get_field_id('navmenu'); ?>"><?php _e('Select Menu:'); ?></label>
|
<label for="<?php echo $this->get_field_id('navmenu'); ?>"><?php _e('Select Menu:'); ?></label>
|
||||||
|
|
||||||
<select id="<?php echo $this->get_field_id('navmenu'); ?>" name="<?php echo $this->get_field_name('navmenu'); ?>">
|
<select id="<?php echo $this->get_field_id('navmenu'); ?>" name="<?php echo $this->get_field_name('navmenu'); ?>">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//DISPLAY SELECT OPTIONS
|
//DISPLAY SELECT OPTIONS
|
||||||
foreach ($custom_menu_records as $custom_menu_record)
|
foreach ($custom_menu_records as $custom_menu_record)
|
||||||
{
|
{
|
||||||
@ -1232,136 +1232,136 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
|||||||
?>
|
?>
|
||||||
<option value="<?php echo $custom_menu_record->id; ?>" <?php echo $selected_option; ?>><?php echo $custom_menu_record->menu_name; ?></option>
|
<option value="<?php echo $custom_menu_record->id; ?>" <?php echo $selected_option; ?>><?php echo $custom_menu_record->menu_name; ?></option>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<label for="<?php echo $this->get_field_id('navtitle'); ?>"><?php _e('Title:'); ?></label>
|
<label for="<?php echo $this->get_field_id('navtitle'); ?>"><?php _e('Title:'); ?></label>
|
||||||
<input type="text" name="<?php echo $this->get_field_name('navtitle'); ?>" value="<?php echo $navtitle; ?>" class="widefat" id="<?php echo $this->get_field_id('navtitle'); ?>" />
|
<input type="text" name="<?php echo $this->get_field_name('navtitle'); ?>" value="<?php echo $navtitle; ?>" class="widefat" id="<?php echo $this->get_field_id('navtitle'); ?>" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
$checked = strtolower($navdeveloper);
|
$checked = strtolower($navdeveloper);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<label for="<?php echo $this->get_field_id('navdeveloper'); ?>"><?php _e('Advanced Options:'); ?></label><br />
|
<label for="<?php echo $this->get_field_id('navdeveloper'); ?>"><?php _e('Advanced Options:'); ?></label><br />
|
||||||
<span class="checkboxes">
|
<span class="checkboxes">
|
||||||
<label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navdeveloper'); ?>" name="<?php echo $this->get_field_name('navdeveloper'); ?>" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
|
<label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navdeveloper'); ?>" name="<?php echo $this->get_field_name('navdeveloper'); ?>" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
|
||||||
<label>No</label><input type="radio" id="<?php echo $this->get_field_name('navdeveloper'); ?>" name="<?php echo $this->get_field_name('navdeveloper'); ?>" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
|
<label>No</label><input type="radio" id="<?php echo $this->get_field_name('navdeveloper'); ?>" name="<?php echo $this->get_field_name('navdeveloper'); ?>" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
|
||||||
</span><!-- /.checkboxes -->
|
</span><!-- /.checkboxes -->
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//DEVELOPER settings
|
//DEVELOPER settings
|
||||||
if ($checked == 'yes')
|
if ($checked == 'yes')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
$checked = strtolower($navdiv);
|
$checked = strtolower($navdiv);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<label for="<?php echo $this->get_field_id('navdiv'); ?>"><?php _e('Wrap in container DIV:'); ?></label><br />
|
<label for="<?php echo $this->get_field_id('navdiv'); ?>"><?php _e('Wrap in container DIV:'); ?></label><br />
|
||||||
<span class="checkboxes">
|
<span class="checkboxes">
|
||||||
<label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navdiv'); ?>" name="<?php echo $this->get_field_name('navdiv'); ?>" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
|
<label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navdiv'); ?>" name="<?php echo $this->get_field_name('navdiv'); ?>" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
|
||||||
<label>No</label><input type="radio" id="<?php echo $this->get_field_name('navdiv'); ?>" name="<?php echo $this->get_field_name('navdiv'); ?>" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
|
<label>No</label><input type="radio" id="<?php echo $this->get_field_name('navdiv'); ?>" name="<?php echo $this->get_field_name('navdiv'); ?>" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
|
||||||
</span><!-- /.checkboxes -->
|
</span><!-- /.checkboxes -->
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($checked == 'yes')
|
if ($checked == 'yes')
|
||||||
{
|
{
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<label for="<?php echo $this->get_field_id('navdivid'); ?>"><?php _e('DIV id:'); ?></label>
|
<label for="<?php echo $this->get_field_id('navdivid'); ?>"><?php _e('DIV id:'); ?></label>
|
||||||
<input type="text" name="<?php echo $this->get_field_name('navdivid'); ?>" value="<?php echo $navdivid; ?>" class="widefat" id="<?php echo $this->get_field_id('navdivid'); ?>" />
|
<input type="text" name="<?php echo $this->get_field_name('navdivid'); ?>" value="<?php echo $navdivid; ?>" class="widefat" id="<?php echo $this->get_field_id('navdivid'); ?>" />
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<label for="<?php echo $this->get_field_id('navdivclass'); ?>"><?php _e('DIV class:'); ?></label>
|
<label for="<?php echo $this->get_field_id('navdivclass'); ?>"><?php _e('DIV class:'); ?></label>
|
||||||
<input type="text" name="<?php echo $this->get_field_name('navdivclass'); ?>" value="<?php echo $navdivclass; ?>" class="widefat" id="<?php echo $this->get_field_id('navdivclass'); ?>" />
|
<input type="text" name="<?php echo $this->get_field_name('navdivclass'); ?>" value="<?php echo $navdivclass; ?>" class="widefat" id="<?php echo $this->get_field_id('navdivclass'); ?>" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
$checked = strtolower($navul);
|
$checked = strtolower($navul);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<label for="<?php echo $this->get_field_id('navul'); ?>"><?php _e('Wrap in container UL:'); ?></label><br />
|
<label for="<?php echo $this->get_field_id('navul'); ?>"><?php _e('Wrap in container UL:'); ?></label><br />
|
||||||
<span class="checkboxes">
|
<span class="checkboxes">
|
||||||
<label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navul'); ?>" name="<?php echo $this->get_field_name('navul'); ?>" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
|
<label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navul'); ?>" name="<?php echo $this->get_field_name('navul'); ?>" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
|
||||||
<label>No</label><input type="radio" id="<?php echo $this->get_field_name('navul'); ?>" name="<?php echo $this->get_field_name('navul'); ?>" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
|
<label>No</label><input type="radio" id="<?php echo $this->get_field_name('navul'); ?>" name="<?php echo $this->get_field_name('navul'); ?>" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
|
||||||
</span><!-- /.checkboxes -->
|
</span><!-- /.checkboxes -->
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($checked == 'yes')
|
if ($checked == 'yes')
|
||||||
{
|
{
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<label for="<?php echo $this->get_field_id('navulid'); ?>"><?php _e('UL id:'); ?></label>
|
<label for="<?php echo $this->get_field_id('navulid'); ?>"><?php _e('UL id:'); ?></label>
|
||||||
<input type="text" name="<?php echo $this->get_field_name('navulid'); ?>" value="<?php echo $navulid; ?>" class="widefat" id="<?php echo $this->get_field_id('navulid'); ?>" />
|
<input type="text" name="<?php echo $this->get_field_name('navulid'); ?>" value="<?php echo $navulid; ?>" class="widefat" id="<?php echo $this->get_field_id('navulid'); ?>" />
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<label for="<?php echo $this->get_field_id('navulclass'); ?>"><?php _e('UL class:'); ?></label>
|
<label for="<?php echo $this->get_field_id('navulclass'); ?>"><?php _e('UL class:'); ?></label>
|
||||||
<input type="text" name="<?php echo $this->get_field_name('navulclass'); ?>" value="<?php echo $navulclass; ?>" class="widefat" id="<?php echo $this->get_field_id('navulclass'); ?>" />
|
<input type="text" name="<?php echo $this->get_field_name('navulclass'); ?>" value="<?php echo $navulclass; ?>" class="widefat" id="<?php echo $this->get_field_id('navulclass'); ?>" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?php $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options'); ?>
|
<?php $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options'); ?>
|
||||||
<p <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?>>
|
<p <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?>>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$checked = strtolower($navwidgetdescription);
|
$checked = strtolower($navwidgetdescription);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<label for="<?php echo $this->get_field_id('navwidgetdescription'); ?>"><?php _e('Show Top Level Descriptions:'); ?></label><br />
|
<label for="<?php echo $this->get_field_id('navwidgetdescription'); ?>"><?php _e('Show Top Level Descriptions:'); ?></label><br />
|
||||||
<span class="checkboxes">
|
<span class="checkboxes">
|
||||||
<label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navwidgetdescription'); ?>" name="<?php echo $this->get_field_name('navwidgetdescription'); ?>" value="1" <?php if ($checked=='1') { echo 'checked="checked"'; } ?> />
|
<label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navwidgetdescription'); ?>" name="<?php echo $this->get_field_name('navwidgetdescription'); ?>" value="1" <?php if ($checked=='1') { echo 'checked="checked"'; } ?> />
|
||||||
<label>No</label><input type="radio" id="<?php echo $this->get_field_name('navwidgetdescription'); ?>" name="<?php echo $this->get_field_name('navwidgetdescription'); ?>" value="2" <?php if ($checked=='1') { } else { echo 'checked="checked"'; } ?> />
|
<label>No</label><input type="radio" id="<?php echo $this->get_field_name('navwidgetdescription'); ?>" name="<?php echo $this->get_field_name('navwidgetdescription'); ?>" value="2" <?php if ($checked=='1') { } else { echo 'checked="checked"'; } ?> />
|
||||||
</span><!-- /.checkboxes -->
|
</span><!-- /.checkboxes -->
|
||||||
</p>
|
</p>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
//Do nothing
|
//Do nothing
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//Error message for menus not existing
|
//Error message for menus not existing
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
@ -1370,7 +1370,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1408,9 +1408,9 @@ function wp_widgets_init() {
|
|||||||
register_widget('WP_Widget_RSS');
|
register_widget('WP_Widget_RSS');
|
||||||
|
|
||||||
register_widget('WP_Widget_Tag_Cloud');
|
register_widget('WP_Widget_Tag_Cloud');
|
||||||
|
|
||||||
register_widget('WP_CustomNavWidget');
|
register_widget('WP_CustomNavWidget');
|
||||||
|
|
||||||
do_action('widgets_init');
|
do_action('widgets_init');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2062,7 +2062,7 @@ function get_link($bookmark_id, $output = OBJECT, $filter = 'raw') {
|
|||||||
* @since 2.3.1
|
* @since 2.3.1
|
||||||
* @deprecated 2.8.0
|
* @deprecated 2.8.0
|
||||||
* @deprecated Use esc_url_raw()
|
* @deprecated Use esc_url_raw()
|
||||||
* @see esc_url_raw()
|
* @see esc_url_raw()
|
||||||
*
|
*
|
||||||
* @param string $url The URL to be cleaned.
|
* @param string $url The URL to be cleaned.
|
||||||
* @param array $protocols An array of acceptable protocols.
|
* @param array $protocols An array of acceptable protocols.
|
||||||
|
@ -610,7 +610,7 @@ function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' )
|
|||||||
* Removes option by name. Prevents removal of protected WordPress options.
|
* Removes option by name. Prevents removal of protected WordPress options.
|
||||||
*
|
*
|
||||||
* @package WordPress
|
* @package WordPress
|
||||||
* @subpackage Option
|
* @subpackage Option
|
||||||
* @since 1.2.0
|
* @since 1.2.0
|
||||||
*
|
*
|
||||||
* @uses do_action() Calls 'delete_option' hook before option is deleted.
|
* @uses do_action() Calls 'delete_option' hook before option is deleted.
|
||||||
|
@ -713,7 +713,7 @@ function single_tag_title($prefix = '', $display = true ) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
$tag = $wp_query->get_queried_object();;
|
$tag = $wp_query->get_queried_object();;
|
||||||
|
|
||||||
if ( ! $tag )
|
if ( ! $tag )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1012,7 +1012,7 @@ class WP_Http_Streams {
|
|||||||
'max_redirects' => $r['redirection'] + 1, // See #11557
|
'max_redirects' => $r['redirection'] + 1, // See #11557
|
||||||
'protocol_version' => (float) $r['httpversion'],
|
'protocol_version' => (float) $r['httpversion'],
|
||||||
'header' => $strHeaders,
|
'header' => $strHeaders,
|
||||||
'ignore_errors' => true, // Return non-200 requests.
|
'ignore_errors' => true, // Return non-200 requests.
|
||||||
'timeout' => $r['timeout'],
|
'timeout' => $r['timeout'],
|
||||||
'ssl' => array(
|
'ssl' => array(
|
||||||
'verify_peer' => $ssl_verify,
|
'verify_peer' => $ssl_verify,
|
||||||
|
@ -34,7 +34,7 @@ function ms_upload_constants( ) {
|
|||||||
*/
|
*/
|
||||||
function ms_cookie_constants( ) {
|
function ms_cookie_constants( ) {
|
||||||
global $current_site;
|
global $current_site;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 1.2.0
|
* @since 1.2.0
|
||||||
*/
|
*/
|
||||||
|
@ -397,16 +397,16 @@ function wp_default_scripts( &$scripts ) {
|
|||||||
) );
|
) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Custom Navigation
|
//Custom Navigation
|
||||||
|
|
||||||
$scripts->add( 'custom-navigation-ui-custom', '/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.js', array('jquery'), '1.7.2' );
|
$scripts->add( 'custom-navigation-ui-custom', '/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.js', array('jquery'), '1.7.2' );
|
||||||
$scripts->add_data( 'custom-navigation-ui-custom', 'group', 1 );
|
$scripts->add_data( 'custom-navigation-ui-custom', 'group', 1 );
|
||||||
|
|
||||||
$scripts->add( 'custom-navigation-default-items', "/wp-admin/js/custom-navigation-default-items$suffix.js", false, '20100220' );
|
$scripts->add( 'custom-navigation-default-items', "/wp-admin/js/custom-navigation-default-items$suffix.js", false, '20100220' );
|
||||||
$scripts->add( 'custom-navigation-dynamic-functions', "/wp-admin/js/custom-navigation-dynamic-functions$suffix.js", false, '20100220' );
|
$scripts->add( 'custom-navigation-dynamic-functions', "/wp-admin/js/custom-navigation-dynamic-functions$suffix.js", false, '20100220' );
|
||||||
$scripts->add( 'custom-navigation-php-functions', "/wp-admin/js/custom-navigation-php-functions$suffix.js", false, '20100220' );
|
$scripts->add( 'custom-navigation-php-functions', "/wp-admin/js/custom-navigation-php-functions$suffix.js", false, '20100220' );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -473,7 +473,7 @@ function wp_default_styles( &$styles ) {
|
|||||||
$styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
|
$styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
|
||||||
$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
|
$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
|
||||||
$styles->add( 'custom-navigation', "/wp-admin/css/custom-navigation$suffix.css", array(), '20100215' );
|
$styles->add( 'custom-navigation', "/wp-admin/css/custom-navigation$suffix.css", array(), '20100215' );
|
||||||
|
|
||||||
foreach ( $rtl_styles as $rtl_style )
|
foreach ( $rtl_styles as $rtl_style )
|
||||||
$styles->add_data( $rtl_style, 'rtl', true );
|
$styles->add_data( $rtl_style, 'rtl', true );
|
||||||
}
|
}
|
||||||
|
@ -243,7 +243,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
|
|||||||
if ( empty($args[$cap]) )
|
if ( empty($args[$cap]) )
|
||||||
$args[$cap] = 'manage_categories';
|
$args[$cap] = 'manage_categories';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( empty($args['singular_label']) )
|
if ( empty($args['singular_label']) )
|
||||||
$args['singular_label'] = $args['label'];
|
$args['singular_label'] = $args['label'];
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ elseif ( is_feed() ) :
|
|||||||
do_feed();
|
do_feed();
|
||||||
return;
|
return;
|
||||||
elseif ( is_trackback() ) :
|
elseif ( is_trackback() ) :
|
||||||
include( ABSPATH . 'wp-trackback.php' );
|
include( ABSPATH . 'wp-trackback.php' );
|
||||||
return;
|
return;
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ wp_fix_server_vars();
|
|||||||
// Check for the required PHP version and for the MySQL extension or a database drop-in.
|
// Check for the required PHP version and for the MySQL extension or a database drop-in.
|
||||||
wp_check_php_mysql_versions();
|
wp_check_php_mysql_versions();
|
||||||
|
|
||||||
// Check if we have recieved a request due to missing favicon.ico
|
// Check if we have recieved a request due to missing favicon.ico
|
||||||
wp_favicon_request();
|
wp_favicon_request();
|
||||||
|
|
||||||
// Check if we're in maintenance mode.
|
// Check if we're in maintenance mode.
|
||||||
|
Loading…
Reference in New Issue
Block a user