first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,159 @@
<?php
$update_data = wp_get_update_data();
$awaiting_mod = wp_count_comments();
$awaiting_mod = $awaiting_mod->moderated;
$current_user = wp_get_current_user();
if( is_multisite() ) {
$current_site = get_current_site();
}
?>
<div id="list_variables">
<div class="list_variables_wrap">
<table class="widefat fixed">
<thead>
<tr>
<th><?php _e( 'Shortcodes' , 'wp-admin-ui-customize' ); ?></th>
<th><?php _e( 'Value' ); ?></th>
</tr>
</thead>
<tbody>
<?php if( is_multisite() ) : ?>
<tr>
<th><strong>[site_name]</strong></th>
<td>
<code><?php echo esc_attr( $current_site->site_name ); ?></code>
</td>
</tr>
<tr>
<th><strong>[site_url]</strong></th>
<td>
<?php $protocol = is_ssl() ? 'https://' : 'http://'; ?>
<code><?php echo $protocol . esc_attr( $current_site->domain . $current_site->path );?></code>
</td>
</tr>
<?php endif; ?>
<tr>
<th><strong>[blog_name]</strong></th>
<td>
<code><?php echo get_bloginfo( 'name' ); ?></code>
<?php if( is_multisite() ) : ?>
<span class="description"><?php _e( 'Blog name of logged in.' , 'wp-admin-ui-customize' ); ?></span>
<?php endif; ?>
</td>
</tr>
<tr>
<th><strong>[blog_url]</strong></th>
<td>
<code><?php echo get_bloginfo( 'url' ); ?></code>
<?php if( is_multisite() ) : ?>
<span class="description"><?php _e( 'Blog URL of logged in.' , 'wp-admin-ui-customize' ); ?></span>
<?php endif; ?>
</td>
</tr>
<tr>
<th><strong>[template_directory_uri]</strong></th>
<td>
<code><?php echo get_bloginfo( 'template_directory' ); ?></code>
</td>
</tr>
<tr>
<th><strong>[stylesheet_directory_uri]</strong></th>
<td>
<code><?php echo get_stylesheet_directory_uri(); ?></code>
</td>
</tr>
<tr>
<th><strong>[update_total]</strong></th>
<td>
<code>&lt;span class=&quot;update-plugins count-<?php echo $update_data["counts"]["total"]; ?>&quot;&gt;&lt;span class=&quot;update-count&quot;&gt;<strong><?php echo number_format_i18n( $update_data["counts"]["total"] ); ?></strong>&lt;/span&gt;&lt;/span&gt;</code>
</td>
</tr>
<tr>
<th><strong>[update_plugins]</strong></th>
<td>
<code>&lt;span class=&quot;update-plugins count-<?php echo $update_data["counts"]["plugins"]; ?>&quot;&gt;&lt;span class=&quot;plugin-count&quot;&gt;<strong><?php echo number_format_i18n( $update_data["counts"]["plugins"] ); ?></strong>&lt;/span&gt;&lt;/span&gt;</code>
</td>
</tr>
<tr>
<th><strong>[update_themes]</strong></th>
<td>
<code>&lt;span class=&quot;update-plugins count-<?php echo $update_data["counts"]["themes"]; ?>&quot;&gt;&lt;span class=&quot;theme-count&quot;&gt;<strong><?php echo number_format_i18n( $update_data["counts"]["themes"] ); ?></strong>&lt;/span&gt;&lt;/span&gt;</code>
</td>
</tr>
<tr>
<th><strong>[comment_count]</strong></th>
<td>
<code>&lt;span class&quot;ab-icon&quot;&gt&lt;/span&gt; &lt;span id=&quot;ab-awaiting-mod&quot; class=&quot;ab-label awaiting-mod pending-count count-<?php echo $awaiting_mod; ?>&quot;&gt;<strong><?php echo number_format_i18n( $awaiting_mod ); ?></strong>&lt;/span&gt;</code>
</td>
</tr>
<tr>
<th><strong>[comment_count_format]</strong></th>
<td>
<code><?php echo $awaiting_mod; ?></code>
</td>
</tr>
<tr>
<th><strong>[user_name]</strong></th>
<td>
<code><?php echo $current_user->display_name; ?></code>
<span class="description"><?php _e( 'In your case.' , 'wp-admin-ui-customize' ); ?></span>
</td>
</tr>
<tr>
<th><strong>[user_login_name]</strong></th>
<td>
<code><?php echo $current_user->user_login; ?></code>
<span class="description"><?php _e( 'In your case.' , 'wp-admin-ui-customize' ); ?></span>
</td>
</tr>
<tr>
<th><strong>[user_avatar]</strong></th>
<td>
<code><?php echo get_avatar( $current_user->ID , 16 ); ?></code>
<span class="description"><?php _e( 'In your case.' , 'wp-admin-ui-customize' ); ?></span>
</td>
</tr>
<tr>
<th><strong>[user_avatar_64]</strong></th>
<td>
<code><?php echo get_avatar( $current_user->ID , 64 ); ?></code>
<span class="description"><?php _e( 'In your case.' , 'wp-admin-ui-customize' ); ?></span>
</td>
</tr>
<tr>
<th><strong>[post_type]</strong></th>
<td>
<code><?php _e( 'Posts' ); ?></code>
<span class="description"><?php _e( 'Current Post Type Name' , 'wp-admin-ui-customize' ); ?> ( <?php _e( 'Pages' ); ?>/<?php _e( 'Categories' ); ?>/<?php _e( 'Tags' ); ?>/<?php _e( 'Custom Post Type' , 'wp-admin-ui-customize' ); ?>)</span>
</td>
</tr>
<?php if( !empty( $this->ActivatedPlugin ) ) : ?>
<?php $activated_plugins = $this->ActivatedPlugin; ?>
<?php if( !empty( $activated_plugins['woocommerce'] ) ) : ?>
<?php if( function_exists( 'wc_processing_order_count' ) ) : ?>
<?php $order_count = intval( wc_processing_order_count() ); ?>
<?php if( !empty( $order_count ) ) : ?>
<tr>
<th><strong>[woocommerce_order_process_count]</strong></th>
<td>
<code>&lt;span class=&quot;awaiting-mod update-plugins count-<?php echo $order_count ?>&quot;&gt;&lt;span class=&quot;processing-count&quot;><?php echo number_format_i18n( $order_count ); ?>&lt;/span&gt;&lt;/span&gt;</code>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>

View File

@@ -0,0 +1,77 @@
<?php
$Data = $this->get_data( 'user_role' );
$UserRoles = $this->get_user_role();
// include js css
$ReadedJs = array( 'jquery' , 'jquery-ui-sortable' );
wp_enqueue_script( $this->PageSlug , $this->Url . $this->PluginSlug . '.js', $ReadedJs , $this->Ver );
wp_enqueue_style( $this->PageSlug , $this->Url . $this->PluginSlug . '.css', array() , $this->Ver );
?>
<div class="wrap">
<?php echo $this->Msg; ?>
<h2><?php _e( 'Reset Settings' , 'wp-admin-ui-customize' ); ?></h2>
<p>&nbsp;</p>
<form id="wauc_reset_userrole" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="user_role" />
<h3><?php _e( 'Applied user roles' , 'wp-admin-ui-customize' ); ?></h3>
<ul class="description">
<?php foreach( $Data as $key => $val ) : ?>
<?php if( !empty( $UserRoles[$key] ) ): ?>
<li><?php echo $UserRoles[$key]["label"]; ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<br />
<p><?php printf( __( 'Reset the %s?' , 'wp-admin-ui-customize' ) , __( 'User Roles Settings' , 'wp-admin-ui-customize' ) ); ?></p>
<p class="submit">
<input type="submit" class="button-primary" name="reset" value="<?php echo esc_attr( __( 'Reset User Roles Settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
</form>
<p>&nbsp;</p>
<h2><?php _e( 'Reset all settings' , 'wp-admin-ui-customize' ); ?></h2>
<form id="wauc_reset_all_settings" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="all_settings" />
<p><?php _e( 'All settings below will be deleted.' , 'wp-admin-ui-customize' ); ?></p>
<ul class="description">
<li><?php _e( 'Frontend' , 'wp-admin-ui-customize' ); ?></li>
<li><?php printf( __( '%1$s %2$s' , 'wp-admin-ui-customize' ) , __( 'General' ) , __( 'Settings' ) ); ?></li>
<li><?php _e( 'Dashboard' ); ?></li>
<li><?php _e( 'Admin bar' , 'wp-admin-ui-customize' ); ?></li>
<li><?php _e( 'Sidebar' , 'wp-admin-ui-customize' ); ?></li>
<li><?php _e( 'Meta boxes' , 'wp-admin-ui-customize' ); ?></li>
<li><?php _e( 'Posts and Pages' , 'wp-admin-ui-customize' ); ?></li>
<li><?php _e( 'Appearance Menus' , 'wp-admin-ui-customize' ); ?></li>
<li><?php _e( 'Login Form' , 'wp-admin-ui-customize' ); ?></li>
<li><?php printf( __( '%1$s of %2$s %3$s' , 'wp-admin-ui-customize' ) , __( 'Change' ) , __( 'Plugin' ) , __( 'Capabilities' ) ); ?></li>
</ul>
<br />
<p><?php _e( 'Are you sure you want to delete all settings?' , 'wp-admin-ui-customize' ); ?></p>
<p class="submit">
<input type="submit" class="button-primary" name="reset" value="<?php echo esc_attr( __( 'Reset all settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
</form>
</div>
<style>
</style>
<script>
jQuery(document).ready( function($) {
});
</script>

View File

