Skip to content

Commit

Permalink
v2.4.2
Browse files Browse the repository at this point in the history
* Fixed error with lessc_formatter_compressed class.
* Added option to disable login page styling.
* Fixed styling of password reset page.
* Fixed styling of registration page.
* Fixed undefined variable "visibleText".
* Fixed styling of input boxes.
* Updated part of welcome widget.
* Added darker background to clear PNG images in Media Library.
* Added option to change the admin area link colors.
  • Loading branch information
GuyPrimavera authored May 19, 2019
1 parent 445a32b commit 7368600
Show file tree
Hide file tree
Showing 20 changed files with 348 additions and 83 deletions.
6 changes: 2 additions & 4 deletions admin/adminBar/adminBarIcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
// Add icon in place of admin bar
function aquila_adminbar_icon() {
if ( is_admin_bar_showing() ) {
$aquilaOptions = get_option( 'aquila_settings' );
if(isset($aquilaOptions['aquila_chk_abVisible']) && $aquilaOptions['aquila_chk_abVisible'] == 1) {
if ($GLOBALS['aquilaShowFullAdminbar']) {
echo '<style>
.aquilaFront #wpadminbar {
display: block;
Expand All @@ -19,8 +18,7 @@ function aquila_adminbar_icon() {
// 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) {
if ($GLOBALS['aquilaShowFullAdminbar']) {
$classes[] = 'aquilaOpenBar';
} else {
$classes[] = 'aquilaClosedBar';
Expand Down
6 changes: 1 addition & 5 deletions admin/adminBar/adminBarLinks.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?php if ( __FILE__ == $_SERVER['SCRIPT_FILENAME'] ) { exit; }

// Admin Bar links
$aquilaOptions = get_option( 'aquila_settings' );

if(isset($aquilaOptions['aquila_chk_abLinks']) && $aquilaOptions['aquila_chk_abLinks'] == 1){
// do nothing
} else {
if (!$GLOBALS['aquilaShowAdminbarLinks']) {
add_action( 'admin_bar_menu', 'aquila_admin_bar_cleanup', 200 );
function aquila_admin_bar_cleanup()
{
Expand Down
22 changes: 0 additions & 22 deletions admin/adminBar/customLogo.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ function clean_output_buffer() {
if( isset($aquilaLogoSettings['aquila_new_logo']) && $aquilaLogoSettings['aquila_new_logo'] !== "" ) {
add_action( 'admin_head', 'aquila_new_logo_admin', 90);
add_action( 'wp_head', 'aquila_new_logo_admin', 90);
add_action( 'login_head', 'aquila_new_logo_login', 90 );
}

// Custom Logo (square)
Expand Down Expand Up @@ -68,27 +67,6 @@ function aquila_new_logo_admin() {
</style>";
}

// Login screen
function aquila_new_logo_login() {
echo "<style type='text/css'>
body.login #login:before {
display: none!important;
}
body.login #login h1 a {
display: block!important;
}
body.login #login h1 a {
background-image: url('" . $GLOBALS['aquilaNewLogo'] . "')!important;
background-size: contain;
background-repeat: no-repeat;
background-position: center center;
width: auto;
height: 80px;
max-width: 350px;
}
</style>";
}

function aquila_new_logo_sqr_admin() {
echo "<style type='text/css'>
body.folded #wpadminbar li#wp-admin-bar-wp-logo > .ab-item .ab-icon:before {
Expand Down
18 changes: 14 additions & 4 deletions admin/colour/colourScheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
} else {
add_action('wp_before_admin_bar_render', 'colourSchemeCSS');
}

add_action('login_head', 'colourSchemeCSS');
//add_action('login_head', 'colourSchemeCSS');
function colourSchemeCSS() {
include('mdColours.php');
include('bright.php');
Expand All @@ -16,6 +15,7 @@ function colourSchemeCSS() {
$aquilaColourSettings = get_option( 'aquilaColourSettings' );
$aquilaPrimary = $aquilaColourSettings['aquila_primary_colour'];
$aquilaSecondary = $aquilaColourSettings['aquila_secondary_colour'];
$aquilaLinkText = $aquilaColourSettings['aquila_link_text_colour'];
$aquilaMenuBack = $aquilaColourSettings['aquila_menu_back_colour'];
$aquilaMenuText = $aquilaColourSettings['aquila_menu_text_colour'];

Expand All @@ -41,6 +41,12 @@ function colourSchemeCSS() {
$secNew = $sec;
}

if ( $aquilaLinkText ) {
$linkText = $aquilaLinkText;
} else {
$linkText = $mdGrey900;
}

if ( $aquilaMenuBack ) {
$menu = $menuNew = $aquilaMenuBack;
/*if( isDark( $menu, 99 ) ) {
Expand Down Expand Up @@ -102,7 +108,7 @@ function colourSchemeCSS() {
}
$bodyBack = $mdGrey100;
$disabled = $mdGrey500;
$linkText = $mdGrey900;
//$linkText = $mdGrey900;

// LessPHP
if ( !class_exists( 'lessc' ) ) {
Expand Down Expand Up @@ -249,6 +255,10 @@ function colourSchemeCSS() {
a:focus {
color: @priD;
}
.wp-block-freeform.block-library-rich-text__tinymce a,
.components-button.is-link {
color: @linkText;
}
#media-upload a.del-link:hover,
div.dashboard-widget-submit input:hover,
.subsubsub a:hover,
Expand Down Expand Up @@ -723,7 +733,7 @@ function colourSchemeCSS() {
background: @menu;
color: @menuText;
#login {
form#loginform {
& > form {
background: @menu2;
}
}
Expand Down
8 changes: 8 additions & 0 deletions admin/options/callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ function aquilaDashboardCallback( ) {
function aquilaAdminbarCallback( ) {
//echo __( 'Configure your admin bar', 'aquila-admin-theme' );
}
function aquilaLoginCallback( ) {
/*echo '<form action="#">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="sample3">
<label class="mdl-textfield__label" for="sample3">Text...</label>
</div>
</form>';*/
}
function aquilaLogoCallback( ) {
echo __( 'Choose a custom logo for your admin area.', 'aquila-admin-theme' );
}
Expand Down
12 changes: 12 additions & 0 deletions admin/options/createFields.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php if ( __FILE__ == $_SERVER['SCRIPT_FILENAME'] ) { exit; }

// Dashboard
function aquila_chk_pluginSupport_render() {
aquila_checkbox ('aquila_settings', 'aquila_chk_pluginSupport', '');
}
Expand All @@ -15,13 +16,20 @@ function aquila_chk_hideFooter_render( ) {
function aquila_chk_showNag_render( ) {
aquila_checkbox ('aquila_settings', 'aquila_chk_showNag', '');
}

// Admin Bar
function aquila_chk_abLinks_render( ) {
aquila_checkbox ('aquila_settings', 'aquila_chk_abLinks', '');
}
function aquila_chk_abVisible_render( ) {
aquila_checkbox ('aquila_settings', 'aquila_chk_abVisible', '');
}

// Login page
function aquila_chk_loginDisable_render( ) {
aquila_checkbox ('aquila_settings', 'aquila_chk_loginDisable', '');
}

// Logo upload
function aquila_new_logo_render( ) {
aquila_img_upload( 'aquilaLogoSettings', 'aquila_new_logo' );
Expand All @@ -38,6 +46,10 @@ function aquila_primary_colour_render() {
function aquila_secondary_colour_render() {
aquila_colour_picker( 'aquilaColourSettings', 'aquila_secondary_colour' );
}
function aquila_link_text_colour_render() {
aquila_colour_picker( 'aquilaColourSettings', 'aquila_link_text_colour' );
}

/*
function aquila_text_colour_render() {
aquila_colour_picker( 'aquilaColourSettings', 'aquila_text_colour' );
Expand Down
14 changes: 14 additions & 0 deletions admin/options/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ function aquila_colour_picker( $optionGroup, $optionName ) {
case 'aquila_background_colour':
$colour = '#f5f5f5';
break;
case 'aquila_link_text_colour':
$colour = '#212121';
break;
case 'aquila_text_colour':
$colour = '#23282d';
break;
Expand Down Expand Up @@ -77,4 +80,15 @@ function aquila_help_box( $url, $title, $subtitle ) {
';
}

// Check checkbox values
function aquila_isset( $var ) {
$aquilaOptions = get_option( 'aquila_settings' );
if(isset($aquilaOptions[$var]) && $aquilaOptions[$var] == 1) {
return true;
} else {
return false;
}
}


?>
1 change: 1 addition & 0 deletions admin/options/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
include('callbacks.php');
include('createOptionsPage.php');
include('help.php');
include('setVariables.php');

?>
30 changes: 26 additions & 4 deletions admin/options/registerSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ function aquila_settings_init( ) {
'aquilaAdminbarCallback',
'aquilaGeneralSettings'
);
add_settings_section(
'aquila_loginSettings_section',
__( 'Login page', 'aquila-admin-theme' ),
'aquilaLoginCallback',
'aquilaGeneralSettings'
);
add_settings_section(
'aquila_logoSettings_section',
__( 'Custom Logo', 'aquila-admin-theme' ),
Expand All @@ -62,7 +68,7 @@ function aquila_settings_init( ) {
);

// Add settings fields
/// Dashboard settings
// Dashboard settings
add_settings_field(
'aquila_chk_pluginSupport',
__( 'Show Editors <strong>Plugins Support</strong> metabox?', 'aquila-admin-theme' ),
Expand Down Expand Up @@ -99,7 +105,7 @@ function aquila_settings_init( ) {
'aquila_dashboardSettings_section'
);

/// Admin bar
// Admin bar
add_settings_field(
'aquila_chk_abLinks',
__( 'Show <strong>Adminbar</strong> links?', 'aquila-admin-theme' ),
Expand All @@ -115,7 +121,16 @@ function aquila_settings_init( ) {
'aquila_adminbarSettings_section'
);

/// Custom Logo
// Admin bar
add_settings_field(
'aquila_chk_loginDisable',
__( '<strong>Disable</strong> Aquila login page styling?', 'aquila-admin-theme' ),
'aquila_chk_loginDisable_render',
'aquilaGeneralSettings',
'aquila_loginSettings_section'
);

// Custom Logo
add_settings_field(
'aquila_new_logo',
__( 'Custom logo', 'aquila-admin-theme' ),
Expand All @@ -131,7 +146,7 @@ function aquila_settings_init( ) {
'aquila_logoSettings_section'
);

/// Colour Scheme
// Colour Scheme
add_settings_field(
'aquila_primary_colour',
__( 'Primary Color', 'aquila-admin-theme' ),
Expand All @@ -146,6 +161,13 @@ function aquila_settings_init( ) {
'aquilaColourSettings',
'aquila_colourSettings_section'
);
add_settings_field(
'aquila_link_text_colour',
__( 'Link Text Color', 'aquila-admin-theme' ),
'aquila_link_text_colour_render',
'aquilaColourSettings',
'aquila_colourSettings_section'
);
/*
add_settings_field(
'aquila_text_colour',
Expand Down
69 changes: 69 additions & 0 deletions admin/options/setVariables.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php if ( __FILE__ == $_SERVER['SCRIPT_FILENAME'] ) { exit; }
$aquilaOptions = get_option( 'aquila_settings' );

if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}

$aquilaShowPluginSupport = $aquilaHideDashboardMetaboxes = $aquilaNoPostToBlog = $aquilaHideFooter = $aquilaShowNag = $aquilaShowAdminbarLinks = $aquilaShowFullAdminbar = $aquilaCustomLogo = $aquilaCustomLogoSquare = $aquilaColourPrimary = $aquilaColourSecondary = $aquilaColourMenuBackground = $aquilaColourMenuText = $aquilaLoginDisable = false;

$aquilaDetails = get_plugins()['aquila-admin-theme/aquila-admin-theme.php'];
$aquilaVer = $aquilaDetails['Version'];

// Checkboxes
if ( aquila_isset('aquila_chk_pluginSupport') ) {
$aquilaShowPluginSupport = true;
}

if ( aquila_isset('aquila_chk_dashBoxes') ) {
$aquilaHideDashboardMetaboxes = true;
}

if ( aquila_isset('aquila_chk_postBlog') ) {
$aquilaNoPostToBlog = true;
}

if ( aquila_isset('aquila_chk_hideFooter') ) {
$aquilaHideFooter = true;
}

if ( aquila_isset('aquila_chk_showNag') ) {
$aquilaShowNag = true;
}

if ( aquila_isset('aquila_chk_abLinks') ) {
$aquilaShowAdminbarLinks = true;
}

if ( aquila_isset('aquila_chk_abVisible') ) {
$aquilaShowFullAdminbar = true;
}
/*
if ( aquila_isset('aquila_new_logo') ) {
$aquilaCustomLogo = true;
}
if ( aquila_isset('aquila_new_logo_sqr') ) {
$aquilaCustomLogoSquare = true;
}
if ( aquila_isset('aquila_primary_colour') ) {
$aquilaColourPrimary = true;
}
if ( aquila_isset('aquila_secondary_colour') ) {
$aquilaColourSecondary = true;
}
if ( aquila_isset('aquila_menu_back_colour') ) {
$aquilaColourMenuBackground = true;
}
if ( aquila_isset('aquila_menu_text_colour') ) {
$aquilaColourMenuText = true;
}
*/
if ( aquila_isset('aquila_chk_loginDisable') ) {
$aquilaLoginDisable = true;
}



?>
1 change: 1 addition & 0 deletions admin/widgets/pluginWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function aquila_plugin_widget() {

add_action( 'wp_dashboard_setup', 'aquila_plugin_widget' );
function aquila_plugin_widget_function() {
$visibleText = '';
echo "<p class='about-description'>";

$aquilaOptions = get_option( 'aquila_settings' );
Expand Down
2 changes: 1 addition & 1 deletion admin/widgets/welcomeWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function aquila_welcome_widget_function() {
<ul>
<li><i class='aquila-wordpress'></i><strong>" . __( 'WordPress', 'aquila-admin-theme' ) . "</strong><br/>" . $wordpressVer . "</li>
<li><i class='aquila-aquila'></i><strong>" . __( 'Aquila', 'aquila-admin-theme' ) . "</strong><br/>" . $aquilaVer . "</li>
<li><i class='aquila-palette'></i><strong>" . $themeInfo->get( 'Name' ) . "</strong><br/>" . $themeInfo->get( 'Version' ) . "</li>
<li><i class='aquila-palette'></i><strong>Theme</strong><br/>" . $themeInfo->get( 'Name' ) . " (" . $themeInfo->get( 'Version' ) . ")</li>
<li><i class='aquila-terminal'></i><strong>" . __( 'Server IP', 'aquila-admin-theme' ) . "</strong><br/>" . $server_ip_address . "</li>
<li><i class='aquila-php'></i><strong>" . __( 'PHP', 'aquila-admin-theme' ) . "</strong><br/>" . $phpVersion . "</li>
<li><i class='aquila-cubes'></i><strong>" . __( 'Memory Usage', 'aquila-admin-theme' ) . "</strong><br/>" . $memUsage . " / " . $memLimit . "MB (" . $memPercent . "%)</li>
Expand Down
Loading

0 comments on commit 7368600

Please sign in to comment.