Version Description
- Fixed issues
Download this release
Release Info
Developer | argonius |
Plugin | Absolutely Glamorous Custom Admin |
Version | 1.4.5 |
Comparing to | |
See all releases |
Code changes from version 1.4.4 to 1.4.5
- plugin.php +33 -22
- readme.txt +7 -1
- require/dynamic.php +95 -0
- script/agca_tmpl.js +1 -2
plugin.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: AG Custom Admin
|
|
4 |
Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
|
5 |
Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
|
6 |
Author: Argonius
|
7 |
-
Version: 1.4.
|
8 |
Author URI: http://www.argonius.com/
|
9 |
|
10 |
Copyright 2014. Argonius (email : info@argonius.com)
|
@@ -56,7 +56,7 @@ class AGCA{
|
|
56 |
/*Initialize properties*/
|
57 |
$this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
|
58 |
|
59 |
-
$this->agca_version = "1.4.
|
60 |
|
61 |
/*upload images programmaticaly*/
|
62 |
//TODO upload with AJAX one by one, use post data to send urls one by one
|
@@ -112,11 +112,15 @@ class AGCA{
|
|
112 |
//print_r($_POST);
|
113 |
$data = $_POST['templates_data'];
|
114 |
$parts = explode("|||",$data);
|
|
|
115 |
$common_data = $parts [0];
|
116 |
-
$
|
117 |
-
$
|
118 |
-
$
|
119 |
-
$
|
|
|
|
|
|
|
120 |
$template_name = $_POST['templates_name'];
|
121 |
|
122 |
update_option('agca_selected_template', $template_name);
|
@@ -128,8 +132,12 @@ class AGCA{
|
|
128 |
|
129 |
$templates[$template_name] = array(
|
130 |
'common'=>$common_data,
|
131 |
-
'admin'
|
132 |
-
'
|
|
|
|
|
|
|
|
|
133 |
'images'=>$images,
|
134 |
'settings'=>$settings
|
135 |
);
|
@@ -291,7 +299,9 @@ class AGCA{
|
|
291 |
</script>
|
292 |
<link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/ag_style.css?ver=<?php echo $this->agca_version; ?>" />
|
293 |
<link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/agca.css" />
|
|
|
294 |
<script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
|
|
|
295 |
<?php
|
296 |
echo $this->templateCustomizations;
|
297 |
|
@@ -1187,29 +1197,30 @@ class AGCA{
|
|
1187 |
function prepareAGCAAdminTemplates(){
|
1188 |
if(get_option( 'agca_templates' ) != ""){
|
1189 |
//print_r(get_option( 'agca_templates' ));
|
1190 |
-
$
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
|
|
|
|
1198 |
//print_r($templdata);
|
1199 |
|
1200 |
-
$this->JSPrintAGCATemplateSettingsVar($
|
1201 |
|
1202 |
-
$admindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($
|
1203 |
$admindata = $this->enableSpecificWPVersionCustomizations($admindata);
|
1204 |
$admindata = $this->removeCSSComments($admindata);
|
1205 |
|
1206 |
//echo $admindata;
|
1207 |
//REPLACE TAGS WITH CUSTOM TEMPLATE SETTINGS
|
1208 |
$this->templateCustomizations = $admindata;
|
1209 |
-
}
|
1210 |
-
break;
|
1211 |
}
|
1212 |
-
|
|
|
1213 |
}
|
1214 |
}
|
1215 |
|
@@ -1260,7 +1271,7 @@ class AGCA{
|
|
1260 |
if($templname == get_option('agca_selected_template')){
|
1261 |
echo (stripslashes($templdata['common']));
|
1262 |
|
1263 |
-
if($templdata['settings'] == "") $templdata['settings'] = "{}";
|
1264 |
$this->JSPrintAGCATemplateSettingsVar($templdata['settings']);
|
1265 |
|
1266 |
$logindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($templdata['login']), $templdata['settings']);
|
4 |
Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
|
5 |
Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
|
6 |
Author: Argonius
|
7 |
+
Version: 1.4.5
|
8 |
Author URI: http://www.argonius.com/
|
9 |
|
10 |
Copyright 2014. Argonius (email : info@argonius.com)
|
56 |
/*Initialize properties*/
|
57 |
$this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
|
58 |
|
59 |
+
$this->agca_version = "1.4.5";
|
60 |
|
61 |
/*upload images programmaticaly*/
|
62 |
//TODO upload with AJAX one by one, use post data to send urls one by one
|
112 |
//print_r($_POST);
|
113 |
$data = $_POST['templates_data'];
|
114 |
$parts = explode("|||",$data);
|
115 |
+
|
116 |
$common_data = $parts [0];
|
117 |
+
$admin_js = $parts [1];
|
118 |
+
$admin_css = $parts [2];
|
119 |
+
$login_js = $parts [3];
|
120 |
+
$login_css = $parts [4];
|
121 |
+
$settings = $parts [5];
|
122 |
+
$images = $parts [6];
|
123 |
+
|
124 |
$template_name = $_POST['templates_name'];
|
125 |
|
126 |
update_option('agca_selected_template', $template_name);
|
132 |
|
133 |
$templates[$template_name] = array(
|
134 |
'common'=>$common_data,
|
135 |
+
'admin'=>"",
|
136 |
+
'adminjs'=>$admin_js,
|
137 |
+
'admincss'=>$admin_css,
|
138 |
+
'login'=>"",
|
139 |
+
'loginjs'=>$login_js,
|
140 |
+
'logincss'=>$login_css,
|
141 |
'images'=>$images,
|
142 |
'settings'=>$settings
|
143 |
);
|
299 |
</script>
|
300 |
<link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/ag_style.css?ver=<?php echo $this->agca_version; ?>" />
|
301 |
<link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/agca.css" />
|
302 |
+
<link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>require/dynamic.php?type=css&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>" />
|
303 |
<script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
|
304 |
+
<script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>require/dynamic.php?type=js&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>"></script>
|
305 |
<?php
|
306 |
echo $this->templateCustomizations;
|
307 |
|
1197 |
function prepareAGCAAdminTemplates(){
|
1198 |
if(get_option( 'agca_templates' ) != ""){
|
1199 |
//print_r(get_option( 'agca_templates' ));
|
1200 |
+
$themes = get_option( 'agca_templates' );
|
1201 |
+
$selectedTheme = get_option('agca_selected_template');
|
1202 |
+
if(isset($themes[$selectedTheme])){
|
1203 |
+
$theme = $themes[$selectedTheme];
|
1204 |
+
echo (stripslashes($theme['common']));
|
1205 |
+
echo "<!--AGCAIMAGES: ".$theme['images']."-->";
|
1206 |
+
|
1207 |
+
//KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
|
1208 |
+
if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
|
1209 |
+
if($theme['settings'] == "" || $theme['settings'] == " ") $theme['settings'] = "{}";
|
1210 |
//print_r($templdata);
|
1211 |
|
1212 |
+
$this->JSPrintAGCATemplateSettingsVar($theme['settings']);
|
1213 |
|
1214 |
+
$admindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($theme['admin']), $theme['settings']);
|
1215 |
$admindata = $this->enableSpecificWPVersionCustomizations($admindata);
|
1216 |
$admindata = $this->removeCSSComments($admindata);
|
1217 |
|
1218 |
//echo $admindata;
|
1219 |
//REPLACE TAGS WITH CUSTOM TEMPLATE SETTINGS
|
1220 |
$this->templateCustomizations = $admindata;
|
|
|
|
|
1221 |
}
|
1222 |
+
//KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
|
1223 |
+
}
|
1224 |
}
|
1225 |
}
|
1226 |
|
1271 |
if($templname == get_option('agca_selected_template')){
|
1272 |
echo (stripslashes($templdata['common']));
|
1273 |
|
1274 |
+
if($templdata['settings'] == "" || $templdata['settings'] == " ") $templdata['settings'] = "{}";
|
1275 |
$this->JSPrintAGCATemplateSettingsVar($templdata['settings']);
|
1276 |
|
1277 |
$logindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($templdata['login']), $templdata['settings']);
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wordpressadminpanel.com/ag-custom-admin/
|
|
4 |
Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.1
|
7 |
-
Stable tag: 1.4.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -154,6 +154,9 @@ Plugin should be always up-to-date with latest WordPress release. If you have fo
|
|
154 |
|
155 |
== Changelog ==
|
156 |
|
|
|
|
|
|
|
157 |
= 1.4.4 =
|
158 |
* Admin themes, caching support
|
159 |
|
@@ -413,6 +416,9 @@ Plugin should be always up-to-date with latest WordPress release. If you have fo
|
|
413 |
|
414 |
== Upgrade Notice ==
|
415 |
|
|
|
|
|
|
|
416 |
= 1.4.4 =
|
417 |
* Admin themes, caching support
|
418 |
|
4 |
Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.1
|
7 |
+
Stable tag: 1.4.5
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
154 |
|
155 |
== Changelog ==
|
156 |
|
157 |
+
= 1.4.5 =
|
158 |
+
* Fixed issues
|
159 |
+
|
160 |
= 1.4.4 =
|
161 |
* Admin themes, caching support
|
162 |
|
416 |
|
417 |
== Upgrade Notice ==
|
418 |
|
419 |
+
= 1.4.5 =
|
420 |
+
* Fixed issues
|
421 |
+
|
422 |
= 1.4.4 =
|
423 |
* Admin themes, caching support
|
424 |
|
require/dynamic.php
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require '../../../../wp-load.php';
|
3 |
+
|
4 |
+
$themes = get_option('agca_templates');
|
5 |
+
$selectedTheme = get_option('agca_selected_template');
|
6 |
+
$type = "";
|
7 |
+
$optionName = "";
|
8 |
+
$agcaContext = "";
|
9 |
+
|
10 |
+
if(isset($_GET["type"])){
|
11 |
+
$type = $_GET["type"];
|
12 |
+
}
|
13 |
+
if(isset($_GET["context"])){
|
14 |
+
$agcaContext = $_GET["context"];
|
15 |
+
}
|
16 |
+
|
17 |
+
if ( $agcaContext != "login" && !is_user_logged_in()) {
|
18 |
+
die();
|
19 |
+
}
|
20 |
+
|
21 |
+
if($type == "css"){
|
22 |
+
header('Content-type: text/css');
|
23 |
+
$optionName = ($agcaContext == "login")? "logincss":"admincss";
|
24 |
+
|
25 |
+
}else if($type == "js"){
|
26 |
+
header('Content-type: application/javascript');
|
27 |
+
$optionName = ($agcaContext == "login")? "loginjs":"adminjs";
|
28 |
+
}
|
29 |
+
if($type == "css" || $type == "js"){
|
30 |
+
if(isset($themes[$selectedTheme])){
|
31 |
+
$theme = $themes[$selectedTheme];
|
32 |
+
$admin_capability = get_option('agca_admin_capability');
|
33 |
+
if($admin_capability == ""){
|
34 |
+
$admin_capability = "edit_dashboard";
|
35 |
+
}
|
36 |
+
if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($admin_capability )))){
|
37 |
+
$adminscript = stripslashes($theme[$optionName]);
|
38 |
+
$settings = $theme['settings'];
|
39 |
+
if($settings == "" || $settings == " ") $settings = "{}";
|
40 |
+
$adminscript = agcaAppendSettingsToAGCATemplateCustomizations(stripslashes($adminscript), $settings);
|
41 |
+
$admindata = agcaEnableSpecificWPVersionCustomizations($admindata);
|
42 |
+
$admindata = agcaRemoveCSSComments($admindata);
|
43 |
+
|
44 |
+
echo $adminscript;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
//print_r($themes); print_r($selectedTheme); die;
|
50 |
+
die;
|
51 |
+
|
52 |
+
|
53 |
+
function agcaEnableSpecificWPVersionCustomizations($customizations){
|
54 |
+
/*enable special CSS for this WP version*/
|
55 |
+
$ver = agcat_get_wp_version();
|
56 |
+
$customizations = str_replace("/*".$ver," ", $customizations);
|
57 |
+
$customizations = str_replace($ver."*/"," ", $customizations);
|
58 |
+
return $customizations;
|
59 |
+
}
|
60 |
+
function agcat_get_wp_version(){
|
61 |
+
global $wp_version;
|
62 |
+
$array = explode('-', $wp_version);
|
63 |
+
$version = $array[0];
|
64 |
+
return $version;
|
65 |
+
}
|
66 |
+
function agcaAppendSettingsToAGCATemplateCustomizations($customizations, $settings){
|
67 |
+
$template_settings = json_decode($settings);
|
68 |
+
//print_r($template_settings);
|
69 |
+
foreach($template_settings as $sett){
|
70 |
+
$key = $sett->code;
|
71 |
+
|
72 |
+
//use default value if user's value is not set
|
73 |
+
$value="";
|
74 |
+
if($sett->value != ""){
|
75 |
+
$value = $sett->value;
|
76 |
+
}else{
|
77 |
+
$value = $sett->default_value;
|
78 |
+
}
|
79 |
+
|
80 |
+
//Prepare settings
|
81 |
+
if($sett->type == 6){
|
82 |
+
if($value !== null && (strtolower($value) == "on" || $value == "1")){
|
83 |
+
$value = "true";
|
84 |
+
}else{
|
85 |
+
$value = "false";
|
86 |
+
}
|
87 |
+
}
|
88 |
+
$customizations = str_replace("%".$key."%",$value, $customizations);
|
89 |
+
}
|
90 |
+
return $customizations;
|
91 |
+
}
|
92 |
+
function agcaRemoveCSSComments($customizations){
|
93 |
+
$customizations = preg_replace('#/\*.*?\*/#si','',$customizations);
|
94 |
+
return $customizations;
|
95 |
+
}
|
script/agca_tmpl.js
CHANGED
@@ -677,8 +677,7 @@ function agcaTemplatesSessionAdd(template, license, callback){
|
|
677 |
"license":license
|
678 |
},
|
679 |
success: callback
|
680 |
-
});
|
681 |
-
//agcaTemplatesSession
|
682 |
}
|
683 |
|
684 |
function agcaTemplatesSessionRemove(template, callback){
|
677 |
"license":license
|
678 |
},
|
679 |
success: callback
|
680 |
+
});
|
|
|
681 |
}
|
682 |
|
683 |
function agcaTemplatesSessionRemove(template, callback){
|