@@ -0,0 +1,358 @@
<?php
$Data = $this->get_data( 'admin_bar_menu' );
$AllDefaultNodes = $this->admin_bar_filter_load();
$Place_types = $this->admin_bar_places();
// include js css
$ReadedJs = array( 'jquery' , 'jquery-ui-draggable' , 'jquery-ui-droppable' , 'jquery-ui-sortable' , 'thickbox' );
wp_enqueue_script( $this->PageSlug , $this->Url . $this->PluginSlug . '.js', $ReadedJs , $this->Ver );
wp_enqueue_style('thickbox');
wp_enqueue_style( $this->PageSlug , $this->Url . $this->PluginSlug . '.css', array() , $this->Ver );
?>
<div class="wrap">
<?php echo $this->Msg; ?>
<h2><?php _e( 'Admin bar' , 'wp-admin-ui-customize' ); ?></h2>
<p><?php _e( 'Drag menu items to edit and reorder menus.' , 'wp-admin-ui-customize' ); ?></p>
<p><strong><?php _e( 'Note: Using the same menu item multiple times could cause unexpected behavior.' , 'wp-admin-ui-customize' ); ?></strong></p>
<p class="description"><?php _e( 'You can use multiple custom menus.' , 'wp-admin-ui-customize' ); ?></p>
<h3 id="wauc-apply-user-roles"><?php echo $this->get_apply_roles(); ?></h3>
<p><a href="#TB_inline?height=300&width=600&inlineId=list_variables&modal=false" title="<?php _e( 'Shortcodes' , 'wp-admin-ui-customize' ); ?>" class="thickbox"><?php _e( 'Available Shortcodes' , 'wp-admin-ui-customize' ); ?></a></p>
<form id="wauc_setting_admin_bar_menu" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="admin_bar_menu" />
<p></p>
<p><?php _e( 'Sub menus can be a maximum of four levels deep.' , 'wp-admin-ui-customize' ); ?></p>
<p><a href="<?php esc_url( $this->get_document_link( 'admin_bar' ) ); ?>" target="_blank" class="button-secondary"><?php _e( 'Additional documentation' , 'wp-admin-ui-customize' ); ?></a></p>
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-2">
<?php foreach( $Place_types as $place => $place_label ) : ?>
<?php if( $place != 'front' ) : ?>
<?php if( $place == 'left' ) : $box_id = 2; else: $box_id = 1; endif; ?>
<div id="postbox-container-<?php echo $box_id; ?>" class="postbox-container">
<div id="<?php echo $place; ?>_menus">
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php echo $place_label; ?><?php _e( 'Menus' ); ?></span></h3>
<div class="inside widgets-holder-wrap">
<?php if( empty( $Data ) ) : ?>
<?php $Nodes = $AllDefaultNodes; ?>
<?php else: ?>
<?php $Nodes = $Data; ?>
<?php endif; ?>
<?php if( !empty( $Nodes[$place]["main"] ) ) : ?>
<?php foreach( $Nodes[$place]["main"] as $main_node ) : ?>
<?php if ( is_object( $main_node ) ) $main_node = (array) $main_node; ?>
<?php if ( !isset( $main_node["group"] ) ) $main_node["group"] = ""; ?>
<?php $menu_widget = array( 'id' => $main_node["id"] , 'title' => stripslashes( $main_node["title"] ) , 'parent' => '' , 'href' => $main_node["href"] , 'group' => $main_node["group"] , 'meta' => $main_node["meta"] , 'new' => false ); ?>
<?php $this->admin_bar_menu_widget( $Nodes[$place] , $menu_widget , 'main' ); ?>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
<br class="clear">
</div>
</div>
<p class="submit">
<input type="submit" class="button-primary" name="update" value="<?php echo esc_attr( __( 'Save' ) ); ?>" />
</p>
<p class="submit reset">
<span class="description"><?php printf( __( 'Reset the %s?' , 'wp-admin-ui-customize' ) , __( 'Admin bar' , 'wp-admin-ui-customize' ) . __( 'Settings' ) ); ?></span>
<input type="submit" class="button-secondary" name="reset" value="<?php echo esc_attr( __( 'Reset settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
</form>
<h3><?php _e ( 'Available menu items' , 'wp-admin-ui-customize' ); ?></h3>
<div id="can_menus" class="metabox-holder columns-1">
<div class="postbox">
<div class="inside">
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php _e( 'Custom' , 'wp-admin-ui-customize' ); ?> <?php _e( 'Menus' ); ?></span></h3>
<div class="inside">
<?php $menu_widget = array( 'id' => "custom_node" , 'title' => "" , 'parent' => '' , 'href' => "" , 'group' => "" , 'meta' => array() , 'new' => true ); ?>
<?php $this->admin_bar_menu_widget( $AllDefaultNodes["front"] , $menu_widget , 'custom' ); ?>
<?php $menu_widget = array( 'id' => "custom_node" , 'title' => "" , 'parent' => '' , 'href' => "" , 'group' => 1 , 'meta' => array() , 'new' => true ); ?>
<?php $this->admin_bar_menu_widget( $AllDefaultNodes["front"] , $menu_widget , 'custom' ); ?>
<div class="clear"></div>
</div>
</div>
<?php foreach( $Place_types as $place => $place_label ) : ?>
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php echo $place_label; ?> <?php _e( 'Menus' ); ?></span></h3>
<div class="inside">
<?php if( !empty( $AllDefaultNodes[$place] ) ) : ?>
<?php foreach( $AllDefaultNodes[$place]["main"] as $main_node_id => $main_node ) : ?>
<p class="description"><?php echo $main_node_id; ?></p>
<?php $menu_widget = array( 'id' => $main_node_id , 'title' => stripslashes( $main_node->title ) , 'parent' => '' , 'href' => $main_node->href , 'group' => $main_node->group , 'meta' => $main_node->meta , 'new' => true ); ?>
<?php $this->admin_bar_menu_widget( $AllDefaultNodes[$place] , $menu_widget , 'main' ); ?>
<?php foreach( $AllDefaultNodes[$place]["sub"] as $sub_node_id => $sub_node ) : ?>
<?php if( $sub_node->parent == $main_node_id ) : ?>
<?php $menu_widget = array( 'id' => $sub_node_id , 'title' => stripslashes( $sub_node->title ) , 'parent' => '' , 'href' => $sub_node->href , 'group' => $sub_node->group , 'meta' => $sub_node->meta , 'new' => true ); ?>
<?php $this->admin_bar_menu_widget( $AllDefaultNodes[$place] , $menu_widget , 'sub' ); ?>
<?php if( !empty( $AllDefaultNodes[$place]["sub2"] ) ) : ?>
<?php foreach( $AllDefaultNodes[$place]["sub2"] as $sub_node_id2 => $sub_node2 ) : ?>
<?php if( $sub_node2->parent == $sub_node_id ) : ?>
<?php $menu_widget = array( 'id' => $sub_node_id2 , 'title' => stripslashes( $sub_node2->title ) , 'parent' => '' , 'href' => $sub_node2->href , 'group' => $sub_node2->group , 'meta' => $sub_node2->meta , 'new' => true ); ?>
<?php $this->admin_bar_menu_widget( $AllDefaultNodes[$place] , $menu_widget , 'sub2' ); ?>
<?php if( !empty( $AllDefaultNodes[$place]["sub3"] ) ) : ?>
<?php foreach( $AllDefaultNodes[$place]["sub3"] as $sub_node_id3 => $sub_node3 ) : ?>
<?php if( $sub_node3->parent == $sub_node_id2 ) : ?>
<?php $menu_widget = array( 'id' => $sub_node_id3 , 'title' => stripslashes( $sub_node3->title ) , 'parent' => '' , 'href' => $sub_node3->href , 'group' => $sub_node3->group , 'meta' => $sub_node3->meta , 'new' => true ); ?>
<?php $this->admin_bar_menu_widget( $AllDefaultNodes[$place] , $menu_widget , 'sub3' ); ?>
<?php if( !empty( $AllDefaultNodes[$place]["sub4"] ) ) : ?>
<?php foreach( $AllDefaultNodes[$place]["sub4"] as $sub_node_id4 => $sub_node4 ) : ?>
<?php if( $sub_node4->parent == $sub_node_id3 ) : ?>
<?php $menu_widget = array( 'id' => $sub_node_id4 , 'title' => stripslashes( $sub_node4->title ) , 'parent' => '' , 'href' => $sub_node4->href , 'group' => $sub_node4->group , 'meta' => $sub_node4->meta , 'new' => true ); ?>
<?php $this->admin_bar_menu_widget( $AllDefaultNodes[$place] , $menu_widget , 'sub4' ); ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<div class="clear"></div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<?php require_once( dirname( __FILE__ ) . '/list_variables.php' ); ?>
<style>
.widget h4 {
padding: 10px 15px;
}
.widget-top a.widget-action {
cursor: pointer;
display: inline-block;
}
.widget-top a.widget-action:focus {
box-shadow: none;
}
.widget-top a.widget-action:before {
display: inline-block;
content: "\f140";
font: normal 20px/1 dashicons;
}
.widget.ui-draggable-dragging {
min-width: 170px;
}
</style>
<script type="text/javascript">
var wauc_widget_each, wauc_menu_sortable;
jQuery(document).ready(function($) {
var $Form = $("#wauc_setting_admin_bar_menu");
var $AddInside = $('#can_menus .postbox .inside');
var $SettingInside = $('#poststuff #post-body .postbox-container .postbox .inside', $Form);
$AddInside.children('.widget').draggable({
connectToSortable: '#poststuff #post-body .postbox-container .postbox .inside',
handle: '> .widget-top > .widget-title',
distance: 2,
helper: 'clone',
zIndex: 5,
stop: function(e,ui) {
wauc_widget_each();
wauc_menu_sortable();
}
});
$('#can_menus').droppable({
tolerance: 'pointer',
accept: function(o){
return $(o).parent().parent().parent().parent().parent().parent().parent().attr('class') != 'columns-1';
},
drop: function(e,ui) {
ui.draggable.addClass('deleting');
},
over: function(e,ui) {
ui.draggable.addClass('deleting');
$('div.widget-placeholder').hide();
},
out: function(e,ui) {
ui.draggable.removeClass('deleting');
$('div.widget-placeholder').show();
}
});
$(document).on('click', '.widget .widget-top .widget-title-action', function() {
$(this).parent().parent().children('.widget-inside').slideToggle( 300 );
return false;
});
$(document).on('click', '.widget .widget-inside .widget-control-actions .alignleft a[href="#remove"]', function() {
$(this).parent().parent().parent().parent().slideUp('normal', function() { $(this).remove(); } );
return false;
});
wauc_menu_sortable = function menu_sortable() {
$('#wauc_setting_admin_bar_menu #poststuff #post-body .postbox-container .postbox .inside, #wauc_setting_admin_bar_menu #poststuff #post-body .postbox-container .postbox .inside .widget .widget-inside .submenu').sortable({
placeholder: "widget-placeholder",
items: '> .widget',
connectWith: "#wauc_setting_admin_bar_menu #poststuff #post-body .postbox-container .postbox .inside, #wauc_setting_admin_bar_menu #poststuff #post-body .postbox-container .postbox .inside .widget .widget-inside .submenu",
handle: '> .widget-top > .widget-title',
cursor: 'move',
distance: 2,
change: function(e,ui) {
var $height = ui.helper.height();
$('#wauc_setting_admin_bar_menu #poststuff #post-body .postbox-container .postbox .inside .widget-placeholder').height($height);
},
stop: function(e,ui) {
if ( ui.item.hasClass('deleting') ) {
ui.item.remove();
}
ui.item.attr( 'style', '' ).removeClass('ui-draggable');
wauc_widget_each();
},
});
}
wauc_menu_sortable();
wauc_widget_each = function widget_each() {
var $Count = 0;
$('.widget', '#wauc_setting_admin_bar_menu #poststuff').each(function() {
var $InputId = $(this).children(".widget-inside").children(".settings").children(".field-url").children(".idtext");
var $InputLink = $(this).children(".widget-inside").children(".settings").children(".field-url").children(".linktext");
var $InputTitle = $(this).children(".widget-inside").children(".settings").children(".field-title").children("label").children(".titletext");
var $InputGourp = $(this).children(".widget-inside").children(".settings").children(".group");
var $InputMetaClass = $(this).children(".widget-inside").children(".settings").children(".field-meta").children(".meta_class");
var $InputMetaTarget = $(this).children(".widget-inside").children(".settings").children(".field-meta").children("label").children(".meta_target");
var $InputParentName = $(this).children(".widget-inside").children(".settings").children(".parent");
var $InputNodeType = $(this).children(".widget-inside").children(".settings").children(".node_type");
var $BoxName = "";
var $NodeType = "";
if( $(this).parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().hasClass("submenu") ) {
$BoxName = $(this).parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().attr("id");
$NodeType = "sub4";
} else if( $(this).parent().parent().parent().parent().parent().parent().parent().hasClass("submenu") ) {
$BoxName = $(this).parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().attr("id");
$NodeType = "sub3";
} else if( $(this).parent().parent().parent().parent().hasClass("submenu") ) {
$BoxName = $(this).parent().parent().parent().parent().parent().parent().parent().parent().parent().attr("id");
$NodeType = "sub2";
} else if( $(this).parent().hasClass("submenu") ) {
$BoxName = $(this).parent().parent().parent().parent().parent().parent().attr("id");
$NodeType = "sub";
} else {
$BoxName = $(this).parent().parent().parent().attr("id");
$NodeType = "main";
}
if( $BoxName ) {
var $BarType = $BoxName.replace( '_menus' , '');
}
if( $(this).hasClass("custom_node") ) {
var $CustomVal = $InputId.val();
$InputId.val( $CustomVal + Math.ceil( Math.random() * 1000 ) );
} else if( $(this).hasClass("newcustom_node") ) {
var $CustomVal = $InputId.val();
var $CustomClassName = $CustomVal + Math.ceil( Math.random() * 1000 );
$InputId.val( $CustomClassName );
$(this).removeClass("newcustom_node");
$(this).addClass( $CustomClassName );
}
var $Name = 'data' + '[' + $BarType + ']['+$Count+']';
$InputId.attr("name", $Name+'[id]');
$InputLink.attr("name", $Name+'[href]');
$InputTitle.attr("name", $Name+'[title]');
$InputGourp.attr("name", $Name+'[group]');
$InputMetaClass.attr("name", $Name+'[meta][class]');
$InputMetaTarget.attr("name", $Name+'[meta][target]');
$InputParentName.attr("name", $Name+'[parent]');
$InputNodeType.attr("name", $Name+'[node_type]');
$InputNodeType.val( $NodeType );
if ( $(this).parent().hasClass("submenu") ) {
var $ParentId = $(this).parent().parent().children(".settings").children(".description").children(".idtext").val();
$InputParentName.val($ParentId);
} else {
$InputParentName.val('');
}
$Count++;
});
}
wauc_widget_each();
});
</script>

