Version Description
- Refactored backend UI implementation
- Integrated Utilities extension to the core
- Improved capability management functionality
- Improved UI
- Added caching mechanism to the core
- Improved caching mechanism
- Fixed few functional bugs
Download this release
Release Info
Developer | vasyl_m |
Plugin | Advanced Access Manager |
Version | 3.4 |
Comparing to | |
See all releases |
Code changes from version 3.3 to 3.4
- Application/Backend/Feature.php +1 -1
- Application/Backend/Feature/Abstract.php +86 -0
- Application/Backend/{Capability.php → Feature/Capability.php} +114 -28
- Application/Backend/{Contact.php → Feature/Contact.php} +9 -31
- Application/Backend/{Extension.php → Feature/Extension.php} +8 -30
- Application/Backend/{Menu.php → Feature/Menu.php} +20 -44
- Application/Backend/{Metabox.php → Feature/Metabox.php} +17 -40
- Application/Backend/{Post.php → Feature/Post.php} +26 -48
- Application/Backend/{ProductList.php → Feature/ProductList.php} +19 -20
- Application/Backend/{Role.php → Feature/Role.php} +2 -2
- Application/Backend/{User.php → Feature/User.php} +2 -2
- Application/Backend/Feature/Utility.php +106 -0
- Application/Backend/Filter.php +4 -3
- Application/Backend/Manager.php +18 -64
- Application/Backend/View.php +11 -36
- Application/Backend/{Helper.php → View/Helper.php} +2 -2
- Application/Backend/{Localization.php → View/Localization.php} +1 -1
- Application/Backend/{view → phtml}/contact.phtml +2 -2
- Application/Backend/{view → phtml}/extension.phtml +14 -14
- Application/Backend/{view → phtml}/index.phtml +37 -71
- Application/Backend/{view → phtml}/main-panel.phtml +0 -0
- Application/Backend/phtml/object/capability.phtml +104 -0
- Application/Backend/{view → phtml}/object/menu.phtml +4 -3
- Application/Backend/{view → phtml}/object/metabox.phtml +9 -4
- Application/Backend/{view → phtml}/object/post.phtml +5 -52
- Application/Backend/phtml/partial/post-type.phtml +12 -0
- Application/Backend/phtml/partial/term-type.phtml +12 -0
- Application/Backend/phtml/utility.phtml +69 -0
- Application/Backend/view/object/capability.phtml +0 -60
- Application/Backend/view/partial/post-type.phtml +0 -12
- Application/Backend/view/partial/term-type.phtml +0 -12
- Application/Core/API.php +2 -2
- Application/Core/Cache.php +128 -0
- Application/Core/Config.php +115 -0
- Application/Core/ConfigPress.php +0 -64
- Application/Core/Object/Post.php +5 -11
- Application/Core/Repository.php +31 -2
- Application/Core/Server.php +1 -3
- Application/Core/Subject.php +1 -1
- Application/Core/Subject/User.php +5 -5
- Application/Frontend/Manager.php +1 -1
- Lang/advanced-access-manager-en_US.mo +0 -0
- Lang/advanced-access-manager-en_US.po +1 -1
- aam.php +11 -3
- media/active-menu.png +0 -0
- media/active-menu.svg +22 -0
- media/css/aam.css +55 -11
- media/font/fontello.eot +0 -0
- media/font/fontello.svg +2 -0
- media/font/fontello.ttf +0 -0
- media/font/fontello.woff +0 -0
- media/font/fontello.woff2 +0 -0
- media/js/aam-hook.js +0 -16
- media/js/aam-ui.js +176 -24
- media/js/aam.js +2 -32
- media/js/toggle.min.js +9 -0
- readme.txt +24 -1
Application/Backend/Feature.php
CHANGED
@@ -33,7 +33,7 @@ class AAM_Backend_Feature {
|
|
33 |
$response = false;
|
34 |
|
35 |
if (empty($feature->capability)){
|
36 |
-
$cap =
|
37 |
} else {
|
38 |
$cap = $feature->capability;
|
39 |
}
|
33 |
$response = false;
|
34 |
|
35 |
if (empty($feature->capability)){
|
36 |
+
$cap = AAM_Core_Config::get('page.capability', 'administrator');
|
37 |
} else {
|
38 |
$cap = $feature->capability;
|
39 |
}
|
Application/Backend/Feature/Abstract.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ======================================================================
|
5 |
+
* LICENSE: This file is subject to the terms and conditions defined in *
|
6 |
+
* file 'license.txt', which is part of this source code package. *
|
7 |
+
* ======================================================================
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Backend feature abstract
|
12 |
+
*
|
13 |
+
* @package AAM
|
14 |
+
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
+
*/
|
16 |
+
abstract class AAM_Backend_Feature_Abstract {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Constructor
|
20 |
+
*
|
21 |
+
* @return void
|
22 |
+
*
|
23 |
+
* @access public
|
24 |
+
* @throws Exception
|
25 |
+
*/
|
26 |
+
public function __construct() {
|
27 |
+
$cap = AAM_Core_Config::get($this->getAccessOption(), 'administrator');
|
28 |
+
if (!AAM::getUser()->hasCapability($cap)) {
|
29 |
+
Throw new Exception(__('Accedd Denied', AAM_KEY));
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Get HTML content
|
35 |
+
*
|
36 |
+
* @return string
|
37 |
+
*
|
38 |
+
* @access public
|
39 |
+
*/
|
40 |
+
public function getContent() {
|
41 |
+
ob_start();
|
42 |
+
require_once(dirname(__FILE__) . '/../phtml/' . $this->getTemplate());
|
43 |
+
$content = ob_get_contents();
|
44 |
+
ob_end_clean();
|
45 |
+
|
46 |
+
return $content;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Get access option
|
51 |
+
*
|
52 |
+
* This function exists only to support implementation for PHP 5.2 cause later
|
53 |
+
* static binding has been introduced only in PHP 5.3.0
|
54 |
+
*
|
55 |
+
* @return string
|
56 |
+
*
|
57 |
+
* @access public
|
58 |
+
*/
|
59 |
+
public static function getAccessOption() {
|
60 |
+
return '';
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Get template filename
|
65 |
+
*
|
66 |
+
* This function exists only to support implementation for PHP 5.2 cause later
|
67 |
+
* static binding has been introduced only in PHP 5.3.0
|
68 |
+
*
|
69 |
+
* @return string
|
70 |
+
*
|
71 |
+
* @access public
|
72 |
+
*/
|
73 |
+
public static function getTemplate() {
|
74 |
+
return '';
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Register feature
|
79 |
+
*
|
80 |
+
* @return void
|
81 |
+
*
|
82 |
+
* @access public
|
83 |
+
*/
|
84 |
+
public static function register() { }
|
85 |
+
|
86 |
+
}
|
Application/Backend/{Capability.php → Feature/Capability.php}
RENAMED
@@ -13,13 +13,8 @@
|
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
-
class
|
17 |
|
18 |
-
/**
|
19 |
-
*
|
20 |
-
*/
|
21 |
-
const CAPABILITY_OPTION = 'aam.feature.capability.capability';
|
22 |
-
|
23 |
/**
|
24 |
* Capability groups
|
25 |
*
|
@@ -53,22 +48,6 @@ class AAM_Backend_Capability {
|
|
53 |
)
|
54 |
);
|
55 |
|
56 |
-
/**
|
57 |
-
* Get HTML content
|
58 |
-
*
|
59 |
-
* @return string
|
60 |
-
*
|
61 |
-
* @access public
|
62 |
-
*/
|
63 |
-
public function getContent() {
|
64 |
-
ob_start();
|
65 |
-
require_once(dirname(__FILE__) . '/view/object/capability.phtml');
|
66 |
-
$content = ob_get_contents();
|
67 |
-
ob_end_clean();
|
68 |
-
|
69 |
-
return $content;
|
70 |
-
}
|
71 |
-
|
72 |
/**
|
73 |
*
|
74 |
* @return type
|
@@ -84,7 +63,7 @@ class AAM_Backend_Capability {
|
|
84 |
$response['data'][] = array(
|
85 |
$cap,
|
86 |
$this->getGroup($cap),
|
87 |
-
|
88 |
$this->prepareActionList($cap)
|
89 |
);
|
90 |
}
|
@@ -93,6 +72,85 @@ class AAM_Backend_Capability {
|
|
93 |
return json_encode($response);
|
94 |
}
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
/**
|
97 |
*
|
98 |
* @param AAM_Core_Subject_User $subject
|
@@ -127,11 +185,41 @@ class AAM_Backend_Capability {
|
|
127 |
|
128 |
$actions[] = ($subject->hasCapability($cap) ? 'checked' : 'unchecked');
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
return implode(
|
131 |
',', apply_filters('aam-cap-row-actions-filter', $actions, $subject)
|
132 |
);
|
133 |
}
|
134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
/**
|
136 |
*
|
137 |
* @return type
|
@@ -144,7 +232,7 @@ class AAM_Backend_Capability {
|
|
144 |
$response[] = array(
|
145 |
$cap,
|
146 |
$this->getGroup($cap),
|
147 |
-
|
148 |
$this->prepareActionList($cap)
|
149 |
);
|
150 |
}
|
@@ -222,16 +310,14 @@ class AAM_Backend_Capability {
|
|
222 |
* @access public
|
223 |
*/
|
224 |
public static function register() {
|
225 |
-
$cap =
|
226 |
|
227 |
AAM_Backend_Feature::registerFeature((object) array(
|
228 |
'uid' => 'capability',
|
229 |
'position' => 15,
|
230 |
'title' => __('Capabilities', AAM_KEY),
|
231 |
'capability' => $cap,
|
232 |
-
'subjects' => array(
|
233 |
-
'AAM_Core_Subject_Role', 'AAM_Core_Subject_User'
|
234 |
-
),
|
235 |
'view' => __CLASS__
|
236 |
));
|
237 |
}
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
+
class AAM_Backend_Feature_Capability extends AAM_Backend_Feature_Abstract {
|
17 |
|
|
|
|
|
|
|
|
|
|
|
18 |
/**
|
19 |
* Capability groups
|
20 |
*
|
48 |
)
|
49 |
);
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
/**
|
52 |
*
|
53 |
* @return type
|
63 |
$response['data'][] = array(
|
64 |
$cap,
|
65 |
$this->getGroup($cap),
|
66 |
+
AAM_Backend_View_Helper::getHumanText($cap),
|
67 |
$this->prepareActionList($cap)
|
68 |
);
|
69 |
}
|
72 |
return json_encode($response);
|
73 |
}
|
74 |
|
75 |
+
/**
|
76 |
+
* Update capability tag
|
77 |
+
*
|
78 |
+
* @return string
|
79 |
+
*
|
80 |
+
* @access public
|
81 |
+
*/
|
82 |
+
public function update() {
|
83 |
+
$capability = AAM_Core_Request::post('capability');
|
84 |
+
$updated = AAM_Core_Request::post('updated');
|
85 |
+
$roles = AAM_Core_API::getRoles();
|
86 |
+
|
87 |
+
//first make sure that similar capability does not exist already
|
88 |
+
$allcaps = AAM_Core_API::getAllCapabilities();
|
89 |
+
|
90 |
+
if (!isset($allcaps[$updated])) {
|
91 |
+
foreach($roles->role_objects as $role) {
|
92 |
+
//check if capability is present for current role! Please notice, we
|
93 |
+
//can not use the native WP_Role::has_cap function because it will
|
94 |
+
//return false if capability exists but not checked
|
95 |
+
if (isset($role->capabilities[$capability])) {
|
96 |
+
$role->add_cap($updated, $role->capabilities[$capability]);
|
97 |
+
$role->remove_cap($capability);
|
98 |
+
}
|
99 |
+
}
|
100 |
+
$response = array('status' => 'success');
|
101 |
+
} else {
|
102 |
+
$response = array(
|
103 |
+
'status' => 'failure',
|
104 |
+
'message' => __('Capability already exists', AAM_KEY)
|
105 |
+
);
|
106 |
+
}
|
107 |
+
|
108 |
+
return json_encode($response);
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Delete capability
|
113 |
+
*
|
114 |
+
* This function delete capability in all roles.
|
115 |
+
*
|
116 |
+
* @return string
|
117 |
+
*
|
118 |
+
* @access public
|
119 |
+
*/
|
120 |
+
public function delete() {
|
121 |
+
$capability = AAM_Core_Request::post('capability');
|
122 |
+
$roles = AAM_Core_API::getRoles();
|
123 |
+
$subject = AAM_Backend_View::getSubject();
|
124 |
+
|
125 |
+
if (is_a($subject, 'AAM_Core_Subject_Role')) {
|
126 |
+
foreach($roles->role_objects as $role) {
|
127 |
+
$role->remove_cap($capability);
|
128 |
+
}
|
129 |
+
$response = array('status' => 'success');
|
130 |
+
} else {
|
131 |
+
$response = array(
|
132 |
+
'status' => 'failure',
|
133 |
+
'message' => __('Can not remove the capability', AAM_KEY)
|
134 |
+
);
|
135 |
+
}
|
136 |
+
|
137 |
+
return json_encode($response);
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* @inheritdoc
|
142 |
+
*/
|
143 |
+
public static function getAccessOption() {
|
144 |
+
return 'feature.capability.capability';
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* @inheritdoc
|
149 |
+
*/
|
150 |
+
public static function getTemplate() {
|
151 |
+
return 'object/capability.phtml';
|
152 |
+
}
|
153 |
+
|
154 |
/**
|
155 |
*
|
156 |
* @param AAM_Core_Subject_User $subject
|
185 |
|
186 |
$actions[] = ($subject->hasCapability($cap) ? 'checked' : 'unchecked');
|
187 |
|
188 |
+
//allow to delete or update capability only for roles!
|
189 |
+
if (AAM_Core_Config::get('manage-capability', false)
|
190 |
+
&& is_a($subject, 'AAM_Core_Subject_Role')) {
|
191 |
+
$actions[] = 'edit';
|
192 |
+
$actions[] = 'delete';
|
193 |
+
}
|
194 |
+
|
195 |
return implode(
|
196 |
',', apply_filters('aam-cap-row-actions-filter', $actions, $subject)
|
197 |
);
|
198 |
}
|
199 |
|
200 |
+
/**
|
201 |
+
* Get list of user roles
|
202 |
+
*
|
203 |
+
* @param array $roles
|
204 |
+
*
|
205 |
+
* @return array
|
206 |
+
*
|
207 |
+
* @access protected
|
208 |
+
*/
|
209 |
+
protected function getUserRoles($roles) {
|
210 |
+
$response = array();
|
211 |
+
|
212 |
+
$names = AAM_Core_API::getRoles()->get_names();
|
213 |
+
|
214 |
+
foreach($roles as $role) {
|
215 |
+
if (isset($names[$role])) {
|
216 |
+
$response[] = translate_user_role($names[$role]);
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
return $response;
|
221 |
+
}
|
222 |
+
|
223 |
/**
|
224 |
*
|
225 |
* @return type
|
232 |
$response[] = array(
|
233 |
$cap,
|
234 |
$this->getGroup($cap),
|
235 |
+
$cap,
|
236 |
$this->prepareActionList($cap)
|
237 |
);
|
238 |
}
|
310 |
* @access public
|
311 |
*/
|
312 |
public static function register() {
|
313 |
+
$cap = AAM_Core_Config::get(self::getAccessOption(), 'administrator');
|
314 |
|
315 |
AAM_Backend_Feature::registerFeature((object) array(
|
316 |
'uid' => 'capability',
|
317 |
'position' => 15,
|
318 |
'title' => __('Capabilities', AAM_KEY),
|
319 |
'capability' => $cap,
|
320 |
+
'subjects' => array('AAM_Core_Subject_Role', 'AAM_Core_Subject_User'),
|
|
|
|
|
321 |
'view' => __CLASS__
|
322 |
));
|
323 |
}
|
Application/Backend/{Contact.php → Feature/Contact.php}
RENAMED
@@ -13,42 +13,20 @@
|
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
-
class
|
17 |
|
18 |
/**
|
19 |
-
*
|
20 |
*/
|
21 |
-
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Constructor
|
25 |
-
*
|
26 |
-
* @return void
|
27 |
-
*
|
28 |
-
* @access public
|
29 |
-
* @throws Exception
|
30 |
-
*/
|
31 |
-
public function __construct() {
|
32 |
-
$cap = AAM_Core_ConfigPress::get(self::CAPABILITY_OPTION, 'administrator');
|
33 |
-
if (!AAM::getUser()->hasCapability($cap)) {
|
34 |
-
Throw new Exception(__('Accedd Denied', AAM_KEY));
|
35 |
-
}
|
36 |
}
|
37 |
|
38 |
/**
|
39 |
-
*
|
40 |
-
*
|
41 |
-
* @return string
|
42 |
-
*
|
43 |
-
* @access public
|
44 |
*/
|
45 |
-
public function
|
46 |
-
|
47 |
-
require_once(dirname(__FILE__) . '/view/contact.phtml');
|
48 |
-
$content = ob_get_contents();
|
49 |
-
ob_end_clean();
|
50 |
-
|
51 |
-
return $content;
|
52 |
}
|
53 |
|
54 |
/**
|
@@ -82,11 +60,11 @@ class AAM_Backend_Contact {
|
|
82 |
* @access public
|
83 |
*/
|
84 |
public static function register() {
|
85 |
-
$cap =
|
86 |
|
87 |
AAM_Backend_Feature::registerFeature((object) array(
|
88 |
'uid' => 'contact',
|
89 |
-
'position' =>
|
90 |
'title' => __('Contact Us', AAM_KEY),
|
91 |
'capability' => $cap,
|
92 |
'subjects' => array(
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
+
class AAM_Backend_Feature_Contact extends AAM_Backend_Feature_Abstract {
|
17 |
|
18 |
/**
|
19 |
+
* @inheritdoc
|
20 |
*/
|
21 |
+
public static function getAccessOption() {
|
22 |
+
return 'feature.contact.capability';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
|
25 |
/**
|
26 |
+
* @inheritdoc
|
|
|
|
|
|
|
|
|
27 |
*/
|
28 |
+
public static function getTemplate() {
|
29 |
+
return 'contact.phtml';
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
|
32 |
/**
|
60 |
* @access public
|
61 |
*/
|
62 |
public static function register() {
|
63 |
+
$cap = AAM_Core_Config::get(self::getAccessOption(), 'administrator');
|
64 |
|
65 |
AAM_Backend_Feature::registerFeature((object) array(
|
66 |
'uid' => 'contact',
|
67 |
+
'position' => 9999,
|
68 |
'title' => __('Contact Us', AAM_KEY),
|
69 |
'capability' => $cap,
|
70 |
'subjects' => array(
|
Application/Backend/{Extension.php → Feature/Extension.php}
RENAMED
@@ -13,42 +13,20 @@
|
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
-
class
|
17 |
|
18 |
/**
|
19 |
-
*
|
20 |
*/
|
21 |
-
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Constructor
|
25 |
-
*
|
26 |
-
* @return void
|
27 |
-
*
|
28 |
-
* @access public
|
29 |
-
* @throws Exception
|
30 |
-
*/
|
31 |
-
public function __construct() {
|
32 |
-
$cap = AAM_Core_ConfigPress::get(self::CAPABILITY_OPTION, 'administrator');
|
33 |
-
if (!AAM::getUser()->hasCapability($cap)) {
|
34 |
-
Throw new Exception(__('Accedd Denied', AAM_KEY));
|
35 |
-
}
|
36 |
}
|
37 |
|
38 |
/**
|
39 |
-
*
|
40 |
-
*
|
41 |
-
* @return string
|
42 |
-
*
|
43 |
-
* @access public
|
44 |
*/
|
45 |
-
public function
|
46 |
-
|
47 |
-
require_once(dirname(__FILE__) . '/view/extension.phtml');
|
48 |
-
$content = ob_get_contents();
|
49 |
-
ob_end_clean();
|
50 |
-
|
51 |
-
return $content;
|
52 |
}
|
53 |
|
54 |
/**
|
@@ -187,7 +165,7 @@ class AAM_Backend_Extension {
|
|
187 |
* @access public
|
188 |
*/
|
189 |
public static function register() {
|
190 |
-
$cap =
|
191 |
|
192 |
AAM_Backend_Feature::registerFeature((object) array(
|
193 |
'uid' => 'extension',
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
+
class AAM_Backend_Feature_Extension extends AAM_Backend_Feature_Abstract {
|
17 |
|
18 |
/**
|
19 |
+
* @inheritdoc
|
20 |
*/
|
21 |
+
public static function getAccessOption() {
|
22 |
+
return 'feature.extension.capability';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
|
25 |
/**
|
26 |
+
* @inheritdoc
|
|
|
|
|
|
|
|
|
27 |
*/
|
28 |
+
public static function getTemplate() {
|
29 |
+
return 'extension.phtml';
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
|
32 |
/**
|
165 |
* @access public
|
166 |
*/
|
167 |
public static function register() {
|
168 |
+
$cap = AAM_Core_Config::get(self::getAccessOption(), 'administrator');
|
169 |
|
170 |
AAM_Backend_Feature::registerFeature((object) array(
|
171 |
'uid' => 'extension',
|
Application/Backend/{Menu.php → Feature/Menu.php}
RENAMED
@@ -13,44 +13,8 @@
|
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
-
class
|
17 |
|
18 |
-
/**
|
19 |
-
* ConfigPress settings for feature access
|
20 |
-
*/
|
21 |
-
const CAPABILITY_OPTION = 'aam.feature.admin_menu.capability';
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Constructor
|
25 |
-
*
|
26 |
-
* @return void
|
27 |
-
*
|
28 |
-
* @access public
|
29 |
-
* @throws Exception
|
30 |
-
*/
|
31 |
-
public function __construct() {
|
32 |
-
$cap = AAM_Core_ConfigPress::get(self::CAPABILITY_OPTION, 'administrator');
|
33 |
-
if (!AAM::getUser()->hasCapability($cap)) {
|
34 |
-
Throw new Exception(__('Accedd Denied', AAM_KEY));
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Get HTML content
|
40 |
-
*
|
41 |
-
* @return string
|
42 |
-
*
|
43 |
-
* @access public
|
44 |
-
*/
|
45 |
-
public function getContent() {
|
46 |
-
ob_start();
|
47 |
-
require_once(dirname(__FILE__) . '/view/object/menu.phtml');
|
48 |
-
$content = ob_get_contents();
|
49 |
-
ob_end_clean();
|
50 |
-
|
51 |
-
return $content;
|
52 |
-
}
|
53 |
-
|
54 |
/**
|
55 |
* Reset menu settings
|
56 |
*
|
@@ -87,7 +51,7 @@ class AAM_Backend_Menu {
|
|
87 |
if (preg_match('/^separator/', $item[2])) {
|
88 |
continue; //skip separator
|
89 |
}
|
90 |
-
|
91 |
$submenu = $this->getSubmenu($item[2]);
|
92 |
|
93 |
$allowed = AAM_Backend_View::getSubject()->hasCapability($item[1]);
|
@@ -107,6 +71,20 @@ class AAM_Backend_Menu {
|
|
107 |
|
108 |
return $response;
|
109 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
/**
|
112 |
* Prepare filtered submenu
|
@@ -115,10 +93,10 @@ class AAM_Backend_Menu {
|
|
115 |
*
|
116 |
* @return array
|
117 |
*
|
118 |
-
* @access
|
119 |
* @global array $submenu
|
120 |
*/
|
121 |
-
|
122 |
global $submenu;
|
123 |
|
124 |
$response = array();
|
@@ -203,16 +181,14 @@ class AAM_Backend_Menu {
|
|
203 |
* @access public
|
204 |
*/
|
205 |
public static function register() {
|
206 |
-
$cap =
|
207 |
|
208 |
AAM_Backend_Feature::registerFeature((object) array(
|
209 |
'uid' => 'admin_menu',
|
210 |
'position' => 5,
|
211 |
'title' => __('Backend Menu', AAM_KEY),
|
212 |
'capability' => $cap,
|
213 |
-
'subjects' => array(
|
214 |
-
'AAM_Core_Subject_Role', 'AAM_Core_Subject_User'
|
215 |
-
),
|
216 |
'view' => __CLASS__
|
217 |
));
|
218 |
}
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
+
class AAM_Backend_Feature_Menu extends AAM_Backend_Feature_Abstract {
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
/**
|
19 |
* Reset menu settings
|
20 |
*
|
51 |
if (preg_match('/^separator/', $item[2])) {
|
52 |
continue; //skip separator
|
53 |
}
|
54 |
+
|
55 |
$submenu = $this->getSubmenu($item[2]);
|
56 |
|
57 |
$allowed = AAM_Backend_View::getSubject()->hasCapability($item[1]);
|
71 |
|
72 |
return $response;
|
73 |
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* @inheritdoc
|
77 |
+
*/
|
78 |
+
public static function getAccessOption() {
|
79 |
+
return 'feature.admin_menu.capability';
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* @inheritdoc
|
84 |
+
*/
|
85 |
+
public static function getTemplate() {
|
86 |
+
return 'object/menu.phtml';
|
87 |
+
}
|
88 |
|
89 |
/**
|
90 |
* Prepare filtered submenu
|
93 |
*
|
94 |
* @return array
|
95 |
*
|
96 |
+
* @access protected
|
97 |
* @global array $submenu
|
98 |
*/
|
99 |
+
protected function getSubmenu($menu) {
|
100 |
global $submenu;
|
101 |
|
102 |
$response = array();
|
181 |
* @access public
|
182 |
*/
|
183 |
public static function register() {
|
184 |
+
$cap = AAM_Core_Config::get(self::getAccessOption(), 'administrator');
|
185 |
|
186 |
AAM_Backend_Feature::registerFeature((object) array(
|
187 |
'uid' => 'admin_menu',
|
188 |
'position' => 5,
|
189 |
'title' => __('Backend Menu', AAM_KEY),
|
190 |
'capability' => $cap,
|
191 |
+
'subjects' => array('AAM_Core_Subject_Role', 'AAM_Core_Subject_User'),
|
|
|
|
|
192 |
'view' => __CLASS__
|
193 |
));
|
194 |
}
|
Application/Backend/{Metabox.php → Feature/Metabox.php}
RENAMED
@@ -13,56 +13,32 @@
|
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
-
class
|
17 |
|
18 |
/**
|
19 |
-
* ConfigPress settings for feature access
|
20 |
-
*/
|
21 |
-
const CAPABILITY_OPTION = 'aam.feature.metabox.capability';
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Constructor
|
25 |
*
|
26 |
-
* @return
|
27 |
-
*
|
28 |
-
* @access public
|
29 |
-
* @throws Exception
|
30 |
*/
|
31 |
-
public function
|
32 |
-
$
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
36 |
}
|
37 |
|
38 |
/**
|
39 |
-
*
|
40 |
-
*
|
41 |
-
* @return string
|
42 |
-
*
|
43 |
-
* @access public
|
44 |
*/
|
45 |
-
public function
|
46 |
-
|
47 |
-
|
48 |
-
ob_start();
|
49 |
-
require_once(dirname(__FILE__) . '/view/object/metabox.phtml');
|
50 |
-
$content = ob_get_contents();
|
51 |
-
ob_end_clean();
|
52 |
-
|
53 |
-
return $content;
|
54 |
}
|
55 |
|
56 |
/**
|
57 |
-
*
|
58 |
-
* @return type
|
59 |
*/
|
60 |
-
public function
|
61 |
-
|
62 |
-
|
63 |
-
return json_encode(array(
|
64 |
-
'status' => ($object->reset() ? 'success' : 'failure')
|
65 |
-
));
|
66 |
}
|
67 |
|
68 |
/**
|
@@ -89,6 +65,7 @@ class AAM_Backend_Metabox {
|
|
89 |
admin_url('post-new.php?post_type=' . $type)
|
90 |
);
|
91 |
}
|
|
|
92 |
//grab metaboxes
|
93 |
AAM_Core_API::cURL($url);
|
94 |
}
|
@@ -196,7 +173,7 @@ class AAM_Backend_Metabox {
|
|
196 |
* @return type
|
197 |
*/
|
198 |
public function getMetaboxList() {
|
199 |
-
$cache
|
200 |
$subject = AAM_Backend_View::getSubject();
|
201 |
|
202 |
//if visitor, return only frontend widgets
|
@@ -231,7 +208,7 @@ class AAM_Backend_Metabox {
|
|
231 |
* @access public
|
232 |
*/
|
233 |
public static function register() {
|
234 |
-
$cap =
|
235 |
|
236 |
AAM_Backend_Feature::registerFeature((object) array(
|
237 |
'uid' => 'metabox',
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
+
class AAM_Backend_Feature_Metabox extends AAM_Backend_Feature_Abstract {
|
17 |
|
18 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
*
|
20 |
+
* @return type
|
|
|
|
|
|
|
21 |
*/
|
22 |
+
public function reset() {
|
23 |
+
$object = AAM_Backend_View::getSubject()->getObject('metabox');
|
24 |
+
|
25 |
+
return json_encode(array(
|
26 |
+
'status' => ($object->reset() ? 'success' : 'failure')
|
27 |
+
));
|
28 |
}
|
29 |
|
30 |
/**
|
31 |
+
* @inheritdoc
|
|
|
|
|
|
|
|
|
32 |
*/
|
33 |
+
public static function getAccessOption() {
|
34 |
+
return 'feature.metabox.capability';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
|
37 |
/**
|
38 |
+
* @inheritdoc
|
|
|
39 |
*/
|
40 |
+
public static function getTemplate() {
|
41 |
+
return 'object/metabox.phtml';
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
/**
|
65 |
admin_url('post-new.php?post_type=' . $type)
|
66 |
);
|
67 |
}
|
68 |
+
|
69 |
//grab metaboxes
|
70 |
AAM_Core_API::cURL($url);
|
71 |
}
|
173 |
* @return type
|
174 |
*/
|
175 |
public function getMetaboxList() {
|
176 |
+
$cache = AAM_Core_API::getOption('aam_metabox_cache', array());
|
177 |
$subject = AAM_Backend_View::getSubject();
|
178 |
|
179 |
//if visitor, return only frontend widgets
|
208 |
* @access public
|
209 |
*/
|
210 |
public static function register() {
|
211 |
+
$cap = AAM_Core_Config::get(self::getAccessOption(), 'administrator');
|
212 |
|
213 |
AAM_Backend_Feature::registerFeature((object) array(
|
214 |
'uid' => 'metabox',
|
Application/Backend/{Post.php → Feature/Post.php}
RENAMED
@@ -13,44 +13,8 @@
|
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
-
class
|
17 |
|
18 |
-
/**
|
19 |
-
* ConfigPress settings for feature access
|
20 |
-
*/
|
21 |
-
const CAPABILITY_OPTION = 'aam.feature.post.capability';
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Constructor
|
25 |
-
*
|
26 |
-
* @return void
|
27 |
-
*
|
28 |
-
* @access public
|
29 |
-
* @throws Exception
|
30 |
-
*/
|
31 |
-
public function __construct() {
|
32 |
-
$cap = AAM_Core_ConfigPress::get(self::CAPABILITY_OPTION, 'administrator');
|
33 |
-
if (!AAM::getUser()->hasCapability($cap)) {
|
34 |
-
Throw new Exception(__('Accedd Denied', AAM_KEY));
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Get HTML content
|
40 |
-
*
|
41 |
-
* @return string
|
42 |
-
*
|
43 |
-
* @access public
|
44 |
-
*/
|
45 |
-
public function getContent() {
|
46 |
-
ob_start();
|
47 |
-
require_once(dirname(__FILE__) . '/view/object/post.phtml');
|
48 |
-
$content = ob_get_contents();
|
49 |
-
ob_end_clean();
|
50 |
-
|
51 |
-
return $content;
|
52 |
-
}
|
53 |
-
|
54 |
/**
|
55 |
* Get list for the table
|
56 |
*
|
@@ -69,7 +33,7 @@ class AAM_Backend_Post {
|
|
69 |
|
70 |
return $this->wrapTable($response);
|
71 |
}
|
72 |
-
|
73 |
/**
|
74 |
* Get breadcrumb for a post or term
|
75 |
*
|
@@ -276,8 +240,10 @@ class AAM_Backend_Post {
|
|
276 |
*/
|
277 |
public function save() {
|
278 |
if ($this->checkLimit()) {
|
279 |
-
$
|
280 |
-
|
|
|
|
|
281 |
|
282 |
$param = AAM_Core_Request::post('param');
|
283 |
$value = filter_var(
|
@@ -285,11 +251,9 @@ class AAM_Backend_Post {
|
|
285 |
);
|
286 |
|
287 |
//clear cache
|
288 |
-
|
289 |
-
|
290 |
-
$result =
|
291 |
-
$param, $value, $object, $objectId
|
292 |
-
);
|
293 |
} else {
|
294 |
$result = false;
|
295 |
$error = __('You reached your limitation.', AAM_KEY);
|
@@ -310,13 +274,13 @@ class AAM_Backend_Post {
|
|
310 |
*/
|
311 |
public function reset() {
|
312 |
$type = trim(AAM_Core_Request::post('type'));
|
313 |
-
$id =
|
314 |
|
315 |
$object = AAM_Backend_View::getSubject()->getObject($type, $id);
|
316 |
if ($object instanceof AAM_Core_Object) {
|
317 |
$result = $object->reset();
|
318 |
//clear cache
|
319 |
-
|
320 |
} else {
|
321 |
$result = false;
|
322 |
}
|
@@ -345,6 +309,20 @@ class AAM_Backend_Post {
|
|
345 |
|
346 |
return ($limit == -1);
|
347 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
|
349 |
/**
|
350 |
* Register Posts & Pages feature
|
@@ -354,7 +332,7 @@ class AAM_Backend_Post {
|
|
354 |
* @access public
|
355 |
*/
|
356 |
public static function register() {
|
357 |
-
$cap =
|
358 |
|
359 |
AAM_Backend_Feature::registerFeature((object) array(
|
360 |
'uid' => 'post',
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
+
class AAM_Backend_Feature_Post extends AAM_Backend_Feature_Abstract {
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
/**
|
19 |
* Get list for the table
|
20 |
*
|
33 |
|
34 |
return $this->wrapTable($response);
|
35 |
}
|
36 |
+
|
37 |
/**
|
38 |
* Get breadcrumb for a post or term
|
39 |
*
|
240 |
*/
|
241 |
public function save() {
|
242 |
if ($this->checkLimit()) {
|
243 |
+
$subject = AAM_Backend_View::getSubject();
|
244 |
+
|
245 |
+
$object = trim(AAM_Core_Request::post('object'));
|
246 |
+
$id = AAM_Core_Request::post('objectId', null);
|
247 |
|
248 |
$param = AAM_Core_Request::post('param');
|
249 |
$value = filter_var(
|
251 |
);
|
252 |
|
253 |
//clear cache
|
254 |
+
AAM_Core_Cache::clear();
|
255 |
+
|
256 |
+
$result = $subject->save($param, $value, $object, $id);
|
|
|
|
|
257 |
} else {
|
258 |
$result = false;
|
259 |
$error = __('You reached your limitation.', AAM_KEY);
|
274 |
*/
|
275 |
public function reset() {
|
276 |
$type = trim(AAM_Core_Request::post('type'));
|
277 |
+
$id = AAM_Core_Request::post('id', 0);
|
278 |
|
279 |
$object = AAM_Backend_View::getSubject()->getObject($type, $id);
|
280 |
if ($object instanceof AAM_Core_Object) {
|
281 |
$result = $object->reset();
|
282 |
//clear cache
|
283 |
+
AAM_Core_Cache::clear();
|
284 |
} else {
|
285 |
$result = false;
|
286 |
}
|
309 |
|
310 |
return ($limit == -1);
|
311 |
}
|
312 |
+
|
313 |
+
/**
|
314 |
+
* @inheritdoc
|
315 |
+
*/
|
316 |
+
public static function getAccessOption() {
|
317 |
+
return 'feature.post.capability';
|
318 |
+
}
|
319 |
+
|
320 |
+
/**
|
321 |
+
* @inheritdoc
|
322 |
+
*/
|
323 |
+
public static function getTemplate() {
|
324 |
+
return 'object/post.phtml';
|
325 |
+
}
|
326 |
|
327 |
/**
|
328 |
* Register Posts & Pages feature
|
332 |
* @access public
|
333 |
*/
|
334 |
public static function register() {
|
335 |
+
$cap = AAM_Core_Config::get(self::getAccessOption(), 'administrator');
|
336 |
|
337 |
AAM_Backend_Feature::registerFeature((object) array(
|
338 |
'uid' => 'post',
|
Application/Backend/{ProductList.php → Feature/ProductList.php}
RENAMED
@@ -18,16 +18,6 @@ return array(
|
|
18 |
'storeURL' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FGAHULDEFZV4U',
|
19 |
'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Plus Package')
|
20 |
),
|
21 |
-
array(
|
22 |
-
'title' => 'AAM Support',
|
23 |
-
'id' => 'AAM Support',
|
24 |
-
'type' => 'commercial',
|
25 |
-
'cost' => '$50',
|
26 |
-
'currency' => 'USD',
|
27 |
-
'description' => AAM_Backend_Helper::preparePhrase('Highest priority technical support (within 1 business day). Need help or not sure how to use AAM? We will carefully analyze your objectives, educate and help you to archive your goals with existing AAM functionality or we will put $50 toward custom development if necessary. [Otherwise money back guaranteed!]', 'strong'),
|
28 |
-
'storeURL' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZM8BAAN8CE3M4',
|
29 |
-
'status' => 'download'
|
30 |
-
),
|
31 |
array(
|
32 |
'title' => 'AAM Role Filter',
|
33 |
'id' => 'AAM Role Filter',
|
@@ -38,6 +28,16 @@ return array(
|
|
38 |
'storeURL' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=G9V4BT3T8WJSN',
|
39 |
'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Role Filter')
|
40 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
array(
|
42 |
'title' => 'AAM Dev License',
|
43 |
'id' => 'AAM Development License',
|
@@ -48,14 +48,6 @@ return array(
|
|
48 |
'storeURL' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZX9RCWU6BTE52',
|
49 |
'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Development License')
|
50 |
),
|
51 |
-
array(
|
52 |
-
'title' => 'AAM Utilities',
|
53 |
-
'id' => 'AAM Utilities',
|
54 |
-
'type' => 'GNU',
|
55 |
-
'license' => 'AAMUTILITIES',
|
56 |
-
'description' => __('Various useful tools for AAM like caching or clear all settings.', AAM_KEY),
|
57 |
-
'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Utilities')
|
58 |
-
),
|
59 |
array(
|
60 |
'title' => 'AAM Multisite',
|
61 |
'id' => 'AAM Multisite',
|
@@ -69,7 +61,7 @@ return array(
|
|
69 |
'id' => 'AAM Post Filter',
|
70 |
'type' => 'GNU',
|
71 |
'license' => 'AAMPOSTFILTER',
|
72 |
-
'description' =>
|
73 |
'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Post Filter')
|
74 |
),
|
75 |
array(
|
@@ -80,11 +72,18 @@ return array(
|
|
80 |
'description' => __('Skeleton for custom AAM extension. Please find all necessary documentation inside the source code.', AAM_KEY),
|
81 |
'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Skeleton Extension')
|
82 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
array(
|
84 |
'title' => 'User Switching',
|
85 |
'id' => 'User Switching',
|
86 |
'type' => 'plugin',
|
87 |
-
'description' => __('Instant switching between user accounts in WordPress.
|
88 |
'status' => AAM_Core_Repository::getInstance()->pluginStatus('User Switching')
|
89 |
)
|
90 |
);
|
18 |
'storeURL' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FGAHULDEFZV4U',
|
19 |
'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Plus Package')
|
20 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
array(
|
22 |
'title' => 'AAM Role Filter',
|
23 |
'id' => 'AAM Role Filter',
|
28 |
'storeURL' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=G9V4BT3T8WJSN',
|
29 |
'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Role Filter')
|
30 |
),
|
31 |
+
array(
|
32 |
+
'title' => 'AAM Support',
|
33 |
+
'id' => 'AAM Support',
|
34 |
+
'type' => 'commercial',
|
35 |
+
'cost' => '$50',
|
36 |
+
'currency' => 'USD',
|
37 |
+
'description' => AAM_Backend_View_Helper::preparePhrase('Highest priority technical support (within 1 business day). Need help or not sure how to use AAM? We will carefully analyze your objectives, educate and help you to archive your goals with existing AAM functionality or we will put $50 toward custom development if necessary. [Otherwise money back guaranteed!]', 'strong'),
|
38 |
+
'storeURL' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZM8BAAN8CE3M4',
|
39 |
+
'status' => 'download'
|
40 |
+
),
|
41 |
array(
|
42 |
'title' => 'AAM Dev License',
|
43 |
'id' => 'AAM Development License',
|
48 |
'storeURL' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZX9RCWU6BTE52',
|
49 |
'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Development License')
|
50 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
array(
|
52 |
'title' => 'AAM Multisite',
|
53 |
'id' => 'AAM Multisite',
|
61 |
'id' => 'AAM Post Filter',
|
62 |
'type' => 'GNU',
|
63 |
'license' => 'AAMPOSTFILTER',
|
64 |
+
'description' => AAM_Backend_View_Helper::preparePhrase('[WARNING!] Please use with caution. This is a supportive exension for the post access option [List]. It adds additional post filtering to fix the issue with large amount of post. [Turned on caching] is strongly recommended.', 'strong', 'strong', 'strong'),
|
65 |
'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Post Filter')
|
66 |
),
|
67 |
array(
|
72 |
'description' => __('Skeleton for custom AAM extension. Please find all necessary documentation inside the source code.', AAM_KEY),
|
73 |
'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Skeleton Extension')
|
74 |
),
|
75 |
+
array(
|
76 |
+
'title' => 'CodePinch',
|
77 |
+
'id' => 'WP Error Fix',
|
78 |
+
'type' => 'plugin',
|
79 |
+
'description' => __('Our patent-pending technology provides solutions to PHP errors within hours, preventing costly maintenance time and keeping your WordPress site error.', AAM_KEY),
|
80 |
+
'status' => AAM_Core_Repository::getInstance()->pluginStatus('WP Error Fix')
|
81 |
+
),
|
82 |
array(
|
83 |
'title' => 'User Switching',
|
84 |
'id' => 'User Switching',
|
85 |
'type' => 'plugin',
|
86 |
+
'description' => __('Instant switching between user accounts in WordPress.', AAM_KEY),
|
87 |
'status' => AAM_Core_Repository::getInstance()->pluginStatus('User Switching')
|
88 |
)
|
89 |
);
|
Application/Backend/{Role.php → Feature/Role.php}
RENAMED
@@ -13,7 +13,7 @@
|
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
-
class
|
17 |
|
18 |
/**
|
19 |
* Constructor
|
@@ -24,7 +24,7 @@ class AAM_Backend_Role {
|
|
24 |
* @throws Exception
|
25 |
*/
|
26 |
public function __construct() {
|
27 |
-
$cap =
|
28 |
if (!AAM::getUser()->hasCapability($cap)) {
|
29 |
Throw new Exception(__('Accedd Denied', AAM_KEY));
|
30 |
}
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
+
class AAM_Backend_Feature_Role {
|
17 |
|
18 |
/**
|
19 |
* Constructor
|
24 |
* @throws Exception
|
25 |
*/
|
26 |
public function __construct() {
|
27 |
+
$cap = AAM_Core_Config::get('page.capability', 'administrator');
|
28 |
if (!AAM::getUser()->hasCapability($cap)) {
|
29 |
Throw new Exception(__('Accedd Denied', AAM_KEY));
|
30 |
}
|
Application/Backend/{User.php → Feature/User.php}
RENAMED
@@ -13,7 +13,7 @@
|
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
-
class
|
17 |
|
18 |
/**
|
19 |
* Constructor
|
@@ -24,7 +24,7 @@ class AAM_Backend_User {
|
|
24 |
* @throws Exception
|
25 |
*/
|
26 |
public function __construct() {
|
27 |
-
$cap =
|
28 |
if (!AAM::getUser()->hasCapability($cap)) {
|
29 |
Throw new Exception(__('Accedd Denied', AAM_KEY));
|
30 |
}
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
+
class AAM_Backend_Feature_User {
|
17 |
|
18 |
/**
|
19 |
* Constructor
|
24 |
* @throws Exception
|
25 |
*/
|
26 |
public function __construct() {
|
27 |
+
$cap = AAM_Core_Config::get('page.capability', 'administrator');
|
28 |
if (!AAM::getUser()->hasCapability($cap)) {
|
29 |
Throw new Exception(__('Accedd Denied', AAM_KEY));
|
30 |
}
|
Application/Backend/Feature/Utility.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ======================================================================
|
5 |
+
* LICENSE: This file is subject to the terms and conditions defined in *
|
6 |
+
* file 'license.txt', which is part of this source code package. *
|
7 |
+
* ======================================================================
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Backend Utility manager
|
12 |
+
*
|
13 |
+
* @package AAM
|
14 |
+
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
+
*/
|
16 |
+
class AAM_Backend_Feature_Utility extends AAM_Backend_Feature_Abstract {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @inheritdoc
|
20 |
+
*/
|
21 |
+
public static function getAccessOption() {
|
22 |
+
return 'feature.utility.capability';
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @inheritdoc
|
27 |
+
*/
|
28 |
+
public static function getTemplate() {
|
29 |
+
return 'utility.phtml';
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Save AAM utility options
|
34 |
+
*
|
35 |
+
* Important notice! This function excepts "value" to be only boolean value
|
36 |
+
*
|
37 |
+
* @return string
|
38 |
+
*
|
39 |
+
* @access public
|
40 |
+
*/
|
41 |
+
public function save() {
|
42 |
+
$param = AAM_Core_Request::post('param');
|
43 |
+
$value = filter_var(
|
44 |
+
AAM_Core_Request::post('value'), FILTER_VALIDATE_BOOLEAN
|
45 |
+
);
|
46 |
+
|
47 |
+
AAM_Core_Config::set($param, $value);
|
48 |
+
|
49 |
+
return json_encode(array('status' => 'success'));
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Clear all AAM settings
|
54 |
+
*
|
55 |
+
* @global wpdb $wpdb
|
56 |
+
*
|
57 |
+
* @return string
|
58 |
+
*
|
59 |
+
* @access public
|
60 |
+
*/
|
61 |
+
public function clear() {
|
62 |
+
global $wpdb;
|
63 |
+
|
64 |
+
//clear wp_options
|
65 |
+
$oquery = "DELETE FROM {$wpdb->options} WHERE `option_name` LIKE %s";
|
66 |
+
$wpdb->query($wpdb->prepare($oquery, 'aam%' ));
|
67 |
+
|
68 |
+
//clear wp_postmeta
|
69 |
+
$pquery = "DELETE FROM {$wpdb->postmeta} WHERE `meta_key` LIKE %s";
|
70 |
+
$wpdb->query($wpdb->prepare($pquery, 'aam%' ));
|
71 |
+
|
72 |
+
//clear wp_usermeta
|
73 |
+
$uquery = "DELETE FROM {$wpdb->usermeta} WHERE `meta_key` LIKE %s";
|
74 |
+
$wpdb->query($wpdb->prepare($uquery, 'aam%' ));
|
75 |
+
|
76 |
+
$mquery = "DELETE FROM {$wpdb->usermeta} WHERE `meta_key` LIKE %s";
|
77 |
+
$wpdb->query($wpdb->prepare($mquery, $wpdb->prefix . 'aam%' ));
|
78 |
+
|
79 |
+
return json_encode(array('status' => 'success'));
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Register Contact/Hire feature
|
84 |
+
*
|
85 |
+
* @return void
|
86 |
+
*
|
87 |
+
* @access public
|
88 |
+
*/
|
89 |
+
public static function register() {
|
90 |
+
$cap = AAM_Core_Config::get(self::getAccessOption(), 'administrator');
|
91 |
+
|
92 |
+
AAM_Backend_Feature::registerFeature((object) array(
|
93 |
+
'uid' => 'utilities',
|
94 |
+
'position' => 30,
|
95 |
+
'title' => __('Utilities', AAM_KEY),
|
96 |
+
'capability' => $cap,
|
97 |
+
'subjects' => array(
|
98 |
+
'AAM_Core_Subject_Role',
|
99 |
+
'AAM_Core_Subject_User',
|
100 |
+
'AAM_Core_Subject_Visitor'
|
101 |
+
),
|
102 |
+
'view' => __CLASS__
|
103 |
+
));
|
104 |
+
}
|
105 |
+
|
106 |
+
}
|
Application/Backend/Filter.php
CHANGED
@@ -99,7 +99,7 @@ class AAM_Backend_Filter {
|
|
99 |
}
|
100 |
|
101 |
if (AAM_Core_Request::get('init') == 'metabox') {
|
102 |
-
$model = new
|
103 |
$model->initialize($screen);
|
104 |
} else {
|
105 |
AAM::getUser()->getObject('metabox')->filterBackend($screen);
|
@@ -206,7 +206,7 @@ class AAM_Backend_Filter {
|
|
206 |
* @return string
|
207 |
*/
|
208 |
public function permalinkHTML($html) {
|
209 |
-
if (
|
210 |
if (AAM::getUser()->hasCapability('manage_permalink') === false) {
|
211 |
$html = '';
|
212 |
}
|
@@ -295,7 +295,8 @@ class AAM_Backend_Filter {
|
|
295 |
* @access public
|
296 |
*/
|
297 |
public function profileUpdate($user_id) {
|
298 |
-
|
|
|
299 |
}
|
300 |
|
301 |
/**
|
99 |
}
|
100 |
|
101 |
if (AAM_Core_Request::get('init') == 'metabox') {
|
102 |
+
$model = new AAM_Backend_Feature_Metabox;
|
103 |
$model->initialize($screen);
|
104 |
} else {
|
105 |
AAM::getUser()->getObject('metabox')->filterBackend($screen);
|
206 |
* @return string
|
207 |
*/
|
208 |
public function permalinkHTML($html) {
|
209 |
+
if (AAM_Core_Config::get('control_permalink') === 'true') {
|
210 |
if (AAM::getUser()->hasCapability('manage_permalink') === false) {
|
211 |
$html = '';
|
212 |
}
|
295 |
* @access public
|
296 |
*/
|
297 |
public function profileUpdate($user_id) {
|
298 |
+
$subject = new AAM_Core_Subject_User($user_id);
|
299 |
+
$subject->deleteOption('cache');
|
300 |
}
|
301 |
|
302 |
/**
|
Application/Backend/Manager.php
CHANGED
@@ -33,7 +33,6 @@ class AAM_Backend_Manager {
|
|
33 |
*/
|
34 |
protected function __construct() {
|
35 |
//print required JS & CSS
|
36 |
-
add_action('admin_enqueue_scripts', array($this, 'enqueueScript'));
|
37 |
add_action('admin_print_scripts', array($this, 'printJavascript'));
|
38 |
add_action('admin_print_styles', array($this, 'printStylesheet'));
|
39 |
|
@@ -55,9 +54,6 @@ class AAM_Backend_Manager {
|
|
55 |
//check extension version
|
56 |
$this->checkExtensionList();
|
57 |
|
58 |
-
//check cache status
|
59 |
-
$this->checkCacheStatus();
|
60 |
-
|
61 |
//register backend hooks and filters
|
62 |
if (apply_filters('aam-utility-property', 'backend-access-control', true)) {
|
63 |
AAM_Backend_Filter::register();
|
@@ -70,6 +66,7 @@ class AAM_Backend_Manager {
|
|
70 |
* @return void
|
71 |
*
|
72 |
* @access public
|
|
|
73 |
*/
|
74 |
public function adminInit() {
|
75 |
global $plugin_page;
|
@@ -98,24 +95,6 @@ class AAM_Backend_Manager {
|
|
98 |
}
|
99 |
}
|
100 |
|
101 |
-
/**
|
102 |
-
* Enqueue global js
|
103 |
-
*
|
104 |
-
* Very important to track the JS errors on page to notify the customer that
|
105 |
-
* plugin might not function properly because of the javascript error on the page
|
106 |
-
*
|
107 |
-
* @return void
|
108 |
-
*
|
109 |
-
* @access public
|
110 |
-
*/
|
111 |
-
public function enqueueScript() {
|
112 |
-
if (AAM::isAAM()) {
|
113 |
-
echo "<script type=\"text/javascript\">\n";
|
114 |
-
echo file_get_contents(AAM_BASE . '/media/js/aam-hook.js');
|
115 |
-
echo "</script>\n";
|
116 |
-
}
|
117 |
-
}
|
118 |
-
|
119 |
/**
|
120 |
*
|
121 |
*/
|
@@ -123,10 +102,7 @@ class AAM_Backend_Manager {
|
|
123 |
$list = AAM_Core_API::getOption('aam-extension-repository', array());
|
124 |
$repo = AAM_Core_Repository::getInstance();
|
125 |
|
126 |
-
|
127 |
-
$list = (is_array($list) ? $list : array());
|
128 |
-
|
129 |
-
foreach($list as $extension) {
|
130 |
$status = $repo->extensionStatus($extension->title);
|
131 |
if ($status == AAM_Core_Repository::STATUS_UPDATE) {
|
132 |
AAM_Core_Console::add(
|
@@ -155,7 +131,7 @@ class AAM_Backend_Manager {
|
|
155 |
if (!preg_match('/^[a-z]{1}[a-z\-]+$/', $extension)) {
|
156 |
AAM_Core_Console::add(
|
157 |
sprintf(
|
158 |
-
|
159 |
$basedir . '/' . $extension
|
160 |
)
|
161 |
);
|
@@ -165,27 +141,6 @@ class AAM_Backend_Manager {
|
|
165 |
}
|
166 |
}
|
167 |
|
168 |
-
/**
|
169 |
-
* Check caching status
|
170 |
-
*
|
171 |
-
* If caching is off, show notification about it
|
172 |
-
*
|
173 |
-
* @return void
|
174 |
-
*
|
175 |
-
* @access protected
|
176 |
-
*/
|
177 |
-
protected function checkCacheStatus() {
|
178 |
-
if (apply_filters('aam-cache-status-filter', false) === false) {
|
179 |
-
$message = __(
|
180 |
-
'AAM caching is off. To speed-up the website turn it on.', AAM_KEY
|
181 |
-
);
|
182 |
-
$message .= ' <a href="#cache-info-modal" data-toggle="modal">';
|
183 |
-
$message .= __('Read more.', AAM_KEY) . '</a>';
|
184 |
-
|
185 |
-
AAM_Core_Console::add($message);
|
186 |
-
}
|
187 |
-
}
|
188 |
-
|
189 |
/**
|
190 |
* Add extra column to search in for User search
|
191 |
*
|
@@ -214,7 +169,7 @@ class AAM_Backend_Manager {
|
|
214 |
* @access public
|
215 |
*/
|
216 |
public function userActions($actions, $user) {
|
217 |
-
$cap =
|
218 |
|
219 |
if (current_user_can($cap, $user->ID)) {
|
220 |
$url = admin_url('admin.php?page=aam&user=' . $user->ID);
|
@@ -238,6 +193,7 @@ class AAM_Backend_Manager {
|
|
238 |
wp_enqueue_script('aam-bt', AAM_MEDIA . '/js/bootstrap.min.js');
|
239 |
wp_enqueue_script('aam-dt', AAM_MEDIA . '/js/datatables.min.js');
|
240 |
wp_enqueue_script('aam-dwn', AAM_MEDIA . '/js/download.min.js');
|
|
|
241 |
wp_enqueue_script('aam-main', AAM_MEDIA . '/js/aam.js');
|
242 |
//add plugin localization
|
243 |
$this->printLocalization('aam-main');
|
@@ -257,21 +213,21 @@ class AAM_Backend_Manager {
|
|
257 |
$subject = $this->getCurrentSubject();
|
258 |
|
259 |
wp_localize_script($localKey, 'aamLocal', array(
|
260 |
-
'nonce'
|
261 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
262 |
'url' => array(
|
263 |
-
'site'
|
264 |
-
'jsbase'
|
265 |
'editUser' => admin_url('user-edit.php'),
|
266 |
-
'addUser'
|
267 |
),
|
268 |
-
'subject'
|
269 |
'type' => $subject->type,
|
270 |
-
'id'
|
271 |
-
'name'=> $subject->name,
|
272 |
'blog' => get_current_blog_id()
|
273 |
),
|
274 |
-
'translation' => require (dirname(__FILE__) . '/Localization.php')
|
275 |
));
|
276 |
}
|
277 |
|
@@ -337,10 +293,10 @@ class AAM_Backend_Manager {
|
|
337 |
add_menu_page(
|
338 |
__('AAM', AAM_KEY),
|
339 |
__('AAM', AAM_KEY) . $counter,
|
340 |
-
|
341 |
'aam',
|
342 |
array($this, 'renderPage'),
|
343 |
-
AAM_MEDIA . '/active-menu.
|
344 |
);
|
345 |
}
|
346 |
|
@@ -368,7 +324,7 @@ class AAM_Backend_Manager {
|
|
368 |
public function renderContent() {
|
369 |
check_ajax_referer('aam_ajax');
|
370 |
|
371 |
-
$cap =
|
372 |
|
373 |
if (AAM::getUser()->hasCapability($cap)) {
|
374 |
echo AAM_Backend_View::getInstance()->renderContent();
|
@@ -393,7 +349,7 @@ class AAM_Backend_Manager {
|
|
393 |
while (@ob_end_clean()){}
|
394 |
|
395 |
//process ajax request
|
396 |
-
$cap =
|
397 |
|
398 |
if (AAM::getUser()->hasCapability($cap)) {
|
399 |
echo AAM_Backend_View::getInstance()->processAjax();
|
@@ -425,9 +381,7 @@ class AAM_Backend_Manager {
|
|
425 |
* @access public
|
426 |
*/
|
427 |
public static function getInstance() {
|
428 |
-
|
429 |
-
self::bootstrap();
|
430 |
-
}
|
431 |
|
432 |
return self::$_instance;
|
433 |
}
|
33 |
*/
|
34 |
protected function __construct() {
|
35 |
//print required JS & CSS
|
|
|
36 |
add_action('admin_print_scripts', array($this, 'printJavascript'));
|
37 |
add_action('admin_print_styles', array($this, 'printStylesheet'));
|
38 |
|
54 |
//check extension version
|
55 |
$this->checkExtensionList();
|
56 |
|
|
|
|
|
|
|
57 |
//register backend hooks and filters
|
58 |
if (apply_filters('aam-utility-property', 'backend-access-control', true)) {
|
59 |
AAM_Backend_Filter::register();
|
66 |
* @return void
|
67 |
*
|
68 |
* @access public
|
69 |
+
* @since 3.3
|
70 |
*/
|
71 |
public function adminInit() {
|
72 |
global $plugin_page;
|
95 |
}
|
96 |
}
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
/**
|
99 |
*
|
100 |
*/
|
102 |
$list = AAM_Core_API::getOption('aam-extension-repository', array());
|
103 |
$repo = AAM_Core_Repository::getInstance();
|
104 |
|
105 |
+
foreach((is_array($list) ? $list : array()) as $extension) {
|
|
|
|
|
|
|
106 |
$status = $repo->extensionStatus($extension->title);
|
107 |
if ($status == AAM_Core_Repository::STATUS_UPDATE) {
|
108 |
AAM_Core_Console::add(
|
131 |
if (!preg_match('/^[a-z]{1}[a-z\-]+$/', $extension)) {
|
132 |
AAM_Core_Console::add(
|
133 |
sprintf(
|
134 |
+
AAM_Backend_View_Helper::preparePhrase('Please manually remove [%s] and re-install the extension if necessary', 'b'),
|
135 |
$basedir . '/' . $extension
|
136 |
)
|
137 |
);
|
141 |
}
|
142 |
}
|
143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
/**
|
145 |
* Add extra column to search in for User search
|
146 |
*
|
169 |
* @access public
|
170 |
*/
|
171 |
public function userActions($actions, $user) {
|
172 |
+
$cap = AAM_Core_Config::get('page.capability', 'administrator');
|
173 |
|
174 |
if (current_user_can($cap, $user->ID)) {
|
175 |
$url = admin_url('admin.php?page=aam&user=' . $user->ID);
|
193 |
wp_enqueue_script('aam-bt', AAM_MEDIA . '/js/bootstrap.min.js');
|
194 |
wp_enqueue_script('aam-dt', AAM_MEDIA . '/js/datatables.min.js');
|
195 |
wp_enqueue_script('aam-dwn', AAM_MEDIA . '/js/download.min.js');
|
196 |
+
wp_enqueue_script('aam-utl-tg', AAM_MEDIA . '/js/toggle.min.js');
|
197 |
wp_enqueue_script('aam-main', AAM_MEDIA . '/js/aam.js');
|
198 |
//add plugin localization
|
199 |
$this->printLocalization('aam-main');
|
213 |
$subject = $this->getCurrentSubject();
|
214 |
|
215 |
wp_localize_script($localKey, 'aamLocal', array(
|
216 |
+
'nonce' => wp_create_nonce('aam_ajax'),
|
217 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
218 |
'url' => array(
|
219 |
+
'site' => admin_url('index.php'),
|
220 |
+
'jsbase' => AAM_MEDIA . '/js',
|
221 |
'editUser' => admin_url('user-edit.php'),
|
222 |
+
'addUser' => admin_url('user-new.php')
|
223 |
),
|
224 |
+
'subject' => array(
|
225 |
'type' => $subject->type,
|
226 |
+
'id' => $subject->id,
|
227 |
+
'name' => $subject->name,
|
228 |
'blog' => get_current_blog_id()
|
229 |
),
|
230 |
+
'translation' => require (dirname(__FILE__) . '/View/Localization.php')
|
231 |
));
|
232 |
}
|
233 |
|
293 |
add_menu_page(
|
294 |
__('AAM', AAM_KEY),
|
295 |
__('AAM', AAM_KEY) . $counter,
|
296 |
+
AAM_Core_Config::get('page.capability', 'administrator'),
|
297 |
'aam',
|
298 |
array($this, 'renderPage'),
|
299 |
+
AAM_MEDIA . '/active-menu.svg'
|
300 |
);
|
301 |
}
|
302 |
|
324 |
public function renderContent() {
|
325 |
check_ajax_referer('aam_ajax');
|
326 |
|
327 |
+
$cap = AAM_Core_Config::get('page.capability', 'administrator');
|
328 |
|
329 |
if (AAM::getUser()->hasCapability($cap)) {
|
330 |
echo AAM_Backend_View::getInstance()->renderContent();
|
349 |
while (@ob_end_clean()){}
|
350 |
|
351 |
//process ajax request
|
352 |
+
$cap = AAM_Core_Config::get('page.capability', 'administrator');
|
353 |
|
354 |
if (AAM::getUser()->hasCapability($cap)) {
|
355 |
echo AAM_Backend_View::getInstance()->processAjax();
|
381 |
* @access public
|
382 |
*/
|
383 |
public static function getInstance() {
|
384 |
+
self::bootstrap();
|
|
|
|
|
385 |
|
386 |
return self::$_instance;
|
387 |
}
|
Application/Backend/View.php
CHANGED
@@ -51,12 +51,13 @@ class AAM_Backend_View {
|
|
51 |
}
|
52 |
|
53 |
//register default features
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
60 |
|
61 |
//feature registration hook
|
62 |
do_action('aam-feature-registration');
|
@@ -71,7 +72,7 @@ class AAM_Backend_View {
|
|
71 |
*/
|
72 |
public function renderPage() {
|
73 |
ob_start();
|
74 |
-
require_once(dirname(__FILE__) . '/
|
75 |
$content = ob_get_contents();
|
76 |
ob_end_clean();
|
77 |
|
@@ -95,7 +96,7 @@ class AAM_Backend_View {
|
|
95 |
$response = call_user_func(array($this, $parts[0]));
|
96 |
} elseif (count($parts) == 2) { //cover the Model.method pattern
|
97 |
try {
|
98 |
-
$classname = '
|
99 |
if (class_exists($classname)) {
|
100 |
$response = call_user_func(array(new $classname, $parts[1]));
|
101 |
}
|
@@ -118,7 +119,7 @@ class AAM_Backend_View {
|
|
118 |
*/
|
119 |
public function renderContent() {
|
120 |
ob_start();
|
121 |
-
require_once(dirname(__FILE__) . '/
|
122 |
$content = ob_get_contents();
|
123 |
ob_end_clean();
|
124 |
|
@@ -132,7 +133,7 @@ class AAM_Backend_View {
|
|
132 |
*/
|
133 |
public function loadPartial($partial) {
|
134 |
ob_start();
|
135 |
-
require_once(dirname(__FILE__) . '/
|
136 |
$content = ob_get_contents();
|
137 |
ob_end_clean();
|
138 |
|
@@ -162,32 +163,6 @@ class AAM_Backend_View {
|
|
162 |
return json_encode(array('status' => ($result ? 'success' : 'failure')));
|
163 |
}
|
164 |
|
165 |
-
/**
|
166 |
-
*
|
167 |
-
* @return type
|
168 |
-
*/
|
169 |
-
public function confirmWelcome() {
|
170 |
-
return json_encode(array(
|
171 |
-
'status' => AAM_Core_API::updateOption('aam-welcome', 0)
|
172 |
-
));
|
173 |
-
}
|
174 |
-
|
175 |
-
/**
|
176 |
-
*
|
177 |
-
* @return type
|
178 |
-
*/
|
179 |
-
public function getErrorFixStatus() {
|
180 |
-
$plugin = AAM_Core_Repository::getInstance()->pluginStatus('WP Error Fix');
|
181 |
-
|
182 |
-
if ($plugin['status'] == 'install') {
|
183 |
-
$response = array('status' => 'show', 'url' => $plugin['url']);
|
184 |
-
} else {
|
185 |
-
$response = array('status' => 'hide');
|
186 |
-
}
|
187 |
-
|
188 |
-
return json_encode($response);
|
189 |
-
}
|
190 |
-
|
191 |
/**
|
192 |
* Get Subject
|
193 |
*
|
51 |
}
|
52 |
|
53 |
//register default features
|
54 |
+
AAM_Backend_Feature_Menu::register();
|
55 |
+
AAM_Backend_Feature_Metabox::register();
|
56 |
+
AAM_Backend_Feature_Capability::register();
|
57 |
+
AAM_Backend_Feature_Post::register();
|
58 |
+
AAM_Backend_Feature_Extension::register();
|
59 |
+
AAM_Backend_Feature_Utility::register();
|
60 |
+
AAM_Backend_Feature_Contact::register();
|
61 |
|
62 |
//feature registration hook
|
63 |
do_action('aam-feature-registration');
|
72 |
*/
|
73 |
public function renderPage() {
|
74 |
ob_start();
|
75 |
+
require_once(dirname(__FILE__) . '/phtml/index.phtml');
|
76 |
$content = ob_get_contents();
|
77 |
ob_end_clean();
|
78 |
|
96 |
$response = call_user_func(array($this, $parts[0]));
|
97 |
} elseif (count($parts) == 2) { //cover the Model.method pattern
|
98 |
try {
|
99 |
+
$classname = 'AAM_Backend_Feature_' . $parts[0];
|
100 |
if (class_exists($classname)) {
|
101 |
$response = call_user_func(array(new $classname, $parts[1]));
|
102 |
}
|
119 |
*/
|
120 |
public function renderContent() {
|
121 |
ob_start();
|
122 |
+
require_once(dirname(__FILE__) . '/phtml/main-panel.phtml');
|
123 |
$content = ob_get_contents();
|
124 |
ob_end_clean();
|
125 |
|
133 |
*/
|
134 |
public function loadPartial($partial) {
|
135 |
ob_start();
|
136 |
+
require_once(dirname(__FILE__) . '/phtml/partial/' . $partial);
|
137 |
$content = ob_get_contents();
|
138 |
ob_end_clean();
|
139 |
|
163 |
return json_encode(array('status' => ($result ? 'success' : 'failure')));
|
164 |
}
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
/**
|
167 |
* Get Subject
|
168 |
*
|
Application/Backend/{Helper.php → View/Helper.php}
RENAMED
@@ -13,7 +13,7 @@
|
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
-
class
|
17 |
|
18 |
/**
|
19 |
* Prepare phrase or label
|
@@ -29,7 +29,7 @@ class AAM_Backend_Helper {
|
|
29 |
//prepare search patterns
|
30 |
$num = func_num_args();
|
31 |
$search = array_fill(0, ($num - 1) * 2, null);
|
32 |
-
array_walk($search, '
|
33 |
|
34 |
$replace = array();
|
35 |
foreach (array_slice(func_get_args(), 1) as $key) {
|
13 |
* @package AAM
|
14 |
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
*/
|
16 |
+
class AAM_Backend_View_Helper {
|
17 |
|
18 |
/**
|
19 |
* Prepare phrase or label
|
29 |
//prepare search patterns
|
30 |
$num = func_num_args();
|
31 |
$search = array_fill(0, ($num - 1) * 2, null);
|
32 |
+
array_walk($search, 'AAM_Backend_View_Helper::prepareWalk');
|
33 |
|
34 |
$replace = array();
|
35 |
foreach (array_slice(func_get_args(), 1) as $key) {
|
Application/Backend/{Localization.php → View/Localization.php}
RENAMED
@@ -15,7 +15,7 @@ return array(
|
|
15 |
'Application error' => __('Application error', AAM_KEY),
|
16 |
'Add Capability' => __('Add Capability', AAM_KEY),
|
17 |
'Show Menu' => __('Show Menu', AAM_KEY),
|
18 |
-
'
|
19 |
'Failed to retrieve mataboxes' => __('Failed to retrieve mataboxes', AAM_KEY),
|
20 |
'Search' => __('Search', AAM_KEY),
|
21 |
'_TOTAL_ object(s)' => __('_TOTAL_ object(s)', AAM_KEY),
|
15 |
'Application error' => __('Application error', AAM_KEY),
|
16 |
'Add Capability' => __('Add Capability', AAM_KEY),
|
17 |
'Show Menu' => __('Show Menu', AAM_KEY),
|
18 |
+
'Restrict Menu' => __('Restrict Menu', AAM_KEY),
|
19 |
'Failed to retrieve mataboxes' => __('Failed to retrieve mataboxes', AAM_KEY),
|
20 |
'Search' => __('Search', AAM_KEY),
|
21 |
'_TOTAL_ object(s)' => __('_TOTAL_ object(s)', AAM_KEY),
|
Application/Backend/{view → phtml}/contact.phtml
RENAMED
@@ -3,12 +3,12 @@
|
|
3 |
<div class="row">
|
4 |
<div class="col-xs-12">
|
5 |
<p class="aam-info">
|
6 |
-
<?php echo __('Feel free to contact us if you have any questions or
|
7 |
</p>
|
8 |
<ol class="text-larger">
|
9 |
<li>Keep your message short. As longer message as longer it will take for us to response;</li>
|
10 |
<li>Use English, Polish, Russian or Ukrainian language. Otherwise we may ignore your message;</li>
|
11 |
-
<li>
|
12 |
<li>In case of issues with the plugin, if possible, include screenshots or videos that show the problem;</li>
|
13 |
<li>Be patient. It might take up to 3 business days for us to response.</li>
|
14 |
</ol>
|
3 |
<div class="row">
|
4 |
<div class="col-xs-12">
|
5 |
<p class="aam-info">
|
6 |
+
<?php echo __('Feel free to contact us if you have any questions or concerns but follow few simple rules:'); ?>
|
7 |
</p>
|
8 |
<ol class="text-larger">
|
9 |
<li>Keep your message short. As longer message as longer it will take for us to response;</li>
|
10 |
<li>Use English, Polish, Russian or Ukrainian language. Otherwise we may ignore your message;</li>
|
11 |
+
<li>You can hire us to do some custom functionality for your needs but please be clear with your requirements;</li>
|
12 |
<li>In case of issues with the plugin, if possible, include screenshots or videos that show the problem;</li>
|
13 |
<li>Be patient. It might take up to 3 business days for us to response.</li>
|
14 |
</ol>
|
Application/Backend/{view → phtml}/extension.phtml
RENAMED
@@ -3,7 +3,7 @@
|
|
3 |
<div class="row">
|
4 |
<div class="col-xs-12">
|
5 |
<p class="aam-info">
|
6 |
-
<?php echo
|
7 |
</p>
|
8 |
</div>
|
9 |
</div>
|
@@ -22,9 +22,9 @@
|
|
22 |
|
23 |
<div>
|
24 |
<ul class="nav nav-tabs" role="tablist">
|
25 |
-
<li role="presentation" class="active"><a href="#premium-extensions" aria-controls="premium-extensions" role="tab" data-toggle="tab"
|
26 |
-
<li role="presentation"><a href="#free-extensions" aria-controls="free-extensions" role="tab" data-toggle="tab"
|
27 |
-
<li role="presentation"><a href="#useful-plugins" aria-controls="help-plugins" role="tab" data-toggle="tab"
|
28 |
</ul>
|
29 |
|
30 |
<!-- Tab panes -->
|
@@ -35,8 +35,8 @@
|
|
35 |
<?php foreach ($this->getProductList('commercial') as $product) { ?>
|
36 |
<tr>
|
37 |
<td>
|
38 |
-
<
|
39 |
-
<p class="
|
40 |
<?php echo $product['description']; ?>
|
41 |
</p>
|
42 |
</td>
|
@@ -60,8 +60,8 @@
|
|
60 |
<?php foreach ($this->getProductList('GNU') as $product) { ?>
|
61 |
<tr>
|
62 |
<td>
|
63 |
-
<
|
64 |
-
<p class="
|
65 |
<?php echo $product['description']; ?>
|
66 |
</p>
|
67 |
</td>
|
@@ -85,8 +85,8 @@
|
|
85 |
<?php foreach ($this->getProductList('plugin') as $product) { ?>
|
86 |
<tr>
|
87 |
<td>
|
88 |
-
<
|
89 |
-
<p class="
|
90 |
<?php echo $product['description']; ?>
|
91 |
</p>
|
92 |
</td>
|
@@ -119,10 +119,10 @@
|
|
119 |
</p>
|
120 |
|
121 |
<ul class="aam-outer-top-xs aam-numeric-list">
|
122 |
-
<li><?php echo
|
123 |
-
<li><?php echo
|
124 |
-
<li><?php echo
|
125 |
-
<li><?php echo
|
126 |
</ul>
|
127 |
</div>
|
128 |
<div class="modal-footer">
|
3 |
<div class="row">
|
4 |
<div class="col-xs-12">
|
5 |
<p class="aam-info">
|
6 |
+
<?php echo AAM_Backend_View_Helper::preparePhrase('License is limited to one domain only but it can be used for unlimited number of test or development environments where URL is either [localhost] or starts with [dev.], [staging.] or [test.] (contact us immediately if you have troubles installing license on your dev website). [Money back guaranteed] within 30 day from the time of purchase.', 'i', 'i', 'i', 'i', 'b'); ?><br/>
|
7 |
</p>
|
8 |
</div>
|
9 |
</div>
|
22 |
|
23 |
<div>
|
24 |
<ul class="nav nav-tabs" role="tablist">
|
25 |
+
<li role="presentation" class="active"><a href="#premium-extensions" aria-controls="premium-extensions" role="tab" data-toggle="tab"><i class='icon-basket'></i> <?php echo __('Premium', AAM_KEY); ?></a></li>
|
26 |
+
<li role="presentation"><a href="#free-extensions" aria-controls="free-extensions" role="tab" data-toggle="tab"><i class='icon-download-cloud'></i> <?php echo __('Free', AAM_KEY); ?></a></li>
|
27 |
+
<li role="presentation"><a href="#useful-plugins" aria-controls="help-plugins" role="tab" data-toggle="tab"><i class='icon-thumbs-up-alt'></i> <?php echo __('Userful Plugins', AAM_KEY); ?></a></li>
|
28 |
</ul>
|
29 |
|
30 |
<!-- Tab panes -->
|
35 |
<?php foreach ($this->getProductList('commercial') as $product) { ?>
|
36 |
<tr>
|
37 |
<td>
|
38 |
+
<span class='aam-setting-title'><?php echo $product['title'], ' - ' . ($product['cost'] . ' <small>' . $product['currency'] . '</small>'); ?></span>
|
39 |
+
<p class="aam-extension-description">
|
40 |
<?php echo $product['description']; ?>
|
41 |
</p>
|
42 |
</td>
|
60 |
<?php foreach ($this->getProductList('GNU') as $product) { ?>
|
61 |
<tr>
|
62 |
<td>
|
63 |
+
<span class='aam-setting-title'><?php echo $product['title'], ' - ' . ('<span class="text-success">' . __('Free', AAM_KEY) . '</span>'); ?></span>
|
64 |
+
<p class="aam-extension-description">
|
65 |
<?php echo $product['description']; ?>
|
66 |
</p>
|
67 |
</td>
|
85 |
<?php foreach ($this->getProductList('plugin') as $product) { ?>
|
86 |
<tr>
|
87 |
<td>
|
88 |
+
<span class='aam-setting-title'><?php echo $product['title'], ' - ' . ('<span class="text-success">' . __('Free', AAM_KEY) . '</span>'); ?></span>
|
89 |
+
<p class="aam-extension-description">
|
90 |
<?php echo $product['description']; ?>
|
91 |
</p>
|
92 |
</td>
|
119 |
</p>
|
120 |
|
121 |
<ul class="aam-outer-top-xs aam-numeric-list">
|
122 |
+
<li><?php echo AAM_Backend_View_Helper::preparePhrase('Click [Download] button below and save the zip archive on your computer', 'b'); ?>;</li>
|
123 |
+
<li><?php echo AAM_Backend_View_Helper::preparePhrase('Connect to your website via FTP and navigate to [wp-content] folder', 'b'); ?>;</li>
|
124 |
+
<li><?php echo AAM_Backend_View_Helper::preparePhrase('Create [aam/extension] folder inside [wp-content] and make sure it is writable by your server', 'b', 'b'); ?>;</li>
|
125 |
+
<li><?php echo AAM_Backend_View_Helper::preparePhrase('Unzip downloaded archive and transfer the folder inside the [wp-content/aam/extension] folder', 'b'); ?>.</li>
|
126 |
</ul>
|
127 |
</div>
|
128 |
<div class="modal-footer">
|
Application/Backend/{view → phtml}/index.phtml
RENAMED
@@ -1,43 +1,5 @@
|
|
1 |
<?php if (defined('AAM_KEY')) { ?>
|
2 |
<div class="wrap">
|
3 |
-
<div class="row aam-no-margin aam-notification-container<?php echo (AAM_Core_Console::hasIssues() ? '' : ' hidden') ?>">
|
4 |
-
<div class="col-xs-12">
|
5 |
-
<div class="row aam-notification">
|
6 |
-
<div class="col-xs-4 col-md-2 aam-notification-icon">
|
7 |
-
<i class="icon-attention-circled"></i>
|
8 |
-
</div>
|
9 |
-
<div class="col-xs-8 col-md-10 aam-notification-content">
|
10 |
-
<ul class="aam-error-list">
|
11 |
-
<?php foreach (AAM_Core_Console::getWarnings() as $message) { ?>
|
12 |
-
<li><?php echo $message; ?></li>
|
13 |
-
<?php } ?>
|
14 |
-
</ul>
|
15 |
-
</div>
|
16 |
-
</div>
|
17 |
-
</div>
|
18 |
-
</div>
|
19 |
-
|
20 |
-
<div class="modal fade" id="cache-info-modal" tabindex="-1" role="dialog">
|
21 |
-
<div class="modal-dialog" role="document">
|
22 |
-
<div class="modal-content">
|
23 |
-
<div class="modal-header">
|
24 |
-
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
25 |
-
<h4 class="modal-title"><?php echo __('Cache Information', AAM_KEY); ?></h4>
|
26 |
-
</div>
|
27 |
-
<div class="modal-body">
|
28 |
-
<p class="aam-info"><?php echo __('AAM main objective is to control access to your frontend and backend resources. In some cases your website may get slower because AAM performs additional checks. That is why it is important to have AAM caching turned on. Please follow few simple steps below to turn on the caching mechanism.', AAM_KEY); ?></p>
|
29 |
-
<ul class="aam-numeric-list">
|
30 |
-
<li><?php echo AAM_Backend_Helper::preparePhrase('Go to [Extensions] tab and click [Download] button for [AAM Utilities]', 'b', 'b', 'i'); ?>;</li>
|
31 |
-
<li><?php echo AAM_Backend_Helper::preparePhrase('After [AAM Utilities] installed successfully, go to [Utilities] tab and enable [Caching].', 'i', 'b', 'b'); ?></ol>
|
32 |
-
</ul>
|
33 |
-
</div>
|
34 |
-
<div class="modal-footer">
|
35 |
-
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('OK', AAM_KEY); ?></button>
|
36 |
-
</div>
|
37 |
-
</div>
|
38 |
-
</div>
|
39 |
-
</div>
|
40 |
-
|
41 |
<div class="row">
|
42 |
<div class="col-xs-12 col-md-8">
|
43 |
<h1 class="aam-current-subject"></h1>
|
@@ -49,7 +11,7 @@
|
|
49 |
<div class="metabox-holder">
|
50 |
<div class="postbox">
|
51 |
<h3 class="hndle">
|
52 |
-
<span><?php echo __('Access
|
53 |
<span class="aam-help-menu" data-target="#access-manager-inside"><i class="icon-help-circled"></i></span>
|
54 |
</h3>
|
55 |
<div class="inside" id="access-manager-inside">
|
@@ -57,13 +19,13 @@
|
|
57 |
<div class="aam-help-context" >
|
58 |
<div class="text-justify aam-large-padding">
|
59 |
<p class="text-larger"><?php echo __('Appreciate your interest in Advanced Access Manager (aka AAM). With strong knowledge and experience in WordPress, AAM becomes a very powerful tool to manage access to your frontend and backend.', AAM_KEY); ?></p>
|
60 |
-
<p class="text-larger"><span class="aam-highlight"><?php echo __('Please notice!', AAM_KEY); ?></span> <?php echo
|
61 |
<p class="text-larger"><?php echo __('AAM was thoroughly tested on the fresh installation of WordPress and in the latest versions of Chrome, Safari, IE and Firefox. If you have any issues, the most typical case is the conflict with other plugins or themes.', AAM_KEY); ?></p>
|
62 |
-
<p class="text-larger"><?php echo sprintf(__('
|
63 |
</div>
|
64 |
|
65 |
<div class="aam-info aam-social">
|
66 |
-
<a target="_blank" href="http://
|
67 |
<a target="_blank" href="http://twitter.com/vasyltech"><i class="icon-twitter"></i></a>
|
68 |
<a target="_blank" href="https://github.com/VasylTech/advanced-access-manager"><i class="icon-github"></i></a>
|
69 |
<a target="_blank" href="https://www.facebook.com/vasyltech"><i class="icon-facebook"></i></a>
|
@@ -76,12 +38,30 @@
|
|
76 |
</div>
|
77 |
|
78 |
<div class="col-xs-12 col-md-4">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
<div class="metabox-holder">
|
80 |
<?php do_action('aam-sidebar-ui-action', 'top'); ?>
|
81 |
|
82 |
<div class="postbox">
|
83 |
<h3 class="hndle">
|
84 |
-
<span><?php echo __('User/Role
|
85 |
<span class="aam-help-menu" data-target="#user-role-manager-inside"><i class="icon-help-circled"></i></span>
|
86 |
</h3>
|
87 |
<div class="inside" id="user-role-manager-inside">
|
@@ -110,7 +90,7 @@
|
|
110 |
<div class="modal-content">
|
111 |
<div class="modal-header">
|
112 |
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
113 |
-
<h4 class="modal-title"><?php echo __('
|
114 |
</div>
|
115 |
<div class="modal-body">
|
116 |
<div class="form-group">
|
@@ -118,14 +98,14 @@
|
|
118 |
<input type="text" class="form-control" id="new-role-name" placeholder="<?php echo __('Enter Role Name', AAM_KEY); ?>" />
|
119 |
</div>
|
120 |
<div class="form-group">
|
121 |
-
<label for="inherit-role-list"><?php echo __('Inherit Capabilities', AAM_KEY); ?></label>
|
122 |
<select class="form-control" id="inherit-role-list">
|
123 |
<option value=""><?php echo __('Select Role', AAM_KEY); ?></option>
|
124 |
</select>
|
125 |
</div>
|
126 |
</div>
|
127 |
<div class="modal-footer">
|
128 |
-
<button type="button" class="btn btn-success" id="add-role-btn"><?php echo __('
|
129 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
|
130 |
</div>
|
131 |
</div>
|
@@ -137,7 +117,7 @@
|
|
137 |
<div class="modal-content">
|
138 |
<div class="modal-header">
|
139 |
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
140 |
-
<h4 class="modal-title"><?php echo __('
|
141 |
</div>
|
142 |
<div class="modal-body">
|
143 |
<div class="form-group">
|
@@ -146,7 +126,7 @@
|
|
146 |
</div>
|
147 |
</div>
|
148 |
<div class="modal-footer">
|
149 |
-
<button type="button" class="btn btn-success" id="edit-role-btn"><?php echo __('Update
|
150 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
|
151 |
</div>
|
152 |
</div>
|
@@ -164,7 +144,7 @@
|
|
164 |
<p class="text-center aam-confirm-message" data-message="<?php echo __('Are you sure that you want to delete %s role?', AAM_KEY); ?>"></p>
|
165 |
</div>
|
166 |
<div class="modal-footer">
|
167 |
-
<button type="button" class="btn btn-danger" id="delete-role-btn"><?php echo __('Delete
|
168 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
|
169 |
</div>
|
170 |
</div>
|
@@ -172,14 +152,14 @@
|
|
172 |
</div>
|
173 |
|
174 |
<div class="modal fade" id="role-notification-modal" tabindex="-1" role="dialog">
|
175 |
-
<div class="modal-dialog" role="document">
|
176 |
<div class="modal-content">
|
177 |
<div class="modal-header">
|
178 |
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
179 |
<h4 class="modal-title"><?php echo __('Notification', AAM_KEY); ?></h4>
|
180 |
</div>
|
181 |
<div class="modal-body">
|
182 |
-
<p class="text-
|
183 |
</div>
|
184 |
<div class="modal-footer">
|
185 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('OK', AAM_KEY); ?></button>
|
@@ -218,11 +198,10 @@
|
|
218 |
</div>
|
219 |
</div>
|
220 |
</div>
|
221 |
-
|
222 |
</div>
|
223 |
<div role="tabpanel" class="tab-pane" id="visitor">
|
224 |
<div class="visitor-message">
|
225 |
-
<span><?php echo __('Manage access to your website for visitors (any user that is not authenticated)', AAM_KEY); ?>.</span>
|
226 |
<button class="btn btn-primary btn-block" id="manage-visitor"><i class="icon-cog"></i> <?php echo __('Manage Visitors', AAM_KEY); ?></button>
|
227 |
</div>
|
228 |
</div>
|
@@ -230,40 +209,27 @@
|
|
230 |
</div>
|
231 |
<div class="aam-help-context">
|
232 |
<p class="aam-info aam-hint">
|
233 |
-
<?php echo
|
234 |
</p>
|
235 |
|
236 |
<p class="text-justify">
|
237 |
-
<strong
|
238 |
-
<?php echo __('With
|
239 |
</p>
|
240 |
|
241 |
<p class="text-justify">
|
242 |
-
<strong
|
243 |
<?php echo __('Manage access for any user. As a bonus feature, you can block user. It means that user will be not able to login to your website anymore.', AAM_KEY); ?>
|
244 |
</p>
|
245 |
|
246 |
<p class="text-justify">
|
247 |
-
<strong
|
248 |
<?php echo __('Visitor can be considered any user that is not authenticated to your website.', AAM_KEY); ?>
|
249 |
</p>
|
250 |
</div>
|
251 |
</div>
|
252 |
</div>
|
253 |
<?php do_action('aam-sidebar-ui-action', 'bottom'); ?>
|
254 |
-
|
255 |
-
<!-- Error Fix Promotion: begin -->
|
256 |
-
<div class="postbox hidden" id="errorfix-promotion">
|
257 |
-
<h3 class="hndle">
|
258 |
-
<span>Website Error Fix</span>
|
259 |
-
<a href="http://phperrorfix.com" target="_blank" class="aam-help-menu"><i class="icon-help-circled"></i></a>
|
260 |
-
</h3>
|
261 |
-
<div class="inside">
|
262 |
-
<p class="aam-info">Keep your website secure & error free with our patent pending <b>WP Error Fix</b>.</p>
|
263 |
-
<a href="#" class="btn btn-warning btn-lg btn-block" id="errorfix-install-btn">Install WP Error Fix</a>
|
264 |
-
</div>
|
265 |
-
</div>
|
266 |
-
<!-- Error Fix Promotion: end -->
|
267 |
</div>
|
268 |
</div>
|
269 |
</div>
|
1 |
<?php if (defined('AAM_KEY')) { ?>
|
2 |
<div class="wrap">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
<div class="row">
|
4 |
<div class="col-xs-12 col-md-8">
|
5 |
<h1 class="aam-current-subject"></h1>
|
11 |
<div class="metabox-holder">
|
12 |
<div class="postbox">
|
13 |
<h3 class="hndle">
|
14 |
+
<span><?php echo __('Access Control Panel', AAM_KEY); ?></span>
|
15 |
<span class="aam-help-menu" data-target="#access-manager-inside"><i class="icon-help-circled"></i></span>
|
16 |
</h3>
|
17 |
<div class="inside" id="access-manager-inside">
|
19 |
<div class="aam-help-context" >
|
20 |
<div class="text-justify aam-large-padding">
|
21 |
<p class="text-larger"><?php echo __('Appreciate your interest in Advanced Access Manager (aka AAM). With strong knowledge and experience in WordPress, AAM becomes a very powerful tool to manage access to your frontend and backend.', AAM_KEY); ?></p>
|
22 |
+
<p class="text-larger"><span class="aam-highlight"><?php echo __('Please notice!', AAM_KEY); ?></span> <?php echo AAM_Backend_View_Helper::preparePhrase('Power comes with responsibility. Make sure that you have enough knowledge in WordPress Roles & Capabilities because AAM is very closely intergrated with WordPress core. It is also very important [to have backup of your database before you start working with AAM] (there is no need to backup your files, AAM does not modify any physical files on your server and never did).', 'b'); ?></p>
|
23 |
<p class="text-larger"><?php echo __('AAM was thoroughly tested on the fresh installation of WordPress and in the latest versions of Chrome, Safari, IE and Firefox. If you have any issues, the most typical case is the conflict with other plugins or themes.', AAM_KEY); ?></p>
|
24 |
+
<p class="text-larger"><?php echo sprintf(__('Also check our %sIntroduction to AAM%s so you know where to start.', AAM_KEY), '<a href="http://vasyltech.com/blog/introduction-to-aam" target="_blank">', '</a>'); ?></p>
|
25 |
</div>
|
26 |
|
27 |
<div class="aam-info aam-social">
|
28 |
+
<a target="_blank" href="http://vasyltech.com/advanced-access-manager"><i class="icon-home"></i></a>
|
29 |
<a target="_blank" href="http://twitter.com/vasyltech"><i class="icon-twitter"></i></a>
|
30 |
<a target="_blank" href="https://github.com/VasylTech/advanced-access-manager"><i class="icon-github"></i></a>
|
31 |
<a target="_blank" href="https://www.facebook.com/vasyltech"><i class="icon-facebook"></i></a>
|
38 |
</div>
|
39 |
|
40 |
<div class="col-xs-12 col-md-4">
|
41 |
+
<?php if (AAM_Core_Console::hasIssues()) { ?>
|
42 |
+
<div class="metabox-holder">
|
43 |
+
<div class="postbox">
|
44 |
+
<h3 class="hndle text-danger">
|
45 |
+
<i class='icon-attention-circled'></i> <span><?php echo __('Notifications', AAM_KEY); ?></span>
|
46 |
+
</h3>
|
47 |
+
<div class="inside">
|
48 |
+
<div class="aam-postbox-inside">
|
49 |
+
<ul class="aam-error-list">
|
50 |
+
<?php foreach (AAM_Core_Console::getWarnings() as $message) { ?>
|
51 |
+
<li><?php echo $message; ?></li>
|
52 |
+
<?php } ?>
|
53 |
+
</ul>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
<?php } ?>
|
59 |
<div class="metabox-holder">
|
60 |
<?php do_action('aam-sidebar-ui-action', 'top'); ?>
|
61 |
|
62 |
<div class="postbox">
|
63 |
<h3 class="hndle">
|
64 |
+
<span><?php echo __('User/Role Panel', AAM_KEY); ?></span>
|
65 |
<span class="aam-help-menu" data-target="#user-role-manager-inside"><i class="icon-help-circled"></i></span>
|
66 |
</h3>
|
67 |
<div class="inside" id="user-role-manager-inside">
|
90 |
<div class="modal-content">
|
91 |
<div class="modal-header">
|
92 |
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
93 |
+
<h4 class="modal-title"><?php echo __('Create Role', AAM_KEY); ?></h4>
|
94 |
</div>
|
95 |
<div class="modal-body">
|
96 |
<div class="form-group">
|
98 |
<input type="text" class="form-control" id="new-role-name" placeholder="<?php echo __('Enter Role Name', AAM_KEY); ?>" />
|
99 |
</div>
|
100 |
<div class="form-group">
|
101 |
+
<label for="inherit-role-list"><?php echo __('Inherit Capabilities From', AAM_KEY); ?></label>
|
102 |
<select class="form-control" id="inherit-role-list">
|
103 |
<option value=""><?php echo __('Select Role', AAM_KEY); ?></option>
|
104 |
</select>
|
105 |
</div>
|
106 |
</div>
|
107 |
<div class="modal-footer">
|
108 |
+
<button type="button" class="btn btn-success" id="add-role-btn"><?php echo __('Create', AAM_KEY); ?></button>
|
109 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
|
110 |
</div>
|
111 |
</div>
|
117 |
<div class="modal-content">
|
118 |
<div class="modal-header">
|
119 |
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
120 |
+
<h4 class="modal-title"><?php echo __('Update Role', AAM_KEY); ?></h4>
|
121 |
</div>
|
122 |
<div class="modal-body">
|
123 |
<div class="form-group">
|
126 |
</div>
|
127 |
</div>
|
128 |
<div class="modal-footer">
|
129 |
+
<button type="button" class="btn btn-success" id="edit-role-btn"><?php echo __('Update', AAM_KEY); ?></button>
|
130 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
|
131 |
</div>
|
132 |
</div>
|
144 |
<p class="text-center aam-confirm-message" data-message="<?php echo __('Are you sure that you want to delete %s role?', AAM_KEY); ?>"></p>
|
145 |
</div>
|
146 |
<div class="modal-footer">
|
147 |
+
<button type="button" class="btn btn-danger" id="delete-role-btn"><?php echo __('Delete', AAM_KEY); ?></button>
|
148 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
|
149 |
</div>
|
150 |
</div>
|
152 |
</div>
|
153 |
|
154 |
<div class="modal fade" id="role-notification-modal" tabindex="-1" role="dialog">
|
155 |
+
<div class="modal-dialog modal-sm" role="document">
|
156 |
<div class="modal-content">
|
157 |
<div class="modal-header">
|
158 |
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
159 |
<h4 class="modal-title"><?php echo __('Notification', AAM_KEY); ?></h4>
|
160 |
</div>
|
161 |
<div class="modal-body">
|
162 |
+
<p class="text-larger"><?php echo __('You are not allowed to delete this role because either you do not have a capability to "delete_users" or there is at least one user assigned to it.', AAM_KEY); ?></p>
|
163 |
</div>
|
164 |
<div class="modal-footer">
|
165 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('OK', AAM_KEY); ?></button>
|
198 |
</div>
|
199 |
</div>
|
200 |
</div>
|
|
|
201 |
</div>
|
202 |
<div role="tabpanel" class="tab-pane" id="visitor">
|
203 |
<div class="visitor-message">
|
204 |
+
<span class="aam-bordered"><?php echo __('Manage access to your website for visitors (any user that is not authenticated)', AAM_KEY); ?>.</span>
|
205 |
<button class="btn btn-primary btn-block" id="manage-visitor"><i class="icon-cog"></i> <?php echo __('Manage Visitors', AAM_KEY); ?></button>
|
206 |
</div>
|
207 |
</div>
|
209 |
</div>
|
210 |
<div class="aam-help-context">
|
211 |
<p class="aam-info aam-hint">
|
212 |
+
<?php echo AAM_Backend_View_Helper::preparePhrase('Manage access for your users, roles and visitors. Be careful with [Administrator] role as well as your admin user. [Database backup is strongly recommended].', 'b', 'b'); ?>
|
213 |
</p>
|
214 |
|
215 |
<p class="text-justify">
|
216 |
+
<strong><i class="icon-users"></i> <?php echo __('Roles', AAM_KEY); ?></strong><br/>
|
217 |
+
<?php echo __('With Roles tab you can manage access for any defined role, edit role\'s name, create new role or even delete existing (but only when there is no users assigned to it). You are not allowed to delete Administrator role.', AAM_KEY); ?>
|
218 |
</p>
|
219 |
|
220 |
<p class="text-justify">
|
221 |
+
<strong><i class="icon-user"></i> <?php echo __('Users', AAM_KEY); ?></strong><br/>
|
222 |
<?php echo __('Manage access for any user. As a bonus feature, you can block user. It means that user will be not able to login to your website anymore.', AAM_KEY); ?>
|
223 |
</p>
|
224 |
|
225 |
<p class="text-justify">
|
226 |
+
<strong><i class="icon-user-secret"></i> <?php echo __('Visitor', AAM_KEY); ?></strong><br/>
|
227 |
<?php echo __('Visitor can be considered any user that is not authenticated to your website.', AAM_KEY); ?>
|
228 |
</p>
|
229 |
</div>
|
230 |
</div>
|
231 |
</div>
|
232 |
<?php do_action('aam-sidebar-ui-action', 'bottom'); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
</div>
|
234 |
</div>
|
235 |
</div>
|
Application/Backend/{view → phtml}/main-panel.phtml
RENAMED
File without changes
|
Application/Backend/phtml/object/capability.phtml
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if (defined('AAM_KEY')) { ?>
|
2 |
+
<div class="aam-feature" id="capability-content">
|
3 |
+
<?php $subject = AAM_Backend_View::getSubject(); ?>
|
4 |
+
<?php if ($subject->getUID() == 'user') { ?>
|
5 |
+
<div class="row">
|
6 |
+
<div class="col-xs-12">
|
7 |
+
<p class="aam-info">
|
8 |
+
<?php echo AAM_Backend_View_Helper::preparePhrase('You are not allowed to assign or create a new capability that does not belong to [' . implode(' or ', $this->getUserRoles($subject->roles)) . '] role. You may consider to creating a new role with desired list of capabilities and assign user to it.', 'strong'); ?>
|
9 |
+
</p>
|
10 |
+
</div>
|
11 |
+
</div>
|
12 |
+
<?php } ?>
|
13 |
+
<div class="aam-feature-top-actions text-right">
|
14 |
+
<div class="btn-group">
|
15 |
+
<a href="#" class="btn btn-xs btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="capability-filter">
|
16 |
+
<i class="icon-filter"></i> <?php echo __('Filter', AAM_KEY); ?> <span class="caret"></span>
|
17 |
+
</a>
|
18 |
+
<ul class="dropdown-menu" id="capability-groups" aria-labelledby="capability-filter">
|
19 |
+
<?php foreach ($this->getGroupList() as $group) { ?>
|
20 |
+
<li><a href="#"><?php echo $group; ?></a></li>
|
21 |
+
<?php } ?>
|
22 |
+
<li role="separator" class="divider"></li>
|
23 |
+
<li><a href="#" data-clear="true"><?php echo __('All Capabilities', AAM_KEY); ?></a></li>
|
24 |
+
</ul>
|
25 |
+
</div>
|
26 |
+
<a href="#" class="btn btn-xs btn-primary" id="add-capability"><i class="icon-plus"></i> <?php echo __('Create', AAM_KEY); ?></a>
|
27 |
+
</div>
|
28 |
+
|
29 |
+
<table id="capability-list" class="table table-striped table-bordered">
|
30 |
+
<thead>
|
31 |
+
<tr>
|
32 |
+
<th>ID</th>
|
33 |
+
<th width="30%"><?php echo __('Category', AAM_KEY); ?></th>
|
34 |
+
<th width="50%"><?php echo __('Capability', AAM_KEY); ?></th>
|
35 |
+
<th><?php echo __('Actions', AAM_KEY); ?></th>
|
36 |
+
</tr>
|
37 |
+
</thead>
|
38 |
+
<tbody></tbody>
|
39 |
+
</table>
|
40 |
+
|
41 |
+
<div class="modal fade" id="add-capability-modal" tabindex="-1" role="dialog">
|
42 |
+
<div class="modal-dialog modal-sm" role="document">
|
43 |
+
<div class="modal-content">
|
44 |
+
<div class="modal-header">
|
45 |
+
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
46 |
+
<h4 class="modal-title"><?php echo __('Create Capability', AAM_KEY); ?></h4>
|
47 |
+
</div>
|
48 |
+
<div class="modal-body">
|
49 |
+
<div class="form-group">
|
50 |
+
<label for="new-capability-name"><?php echo __('Capability', AAM_KEY); ?><span class="aam-asterix">*</span></label>
|
51 |
+
<input type="text" class="form-control" id="new-capability-name" placeholder="<?php echo __('Enter Capability', AAM_KEY); ?>" />
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
<div class="modal-footer">
|
55 |
+
<button type="button" class="btn btn-success" id="add-capability-btn"><?php echo __('Create', AAM_KEY); ?></button>
|
56 |
+
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
|
62 |
+
<div class="modal fade" id="edit-capability-modal" tabindex="-1" role="dialog">
|
63 |
+
<div class="modal-dialog modal-sm" role="document">
|
64 |
+
<div class="modal-content">
|
65 |
+
<div class="modal-header">
|
66 |
+
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
67 |
+
<h4 class="modal-title"><?php echo __('Update Capability', AAM_KEY); ?></h4>
|
68 |
+
</div>
|
69 |
+
<div class="modal-body">
|
70 |
+
<div class="form-group">
|
71 |
+
<label for="capability-id"><?php echo __('Capability', AAM_KEY); ?><span class="aam-asterix">*</span></label>
|
72 |
+
<input type="text" class="form-control" id="capability-id" placeholder="<?php echo __('Enter Capability', AAM_KEY); ?>" />
|
73 |
+
</div>
|
74 |
+
<p class="aam-info aam-hint"><?php echo AAM_Backend_View_Helper::preparePhrase(__('[Please notice!] Capability will be updated for all roles. Any functionality that depends on current Capability may not work properly.', AAM_KEY), 'strong'); ?></p>
|
75 |
+
</div>
|
76 |
+
<div class="modal-footer">
|
77 |
+
<button type="button" class="btn btn-warning" id="update-capability-btn"><?php echo __('Update', AAM_KEY); ?></button>
|
78 |
+
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
|
84 |
+
<div class="modal fade" id="delete-capability-modal" tabindex="-1" role="dialog">
|
85 |
+
<div class="modal-dialog modal-sm" role="document">
|
86 |
+
<div class="modal-content">
|
87 |
+
<div class="modal-header">
|
88 |
+
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
89 |
+
<h4 class="modal-title"><?php echo __('Delete Capability', AAM_KEY); ?></h4>
|
90 |
+
</div>
|
91 |
+
<div class="modal-body">
|
92 |
+
<p class="text-center aam-confirm-message" data-message="<?php echo __('Are you sure that you want to delete %s capability for all roles?', AAM_KEY); ?>"></p>
|
93 |
+
</div>
|
94 |
+
<div class="modal-footer">
|
95 |
+
<button type="button" class="btn btn-danger" id="delete-capability-btn"><?php echo __('Delete', AAM_KEY); ?></button>
|
96 |
+
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
</div>
|
100 |
+
</div>
|
101 |
+
|
102 |
+
</div>
|
103 |
+
<?php
|
104 |
+
}
|
Application/Backend/{view → phtml}/object/menu.phtml
RENAMED
@@ -11,20 +11,21 @@
|
|
11 |
|
12 |
<div class="panel-group" id="admin-menu" role="tablist" aria-multiselectable="true">
|
13 |
<?php
|
|
|
14 |
$object = AAM_Backend_View::getSubject()->getObject('menu');
|
15 |
foreach ($this->getMenu() as $i => $menu) {
|
16 |
?>
|
17 |
<div class="panel panel-default">
|
18 |
<div class="panel-heading" role="tab" id="menu-<?php echo $i; ?>-heading">
|
19 |
<h4 class="panel-title">
|
20 |
-
<a role="button" data-toggle="collapse" data-parent="#admin-menu" href="#menu-<?php echo $i; ?>" aria-controls="menu-<?php echo $i; ?>"
|
21 |
<?php echo $menu['name']; ?> <small class="aam-menu-capability"><?php echo $menu['capability']; ?></small>
|
22 |
</a>
|
23 |
<?php echo ($object->has($menu['id']) ? '<i class="aam-panel-title-icon icon-eye-off text-danger"></i>' : ''); ?>
|
24 |
</h4>
|
25 |
</div>
|
26 |
|
27 |
-
<div id="menu-<?php echo $i; ?>" class="panel-collapse collapse" role="tabpanel" aria-labelledby="menu-<?php echo $i; ?>-heading">
|
28 |
<div class="panel-body">
|
29 |
<?php if (!empty($menu['submenu'])) { ?>
|
30 |
<div class="row aam-bordered">
|
@@ -47,7 +48,7 @@
|
|
47 |
</a>
|
48 |
<?php } else { ?>
|
49 |
<a href="#" class="btn btn-danger btn-sm btn-block aam-restrict-menu" data-menu-id="<?php echo $menu['id']; ?>" data-target="#menu-<?php echo $i; ?>">
|
50 |
-
<i class="icon-eye-off"></i> <?php echo __('
|
51 |
</a>
|
52 |
<?php } ?>
|
53 |
</div>
|
11 |
|
12 |
<div class="panel-group" id="admin-menu" role="tablist" aria-multiselectable="true">
|
13 |
<?php
|
14 |
+
$first = false;
|
15 |
$object = AAM_Backend_View::getSubject()->getObject('menu');
|
16 |
foreach ($this->getMenu() as $i => $menu) {
|
17 |
?>
|
18 |
<div class="panel panel-default">
|
19 |
<div class="panel-heading" role="tab" id="menu-<?php echo $i; ?>-heading">
|
20 |
<h4 class="panel-title">
|
21 |
+
<a role="button" data-toggle="collapse" data-parent="#admin-menu" href="#menu-<?php echo $i; ?>" aria-controls="menu-<?php echo $i; ?>" <?php if (!$first) { echo 'aria-expanded="true"'; } ?>>
|
22 |
<?php echo $menu['name']; ?> <small class="aam-menu-capability"><?php echo $menu['capability']; ?></small>
|
23 |
</a>
|
24 |
<?php echo ($object->has($menu['id']) ? '<i class="aam-panel-title-icon icon-eye-off text-danger"></i>' : ''); ?>
|
25 |
</h4>
|
26 |
</div>
|
27 |
|
28 |
+
<div id="menu-<?php echo $i; ?>" class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>" role="tabpanel" aria-labelledby="menu-<?php echo $i; ?>-heading">
|
29 |
<div class="panel-body">
|
30 |
<?php if (!empty($menu['submenu'])) { ?>
|
31 |
<div class="row aam-bordered">
|
48 |
</a>
|
49 |
<?php } else { ?>
|
50 |
<a href="#" class="btn btn-danger btn-sm btn-block aam-restrict-menu" data-menu-id="<?php echo $menu['id']; ?>" data-target="#menu-<?php echo $i; ?>">
|
51 |
+
<i class="icon-eye-off"></i> <?php echo __('Restrict Menu', AAM_KEY); ?>
|
52 |
</a>
|
53 |
<?php } ?>
|
54 |
</div>
|
Application/Backend/{view → phtml}/object/metabox.phtml
RENAMED
@@ -13,8 +13,13 @@
|
|
13 |
<a href="#" class="btn btn-xs btn-primary" id="refresh-metabox-list"><i class="icon-arrows-cw"></i> <?php echo __('Refresh', AAM_KEY); ?></a>
|
14 |
</div>
|
15 |
|
16 |
-
<?php
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
<?php if (!empty($metaboxList)) { ?>
|
20 |
<div class="panel-group" id="metabox-list" role="tablist">
|
@@ -22,7 +27,7 @@
|
|
22 |
<div class="panel panel-default">
|
23 |
<div class="panel-heading" role="tab" id="group-<?php echo $screen; ?>-heading">
|
24 |
<h4 class="panel-title">
|
25 |
-
<a role="button" data-toggle="collapse" data-parent="#metabox-list" href="#group-<?php echo $screen; ?>" aria-controls="group-<?php echo $screen; ?>"
|
26 |
<?php
|
27 |
switch ($screen) {
|
28 |
case 'dashboard':
|
@@ -41,7 +46,7 @@
|
|
41 |
</a>
|
42 |
</h4>
|
43 |
</div>
|
44 |
-
<div id="group-<?php echo $screen; ?>" class="panel-collapse collapse" role="tabpanel" aria-labelledby="group-<?php echo $screen; ?>-heading">
|
45 |
<div class="panel-body">
|
46 |
<div class="row aam-bordered">
|
47 |
<?php foreach ($metaboxes as $metabox) { ?>
|
13 |
<a href="#" class="btn btn-xs btn-primary" id="refresh-metabox-list"><i class="icon-arrows-cw"></i> <?php echo __('Refresh', AAM_KEY); ?></a>
|
14 |
</div>
|
15 |
|
16 |
+
<?php
|
17 |
+
global $wp_post_types;
|
18 |
+
|
19 |
+
$first = false;
|
20 |
+
$object = AAM_Backend_View::getSubject()->getObject('metabox');
|
21 |
+
$metaboxList = $this->getMetaboxList();
|
22 |
+
?>
|
23 |
|
24 |
<?php if (!empty($metaboxList)) { ?>
|
25 |
<div class="panel-group" id="metabox-list" role="tablist">
|
27 |
<div class="panel panel-default">
|
28 |
<div class="panel-heading" role="tab" id="group-<?php echo $screen; ?>-heading">
|
29 |
<h4 class="panel-title">
|
30 |
+
<a role="button" data-toggle="collapse" data-parent="#metabox-list" href="#group-<?php echo $screen; ?>" aria-controls="group-<?php echo $screen; ?>" <?php if (!$first) { echo 'aria-expanded="true"'; } ?>>
|
31 |
<?php
|
32 |
switch ($screen) {
|
33 |
case 'dashboard':
|
46 |
</a>
|
47 |
</h4>
|
48 |
</div>
|
49 |
+
<div id="group-<?php echo $screen; ?>" class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>" role="tabpanel" aria-labelledby="group-<?php echo $screen; ?>-heading">
|
50 |
<div class="panel-body">
|
51 |
<div class="row aam-bordered">
|
52 |
<?php foreach ($metaboxes as $metabox) { ?>
|
Application/Backend/{view → phtml}/object/post.phtml
RENAMED
@@ -4,7 +4,7 @@
|
|
4 |
<div class="row">
|
5 |
<div class="col-xs-12">
|
6 |
<p class="aam-info">
|
7 |
-
<?php echo
|
8 |
</p>
|
9 |
</div>
|
10 |
</div>
|
@@ -15,13 +15,13 @@
|
|
15 |
</div>
|
16 |
|
17 |
<div class="aam-overwrite hidden" id="post-overwritten">
|
18 |
-
<span><i class="icon-attention-circled"></i> <?php echo __('Settings
|
19 |
-
<span><a href="#" id="post-reset"><?php echo __('Reset', AAM_KEY); ?></a
|
20 |
</div>
|
21 |
|
22 |
<div class="aam-inherited hidden" id="post-inherited">
|
23 |
<span><?php echo __('Settings inherited from', AAM_KEY); ?> <strong id="post-parent"></strong></span>
|
24 |
-
<span
|
25 |
</div>
|
26 |
|
27 |
<div class="aam-container">
|
@@ -154,52 +154,5 @@
|
|
154 |
<a href="#" class="btn btn-xs btn-primary post-back">≪ <?php echo __('Go Back', AAM_KEY); ?></a>
|
155 |
</div>
|
156 |
</div>
|
157 |
-
|
158 |
-
<div class="modal fade" id="aam-inheritance-modal" tabindex="-1" role="dialog">
|
159 |
-
<div class="modal-dialog" role="document">
|
160 |
-
<div class="modal-content">
|
161 |
-
<div class="modal-header">
|
162 |
-
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
163 |
-
<h4 class="modal-title"><?php echo __('Inheritance', AAM_KEY); ?></h4>
|
164 |
-
</div>
|
165 |
-
<div class="modal-body aam-info-modal">
|
166 |
-
<p><?php echo __('If no access settings defined for post* or category* AAM triggers the inheritance mechanism in order listed below. The inheritance process terminates when the first defined set of settings is found.', AAM_KEY); ?></p>
|
167 |
-
<ul class="aam-numeric-list">
|
168 |
-
<li><?php echo __('If caching is on, read the cached settings', AAM_KEY); ?>;</li>
|
169 |
-
<li><?php echo __('Read post\'s or category\'s settings', AAM_KEY); ?>;</li>
|
170 |
-
<li><?php echo __('If AAM Plus Package installed, iterate through the tree of parent categories and read settings', AAM_KEY); ?>;</li>
|
171 |
-
<li><?php echo __('If AAM Plus Package installed, read the default access settings for posts or categories', AAM_KEY); ?>;</li>
|
172 |
-
<li><?php echo __('If user, read settings from the parent role and repeat the same sequence of steps', AAM_KEY); ?>;</li>
|
173 |
-
</ul>
|
174 |
-
|
175 |
-
<p class="aam-info aam-hint">
|
176 |
-
* <?php echo AAM_Backend_Helper::preparePhrase('[post] - any post, page or custom post type', 'strong'); ?>;<br/>
|
177 |
-
* <?php echo AAM_Backend_Helper::preparePhrase('[category] - any taxonomy/term or custom taxonomy', 'strong'); ?>.
|
178 |
-
</p>
|
179 |
-
</div>
|
180 |
-
<div class="modal-footer">
|
181 |
-
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('OK', AAM_KEY); ?></button>
|
182 |
-
</div>
|
183 |
-
</div>
|
184 |
-
</div>
|
185 |
-
</div>
|
186 |
-
|
187 |
-
<div class="modal fade" id="aam-reset-info-modal" tabindex="-1" role="dialog">
|
188 |
-
<div class="modal-dialog" role="document">
|
189 |
-
<div class="modal-content">
|
190 |
-
<div class="modal-header">
|
191 |
-
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
192 |
-
<h4 class="modal-title"><?php echo __('Reset Information', AAM_KEY); ?></h4>
|
193 |
-
</div>
|
194 |
-
<div class="modal-body aam-info-modal">
|
195 |
-
<p><?php echo AAM_Backend_Helper::preparePhrase('[Settings may not be inherited] message indicates that access settings for current post or category are not inherited from parent category, role or default settings because they were modified for this particular post or category. Click [Reset] if you need to reset the access.', 'strong', 'strong'); ?></p>
|
196 |
-
</div>
|
197 |
-
<div class="modal-footer">
|
198 |
-
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('OK', AAM_KEY); ?></button>
|
199 |
-
</div>
|
200 |
-
</div>
|
201 |
-
</div>
|
202 |
-
</div>
|
203 |
</div>
|
204 |
-
<?php
|
205 |
-
}
|
4 |
<div class="row">
|
5 |
<div class="col-xs-12">
|
6 |
<p class="aam-info">
|
7 |
+
<?php echo AAM_Backend_View_Helper::preparePhrase('You are allowed to manage access up to 10 posts, pages or custom post types. Consider to purchase [AAM Plus Package] extension to unlock this limitation.', 'b'); ?>
|
8 |
</p>
|
9 |
</div>
|
10 |
</div>
|
15 |
</div>
|
16 |
|
17 |
<div class="aam-overwrite hidden" id="post-overwritten">
|
18 |
+
<span><i class="icon-attention-circled"></i> <?php echo __('Settings are overwritten', AAM_KEY); ?></span>
|
19 |
+
<span><a href="#" id="post-reset"><?php echo __('Reset', AAM_KEY); ?></a></span>
|
20 |
</div>
|
21 |
|
22 |
<div class="aam-inherited hidden" id="post-inherited">
|
23 |
<span><?php echo __('Settings inherited from', AAM_KEY); ?> <strong id="post-parent"></strong></span>
|
24 |
+
<span></span>
|
25 |
</div>
|
26 |
|
27 |
<div class="aam-container">
|
154 |
<a href="#" class="btn btn-xs btn-primary post-back">≪ <?php echo __('Go Back', AAM_KEY); ?></a>
|
155 |
</div>
|
156 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
</div>
|
158 |
+
<?php }
|
|
Application/Backend/phtml/partial/post-type.phtml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if (defined('AAM_KEY')) { ?>
|
2 |
+
<div class="row">
|
3 |
+
<div class="col-xs-12">
|
4 |
+
<p class="aam-info">
|
5 |
+
<?php echo AAM_Backend_View_Helper::preparePhrase('Define the default access to your posts, pages, custom post types or categories. This feature is available only with [AAM Plus Package] extension. But you can still manage access to individual posts, pages or custom post types. Consider to purchase [AAM Plus Package] extension.', 'b', 'b'); ?>
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<img src="http://vasyltech.com/img/aam-default-access-form.jpg" class="img-responsive" />
|
9 |
+
</div>
|
10 |
+
</div>
|
11 |
+
<?php
|
12 |
+
}
|
Application/Backend/phtml/partial/term-type.phtml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if (defined('AAM_KEY')) { ?>
|
2 |
+
<div class="row">
|
3 |
+
<div class="col-xs-12">
|
4 |
+
<p class="aam-info">
|
5 |
+
<?php echo AAM_Backend_View_Helper::preparePhrase('Managing default access to categories (terms) is available in [AAM Plus Package] only. But you can still manage access to individual posts, pages or custom post types. Consider to purchase [AAM Plus Package] extension.', 'b', 'b'); ?>
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<img src="http://vasyltech.com/img/aam-term-access-form.jpg" class="img-responsive" />
|
9 |
+
</div>
|
10 |
+
</div>
|
11 |
+
<?php
|
12 |
+
}
|
Application/Backend/phtml/utility.phtml
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="aam-feature" id="utilities-content">
|
2 |
+
<table class="table table-striped table-bordered">
|
3 |
+
<tbody>
|
4 |
+
<tr>
|
5 |
+
<td>
|
6 |
+
<span class='aam-setting-title'><?php echo __('Edit/Delete Capabilities', AAM_KEY); ?></span>
|
7 |
+
<p class="aam-setting-description">
|
8 |
+
<?php echo AAM_Backend_View_Helper::preparePhrase('[Please notice!] This feature should be used only by experienced users. Toggle an ability to edit or delete capabilities. [Since AAM v3.0.6]', 'strong', 'small'); ?>
|
9 |
+
</p>
|
10 |
+
</td>
|
11 |
+
<td>
|
12 |
+
<input data-toggle="toggle" data-on="<?php echo __('Enabled', AAM_KEY); ?>" data-off="<?php echo __('Disabled', AAM_KEY); ?>" type="checkbox" name="manage-capability" <?php echo (AAM_Core_Config::get('manage-capability', false) ? 'checked' : ''); ?> />
|
13 |
+
</td>
|
14 |
+
</tr>
|
15 |
+
<tr>
|
16 |
+
<td>
|
17 |
+
<span class='aam-setting-title'><?php echo __('Backend Access Control', AAM_KEY); ?></span>
|
18 |
+
<p class="aam-setting-description">
|
19 |
+
<?php echo AAM_Backend_View_Helper::preparePhrase('Use AAM to control access to posts, pages, categories, menus and metaboxes etc. Disable this setting to stop AAM from controling access for backend. [Since AAM v3.1]', 'small'); ?>
|
20 |
+
</p>
|
21 |
+
</td>
|
22 |
+
<td>
|
23 |
+
<input data-toggle="toggle" data-on="<?php echo __('Enabled', AAM_KEY); ?>" data-off="<?php echo __('Disabled', AAM_KEY); ?>" type="checkbox" name="backend-access-control" <?php echo (AAM_Core_Config::get('backend-access-control', true) ? 'checked' : ''); ?> />
|
24 |
+
</td>
|
25 |
+
</tr>
|
26 |
+
<tr>
|
27 |
+
<td>
|
28 |
+
<span class='aam-setting-title'><?php echo __('Frontend Access Control', AAM_KEY); ?></span>
|
29 |
+
<p class="aam-setting-description">
|
30 |
+
<?php echo AAM_Backend_View_Helper::preparePhrase('Use AAM to control access to posts, pages, categories, menus and widgets. Disable this setting to stop AAM from controling access for frontend. [Since AAM v3.1]', 'small'); ?>
|
31 |
+
</p>
|
32 |
+
</td>
|
33 |
+
<td>
|
34 |
+
<input data-toggle="toggle" data-on="<?php echo __('Enabled', AAM_KEY); ?>" data-off="<?php echo __('Disabled', AAM_KEY); ?>" type="checkbox" name="frontend-access-control" <?php echo (AAM_Core_Config::get('frontend-access-control', true) ? 'checked' : ''); ?> />
|
35 |
+
</td>
|
36 |
+
</tr>
|
37 |
+
<?php do_action('aam-utilities-setting'); ?>
|
38 |
+
<tr>
|
39 |
+
<td>
|
40 |
+
<span class='aam-setting-title'><?php echo __('Clear All Settings', AAM_KEY); ?></span>
|
41 |
+
<p class="aam-setting-description">
|
42 |
+
<?php echo __('Remove all the settings related to AAM (including all extension licenses).', AAM_KEY); ?>
|
43 |
+
</p>
|
44 |
+
</td>
|
45 |
+
<td>
|
46 |
+
<a href="#clear-settings-modal" data-toggle="modal" class="btn btn-danger btn-block">Clear Settings</a>
|
47 |
+
</td>
|
48 |
+
</tr>
|
49 |
+
</tbody>
|
50 |
+
</table>
|
51 |
+
|
52 |
+
<div class="modal fade" id="clear-settings-modal" tabindex="-1" role="dialog">
|
53 |
+
<div class="modal-dialog modal-sm" role="document">
|
54 |
+
<div class="modal-content">
|
55 |
+
<div class="modal-header">
|
56 |
+
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
57 |
+
<h4 class="modal-title"><?php echo __('Clear All Settings', AAM_KEY); ?></h4>
|
58 |
+
</div>
|
59 |
+
<div class="modal-body">
|
60 |
+
<p class="text-center text-larger"><?php echo __('All settings related to AAM will be removed. Please confirm your action.', AAM_KEY); ?></p>
|
61 |
+
</div>
|
62 |
+
<div class="modal-footer">
|
63 |
+
<button type="button" class="btn btn-danger" id="clear-settings"><?php echo __('Clear', AAM_KEY); ?></button>
|
64 |
+
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Cancel', AAM_KEY); ?></button>
|
65 |
+
</div>
|
66 |
+
</div>
|
67 |
+
</div>
|
68 |
+
</div>
|
69 |
+
</div>
|
Application/Backend/view/object/capability.phtml
DELETED
@@ -1,60 +0,0 @@
|
|
1 |
-
<?php if (defined('AAM_KEY')) { ?>
|
2 |
-
<div class="aam-feature" id="capability-content">
|
3 |
-
<div class="row aam-user-note hidden">
|
4 |
-
<div class="col-xs-12">
|
5 |
-
<p class="aam-info">
|
6 |
-
<?php echo AAM_Backend_Helper::preparePhrase('[Please notice!] You are not allowed to assign or create a new capability that does not belong to user\'s role. Consider creating a new role with desired list of capabilities and then assign that role to user.', 'strong'); ?>
|
7 |
-
</p>
|
8 |
-
</div>
|
9 |
-
</div>
|
10 |
-
<div class="aam-feature-top-actions text-right">
|
11 |
-
<div class="btn-group">
|
12 |
-
<a href="#" class="btn btn-xs btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="capability-filter">
|
13 |
-
<i class="icon-filter"></i> <?php echo __('Filter', AAM_KEY); ?> <span class="caret"></span>
|
14 |
-
</a>
|
15 |
-
<ul class="dropdown-menu" id="capability-groups" aria-labelledby="capability-filter">
|
16 |
-
<?php foreach ($this->getGroupList() as $group) { ?>
|
17 |
-
<li><a href="#"><?php echo $group; ?></a></li>
|
18 |
-
<?php } ?>
|
19 |
-
<li role="separator" class="divider"></li>
|
20 |
-
<li><a href="#" data-clear="true"><?php echo __('All Capabilities', AAM_KEY); ?></a></li>
|
21 |
-
</ul>
|
22 |
-
</div>
|
23 |
-
<a href="#" class="btn btn-xs btn-primary" id="add-capability"><i class="icon-plus"></i> <?php echo __('Create', AAM_KEY); ?></a>
|
24 |
-
</div>
|
25 |
-
|
26 |
-
<table id="capability-list" class="table table-striped table-bordered">
|
27 |
-
<thead>
|
28 |
-
<tr>
|
29 |
-
<th>ID</th>
|
30 |
-
<th width="30%"><?php echo __('Category', AAM_KEY); ?></th>
|
31 |
-
<th width="50%"><?php echo __('Capability', AAM_KEY); ?></th>
|
32 |
-
<th><?php echo __('Actions', AAM_KEY); ?></th>
|
33 |
-
</tr>
|
34 |
-
</thead>
|
35 |
-
<tbody></tbody>
|
36 |
-
</table>
|
37 |
-
|
38 |
-
<div class="modal fade" id="add-capability-modal" tabindex="-1" role="dialog">
|
39 |
-
<div class="modal-dialog modal-sm" role="document">
|
40 |
-
<div class="modal-content">
|
41 |
-
<div class="modal-header">
|
42 |
-
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
43 |
-
<h4 class="modal-title"><?php echo __('Add New Capability', AAM_KEY); ?></h4>
|
44 |
-
</div>
|
45 |
-
<div class="modal-body">
|
46 |
-
<div class="form-group">
|
47 |
-
<label for="new-capability-name"><?php echo __('Capability Name', AAM_KEY); ?><span class="aam-asterix">*</span></label>
|
48 |
-
<input type="text" class="form-control" id="new-capability-name" placeholder="<?php echo __('Enter Capability', AAM_KEY); ?>" />
|
49 |
-
</div>
|
50 |
-
</div>
|
51 |
-
<div class="modal-footer">
|
52 |
-
<button type="button" class="btn btn-success" id="add-capability-btn"><?php echo __('Add Capability', AAM_KEY); ?></button>
|
53 |
-
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
|
54 |
-
</div>
|
55 |
-
</div>
|
56 |
-
</div>
|
57 |
-
</div>
|
58 |
-
</div>
|
59 |
-
<?php
|
60 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Application/Backend/view/partial/post-type.phtml
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php if (defined('AAM_KEY')) { ?>
|
2 |
-
<div class="row">
|
3 |
-
<div class="col-xs-12">
|
4 |
-
<p class="aam-info">
|
5 |
-
<?php echo AAM_Backend_Helper::preparePhrase('Define the default access to your posts, pages, custom post types or categories. This feature is available only with [AAM Plus Package] extension. But you can still manage access to individual posts, pages or custom post types. Consider to purchase [AAM Plus Package] extension.', 'b', 'b'); ?>
|
6 |
-
</p>
|
7 |
-
|
8 |
-
<img src="http://vasyltech.com/img/aam-default-access-form.jpg" class="img-responsive" />
|
9 |
-
</div>
|
10 |
-
</div>
|
11 |
-
<?php
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Application/Backend/view/partial/term-type.phtml
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php if (defined('AAM_KEY')) { ?>
|
2 |
-
<div class="row">
|
3 |
-
<div class="col-xs-12">
|
4 |
-
<p class="aam-info">
|
5 |
-
<?php echo AAM_Backend_Helper::preparePhrase('Managing default access to categories (terms) is available in [AAM Plus Package] only. But you can still manage access to individual posts, pages or custom post types. Consider to purchase [AAM Plus Package] extension.', 'b', 'b'); ?>
|
6 |
-
</p>
|
7 |
-
|
8 |
-
<img src="http://vasyltech.com/img/aam-term-access-form.jpg" class="img-responsive" />
|
9 |
-
</div>
|
10 |
-
</div>
|
11 |
-
<?php
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Application/Core/API.php
CHANGED
@@ -195,8 +195,8 @@ final class AAM_Core_API {
|
|
195 |
* @access public
|
196 |
*/
|
197 |
public static function reject($area = 'frontend', $callback = null) {
|
198 |
-
$redirect =
|
199 |
-
$message =
|
200 |
"{$area}.access.deny.message", __('Access Denied', AAM_KEY)
|
201 |
);
|
202 |
|
195 |
* @access public
|
196 |
*/
|
197 |
public static function reject($area = 'frontend', $callback = null) {
|
198 |
+
$redirect = AAM_Core_Config::get("{$area}.access.deny.redirect");
|
199 |
+
$message = AAM_Core_Config::get(
|
200 |
"{$area}.access.deny.message", __('Access Denied', AAM_KEY)
|
201 |
);
|
202 |
|
Application/Core/Cache.php
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ======================================================================
|
5 |
+
* LICENSE: This file is subject to the terms and conditions defined in *
|
6 |
+
* file 'license.txt', which is part of this source code package. *
|
7 |
+
* ======================================================================
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* AAM Core Cache
|
12 |
+
*
|
13 |
+
* @package AAM
|
14 |
+
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
+
*/
|
16 |
+
class AAM_Core_Cache {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* DB Cache option
|
20 |
+
*/
|
21 |
+
const CACHE_OPTION = 'cache';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Core config
|
25 |
+
*
|
26 |
+
* @var array
|
27 |
+
*
|
28 |
+
* @access protected
|
29 |
+
*/
|
30 |
+
protected static $cache = false;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Update cache flag
|
34 |
+
*
|
35 |
+
* @var boolean
|
36 |
+
*
|
37 |
+
* @access protected
|
38 |
+
*/
|
39 |
+
protected static $updated = false;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Get cached option
|
43 |
+
*
|
44 |
+
* @param string $option
|
45 |
+
*
|
46 |
+
* @return mixed
|
47 |
+
*
|
48 |
+
* @access public
|
49 |
+
*/
|
50 |
+
public static function get($option) {
|
51 |
+
return (isset(self::$cache[$option]) ? self::$cache[$option] : null);
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Set cache option
|
56 |
+
*
|
57 |
+
* @param string $option
|
58 |
+
* @param mixed $data
|
59 |
+
*
|
60 |
+
* @return void
|
61 |
+
*
|
62 |
+
* @access public
|
63 |
+
*/
|
64 |
+
public static function set($option, $data) {
|
65 |
+
if (!isset(self::$cache[$option]) || self::$cache[$option] != $data) {
|
66 |
+
self::$cache[$option] = $data;
|
67 |
+
self::$updated = true;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Clear cache
|
73 |
+
*
|
74 |
+
* @return void
|
75 |
+
*
|
76 |
+
* @access public
|
77 |
+
* @global WPDB $wpdb
|
78 |
+
*/
|
79 |
+
public static function clear() {
|
80 |
+
global $wpdb;
|
81 |
+
|
82 |
+
//clear wp_options
|
83 |
+
$oquery = "DELETE FROM {$wpdb->options} WHERE `option_name` LIKE %s";
|
84 |
+
$wpdb->query($wpdb->prepare($oquery, 'aam_cache%' ));
|
85 |
+
|
86 |
+
//clear wp_usermeta
|
87 |
+
$uquery = "DELETE FROM {$wpdb->usermeta} WHERE `meta_key` LIKE %s";
|
88 |
+
$wpdb->query($wpdb->prepare($uquery, 'aam_cache%' ));
|
89 |
+
|
90 |
+
$mquery = "DELETE FROM {$wpdb->usermeta} WHERE `meta_key` LIKE %s";
|
91 |
+
$wpdb->query($wpdb->prepare($mquery, $wpdb->prefix . 'aam_cache%' ));
|
92 |
+
|
93 |
+
//clear updated flag
|
94 |
+
self::$updated = false;
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Save cache
|
99 |
+
*
|
100 |
+
* Save aam cache but only if changes deleted
|
101 |
+
*
|
102 |
+
* @return void
|
103 |
+
*
|
104 |
+
* @access public
|
105 |
+
*/
|
106 |
+
public static function save() {
|
107 |
+
if (self::$updated) {
|
108 |
+
AAM::getUser()->updateOption(self::$cache, self::CACHE_OPTION);
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Bootstrap cache
|
114 |
+
*
|
115 |
+
* Do not load cache if user is on AAM page
|
116 |
+
*
|
117 |
+
* @return void
|
118 |
+
*
|
119 |
+
* @access public
|
120 |
+
*/
|
121 |
+
public static function bootstrap() {
|
122 |
+
if (!AAM::isAAM()) {
|
123 |
+
self::$cache = AAM::getUser()->readOption(self::CACHE_OPTION);
|
124 |
+
add_action('shutdown', 'AAM_Core_Cache::save');
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
}
|
Application/Core/Config.php
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ======================================================================
|
5 |
+
* LICENSE: This file is subject to the terms and conditions defined in *
|
6 |
+
* file 'license.txt', which is part of this source code package. *
|
7 |
+
* ======================================================================
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* AAM Core Config
|
12 |
+
*
|
13 |
+
* @package AAM
|
14 |
+
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
+
*/
|
16 |
+
class AAM_Core_Config {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Core settings database option
|
20 |
+
*
|
21 |
+
* aam-utilities slug is used because AAM Utilities with v3.4 became a core
|
22 |
+
* feature instead of independent extension.
|
23 |
+
*/
|
24 |
+
const CONFIG_OPTION = 'aam-utilities';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Core config
|
28 |
+
*
|
29 |
+
* @var array
|
30 |
+
*
|
31 |
+
* @access protected
|
32 |
+
*/
|
33 |
+
protected static $config = array();
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Load core AAM settings
|
37 |
+
*
|
38 |
+
* @return void
|
39 |
+
*
|
40 |
+
* @access public
|
41 |
+
*/
|
42 |
+
public static function bootstrap() {
|
43 |
+
self::$config = AAM_Core_API::getOption(self::CONFIG_OPTION, array());
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Get config option
|
48 |
+
*
|
49 |
+
* @param string $option
|
50 |
+
* @param mixed $default
|
51 |
+
*
|
52 |
+
* @return mixed
|
53 |
+
*
|
54 |
+
* @access public
|
55 |
+
* @static
|
56 |
+
*/
|
57 |
+
public static function get($option, $default = null) {
|
58 |
+
if (isset(self::$config[$option])) {
|
59 |
+
$value = self::$config[$option];
|
60 |
+
} else { //try to get option from ConfigPress
|
61 |
+
$value = self::readConfigPress($option, $default);
|
62 |
+
}
|
63 |
+
|
64 |
+
return $value;
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Set config
|
69 |
+
*
|
70 |
+
* @param string $option
|
71 |
+
* @param mixed $value
|
72 |
+
*
|
73 |
+
* @return boolean
|
74 |
+
*
|
75 |
+
* @access public
|
76 |
+
*/
|
77 |
+
public static function set($option, $value) {
|
78 |
+
self::$config[$option] = $value;
|
79 |
+
|
80 |
+
//save config to database
|
81 |
+
return AAM_Core_API::updateOption(self::CONFIG_OPTION, self::$config);
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Get ConfigPress parameter
|
86 |
+
*
|
87 |
+
* @param string $param
|
88 |
+
* @param mixed $default
|
89 |
+
*
|
90 |
+
* @return mixed
|
91 |
+
*
|
92 |
+
* @access public
|
93 |
+
* @static
|
94 |
+
*/
|
95 |
+
protected static function readConfigPress($param, $default = null) {
|
96 |
+
if (class_exists('ConfigPress')) {
|
97 |
+
$config = ConfigPress::get('aam.' . $param, $default);
|
98 |
+
} else {
|
99 |
+
$config = $default;
|
100 |
+
}
|
101 |
+
|
102 |
+
if (is_array($config) && isset($config['userFunc'])) {
|
103 |
+
if (is_callable($config['userFunc'])) {
|
104 |
+
$response = call_user_func($config['userFunc']);
|
105 |
+
} else {
|
106 |
+
$response = $default;
|
107 |
+
}
|
108 |
+
} else {
|
109 |
+
$response = $config;
|
110 |
+
}
|
111 |
+
|
112 |
+
return $response;
|
113 |
+
}
|
114 |
+
|
115 |
+
}
|
Application/Core/ConfigPress.php
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* ======================================================================
|
5 |
-
* LICENSE: This file is subject to the terms and conditions defined in *
|
6 |
-
* file 'license.txt', which is part of this source code package. *
|
7 |
-
* ======================================================================
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* ConfigPress layer
|
12 |
-
*
|
13 |
-
* @package AAM
|
14 |
-
* @author Vasyl Martyniuk <vasyl@vasyltech.com>
|
15 |
-
*/
|
16 |
-
final class AAM_Core_ConfigPress {
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Get ConfigPress parameter
|
20 |
-
*
|
21 |
-
* @param string $param
|
22 |
-
* @param mixed $default
|
23 |
-
*
|
24 |
-
* @return mixed
|
25 |
-
*
|
26 |
-
* @access public
|
27 |
-
* @static
|
28 |
-
*/
|
29 |
-
public static function get($param, $default = null) {
|
30 |
-
if (class_exists('ConfigPress')) {
|
31 |
-
$response = ConfigPress::get($param, $default);
|
32 |
-
} else {
|
33 |
-
$response = $default;
|
34 |
-
}
|
35 |
-
|
36 |
-
return self::parseParam($response, $default);
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Parse found parameter
|
41 |
-
*
|
42 |
-
* @param mixed $param
|
43 |
-
* @param mixed $default
|
44 |
-
*
|
45 |
-
* @return mixed
|
46 |
-
*
|
47 |
-
* @access protected
|
48 |
-
* @static
|
49 |
-
*/
|
50 |
-
protected static function parseParam($param, $default) {
|
51 |
-
if (is_array($param) && isset($param['userFunc'])) {
|
52 |
-
if (is_callable($param['userFunc'])) {
|
53 |
-
$response = call_user_func($param['userFunc']);
|
54 |
-
} else {
|
55 |
-
$response = $default;
|
56 |
-
}
|
57 |
-
} else {
|
58 |
-
$response = $param;
|
59 |
-
}
|
60 |
-
|
61 |
-
return $response;
|
62 |
-
}
|
63 |
-
|
64 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Application/Core/Object/Post.php
CHANGED
@@ -60,11 +60,11 @@ class AAM_Core_Object_Post extends AAM_Core_Object {
|
|
60 |
*/
|
61 |
public function read() {
|
62 |
$subject = $this->getSubject();
|
63 |
-
$opname
|
64 |
-
$chname
|
65 |
|
66 |
//read cache first
|
67 |
-
$option =
|
68 |
|
69 |
if ($option === false) { //if false, then the cache is empty but exist
|
70 |
$option = array();
|
@@ -86,14 +86,8 @@ class AAM_Core_Object_Post extends AAM_Core_Object {
|
|
86 |
|
87 |
$this->setOption($option);
|
88 |
|
89 |
-
//
|
90 |
-
|
91 |
-
'aam-write-cache-action',
|
92 |
-
$chname,
|
93 |
-
//if cache is on and result is empty, simply cache the false to speed-up
|
94 |
-
(empty($option) ? false : $option),
|
95 |
-
$subject
|
96 |
-
);
|
97 |
}
|
98 |
|
99 |
/**
|
60 |
*/
|
61 |
public function read() {
|
62 |
$subject = $this->getSubject();
|
63 |
+
$opname = $this->getOptionName();
|
64 |
+
$chname = $opname . '|' . $this->getPost()->ID;
|
65 |
|
66 |
//read cache first
|
67 |
+
$option = AAM_Core_Cache::get($chname);
|
68 |
|
69 |
if ($option === false) { //if false, then the cache is empty but exist
|
70 |
$option = array();
|
86 |
|
87 |
$this->setOption($option);
|
88 |
|
89 |
+
//if cache is on and result is empty, simply cache the false to speed-up
|
90 |
+
AAM_Core_Cache::set($chname, (empty($option) ? false : $option));
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
}
|
92 |
|
93 |
/**
|
Application/Core/Repository.php
CHANGED
@@ -97,6 +97,9 @@ class AAM_Core_Repository {
|
|
97 |
*/
|
98 |
public function load() {
|
99 |
$basedir = $this->getBasedir();
|
|
|
|
|
|
|
100 |
|
101 |
if (file_exists($basedir)) {
|
102 |
//iterate through each active extension and load it
|
@@ -110,7 +113,33 @@ class AAM_Core_Repository {
|
|
110 |
do_action('aam-post-extensions-load');
|
111 |
}
|
112 |
}
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
/**
|
115 |
* Bootstrap the Extension
|
116 |
*
|
@@ -269,7 +298,7 @@ class AAM_Core_Repository {
|
|
269 |
public function getBasedir() {
|
270 |
$basedir = WP_CONTENT_DIR . self::RELPATH;
|
271 |
|
272 |
-
return
|
273 |
}
|
274 |
|
275 |
}
|
97 |
*/
|
98 |
public function load() {
|
99 |
$basedir = $this->getBasedir();
|
100 |
+
|
101 |
+
//since release 3.4 Utilities are intergreated into core as Settings
|
102 |
+
$this->integrateUtility();
|
103 |
|
104 |
if (file_exists($basedir)) {
|
105 |
//iterate through each active extension and load it
|
113 |
do_action('aam-post-extensions-load');
|
114 |
}
|
115 |
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
*
|
119 |
+
*/
|
120 |
+
protected function integrateUtility() {
|
121 |
+
//block AAM Utilities Extension from load
|
122 |
+
define('AAM_UTILITIES', '99');
|
123 |
+
//TODO - Remove this in Jul 2017
|
124 |
+
|
125 |
+
//caching filter & action
|
126 |
+
add_filter('aam-read-cache-filter', array($this, 'readCache'), 10, 3);
|
127 |
+
|
128 |
+
//utilities option
|
129 |
+
add_filter('aam-utility-property', 'AAM_Core_Config::get', 10, 2);
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
*
|
134 |
+
* @param type $value
|
135 |
+
* @param type $option
|
136 |
+
* @param type $subject
|
137 |
+
* @return type
|
138 |
+
*/
|
139 |
+
public function readCache($value, $option, $subject) {
|
140 |
+
return AAM_Core_Cache::get($option);
|
141 |
+
}
|
142 |
+
|
143 |
/**
|
144 |
* Bootstrap the Extension
|
145 |
*
|
298 |
public function getBasedir() {
|
299 |
$basedir = WP_CONTENT_DIR . self::RELPATH;
|
300 |
|
301 |
+
return AAM_Core_Config::get('extentionDir', $basedir);
|
302 |
}
|
303 |
|
304 |
}
|
Application/Core/Server.php
CHANGED
@@ -33,14 +33,12 @@ final class AAM_Core_Server {
|
|
33 |
*/
|
34 |
public static function check() {
|
35 |
$response = self::send(self::SERVER_URL . '/check');
|
36 |
-
|
37 |
if (!is_wp_error($response)) {
|
38 |
//WP Error Fix bug report
|
39 |
if ($response->error !== true && !empty($response->products)) {
|
40 |
$result = $response->products;
|
41 |
}
|
42 |
-
} else {
|
43 |
-
$result = array();
|
44 |
}
|
45 |
|
46 |
return $result;
|
33 |
*/
|
34 |
public static function check() {
|
35 |
$response = self::send(self::SERVER_URL . '/check');
|
36 |
+
$result = array();
|
37 |
if (!is_wp_error($response)) {
|
38 |
//WP Error Fix bug report
|
39 |
if ($response->error !== true && !empty($response->products)) {
|
40 |
$result = $response->products;
|
41 |
}
|
|
|
|
|
42 |
}
|
43 |
|
44 |
return $result;
|
Application/Core/Subject.php
CHANGED
@@ -180,7 +180,7 @@ abstract class AAM_Core_Subject {
|
|
180 |
public function getObject($objectType, $id = 'none') {
|
181 |
$object = null;
|
182 |
|
183 |
-
$nid = (is_scalar($id) ? $id : 'none'); //prevent from any
|
184 |
|
185 |
//check if there is an object with specified ID
|
186 |
if (!isset($this->_objects[$objectType][$nid])) {
|
180 |
public function getObject($objectType, $id = 'none') {
|
181 |
$object = null;
|
182 |
|
183 |
+
$nid = (is_scalar($id) ? $id : 'none'); //prevent from any surprises
|
184 |
|
185 |
//check if there is an object with specified ID
|
186 |
if (!isset($this->_objects[$objectType][$nid])) {
|
Application/Core/Subject/User.php
CHANGED
@@ -78,7 +78,7 @@ class AAM_Core_Subject_User extends AAM_Core_Subject {
|
|
78 |
//retrieve aam capabilities if are not retrieved yet
|
79 |
$caps = get_user_option(self::AAM_CAPKEY, $this->getId());
|
80 |
if (is_array($caps)) {
|
81 |
-
$caps
|
82 |
$allcaps = array_merge($subject->allcaps, $caps);
|
83 |
|
84 |
//reset the user capabilities
|
@@ -222,13 +222,13 @@ class AAM_Core_Subject_User extends AAM_Core_Subject {
|
|
222 |
*/
|
223 |
public function getParent() {
|
224 |
//try to get this option from the User's Role
|
225 |
-
$roles
|
226 |
//first user role is counted only. AAM does not support multi-roles
|
227 |
-
$
|
228 |
|
229 |
//in case of multisite & current user does not belong to the site
|
230 |
-
if ($
|
231 |
-
$role = new AAM_Core_Subject_Role($
|
232 |
} else {
|
233 |
$role = null;
|
234 |
}
|
78 |
//retrieve aam capabilities if are not retrieved yet
|
79 |
$caps = get_user_option(self::AAM_CAPKEY, $this->getId());
|
80 |
if (is_array($caps)) {
|
81 |
+
$caps = array_merge($subject->caps, $caps);
|
82 |
$allcaps = array_merge($subject->allcaps, $caps);
|
83 |
|
84 |
//reset the user capabilities
|
222 |
*/
|
223 |
public function getParent() {
|
224 |
//try to get this option from the User's Role
|
225 |
+
$roles = $this->getSubject()->roles;
|
226 |
//first user role is counted only. AAM does not support multi-roles
|
227 |
+
$parent = array_shift($roles);
|
228 |
|
229 |
//in case of multisite & current user does not belong to the site
|
230 |
+
if ($parent) {
|
231 |
+
$role = new AAM_Core_Subject_Role($parent);
|
232 |
} else {
|
233 |
$role = null;
|
234 |
}
|
Application/Frontend/Manager.php
CHANGED
@@ -178,7 +178,7 @@ class AAM_Frontend_Manager {
|
|
178 |
|
179 |
$user->add(
|
180 |
'authentication_failed',
|
181 |
-
|
182 |
);
|
183 |
}
|
184 |
|
178 |
|
179 |
$user->add(
|
180 |
'authentication_failed',
|
181 |
+
AAM_Backend_View_Helper::preparePhrase($message, 'strong')
|
182 |
);
|
183 |
}
|
184 |
|
Lang/advanced-access-manager-en_US.mo
CHANGED
Binary file
|
Lang/advanced-access-manager-en_US.po
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: AAM\n"
|
4 |
-
"POT-Creation-Date: 2016-
|
5 |
"PO-Revision-Date: \n"
|
6 |
"Language-Team: WP AAM <vasyl@vasyltech.com>\n"
|
7 |
"MIME-Version: 1.0\n"
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: AAM\n"
|
4 |
+
"POT-Creation-Date: 2016-07-13 11:39-0400\n"
|
5 |
"PO-Revision-Date: \n"
|
6 |
"Language-Team: WP AAM <vasyl@vasyltech.com>\n"
|
7 |
"MIME-Version: 1.0\n"
|
aam.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
Plugin Name: Advanced Access Manager
|
5 |
Description: Manage User and Role Access to WordPress Backend and Frontend.
|
6 |
-
Version: 3.
|
7 |
Author: Vasyl Martyniuk <vasyl@vasyltech.com>
|
8 |
Author URI: http://www.vasyltech.com
|
9 |
|
@@ -54,7 +54,11 @@ class AAM {
|
|
54 |
$this->setUser(new AAM_Core_Subject_Visitor(''));
|
55 |
}
|
56 |
|
|
|
|
|
|
|
57 |
//load all installed extension
|
|
|
58 |
AAM_Core_Repository::getInstance()->load();
|
59 |
|
60 |
//bootstrap the correct interface
|
@@ -97,8 +101,9 @@ class AAM {
|
|
97 |
* @access public
|
98 |
*/
|
99 |
public static function isAAM() {
|
100 |
-
$page
|
101 |
-
$action
|
|
|
102 |
$intersect = array_intersect(array('aam', 'aamc'), array($page, $action));
|
103 |
|
104 |
return (is_admin() && count($intersect));
|
@@ -118,6 +123,9 @@ class AAM {
|
|
118 |
AAM_KEY, false, dirname(plugin_basename(__FILE__)) . '/Lang/'
|
119 |
);
|
120 |
self::$_instance = new self;
|
|
|
|
|
|
|
121 |
}
|
122 |
|
123 |
return self::$_instance;
|
3 |
/**
|
4 |
Plugin Name: Advanced Access Manager
|
5 |
Description: Manage User and Role Access to WordPress Backend and Frontend.
|
6 |
+
Version: 3.4
|
7 |
Author: Vasyl Martyniuk <vasyl@vasyltech.com>
|
8 |
Author URI: http://www.vasyltech.com
|
9 |
|
54 |
$this->setUser(new AAM_Core_Subject_Visitor(''));
|
55 |
}
|
56 |
|
57 |
+
//load AAM core config
|
58 |
+
AAM_Core_Config::bootstrap();
|
59 |
+
|
60 |
//load all installed extension
|
61 |
+
//TODO - Remove in Aug 2017
|
62 |
AAM_Core_Repository::getInstance()->load();
|
63 |
|
64 |
//bootstrap the correct interface
|
101 |
* @access public
|
102 |
*/
|
103 |
public static function isAAM() {
|
104 |
+
$page = AAM_Core_Request::get('page');
|
105 |
+
$action = AAM_Core_Request::post('action');
|
106 |
+
|
107 |
$intersect = array_intersect(array('aam', 'aamc'), array($page, $action));
|
108 |
|
109 |
return (is_admin() && count($intersect));
|
123 |
AAM_KEY, false, dirname(plugin_basename(__FILE__)) . '/Lang/'
|
124 |
);
|
125 |
self::$_instance = new self;
|
126 |
+
|
127 |
+
//load AAM cache
|
128 |
+
AAM_Core_Cache::bootstrap();
|
129 |
}
|
130 |
|
131 |
return self::$_instance;
|
media/active-menu.png
DELETED
Binary file
|
media/active-menu.svg
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2 |
+
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3 |
+
<!-- Generator: Sketch 3.8.3 (29802) - http://www.bohemiancoding.com/sketch -->
|
4 |
+
<title>Group</title>
|
5 |
+
<desc>Created with Sketch.</desc>
|
6 |
+
<defs></defs>
|
7 |
+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
8 |
+
<g id="Group">
|
9 |
+
<g id="Gear_7" fill="#FFFFFF">
|
10 |
+
<g id="layer1" transform="translate(0.113781, 0.033332)">
|
11 |
+
<g id="g27" transform="translate(0.124998, 0.048704)">
|
12 |
+
<path d="M17.5195752,7.63821239 L16.0152212,7.13532743 C15.8313982,6.35861947 15.5261947,5.62906195 15.1185664,4.96895575 L15.8261416,3.55061947 C15.3404602,2.91010619 14.7687611,2.33856637 14.1284071,1.85304425 L12.7099115,2.56061947 C12.0499646,2.15283186 11.3204071,1.84730973 10.5438584,1.66364602 L10.0409735,0.159451327 C9.64847788,0.105769912 9.2480177,0.0772566372 8.84070796,0.0772566372 C8.43339823,0.0772566372 8.03309735,0.105769912 7.64044248,0.159451327 L7.13755752,1.66364602 C6.36100885,1.84730973 5.63145133,2.15283186 4.97134513,2.56061947 L3.55300885,1.85304425 C2.91249558,2.33856637 2.34095575,2.91010619 1.85559292,3.55061947 L2.56316814,4.96895575 C2.15538053,5.62906195 1.84985841,6.35861947 1.66635398,7.13532743 L0.162,7.63821239 C0.108318584,8.03054867 0.0798053097,8.43116814 0.0798053097,8.83831858 C0.0798053097,9.24546903 0.108159292,9.6460885 0.162,10.0384248 L1.66635398,10.5413097 C1.8500177,11.3180177 2.15538053,12.0475752 2.56300885,12.7076814 L1.85575221,14.1260177 C2.34111504,14.766531 2.91265487,15.3380708 3.55316814,15.8235929 L4.97150442,15.1160177 C5.63161062,15.5238053 6.36116814,15.8293274 7.13771681,16.0129912 L7.64060177,17.5170265 C8.03309735,17.5708673 8.43355752,17.5993805 8.84086726,17.5993805 C9.24817699,17.5993805 9.64847788,17.5708673 10.0411327,17.5170265 L10.5440177,16.0129912 C11.3205664,15.8293274 12.0501239,15.5238053 12.7100708,15.116177 L14.1285664,15.8235929 C14.7689204,15.3380708 15.3406195,14.766531 15.8259823,14.1260177 L15.1187257,12.7076814 C15.526354,12.0475752 15.8315575,11.3180177 16.0153805,10.5413097 L17.5197345,10.0384248 C17.5734159,9.6460885 17.6019292,9.24546903 17.6019292,8.83831858 C17.6019292,8.43116814 17.5734159,8.03054867 17.5195752,7.63821239 L17.5195752,7.63821239 Z M8.84070796,14.8261062 C5.53380531,14.8261062 2.85292035,12.1453805 2.85292035,8.83831858 C2.85292035,5.53125664 5.53380531,2.85053097 8.84070796,2.85053097 C12.1476106,2.85053097 14.8284956,5.53125664 14.8284956,8.83831858 C14.8284956,12.1453805 12.1476106,14.8261062 8.84070796,14.8261062 L8.84070796,14.8261062 Z" id="path29"></path>
|
13 |
+
</g>
|
14 |
+
</g>
|
15 |
+
</g>
|
16 |
+
<g id="1467918132_102" transform="translate(5.097345, 3.663717)">
|
17 |
+
<path d="M1.39794078,2.60514684 L1.39794078,3.99669843 L0.801558397,3.99669843 C0.362214334,3.99669843 0.00634542449,4.35254546 0.00634542449,4.79188953 L0.00634542449,8.76786687 C0.00634542449,9.20718905 0.362214334,9.5630142 0.801558397,9.5630142 L7.16304337,9.5630142 C7.60236555,9.5630142 7.95830011,9.20718905 7.95830011,8.76786687 L7.95830011,4.79188953 C7.95830011,4.35254546 7.60236555,3.99669843 7.16304337,3.99669843 L6.56670476,3.99669843 L6.56670476,2.60514684 C6.56670476,1.17782019 5.40960566,0.0207867354 3.98232277,0.0207867354 C2.55503987,0.0207867354 1.39794078,1.17779831 1.39794078,2.60514684 L1.39794078,2.60514684 Z M2.39194058,3.99669843 L2.39194058,2.60514684 C2.39194058,1.7264806 3.10361276,1.01474278 3.98230088,1.01474278 C4.86098901,1.01474278 5.57270495,1.7264806 5.57270495,2.60514684 L5.57270495,3.99669843 L2.39194058,3.99669843 L2.39194058,3.99669843 Z" id="Shape" fill="#FFFFFF"></path>
|
18 |
+
<path d="M3.18710979,6.18348488 C3.18710979,5.7441627 3.54295682,5.38831567 3.98230088,5.38831567 C4.42164495,5.38831567 4.7774701,5.7441627 4.7774701,6.18348488 C4.7774701,6.46382136 4.63231304,6.71035204 4.41370223,6.85148303 C4.41370223,6.85148303 4.49137898,7.32073811 4.57872703,7.8732933 C4.57872703,8.03823057 4.44553875,8.17141885 4.28051396,8.17141885 L3.68408781,8.17141885 C3.5190849,8.17141885 3.38591851,8.03823057 3.38591851,7.8732933 L3.5509433,6.85148303 C3.33231061,6.71035204 3.18710979,6.46379947 3.18710979,6.18348488 L3.18710979,6.18348488 Z" id="Path" fill="#000000"></path>
|
19 |
+
</g>
|
20 |
+
</g>
|
21 |
+
</g>
|
22 |
+
</svg>
|
media/css/aam.css
CHANGED
@@ -62,7 +62,6 @@
|
|
62 |
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
|
63 |
}
|
64 |
|
65 |
-
|
66 |
.icon-spin4:before { content: '\e800'; } /* 'î ' */
|
67 |
.icon-eye-off:before { content: '\e801'; } /* 'î ' */
|
68 |
.icon-attention-circled:before { content: '\e802'; } /* 'î ' */
|
@@ -97,6 +96,7 @@
|
|
97 |
.icon-star:before { content: '\e81f'; } /* 'î ' */
|
98 |
.icon-list:before { content: '\e820'; } /* 'î ' */
|
99 |
.icon-level-down:before { content: '\e821'; } /* 'î ¡' */
|
|
|
100 |
|
101 |
.animate-spin {
|
102 |
-moz-animation: spin 2s infinite linear;
|
@@ -208,6 +208,9 @@ html, body {
|
|
208 |
|
209 |
.js .postbox .hndle, .js .widget .widget-top {
|
210 |
cursor: auto;
|
|
|
|
|
|
|
211 |
}
|
212 |
|
213 |
.hndle a {
|
@@ -508,11 +511,6 @@ input[type="checkbox"]:focus, input[type="radio"]:focus {
|
|
508 |
cursor: pointer;
|
509 |
}
|
510 |
|
511 |
-
.visitor-message {
|
512 |
-
border: 2px solid #F5F5F5;
|
513 |
-
padding: 15px 10px;
|
514 |
-
}
|
515 |
-
|
516 |
.visitor-message span {
|
517 |
margin-bottom: 15px;
|
518 |
display: block;
|
@@ -639,11 +637,25 @@ input[type="checkbox"]:focus, input[type="radio"]:focus {
|
|
639 |
|
640 |
.aam-help-menu {
|
641 |
float: right;
|
642 |
-
font-size:
|
|
|
643 |
color: #337ab7;
|
644 |
cursor: pointer;
|
645 |
}
|
646 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
647 |
.aam-help-menu.active {
|
648 |
color: #a94442;
|
649 |
}
|
@@ -699,7 +711,7 @@ input[type="checkbox"]:focus, input[type="radio"]:focus {
|
|
699 |
|
700 |
.aam-info {
|
701 |
border-left: 3px solid #337ab7;
|
702 |
-
background-color: #
|
703 |
padding: 10px;
|
704 |
position: relative;
|
705 |
font-size: 1em;
|
@@ -748,8 +760,10 @@ input[type="checkbox"]:focus, input[type="radio"]:focus {
|
|
748 |
margin: 0 10px;
|
749 |
}
|
750 |
|
751 |
-
.aam-error-list
|
752 |
-
|
|
|
|
|
753 |
}
|
754 |
|
755 |
.aam-menu-capability {
|
@@ -792,9 +806,39 @@ input[type="checkbox"]:focus, input[type="radio"]:focus {
|
|
792 |
|
793 |
.aam-current-subject strong {
|
794 |
text-transform: capitalize;
|
|
|
795 |
}
|
796 |
|
797 |
.table h4 {
|
798 |
margin-top: 5px;
|
799 |
margin-bottom: 5px;
|
800 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
|
63 |
}
|
64 |
|
|
|
65 |
.icon-spin4:before { content: '\e800'; } /* 'î ' */
|
66 |
.icon-eye-off:before { content: '\e801'; } /* 'î ' */
|
67 |
.icon-attention-circled:before { content: '\e802'; } /* 'î ' */
|
96 |
.icon-star:before { content: '\e81f'; } /* 'î ' */
|
97 |
.icon-list:before { content: '\e820'; } /* 'î ' */
|
98 |
.icon-level-down:before { content: '\e821'; } /* 'î ¡' */
|
99 |
+
.icon-thumbs-up-alt:before { content: '\f164'; } /* 'ï
¤' */
|
100 |
|
101 |
.animate-spin {
|
102 |
-moz-animation: spin 2s infinite linear;
|
208 |
|
209 |
.js .postbox .hndle, .js .widget .widget-top {
|
210 |
cursor: auto;
|
211 |
+
background-color: #F0F0F0;
|
212 |
+
font-size: 1.2em;
|
213 |
+
letter-spacing: 2px;
|
214 |
}
|
215 |
|
216 |
.hndle a {
|
511 |
cursor: pointer;
|
512 |
}
|
513 |
|
|
|
|
|
|
|
|
|
|
|
514 |
.visitor-message span {
|
515 |
margin-bottom: 15px;
|
516 |
display: block;
|
637 |
|
638 |
.aam-help-menu {
|
639 |
float: right;
|
640 |
+
font-size: 1.4em;
|
641 |
+
margin-top: -4px;
|
642 |
color: #337ab7;
|
643 |
cursor: pointer;
|
644 |
}
|
645 |
|
646 |
+
.aam-setting-title, .aam-extension-title {
|
647 |
+
font-size: 1.2em;
|
648 |
+
font-weight: 700;
|
649 |
+
display: block;
|
650 |
+
}
|
651 |
+
|
652 |
+
.aam-setting-description, .aam-extension-description {
|
653 |
+
font-size: 0.9em;
|
654 |
+
text-align: justify;
|
655 |
+
line-height: 1.4;
|
656 |
+
color: #666666;
|
657 |
+
}
|
658 |
+
|
659 |
.aam-help-menu.active {
|
660 |
color: #a94442;
|
661 |
}
|
711 |
|
712 |
.aam-info {
|
713 |
border-left: 3px solid #337ab7;
|
714 |
+
background-color: #FAFAFA;
|
715 |
padding: 10px;
|
716 |
position: relative;
|
717 |
font-size: 1em;
|
760 |
margin: 0 10px;
|
761 |
}
|
762 |
|
763 |
+
.aam-error-list {
|
764 |
+
padding: 15px;
|
765 |
+
list-style: disc;
|
766 |
+
margin-bottom: 0;
|
767 |
}
|
768 |
|
769 |
.aam-menu-capability {
|
806 |
|
807 |
.aam-current-subject strong {
|
808 |
text-transform: capitalize;
|
809 |
+
color: #a94442;
|
810 |
}
|
811 |
|
812 |
.table h4 {
|
813 |
margin-top: 5px;
|
814 |
margin-bottom: 5px;
|
815 |
+
}
|
816 |
+
|
817 |
+
/*! ========================================================================
|
818 |
+
* Bootstrap Toggle: bootstrap-toggle.css v2.2.0
|
819 |
+
* http://www.bootstraptoggle.com
|
820 |
+
* ========================================================================
|
821 |
+
* Copyright 2014 Min Hur, The New York Times Company
|
822 |
+
* Licensed under MIT
|
823 |
+
* ======================================================================== */
|
824 |
+
.checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px}
|
825 |
+
.toggle{position:relative;overflow:hidden}
|
826 |
+
.toggle input[type=checkbox]{display:none}
|
827 |
+
.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none}
|
828 |
+
.toggle.off .toggle-group{left:-100%}
|
829 |
+
.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0}
|
830 |
+
.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0}
|
831 |
+
.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px}
|
832 |
+
.toggle.btn{min-width:59px;min-height:34px}
|
833 |
+
.toggle-on.btn{padding-right:24px}
|
834 |
+
.toggle-off.btn{padding-left:24px}
|
835 |
+
.toggle.btn-lg{min-width:79px;min-height:45px}
|
836 |
+
.toggle-on.btn-lg{padding-right:31px}
|
837 |
+
.toggle-off.btn-lg{padding-left:31px}
|
838 |
+
.toggle-handle.btn-lg{width:40px}
|
839 |
+
.toggle.btn-sm{min-width:50px;min-height:30px}
|
840 |
+
.toggle-on.btn-sm{padding-right:20px}
|
841 |
+
.toggle-off.btn-sm{padding-left:20px}
|
842 |
+
.toggle.btn-xs{min-width:35px;min-height:22px}
|
843 |
+
.toggle-on.btn-xs{padding-right:12px}
|
844 |
+
.toggle-off.btn-xs{padding-left:12px}
|
media/font/fontello.eot
CHANGED
Binary file
|
media/font/fontello.svg
CHANGED
@@ -73,6 +73,8 @@
|
|
73 |
<glyph glyph-name="list" unicode="" d="M143 118v-107q0-7-5-13t-13-5h-107q-7 0-13 5t-5 13v107q0 7 5 12t13 6h107q7 0 13-6t5-12z m0 214v-107q0-7-5-13t-13-5h-107q-7 0-13 5t-5 13v107q0 7 5 13t13 5h107q7 0 13-5t5-13z m0 214v-107q0-7-5-12t-13-6h-107q-7 0-13 6t-5 12v107q0 8 5 13t13 5h107q7 0 13-5t5-13z m857-428v-107q0-7-5-13t-13-5h-750q-7 0-12 5t-6 13v107q0 7 6 12t12 6h750q7 0 13-6t5-12z m-857 643v-107q0-8-5-13t-13-5h-107q-7 0-13 5t-5 13v107q0 7 5 12t13 6h107q7 0 13-6t5-12z m857-429v-107q0-7-5-13t-13-5h-750q-7 0-12 5t-6 13v107q0 7 6 13t12 5h750q7 0 13-5t5-13z m0 214v-107q0-7-5-12t-13-6h-750q-7 0-12 6t-6 12v107q0 8 6 13t12 5h750q7 0 13-5t5-13z m0 215v-107q0-8-5-13t-13-5h-750q-7 0-12 5t-6 13v107q0 7 6 12t12 6h750q7 0 13-6t5-12z" horiz-adv-x="1000" />
|
74 |
|
75 |
<glyph glyph-name="level-down" unicode="" d="M18 707h393q7 0 12-5t6-13v-482h107q22 0 32-20t-5-39l-178-214q-11-13-28-13t-27 13l-179 214q-14 17-5 39 10 20 33 20h107v357h-179q-8 0-14 6l-89 108q-7 7-2 19 5 10 16 10z" horiz-adv-x="571.4" />
|
|
|
|
|
76 |
</font>
|
77 |
</defs>
|
78 |
</svg>
|
73 |
<glyph glyph-name="list" unicode="" d="M143 118v-107q0-7-5-13t-13-5h-107q-7 0-13 5t-5 13v107q0 7 5 12t13 6h107q7 0 13-6t5-12z m0 214v-107q0-7-5-13t-13-5h-107q-7 0-13 5t-5 13v107q0 7 5 13t13 5h107q7 0 13-5t5-13z m0 214v-107q0-7-5-12t-13-6h-107q-7 0-13 6t-5 12v107q0 8 5 13t13 5h107q7 0 13-5t5-13z m857-428v-107q0-7-5-13t-13-5h-750q-7 0-12 5t-6 13v107q0 7 6 12t12 6h750q7 0 13-6t5-12z m-857 643v-107q0-8-5-13t-13-5h-107q-7 0-13 5t-5 13v107q0 7 5 12t13 6h107q7 0 13-6t5-12z m857-429v-107q0-7-5-13t-13-5h-750q-7 0-12 5t-6 13v107q0 7 6 13t12 5h750q7 0 13-5t5-13z m0 214v-107q0-7-5-12t-13-6h-750q-7 0-12 6t-6 12v107q0 8 6 13t12 5h750q7 0 13-5t5-13z m0 215v-107q0-8-5-13t-13-5h-750q-7 0-12 5t-6 13v107q0 7 6 12t12 6h750q7 0 13-6t5-12z" horiz-adv-x="1000" />
|
74 |
|
75 |
<glyph glyph-name="level-down" unicode="" d="M18 707h393q7 0 12-5t6-13v-482h107q22 0 32-20t-5-39l-178-214q-11-13-28-13t-27 13l-179 214q-14 17-5 39 10 20 33 20h107v357h-179q-8 0-14 6l-89 108q-7 7-2 19 5 10 16 10z" horiz-adv-x="571.4" />
|
76 |
+
|
77 |
+
<glyph glyph-name="thumbs-up-alt" unicode="" d="M143 100q0 15-11 25t-25 11q-15 0-25-11t-11-25q0-15 11-25t25-11q15 0 25 11t11 25z m89 286v-357q0-15-10-25t-26-11h-160q-15 0-25 11t-11 25v357q0 14 11 25t25 10h160q15 0 26-10t10-25z m661 0q0-48-31-83 9-25 9-43 1-42-24-76 9-32 0-66-9-31-31-52 5-63-27-101-36-43-110-44h-72q-37 0-80 9t-68 16-67 22q-69 24-88 25-15 0-26 11t-10 25v357q0 14 10 25t24 11q13 1 42 33t57 67q38 49 56 67 10 10 17 27t10 27 8 34q4 22 7 34t11 29 18 28q11 11 26 11 25 0 46-6t33-15 22-22 14-26 7-27 2-26 1-21q0-21-6-43t-10-33-16-31q-1-4-5-10t-6-13-5-13h155q43 0 75-32t32-75z" horiz-adv-x="928.6" />
|
78 |
</font>
|
79 |
</defs>
|
80 |
</svg>
|
media/font/fontello.ttf
CHANGED
Binary file
|
media/font/fontello.woff
CHANGED
Binary file
|
media/font/fontello.woff2
CHANGED
Binary file
|
media/js/aam-hook.js
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
AAM_PageError = false;
|
2 |
-
|
3 |
-
(function () {
|
4 |
-
var callback = null;
|
5 |
-
|
6 |
-
if (typeof window.onerror === 'function') {
|
7 |
-
callback = window.onerror;
|
8 |
-
}
|
9 |
-
|
10 |
-
window.onerror = function (msg, url, line, col, error) {
|
11 |
-
AAM_PageError = true;
|
12 |
-
if (callback) {
|
13 |
-
callback.call(null, msg, url, line, col, error);
|
14 |
-
}
|
15 |
-
};
|
16 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
media/js/aam-ui.js
CHANGED
@@ -392,15 +392,13 @@
|
|
392 |
});
|
393 |
} else {
|
394 |
$(btn).attr({
|
395 |
-
'class': 'aam-row-action icon-lock-open-alt text-
|
396 |
'title': aam.__('Lock User'),
|
397 |
'data-original-title': aam.__('Lock User')
|
398 |
});
|
399 |
}
|
400 |
} else {
|
401 |
-
aam.notification(
|
402 |
-
'danger', aam.__('Failed to block user')
|
403 |
-
);
|
404 |
}
|
405 |
},
|
406 |
error: function () {
|
@@ -455,10 +453,10 @@
|
|
455 |
|
456 |
//add subtitle
|
457 |
$('td:eq(0)', row).append(
|
458 |
-
|
459 |
aam.__('Role') + ': ' + data[1]
|
460 |
-
|
461 |
-
|
462 |
|
463 |
var actions = data[3].split(',');
|
464 |
|
@@ -515,7 +513,7 @@
|
|
515 |
|
516 |
case 'lock':
|
517 |
$(container).append($('<i/>', {
|
518 |
-
'class': 'aam-row-action icon-lock-open-alt text-
|
519 |
}).bind('click', function () {
|
520 |
blockUser(data[0], $(this));
|
521 |
}).attr({
|
@@ -672,7 +670,7 @@
|
|
672 |
$('.aam-lock', target).remove();
|
673 |
$(this).removeClass('btn-primary').addClass('btn-danger');
|
674 |
$(this).html(
|
675 |
-
'<i class="icon-eye-off"></i>' + aam.__('
|
676 |
);
|
677 |
$('.panel-title .icon-eye-off', target + '-heading').remove();
|
678 |
}
|
@@ -906,15 +904,10 @@
|
|
906 |
searchPlaceholder: aam.__('Search Capability'),
|
907 |
info: aam.__('_TOTAL_ capability(s)'),
|
908 |
infoFiltered: '',
|
|
|
909 |
lengthMenu: '_MENU_'
|
910 |
},
|
911 |
createdRow: function (row, data) {
|
912 |
-
//add also the internal capability representation next to the
|
913 |
-
//capability title
|
914 |
-
$('td:eq(1)', row).append(
|
915 |
-
' <small class="aam-block">' + data[0] + '</small>'
|
916 |
-
);
|
917 |
-
|
918 |
var actions = data[3].split(',');
|
919 |
|
920 |
var container = $('<div/>', {'class': 'aam-row-actions'});
|
@@ -935,6 +928,30 @@
|
|
935 |
save(data[0], this);
|
936 |
}));
|
937 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
938 |
|
939 |
default:
|
940 |
aam.triggerHook('decorate-capability-row', {
|
@@ -960,7 +977,6 @@
|
|
960 |
});
|
961 |
});
|
962 |
|
963 |
-
|
964 |
$('#add-capability').bind('click', function (event) {
|
965 |
event.preventDefault();
|
966 |
$('#add-capability-modal').modal('show');
|
@@ -1010,14 +1026,88 @@
|
|
1010 |
$('#add-capability-modal').on('shown.bs.modal', function (e) {
|
1011 |
$('#new-capability-name').focus();
|
1012 |
});
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
$('
|
1019 |
-
|
1020 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1021 |
}
|
1022 |
|
1023 |
aam.addHook('init', initialize);
|
@@ -1574,6 +1664,68 @@
|
|
1574 |
})(jQuery);
|
1575 |
|
1576 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1577 |
/**
|
1578 |
* Main Panel Interface
|
1579 |
*
|
392 |
});
|
393 |
} else {
|
394 |
$(btn).attr({
|
395 |
+
'class': 'aam-row-action icon-lock-open-alt text-danger',
|
396 |
'title': aam.__('Lock User'),
|
397 |
'data-original-title': aam.__('Lock User')
|
398 |
});
|
399 |
}
|
400 |
} else {
|
401 |
+
aam.notification('danger', aam.__('Failed to block user'));
|
|
|
|
|
402 |
}
|
403 |
},
|
404 |
error: function () {
|
453 |
|
454 |
//add subtitle
|
455 |
$('td:eq(0)', row).append(
|
456 |
+
$('<i/>', {'class': 'aam-row-subtitle'}).text(
|
457 |
aam.__('Role') + ': ' + data[1]
|
458 |
+
)
|
459 |
+
);
|
460 |
|
461 |
var actions = data[3].split(',');
|
462 |
|
513 |
|
514 |
case 'lock':
|
515 |
$(container).append($('<i/>', {
|
516 |
+
'class': 'aam-row-action icon-lock-open-alt text-danger'
|
517 |
}).bind('click', function () {
|
518 |
blockUser(data[0], $(this));
|
519 |
}).attr({
|
670 |
$('.aam-lock', target).remove();
|
671 |
$(this).removeClass('btn-primary').addClass('btn-danger');
|
672 |
$(this).html(
|
673 |
+
'<i class="icon-eye-off"></i>' + aam.__('Restrict Menu')
|
674 |
);
|
675 |
$('.panel-title .icon-eye-off', target + '-heading').remove();
|
676 |
}
|
904 |
searchPlaceholder: aam.__('Search Capability'),
|
905 |
info: aam.__('_TOTAL_ capability(s)'),
|
906 |
infoFiltered: '',
|
907 |
+
infoEmpty: aam.__('Nothing to show'),
|
908 |
lengthMenu: '_MENU_'
|
909 |
},
|
910 |
createdRow: function (row, data) {
|
|
|
|
|
|
|
|
|
|
|
|
|
911 |
var actions = data[3].split(',');
|
912 |
|
913 |
var container = $('<div/>', {'class': 'aam-row-actions'});
|
928 |
save(data[0], this);
|
929 |
}));
|
930 |
break;
|
931 |
+
|
932 |
+
case 'edit':
|
933 |
+
$(container).append($('<i/>', {
|
934 |
+
'class': 'aam-row-action icon-pencil text-warning'
|
935 |
+
}).bind('click', function () {
|
936 |
+
$('#capability-id').val(data[0]);
|
937 |
+
$('#update-capability-btn').attr('data-cap', data[0]);
|
938 |
+
$('#edit-capability-modal').modal('show');
|
939 |
+
}));
|
940 |
+
break;
|
941 |
+
|
942 |
+
case 'delete':
|
943 |
+
$(container).append($('<i/>', {
|
944 |
+
'class': 'aam-row-action icon-trash-empty text-danger'
|
945 |
+
}).bind('click', function () {
|
946 |
+
var message = $('.aam-confirm-message', '#delete-capability-modal');
|
947 |
+
$(message).html(message.data('message').replace(
|
948 |
+
'%s', '<b>' + data[0] + '</b>')
|
949 |
+
);
|
950 |
+
$('#capability-id').val(data[0]);
|
951 |
+
$('#delete-capability-btn').attr('data-cap', data[0]);
|
952 |
+
$('#delete-capability-modal').modal('show');
|
953 |
+
}));
|
954 |
+
break;
|
955 |
|
956 |
default:
|
957 |
aam.triggerHook('decorate-capability-row', {
|
977 |
});
|
978 |
});
|
979 |
|
|
|
980 |
$('#add-capability').bind('click', function (event) {
|
981 |
event.preventDefault();
|
982 |
$('#add-capability-modal').modal('show');
|
1026 |
$('#add-capability-modal').on('shown.bs.modal', function (e) {
|
1027 |
$('#new-capability-name').focus();
|
1028 |
});
|
1029 |
+
|
1030 |
+
$('#update-capability-btn').bind('click', function (event) {
|
1031 |
+
event.preventDefault();
|
1032 |
+
|
1033 |
+
var btn = this;
|
1034 |
+
var cap = $.trim($('#capability-id').val());
|
1035 |
+
|
1036 |
+
if (cap) {
|
1037 |
+
$.ajax(aamLocal.ajaxurl, {
|
1038 |
+
type: 'POST',
|
1039 |
+
dataType: 'json',
|
1040 |
+
data: {
|
1041 |
+
action: 'aam',
|
1042 |
+
sub_action: 'Capability.update',
|
1043 |
+
_ajax_nonce: aamLocal.nonce,
|
1044 |
+
capability: $(this).attr('data-cap'),
|
1045 |
+
updated: cap
|
1046 |
+
},
|
1047 |
+
beforeSend: function () {
|
1048 |
+
$(btn).text(aam.__('Saving...')).attr('disabled', true);
|
1049 |
+
},
|
1050 |
+
success: function (response) {
|
1051 |
+
if (response.status === 'success') {
|
1052 |
+
$('#edit-capability-modal').modal('hide');
|
1053 |
+
$('#capability-list').DataTable().ajax.reload();
|
1054 |
+
} else {
|
1055 |
+
aam.notification(
|
1056 |
+
'danger', aam.__('Failed to update capability')
|
1057 |
+
);
|
1058 |
+
}
|
1059 |
+
},
|
1060 |
+
error: function () {
|
1061 |
+
aam.notification('danger', aam.__('Application error'));
|
1062 |
+
},
|
1063 |
+
complete: function () {
|
1064 |
+
$(btn).text(aam.__('Update Capability')).attr(
|
1065 |
+
'disabled', false
|
1066 |
+
);
|
1067 |
+
}
|
1068 |
+
});
|
1069 |
+
}
|
1070 |
+
});
|
1071 |
+
|
1072 |
+
$('#delete-capability-btn').bind('click', function (event) {
|
1073 |
+
event.preventDefault();
|
1074 |
+
|
1075 |
+
var btn = this;
|
1076 |
+
|
1077 |
+
$.ajax(aamLocal.ajaxurl, {
|
1078 |
+
type: 'POST',
|
1079 |
+
dataType: 'json',
|
1080 |
+
data: {
|
1081 |
+
action: 'aam',
|
1082 |
+
sub_action: 'Capability.delete',
|
1083 |
+
_ajax_nonce: aamLocal.nonce,
|
1084 |
+
subject: aam.getSubject().type,
|
1085 |
+
subjectId: aam.getSubject().id,
|
1086 |
+
capability: $(this).attr('data-cap')
|
1087 |
+
},
|
1088 |
+
beforeSend: function () {
|
1089 |
+
$(btn).text(aam.__('Deleting...')).attr('disabled', true);
|
1090 |
+
},
|
1091 |
+
success: function (response) {
|
1092 |
+
if (response.status === 'success') {
|
1093 |
+
$('#delete-capability-modal').modal('hide');
|
1094 |
+
$('#capability-list').DataTable().ajax.reload();
|
1095 |
+
} else {
|
1096 |
+
aam.notification(
|
1097 |
+
'danger', aam.__('Failed to delete capability')
|
1098 |
+
);
|
1099 |
+
}
|
1100 |
+
},
|
1101 |
+
error: function () {
|
1102 |
+
aam.notification('danger', aam.__('Application error'));
|
1103 |
+
},
|
1104 |
+
complete: function () {
|
1105 |
+
$(btn).text(aam.__('Delete Capability')).attr(
|
1106 |
+
'disabled', false
|
1107 |
+
);
|
1108 |
+
}
|
1109 |
+
});
|
1110 |
+
});
|
1111 |
}
|
1112 |
|
1113 |
aam.addHook('init', initialize);
|
1664 |
})(jQuery);
|
1665 |
|
1666 |
|
1667 |
+
/**
|
1668 |
+
* Utilities Interface
|
1669 |
+
*
|
1670 |
+
* @param {type} $
|
1671 |
+
*
|
1672 |
+
* @returns {undefined}
|
1673 |
+
*/
|
1674 |
+
(function ($) {
|
1675 |
+
|
1676 |
+
/**
|
1677 |
+
*
|
1678 |
+
* @returns {undefined}
|
1679 |
+
*/
|
1680 |
+
function initialize() {
|
1681 |
+
$('input[data-toggle="toggle"]').bootstrapToggle({
|
1682 |
+
size: 'normal',
|
1683 |
+
width: '100%'
|
1684 |
+
}).bind('change', function () {
|
1685 |
+
$.ajax(aamLocal.ajaxurl, {
|
1686 |
+
type: 'POST',
|
1687 |
+
dataType: 'json',
|
1688 |
+
async: false,
|
1689 |
+
data: {
|
1690 |
+
action: 'aam',
|
1691 |
+
sub_action: 'Utility.save',
|
1692 |
+
_ajax_nonce: aamLocal.nonce,
|
1693 |
+
param: $(this).attr('name'),
|
1694 |
+
value: $(this).prop('checked')
|
1695 |
+
},
|
1696 |
+
error: function () {
|
1697 |
+
aam.notification('danger', aam.__('Application Error'));
|
1698 |
+
}
|
1699 |
+
});
|
1700 |
+
});
|
1701 |
+
|
1702 |
+
$('#clear-settings').bind('click', function () {
|
1703 |
+
$.ajax(aamLocal.ajaxurl, {
|
1704 |
+
type: 'POST',
|
1705 |
+
dataType: 'json',
|
1706 |
+
async: false,
|
1707 |
+
data: {
|
1708 |
+
action: 'aam',
|
1709 |
+
sub_action: 'Utility.clear',
|
1710 |
+
_ajax_nonce: aamLocal.nonce
|
1711 |
+
},
|
1712 |
+
success: function (response) {
|
1713 |
+
if (response.status === 'success') {
|
1714 |
+
location.reload();
|
1715 |
+
}
|
1716 |
+
},
|
1717 |
+
error: function () {
|
1718 |
+
aam.notification('danger', aam.__('Application Error'));
|
1719 |
+
}
|
1720 |
+
});
|
1721 |
+
});
|
1722 |
+
}
|
1723 |
+
|
1724 |
+
aam.addHook('init', initialize);
|
1725 |
+
|
1726 |
+
})(jQuery);
|
1727 |
+
|
1728 |
+
|
1729 |
/**
|
1730 |
* Main Panel Interface
|
1731 |
*
|
media/js/aam.js
CHANGED
@@ -101,37 +101,6 @@
|
|
101 |
});
|
102 |
$(this).tooltip('show');
|
103 |
});
|
104 |
-
|
105 |
-
//if there is an error detected during the AAM load, show it
|
106 |
-
if (typeof AAM_PageError !== 'undefined' && AAM_PageError) {
|
107 |
-
$('.aam-error-list').append(
|
108 |
-
$('<li/>').html(
|
109 |
-
this.__('Javascript error detected during the page load. AAM may not function properly.')
|
110 |
-
)
|
111 |
-
);
|
112 |
-
$('.aam-notification-container').removeClass('hidden');
|
113 |
-
}
|
114 |
-
|
115 |
-
//Error Fix promotion code
|
116 |
-
$.ajax(aamLocal.ajaxurl, {
|
117 |
-
type: 'POST',
|
118 |
-
dataType: 'json',
|
119 |
-
data: {
|
120 |
-
action: 'aam',
|
121 |
-
sub_action: 'getErrorFixStatus',
|
122 |
-
_ajax_nonce: aamLocal.nonce
|
123 |
-
},
|
124 |
-
success: function (response) {
|
125 |
-
if (response.status === 'show') {
|
126 |
-
$('#errorfix-promotion').removeClass('hidden');
|
127 |
-
$('#errorfix-install-btn').attr(
|
128 |
-
'href', response.url.replace(/&/g, '&')
|
129 |
-
);
|
130 |
-
} else {
|
131 |
-
$('#errorfix-promotion').remove();
|
132 |
-
}
|
133 |
-
}
|
134 |
-
});
|
135 |
};
|
136 |
|
137 |
/**
|
@@ -157,8 +126,9 @@
|
|
157 |
};
|
158 |
|
159 |
//update the header
|
|
|
160 |
$('.aam-current-subject').html(
|
161 |
-
aam.__(
|
162 |
);
|
163 |
|
164 |
this.triggerHook('setSubject');
|
101 |
});
|
102 |
$(this).tooltip('show');
|
103 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
};
|
105 |
|
106 |
/**
|
126 |
};
|
127 |
|
128 |
//update the header
|
129 |
+
var subject = type.charAt(0).toUpperCase() + type.slice(1);
|
130 |
$('.aam-current-subject').html(
|
131 |
+
aam.__(subject) + ': <strong>' + name + '</strong>'
|
132 |
);
|
133 |
|
134 |
this.triggerHook('setSubject');
|
media/js/toggle.min.js
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! ========================================================================
|
2 |
+
* Bootstrap Toggle: bootstrap-toggle.js v2.2.0
|
3 |
+
* http://www.bootstraptoggle.com
|
4 |
+
* ========================================================================
|
5 |
+
* Copyright 2014 Min Hur, The New York Times Company
|
6 |
+
* Licensed under MIT
|
7 |
+
* ======================================================================== */
|
8 |
+
+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&&b;e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&&e[b]&&e[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="2.2.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:"",width:null,height:null},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style,width:this.$element.attr("data-width")||c.DEFAULTS.width,height:this.$element.attr("data-height")||c.DEFAULTS.height}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-lg":"small"===this.options.size?"btn-sm":"mini"===this.options.size?"btn-xs":"",c=a('<label class="btn">').html(this.options.on).addClass(this._onstyle+" "+b),d=a('<label class="btn">').html(this.options.off).addClass(this._offstyle+" "+b+" active"),e=a('<span class="toggle-handle btn btn-default">').addClass(b),f=a('<div class="toggle-group">').append(c,d,e),g=a('<div class="toggle btn" data-toggle="toggle">').addClass(this.$element.prop("checked")?this._onstyle:this._offstyle+" off").addClass(b).addClass(this.options.style);this.$element.wrap(g),a.extend(this,{$toggle:this.$element.parent(),$toggleOn:c,$toggleOff:d,$toggleGroup:f}),this.$toggle.append(f);var h=this.options.width||Math.max(c.outerWidth(),d.outerWidth())+e.outerWidth()/2,i=this.options.height||Math.max(c.outerHeight(),d.outerHeight());c.addClass("toggle-on"),d.addClass("toggle-off"),this.$toggle.css({width:h,height:i}),this.options.height&&(c.css("line-height",c.height()+"px"),d.css("line-height",d.height()+"px")),this.update(!0),this.trigger(!0)},c.prototype.toggle=function(){this.$element.prop("checked")?this.off():this.on()},c.prototype.on=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._offstyle+" off").addClass(this._onstyle),this.$element.prop("checked",!0),void(a||this.trigger()))},c.prototype.off=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._onstyle).addClass(this._offstyle+" off"),this.$element.prop("checked",!1),void(a||this.trigger()))},c.prototype.enable=function(){this.$toggle.removeAttr("disabled"),this.$element.prop("disabled",!1)},c.prototype.disable=function(){this.$toggle.attr("disabled","disabled"),this.$element.prop("disabled",!0)},c.prototype.update=function(a){this.$element.prop("disabled")?this.disable():this.enable(),this.$element.prop("checked")?this.on(a):this.off(a)},c.prototype.trigger=function(b){this.$element.off("change.bs.toggle"),b||this.$element.change(),this.$element.on("change.bs.toggle",a.proxy(function(){this.update()},this))},c.prototype.destroy=function(){this.$element.off("change.bs.toggle"),this.$toggleGroup.remove(),this.$element.removeData("bs.toggle"),this.$element.unwrap()};var d=a.fn.bootstrapToggle;a.fn.bootstrapToggle=b,a.fn.bootstrapToggle.Constructor=c,a.fn.toggle.noConflict=function(){return a.fn.bootstrapToggle=d,this},a(function(){a("input[type=checkbox][data-toggle^=toggle]").bootstrapToggle()}),a(document).on("click.bs.toggle","div[data-toggle^=toggle]",function(b){var c=a(this).find("input[type=checkbox]");c.bootstrapToggle("toggle"),b.preventDefault()})}(jQuery);
|
9 |
+
//# sourceMappingURL=bootstrap-toggle.min.js.map
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: vasyltech
|
|
3 |
Tags: access, role, user, capability, page, post, permission, security
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 4.5.3
|
6 |
-
Stable tag: 3.
|
7 |
|
8 |
One of the best tools in WordPress repository to manage access to your posts,
|
9 |
pages, categories and backend area for users, roles and visitors.
|
@@ -27,6 +27,20 @@ AAM the main objectives are to control access to your:
|
|
27 |
> AAM is very flexible and customizable plugin that is used by a lot of developers
|
28 |
> around the world to create secure and powerful WordPress solutions.
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
Check our [website page](http://vasyltech.com/advanced-access-manager) to find
|
31 |
out more about the Advanced Access Manager.
|
32 |
|
@@ -45,6 +59,15 @@ out more about the Advanced Access Manager.
|
|
45 |
|
46 |
== Changelog ==
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
= 3.3 =
|
49 |
* Improved UI
|
50 |
* Completely protect Admin Menu if restricted
|
3 |
Tags: access, role, user, capability, page, post, permission, security
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 4.5.3
|
6 |
+
Stable tag: 3.4
|
7 |
|
8 |
One of the best tools in WordPress repository to manage access to your posts,
|
9 |
pages, categories and backend area for users, roles and visitors.
|
27 |
> AAM is very flexible and customizable plugin that is used by a lot of developers
|
28 |
> around the world to create secure and powerful WordPress solutions.
|
29 |
|
30 |
+
`//Get AAM_Core_Subject. This object allows you to work with access control
|
31 |
+
//for current logged-in user or visitor
|
32 |
+
$user = AAM::getUser();
|
33 |
+
|
34 |
+
//Example 1. Get Post with ID 10 and check if current user has access to read it
|
35 |
+
//on the frontend side of the website. If true then access denied to read this post.
|
36 |
+
$user->getObject('post', 10)->has('frontend.read');
|
37 |
+
|
38 |
+
//Example 2. Get Admin Menu object and check if user has access to Media menu.
|
39 |
+
//If true then access denied to this menu
|
40 |
+
$user->getObject('menu')->has('upload.php');
|
41 |
+
|
42 |
+
//For more information feel free to contact us via email vasyl@vasyltech.com`
|
43 |
+
|
44 |
Check our [website page](http://vasyltech.com/advanced-access-manager) to find
|
45 |
out more about the Advanced Access Manager.
|
46 |
|
59 |
|
60 |
== Changelog ==
|
61 |
|
62 |
+
= 3.4 =
|
63 |
+
* Refactored backend UI implementation
|
64 |
+
* Integrated Utilities extension to the core
|
65 |
+
* Improved capability management functionality
|
66 |
+
* Improved UI
|
67 |
+
* Added caching mechanism to the core
|
68 |
+
* Improved caching mechanism
|
69 |
+
* Fixed few functional bugs
|
70 |
+
|
71 |
= 3.3 =
|
72 |
* Improved UI
|
73 |
* Completely protect Admin Menu if restricted
|