From 907eabeebd2abc5a8b8ad393a1c13c64aa330aa2 Mon Sep 17 00:00:00 2001 From: Guy Primavera <17991356+GuyPrimavera@users.noreply.github.com> Date: Tue, 13 Nov 2018 16:18:19 +0000 Subject: [PATCH] v2.3 --- admin/adminBar.php | 3 + admin/adminBar/adminBarIcon.php | 35 ++ admin/adminBar/adminBarLinks.php | 56 +-- admin/adminBar/adminBarStyle.php | 20 + admin/adminBar/adminBarTitle.php | 31 -- admin/adminBar/customLogo.php | 111 +++++ admin/adminBar/removeHowdy.php | 1 - admin/adminBar/screenLinks.php | 5 - admin/colour/bright.php | 7 +- admin/colour/colourScheme.php | 67 +-- admin/colour/isDark.php | 5 +- admin/colour/lum.php | 4 +- admin/colour/mdColours.php | 2 +- admin/dashboard.php | 2 - admin/functions/addClasses.php | 13 - admin/functions/footer.php | 7 +- admin/functions/hideNag.php | 7 +- admin/functions/pluginList.php | 5 - admin/functions/postToBlog.php | 24 +- admin/options/callbacks.php | 20 + admin/options/createFields.php | 56 +++ admin/options/createOptionsPage.php | 45 ++ admin/options/help.php | 67 +++ admin/options/helpers.php | 80 ++++ admin/options/options.php | 10 + admin/options/registerSettings.php | 197 +++++++++ admin/widgets/pluginWidget.php | 16 +- admin/widgets/removeWidgets.php | 53 ++- admin/widgets/welcomeWidget.php | 19 +- aquila-admin-theme.php | 11 +- css/adminBar.css | 72 +++- css/adminBar.less | 64 ++- css/aquila.css | 224 ++++++++-- css/aquila.less | 207 +++++++++- css/login.css | 15 +- css/login.less | 8 + css/vars.css | 9 +- css/vars.less | 8 +- js/calls.js | 182 +++----- ...min-theme-en_GB-backup-201811131454080.po~ | 317 ++++++++++++++ lang/aquila-admin-theme-en_GB.mo | Bin 751 -> 5355 bytes lang/aquila-admin-theme-en_GB.po | 385 +++++++++++------ ...min-theme-it_IT-backup-201811131506370.po~ | 317 ++++++++++++++ lang/aquila-admin-theme-it_IT.mo | Bin 3356 -> 5753 bytes lang/aquila-admin-theme-it_IT.po | 388 ++++++++++++------ lang/aquila-admin-theme.pot | 318 ++++++++++++++ login/aquila-login-screen.php | 3 +- readme.txt | 47 ++- scripts.php | 43 +- 49 files changed, 2879 insertions(+), 707 deletions(-) create mode 100644 admin/adminBar/adminBarIcon.php create mode 100644 admin/adminBar/adminBarStyle.php create mode 100644 admin/adminBar/customLogo.php create mode 100644 admin/options/callbacks.php create mode 100644 admin/options/createFields.php create mode 100644 admin/options/createOptionsPage.php create mode 100644 admin/options/help.php create mode 100644 admin/options/helpers.php create mode 100644 admin/options/options.php create mode 100644 admin/options/registerSettings.php create mode 100644 lang/aquila-admin-theme-en_GB-backup-201811131454080.po~ create mode 100644 lang/aquila-admin-theme-it_IT-backup-201811131506370.po~ create mode 100644 lang/aquila-admin-theme.pot diff --git a/admin/adminBar.php b/admin/adminBar.php index 39646b1..c860eb1 100644 --- a/admin/adminBar.php +++ b/admin/adminBar.php @@ -1,5 +1,8 @@ + .aquilaFront #wpadminbar { + display: block; + } + '; + } + echo '
'; + } +} +add_action( 'admin_bar_menu', 'aquila_adminbar_icon', 999 ); + +// Add body class +function aquila_adminbar_open_class( $classes ) { + if ( is_admin_bar_showing() ) { + $aquilaOptions = get_option( 'aquila_settings' ); + if(isset($aquilaOptions['aquila_chk_abVisible']) && $aquilaOptions['aquila_chk_abVisible'] == 1) { + $classes[] = 'aquilaOpenBar'; + } else { + $classes[] = 'aquilaClosedBar'; + } + return $classes; + } else { + return $classes; + } +} +add_filter('body_class', 'aquila_adminbar_open_class'); + +?> \ No newline at end of file diff --git a/admin/adminBar/adminBarLinks.php b/admin/adminBar/adminBarLinks.php index d1fed7a..19e6fd1 100644 --- a/admin/adminBar/adminBarLinks.php +++ b/admin/adminBar/adminBarLinks.php @@ -1,46 +1,35 @@ remove_menu('updates'); - $wp_admin_bar->remove_menu('comments'); - $wp_admin_bar->remove_menu('new-content'); - $wp_admin_bar->remove_menu('vc_inline-admin-bar-link'); - $wp_admin_bar->remove_menu('revslider'); - $wp_admin_bar->remove_menu('customize'); - $wp_admin_bar->remove_menu('themes'); - $wp_admin_bar->remove_menu('widgets'); - $wp_admin_bar->remove_menu('menus'); - $wp_admin_bar->remove_menu('wpseo-menu'); - $wp_admin_bar->remove_menu('ngg-menu'); - $wp_admin_bar->remove_menu('w3tc'); - $wp_admin_bar->remove_menu('all-in-one-seo-pack'); - $wp_admin_bar->remove_menu('updraft_admin_node'); - $wp_admin_bar->remove_menu('customer-area'); - $wp_admin_bar->remove_menu('itsec_admin_bar_menu'); - $wp_admin_bar->remove_menu('maintenance_options'); - $wp_admin_bar->remove_menu('tribe-events'); - $wp_admin_bar->remove_menu('analytify'); - $wp_admin_bar->remove_menu('cxssh-main-menu'); + add_action( 'admin_bar_menu', 'aquila_admin_bar_cleanup', 200 ); + function aquila_admin_bar_cleanup() + { + global $wp_admin_bar; + if ( !is_object( $wp_admin_bar ) ) { + return; + } + + $nodes = $wp_admin_bar->get_nodes(); + $nodesKeep = array('wp-logo', 'site-name', 'adminTitle', 'screenOptions', 'contextHelp', 'menu-toggle', 'my-account', 'view', 'edit'); + + foreach( $nodes as $node ) + { + if( (!$node->parent || 'top-secondary' == $node->parent) && (!in_array($node->id, $nodesKeep)) ) { + $wp_admin_bar->remove_menu( $node->id ); + //echo $node->id . '
'; + } + } } - add_action( 'wp_before_admin_bar_render', 'aquila_admin_bar_links', 999 ); - } // Remove nodes - add_action( 'admin_bar_menu', 'aquila_remove_wp_logo_nodes', 999 ); - -function aquila_remove_wp_logo_nodes() -{ +function aquila_remove_wp_logo_nodes() { global $wp_admin_bar; $wp_admin_bar->remove_node( 'about' ); $wp_admin_bar->remove_node( 'wporg' ); @@ -50,10 +39,8 @@ function aquila_remove_wp_logo_nodes() } // Add Aquila links - add_action('admin_bar_menu', 'aquila_wp_logo_links', 100); function aquila_wp_logo_links($admin_bar){ - $admin_bar->add_menu( array( 'id' => 'wpLessons', 'parent'=> 'wp-logo', @@ -65,7 +52,6 @@ function aquila_wp_logo_links($admin_bar){ 'target' => __('_blank'), ), )); - $admin_bar->add_menu( array( 'id' => 'wpGuide', 'parent'=> 'wp-logo', @@ -77,7 +63,6 @@ function aquila_wp_logo_links($admin_bar){ 'target' => __('_blank'), ), )); - $admin_bar->add_menu( array( 'id' => 'mitoSupport', 'parent'=> 'wp-logo-external', @@ -89,7 +74,6 @@ function aquila_wp_logo_links($admin_bar){ 'target' => __('_blank'), ), )); - } ?> \ No newline at end of file diff --git a/admin/adminBar/adminBarStyle.php b/admin/adminBar/adminBarStyle.php new file mode 100644 index 0000000..62622b4 --- /dev/null +++ b/admin/adminBar/adminBarStyle.php @@ -0,0 +1,20 @@ + + html { margin-top: 0px !important; } + * html body { margin-top: 0px !important; } + @media screen and ( max-width: 782px ) { + html { margin-top: 0px !important; } + * html body { margin-top: 0px !important; } + } + + "; + } +} +add_action( 'wp_head', 'aquila_admin_bar', 99 ); +remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' ); + +?> \ No newline at end of file diff --git a/admin/adminBar/adminBarTitle.php b/admin/adminBar/adminBarTitle.php index 8090f33..c9ae724 100644 --- a/admin/adminBar/adminBarTitle.php +++ b/admin/adminBar/adminBarTitle.php @@ -5,15 +5,12 @@ } function aquila_adminbar_title($admin_bar){ - $postType = false; $postType = get_current_screen()->post_type; $postTypeName = get_post_type_object( $postType ); $adminTitle = false; $adminTitle = get_admin_page_title(); - if ($adminTitle !== false && $postType !== false && is_admin()) { - $admin_bar->add_menu( array( 'id' => 'adminTitle', 'title' => $adminTitle, @@ -22,34 +19,6 @@ function aquila_adminbar_title($admin_bar){ 'title' => __($adminTitle), ), )); - -/* - if ($postType !== false) { - - $admin_bar->add_menu( array( - 'id' => 'viewAll', - 'parent' => 'adminTitle', // Rename when ready for "Add new" - 'title' => 'All ' . $postTypeName->labels->name, - 'href' => get_admin_url( ) . 'edit.php?post_type=' . $postType, - 'meta' => array( - 'title' => __('My Sub Menu Item'), - 'target' => '_blank', - 'class' => 'my_menu_item_class' - ), - )); - $admin_bar->add_menu( array( - 'id' => 'my-second-sub-item', - 'parent' => 'adminTitle', - 'title' => 'New ' . $postTypeName->labels->singular_name, - 'href' => get_admin_url( ) . 'post-new.php?post_type=' . $postType, - 'meta' => array( - 'title' => __('My Second Sub Menu Item'), - 'target' => '_blank', - 'class' => 'my_menu_item_class' - ), - )); - } - */ } } diff --git a/admin/adminBar/customLogo.php b/admin/adminBar/customLogo.php new file mode 100644 index 0000000..0c22a38 --- /dev/null +++ b/admin/adminBar/customLogo.php @@ -0,0 +1,111 @@ + + #wpadminbar li#wp-admin-bar-wp-logo > .ab-item .ab-icon:before { + display: none!important; + } + #wpadminbar #wp-toolbar li#wp-admin-bar-wp-logo > .ab-item span.ab-icon { + background-image: url('" . $GLOBALS['aquilaNewLogo'] . "')!important; + background-size: contain; + background-repeat: no-repeat; + background-position: center center; + margin: 0%!important; + max-width: 80%; + height: 70%; + top: 15%; + left: 10%; + } + #aquilaAdminbarIcon { + background-image: url('" . $GLOBALS['aquilaNewLogoSqr'] . "')!important; + background-size: 40px; + background-repeat: no-repeat; + background-position: center center; + } + #aquilaAdminbarIcon:before { + display: none!important; + } + body.folded #wpadminbar li#wp-admin-bar-wp-logo > .ab-item .ab-icon:before { + display: none!important; + } + body.folded #wpadminbar #wp-toolbar li#wp-admin-bar-wp-logo > .ab-item span.ab-icon { + background-image: url('" . $GLOBALS['aquilaNewLogoSqr'] . "')!important; + background-size: contain; + background-repeat: no-repeat; + background-position: center center; + margin: 0%!important; + max-width: 80%; + height: 70%; + top: 15%; + left: 10%; + } + "; +} + +// Login screen +function aquila_new_logo_login() { + echo ""; +} + +function aquila_new_logo_sqr_admin() { + echo ""; +} + +?> \ No newline at end of file diff --git a/admin/adminBar/removeHowdy.php b/admin/adminBar/removeHowdy.php index 5cbf5bd..91795a6 100644 --- a/admin/adminBar/removeHowdy.php +++ b/admin/adminBar/removeHowdy.php @@ -1,7 +1,6 @@ add_menu( array( 'id' => 'screenOptions', 'title' => '', @@ -12,7 +11,6 @@ function new_screenlinks($admin_bar){ 'class' => __('screenLink'), ), )); - $admin_bar->add_menu( array( 'id' => 'contextHelp', 'title' => '', @@ -22,9 +20,6 @@ function new_screenlinks($admin_bar){ 'class' => __('screenLink'), ), )); - - - } ?> \ No newline at end of file diff --git a/admin/colour/bright.php b/admin/colour/bright.php index 3541e07..8064cd8 100644 --- a/admin/colour/bright.php +++ b/admin/colour/bright.php @@ -1,24 +1,19 @@ -setFormatter("compressed"); @@ -129,9 +133,7 @@ function colourSchemeCSS() { echo ''; -} ?> +} + +?> \ No newline at end of file diff --git a/admin/colour/isDark.php b/admin/colour/isDark.php index 4170dee..2785b8b 100644 --- a/admin/colour/isDark.php +++ b/admin/colour/isDark.php @@ -1,7 +1,6 @@ - \ No newline at end of file diff --git a/admin/colour/lum.php b/admin/colour/lum.php index 098204f..ebbcda2 100644 --- a/admin/colour/lum.php +++ b/admin/colour/lum.php @@ -1,9 +1,7 @@ - \ No newline at end of file diff --git a/admin/functions/addClasses.php b/admin/functions/addClasses.php index e13bac5..1dbc48f 100644 --- a/admin/functions/addClasses.php +++ b/admin/functions/addClasses.php @@ -1,38 +1,25 @@ roles); - $classes .= 'aquila aquilaAdmin'; return $classes; - } //add_filter('body_class','aquila_admin_body_role'); add_filter('admin_body_class', 'aquila_admin_body_role'); - function aquila_front_body_class( $classes ) { - - if ( is_admin_bar_showing() ) { - //global $current_user; //$userRole = array_shift($current_user->roles); - $classes[] = 'aquila aquilaFront'; return $classes; - } else { - $classes[] = ' '; return $classes; - } - } add_filter('body_class', 'aquila_front_body_class'); diff --git a/admin/functions/footer.php b/admin/functions/footer.php index 8797617..a9cbb72 100644 --- a/admin/functions/footer.php +++ b/admin/functions/footer.php @@ -1,19 +1,14 @@ design by Mito'; } add_filter('admin_footer_text', 'aquila_admin_footer_admin'); - } - ?> \ No newline at end of file diff --git a/admin/functions/hideNag.php b/admin/functions/hideNag.php index b48839f..2d10d9f 100644 --- a/admin/functions/hideNag.php +++ b/admin/functions/hideNag.php @@ -1,13 +1,10 @@ \ No newline at end of file diff --git a/admin/functions/pluginList.php b/admin/functions/pluginList.php index 16d4b29..48cc96a 100644 --- a/admin/functions/pluginList.php +++ b/admin/functions/pluginList.php @@ -8,23 +8,18 @@ $allPlugins = get_plugins(); $allPluginsKeys = array_keys($allPlugins); - $Count = 0; foreach ($allPlugins as $pluginItem) { - $pluginRootFile = $allPluginsKeys[$Count]; $pluginTitle = $pluginItem['Title']; $pluginVersion = $pluginItem['Version']; $pluginURI = $pluginItem['PluginURI']; $pluginDomain = $pluginItem['TextDomain']; $pluginStatus = is_plugin_active($pluginRootFile) ? 'active' : 'inactive'; - if (($pluginStatus == "active") && ($pluginURI)) { echo "
  • " . $pluginTitle . "
  • "; } - //echo print_r($allPlugins, true); - $Count++; } diff --git a/admin/functions/postToBlog.php b/admin/functions/postToBlog.php index 95ba591..568b1f0 100644 --- a/admin/functions/postToBlog.php +++ b/admin/functions/postToBlog.php @@ -3,21 +3,23 @@ $aquilaOptions = get_option( 'aquila_settings' ); if(isset($aquilaOptions['aquila_chk_postBlog']) && $aquilaOptions['aquila_chk_postBlog'] == 1){ - + // do nothing } else { - function aquila_admin_post_to_blog() { global $menu; //global $submenu; - if (isset($menu[5][5]) && $menu[5][5] === "menu-posts" && current_user_can("edit_posts")) { $menu[5][0] = 'Blog'; - $submenu['edit.php'][5][0] = __( 'Blog', 'aquila-admin-theme' ); - $submenu['edit.php'][10][0] = __( 'Add Blog Post', 'aquila-admin-theme' ); - $submenu['edit.php'][16][0] = __( 'Blog Tags', 'aquila-admin-theme' ); - echo ''; - } // Thanks Aaron Queen - + if (isset($submenu['edit.php'][5])) { + $submenu['edit.php'][5][0] = __( 'Blog', 'aquila-admin-theme' ); + } + if (isset($submenu['edit.php'][10])) { + $submenu['edit.php'][10][0] = __( 'Add Blog Post', 'aquila-admin-theme' ); + } + if (isset($submenu['edit.php'][16])) { + $submenu['edit.php'][16][0] = __( 'Blog Tags', 'aquila-admin-theme' ); + } + } } function aquila_admin_blog_object() { global $wp_post_types; @@ -36,19 +38,15 @@ function aquila_admin_blog_object() { $labels->menu_name = __( 'Blog', 'aquila-admin-theme' ); $labels->name_admin_bar = __( 'Blog', 'aquila-admin-theme' ); } - add_action( 'admin_menu', 'aquila_admin_post_to_blog' ); add_action( 'init', 'aquila_admin_blog_object' ); - } // Format meta box - function aquila_admin_blog_meta_boxes() { remove_meta_box( 'formatdiv' , 'post' , 'normal' ); remove_meta_box( 'mymetabox_revslider_0' , 'post' , 'normal' ); } add_action( 'admin_menu' , 'aquila_admin_blog_meta_boxes' ); - ?> \ No newline at end of file diff --git a/admin/options/callbacks.php b/admin/options/callbacks.php new file mode 100644 index 0000000..91629fb --- /dev/null +++ b/admin/options/callbacks.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/admin/options/createFields.php b/admin/options/createFields.php new file mode 100644 index 0000000..c80bf0e --- /dev/null +++ b/admin/options/createFields.php @@ -0,0 +1,56 @@ + \ No newline at end of file diff --git a/admin/options/createOptionsPage.php b/admin/options/createOptionsPage.php new file mode 100644 index 0000000..61b878d --- /dev/null +++ b/admin/options/createOptionsPage.php @@ -0,0 +1,45 @@ + +
    + +

    + + + + + + +
    + + + +
    +
    + + \ No newline at end of file diff --git a/admin/options/help.php b/admin/options/help.php new file mode 100644 index 0000000..27f07bf --- /dev/null +++ b/admin/options/help.php @@ -0,0 +1,67 @@ +'; + aquila_help_box ( + 'https://wordpress.org/plugins/aquila-admin-theme/', + __( 'View this plugin on WordPress.org', 'aquila-admin-theme' ), + __( 'See the features and recent updates.', 'aquila-admin-theme' ) + ); + aquila_help_box ( + 'https://wordpress.org/support/plugin/aquila-admin-theme', + __( 'View the support forum', 'aquila-admin-theme' ), + __( 'On WordPress.org.', 'aquila-admin-theme' ) + ); + aquila_help_box ( + 'https://wordpress.org/support/plugin/aquila-admin-theme#new-post', + __( 'Ask a question', 'aquila-admin-theme' ), + __( 'Something not working? Let me know.', 'aquila-admin-theme' ) + ); + aquila_help_box ( + 'https://wordpress.org/plugins/aquila-admin-theme/#developers', + __( 'See the ChangeLog', 'aquila-admin-theme' ), + __( 'See what\'s changed.', 'aquila-admin-theme' ) + ); + aquila_help_box ( + 'https://translate.wordpress.org/projects/wp-plugins/aquila-admin-theme', + __( 'Translate into your language', 'aquila-admin-theme' ), + __( 'Je voudrais un sandwich.', 'aquila-admin-theme' ) + ); + aquila_help_box ( + 'https://github.com/GuyPrimavera/aquila-admin-theme', + __( 'View the source code on GitHub', 'aquila-admin-theme' ), + __( 'It\'s a hub for gits.', 'aquila-admin-theme' ) + ); + aquila_help_box ( + 'https://plugins.trac.wordpress.org/browser/aquila-admin-theme/', + __( 'View the source code on WP Trac', 'aquila-admin-theme' ), + __( 'Similar to GitHub.', 'aquila-admin-theme' ) + ); + aquila_help_box ( + 'https://plugins.trac.wordpress.org/log/aquila-admin-theme/', + __( 'View the development log', 'aquila-admin-theme' ), + __( 'On WordPress.org.', 'aquila-admin-theme' ) + ); + aquila_help_box ( + 'https://wordpress.org/plugins/aquila-admin-theme/advanced/#plugin-download-history-stats', + __( 'Previous versions', 'aquila-admin-theme' ), + __( 'Download an older version of the plugin.', 'aquila-admin-theme' ) + ); + aquila_help_box ( + 'https://guyprimavera.com/projects/wordpress-plugins/aquila-admin-theme/', + __( 'View the plugin\'s web page', 'aquila-admin-theme' ), + __( 'On GuyPrimavera.com.', 'aquila-admin-theme' ) + ); + aquila_help_box ( + 'https://wordpress.org/support/plugin/aquila-admin-theme/reviews/#new-post', + __( 'Leave a review', 'aquila-admin-theme' ), + __( 'Let me know what you think!', 'aquila-admin-theme' ) + ); + aquila_help_box ( + 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YVPWSJB4SPN5N', + __( 'Donate towards this plugin', 'aquila-admin-theme' ), + __( 'This full-version is free to use, but every little helps!', 'aquila-admin-theme' ) + ); + echo '