View File

@@ -0,0 +1,207 @@
<?php
$Data = $this->get_data( 'admin_general' );
// include js css
$ReadedJs = array( 'jquery' , 'jquery-ui-sortable' , 'thickbox' );
wp_enqueue_script( $this->PageSlug , $this->Url . $this->PluginSlug . '.js', $ReadedJs , $this->Ver );
wp_enqueue_style('thickbox');
wp_enqueue_style( $this->PageSlug , $this->Url . $this->PluginSlug . '.css', array() , $this->Ver );
?>
<div class="wrap">
<?php echo $this->Msg; ?>
<h2><?php printf( __( '%1$s %2$s' , 'wp-admin-ui-customize' ) , __( 'General' ) , __( 'Settings' ) ); ?></h2>
<p>&nbsp;</p>
<h3 id="wauc-apply-user-roles"><?php echo $this->get_apply_roles(); ?></h3>
<form id="wauc_setting_admin_general" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="admin_general" />
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-1">
<div id="postbox-container-1" class="postbox-container">
<div id="admin_general">
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php echo _e( 'Notifications' , 'wp-admin-ui-customize' ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<tr>
<th>
<label><?php _e( 'WordPress core updates' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $field = 'notice_update_core'; ?>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide notifications' , 'wp-admin-ui-customize' ); ?></label>
</td>
</tr>
<tr>
<th>
<label><?php _e( 'Plugin updates' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $field = 'notice_update_plugin'; ?>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide notifications' , 'wp-admin-ui-customize' ); ?></label>
</td>
</tr>
<tr>
<th>
<label><?php _e( 'Theme updates' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $field = 'notice_update_theme'; ?>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide notifications' , 'wp-admin-ui-customize' ); ?></label>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php echo _e( 'Screen Options and Help Tab' , 'wp-admin-ui-customize' ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<tr>
<th>
<label><?php _e( 'Screen Options' ); ?></label>
</th>
<td>
<?php $field = 'screen_option_tab'; ?>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
</td>
</tr>
<tr>
<th>
<label><?php _e( 'Help' ); ?></label>
</th>
<td>
<?php $field = 'help_tab'; ?>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php echo _e( 'Footer' , 'wp-admin-ui-customize' ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<tr>
<th>
<label><?php _e( 'Footer text' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $field = 'footer_text'; ?>
<?php $Val = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Val = stripslashes( $Data[$field] ); endif; ?>
<input type="text" name="data[<?php echo esc_attr( $field ); ?>]" value="<?php echo esc_attr( $Val ); ?>" class="large-text" />
<p class="description"><?php _e( 'Default' ); ?>: <?php _e( 'Thank you for creating with <a href="%s">WordPress</a>.' ); ?></p>
<a href="#TB_inline?height=300&width=600&inlineId=list_variables&modal=false" title="<?php _e( 'Shortcodes' , 'wp-admin-ui-customize' ); ?>" class="thickbox"><?php _e( 'Available Shortcodes' , 'wp-admin-ui-customize' ); ?></a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php _e( 'General' ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<?php $field = 'css'; ?>
<tr>
<th>
<label><?php _e( 'CSS file to load' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $Val = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Val = strip_tags( stripslashes( $Data[$field] ) ); endif; ?>
<input type="text" name="data[<?php echo esc_attr( $field ); ?>]" value="<?php echo esc_attr( $Val ); ?>" class="regular-text">
<a href="#TB_inline?height=300&width=600&inlineId=list_variables&modal=false" title="<?php _e( 'Shortcodes' , 'wp-admin-ui-customize' ); ?>" class="thickbox"><?php _e( 'Available Shortcodes' , 'wp-admin-ui-customize' ); ?></a>
</td>
</tr>
<?php $field = 'title_tag'; ?>
<tr>
<th>
<label><?php _e( 'Admin screen' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Remove "Wordpress" from title tag' , 'wp-admin-ui-customize' ); ?></label>
</td>
</tr>
<?php $field = 'resize_admin_bar'; ?>
<tr>
<th>
<label><?php _e( 'Admin bar' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Disable resizing' , 'wp-admin-ui-customize' ); ?></label>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<br class="clear">
</div>
</div>
<p class="submit">
<input type="submit" class="button-primary" name="update" value="<?php echo esc_attr( __( 'Save' ) ); ?>" />
</p>
<p class="submit reset">
<span class="description"><?php printf( __( 'Reset the %s?' , 'wp-admin-ui-customize' ) , sprintf( __( '%1$s %2$s' , 'wp-admin-ui-customize' ) , __( 'General' ) , __( 'Settings' ) ) ); ?></span>
<input type="submit" class="button-secondary" name="reset" value="<?php echo esc_attr( __( 'Reset settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
</form>
</div>
<?php require_once( dirname( __FILE__ ) . '/list_variables.php' ); ?>
<style>
</style>
<script>
jQuery(document).ready( function($) {
});
</script>

View File

@@ -0,0 +1,95 @@
<?php
$Data = $this->get_data( 'appearance_menus' );
// include js css
$ReadedJs = array( 'jquery' , 'jquery-ui-sortable' );
wp_enqueue_script( $this->PageSlug , $this->Url . $this->PluginSlug . '.js', $ReadedJs , $this->Ver );
wp_enqueue_style( $this->PageSlug , $this->Url . $this->PluginSlug . '.css', array() , $this->Ver );
?>
<div class="wrap">
<?php echo $this->Msg; ?>
<h2><?php _e( 'Appearance Menus' , 'wp-admin-ui-customize' ); ?></h2>
<p>&nbsp;</p>
<h3 id="wauc-apply-user-roles"><?php echo $this->get_apply_roles(); ?></h3>
<form id="wauc_setting_appearance_menus" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="appearance_menus" />
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-1">
<div id="postbox-container-1" class="postbox-container">
<div id="appearance_menus">
<div class="postbox">
<h3 class="hndle"><span><?php _e( 'Menus' ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<?php $field = 'add_new_menu'; ?>
<tr>
<th>
<label><?php _e( 'Create a new menu' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
<p class="description"><?php _e( 'This is useful when you want to use only the menus that have already been created.' , 'wp-admin-ui-customize' ); ?></p>
<p><img src="<?php echo esc_url( $this->Url . 'images/appearance_menus_add_new_menu.png' ); ?>" /></p>
<p><img src="<?php echo esc_url( $this->Url . 'images/appearance_menus_add_new_menu_of_location.png' ); ?>" /></p>
</td>
</tr>
<?php $field = 'delete_menu'; ?>
<tr>
<th>
<label><?php _e( 'Delete Menu' ); ?></label>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
<p class="description"><?php _e( 'This is useful when you want to use only the menus that have already been created.' , 'wp-admin-ui-customize' ); ?></p>
<p><img src="<?php echo esc_url( $this->Url . 'images/appearance_menus_delete_menu.png' ); ?>" /></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<br class="clear">
</div>
</div>
<p class="submit">
<input type="submit" class="button-primary" name="update" value="<?php echo esc_attr( __( 'Save' ) ); ?>" />
</p>
<p class="submit reset">
<span class="description"><?php printf( __( 'Reset the %s?' , 'wp-admin-ui-customize' ) , __( 'Appearance Menus' , 'wp-admin-ui-customize' ) ); ?></span>
<input type="submit" class="button-secondary" name="reset" value="<?php echo esc_attr( __( 'Reset settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
</form>
</div>
<style>
</style>
<script>
jQuery(document).ready( function($) {
});
</script>

View File

@@ -0,0 +1,193 @@
<?php
$Data = $this->get_data( 'dashboard' );
$Metaboxes = $this->get_data( "regist_dashboard_metabox" );
// include js css
$ReadedJs = array( 'jquery' , 'jquery-ui-sortable' );
wp_enqueue_script( $this->PageSlug , $this->Url . $this->PluginSlug . '.js', $ReadedJs , $this->Ver );
wp_enqueue_style( $this->PageSlug , $this->Url . $this->PluginSlug . '.css', array() , $this->Ver );
?>
<div class="wrap">
<?php echo $this->Msg; ?>
<h2><?php _e( 'Dashboard' ); ?><?php _e( 'Settings' ); ?></h2>
<p>&nbsp;</p>
<h3 id="wauc-apply-user-roles"><?php echo $this->get_apply_roles(); ?></h3>
<form id="wauc_setting_dashboard" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="dashboard" />
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-1">
<div id="postbox-container-1" class="postbox-container">
<div id="dashboard">
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php _e( 'Meta boxes' , 'wp-admin-ui-customize' ); ?></span></h3>
<div class="inside">
<?php if( !empty( $Metaboxes["metaboxes"]["dashboard"] ) ) : ?>
<table class="form-table">
<thead>
<tr>
<th>&nbsp;</th>
<td style="width: 15%;">
<input type="checkbox" name="" class="check_all" />
<strong><?php _e( 'Select All' ); ?></strong>
</td>
<td><strong><?php _e( 'Update meta box title' , 'wp-admin-ui-customize' ); ?></strong></td>
</tr>
</thead>
<tbody>
<?php $field = 'show_welcome_panel'; ?>
<tr>
<th>
<label><?php echo _x( 'Welcome', 'Welcome panel' ); ?></label>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>][remove]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
</td>
<td></td>
</tr>
<?php foreach( $Metaboxes["metaboxes"]["dashboard"] as $context => $meta_box ) : ?>
<?php foreach( $meta_box as $priority => $box ) : ?>
<?php foreach( $box as $metabox_id => $metabox_title ) : ?>
<?php if( !empty( $metabox_id ) ) : ?>
<tr>
<th>
<label><?php _e( $metabox_title ); ?></label>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$metabox_id]["remove"] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $metabox_id ); ?>][remove]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
</td>
<td>
<?php $Val = ''; ?>
<?php if( !empty( $Data[$metabox_id]["name"] ) ) : $Val = stripslashes( $Data[$metabox_id]["name"] ); endif; ?>
<input type="text" name="data[<?php echo esc_attr( $metabox_id ); ?>][name]" class="regular-text" value="<?php echo esc_html( $Val ); ?>" placeholder="<?php echo esc_attr( __( $metabox_title ) ); ?>" />
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php $load_link = self_admin_url( 'index.php' ); ?>
<p>
<a href="<?php echo esc_url( $load_link ); ?>" class="button button-primary column_load">
<span class="dashicons dashicons-update"></span>
<?php echo sprintf( __( 'Refresh meta boxes for %s', 'wp-admin-ui-customize' ) , __( 'Dashboard' ) ); ?>
</a>
</p>
<p class="loading">
<span class="spinner"></span>
<?php _e( 'Loading&hellip;' ); ?>
</p>
</div>
</div>
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php _e( 'Other' , 'wp-admin-ui-customize' ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<?php $field = 'metabox_move'; ?>
<tr>
<th>
<label><?php _e( 'Meta box movement' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e( "Prevent selected roles from re-arrange meta boxes" , 'wp-admin-ui-customize' ); ?></label>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<br class="clear">
</div>
</div>
<p class="submit">
<input type="submit" class="button-primary" name="update" value="<?php echo esc_attr( __( 'Save' ) ); ?>" />
</p>
<p class="submit reset">
<span class="description"><?php printf( __( 'Reset the %s?' , 'wp-admin-ui-customize' ) , __( 'Dashboard' ) . __( 'Settings' ) ); ?></span>
<input type="submit" class="button-secondary" name="reset" value="<?php echo esc_attr( __( 'Reset settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
</form>
</div>
<style>
.form-table td {
vertical-align: top;
}
.inside .loading {
display: none;
}
.inside .loading .spinner {
float: left;
visibility: visible;
}
.button.column_load .dashicons {
margin-top: 3px;
}
</style>
<script type="text/javascript">
jQuery(document).ready(function($) {
$( document ).on("click", "#wauc_setting_dashboard input.check_all", function() {
var Checked = $(this).prop("checked");
$Table = $(this).parent().parent().parent().parent();
$Table.children("tbody").children("tr").each(function( key, el ) {
$(el).find("input[type=checkbox]").prop("checked" , Checked);
});
});
$('.wauc_form .column_load').on('click', function( ev ) {
var load_url = $(ev.target).prop('href');
$.ajax({
url: load_url,
beforeSend: function( xhr ) {
$(ev.target).parent().parent().find('.loading').show();
$(ev.target).parent().parent().find('.spinner').show();
}
}).done(function( data ) {
location.reload();
});
return false;
}).disableSelection();
});
</script>

View File

@@ -0,0 +1,128 @@
<?php
$Data = $this->get_data( 'user_role' );
$UserRoles = $this->get_user_role();
// include js css
$ReadedJs = array( 'jquery' , 'jquery-ui-sortable' );
wp_enqueue_script( $this->PageSlug , $this->Url . $this->PluginSlug . '.js', $ReadedJs , $this->Ver );
wp_enqueue_style( $this->PageSlug , $this->Url . $this->PluginSlug . '.css', array() , $this->Ver );
?>
<div class="wrap">
<?php echo $this->Msg; ?>
<h2><?php echo $this->Name; ?></h2>
<div style="background: #fff; border: 1px solid #efefef; padding: 0 20px; border-radius: 10px; box-shadow: 3px 3px rgba(0, 0, 0, 0.2);">
<p><span class="dashicons dashicons-warning"></span> <?php _e( 'Thank you for using WP Admin UI Customize. But sorry this plugin is stopped development and instead I developing to new plugin.' , 'wp-admin-ui-customize' ); ?> ;)</p>
<p><a href="https://mywpcustomize.com" target="_blank" class="button button-primary"><span class="dashicons dashicons-admin-plugins" style="margin-top: 3px;"></span> My WP Customize</a></p>
</div>
<p><?php _e( '
WP Admin UI Customize allows the management UI for different user roles to be customized.' , 'wp-admin-ui-customize' ); ?></p>
<p><?php _e ( 'Select the user roles to customize below.' , 'wp-admin-ui-customize' ); ?></p>
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-2">
<div id="postbox-container-1" class="postbox-container">
<div id="about_plugin">
<div class="stuffbox" id="aboutbox">
<h3><span class="hndle"><?php _e( 'About plugin' , 'wp-admin-ui-customize' ); ?></span></h3>
<div class="inside">
<p><?php _e( 'Tested with WordPress versions' , 'wp-admin-ui-customize' ); ?> : 4.2 - 4.9</p>
<ul>
<li><a href="<?php echo esc_url( $this->Site ); ?>" target="_blank"><?php _e( 'Plugin site' , 'wp-admin-ui-customize' ); ?></a></li>
<li><a href="<?php echo esc_url( $this->AuthorUrl ); ?>" target="_blank"><?php _e( 'Developer site' , 'wp-admin-ui-customize' ); ?></a></li>
<li><a href="http://wordpress.org/support/plugin/<?php echo $this->PluginSlug; ?>" target="_blank"><?php _e( 'Support Forums' ); ?></a></li>
<li><a href="http://wordpress.org/support/view/plugin-reviews/<?php echo $this->PluginSlug; ?>" target="_blank"><?php _e( 'Reviews' , 'wp-admin-ui-customize' ); ?></a></li>
<li><a href="https://twitter.com/gqevu6bsiz" target="_blank">twitter</a></li>
</ul>
</div>
</div>
<div class="stuffbox" id="usefulbox">
<h3><span class="hndle"><?php _e( 'Useful plugins' , 'wp-admin-ui-customize' ); ?></span></h3>
<div class="inside">
<p><strong><a href="http://wordpress.org/extend/plugins/post-lists-view-custom/" target="_blank">Post Lists View Custom</a></strong></p>
<p class="description"><?php _e( 'Customize list view columns for posts, pages, custom post types, media library, and other management screens.' , 'wp-admin-ui-customize' ); ?></p>
<p><strong><a href="http://wordpress.org/extend/plugins/announce-from-the-dashboard/" target="_blank">Announce from the Dashboard</a></strong></p>
<p class="description"><?php _e( 'Create dashboard messages to be displayed for selected user roles.' , 'wp-admin-ui-customize' ); ?></p>
<p><strong><a href="http://wordpress.org/extend/plugins/custom-options-plus-post-in/" target="_blank">Custom Options Plus Post in</a></strong></p>
<p class="description"><?php _e( 'Create custom global variables that can be used with generated template tags or shortcodes.' , 'wp-admin-ui-customize' ); ?></p>
<p>&nbsp;</p>
</div>
</div>
</div>
</div>
<div id="postbox-container-2" class="postbox-container">
<div id="user_role">
<form id="wauc_setting_default" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="user_role" />
<div class="postbox">
<h3 class="hndle"><span><?php _e( 'User Roles' ); ?></span></h3>
<div class="inside">
<?php $field = 'user_role'; ?>
<?php foreach($UserRoles as $role_name => $val) : ?>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$role_name] ) ) : $Checked = 'checked="checked"'; endif; ?>
<p>
<label>
<input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>][<?php echo esc_attr( $role_name ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> />
<?php echo $val["label"]; ?>
</label>
</p>
<?php endforeach; ?>
</div>
</div>
<p class="submit">
<input type="submit" class="button-primary" name="update" value="<?php echo esc_attr( __( 'Save' ) ); ?>" />
</p>
<p class="submit reset">
<span class="description"><?php printf( __( 'Reset the %s?' , 'wp-admin-ui-customize' ) , __( 'User Roles Settings' , 'wp-admin-ui-customize' ) ); ?></span>
<input type="submit" class="button-secondary" name="reset" value="<?php echo esc_attr( __( 'Reset settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
<p>&nbsp;</p>
</form>
<p>&nbsp;</p>
<div class="stuffbox" style="border-color: #FFC426; border-width: 3px;">
<h3 style="background: #FFF2D0; border-color: #FFC426;"><span class="hndle"><?php _e( 'Do you need professional setup and customization?' , 'wp-admin-ui-customize' ); ?></span></h3>
<div class="inside">
<p style="float: right;">
<img src="<?php echo esc_url( $this->Schema . 'www.gravatar.com/avatar/7e05137c5a859aa987a809190b979ed4?s=46' ); ?>" width="46" /><br />
<a href="<?php echo esc_url( $this->AuthorUrl . 'contact-us/' ); ?>" target="_blank">gqevu6bsiz</a>
</p>
<p><?php _e( 'I provide full service customization for WP Admin UI Customize.' , 'wp-admin-ui-customize' ); ?></p>
<p><?php _e( 'Please contact me if you are interested.' , 'wp-admin-ui-customize' ); ?></p>
<p>
<a href="<?php echo esc_url( $this->Site . 'contact/' ); ?>" target="_blank"><?php _e( 'Contact me' , 'wp-admin-ui-customize' ); ?></a>
</p>
</div>
</div>
</div>
</div>
<br class="clear">
</div>
</div>
</div>

View File

@@ -0,0 +1,154 @@
<?php
$Data = $this->get_data( 'loginscreen' );
// include js css
$ReadedJs = array( 'jquery' , 'jquery-ui-sortable' , 'thickbox' );
wp_enqueue_script( $this->PageSlug , $this->Url . $this->PluginSlug . '.js', $ReadedJs , $this->Ver );
wp_enqueue_style('thickbox');
wp_enqueue_style( $this->PageSlug , $this->Url . $this->PluginSlug . '.css', array() , $this->Ver );
?>
<div class="wrap">
<?php echo $this->Msg; ?>
<h2><?php _e( 'Login Form' , 'wp-admin-ui-customize' ); ?></h2>
<p>&nbsp;</p>
<form id="wauc_setting_loginscreen" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="loginscreen" />
<?php if( is_multisite() ) : ?>
<p class="description"><?php _e( 'Is not possible to check the login form if you do not log out in the case of MultiSite.' , 'wp-admin-ui-customize' ); ?></p>
<?php endif; ?>
<p><a title="<?php _e( 'Login Screen' , 'wp-admin-ui-customize' ); ?>" href="<?php echo esc_url( get_option( 'siteurl' ) ); ?>/wp-login.php?TB_iframe=1&width=520&height=520" class="thickbox button button-secondary"><?php _e( 'Show Current Login Screen' , 'wp-admin-ui-customize' ); ?></a></p>
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-1">
<div id="postbox-container-1" class="postbox-container">
<div id="login_screen">
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php _e( 'Login Form' , 'wp-admin-ui-customize' ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<?php $field = 'login_headerurl'; ?>
<tr>
<th>
<label><?php _e( 'Logo URL' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $Val = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Val = strip_tags( stripslashes( $Data[$field] ) ); endif; ?>
<input type="text" name="data[<?php echo esc_attr( $field ); ?>]" value="<?php echo esc_attr( $Val ); ?>" class="regular-text" id="<?php echo esc_attr( $field ); ?>">
<a href="#TB_inline?height=300&width=600&inlineId=list_variables&modal=false" title="<?php _e( 'Shortcodes' , 'wp-admin-ui-customize' ); ?>" class="thickbox"><?php _e( 'Available Shortcodes' , 'wp-admin-ui-customize' ); ?></a>
</td>
</tr>
<?php $field = 'login_headertitle'; ?>
<tr>
<th>
<label><?php _e( 'Logo Title' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $Val = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Val = strip_tags( stripslashes( $Data[$field] ) ); endif; ?>
<input type="text" name="data[<?php echo esc_attr( $field ); ?>]" value="<?php echo esc_attr( $Val ); ?>" class="regular-text" id="<?php echo esc_attr( $field ); ?>">
<a href="#TB_inline?height=300&width=600&inlineId=list_variables&modal=false" title="<?php _e( 'Shortcodes' , 'wp-admin-ui-customize' ); ?>" class="thickbox"><?php _e( 'Available Shortcodes' , 'wp-admin-ui-customize' ); ?></a>
</td>
</tr>
<?php $field = 'login_headerlogo'; ?>
<tr>
<th>
<label><?php _e( 'Logo Image URL' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $Val = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Val = strip_tags( stripslashes( $Data[$field] ) ); endif; ?>
<input type="text" name="data[<?php echo esc_attr( $field ); ?>]" value="<?php echo esc_attr( $Val ); ?>" class="regular-text" id="<?php echo esc_attr( $field ); ?>">
<a href="#TB_inline?height=300&width=600&inlineId=list_variables&modal=false" title="<?php _e( 'Shortcodes' , 'wp-admin-ui-customize' ); ?>" class="thickbox"><?php _e( 'Available Shortcodes' , 'wp-admin-ui-customize' ); ?></a>
<?php if( !empty( $Val ) ) : ?>
<?php $img = $this->val_replace( $Val ); ?>
<p><img src="<?php echo esc_url( $img ); ?>" style="max-width: 100%;" alt="Login Logo" /></p>
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php _e( 'General' ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<?php $field = 'login_css'; ?>
<tr>
<th>
<label><?php _e( 'CSS file to load' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $Val = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Val = strip_tags( stripslashes( $Data[$field] ) ); endif; ?>
<input type="text" name="data[<?php echo esc_attr( $field ); ?>]" value="<?php echo esc_attr( $Val ); ?>" class="regular-text" id="<?php echo esc_attr( $field ); ?>">
<a href="#TB_inline?height=300&width=600&inlineId=list_variables&modal=false" title="<?php _e( 'Shortcodes' , 'wp-admin-ui-customize' ); ?>" class="thickbox"><?php _e( 'Available Shortcodes' , 'wp-admin-ui-customize' ); ?></a>
</td>
</tr>
<?php $field = 'login_footer'; ?>
<tr>
<th>
<label><?php _e( 'Footer text' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php $Val = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Val = stripslashes( $Data[$field] ); endif; ?>
<input type="text" name="data[<?php echo esc_attr( $field ); ?>]" value="<?php echo esc_attr( $Val ); ?>" class="large-text" id="<?php echo esc_attr( $field ); ?>">
<a href="#TB_inline?height=300&width=600&inlineId=list_variables&modal=false" title="<?php _e( 'Shortcodes' , 'wp-admin-ui-customize' ); ?>" class="thickbox"><?php _e( 'Available Shortcodes' , 'wp-admin-ui-customize' ); ?></a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<br class="clear">
</div>
</div>
<p class="submit">
<input type="submit" class="button-primary" name="update" value="<?php echo esc_attr( __( 'Save' ) ); ?>" />
</p>
<p class="submit reset">
<span class="description"><?php printf( __( 'Reset the %s?' , 'wp-admin-ui-customize' ) , __( 'Login Form' , 'wp-admin-ui-customize' ) ); ?></span>
<input type="submit" class="button-secondary" name="reset" value="<?php echo esc_attr( __( 'Reset settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
</form>
</div>
<?php require_once( dirname( __FILE__ ) . '/list_variables.php' ); ?>
<style>
</style>
<script>
jQuery(document).ready( function($) {
});
</script>

View File

@@ -0,0 +1,445 @@
<?php
$Data = $this->get_data( 'manage_metabox' );
$Metaboxes = $this->get_data( "regist_metabox" );
$CustomPosts = $this->get_custom_posts();
$activated_plugin = $this->ActivatedPlugin;
// include js css
$ReadedJs = array( 'jquery' , 'jquery-ui-sortable' );
wp_enqueue_script( $this->PageSlug , $this->Url . $this->PluginSlug . '.js', $ReadedJs , $this->Ver );
wp_enqueue_style( $this->PageSlug , $this->Url . $this->PluginSlug . '.css', array() , $this->Ver );
?>
<div class="wrap">
<?php echo $this->Msg; ?>
<h2><?php _e( 'Management of meta boxes' , 'wp-admin-ui-customize' ); ?></h2>
<p><?php _e( 'Ensure at least one post and page is present and then refresh to display the available meta boxes.' , 'wp-admin-ui-customize' ); ?></p>
<p><?php _e( 'It is also possible to change the meta box display name.' , 'wp-admin-ui-customize' ); ?></p>
<h3 id="wauc-apply-user-roles"><?php echo $this->get_apply_roles(); ?></h3>
<form id="wauc_setting_manage_metabox" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="manage_metabox" />
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-1">
<div id="postbox-container-1" class="postbox-container">
<div id="built_in">
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php _e( 'Posts' ); ?></span></h3>
<div class="inside">
<?php if( !empty( $Metaboxes["metaboxes"]["post"] ) ) : ?>
<table class="form-table">
<thead>
<tr>
<th>&nbsp;</th>
<td style="width: 15%;">
<label>
<input type="checkbox" name="" class="check_all" />
<strong><?php _e( 'Select All' ); ?></strong>
</label>
</td>
<td style="width: 15%;">
<strong><?php _e( 'Default Open' , 'wp-admin-ui-customize' ); ?></strong>
</td>
<td><strong><?php _e( 'Update meta box title' , 'wp-admin-ui-customize' ); ?></strong></td>
</tr>
</thead>
<tbody>
<?php foreach( $Metaboxes["metaboxes"]["post"] as $context => $meta_box ) : ?>
<?php foreach( $meta_box as $priority => $box ) : ?>
<?php foreach( $box as $metabox_id => $metabox_title ) : ?>
<tr>
<th>
<?php _e( $metabox_title ); ?>
</th>
<td>
<?php if( $metabox_id != 'submitdiv' ) : ?>
<?php $Checked = ''; ?>
<?php if( !empty( $Data["post"][$metabox_id]["remove"] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[post][<?php echo esc_attr( $metabox_id ); ?>][remove]" value="1" class="show_check" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
<?php else : ?>
<?php _e( 'Show' ); ?>
<?php endif; ?>
</td>
<td>
<?php if( $metabox_id != 'submitdiv' ) : ?>
<?php $Selected = 0; ?>
<?php if( !empty( $Data["post"][$metabox_id]["toggle"] ) ) : $Selected = true; endif; ?>
<select name="data[post][<?php echo esc_attr( $metabox_id ); ?>][toggle]" class="select_toggle">
<option value="0" <?php Selected( $Selected , 0 ); ?>><?php _e( 'Expanded' , 'wp-admin-ui-customize' ); ?></option>
<option value="1" <?php Selected( $Selected , 1 ); ?>><?php _e( 'Collapsed' , 'wp-admin-ui-customize' ); ?></option>
</select>
<?php else : ?>
<?php _e( 'Show' ); ?>
<?php endif; ?>
</td>
<td>
<?php $Val = ''; ?>
<?php if( !empty( $Data["post"][$metabox_id]["name"] ) ) : $Val = stripslashes( $Data["post"][$metabox_id]["name"] ); endif; ?>
<input type="text" name="data[post][<?php echo esc_attr( $metabox_id ); ?>][name]" class="regular-text metabox_rename" value="<?php echo esc_html( $Val ); ?>" placeholder="<?php echo esc_attr( __( $metabox_title ) ); ?>" />
<?php if( $metabox_id == 'commentstatusdiv' ) : ?>
<p class="description"><?php _e( 'If the discussion meta box is hidden comments will not be displayed on new posts for the selected role.' , 'wp-admin-ui-customize' ); ?></p>
<p><img src="<?php echo esc_url( $this->Url . 'images/discussion_allow_comments.png' ); ?>" /></p>
<p><a href="<?php echo esc_url( admin_url( 'admin.php?page=' . $this->PageSlug . '_post_add_edit_screen' ) ); ?>"><?php _e( 'Change this setting to allow comments on new posts' , 'wp-admin-ui-customize' ); ?></a></p>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php $post = get_posts( array( 'post_type' => 'post' , 'order' => 'DESC' , 'orderby' => 'post_date' , 'numberposts' => 1 ) ); ?>
<?php if( !empty( $post ) ) : ?>
<?php $load_link = self_admin_url( 'post.php?post=' . $post[0]->ID . '&action=edit' ); ?>
<?php else: ?>
<?php $load_link = self_admin_url( 'post-new.php' ); ?>
<?php endif; ?>
<p>
<a href="<?php echo esc_url( $load_link ); ?>" class="button button-primary column_load">
<span class="dashicons dashicons-update"></span>
<?php echo sprintf( __( 'Refresh meta boxes for %s', 'wp-admin-ui-customize' ) , __( 'Posts' ) ); ?>
</a>
</p>
<p class="loading">
<span class="spinner"></span>
<?php _e( 'Loading&hellip;' ); ?>
</p>
</div>
</div>
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php _e( 'Pages' ); ?></span></h3>
<div class="inside">
<?php if( !empty( $Metaboxes["metaboxes"]["page"] ) ) : ?>
<table class="form-table">
<thead>
<tr>
<th>&nbsp;</th>
<td style="width: 15%;">
<label>
<input type="checkbox" name="" class="check_all" />
<strong><?php _e( 'Select All' ); ?></strong>
</label>
</td>
<td style="width: 15%;">
<strong><?php _e( 'Default Open' , 'wp-admin-ui-customize' ); ?></strong>
</td>
<td><strong><?php _e( 'Update meta box title' , 'wp-admin-ui-customize' ); ?></strong></td>
</tr>
</thead>
<tbody>
<?php foreach( $Metaboxes["metaboxes"]["page"] as $context => $meta_box ) : ?>
<?php foreach( $meta_box as $priority => $box ) : ?>
<?php foreach( $box as $metabox_id => $metabox_title ) : ?>
<tr>
<th>
<?php _e( $metabox_title ); ?>
</th>
<td>
<?php if( $metabox_id != 'submitdiv' ) : ?>
<?php $Checked = ''; ?>
<?php if( !empty( $Data["page"][$metabox_id]["remove"] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[page][<?php echo esc_attr( $metabox_id ); ?>][remove]" value="1" class="show_check" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
<?php else : ?>
<?php _e( 'Show' ); ?>
<?php endif; ?>
</td>
<td>
<?php if( $metabox_id != 'submitdiv' ) : ?>
<?php $Selected = 0; ?>
<?php if( !empty( $Data["page"][$metabox_id]["toggle"] ) ) : $Selected = true; endif; ?>
<select name="data[page][<?php echo esc_attr( $metabox_id ); ?>][toggle]" class="select_toggle">
<option value="0" <?php Selected( $Selected , 0 ); ?>><?php _e( 'Expanded' , 'wp-admin-ui-customize' ); ?></option>
<option value="1" <?php Selected( $Selected , 1 ); ?>><?php _e( 'Collapsed' , 'wp-admin-ui-customize' ); ?></option>
</select>
<?php else : ?>
<?php _e( 'Show' ); ?>
<?php endif; ?>
</td>
<td>
<?php $Val = ''; ?>
<?php if( !empty( $Data["page"][$metabox_id]["name"] ) ) : $Val = stripslashes( $Data["page"][$metabox_id]["name"] ); endif; ?>
<input type="text" name="data[page][<?php echo esc_attr( $metabox_id ); ?>][name]" class="regular-text metabox_rename" value="<?php echo esc_html( $Val ); ?>" placeholder="<?php echo esc_attr( __( $metabox_title ) ); ?>" />
<?php if( $metabox_id == 'commentstatusdiv' ) : ?>
<p class="description"><?php _e( 'If the discussion meta box is hidden comments will not be displayed on new posts for the selected role.' , 'wp-admin-ui-customize' ); ?></p>
<p><img src="<?php echo esc_url( $this->Url . 'images/discussion_allow_comments.png' ); ?>" /></p>
<p><a href="<?php echo esc_url( admin_url( 'admin.php?page=' . $this->PageSlug . '_post_add_edit_screen' ) ); ?>"><?php _e( 'Change this setting to allow comments on new posts' , 'wp-admin-ui-customize' ); ?></a></p>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php $post = get_posts( array( 'post_type' => 'page' , 'order' => 'DESC' , 'orderby' => 'post_date' , 'numberposts' => 1 ) ); ?>
<?php if( !empty( $post ) ) : ?>
<?php $load_link = self_admin_url( 'post.php?post=' . $post[0]->ID . '&action=edit' ); ?>
<?php else: ?>
<?php $load_link = self_admin_url( 'post-new.php?post_type=page' ); ?>
<?php endif; ?>
<p>
<a href="<?php echo esc_url( $load_link ); ?>" class="button button-primary column_load">
<span class="dashicons dashicons-update"></span>
<?php echo sprintf( __( 'Refresh meta boxes for %s', 'wp-admin-ui-customize' ) , __( 'Pages' ) ); ?>
</a>
</p>
<p class="loading">
<span class="spinner"></span>
<?php _e( 'Loading&hellip;' ); ?>
</p>
</div>
</div>
</div>
</div>
<?php if ( !empty( $CustomPosts ) ) : ?>
<div id="postbox-container-2" class="postbox-container">
<div id="custom_post">
<?php foreach( $CustomPosts as $post_name => $cpt ) : ?>
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php echo strip_tags( $cpt->labels->name ); ?></span></h3>
<div class="inside">
<?php if( !empty( $Metaboxes["metaboxes"][$post_name] ) ) : ?>
<table class="form-table">
<thead>
<tr>
<th>&nbsp;</th>
<td style="width: 15%;">
<label>
<input type="checkbox" name="" class="check_all" />
<strong><?php _e( 'Select All' ); ?></strong>
</label>
</td>
<td style="width: 15%;">
<strong><?php _e( 'Default Open' , 'wp-admin-ui-customize' ); ?></strong>
</td>
<td><strong><?php _e( 'Update meta box title' , 'wp-admin-ui-customize' ); ?></strong></td>
</tr>
</thead>
<tbody>
<?php foreach( $Metaboxes["metaboxes"][$post_name] as $context => $meta_box ) : ?>
<?php foreach( $meta_box as $priority => $box ) : ?>
<?php foreach( $box as $metabox_id => $metabox_title ) : ?>
<?php if( !empty( $metabox_id ) ) : ?>
<tr>
<th><?php echo $metabox_title; ?></th>
<td>
<?php if( $metabox_id != 'submitdiv' ) : ?>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$post_name][$metabox_id]["remove"] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $post_name ); ?>][<?php echo esc_attr( $metabox_id ); ?>][remove]" value="1" class="show_check" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
<?php else : ?>
<?php _e( 'Show' ); ?>
<?php endif; ?>
</td>
<td>
<?php if( $metabox_id != 'submitdiv' ) : ?>
<?php $Selected = 0; ?>
<?php if( !empty( $Data[$post_name][$metabox_id]["toggle"] ) ) : $Selected = true; endif; ?>
<select name="data[<?php echo esc_attr( $post_name ); ?>][<?php echo esc_attr( $metabox_id ); ?>][toggle]" class="select_toggle">
<option value="0" <?php Selected( $Selected , 0 ); ?>><?php _e( 'Expanded' , 'wp-admin-ui-customize' ); ?></option>
<option value="1" <?php Selected( $Selected , 1 ); ?>><?php _e( 'Collapsed' , 'wp-admin-ui-customize' ); ?></option>
</select>
<?php else : ?>
<?php _e( 'Show' ); ?>
<?php endif; ?>
</td>
<td>
<?php $Val = ''; ?>
<?php if( !empty( $Data[$post_name][$metabox_id]["name"] ) ) : $Val = stripslashes( $Data[$post_name][$metabox_id]["name"] ); endif; ?>
<input type="text" name="data[<?php echo esc_attr( $post_name ); ?>][<?php echo esc_attr( $metabox_id ); ?>][name]" class="regular-text metabox_rename" value="<?php echo esc_html( $Val ); ?>" placeholder="<?php echo esc_attr( __( $metabox_title ) ); ?>" />
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php $args = array( 'post_type' => $post_name , 'order' => 'DESC' , 'orderby' => 'post_date' , 'numberposts' => 1 ); ?>
<?php if( !empty( $activated_plugin['woocommerce'] ) && $post_name == 'shop_order' ) : ?>
<?php $args['post_status'] = array( 'wc-processing', 'wc-completed' ); ?>
<?php endif; ?>
<?php $post = get_posts( $args ); ?>
<?php if( !empty( $post ) ) : ?>
<?php $load_link = self_admin_url( 'post.php?post=' . $post[0]->ID . '&action=edit' ); ?>
<?php else: ?>
<?php $load_link = self_admin_url( 'post-new.php?post_type=' . $post_name ); ?>
<?php endif; ?>
<p>
<a href="<?php echo esc_url( $load_link ); ?>" class="button button-primary column_load">
<span class="dashicons dashicons-update"></span>
<?php echo sprintf( __( 'Refresh meta boxes for %s', 'wp-admin-ui-customize' ) , $cpt->label ); ?>
</a>
</p>
<p class="loading">
<span class="spinner"></span>
<?php _e( 'Loading&hellip;' ); ?>
</p>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<br class="clear">
</div>
</div>
<p class="submit">
<input type="submit" class="button-primary" name="update" value="<?php echo esc_attr( __( 'Save' ) ); ?>" />
</p>
<p class="submit reset">
<span class="description"><?php printf( __( 'Reset the %s?' , 'wp-admin-ui-customize' ) , __( 'Management of meta boxes' , 'wp-admin-ui-customize' ) . __( 'Settings' ) ); ?></span>
<input type="submit" class="button-secondary" name="reset" value="<?php echo esc_attr( __( 'Reset settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
</form>
</div>
<style>
.form-table td {
vertical-align: top;
}
.inside .loading {
display: none;
}
.inside .loading .spinner {
float: left;
visibility: visible;
}
.button.column_load .dashicons {
margin-top: 3px;
}
</style>
<script type="text/javascript">
jQuery(document).ready(function($) {
var $Form = $("#wauc_setting_manage_metabox");
$(".check_all", $Form).click(function() {
var Checked = $(this).prop("checked");
$Table = $(this).parent().parent().parent().parent().parent();
$Table.children("tbody").children("tr").each(function( index, el ) {
var $Tr = $(el);
$Tr.find("input[type=checkbox]").prop("checked" , Checked);
if( Checked ) {
$Tr.find('.select_toggle').prop('disabled', true);
$Tr.find('.metabox_rename').prop('disabled', true).addClass('disabled');
} else {
$Tr.find('.select_toggle').prop('disabled', false);
$Tr.find('.metabox_rename').prop('disabled', false).removeClass('disabled');
}
});
});
$('.postbox .inside .form-table').each(function( key, el ) {
$(el).find('tbody tr').each(function( tr_key , tr_el ) {
if( $(tr_el).find('.show_check').size() > 0 ) {
if( $(tr_el).find('.show_check').prop('checked') ) {
$(tr_el).find('.select_toggle').prop('disabled', true);
$(tr_el).find('.metabox_rename').prop('disabled', true).addClass('disabled');
}
}
});
});
$('.postbox .inside .form-table tbody tr td .show_check').on('click', function( ev ) {
var Tr = $(ev.target).parent().parent().parent();
if( $(ev.target).prop('checked') ) {
Tr.find('.select_toggle').prop('disabled', true);
Tr.find('.metabox_rename').prop('disabled', true).addClass('disabled');
} else {
Tr.find('.select_toggle').prop('disabled', false);
Tr.find('.metabox_rename').prop('disabled', false).removeClass('disabled');
}
});
$('.wauc_form .column_load').on('click', function( ev ) {
var load_url = $(ev.target).prop('href');
load_url += '&<?php echo $this->ltd; ?>_metabox_load=1';
$.ajax({
url: load_url,
beforeSend: function( xhr ) {
$(ev.target).parent().parent().find('.loading').show();
$(ev.target).parent().parent().find('.spinner').show();
}
}).done(function( post_html_el ) {
if( post_html_el.indexOf( "adminpage = 'post-php'" ) != -1 || post_html_el.indexOf( "adminpage = 'post-new-php'" ) != -1 ) {
location.reload();
}
});
return false;
}).disableSelection();
});
</script>

View File

@@ -0,0 +1,96 @@
<?php
$Data = $this->get_data( 'plugin_cap' );
$UserRoles = $this->get_user_role();
$current_user_role_group = $this->current_user_role_group();
// include js css
$ReadedJs = array( 'jquery' , 'jquery-ui-sortable' );
wp_enqueue_script( $this->PageSlug , $this->Url . $this->PluginSlug . '.js', $ReadedJs , $this->Ver );
wp_enqueue_style( $this->PageSlug , $this->Url . $this->PluginSlug . '.css', array() , $this->Ver );
?>
<div class="wrap">
<?php echo $this->Msg; ?>
<h2><?php echo sprintf( __( '%1$s of %2$s %3$s' , 'wp-admin-ui-customize' ) , __( 'Change' ) , __( 'Plugin' ) , __( 'Capabilities' ) ); ?></h2>
<p><?php echo sprintf( __( 'You can change the user role %2$s of %1$s settings.' , 'wp-admin-ui-customize' ) , $this->Name , __( 'Capabilities' ) ); ?></p>
<p><?php echo sprintf( __( 'Select the capability required to modify %s settings.' , 'wp-admin-ui-customize' ) , $this->Name ); ?></p>
<p>&nbsp;</p>
<form id="wauc_setting_plugin_cap" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="plugin_cap" />
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-1">
<div id="postbox-container-1" class="postbox-container">
<div id="appearance_menus">
<div class="postbox">
<h3 class="hndle"><span><?php echo sprintf( __( 'Capability required to modify %s settings' , 'wp-admin-ui-customize' ) , $this->Name ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<?php $field = 'edit_cap'; ?>
<tr>
<th>
<label><?php _e( 'Capabilities' ); ?></label>
</th>
<td>
<select name="data[<?php echo esc_attr( $field ); ?>]">
<?php $SelectedCap = 'manage_options'; ?>
<?php if( !empty( $Data[$field] ) ) : ?>
<?php $SelectedCap = strip_tags( $Data[$field] ); ?>
<?php endif; ?>
<?php if( !empty( $UserRoles[$current_user_role_group]["capabilities"] ) ) : ?>
<?php foreach( $UserRoles[$current_user_role_group]["capabilities"] as $cap => $v ) : ?>
<?php $Selected = false; ?>
<?php if( !empty( $SelectedCap ) ) : ?>
<?php if( $SelectedCap == $cap ) $Selected = 'selected="selected"'; ?>
<?php endif; ?>
<option value="<?php echo esc_attr( $cap ); ?>" <?php echo esc_attr( $Selected ); ?>><?php echo esc_attr( $cap ); ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
<p class="description"><?php _e( 'Default' ); ?>: manage_options</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<br class="clear">
</div>
</div>
<p class="submit">
<input type="submit" class="button-primary" name="update" value="<?php echo esc_attr( __( 'Save' ) ); ?>" />
</p>
<p class="submit reset">
<span class="description"><?php printf( __( 'Reset the %s?' , 'wp-admin-ui-customize' ) , sprintf( __( '%1$s of %2$s %3$s' , 'wp-admin-ui-customize' ) , __( 'Change' ) , __( 'Plugin' ) , __( 'Capabilities' ) ) . __( 'Settings' ) ); ?></span>
<input type="submit" class="button-secondary" name="reset" value="<?php echo esc_attr( __( 'Reset settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
</form>
</div>
<style>
</style>
<script>
jQuery(document).ready( function($) {
});
</script>

View File

@@ -0,0 +1,115 @@
<?php
$Data = $this->get_data( 'post_add_edit' );
$comment_status = get_option( 'default_comment_status' );
// include js css
$ReadedJs = array( 'jquery' , 'jquery-ui-sortable' );
wp_enqueue_script( $this->PageSlug , $this->Url . $this->PluginSlug . '.js', $ReadedJs , $this->Ver );
wp_enqueue_style( $this->PageSlug , $this->Url . $this->PluginSlug . '.css', array() , $this->Ver );
?>
<div class="wrap">
<?php echo $this->Msg; ?>
<h2><?php _e( 'Add New Post and Edit Post Screen Setting' , 'wp-admin-ui-customize' ); ?></h2>
<p>&nbsp;</p>
<h3 id="wauc-apply-user-roles"><?php echo $this->get_apply_roles(); ?></h3>
<form id="wauc_setting_post_add_edit" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="post_add_edit" />
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-1">
<div id="postbox-container-1" class="postbox-container">
<div id="post_add">
<div class="postbox">
<h3 class="hndle"><span><?php _e( 'Add New Post' ); ?> &amp; <?php _e( 'Add New Page' ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<?php $field = 'allow_comments'; ?>
<tr>
<th>
<label><?php _e( 'Allow comments if discussion meta box is hidden' , 'wp-admin-ui-customize' ); ?></label>
</th>
<td>
<?php if( $comment_status == 'open' ) : ?>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Allow' ); ?></label>
<p class="description"><?php _e( 'If the discussion meta box is hidden comments will not be displayed on new posts for the selected role.' , 'wp-admin-ui-customize' ); ?></p>
<p><?php _e( 'Check \'Allow\' to allow comments on new posts.' , 'wp-admin-ui-customize' ); ?></p>
<p><a href="<?php echo esc_url( admin_url( 'options-discussion.php' ) ); ?>"><?php echo sprintf( __( 'The %s in WordPress will override this setting.' , 'wp-admin-ui-customize' ) , __( 'Default article settings' ) ); ?></a></p>
<?php else : ?>
<p><a href="<?php echo esc_url( admin_url( 'options-discussion.php' ) ); ?>"><?php echo sprintf( __( 'Please select the <strong>%s</strong>' , 'wp-admin-ui-customize' ) , __( 'Allow people to post comments on new articles' ) ); ?></a></p>
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="post_add_edit">
<div class="postbox">
<h3 class="hndle"><span><?php _e( 'Add New Post' ); ?> &amp; <?php _e( 'Edit Post' ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<?php $field = 'default_permalink'; ?>
<tr>
<th>
<label><?php _e( 'Change Permalinks' ); ?></label>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $Data[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
<p class="description"><?php _e( 'Only appears when the permalinks are set to the default setting.' , 'wp-admin-ui-customize' ); ?></p>
<p><img src="<?php echo esc_url( $this->Url . 'images/post_add_edit_screen__edit_ppermalink.png' ); ?>" /></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<br class="clear">
</div>
</div>
<p class="submit">
<input type="submit" class="button-primary" name="update" value="<?php echo esc_attr( __( 'Save' ) ); ?>" />
</p>
<p class="submit reset">
<span class="description"><?php printf( __( 'Reset the %s?' , 'wp-admin-ui-customize' ) , __( 'Add New Post and Edit Post Screen Setting' , 'wp-admin-ui-customize' ) ); ?></span>
<input type="submit" class="button-secondary" name="reset" value="<?php echo esc_attr( __( 'Reset settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
</form>
</div>
<style>
</style>
<script>
jQuery(document).ready( function($) {
});
</script>

View File

@@ -0,0 +1,384 @@
<?php
$this->get_user_role();
$Data = $this->get_data( 'sidemenu' );
// include js css
$ReadedJs = array( 'jquery' , 'jquery-ui-draggable' , 'jquery-ui-droppable' , 'jquery-ui-sortable' , 'thickbox' );
wp_enqueue_script( $this->PageSlug , $this->Url . $this->PluginSlug . '.js', $ReadedJs , $this->Ver );
wp_enqueue_style('thickbox');
wp_enqueue_style( $this->PageSlug , $this->Url . $this->PluginSlug . '.css', array() , $this->Ver );
?>
<div class="wrap">
<?php echo $this->Msg; ?>
<h2><?php _e( 'Sidebar' , 'wp-admin-ui-customize' ); ?></h2>
<p><?php _e( 'Drag menu items to edit and reorder menus.' , 'wp-admin-ui-customize' ); ?></p>
<p class="description"><?php echo sprintf( __( 'New plugin menus will be added to the <strong>%s</strong>.' , 'wp-admin-ui-customize' ) , __( 'Available menu items' , 'wp-admin-ui-customize' ) ); ?>
<p><strong><?php _e( 'Note: Using the same menu item multiple times could cause unexpected behavior.' , 'wp-admin-ui-customize' ); ?></strong></p>
<h3 id="wauc-apply-user-roles"><?php echo $this->get_apply_roles(); ?></h3>
<p><a href="#TB_inline?height=300&width=600&inlineId=list_variables&modal=false" title="<?php _e( 'Shortcodes' , 'wp-admin-ui-customize' ); ?>" class="thickbox"><?php _e( 'Available Shortcodes' , 'wp-admin-ui-customize' ); ?></a></p>
<form id="wauc_setting_sidemenu" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="sidemenu" />
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-2">
<div id="postbox-container-1" class="postbox-container">
<div id="can_menus">
<div class="postbox">
<h3 class="hndle"><span><?php _e( 'Available menu items' , 'wp-admin-ui-customize' ); ?></span></h3>
<div class="inside">
<p class="description"><?php _e( 'Sepalator' , 'wp-admin-ui-customize' ); ?></p>
<?php $menu_widget = array( 'title' => '-' , 'slug' => 'separator' , 'parent_slug' => '' , 'new' => true , 'cap' => 'read' ); ?>
<?php $this->sidebar_menu_widget( $menu_widget ); ?>
<div class="clear"></div>
<?php foreach($this->Menu as $mm) : ?>
<?php if( !empty( $mm[0] ) ) : ?>
<?php $menu_title = $mm[0]; ?>
<?php if( $mm[5] == 'menu-comments' ) : ?>
<?php $menu_title = __( 'Comments' ); ?>
<?php elseif( $mm[5] == 'menu-appearance' ) : ?>
<?php $menu_title = __( 'Appearance' ); ?>
<?php elseif( $mm[5] == 'menu-plugins' ) : ?>
<?php $menu_title = __( 'Plugins' ); ?>
<?php endif; ?>
<p class="description"><?php echo $menu_title; ?></p>
<?php if( empty( $this->SubMenu[$mm[2]] ) ) : ?>
<?php $menu_widget = array( 'title' => $menu_title , 'slug' => $mm[2] , 'parent_slug' => '' , 'new' => true , 'cap' => $mm[1] , 'submenu' => '' ); ?>
<?php $this->sidebar_menu_widget( $menu_widget ); ?>
<?php else: ?>
<?php foreach($this->SubMenu as $parent_slug => $sub) : ?>
<?php foreach($sub as $sm) : ?>
<?php if( $mm[2] == $parent_slug ) : ?>
<?php $menu_title = $sm[0]; ?>
<?php if( $sm[1] == 'update_core' ) : ?>
<?php $menu_title = __( 'Update' ) . ' [update_total]'; ?>
<?php elseif( $sm[2] == 'edit-comments.php' ) : ?>
<?php $menu_title .= ' [comment_count]'; ?>
<?php elseif( $sm[2] == 'themes.php' ) : ?>
<?php $menu_title .= ' [update_themes]'; ?>
<?php elseif( $sm[2] == 'plugins.php' ) : ?>
<?php $menu_title .= ' [update_plugins]'; ?>
<?php endif; ?>
<?php $menu_widget = array( 'title' => $menu_title , 'slug' => $sm[2] , 'parent_slug' => '' , 'new' => true , 'cap' => $sm[1] , 'submenu' => '' ); ?>
<?php $this->sidebar_menu_widget( $menu_widget ); ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endif; ?>
<div class="clear"></div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<div id="postbox-container-2" class="postbox-container">
<div id="setting_menus">
<div class="postbox">
<h3 class="hndle">
<span><?php _e( 'Current menu' , 'wp-admin-ui-customize' ); ?></span>
</h3>
<div class="inside widgets-holder-wrap">
<?php if( empty( $Data ) ) : ?>
<?php foreach($this->Menu as $mm) : ?>
<?php if( isset( $mm[2] ) && strstr( $mm[2] , 'separator' ) ) : ?>
<?php $menu_title = '-'; ?>
<?php $mm[2] = 'separator'; ?>
<?php $mwsm = array(); ?>
<?php elseif( !empty( $mm[0] ) ) : ?>
<?php $menu_title = $mm[0]; ?>
<?php if( !empty( $mm[5] ) ) : ?>
<?php if( $mm[5] == 'menu-comments' ) : ?>
<?php $menu_title = __( 'Comments' ) . ' [comment_count]'; ?>
<?php elseif( $mm[5] == 'menu-appearance' ) : ?>
<?php $menu_title = __( 'Appearance' ) . ' [update_themes]'; ?>
<?php elseif( $mm[5] == 'menu-plugins' ) : ?>
<?php $menu_title = __( 'Plugins' ) . ' [update_plugins]'; ?>
<?php endif; ?>
<?php endif; ?>
<?php $mwsm = array(); ?>
<?php foreach($this->SubMenu as $parent_slug => $sub) : ?>
<?php foreach($sub as $sm) : ?>
<?php if( $mm[2] == $parent_slug ) : ?>
<?php $submenu_title = $sm[0]; ?>
<?php if( $sm[1] == 'update_core' ) : ?>
<?php $submenu_title = __( 'Update' ) . ' [update_total]'; ?>
<?php endif; ?>
<?php $mwsm[] = array( 'title' => $submenu_title , 'slug' => $sm[2] , 'parent_slug' => $parent_slug , 'cap' => $sm[1] ); ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php $menu_widget = array( 'title' => $menu_title , 'slug' => $mm[2] , 'parent_slug' => '' , 'new' => false , 'cap' => $mm[1] , 'submenu' => $mwsm ); ?>
<?php $this->sidebar_menu_widget( $menu_widget ); ?>
<?php endforeach; ?>
<?php else: ?>
<?php if( !empty( $Data["main"] ) ) : ?>
<?php foreach($Data["main"] as $mm) : ?>
<?php if( !empty( $mm["title"] ) ) : ?>
<?php $mm_slug = htmlspecialchars_decode( $mm["slug"] ); ?>
<?php $mwsm = array(); ?>
<?php if( !empty( $Data["sub"] ) ) : ?>
<?php foreach($Data["sub"] as $sm) : ?>
<?php $sm_slug = htmlspecialchars_decode( $sm["slug"] ); ?>
<?php $sm_parent_slug = htmlspecialchars_decode( $sm["parent_slug"] ); ?>
<?php if( $mm_slug == $sm_parent_slug ) : ?>
<?php $cap = ""; ?>
<?php if( !empty( $this->SubMenu[$mm_slug] ) ) : ?>
<?php foreach( $this->SubMenu[$mm_slug] as $k => $tmp_sm ) : ?>
<?php if( $tmp_sm[2] == $sm_slug ) : ?>
<?php $cap = $tmp_sm[1]; ?>
<?php break; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php $mwsm[] = array( 'title' => $sm["title"] , 'slug' => $sm["slug"] , 'parent_slug' => $sm["parent_slug"] , 'cap' => $cap ); ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php $cap = ""; ?>
<?php foreach( $this->Menu as $tmp_m ) : ?>
<?php if( $tmp_m[2] == $mm_slug ) : ?>
<?php $cap = $tmp_m[1]; ?>
<?php break; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php $menu_widget = array( 'title' => $mm["title"] , 'slug' => $mm["slug"] , 'parent_slug' => '' , 'new' => false , 'cap' =>$cap , 'submenu' => $mwsm ); ?>
<?php $this->sidebar_menu_widget( $menu_widget ); ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<p class="sidebar_setting_delete"><a href="#"><?php _e( 'Remove all items from the current menu' , 'wp-admin-ui-customize' ); ?></a></p>
</div>
</div>
<br class="clear">
</div>
</div>
<p class="submit">
<input type="submit" class="button-primary" name="update" value="<?php echo esc_attr( __( 'Save' ) ); ?>" />
</p>
<p class="submit reset">
<span class="description"><?php printf( __( 'Reset the %s?' , 'wp-admin-ui-customize' ) , __( 'Sidebar' , 'wp-admin-ui-customize' ) . __( 'Settings' ) ); ?></span>
<input type="submit" class="button-secondary" name="reset" value="<?php echo esc_attr( __( 'Reset settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
</form>
</div>
<?php require_once( dirname( __FILE__ ) . '/list_variables.php' ); ?>
<style>
.widget h4 {
padding: 12px 15px;
}
.widget-top a.widget-action {
cursor: pointer;
display: inline-block;
}
.widget-top a.widget-action:focus {
box-shadow: none;
}
.widget-top a.widget-action:before {
display: inline-block;
content: "\f140";
font: normal 20px/1 dashicons;
}
</style>
<script type="text/javascript">
var wauc_widget_each, wauc_menu_sortable;
jQuery(document).ready(function($) {
var $Form = $("#wauc_setting_sidemenu");
var $AddInside = $('#can_menus .postbox .inside', $Form);
var $SettingInside = $('#setting_menus .postbox .inside', $Form);
$AddInside.children('.widget').draggable({
connectToSortable: '#setting_menus .postbox .inside',
handle: '> .widget-top > .widget-title',
distance: 2,
helper: 'clone',
zIndex: 5,
stop: function(e,ui) {
wauc_widget_each();
wauc_menu_sortable();
}
});
$('#postbox-container-1', $Form).droppable({
tolerance: 'pointer',
accept: function(o){
return $(o).parent().parent().parent().attr('id') != 'postbox-container-1';
},
drop: function(e,ui) {
ui.draggable.addClass('deleting');
},
over: function(e,ui) {
ui.draggable.addClass('deleting');
$('div.widget-placeholder').hide();
},
out: function(e,ui) {
ui.draggable.removeClass('deleting');
$('div.widget-placeholder').show();
}
});
$(document).on('click', '.widget .widget-top .widget-title-action', function() {
$(this).parent().parent().children(".widget-inside").slideToggle();
return false;
});
$(document).on('click', '.widget .widget-inside .widget-control-actions .alignleft a[href="#remove"]', function() {
$(this).parent().parent().parent().parent().slideUp('normal', function() { $(this).remove(); } );
return false;
});
wauc_menu_sortable = function menu_sortable() {
$('#wauc_setting_sidemenu #poststuff #post-body #postbox-container-2 #setting_menus .postbox .inside, #wauc_setting_sidemenu #poststuff #post-body #postbox-container-2 #setting_menus .postbox .inside .widget .widget-inside .submenu').sortable({
placeholder: "widget-placeholder",
items: '> .widget',
connectWith: "#wauc_setting_sidemenu #poststuff #post-body #postbox-container-2 #setting_menus .postbox .inside, #wauc_setting_sidemenu #poststuff #post-body #postbox-container-2 #setting_menus .postbox .inside .widget .widget-inside .submenu",
handle: '> .widget-top > .widget-title',
cursor: 'move',
distance: 2,
change: function(e,ui) {
var $height = ui.helper.height();
$('#wauc_setting_sidemenu #poststuff #post-body #postbox-container-2 #setting_menus .postbox .inside .widget-placeholder').height($height);
},
stop: function(e,ui) {
if ( ui.item.hasClass('deleting') ) {
ui.item.remove();
}
ui.item.attr( 'style', '' ).removeClass('ui-draggable');
wauc_widget_each();
},
});
}
wauc_menu_sortable();
wauc_widget_each = function widget_each() {
var $Count = 0;
$('#wauc_setting_sidemenu #setting_menus .postbox .inside .widget').each(function() {
var $InputSlug = $(this).children(".widget-inside").children(".settings").children(".description").children(".slugtext");
var $InputTitle = $(this).children(".widget-inside").children(".settings").children("label").children(".titletext");
var $InputParentSlug = $(this).children(".widget-inside").children(".settings").children(".parent_slugtext");
var $Name = 'data' + '['+$Count+']';
$InputSlug.attr("name", $Name+'[slug]');
$InputTitle.attr("name", $Name+'[title]');
$InputParentSlug.attr("name", $Name+'[parent_slug]');
if ( $(this).parent().parent().parent().parent().hasClass("submenu") ) {
// None three
$(this).remove();
} else if ( $(this).parent().hasClass("submenu") ) {
var $ParentSlug = $(this).parent().parent().children(".settings").children(".description").children(".slugtext").val();
$InputParentSlug.val($ParentSlug);
} else {
$InputParentSlug.val('');
}
$Count++;
});
}
wauc_widget_each();
$('#setting_menus .sidebar_setting_delete a').on('click', function() {
$('#setting_menus .postbox .inside').html('');
return false;
});
$('#wauc_setting_sidemenu').on('submit', function() {
$('#can_menus').remove();
return true;
});
});
</script>

View File

@@ -0,0 +1,174 @@
<?php
$Data = $this->get_data( 'site' );
$SiteSetting = get_option( $this->Record["site"] );
// include js css
$ReadedJs = array( 'jquery' , 'jquery-ui-sortable' );
wp_enqueue_script( $this->PageSlug , $this->Url . $this->PluginSlug . '.js', $ReadedJs , $this->Ver );
wp_enqueue_style( $this->PageSlug , $this->Url . $this->PluginSlug . '.css', array() , $this->Ver );
?>
<div class="wrap">
<?php echo $this->Msg; ?>
<h2><?php _e( 'Site Settings' , 'wp-admin-ui-customize' ); ?></h2>
<p>&nbsp;</p>
<h3 id="wauc-apply-user-roles"><?php echo $this->get_apply_roles(); ?></h3>
<form id="wauc_setting_site" class="wauc_form" method="post" action="<?php echo esc_url( remove_query_arg( 'wauc_msg' , add_query_arg( array( 'page' => $this->PageSlug ) ) ) ); ?>">
<input type="hidden" name="<?php echo esc_attr( $this->UPFN ); ?>" value="Y" />
<?php wp_nonce_field( $this->Nonces["value"] , $this->Nonces["field"] ); ?>
<input type="hidden" name="record_field" value="site" />
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-1">
<div id="postbox-container-1" class="postbox-container">
<div id="meta_fields">
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php _e( 'Header Meta' , 'wp-admin-ui-customize' ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<?php $field = 'wp_generator'; ?>
<tr>
<th>
<label><?php echo $field; ?></label>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $SiteSetting[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
<p class="description"><?php _e( 'Tag' , 'wp-admin-ui-customize' ); ?> : <code><?php echo esc_html( get_the_generator( 'xhtml' ) ); ?></code></p>
</td>
</tr>
<?php $field = 'wlwmanifest_link'; ?>
<tr>
<th>
<?php echo $field; ?>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $SiteSetting[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
<p class="description"><?php _e( 'Required if you are using Windows Live Writer.' , 'wp-admin-ui-customize' ); ?></p>
<p class="description"><?php _e( 'Tag' , 'wp-admin-ui-customize' ); ?> : <code><?php echo esc_html( '<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="' . esc_url( get_bloginfo('wpurl') ) . '/wp-includes/wlwmanifest.xml" />' ); ?></code></p>
</td>
</tr>
<?php $field = 'rsd_link'; ?>
<tr>
<th>
<?php echo $field; ?>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $SiteSetting[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
<p class="description"><?php _e( 'Required if you are using pingbacks.' , 'wp-admin-ui-customize' ); ?></p>
<p class="description"><?php _e( 'Tag' , 'wp-admin-ui-customize' ); ?> : <code><?php echo esc_html( '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="' . esc_url( get_bloginfo('wpurl') ) . '"/xmlrpc.php?rsd" />' ); ?></code></p>
</td>
</tr>
<?php $field = 'feed_links'; ?>
<tr>
<th>
<?php echo $field; ?>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $SiteSetting[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
<p class="description"><?php _e( 'Adds RSS feed links to the HTML &lt;head&gt;' , 'wp-admin-ui-customize' ); ?></p>
<p class="description"><?php _e( 'Tag' , 'wp-admin-ui-customize' ); ?> : <code><?php echo esc_html( '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( sprintf( __('%1$s %2$s Feed') , get_bloginfo('name') , '&amp;raquo&#059;' ) ) . '" href="' . get_feed_link( get_default_feed() ) . ' />' ); ?></code></p>
</td>
</tr>
<?php $field = 'feed_links_extra'; ?>
<tr>
<th>
<?php echo $field; ?>
</th>
<td>
<?php $Checked = ''; ?>
<?php if( !empty( $SiteSetting[$field] ) ) : $Checked = 'checked="checked"'; endif; ?>
<label><input type="checkbox" name="data[<?php echo esc_attr( $field ); ?>]" value="1" <?php echo esc_attr( $Checked ); ?> /> <?php _e ( 'Hide' ); ?></label>
<p class="description"><?php _e( 'Adds RSS feed links for other feeds such as category feeds' , 'wp-admin-ui-customize' ); ?></p>
<p class="description"><?php _e( 'Tag' , 'wp-admin-ui-customize' ); ?> : <code><?php echo esc_html( '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( sprintf( __('%1$s %2$s Comments Feed') , get_bloginfo('name') , '&amp;raquo&#059;' ) ) . '" href="' . get_feed_link( get_default_feed() . '&#038;p=***' ) . ' />' ); ?></code></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="postbox-container-2" class="postbox-container">
<div id="general">
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php _e( 'General' ); ?></span></h3>
<div class="inside">
<table class="form-table">
<tbody>
<?php $field = 'admin_bar'; ?>
<tr>
<th>
<?php _e( 'Admin bar' , 'wp-admin-ui-customize' ); ?>
</th>
<td>
<?php $arr = array( "hide" => __( 'Hide admin bar on the front end' , 'wp-admin-ui-customize' ) , "front" => __( 'Apply WP Admin UI Customize settings to the front end admin bar' , 'wp-admin-ui-customize' ) ); ?>
<select name="data[<?php echo esc_attr( $field ); ?>]">
<option value="">-</option>
<?php foreach( $arr as $key => $label ) : ?>
<?php $Selected = ''; ?>
<?php if( !empty( $Data[$field] ) ) : ?>
<?php if( $Data[$field] == $key ) : $Selected = 'selected="selected"'; endif; ?>
<?php if( $key == "hide" && $Data[$field] == "1" ) : $Selected = 'selected="selected"'; endif; ?>
<?php endif; ?>
<option value="<?php echo esc_attr( $key ); ?>" <?php echo esc_attr( $Selected ); ?>><?php echo esc_attr( $label ); ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<br class="clear">
</div>
</div>
<p class="submit">
<input type="submit" class="button-primary" name="update" value="<?php echo esc_attr( __( 'Save' ) ); ?>" />
</p>
<p class="submit reset">
<span class="description"><?php printf( __( 'Reset the %s?' , 'wp-admin-ui-customize' ) , __( 'Site Settings' , 'wp-admin-ui-customize' ) ); ?></span>
<input type="submit" class="button-secondary" name="reset" value="<?php echo esc_attr( __( 'Reset settings' , 'wp-admin-ui-customize' ) ); ?>" />
</p>
</form>
</div>
<style>
</style>
<script>
jQuery(document).ready( function($) {
});
</script>