Advanced Access Manager - Version 2.2

Version Description

  • Fixed issue with jQuery UI Tooltip Widget
  • Added AAM Warning Panel
  • Added Event Log Feature
  • Moved ConfigPress to separate Page (refactored internal handling)
  • Reverted back the SSL handling
  • Added Post Delete feature
  • Added Post's Restore Default Restrictions feature
  • Added ConfigPress Extension turn on/off setting
  • Russian translation by (Maxim Kernozhitskiy http://aeromultimedia.com)
  • Removed Migration possibility
  • Refactored AAM Core Console model
  • Increased the number of saved restriction for basic version
  • Simplified Undo feature
Download this release

Release Info

Developer vasyl_m
Plugin Icon 128x128 Advanced Access Manager
Version 2.2
Comparing to
See all releases

Code changes from version 2.1 to 2.2

Files changed (66) hide show
  1. aam.php +99 -69
  2. application/control/object.php +3 -5
  3. application/control/object/backup.php +1 -1
  4. application/control/object/configpress.php +6 -4
  5. application/control/object/post.php +28 -1
  6. application/control/subject.php +5 -16
  7. application/control/subject/role.php +4 -6
  8. application/control/subject/user.php +1 -1
  9. application/control/subject/visitor.php +3 -3
  10. application/core/configpress.php +163 -0
  11. application/core/console.php +50 -7
  12. application/core/extension.php +13 -3
  13. application/core/migrate.php +0 -480
  14. application/view/abstract.php +2 -2
  15. application/view/ajax.php +35 -0
  16. application/view/configpress.php +28 -27
  17. application/view/extension.php +9 -2
  18. application/view/manager.php +8 -9
  19. application/view/post.php +66 -15
  20. application/view/tmpl/configpress.phtml +66 -15
  21. application/view/tmpl/extension.phtml +49 -7
  22. application/view/tmpl/manager.phtml +28 -10
  23. application/view/tmpl/menu.phtml +1 -1
  24. application/view/tmpl/metabox.phtml +2 -2
  25. application/view/tmpl/post.phtml +6 -1
  26. config.php +6 -34
  27. docs/configpress.pdf +0 -0
  28. extension/AAM_Activity_Log/activity.css +46 -0
  29. extension/AAM_Activity_Log/activity.js +185 -0
  30. extension/AAM_Activity_Log/activity.php +222 -0
  31. extension/AAM_Activity_Log/extension.php +295 -0
  32. extension/AAM_Activity_Log/images/info-active.png +0 -0
  33. extension/AAM_Activity_Log/images/info.png +0 -0
  34. extension/AAM_Activity_Log/images/trash-active.png +0 -0
  35. extension/AAM_Activity_Log/images/trash.png +0 -0
  36. extension/AAM_Activity_Log/index.php +14 -0
  37. extension/AAM_Activity_Log/ui.phtml +32 -0
  38. extension/AAM_Multisite_Support/multisite.js +5 -5
  39. extension/AAM_My_Feature/extension.php +1 -1
  40. lang/aam-ru_RU.mo +0 -0
  41. lang/aam-ru_RU.po +334 -0
  42. media/css/aam.css +54 -23
  43. media/css/codemirror.css +4 -2
  44. media/css/configpress.css +114 -0
  45. media/css/extension.css +18 -0
  46. media/css/images/cmanager/restore-active.png +0 -0
  47. media/css/images/cmanager/restore.png +0 -0
  48. media/css/images/configpress/pdf-active.png +0 -0
  49. media/css/images/configpress/pdf.png +0 -0
  50. media/css/images/post/delete-active.png +0 -0
  51. media/css/images/post/delete.png +0 -0
  52. media/css/images/post/restore-active.png +0 -0
  53. media/css/images/post/restore.png +0 -0
  54. media/css/images/post/trash-active.png +0 -0
  55. media/css/images/post/trash.png +0 -0
  56. media/css/images/warning.png +0 -0
  57. media/css/jquery.dt.css +1 -1
  58. media/css/migrate.css +0 -67
  59. media/css/migrate/completed.png +0 -0
  60. media/css/migrate/failure.png +0 -0
  61. media/css/migrate/pending.png +0 -0
  62. media/css/migrate/wait.png +0 -0
  63. media/js/aam.js +217 -75
  64. media/js/configpress.js +56 -0
  65. media/js/migrate.js +0 -147
  66. readme.txt +66 -17
aam.php CHANGED
@@ -1,8 +1,9 @@
1
  <?php
 
2
  /**
3
  Plugin Name: Advanced Access Manager
4
  Description: Manage User and Role Access to WordPress Backend and Frontend.
5
- Version: 2.1
6
  Author: Vasyl Martyniuk <support@wpaam.com>
7
  Author URI: http://www.wpaam.com
8
 
@@ -12,7 +13,6 @@
12
  * file 'license.txt', which is part of this source code package. *
13
  * ======================================================================
14
  */
15
-
16
  require(dirname(__FILE__) . '/config.php');
17
 
18
  /**
@@ -92,6 +92,8 @@ class aam {
92
  add_action('admin_action_edit', array($this, 'adminActionEdit'), 10);
93
  //wp die hook
94
  add_filter('wp_die_handler', array($this, 'wpDie'), 10);
 
 
95
  } else {
96
  //control WordPress frontend
97
  add_action('wp', array($this, 'wp'), 999);
@@ -218,7 +220,7 @@ class aam {
218
  foreach ($terms as $i => $term) {
219
  if (is_object($term)) {
220
  $object = $this->getUser()->getObject(
221
- aam_Control_Object_Term::UID, $term->term_id
222
  );
223
  if ($object->has($area, aam_Control_Object_Term::ACTION_LIST)) {
224
  unset($terms[$i]);
@@ -240,14 +242,13 @@ class aam {
240
  * @access public
241
  * @todo Cache this process
242
  */
243
- public function getPages($pages){
244
-
245
- if (is_array($pages)){
246
- foreach($pages as $i => $page){
247
  $object = $this->getUser()->getObject(
248
- aam_Control_Object_Post::UID, $page->ID
249
  );
250
- if ($object->has('frontend', aam_Control_Object_Post::ACTION_EXCLUDE)){
251
  unset($pages[$i]);
252
  }
253
  }
@@ -265,22 +266,22 @@ class aam {
265
  *
266
  * @access public
267
  */
268
- public function getNavigationMenu($pages){
269
- if (is_array($pages)){
270
- foreach($pages as $i => $page){
271
- if ($page->type === 'taxonomy'){
272
  $object = $this->getUser()->getObject(
273
- aam_Control_Object_Term::UID, $page->object_id
274
  );
275
  $exclude = aam_Control_Object_Term::ACTION_EXCLUDE;
276
  } else {
277
  $object = $this->getUser()->getObject(
278
- aam_Control_Object_Post::UID, $page->object_id
279
  );
280
  $exclude = aam_Control_Object_Post::ACTION_EXCLUDE;
281
  }
282
 
283
- if ($object->has('frontend', $exclude)){
284
  unset($pages[$i]);
285
  }
286
  }
@@ -339,16 +340,19 @@ class aam {
339
  * @access public
340
  */
341
  public function reject() {
342
- $cpress = $this->getUser()->getObject(aam_Control_Object_ConfigPress::UID);
343
  if (is_admin()) {
344
- $redirect = $cpress->getParam('backend.access.deny.redirect');
345
- $message = $cpress->getParam(
346
- 'backend.access.deny.message', __('Access denied', 'aam')
 
 
347
  );
348
  } else {
349
- $redirect = $cpress->getParam('frontend.access.deny.redirect');
350
- $message = $cpress->getParam(
351
- 'frontend.access.deny.message', __('Access denied', 'aam')
 
 
352
  );
353
  }
354
 
@@ -373,10 +377,9 @@ class aam {
373
  * @access public
374
  */
375
  public function wpDie($function) {
376
- $cpress = $this->getUser()->getObject(aam_Control_Object_ConfigPress::UID);
377
- $redirect = $cpress->getParam('backend.access.deny.redirect');
378
- $message = $cpress->getParam(
379
- 'backend.access.deny.message', __('Access denied', 'aam')
380
  );
381
 
382
  if (filter_var($redirect, FILTER_VALIDATE_URL)) {
@@ -506,9 +509,6 @@ class aam {
506
  $subject
507
  );
508
 
509
- $configPress = new aam_Control_Object_ConfigPress($subject, 1);
510
- $objects[aam_Control_Object_ConfigPress::UID] = $configPress;
511
-
512
  return $objects;
513
  }
514
 
@@ -576,9 +576,7 @@ class aam {
576
  wp_mail($event['action_specifier'], $subject, $message);
577
  } else if ($event['action'] == 'change_status') {
578
  $wpdb->update(
579
- $wpdb->posts,
580
- array('post_status' => $event['action_specifier']),
581
- array('ID' => $post_ID)
582
  );
583
  } else if ($event['action'] == 'custom') {
584
  if (is_callable($event['callback'])) {
@@ -646,6 +644,17 @@ class aam {
646
  return (aam_Core_Request::get('page') == 'aam-ext' ? true : false);
647
  }
648
 
 
 
 
 
 
 
 
 
 
 
 
649
  /**
650
  * Print necessary styles
651
  *
@@ -661,7 +670,6 @@ class aam {
661
  wp_enqueue_style('aam-ui-style', AAM_MEDIA_URL . 'css/jquery-ui.css');
662
  wp_enqueue_style('aam-style', AAM_MEDIA_URL . 'css/aam.css');
663
  wp_enqueue_style('aam-datatables', AAM_MEDIA_URL . 'css/jquery.dt.css');
664
- wp_enqueue_style('aam-codemirror', AAM_MEDIA_URL . 'css/codemirror.css');
665
  wp_enqueue_style(
666
  'aam-treeview', AAM_MEDIA_URL . 'css/jquery.treeview.css'
667
  );
@@ -672,12 +680,11 @@ class aam {
672
  wp_enqueue_style('aam-ui-style', AAM_MEDIA_URL . 'css/jquery-ui.css');
673
  wp_enqueue_style('aam-style', AAM_MEDIA_URL . 'css/extension.css');
674
  wp_enqueue_style('aam-datatables', AAM_MEDIA_URL . 'css/jquery.dt.css');
 
 
 
675
  }
676
 
677
- //migration functionality. TODO - remove in July 15 2014
678
- if (class_exists('aam_Core_Migrate')){
679
- wp_enqueue_style('aam-migrate', AAM_MEDIA_URL . 'css/migrate.css');
680
- }
681
  }
682
 
683
  /**
@@ -693,8 +700,6 @@ class aam {
693
  wp_enqueue_script('dashboard');
694
  wp_enqueue_script('aam-admin', AAM_MEDIA_URL . 'js/aam.js');
695
  wp_enqueue_script('aam-datatables', AAM_MEDIA_URL . 'js/jquery.dt.js');
696
- wp_enqueue_script('aam-codemirror', AAM_MEDIA_URL . 'js/codemirror.js');
697
- wp_enqueue_script('aam-cmini', AAM_MEDIA_URL . 'js/properties.js');
698
  wp_enqueue_script(
699
  'aam-treeview', AAM_MEDIA_URL . 'js/jquery.treeview.js'
700
  );
@@ -742,16 +747,19 @@ class aam {
742
  'labels' => aam_View_Manager::uiLabels()
743
  );
744
  wp_localize_script('aam-admin', 'aamLocal', $localization);
745
- }
 
 
 
 
 
 
746
 
747
- //migration functionality. TODO - remove in July 15 2014
748
- if (class_exists('aam_Core_Migrate')){
749
- wp_enqueue_script('aam-migrate', AAM_MEDIA_URL . 'js/migrate.js');
750
  $localization = array(
751
  'nonce' => wp_create_nonce('aam_ajax'),
752
  'ajaxurl' => admin_url('admin-ajax.php'),
753
  );
754
- wp_localize_script('aam-migrate', 'aamMigrateLocal', $localization);
755
  }
756
  }
757
 
@@ -803,9 +811,9 @@ class aam {
803
  global $post;
804
 
805
  //make sure that nobody is playing with screen options
806
- if ($post instanceof WP_Post){
807
  $screen = $post->post_type;
808
- } elseif($screen_object = get_current_screen()) {
809
  $screen = $screen_object->id;
810
  } else {
811
  $screen = '';
@@ -815,8 +823,8 @@ class aam {
815
  $model = new aam_View_Metabox;
816
  $model->run($screen);
817
  } else {
818
- $this->getUser()->getObject(aam_Control_Object_Metabox::UID)
819
- ->filterBackend($screen);
820
  }
821
  }
822
 
@@ -830,35 +838,45 @@ class aam {
830
  public function adminMenu() {
831
  //register the menu
832
  add_menu_page(
833
- __('AAM', 'aam'),
834
- __('AAM', 'aam'),
835
- 'administrator',
836
- 'aam',
837
- array($this, 'content'),
838
- AAM_BASE_URL . 'active-menu.png'
839
  );
840
  //register submenus
841
  add_submenu_page(
842
- 'aam',
843
- __('Access Control', 'aam'),
844
- __('Access Control', 'aam'),
845
- 'administrator',
846
- 'aam',
847
- array($this, 'content')
848
  );
849
  add_submenu_page(
850
- 'aam',
851
- __('Extensions', 'aam'),
852
- __('Extensions', 'aam'),
853
- 'administrator',
854
- 'aam-ext',
855
- array($this, 'extensionContent')
856
  );
857
 
858
  //filter admin menu
859
  $this->getUser()->getObject(aam_Control_Object_Menu::UID)->filter();
860
  }
861
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
862
  /**
863
  * Render Main Content page
864
  *
@@ -871,6 +889,18 @@ class aam {
871
  echo $manager->run();
872
  }
873
 
 
 
 
 
 
 
 
 
 
 
 
 
874
  /**
875
  * Extension content page
876
  *
@@ -963,7 +993,7 @@ class aam {
963
  *
964
  * @access public
965
  */
966
- public function shutdown(){
967
  $this->getUser()->saveCache();
968
  }
969
 
@@ -984,4 +1014,4 @@ class aam {
984
  add_action('init', 'aam::initialize');
985
 
986
  //register_activation_hook(__FILE__, array('aam', 'activate'));
987
- register_uninstall_hook(__FILE__, array('aam', 'uninstall'));
1
  <?php
2
+
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: Manage User and Role Access to WordPress Backend and Frontend.
6
+ Version: 2.2
7
  Author: Vasyl Martyniuk <support@wpaam.com>
8
  Author URI: http://www.wpaam.com
9
 
13
  * file 'license.txt', which is part of this source code package. *
14
  * ======================================================================
15
  */
 
16
  require(dirname(__FILE__) . '/config.php');
17
 
18
  /**
92
  add_action('admin_action_edit', array($this, 'adminActionEdit'), 10);
93
  //wp die hook
94
  add_filter('wp_die_handler', array($this, 'wpDie'), 10);
95
+ //***For UI purposes***
96
+ add_action('parse_tax_query', array($this, 'parseTaxQuery'), 10, 1);
97
  } else {
98
  //control WordPress frontend
99
  add_action('wp', array($this, 'wp'), 999);
220
  foreach ($terms as $i => $term) {
221
  if (is_object($term)) {
222
  $object = $this->getUser()->getObject(
223
+ aam_Control_Object_Term::UID, $term->term_id
224
  );
225
  if ($object->has($area, aam_Control_Object_Term::ACTION_LIST)) {
226
  unset($terms[$i]);
242
  * @access public
243
  * @todo Cache this process
244
  */
245
+ public function getPages($pages) {
246
+ if (is_array($pages)) {
247
+ foreach ($pages as $i => $page) {
 
248
  $object = $this->getUser()->getObject(
249
+ aam_Control_Object_Post::UID, $page->ID
250
  );
251
+ if ($object->has('frontend', aam_Control_Object_Post::ACTION_EXCLUDE)) {
252
  unset($pages[$i]);
253
  }
254
  }
266
  *
267
  * @access public
268
  */
269
+ public function getNavigationMenu($pages) {
270
+ if (is_array($pages)) {
271
+ foreach ($pages as $i => $page) {
272
+ if ($page->type === 'taxonomy') {
273
  $object = $this->getUser()->getObject(
274
+ aam_Control_Object_Term::UID, $page->object_id
275
  );
276
  $exclude = aam_Control_Object_Term::ACTION_EXCLUDE;
277
  } else {
278
  $object = $this->getUser()->getObject(
279
+ aam_Control_Object_Post::UID, $page->object_id
280
  );
281
  $exclude = aam_Control_Object_Post::ACTION_EXCLUDE;
282
  }
283
 
284
+ if ($object->has('frontend', $exclude)) {
285
  unset($pages[$i]);
286
  }
287
  }
340
  * @access public
341
  */
342
  public function reject() {
 
343
  if (is_admin()) {
344
+ $redirect = aam_Core_ConfigPress::getParam(
345
+ 'backend.access.deny.redirect'
346
+ );
347
+ $message = aam_Core_ConfigPress::getParam(
348
+ 'backend.access.deny.message', __('Access denied', 'aam')
349
  );
350
  } else {
351
+ $redirect = aam_Core_ConfigPress::getParam(
352
+ 'frontend.access.deny.redirect'
353
+ );
354
+ $message = aam_Core_ConfigPress::getParam(
355
+ 'frontend.access.deny.message', __('Access denied', 'aam')
356
  );
357
  }
358
 
377
  * @access public
378
  */
379
  public function wpDie($function) {
380
+ $redirect = aam_Core_ConfigPress::getParam('backend.access.deny.redirect');
381
+ $message = aam_Core_ConfigPress::getParam(
382
+ 'backend.access.deny.message', __('Access denied', 'aam')
 
383
  );
384
 
385
  if (filter_var($redirect, FILTER_VALIDATE_URL)) {
509
  $subject
510
  );
511
 
 
 
 
512
  return $objects;
513
  }
514
 
576
  wp_mail($event['action_specifier'], $subject, $message);
577
  } else if ($event['action'] == 'change_status') {
578
  $wpdb->update(
579
+ $wpdb->posts, array('post_status' => $event['action_specifier']), array('ID' => $post_ID)
 
 
580
  );
581
  } else if ($event['action'] == 'custom') {
582
  if (is_callable($event['callback'])) {
644
  return (aam_Core_Request::get('page') == 'aam-ext' ? true : false);
645
  }
646
 
647
+ /**
648
+ * Make sure that AAM ConfigPress UI Page is used
649
+ *
650
+ * @return boolean
651
+ *
652
+ * @access public
653
+ */
654
+ public function isAAMConfigPressScreen() {
655
+ return (aam_Core_Request::get('page') == 'aam-configpress' ? true : false);
656
+ }
657
+
658
  /**
659
  * Print necessary styles
660
  *
670
  wp_enqueue_style('aam-ui-style', AAM_MEDIA_URL . 'css/jquery-ui.css');
671
  wp_enqueue_style('aam-style', AAM_MEDIA_URL . 'css/aam.css');
672
  wp_enqueue_style('aam-datatables', AAM_MEDIA_URL . 'css/jquery.dt.css');
 
673
  wp_enqueue_style(
674
  'aam-treeview', AAM_MEDIA_URL . 'css/jquery.treeview.css'
675
  );
680
  wp_enqueue_style('aam-ui-style', AAM_MEDIA_URL . 'css/jquery-ui.css');
681
  wp_enqueue_style('aam-style', AAM_MEDIA_URL . 'css/extension.css');
682
  wp_enqueue_style('aam-datatables', AAM_MEDIA_URL . 'css/jquery.dt.css');
683
+ } elseif ($this->isAAMConfigPressScreen()) {
684
+ wp_enqueue_style('aam-style', AAM_MEDIA_URL . 'css/configpress.css');
685
+ wp_enqueue_style('aam-codemirror', AAM_MEDIA_URL . 'css/codemirror.css');
686
  }
687
 
 
 
 
 
688
  }
689
 
690
  /**
700
  wp_enqueue_script('dashboard');
701
  wp_enqueue_script('aam-admin', AAM_MEDIA_URL . 'js/aam.js');
702
  wp_enqueue_script('aam-datatables', AAM_MEDIA_URL . 'js/jquery.dt.js');
 
 
703
  wp_enqueue_script(
704
  'aam-treeview', AAM_MEDIA_URL . 'js/jquery.treeview.js'
705
  );
747
  'labels' => aam_View_Manager::uiLabels()
748
  );
749
  wp_localize_script('aam-admin', 'aamLocal', $localization);
750
+ } elseif ($this->isAAMConfigPressScreen()) {
751
+ wp_enqueue_script('jquery-ui-core');
752
+ wp_enqueue_script('jquery-effects-core');
753
+ wp_enqueue_script('jquery-effects-highlight');
754
+ wp_enqueue_script('aam-admin', AAM_MEDIA_URL . 'js/configpress.js');
755
+ wp_enqueue_script('aam-codemirror', AAM_MEDIA_URL . 'js/codemirror.js');
756
+ wp_enqueue_script('aam-cmini', AAM_MEDIA_URL . 'js/properties.js');
757
 
 
 
 
758
  $localization = array(
759
  'nonce' => wp_create_nonce('aam_ajax'),
760
  'ajaxurl' => admin_url('admin-ajax.php'),
761
  );
762
+ wp_localize_script('aam-admin', 'aamLocal', $localization);
763
  }
764
  }
765
 
811
  global $post;
812
 
813
  //make sure that nobody is playing with screen options
814
+ if ($post instanceof WP_Post) {
815
  $screen = $post->post_type;
816
+ } elseif ($screen_object = get_current_screen()) {
817
  $screen = $screen_object->id;
818
  } else {
819
  $screen = '';
823
  $model = new aam_View_Metabox;
824
  $model->run($screen);
825
  } else {
826
+ $this->getUser()->getObject(aam_Control_Object_Metabox::UID)
827
+ ->filterBackend($screen);
828
  }
829
  }
830
 
838
  public function adminMenu() {
839
  //register the menu
840
  add_menu_page(
841
+ __('AAM', 'aam'), __('AAM', 'aam'), 'administrator', 'aam', array($this, 'content'), AAM_BASE_URL . 'active-menu.png'
 
 
 
 
 
842
  );
843
  //register submenus
844
  add_submenu_page(
845
+ 'aam', __('Access Control', 'aam'), __('Access Control', 'aam'), 'administrator', 'aam', array($this, 'content')
846
+ );
847
+ add_submenu_page(
848
+ 'aam', __('ConfigPress', 'aam'), __('ConfigPress', 'aam'), 'administrator', 'aam-configpress', array($this, 'configPressContent')
 
 
849
  );
850
  add_submenu_page(
851
+ 'aam', __('Extensions', 'aam'), __('Extensions', 'aam'), 'administrator', 'aam-ext', array($this, 'extensionContent')
 
 
 
 
 
852
  );
853
 
854
  //filter admin menu
855
  $this->getUser()->getObject(aam_Control_Object_Menu::UID)->filter();
856
  }
857
 
858
+ /**
859
+ * Take control over Tax Query parser
860
+ *
861
+ * By default WordPress consider non-empty term & category pair as search by
862
+ * slug. This is weird assumption and there is no other way to force core to
863
+ * search posts within custom taxonomy rather than take control over it with
864
+ * action parse_tax_query.
865
+ *
866
+ * @param WP_Query $query
867
+ *
868
+ * @return void
869
+ *
870
+ * @access public
871
+ */
872
+ public function parseTaxQuery($query) {
873
+ if (!empty($query->query['term']) && !empty($query->query['taxonomy'])) {
874
+ foreach ($query->tax_query->queries as $id => $dump) {
875
+ $query->tax_query->queries[$id]['field'] = 'term_id';
876
+ }
877
+ }
878
+ }
879
+
880
  /**
881
  * Render Main Content page
882
  *
889
  echo $manager->run();
890
  }
891
 
892
+ /**
893
+ * Render ConfigPress Page
894
+ *
895
+ * @return void
896
+ *
897
+ * @access public
898
+ */
899
+ public function configPressContent() {
900
+ $manager = new aam_View_ConfigPress();
901
+ echo $manager->run();
902
+ }
903
+
904
  /**
905
  * Extension content page
906
  *
993
  *
994
  * @access public
995
  */
996
+ public function shutdown() {
997
  $this->getUser()->saveCache();
998
  }
999
 
1014
  add_action('init', 'aam::initialize');
1015
 
1016
  //register_activation_hook(__FILE__, array('aam', 'activate'));
1017
+ register_uninstall_hook(__FILE__, array('aam', 'uninstall'));
application/control/object.php CHANGED
@@ -75,11 +75,9 @@ abstract class aam_Control_Object {
75
  * @access public
76
  */
77
  public function init($object_id) {
78
- //if (empty($this->_option)) {
79
- $this->setOption(
80
- $this->getSubject()->readOption($this->getUID(), $object_id)
81
- );
82
- //}
83
  }
84
 
85
  /**
75
  * @access public
76
  */
77
  public function init($object_id) {
78
+ $this->setOption(
79
+ $this->getSubject()->readOption($this->getUID(), $object_id)
80
+ );
 
 
81
  }
82
 
83
  /**
application/control/object/backup.php CHANGED
@@ -23,7 +23,7 @@ class aam_Control_Object_Backup extends aam_Control_Object {
23
  /**
24
  *
25
  */
26
- const ROLEBACK_TIMES = 3;
27
 
28
  /**
29
  *
23
  /**
24
  *
25
  */
26
+ const ROLEBACK_TIMES = 1;
27
 
28
  /**
29
  *
application/control/object/configpress.php CHANGED
@@ -7,11 +7,15 @@
7
  */
8
 
9
  /**
10
- *
 
 
 
11
  * @package AAM
12
  * @author Vasyl Martyniuk <support@wpaam.com>
13
  * @copyright Copyright C 2013 Vasyl Martyniuk
14
  * @license GNU General Public License {@link http://www.gnu.org/licenses/}
 
15
  */
16
  class aam_Control_Object_ConfigPress extends aam_Control_Object {
17
 
@@ -69,7 +73,6 @@ class aam_Control_Object_ConfigPress extends aam_Control_Object {
69
  );
70
  } else {
71
  $response = false;
72
- aam_Core_Console::write('Temp directory is not writable');
73
  }
74
 
75
  return $response;
@@ -112,7 +115,7 @@ class aam_Control_Object_ConfigPress extends aam_Control_Object {
112
  try {
113
  $this->setTree(new Zend_Config_Ini($filename));
114
  } catch (Zend_Config_Exception $e) {
115
- aam_Core_Console::write($e->getMessage());
116
  }
117
  }
118
 
@@ -128,7 +131,6 @@ class aam_Control_Object_ConfigPress extends aam_Control_Object {
128
  if (is_string($func) && is_callable($func)) {
129
  $response = call_user_func($func);
130
  } else {
131
- aam_Core_Console::write("ConfigPress userFunc {$func} failure");
132
  $response = $default;
133
  }
134
  } else {
7
  */
8
 
9
  /**
10
+ * ConfigPress Legacy
11
+ *
12
+ * Keep this object for compatibility reasons
13
+ *
14
  * @package AAM
15
  * @author Vasyl Martyniuk <support@wpaam.com>
16
  * @copyright Copyright C 2013 Vasyl Martyniuk
17
  * @license GNU General Public License {@link http://www.gnu.org/licenses/}
18
+ * @todo Remove in 4/30/2014
19
  */
20
  class aam_Control_Object_ConfigPress extends aam_Control_Object {
21
 
73
  );
74
  } else {
75
  $response = false;
 
76
  }
77
 
78
  return $response;
115
  try {
116
  $this->setTree(new Zend_Config_Ini($filename));
117
  } catch (Zend_Config_Exception $e) {
118
+ aam_Core_Console::add('ConfigPress parsing error');
119
  }
120
  }
121
 
131
  if (is_string($func) && is_callable($func)) {
132
  $response = call_user_func($func);
133
  } else {
 
134
  $response = $default;
135
  }
136
  } else {
application/control/object/post.php CHANGED
@@ -61,12 +61,21 @@ class aam_Control_Object_Post extends aam_Control_Object {
61
  * @var type
62
  */
63
  private $_option = array();
 
 
 
 
 
 
 
 
 
64
 
65
  /**
66
  * @inheritdoc
67
  */
68
  public function __sleep(){
69
- return array('_post', '_option');
70
  }
71
 
72
  /**
@@ -82,6 +91,7 @@ class aam_Control_Object_Post extends aam_Control_Object {
82
  */
83
  public function save($params = null) {
84
  if (is_array($params)) {
 
85
  update_post_meta($this->getPost()->ID, $this->getOptionName(), $params);
86
  }
87
  }
@@ -217,6 +227,7 @@ class aam_Control_Object_Post extends aam_Control_Object {
217
  $access = $term->getOption();
218
  if (isset($access['post']) && $access['post']) {
219
  $result = array('post' => $access['post']);
 
220
  } elseif (is_object($term->getTerm()) && $term->getTerm()->parent) {
221
  $result = $this->inheritAccess($term->getTerm()->parent);
222
  } else {
@@ -269,6 +280,22 @@ class aam_Control_Object_Post extends aam_Control_Object {
269
  public function getOption() {
270
  return $this->_option;
271
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
 
273
  /**
274
  *
61
  * @var type
62
  */
63
  private $_option = array();
64
+
65
+ /**
66
+ * Indicator that settings where inherited
67
+ *
68
+ * @var boolean
69
+ *
70
+ * @access private
71
+ */
72
+ private $_inherited = false;
73
 
74
  /**
75
  * @inheritdoc
76
  */
77
  public function __sleep(){
78
+ return array('_post', '_option', '_inherited');
79
  }
80
 
81
  /**
91
  */
92
  public function save($params = null) {
93
  if (is_array($params)) {
94
+ $this->setInherited(false);
95
  update_post_meta($this->getPost()->ID, $this->getOptionName(), $params);
96
  }
97
  }
227
  $access = $term->getOption();
228
  if (isset($access['post']) && $access['post']) {
229
  $result = array('post' => $access['post']);
230
+ $this->setInherited(true);
231
  } elseif (is_object($term->getTerm()) && $term->getTerm()->parent) {
232
  $result = $this->inheritAccess($term->getTerm()->parent);
233
  } else {
280
  public function getOption() {
281
  return $this->_option;
282
  }
283
+
284
+ /**
285
+ *
286
+ * @param type $flag
287
+ */
288
+ public function setInherited($flag){
289
+ $this->_inherited = $flag;
290
+ }
291
+
292
+ /**
293
+ *
294
+ * @return type
295
+ */
296
+ public function getInherited(){
297
+ return $this->_inherited;
298
+ }
299
 
300
  /**
301
  *
application/control/subject.php CHANGED
@@ -86,8 +86,7 @@ abstract class aam_Control_Subject {
86
  * @access public
87
  */
88
  public function initCache(){
89
- $cpress = $this->getObject(aam_Control_Object_ConfigPress::UID);
90
- if ($cpress->getParam('aam.caching', 'false') === "true"){
91
  $this->setObjects($this->readCache());
92
  foreach($this->_objects as $objects){
93
  foreach($objects as $object){
@@ -107,9 +106,8 @@ abstract class aam_Control_Subject {
107
  * @access public
108
  */
109
  public function saveCache(){
110
- $cpress = $this->getObject(aam_Control_Object_ConfigPress::UID);
111
- if (($this->_updateCache === true)
112
- && ($cpress->getParam('aam.caching', 'false') === "true")){
113
  $this->updateCache();
114
  }
115
  }
@@ -130,9 +128,6 @@ abstract class aam_Control_Subject {
130
  if (method_exists($subject, $name)) {
131
  $response = call_user_func_array(array($subject, $name), $arguments);
132
  } else {
133
- aam_Core_Console::write(
134
- "Method {$name} does not exist in " . get_class($subject)
135
- );
136
  $response = null;
137
  }
138
 
@@ -263,16 +258,10 @@ abstract class aam_Control_Subject {
263
  );
264
  } else {
265
  $this->_objects[$object][$object_id] = apply_filters(
266
- 'aam_object', $this, $object, $object_id
267
  );
268
  }
269
-
270
- //optimize the memory. make sure that the number of objects is not longer
271
- //than 50, othewise remove first one (most likely it is not used)
272
- if (count($this->_objects[$object]) > 50){
273
- array_shift($this->_objects[$object]); //remove the first
274
- }
275
-
276
  //set update cache flag to true if object can be cached
277
  if ($this->_objects[$object][$object_id]->cacheObject() === true){
278
  $this->_updateCache = true;
86
  * @access public
87
  */
88
  public function initCache(){
89
+ if (aam_Core_ConfigPress::getParam('aam.caching', 'false') === "true"){
 
90
  $this->setObjects($this->readCache());
91
  foreach($this->_objects as $objects){
92
  foreach($objects as $object){
106
  * @access public
107
  */
108
  public function saveCache(){
109
+ $caching = aam_Core_ConfigPress::getParam('aam.caching', 'false');
110
+ if (($this->_updateCache === true) && ($caching === "true")){
 
111
  $this->updateCache();
112
  }
113
  }
128
  if (method_exists($subject, $name)) {
129
  $response = call_user_func_array(array($subject, $name), $arguments);
130
  } else {
 
 
 
131
  $response = null;
132
  }
133
 
258
  );
259
  } else {
260
  $this->_objects[$object][$object_id] = apply_filters(
261
+ 'aam_object', null, $object, $object_id
262
  );
263
  }
264
+
 
 
 
 
 
 
265
  //set update cache flag to true if object can be cached
266
  if ($this->_objects[$object][$object_id]->cacheObject() === true){
267
  $this->_updateCache = true;
application/control/subject/role.php CHANGED
@@ -32,9 +32,7 @@ class aam_Control_Subject_Role extends aam_Control_Subject {
32
  $roles = new WP_Roles;
33
  $role = $roles->get_role($this->getId());
34
 
35
- if (is_null($role)) {
36
- aam_Core_Console::write('Role ' . $this->getId() . ' does not exist');
37
- } elseif (isset($role->capabilities)){
38
  //add role capability as role id, weird WordPress behavior
39
  //example is administrator capability
40
  $role->capabilities[$this->getId()] = true;
@@ -142,7 +140,7 @@ class aam_Control_Subject_Role extends aam_Control_Subject {
142
  * @param type $object_id
143
  * @return type
144
  */
145
- public function updateOption($value, $object, $object_id = '') {
146
  return aam_Core_API::updateBlogOption(
147
  $this->getOptionName($object, $object_id), $value
148
  );
@@ -155,7 +153,7 @@ class aam_Control_Subject_Role extends aam_Control_Subject {
155
  * @param type $default
156
  * @return type
157
  */
158
- public function readOption($object, $object_id = '', $default = null) {
159
  return aam_Core_API::getBlogOption(
160
  $this->getOptionName($object, $object_id), $default
161
  );
@@ -167,7 +165,7 @@ class aam_Control_Subject_Role extends aam_Control_Subject {
167
  * @param type $object_id
168
  * @return type
169
  */
170
- public function deleteOption($object, $object_id = '') {
171
  return aam_Core_API::deleteBlogOption(
172
  $this->getOptionName($object, $object_id)
173
  );
32
  $roles = new WP_Roles;
33
  $role = $roles->get_role($this->getId());
34
 
35
+ if (!is_null($role) && isset($role->capabilities)){
 
 
36
  //add role capability as role id, weird WordPress behavior
37
  //example is administrator capability
38
  $role->capabilities[$this->getId()] = true;
140
  * @param type $object_id
141
  * @return type
142
  */
143
+ public function updateOption($value, $object, $object_id = 0) {
144
  return aam_Core_API::updateBlogOption(
145
  $this->getOptionName($object, $object_id), $value
146
  );
153
  * @param type $default
154
  * @return type
155
  */
156
+ public function readOption($object, $object_id = 0, $default = null) {
157
  return aam_Core_API::getBlogOption(
158
  $this->getOptionName($object, $object_id), $default
159
  );
165
  * @param type $object_id
166
  * @return type
167
  */
168
+ public function deleteOption($object, $object_id = 0) {
169
  return aam_Core_API::deleteBlogOption(
170
  $this->getOptionName($object, $object_id)
171
  );
application/control/subject/user.php CHANGED
@@ -1 +1 @@
1
- <?php
2
  * ======================================================================
3
  * LICENSE: This file is subject to the terms and conditions defined in *
4
  * file 'license.txt', which is part of this source code package. *
5
  * ======================================================================
6
  */
7
  *
8
  * @package AAM
9
  * @author Vasyl Martyniuk <support@wpaam.com>
10
  * @copyright Copyright C 2013 Vasyl Martyniuk
11
  * @license GNU General Public License {@link http://www.gnu.org/licenses/}
12
  */
13
  /**
14
  * Subject UID: USER
15
  */
16
  const UID = 'user';
17
  /**
18
  * AAM Capability Key
19
  *
20
  * WordPress does not allow to have different set of capabilities for one user
21
  * between sites. aam_capability key stores the set of capabilities stored after
22
  * individual user edit and merge them with system capabilities.
23
  * The merging process overwrites allcaps.
24
  *
25
  * @var array
26
  *
27
  * @access private
28
  */
29
  private $_cap_key = '';
30
  /**
31
  *
32
  * @param type $id
33
  */
34
  public function __construct($id) {
35
  parent::__construct($id);
36
  //overwrite default set of capabilities if AAM capset is defined
37
  if ($this->isDefaultCapSet() === false){
38
  //make sure that aam_capability is actually array
39
  if (is_array($this->getSubject()->aam_caps)){
40
  $allcaps = array_merge(
41
  $this->getSubject()->allcaps, $this->getSubject()->aam_caps
42
  );
43
  $this->getSubject()->allcaps = $allcaps;
44
  }
45
  }
46
  }
47
  /**
48
  *
49
  * @return type
50
  */
51
  public function delete() {
52
  $response = false;
53
  if (current_user_can('delete_users')
54
  && ($this->getId() !== get_current_user_id())) {
55
  $response = wp_delete_user($this->getId());
56
  }
57
  return $response;
58
  }
59
  /**
60
  *
61
  * @global type $wpdb
62
  * @return boolean
63
  */
64
  public function block() {
65
  global $wpdb;
66
  $response = false;
67
  if (current_user_can('edit_users')
68
  && ($this->getId() != get_current_user_id())) {
69
  $status = ($this->getSubject()->user_status == 0 ? 1 : 0);
70
  if ($wpdb->update(
71
  $wpdb->users,
72
  array('user_status' => $status),
73
  array('ID' => $this->getId())
74
  )) {
75
  $this->getSubject()->user_status = $status;
76
  clean_user_cache($this->getSubject());
77
  $response = true;
78
  }
79
  }
80
  return $response;
81
  }
82
  /**
83
  * Retrieve User based on ID
84
  *
85
  * @return WP_Role|null
86
  *
87
  * @access protected
88
  */
89
  protected function retrieveSubject() {
90
  global $current_user;
91
  if ($current_user instanceof WP_User && $current_user->ID == $this->getId()) {
92
  $subject = $current_user;
93
  } else {
94
  $subject = new WP_User($this->getId());
95
  }
96
  //retrieve aam capabilities if are not retrieved yet
97
  $this->_cap_key = 'aam_capability';
98
  $subject->aam_caps = get_user_option($this->_cap_key, $this->getId());
99
  return $subject;
100
  }
101
  /**
102
  * Check if user has default capability set
103
  *
104
  * @return boolean
105
  *
106
  * @access public
107
  */
108
  public function isDefaultCapSet(){
109
  return empty($this->getSubject()->aam_caps);
110
  }
111
  /**
112
  *
113
  * @return type
114
  */
115
  public function getCapabilities() {
116
  return $this->getSubject()->allcaps;
117
  }
118
  /**
119
  *
120
  * @param type $capability
121
  * @return type
122
  */
123
  public function hasCapability($capability) {
124
  return user_can($this->getSubject(), $capability);
125
  }
126
  /**
127
  * Check if Subject has capability
128
  *
129
  * Keep compatible with WordPress core
130
  *
131
  * @param string $capability
132
  *
133
  * @return boolean
134
  *
135
  * @access public
136
  */
137
  public function addCapability($capability) {
138
  return $this->updateCapability($capability, true);
139
  }
140
  /**
141
  * Remove Capability
142
  *
143
  * @param string $capability
144
  *
145
  * @return boolean
146
  *
147
  * @access public
148
  */
149
  public function removeCapability($capability) {
150
  return $this->updateCapability($capability, false);
151
  }
152
  /**
153
  * Reset User Capability
154
  *
155
  * @return array
156
  *
157
  * @access public
158
  */
159
  public function resetCapability(){
160
  return delete_user_option($this->getId(), $this->_cap_key);
161
  }
162
  /**
163
  * Update User's Capability Set
164
  *
165
  * @param string $capability
166
  * @param boolean $grand
167
  *
168
  * @return boolean
169
  *
170
  * @access public
171
  */
172
  public function updateCapability($capability, $grand){
173
  //make sure that we have right array
174
  if (is_array($this->getSubject()->aam_caps)){
175
  $aam_caps = $this->getSubject()->aam_caps;
176
  } else {
177
  $aam_caps = array();
178
  }
179
  //add capability
180
  $aam_caps[$capability] = $grand;
181
  //update user data. TODO - Keep eyes on this part
182
  $this->getSubject()->data->aam_caps = $aam_caps;
183
  //save and return the result of operation
184
  return update_user_option($this->getId(), $this->_cap_key, $aam_caps);
185
  }
186
  /**
187
  *
188
  * @param type $value
189
  * @param type $object
190
  * @param type $object_id
191
  * @return type
192
  */
193
  public function updateOption($value, $object, $object_id = '') {
194
  return update_user_option(
195
  $this->getId(), $this->getOptionName($object, $object_id), $value
196
  );
197
  }
198
  /**
199
  *
200
  * @param type $object
201
  * @param type $object_id
202
  * @return type
203
  */
204
  public function readOption($object, $object_id = '') {
205
  $option = get_user_option(
206
  $this->getOptionName($object, $object_id), $this->getId()
207
  );
208
  if (empty($option)) {
209
  //try to get this option from the User's Role
210
  $roles = $this->getSubject()->roles;
211
  //first user role is counted only. AAM does not support multi-roles
212
  $subject_role = array_shift($roles);
213
  //in case of multisite & current user does not belong to the site
214
  if ($subject_role){
215
  $role = new aam_Control_Subject_Role($subject_role);
216
  $option = $role->getObject($object, $object_id)->getOption();
217
  }
218
  }
219
  return $option;
220
  }
221
  /**
222
  *
223
  * @param type $object
224
  * @param type $object_id
225
  * @return type
226
  */
227
  public function deleteOption($object, $object_id = '') {
228
  return delete_user_option(
229
  $this->getId(), $this->getOptionName($object, $object_id)
230
  );
231
  }
232
  /**
233
  *
234
  * @param type $object
235
  * @param type $object_id
236
  * @return type
237
  */
238
  protected function getOptionName($object, $object_id) {
239
  return "aam_{$object}" . ($object_id ? "_{$object_id}" : '');
240
  }
241
  /**
242
  * Get Subject UID
243
  *
244
  * @return string
245
  *
246
  * @access public
247
  */
248
  public function getUID() {
249
  return self::UID;
250
  }
251
  /**
252
  * Get User's Cache
253
  *
254
  * Read User's option aam_cache and return it
255
  *
256
  * @return array
257
  *
258
  * @access public
259
  */
260
  public function readCache(){
261
  $cache = get_user_option('aam_cache', $this->getId());
262
  return (is_array($cache) ? $cache : array());
263
  }
264
  /**
265
  * Insert or Update User's Cache
266
  *
267
  * @return boolean
268
  *
269
  * @access public
270
  */
271
  public function updateCache(){
272
  return update_user_option($this->getId(), 'aam_cache', $this->getObjects());
273
  }
274
  /**
275
  * Delete User's Cache
276
  *
277
  * @return boolean
278
  *
279
  * @access public
280
  */
281
  public function clearCache(){
282
  return delete_user_option($this->getId(), 'aam_cache');
283
  }
 
284
  * ======================================================================
285
  * LICENSE: This file is subject to the terms and conditions defined in *
286
  * file 'license.txt', which is part of this source code package. *
287
  * ======================================================================
288
  */
289
  *
290
  * @package AAM
291
  * @author Vasyl Martyniuk <support@wpaam.com>
292
  * @copyright Copyright C 2013 Vasyl Martyniuk
293
  * @license GNU General Public License {@link http://www.gnu.org/licenses/}
294
  */
295
  /**
296
  * Subject UID: USER
297
  */
298
  const UID = 'user';
299
  /**
300
  * AAM Capability Key
301
  *
302
  * WordPress does not allow to have different set of capabilities for one user
303
  * between sites. aam_capability key stores the set of capabilities stored after
304
  * individual user edit and merge them with system capabilities.
305
  * The merging process overwrites allcaps.
306
  *
307
  * @var array
308
  *
309
  * @access private
310
  */
311
  private $_cap_key = '';
312
  /**
313
  *
314
  * @param type $id
315
  */
316
  public function __construct($id) {
317
  parent::__construct($id);
318
  //overwrite default set of capabilities if AAM capset is defined
319
  if ($this->isDefaultCapSet() === false){
320
  //make sure that aam_capability is actually array
321
  if (is_array($this->getSubject()->aam_caps)){
322
  $allcaps = array_merge(
323
  $this->getSubject()->allcaps, $this->getSubject()->aam_caps
324
  );
325
  $this->getSubject()->allcaps = $allcaps;
326
  }
327
  }
328
  }
329
  /**
330
  *
331
  * @return type
332
  */
333
  public function delete() {
334
  $response = false;
335
  if (current_user_can('delete_users')
336
  && ($this->getId() !== get_current_user_id())) {
337
  $response = wp_delete_user($this->getId());
338
  }
339
  return $response;
340
  }
341
  /**
342
  *
343
  * @global type $wpdb
344
  * @return boolean
345
  */
346
  public function block() {
347
  global $wpdb;
348
  $response = false;
349
  if (current_user_can('edit_users')
350
  && ($this->getId() != get_current_user_id())) {
351
  $status = ($this->getSubject()->user_status == 0 ? 1 : 0);
352
  if ($wpdb->update(
353
  $wpdb->users,
354
  array('user_status' => $status),
355
  array('ID' => $this->getId())
356
  )) {
357
  $this->getSubject()->user_status = $status;
358
  clean_user_cache($this->getSubject());
359
  $response = true;
360
  }
361
  }
362
  return $response;
363
  }
364
  /**
365
  * Retrieve User based on ID
366
  *
367
  * @return WP_Role|null
368
  *
369
  * @access protected
370
  */
371
  protected function retrieveSubject() {
372
  global $current_user;
373
  if ($current_user instanceof WP_User && $current_user->ID == $this->getId()) {
374
  $subject = $current_user;
375
  } else {
376
  $subject = new WP_User($this->getId());
377
  }
378
  //retrieve aam capabilities if are not retrieved yet
379
  $this->_cap_key = 'aam_capability';
380
  $subject->aam_caps = get_user_option($this->_cap_key, $this->getId());
381
  return $subject;
382
  }
383
  /**
384
  * Check if user has default capability set
385
  *
386
  * @return boolean
387
  *
388
  * @access public
389
  */
390
  public function isDefaultCapSet(){
391
  return empty($this->getSubject()->aam_caps);
392
  }
393
  /**
394
  *
395
  * @return type
396
  */
397
  public function getCapabilities() {
398
  return $this->getSubject()->allcaps;
399
  }
400
  /**
401
  *
402
  * @param type $capability
403
  * @return type
404
  */
405
  public function hasCapability($capability) {
406
  return user_can($this->getSubject(), $capability);
407
  }
408
  /**
409
  * Check if Subject has capability
410
  *
411
  * Keep compatible with WordPress core
412
  *
413
  * @param string $capability
414
  *
415
  * @return boolean
416
  *
417
  * @access public
418
  */
419
  public function addCapability($capability) {
420
  return $this->updateCapability($capability, true);
421
  }
422
  /**
423
  * Remove Capability
424
  *
425
  * @param string $capability
426
  *
427
  * @return boolean
428
  *
429
  * @access public
430
  */
431
  public function removeCapability($capability) {
432
  return $this->updateCapability($capability, false);
433
  }
434
  /**
435
  * Reset User Capability
436
  *
437
  * @return array
438
  *
439
  * @access public
440
  */
441
  public function resetCapability(){
442
  return delete_user_option($this->getId(), $this->_cap_key);
443
  }
444
  /**
445
  * Update User's Capability Set
446
  *
447
  * @param string $capability
448
  * @param boolean $grand
449
  *
450
  * @return boolean
451
  *
452
  * @access public
453
  */
454
  public function updateCapability($capability, $grand){
455
  //make sure that we have right array
456
  if (is_array($this->getSubject()->aam_caps)){
457
  $aam_caps = $this->getSubject()->aam_caps;
458
  } else {
459
  $aam_caps = array();
460
  }
461
  //add capability
462
  $aam_caps[$capability] = $grand;
463
  //update user data. TODO - Keep eyes on this part
464
  $this->getSubject()->data->aam_caps = $aam_caps;
465
  //save and return the result of operation
466
  return update_user_option($this->getId(), $this->_cap_key, $aam_caps);
467
  }
468
  /**
469
  *
470
  * @param type $value
471
  * @param type $object
472
  * @param type $object_id
473
  * @return type
474
  */
475
  public function updateOption($value, $object, $object_id = 0) {
476
  return update_user_option(
477
  $this->getId(), $this->getOptionName($object, $object_id), $value
478
  );
479
  }
480
  /**
481
  *
482
  * @param type $object
483
  * @param type $object_id
484
  * @param bool $inherit
485
  *
486
  * @return mixed
487
  */
488
  public function readOption($object, $object_id = 0, $inherit = true) {
489
  $option = get_user_option(
490
  $this->getOptionName($object, $object_id), $this->getId()
491
  );
492
  if (empty($option) && $inherit) {
493
  //try to get this option from the User's Role
494
  $roles = $this->getSubject()->roles;
495
  //first user role is counted only. AAM does not support multi-roles
496
  $subject_role = array_shift($roles);
497
  //in case of multisite & current user does not belong to the site
498
  if ($subject_role){
499
  $role = new aam_Control_Subject_Role($subject_role);
500
  $option = $role->getObject($object, $object_id)->getOption();
501
  }
502
  }
503
  return $option;
504
  }
505
  /**
506
  *
507
  * @param type $object
508
  * @param type $object_id
509
  * @return type
510
  */
511
  public function deleteOption($object, $object_id = 0) {
512
  return delete_user_option(
513
  $this->getId(), $this->getOptionName($object, $object_id)
514
  );
515
  }
516
  /**
517
  *
518
  * @param type $object
519
  * @param type $object_id
520
  * @return type
521
  */
522
  protected function getOptionName($object, $object_id) {
523
  return "aam_{$object}" . ($object_id ? "_{$object_id}" : '');
524
  }
525
  /**
526
  * Get Subject UID
527
  *
528
  * @return string
529
  *
530
  * @access public
531
  */
532
  public function getUID() {
533
  return self::UID;
534
  }
535
  /**
536
  * Get User's Cache
537
  *
538
  * Read User's option aam_cache and return it
539
  *
540
  * @return array
541
  *
542
  * @access public
543
  */
544
  public function readCache(){
545
  $cache = get_user_option('aam_cache', $this->getId());
546
  return (is_array($cache) ? $cache : array());
547
  }
548
  /**
549
  * Insert or Update User's Cache
550
  *
551
  * @return boolean
552
  *
553
  * @access public
554
  */
555
  public function updateCache(){
556
  return update_user_option($this->getId(), 'aam_cache', $this->getObjects());
557
  }
558
  /**
559
  * Delete User's Cache
560
  *
561
  * @return boolean
562
  *
563
  * @access public
564
  */
565
  public function clearCache(){
566
  return delete_user_option($this->getId(), 'aam_cache');
567
  }
 
1
  * ======================================================================
2
  * LICENSE: This file is subject to the terms and conditions defined in *
3
  * file 'license.txt', which is part of this source code package. *
4
  * ======================================================================
5
  */
6
  *
7
  * @package AAM
8
  * @author Vasyl Martyniuk <support@wpaam.com>
9
  * @copyright Copyright C 2013 Vasyl Martyniuk
10
  * @license GNU General Public License {@link http://www.gnu.org/licenses/}
11
  */
12
  /**
13
  * Subject UID: USER
14
  */
15
  const UID = 'user';
16
  /**
17
  * AAM Capability Key
18
  *
19
  * WordPress does not allow to have different set of capabilities for one user
20
  * between sites. aam_capability key stores the set of capabilities stored after
21
  * individual user edit and merge them with system capabilities.
22
  * The merging process overwrites allcaps.
23
  *
24
  * @var array
25
  *
26
  * @access private
27
  */
28
  private $_cap_key = '';
29
  /**
30
  *
31
  * @param type $id
32
  */
33
  public function __construct($id) {
34
  parent::__construct($id);
35
  //overwrite default set of capabilities if AAM capset is defined
36
  if ($this->isDefaultCapSet() === false){
37
  //make sure that aam_capability is actually array
38
  if (is_array($this->getSubject()->aam_caps)){
39
  $allcaps = array_merge(
40
  $this->getSubject()->allcaps, $this->getSubject()->aam_caps
41
  );
42
  $this->getSubject()->allcaps = $allcaps;
43
  }
44
  }
45
  }
46
  /**
47
  *
48
  * @return type
49
  */
50
  public function delete() {
51
  $response = false;
52
  if (current_user_can('delete_users')
53
  && ($this->getId() !== get_current_user_id())) {
54
  $response = wp_delete_user($this->getId());
55
  }
56
  return $response;
57
  }
58
  /**
59
  *
60
  * @global type $wpdb
61
  * @return boolean
62
  */
63
  public function block() {
64
  global $wpdb;
65
  $response = false;
66
  if (current_user_can('edit_users')
67
  && ($this->getId() != get_current_user_id())) {
68
  $status = ($this->getSubject()->user_status == 0 ? 1 : 0);
69
  if ($wpdb->update(
70
  $wpdb->users,
71
  array('user_status' => $status),
72
  array('ID' => $this->getId())
73
  )) {
74
  $this->getSubject()->user_status = $status;
75
  clean_user_cache($this->getSubject());
76
  $response = true;
77
  }
78
  }
79
  return $response;
80
  }
81
  /**
82
  * Retrieve User based on ID
83
  *
84
  * @return WP_Role|null
85
  *
86
  * @access protected
87
  */
88
  protected function retrieveSubject() {
89
  global $current_user;
90
  if ($current_user instanceof WP_User && $current_user->ID == $this->getId()) {
91
  $subject = $current_user;
92
  } else {
93
  $subject = new WP_User($this->getId());
94
  }
95
  //retrieve aam capabilities if are not retrieved yet
96
  $this->_cap_key = 'aam_capability';
97
  $subject->aam_caps = get_user_option($this->_cap_key, $this->getId());
98
  return $subject;
99
  }
100
  /**
101
  * Check if user has default capability set
102
  *
103
  * @return boolean
104
  *
105
  * @access public
106
  */
107
  public function isDefaultCapSet(){
108
  return empty($this->getSubject()->aam_caps);
109
  }
110
  /**
111
  *
112
  * @return type
113
  */
114
  public function getCapabilities() {
115
  return $this->getSubject()->allcaps;
116
  }
117
  /**
118
  *
119
  * @param type $capability
120
  * @return type
121
  */
122
  public function hasCapability($capability) {
123
  return user_can($this->getSubject(), $capability);
124
  }
125
  /**
126
  * Check if Subject has capability
127
  *
128
  * Keep compatible with WordPress core
129
  *
130
  * @param string $capability
131
  *
132
  * @return boolean
133
  *
134
  * @access public
135
  */
136
  public function addCapability($capability) {
137
  return $this->updateCapability($capability, true);
138
  }
139
  /**
140
  * Remove Capability
141
  *
142
  * @param string $capability
143
  *
144
  * @return boolean
145
  *
146
  * @access public
147
  */
148
  public function removeCapability($capability) {
149
  return $this->updateCapability($capability, false);
150
  }
151
  /**
152
  * Reset User Capability
153
  *
154
  * @return array
155
  *
156
  * @access public
157
  */
158
  public function resetCapability(){
159
  return delete_user_option($this->getId(), $this->_cap_key);
160
  }
161
  /**
162
  * Update User's Capability Set
163
  *
164
  * @param string $capability
165
  * @param boolean $grand
166
  *
167
  * @return boolean
168
  *
169
  * @access public
170
  */
171
  public function updateCapability($capability, $grand){
172
  //make sure that we have right array
173
  if (is_array($this->getSubject()->aam_caps)){
174
  $aam_caps = $this->getSubject()->aam_caps;
175
  } else {
176
  $aam_caps = array();
177
  }
178
  //add capability
179
  $aam_caps[$capability] = $grand;
180
  //update user data. TODO - Keep eyes on this part
181
  $this->getSubject()->data->aam_caps = $aam_caps;
182
  //save and return the result of operation
183
  return update_user_option($this->getId(), $this->_cap_key, $aam_caps);
184
  }
185
  /**
186
  *
187
  * @param type $value
188
  * @param type $object
189
  * @param type $object_id
190
  * @return type
191
  */
192
  public function updateOption($value, $object, $object_id = '') {
193
  return update_user_option(
194
  $this->getId(), $this->getOptionName($object, $object_id), $value
195
  );
196
  }
197
  /**
198
  *
199
  * @param type $object
200
  * @param type $object_id
201
  * @return type
202
  */
203
  public function readOption($object, $object_id = '') {
204
  $option = get_user_option(
205
  $this->getOptionName($object, $object_id), $this->getId()
206
  );
207
  if (empty($option)) {
208
  //try to get this option from the User's Role
209
  $roles = $this->getSubject()->roles;
210
  //first user role is counted only. AAM does not support multi-roles
211
  $subject_role = array_shift($roles);
212
  //in case of multisite & current user does not belong to the site
213
  if ($subject_role){
214
  $role = new aam_Control_Subject_Role($subject_role);
215
  $option = $role->getObject($object, $object_id)->getOption();
216
  }
217
  }
218
  return $option;
219
  }
220
  /**
221
  *
222
  * @param type $object
223
  * @param type $object_id
224
  * @return type
225
  */
226
  public function deleteOption($object, $object_id = '') {
227
  return delete_user_option(
228
  $this->getId(), $this->getOptionName($object, $object_id)
229
  );
230
  }
231
  /**
232
  *
233
  * @param type $object
234
  * @param type $object_id
235
  * @return type
236
  */
237
  protected function getOptionName($object, $object_id) {
238
  return "aam_{$object}" . ($object_id ? "_{$object_id}" : '');
239
  }
240
  /**
241
  * Get Subject UID
242
  *
243
  * @return string
244
  *
245
  * @access public
246
  */
247
  public function getUID() {
248
  return self::UID;
249
  }
250
  /**
251
  * Get User's Cache
252
  *
253
  * Read User's option aam_cache and return it
254
  *
255
  * @return array
256
  *
257
  * @access public
258
  */
259
  public function readCache(){
260
  $cache = get_user_option('aam_cache', $this->getId());
261
  return (is_array($cache) ? $cache : array());
262
  }
263
  /**
264
  * Insert or Update User's Cache
265
  *
266
  * @return boolean
267
  *
268
  * @access public
269
  */
270
  public function updateCache(){
271
  return update_user_option($this->getId(), 'aam_cache', $this->getObjects());
272
  }
273
  /**
274
  * Delete User's Cache
275
  *
276
  * @return boolean
277
  *
278
  * @access public
279
  */
280
  public function clearCache(){
281
  return delete_user_option($this->getId(), 'aam_cache');
282
  }
283
+ <?php
284
  * ======================================================================
285
  * LICENSE: This file is subject to the terms and conditions defined in *
286
  * file 'license.txt', which is part of this source code package. *
287
  * ======================================================================
288
  */
289
  *
290
  * @package AAM
291
  * @author Vasyl Martyniuk <support@wpaam.com>
292
  * @copyright Copyright C 2013 Vasyl Martyniuk
293
  * @license GNU General Public License {@link http://www.gnu.org/licenses/}
294
  */
295
  /**
296
  * Subject UID: USER
297
  */
298
  const UID = 'user';
299
  /**
300
  * AAM Capability Key
301
  *
302
  * WordPress does not allow to have different set of capabilities for one user
303
  * between sites. aam_capability key stores the set of capabilities stored after
304
  * individual user edit and merge them with system capabilities.
305
  * The merging process overwrites allcaps.
306
  *
307
  * @var array
308
  *
309
  * @access private
310
  */
311
  private $_cap_key = '';
312
  /**
313
  *
314
  * @param type $id
315
  */
316
  public function __construct($id) {
317
  parent::__construct($id);
318
  //overwrite default set of capabilities if AAM capset is defined
319
  if ($this->isDefaultCapSet() === false){
320
  //make sure that aam_capability is actually array
321
  if (is_array($this->getSubject()->aam_caps)){
322
  $allcaps = array_merge(
323
  $this->getSubject()->allcaps, $this->getSubject()->aam_caps
324
  );
325
  $this->getSubject()->allcaps = $allcaps;
326
  }
327
  }
328
  }
329
  /**
330
  *
331
  * @return type
332
  */
333
  public function delete() {
334
  $response = false;
335
  if (current_user_can('delete_users')
336
  && ($this->getId() !== get_current_user_id())) {
337
  $response = wp_delete_user($this->getId());
338
  }
339
  return $response;
340
  }
341
  /**
342
  *
343
  * @global type $wpdb
344
  * @return boolean
345
  */
346
  public function block() {
347
  global $wpdb;
348
  $response = false;
349
  if (current_user_can('edit_users')
350
  && ($this->getId() != get_current_user_id())) {
351
  $status = ($this->getSubject()->user_status == 0 ? 1 : 0);
352
  if ($wpdb->update(
353
  $wpdb->users,
354
  array('user_status' => $status),
355
  array('ID' => $this->getId())
356
  )) {
357
  $this->getSubject()->user_status = $status;
358
  clean_user_cache($this->getSubject());
359
  $response = true;
360
  }
361
  }
362
  return $response;
363
  }
364
  /**
365
  * Retrieve User based on ID
366
  *
367
  * @return WP_Role|null
368
  *
369
  * @access protected
370
  */
371
  protected function retrieveSubject() {
372
  global $current_user;
373
  if ($current_user instanceof WP_User && $current_user->ID == $this->getId()) {
374
  $subject = $current_user;
375
  } else {
376
  $subject = new WP_User($this->getId());
377
  }
378
  //retrieve aam capabilities if are not retrieved yet
379
  $this->_cap_key = 'aam_capability';
380
  $subject->aam_caps = get_user_option($this->_cap_key, $this->getId());
381
  return $subject;
382
  }
383
  /**
384
  * Check if user has default capability set
385
  *
386
  * @return boolean
387
  *
388
  * @access public
389
  */
390
  public function isDefaultCapSet(){
391
  return empty($this->getSubject()->aam_caps);
392
  }
393
  /**
394
  *
395
  * @return type
396
  */
397
  public function getCapabilities() {
398
  return $this->getSubject()->allcaps;
399
  }
400
  /**
401
  *
402
  * @param type $capability
403
  * @return type
404
  */
405
  public function hasCapability($capability) {
406
  return user_can($this->getSubject(), $capability);
407
  }
408
  /**
409
  * Check if Subject has capability
410
  *
411
  * Keep compatible with WordPress core
412
  *
413
  * @param string $capability
414
  *
415
  * @return boolean
416
  *
417
  * @access public
418
  */
419
  public function addCapability($capability) {
420
  return $this->updateCapability($capability, true);
421
  }
422
  /**
423
  * Remove Capability
424
  *
425
  * @param string $capability
426
  *
427
  * @return boolean
428
  *
429
  * @access public
430
  */
431
  public function removeCapability($capability) {
432
  return $this->updateCapability($capability, false);
433
  }
434
  /**
435
  * Reset User Capability
436
  *
437
  * @return array
438
  *
439
  * @access public
440
  */
441
  public function resetCapability(){
442
  return delete_user_option($this->getId(), $this->_cap_key);
443
  }
444
  /**
445
  * Update User's Capability Set
446
  *
447
  * @param string $capability
448
  * @param boolean $grand
449
  *
450
  * @return boolean
451
  *
452
  * @access public
453
  */
454
  public function updateCapability($capability, $grand){
455
  //make sure that we have right array
456
  if (is_array($this->getSubject()->aam_caps)){
457
  $aam_caps = $this->getSubject()->aam_caps;
458
  } else {
459
  $aam_caps = array();
460
  }
461
  //add capability
462
  $aam_caps[$capability] = $grand;
463
  //update user data. TODO - Keep eyes on this part
464
  $this->getSubject()->data->aam_caps = $aam_caps;
465
  //save and return the result of operation
466
  return update_user_option($this->getId(), $this->_cap_key, $aam_caps);
467
  }
468
  /**
469
  *
470
  * @param type $value
471
  * @param type $object
472
  * @param type $object_id
473
  * @return type
474
  */
475
  public function updateOption($value, $object, $object_id = 0) {
476
  return update_user_option(
477
  $this->getId(), $this->getOptionName($object, $object_id), $value
478
  );
479
  }
480
  /**
481
  *
482
  * @param type $object
483
  * @param type $object_id
484
  * @param bool $inherit
485
  *
486
  * @return mixed
487
  */
488
  public function readOption($object, $object_id = 0, $inherit = true) {
489
  $option = get_user_option(
490
  $this->getOptionName($object, $object_id), $this->getId()
491
  );
492
  if (empty($option) && $inherit) {
493
  //try to get this option from the User's Role
494
  $roles = $this->getSubject()->roles;
495
  //first user role is counted only. AAM does not support multi-roles
496
  $subject_role = array_shift($roles);
497
  //in case of multisite & current user does not belong to the site
498
  if ($subject_role){
499
  $role = new aam_Control_Subject_Role($subject_role);
500
  $option = $role->getObject($object, $object_id)->getOption();
501
  }
502
  }
503
  return $option;
504
  }
505
  /**
506
  *
507
  * @param type $object
508
  * @param type $object_id
509
  * @return type
510
  */
511
  public function deleteOption($object, $object_id = 0) {
512
  return delete_user_option(
513
  $this->getId(), $this->getOptionName($object, $object_id)
514
  );
515
  }
516
  /**
517
  *
518
  * @param type $object
519
  * @param type $object_id
520
  * @return type
521
  */
522
  protected function getOptionName($object, $object_id) {
523
  return "aam_{$object}" . ($object_id ? "_{$object_id}" : '');
524
  }
525
  /**
526
  * Get Subject UID
527
  *
528
  * @return string
529
  *
530
  * @access public
531
  */
532
  public function getUID() {
533
  return self::UID;
534
  }
535
  /**
536
  * Get User's Cache
537
  *
538
  * Read User's option aam_cache and return it
539
  *
540
  * @return array
541
  *
542
  * @access public
543
  */
544
  public function readCache(){
545
  $cache = get_user_option('aam_cache', $this->getId());
546
  return (is_array($cache) ? $cache : array());
547
  }
548
  /**
549
  * Insert or Update User's Cache
550
  *
551
  * @return boolean
552
  *
553
  * @access public
554
  */
555
  public function updateCache(){
556
  return update_user_option($this->getId(), 'aam_cache', $this->getObjects());
557
  }
558
  /**
559
  * Delete User's Cache
560
  *
561
  * @return boolean
562
  *
563
  * @access public
564
  */
565
  public function clearCache(){
566
  return delete_user_option($this->getId(), 'aam_cache');
567
  }
application/control/subject/visitor.php CHANGED
@@ -61,7 +61,7 @@ class aam_Control_Subject_Visitor extends aam_Control_Subject
61
  * @param type $object_id
62
  * @return type
63
  */
64
- public function updateOption($value, $object, $object_id = ''){
65
  return aam_Core_API::updateBlogOption(
66
  $this->getOptionName($object, $object_id), $value
67
  );
@@ -73,7 +73,7 @@ class aam_Control_Subject_Visitor extends aam_Control_Subject
73
  * @param type $object_id
74
  * @return type
75
  */
76
- public function readOption($object, $object_id = ''){
77
  return aam_Core_API::getBlogOption(
78
  $this->getOptionName($object, $object_id)
79
  );
@@ -85,7 +85,7 @@ class aam_Control_Subject_Visitor extends aam_Control_Subject
85
  * @param type $object_id
86
  * @return type
87
  */
88
- public function deleteOption($object, $object_id = ''){
89
  return aam_Core_API::deleteBlogOption(
90
  $this->getOptionName($object, $object_id)
91
  );
61
  * @param type $object_id
62
  * @return type
63
  */
64
+ public function updateOption($value, $object, $object_id = 0){
65
  return aam_Core_API::updateBlogOption(
66
  $this->getOptionName($object, $object_id), $value
67
  );
73
  * @param type $object_id
74
  * @return type
75
  */
76
+ public function readOption($object, $object_id = 0){
77
  return aam_Core_API::getBlogOption(
78
  $this->getOptionName($object, $object_id)
79
  );
85
  * @param type $object_id
86
  * @return type
87
  */
88
+ public function deleteOption($object, $object_id = 0){
89
  return aam_Core_API::deleteBlogOption(
90
  $this->getOptionName($object, $object_id)
91
  );
application/core/configpress.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 handler
12
+ *
13
+ * @package AAM
14
+ * @author Vasyl Martyniuk <support@wpaam.com>
15
+ * @copyright Copyright C 2013 Vasyl Martyniuk
16
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
17
+ */
18
+ final class aam_Core_ConfigPress {
19
+
20
+ /**
21
+ * Parsed ConfigPress from the file
22
+ *
23
+ * @var Zend_Config_Ini
24
+ *
25
+ * @access private
26
+ * @static
27
+ */
28
+ private static $_config = null;
29
+
30
+ /**
31
+ * Read ConfigPress File content
32
+ *
33
+ * @return string
34
+ *
35
+ * @access public
36
+ * @static
37
+ */
38
+ public static function read() {
39
+ $filename = aam_Core_API::getBlogOption('aam_configpress', '');
40
+ if ($filename && file_exists(AAM_TEMP_DIR . $filename)) {
41
+ $content = file_get_contents(AAM_TEMP_DIR . $filename);
42
+ } else {
43
+ $content = '';
44
+ }
45
+
46
+ return $content;
47
+ }
48
+
49
+ /**
50
+ * Write ConfigPres to file
51
+ *
52
+ * @param string $content
53
+ *
54
+ * @return boolean
55
+ *
56
+ * @access public
57
+ * @static
58
+ */
59
+ public static function write($content) {
60
+ if (is_writable(AAM_TEMP_DIR)) {
61
+ $filename = aam_Core_API::getBlogOption('aam_configpress', '');
62
+ if (!$filename) { //file already was created
63
+ $filename = sha1(uniqid('aam'));
64
+ aam_Core_API::updateBlogOption('aam_configpress', $filename);
65
+ }
66
+ $response = file_put_contents(
67
+ AAM_TEMP_DIR . $filename, stripcslashes($content)
68
+ );
69
+ } else {
70
+ $response = false;
71
+ }
72
+
73
+ return $response;
74
+ }
75
+
76
+ /**
77
+ * Get ConfigPress parameter
78
+ *
79
+ * @param string $param
80
+ * @param mixed $default
81
+ *
82
+ * @return mixed
83
+ *
84
+ * @access public
85
+ * @static
86
+ */
87
+ public static function getParam($param, $default = null) {
88
+ //initialize the ConfigPress if empty
89
+ if (is_null(self::$_config)) {
90
+ $filename = aam_Core_API::getBlogOption('aam_configpress', '');
91
+ if ($filename && file_exists(AAM_TEMP_DIR . $filename)) {
92
+ //parse the file content & create Config INI Object
93
+ self::parseConfig(AAM_TEMP_DIR . $filename);
94
+ }
95
+ }
96
+
97
+ //find the parameter
98
+ $tree = self::$_config;
99
+ foreach (explode('.', $param) as $section) {
100
+ if (isset($tree->{$section})) {
101
+ $tree = $tree->{$section};
102
+ } else {
103
+ $tree = $default;
104
+ break;
105
+ }
106
+ }
107
+
108
+ return self::parseParam($tree, $default);
109
+ }
110
+
111
+ /**
112
+ * Parse found parameter
113
+ *
114
+ * @param mixed $param
115
+ * @param mixed $default
116
+ *
117
+ * @return mixed
118
+ *
119
+ * @access protected
120
+ * @static
121
+ */
122
+ protected static function parseParam($param, $default) {
123
+ if (is_object($param) && isset($param->userFunc)) {
124
+ $func = trim($param->userFunc);
125
+ if (is_string($func) && is_callable($func)) {
126
+ $response = call_user_func($func);
127
+ } else {
128
+ $response = $default;
129
+ }
130
+ } else {
131
+ $response = $param;
132
+ }
133
+
134
+ return $response;
135
+ }
136
+
137
+ /**
138
+ * Parse ConfigPress file and create an object
139
+ *
140
+ * @param string $filename
141
+ *
142
+ * @return void
143
+ *
144
+ * @access protected
145
+ * @static
146
+ */
147
+ protected static function parseConfig($filename) {
148
+ //include third party library
149
+ if (!class_exists('Zend_Config')) {
150
+ require_once(AAM_LIBRARY_DIR . 'Zend/Exception.php');
151
+ require_once(AAM_LIBRARY_DIR . 'Zend/Config/Exception.php');
152
+ require_once(AAM_LIBRARY_DIR . 'Zend/Config.php');
153
+ require_once(AAM_LIBRARY_DIR . 'Zend/Config/Ini.php');
154
+ }
155
+ //parse ini file
156
+ try {
157
+ self::$_config = new Zend_Config_Ini($filename);
158
+ } catch (Zend_Config_Exception $e) {
159
+ //do nothing
160
+ }
161
+ }
162
+
163
+ }
application/core/console.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * ======================================================================
4
  * LICENSE: This file is subject to the terms and conditions defined in *
@@ -7,7 +8,11 @@
7
  */
8
 
9
  /**
10
- *
 
 
 
 
11
  * @package AAM
12
  * @author Vasyl Martyniuk <support@wpaam.com>
13
  * @copyright Copyright C 2013 Vasyl Martyniuk
@@ -16,13 +21,51 @@
16
  class aam_Core_Console {
17
 
18
  /**
19
- *
20
- * @param type $message
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  */
22
- public static function write($message) {
23
- file_put_contents(
24
- AAM_TEMP_DIR . '/console.log', $message . "\n", FILE_APPEND
25
- );
26
  }
27
 
28
  }
1
  <?php
2
+
3
  /**
4
  * ======================================================================
5
  * LICENSE: This file is subject to the terms and conditions defined in *
8
  */
9
 
10
  /**
11
+ * AAM Core Consol Panel
12
+ *
13
+ * Track and display list of all warnings that has been detected during AAM
14
+ * execution. The consol is used only when AAM interface was triggered in Admin side.
15
+ *
16
  * @package AAM
17
  * @author Vasyl Martyniuk <support@wpaam.com>
18
  * @copyright Copyright C 2013 Vasyl Martyniuk
21
  class aam_Core_Console {
22
 
23
  /**
24
+ * List of Runtime errors related to AAM
25
+ *
26
+ * @var array
27
+ *
28
+ * @access private
29
+ * @static
30
+ */
31
+ private static $_warnings = array();
32
+
33
+ /**
34
+ * Add new warning
35
+ *
36
+ * @param string $message
37
+ *
38
+ * @return void
39
+ *
40
+ * @access public
41
+ * @static
42
+ */
43
+ public static function add($message) {
44
+ self::$_warnings[] = $message;
45
+ }
46
+
47
+ /**
48
+ * Check if there is any warning during execution
49
+ *
50
+ * @return boolean
51
+ *
52
+ * @access public
53
+ * @static
54
+ */
55
+ public static function hasIssues() {
56
+ return (count(self::$_warnings) ? true : false);
57
+ }
58
+
59
+ /**
60
+ * Get list of all warnings
61
+ *
62
+ * @return array
63
+ *
64
+ * @access public
65
+ * @static
66
  */
67
+ public static function getWarnings() {
68
+ return self::$_warnings;
 
 
69
  }
70
 
71
  }
application/core/extension.php CHANGED
@@ -75,11 +75,15 @@ class aam_Core_Extension {
75
  * @access public
76
  */
77
  public function load() {
78
-
79
  //iterate through each active extension and load it
80
  foreach (scandir($this->_basedir) as $module) {
81
  if (!in_array($module, array('.', '..'))) {
82
- $this->bootstrapExtension($module);
 
 
 
 
 
83
  }
84
  }
85
  }
@@ -214,7 +218,6 @@ class aam_Core_Extension {
214
  protected function insert($zip) {
215
  $response = true;
216
  if (is_wp_error(unzip_file($zip, $this->_basedir))) {
217
- aam_Core_Console::write('Failed to insert extension');
218
  $response = false;
219
  }
220
 
@@ -235,7 +238,14 @@ class aam_Core_Extension {
235
  protected function bootstrapExtension($extension) {
236
  $bootstrap = $this->_basedir . "/{$extension}/index.php";
237
  if (file_exists($bootstrap) && !isset($this->_cache[$extension])) {
 
238
  $this->_cache[$extension] = require_once($bootstrap);
 
 
 
 
 
 
239
  }
240
  }
241
 
75
  * @access public
76
  */
77
  public function load() {
 
78
  //iterate through each active extension and load it
79
  foreach (scandir($this->_basedir) as $module) {
80
  if (!in_array($module, array('.', '..'))) {
81
+ $status = aam_Core_ConfigPress::getParam(
82
+ "aam.extension.{$module}.status"
83
+ );
84
+ if (strtolower($status) !== 'off'){
85
+ $this->bootstrapExtension($module);
86
+ }
87
  }
88
  }
89
  }
218
  protected function insert($zip) {
219
  $response = true;
220
  if (is_wp_error(unzip_file($zip, $this->_basedir))) {
 
221
  $response = false;
222
  }
223
 
238
  protected function bootstrapExtension($extension) {
239
  $bootstrap = $this->_basedir . "/{$extension}/index.php";
240
  if (file_exists($bootstrap) && !isset($this->_cache[$extension])) {
241
+ //bootstrap the extension
242
  $this->_cache[$extension] = require_once($bootstrap);
243
+ //check if activation hook still present and trigger warning if yes
244
+ if (file_exists($this->_basedir . "/{$extension}/activation.php")){
245
+ aam_Core_Console::add(
246
+ "Activation hook for {$extension} is not deleted"
247
+ );
248
+ }
249
  }
250
  }
251
 
application/core/migrate.php DELETED
@@ -1,480 +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
- * Migrate the setting to 2.x version
12
- *
13
- * @package AAM
14
- * @author Vasyl Martyniuk <support@wpaam.com>
15
- * @copyright Copyright C 2013 Vasyl Martyniuk
16
- * @license GNU General Public License {@link http://www.gnu.org/licenses/}
17
- */
18
- final class aam_Core_Migrate {
19
-
20
- /**
21
- * Run the migration process
22
- *
23
- * @return string
24
- *
25
- * @access public
26
- */
27
- public function run() {
28
- @set_time_limit(300);
29
-
30
- ob_start(); //prevent from any kind of notice, warning printout
31
- switch (aam_Core_Request::post('step')) {
32
- case 'collect':
33
- $response = $this->collect();
34
- break;
35
-
36
- case 'migrate':
37
- $response = $this->migrate();
38
- break;
39
-
40
- case 'cleanup':
41
- $response = $this->cleanup();
42
- break;
43
-
44
- case 'complete':
45
- $response = $this->complete();
46
- break;
47
-
48
- default:
49
- $response = array('status' => 'failure');
50
- break;
51
- }
52
- ob_end_clean();
53
-
54
- return json_encode($response);
55
- }
56
-
57
- /**
58
- * Collect the list of all setting for migration
59
- *
60
- * @global type $wpdb
61
- * @return string
62
- */
63
- protected function collect() {
64
- global $wpdb;
65
-
66
- $collection = array(
67
- 'users' => array(),
68
- 'roles' => array()
69
- );
70
- aam_Core_API::deleteBlogOption('aam_migration_cache');
71
-
72
- //====== collect all user individual settings ======
73
- $query = 'SELECT * FROM ' . $wpdb->usermeta;
74
- $query .= ' WHERE meta_key = "wpaccess_config"';
75
- $user_list = $wpdb->get_results($query);
76
- if (count($user_list)) {
77
- foreach ($user_list as $user) {
78
- $collection['users'][$user->user_id] = $user->meta_value;
79
- }
80
- }
81
-
82
- //====== collect all roles settings =======
83
- if (is_multisite()) {
84
- //get all sites first and iterate through each
85
- $query = 'SELECT blog_id FROM ' . $wpdb->blogs;
86
- $blog_list = $wpdb->get_results($query);
87
- if (is_array($blog_list)) {
88
- foreach ($blog_list as $blog) {
89
- $collection['roles'][$blog->blog_id] = $this->getRoleSet(
90
- $blog->blog_id
91
- );
92
- }
93
- }
94
- } else {
95
- $collection['roles'] = $this->getRoleSet();
96
- }
97
-
98
- //save the cache for wether migration process
99
- if (aam_Core_API::updateBlogOption('aam_migration_cache', $collection, 1)) {
100
- $response = array('status' => 'success', 'stop' => 1);
101
- } else {
102
- $response = array('status' => 'failure');
103
- }
104
-
105
- return $response;
106
- }
107
-
108
- protected function getRoleSet($blog_id = 1) {
109
- global $wpdb;
110
-
111
- $role_set = array();
112
- $blog_prefix = $wpdb->get_blog_prefix($blog_id);
113
- //get list of roles for current blog
114
- $query = 'SELECT * FROM ' . $blog_prefix . 'options ';
115
- $query .= 'WHERE option_name = "' . $blog_prefix . 'user_roles"';
116
- if ($row = $wpdb->get_row($query)) {
117
- $user_roles = unserialize($row->option_value);
118
- if (is_array($user_roles)) {
119
- foreach ($user_roles as $role => $data) {
120
- $query = 'SELECT option_value FROM ' . $blog_prefix . 'options ';
121
- $query .= 'WHERE option_name = "' . $blog_prefix . 'wpaccess_config_' . $role . '"';
122
- $role_set[$role] = $wpdb->get_var($query);
123
- }
124
- }
125
- }
126
-
127
- return $role_set;
128
- }
129
-
130
- protected function migrate() {
131
- $response = array('status' => 'success', 'stop' => 1);
132
- //get the settings
133
- $collection = aam_Core_API::getBlogOption('aam_migration_cache', 1);
134
-
135
- if (is_array($collection)) {
136
- if (isset($collection['users'])) {
137
- $this->migrateUsers($collection);
138
- }
139
-
140
- if (isset($collection['roles'])) {
141
- $this->migrateRoles($collection);
142
- }
143
- }
144
-
145
- return $response;
146
- }
147
-
148
- protected function migrateSettings($settings) {
149
- $migrated = array();
150
- $legacy = unserialize($settings);
151
- if ($legacy instanceof stdClass) {
152
- if (isset($legacy->menu)) {
153
- $migrated['menu'] = $this->migrateMenu($legacy->menu);
154
- }
155
- if (isset($legacy->metaboxes)) {
156
- $migrated['metabox'] = $this->migrateMetaboxes(
157
- $legacy->metaboxes
158
- );
159
- }
160
- if (isset($legacy->capabilities)) {
161
- $migrated['capability'] = $this->migrateCapabilities(
162
- $legacy->capabilities
163
- );
164
- }
165
- if (isset($legacy->restrictions)) {
166
- $migrated['restrictions'] = $this->migrateRestrictions(
167
- $legacy->restrictions
168
- );
169
- }
170
- if (isset($legacy->events)) {
171
- $migrated['events'] = $this->migrateEvents($legacy->events);
172
- }
173
- }
174
-
175
- return $migrated;
176
- }
177
-
178
- protected function migrateMenu($legacy) {
179
- $menu = array();
180
-
181
- if (is_array($legacy)) {
182
- foreach ($legacy as $id => $data) {
183
- if (isset($data['whole']) && intval($data['whole'])) {
184
- $menu[$id] = 1;
185
- }
186
- if (isset($data['sub']) && is_array($data['sub'])) {
187
- foreach ($data['sub'] as $sub_id => $sub_data) {
188
- if (intval($sub_data)) {
189
- $menu[$sub_id] = 1;
190
- }
191
- }
192
- }
193
- }
194
- }
195
-
196
- return $menu;
197
- }
198
-
199
- protected function migrateMetaboxes($legacy) {
200
- $metaboxes = array();
201
- if (is_array($legacy)) {
202
- foreach ($legacy as $id => $checked) {
203
- if (intval($checked)) {
204
- $chunks = explode('-', $id);
205
- if (count($chunks) == 1) { //widgets
206
- if (!isset($metaboxes['widgets'])) {
207
- $metaboxes['widgets'] = array();
208
- }
209
- $metaboxes['widgets'][$chunks[0]] = 1;
210
- } elseif (count($chunks) == 2) {
211
- if (!isset($metaboxes[$chunks[0]])) {
212
- $metaboxes[$chunks[0]] = array();
213
- }
214
- $metaboxes[$chunks[0]][$chunks[1]] = 1;
215
- }
216
- }
217
- }
218
- }
219
-
220
- return $metaboxes;
221
- }
222
-
223
- protected function migrateCapabilities($capabilities) {
224
- return (is_array($capabilities) && count($capabilities) ? $capabilities : array());
225
- }
226
-
227
- protected function migrateRestrictions($legacy) {
228
- $access = array(
229
- 'post' => array(),
230
- 'taxonomy' => array()
231
- );
232
- if (is_array($legacy)) {
233
- foreach ($legacy as $type => $records) {
234
- if (is_array($records)) {
235
- foreach ($records as $id => $restrictions) {
236
- $access[$type][$id] = array(
237
- 'frontend' => array(),
238
- 'backend' => array()
239
- );
240
- foreach ($restrictions as $restriction => $checked) {
241
- if (intval($checked)) {
242
- $chunks = explode('_', $restriction);
243
- if ($type == 'taxonomy') {
244
- $access[$type][$id][$chunks[0]][$chunks[1]] = 1;
245
- } elseif ($type == 'post') {
246
- $access[$type][$id][$chunks[0]][$chunks[2]] = 1;
247
- }
248
- }
249
- }
250
- }
251
- }
252
- }
253
- }
254
-
255
- return $access;
256
- }
257
-
258
- protected function migrateEvents($legacy) {
259
- $events = array();
260
-
261
- if (is_array($legacy)) {
262
- foreach ($legacy as $event_id => $data) {
263
- $events[$event_id] = array();
264
- if (isset($data['eventType'])) {
265
- $events[$event_id]['event'] = $data['eventType'];
266
- }
267
- if (isset($data['statusChange'])) {
268
- $events[$event_id]['event_specifier'] = $data['statusChange'];
269
- }
270
- if (isset($data['postType'])) {
271
- $events[$event_id]['post_type'] = $data['postType'];
272
- }
273
- if (isset($data['eventAction'])) {
274
- //fix type from previos version
275
- if ($data['eventAction'] === 'change_satus') {
276
- $action = 'change_status';
277
- } else {
278
- $action = $data['eventAction'];
279
- }
280
- $events[$event_id]['action'] = $action;
281
- }
282
- if (!empty($data['eventEmail'])) {
283
- $events[$event_id]['action_specifier'] = $data['eventEmail'];
284
- } elseif (!empty($data['statusChangeTo'])) {
285
- $events[$event_id]['action_specifier'] = $data['statusChangeTo'];
286
- } elseif (!empty($data['callback'])) {
287
- $events[$event_id]['action_specifier'] = $data['callback'];
288
- }
289
- }
290
- }
291
-
292
- return $events;
293
- }
294
-
295
- protected function migrateUsers(&$collection) {
296
- if (is_array($collection['users'])) {
297
- foreach ($collection['users'] as $id => $data) {
298
- $migrated = $this->migrateSettings($data);
299
- //unset restrictions, bad implementation in AAM 1.x
300
- if (isset($migrated['restrictions'])) {
301
- unset($migrated['restrictions']);
302
- }
303
-
304
- $this->saveSettings('User', $id, $migrated);
305
- }
306
- }
307
-
308
- return 'success';
309
- }
310
-
311
- protected function migrateRoles(&$collection) {
312
- global $wpdb, $wp_user_roles, $blog_id;
313
-
314
- if (is_multisite()) {
315
- foreach ($collection['roles'] as $blog_id => $roles) {
316
- //reset roles & blog id
317
- $wp_user_roles = null;
318
- $wpdb->set_blog_id($blog_id);
319
- foreach ($roles as $role => $data) {
320
- $this->migrateRole($role, $data, $blog_id);
321
- }
322
- }
323
- } else {
324
- foreach ($collection['roles'] as $role => $data) {
325
- $this->migrateRole($role, $data);
326
- }
327
- }
328
- }
329
-
330
- protected function migrateRole($role, $data) {
331
- if ($role !== 'administrator'){ //skip admin role. We do not have super admin anymore
332
- $settings = $this->migrateSettings($data);
333
- } elseif (isset($data['events'])) { //transfer only events
334
- $settings = array('events' => $data['events']);
335
- } else {
336
- $settings = array();
337
- }
338
-
339
- return $this->saveSettings('Role', $role, $settings);
340
- }
341
-
342
- protected function saveSettings($type, $id, $settings) {
343
- if (is_array($settings) && count($settings)) {
344
- $subject_class = 'aam_Control_Subject_' . $type;
345
- $subject = new $subject_class($id);
346
- //set new settings
347
- //Dashboard Menu settings
348
- if (isset($settings['menu']) && count($settings['menu'])) {
349
- $subject->getObject(aam_Control_Object_Menu::UID)->save(
350
- $settings['menu']
351
- );
352
- }
353
- //Dashboard Metaboxes & Widgets
354
- if (isset($settings['metabox']) && count($settings['metabox'])) {
355
- $subject->getObject(aam_Control_Object_Metabox::UID)->save(
356
- $settings['metabox']
357
- );
358
- }
359
- //Capability list
360
- if (isset($settings['capability']) && count($settings['capability'])) {
361
- foreach ($settings['capability'] as $capability => $grand) {
362
- if (intval($grand)) {
363
- $subject->addCapability($capability);
364
- } else {
365
- $subject->removeCapability($capability);
366
- }
367
- }
368
- }
369
- //Posts & Categories
370
- if (isset($settings['restrictions']) && count($settings['restrictions'])) {
371
- if (count($settings['restrictions']['post'])) {
372
- $post = $subject->getObject(aam_Control_Object_Post::UID);
373
- foreach ($settings['restrictions']['post'] as $post_id => $data) {
374
- $post = $subject->getObject(
375
- aam_Control_Object_Post::UID, $post_id
376
- );
377
- if ($post->getPost() instanceof WP_Post) {
378
- $post->save(array('post' => $data));
379
- }
380
- }
381
- }
382
-
383
- if (count($settings['restrictions']['taxonomy'])) {
384
- foreach ($settings['restrictions']['taxonomy'] as $term_id => $data) {
385
- $term = $subject->getObject(
386
- aam_Control_Object_Term::UID, $term_id
387
- );
388
- if (is_object($term->getTerm())) {
389
- $term->save(array('term' => $data));
390
- }
391
- }
392
- }
393
- }
394
-
395
- //Events
396
- if (isset($settings['events']) && count($settings['events'])) {
397
- $subject->getObject(aam_Control_Object_Event::UID)->save(
398
- $settings['events']
399
- );
400
- }
401
- }
402
- }
403
-
404
- protected function cleanup() {
405
- $this->removeSuperAdmin();
406
-
407
- //remove migration cache
408
- aam_Core_API::deleteBlogOption('aam_migration_cache', 1);
409
-
410
- return array('status' => 'success', 'stop' => 1);
411
- }
412
-
413
- protected function removeSuperAdmin() {
414
- global $wp_user_roles, $wpdb;
415
-
416
- if (is_multisite()) {
417
- //get all sites first and iterate through each
418
- $query = 'SELECT blog_id FROM ' . $wpdb->blogs;
419
- $blog_list = $wpdb->get_results($query);
420
- if (is_array($blog_list)) {
421
- foreach ($blog_list as $blog) {
422
- //reset roles & blog id
423
- $wp_user_roles = null;
424
- $wpdb->set_blog_id($blog_id);
425
- $this->removeSuperAdminRole();
426
- }
427
- }
428
- } else {
429
- $this->removeSuperAdminRole();
430
- }
431
- //remove all super_admin capabilities from usermeta
432
- $list = $wpdb->get_results(
433
- 'SELECT * FROM ' . $wpdb->usermeta . ' WHERE meta_key LIKE "%_capabilities"'
434
- );
435
- if (is_array($list)) {
436
- foreach ($list as $metadata) {
437
- $caps = unserialize($metadata->meta_value);
438
- if (isset($caps['super_admin'])) {
439
- unset($caps['super_admin']);
440
- $caps['administrator'] = 1;
441
- $wpdb->update(
442
- $wpdb->usermeta,
443
- array('meta_value' => serialize($caps)),
444
- array('umeta_id' => $metadata->umeta_id)
445
- );
446
- }
447
- }
448
- }
449
- }
450
-
451
- protected function removeSuperAdminRole() {
452
- //update the role capabilities and remove super admin role
453
- $roles = new WP_Roles();
454
- //get all capabilities first and merge them in one array
455
- $capabilities = array();
456
- foreach ($roles->role_objects as $role) {
457
- $capabilities = array_merge($capabilities, $role->capabilities);
458
- }
459
-
460
- if (count($capabilities)) {
461
- //update administrator capability role
462
- if ($admin = $roles->get_role('administrator')) {
463
- foreach ($capabilities as $capability => $grand) {
464
- $admin->add_cap($capability);
465
- }
466
- } else {
467
- $roles->add_role('administrator', 'Administrator', $capabilities);
468
- }
469
- //remove Super Admin Role
470
- $roles->remove_role('super_admin');
471
- }
472
- }
473
-
474
- protected function complete() {
475
- aam_Core_API::updateBlogOption('aam_migrated', 1, 1);
476
-
477
- return array('status' => 'success', 'stop' => 1);
478
- }
479
-
480
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
application/view/abstract.php CHANGED
@@ -20,7 +20,7 @@ abstract class aam_View_Abstract {
20
  * @var type
21
  */
22
  static private $_subject = null;
23
-
24
  /**
25
  *
26
  */
@@ -66,5 +66,5 @@ abstract class aam_View_Abstract {
66
 
67
  return $content;
68
  }
69
-
70
  }
20
  * @var type
21
  */
22
  static private $_subject = null;
23
+
24
  /**
25
  *
26
  */
66
 
67
  return $content;
68
  }
69
+
70
  }
application/view/ajax.php CHANGED
@@ -110,6 +110,10 @@ class aam_View_Ajax extends aam_View_Abstract{
110
  case 'clear_access':
111
  $response = $this->clearAccess();
112
  break;
 
 
 
 
113
 
114
  case 'event_list':
115
  $response = $this->getEventList();
@@ -134,6 +138,10 @@ class aam_View_Ajax extends aam_View_Abstract{
134
  case 'remove_extension':
135
  $response = $this->removeExtension();
136
  break;
 
 
 
 
137
 
138
  //TODO - Remove in 07/15/2014
139
  case 'migrate':
@@ -411,6 +419,19 @@ class aam_View_Ajax extends aam_View_Abstract{
411
 
412
  return $model->clearAccess();
413
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
414
 
415
  /**
416
  * Prepare and generate the post breadcrumb
@@ -502,6 +523,20 @@ class aam_View_Ajax extends aam_View_Abstract{
502
 
503
  return $model->remove();
504
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
505
 
506
  /**
507
  * Migrate
110
  case 'clear_access':
111
  $response = $this->clearAccess();
112
  break;
113
+
114
+ case 'delete_post':
115
+ $response = $this->deletePost();
116
+ break;
117
 
118
  case 'event_list':
119
  $response = $this->getEventList();
138
  case 'remove_extension':
139
  $response = $this->removeExtension();
140
  break;
141
+
142
+ case 'save_configpress':
143
+ $response = $this->saveConfigPress();
144
+ break;
145
 
146
  //TODO - Remove in 07/15/2014
147
  case 'migrate':
419
 
420
  return $model->clearAccess();
421
  }
422
+
423
+ /**
424
+ * Delete Post
425
+ *
426
+ * @return string
427
+ *
428
+ * @access protected
429
+ */
430
+ protected function deletePost(){
431
+ $model = new aam_View_Post();
432
+
433
+ return $model->deletePost();
434
+ }
435
 
436
  /**
437
  * Prepare and generate the post breadcrumb
523
 
524
  return $model->remove();
525
  }
526
+
527
+ /**
528
+ * Save ConfigPress
529
+ *
530
+ * @return string
531
+ *
532
+ * @access protected
533
+ */
534
+ protected function saveConfigPress(){
535
+ $result = aam_Core_ConfigPress::write(aam_Core_Request::post('config'));
536
+ return json_encode(array(
537
+ 'status' => ($result === false ? 'failure' : 'success')
538
+ ));
539
+ }
540
 
541
  /**
542
  * Migrate
application/view/configpress.php CHANGED
@@ -1,28 +1,29 @@
1
- <?php
2
- /**
3
- * ======================================================================
4
- * LICENSE: This file is subject to the terms and conditions defined in *
5
- * file 'license.txt', which is part of this source code package. *
6
- * ======================================================================
7
- */
8
-
9
- /**
10
- *
11
- * @package AAM
12
- * @author Vasyl Martyniuk <support@wpaam.com>
13
- * @copyright Copyright C 2013 Vasyl Martyniuk
14
- * @license GNU General Public License {@link http://www.gnu.org/licenses/}
15
- */
16
- class aam_View_ConfigPress extends aam_View_Abstract
17
- {
18
-
19
- /**
20
- *
21
- * @return type
22
- */
23
- public function content()
24
- {
25
- return $this->loadTemplate(dirname(__FILE__) . '/tmpl/configpress.phtml');
26
- }
27
-
 
28
  }
1
+ <?php
2
+ /**
3
+ * ======================================================================
4
+ * LICENSE: This file is subject to the terms and conditions defined in *
5
+ * file 'license.txt', which is part of this source code package. *
6
+ * ======================================================================
7
+ */
8
+
9
+ /**
10
+ *
11
+ * @package AAM
12
+ * @author Vasyl Martyniuk <support@wpaam.com>
13
+ * @copyright Copyright C 2013 Vasyl Martyniuk
14
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
15
+ */
16
+ class aam_View_ConfigPress extends aam_View_Abstract {
17
+
18
+ /**
19
+ * Run the Manager
20
+ *
21
+ * @return string
22
+ *
23
+ * @access public
24
+ */
25
+ public function run() {
26
+ return $this->loadTemplate(dirname(__FILE__) . '/tmpl/configpress.phtml');
27
+ }
28
+
29
  }
application/view/extension.php CHANGED
@@ -23,7 +23,7 @@ class aam_View_Extension extends aam_View_Abstract {
23
  * @access private
24
  */
25
  private $_repository = array();
26
-
27
  /**
28
  * Constructor
29
  *
@@ -93,9 +93,16 @@ class aam_View_Extension extends aam_View_Abstract {
93
  * @access public
94
  */
95
  public function run() {
 
 
 
 
 
 
 
96
  return $this->loadTemplate(dirname(__FILE__) . '/tmpl/extension.phtml');
97
  }
98
-
99
  /**
100
  * Check if extensions exists
101
  *
23
  * @access private
24
  */
25
  private $_repository = array();
26
+
27
  /**
28
  * Constructor
29
  *
93
  * @access public
94
  */
95
  public function run() {
96
+ //check if plugins/advanced-access-manager/extension is writable
97
+ if (!is_writable(AAM_BASE_DIR . 'extension')){
98
+ aam_Core_Console::add(__(
99
+ 'Folder advanced-access-manager/extension is not writable', 'aam'
100
+ ));
101
+ }
102
+
103
  return $this->loadTemplate(dirname(__FILE__) . '/tmpl/extension.phtml');
104
  }
105
+
106
  /**
107
  * Check if extensions exists
108
  *
application/view/manager.php CHANGED
@@ -128,14 +128,6 @@ class aam_View_Manager extends aam_View_Abstract {
128
  'anonimus' => false,
129
  'content' => array(new aam_View_Event(), 'content'),
130
  'help' => __('Define your own action when some event appeared in your WordPress blog. This sections allows you to trigger an action on event like post content change, or page status update. You can setup to send email notification, change the post status or write your own custom event handler.', 'aam')
131
- ),
132
- 'config_press' => array(
133
- 'id' => 'configpress',
134
- 'position' => 30,
135
- 'title' => __('ConfigPress', 'aam'),
136
- 'anonimus' => true,
137
- 'content' => array(new aam_View_ConfigPress(), 'content'),
138
- 'help' => __('Control <b>AAM</b> behavior with ConfigPress. For more details please check <b>ConfigPress tutorial</b>.', 'aam')
139
  )
140
  );
141
  }
@@ -376,7 +368,14 @@ class aam_View_Manager extends aam_View_Abstract {
376
  'Unlock Default Accesss Control' => __('Unlock Default Accesss Control', 'aam'),
377
  'Close' => __('Close', 'aam'),
378
  'Edit Role' => __('Edit Role', 'aam'),
379
- 'Restore Default Capabilities' => __('Restore Default Capabilities', 'aam')
 
 
 
 
 
 
 
380
  ));
381
  }
382
 
128
  'anonimus' => false,
129
  'content' => array(new aam_View_Event(), 'content'),
130
  'help' => __('Define your own action when some event appeared in your WordPress blog. This sections allows you to trigger an action on event like post content change, or page status update. You can setup to send email notification, change the post status or write your own custom event handler.', 'aam')
 
 
 
 
 
 
 
 
131
  )
132
  );
133
  }
368
  'Unlock Default Accesss Control' => __('Unlock Default Accesss Control', 'aam'),
369
  'Close' => __('Close', 'aam'),
370
  'Edit Role' => __('Edit Role', 'aam'),
371
+ 'Restore Default Capabilities' => __('Restore Default Capabilities', 'aam'),
372
+ 'Delete Post Message' => __('Are you sure you want to delete <b>%s</b>?', 'aam'),
373
+ 'Trash Post Message' => __('Are you sure you want to move <b>%s</b> to trash?', 'aam'),
374
+ 'Delete Post' => __('Delete Post', 'aam'),
375
+ 'Delete Permanently' => __('Delete Permanently', 'aam'),
376
+ 'Trash Post' => __('Trash Post', 'aam'),
377
+ 'Restore Default Access' => __('Restore Default Access', 'aam')
378
+
379
  ));
380
  }
381
 
application/view/post.php CHANGED
@@ -72,23 +72,33 @@ class aam_View_Post extends aam_View_Abstract {
72
  * @return type
73
  */
74
  public function retrievePostList() {
75
- global $wp_post_statuses, $wp_post_types;
76
 
77
  $term = trim(aam_Core_Request::request('term'));
78
-
 
79
  if (empty($term)) {
80
  $post_type = 'post';
 
81
  } elseif (isset($wp_post_types[$term])) {
82
  $post_type = $term;
83
  $term = '';
84
  } else {
85
- $post_type = '';
 
 
 
 
 
 
86
  }
87
-
88
  $args = array(
89
  'numberposts' => aam_Core_Request::request('iDisplayLength'),
90
  'offset' => aam_Core_Request::request('iDisplayStart'),
91
- 'category' => $term,
 
 
92
  'post_type' => $post_type,
93
  's' => aam_Core_Request::request('sSearch'),
94
  'post_status' => array()
@@ -97,7 +107,9 @@ class aam_View_Post extends aam_View_Abstract {
97
  $argsAll = array(
98
  'numberposts' => '999999',
99
  'fields' => 'ids',
100
- 'category' => $term,
 
 
101
  'post_type' => $post_type,
102
  's' => aam_Core_Request::request('sSearch'),
103
  'post_status' => array()
@@ -116,7 +128,7 @@ class aam_View_Post extends aam_View_Abstract {
116
  $total += $number;
117
  }
118
  }
119
-
120
  //get displayed total
121
  $displayTotal = count(get_posts($argsAll));
122
 
@@ -127,19 +139,39 @@ class aam_View_Post extends aam_View_Abstract {
127
  'aaData' => array(),
128
  );
129
 
130
- foreach (get_posts($args) as $post) {
 
 
 
131
  $response['aaData'][] = array(
132
- $post->ID,
133
- $post->post_status,
134
- get_edit_post_link($post->ID),
135
- $post->post_title,
136
- $wp_post_statuses[$post->post_status]->label,
137
- ''
 
138
  );
139
  }
140
 
141
  return json_encode($response);
142
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
 
144
  /**
145
  *
@@ -187,6 +219,25 @@ class aam_View_Post extends aam_View_Abstract {
187
 
188
  return json_encode($tree);
189
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
 
191
  /**
192
  *
@@ -396,7 +447,7 @@ class aam_View_Post extends aam_View_Abstract {
396
  aam_Core_API::getBlogOption('aam_access_limit', 0)
397
  );
398
 
399
- if ($limit_counter == -1 || $limit_counter <= 5) {
400
  $access = aam_Core_Request::post('access');
401
  if (aam_Core_Request::post('type') == 'term') {
402
  $object = $this->getSubject()->getObject(
72
  * @return type
73
  */
74
  public function retrievePostList() {
75
+ global $wp_post_statuses, $wp_post_types, $wp_taxonomies;
76
 
77
  $term = trim(aam_Core_Request::request('term'));
78
+
79
+ //default behavior
80
  if (empty($term)) {
81
  $post_type = 'post';
82
+ //root for each Post Type
83
  } elseif (isset($wp_post_types[$term])) {
84
  $post_type = $term;
85
  $term = '';
86
  } else {
87
+ $taxonomy = $this->getTaxonomy($term);
88
+ if (isset($wp_taxonomies[$taxonomy])){
89
+ //take in consideration only first object type
90
+ $post_type = $wp_taxonomies[$taxonomy]->object_type[0];
91
+ } else {
92
+ $post_type = 'post';
93
+ }
94
  }
95
+
96
  $args = array(
97
  'numberposts' => aam_Core_Request::request('iDisplayLength'),
98
  'offset' => aam_Core_Request::request('iDisplayStart'),
99
+ 'fields' => 'ids',
100
+ 'term' => $term,
101
+ 'taxonomy' => (!empty($taxonomy) ? $taxonomy : ''),
102
  'post_type' => $post_type,
103
  's' => aam_Core_Request::request('sSearch'),
104
  'post_status' => array()
107
  $argsAll = array(
108
  'numberposts' => '999999',
109
  'fields' => 'ids',
110
+ //'category' => $term,
111
+ 'term' => $term,
112
+ 'taxonomy' => (!empty($taxonomy) ? $taxonomy : ''),
113
  'post_type' => $post_type,
114
  's' => aam_Core_Request::request('sSearch'),
115
  'post_status' => array()
128
  $total += $number;
129
  }
130
  }
131
+
132
  //get displayed total
133
  $displayTotal = count(get_posts($argsAll));
134
 
139
  'aaData' => array(),
140
  );
141
 
142
+ foreach (get_posts($args) as $post_id) {
143
+ $post = $this->getSubject()->getObject(
144
+ aam_Control_Object_Post::UID, $post_id
145
+ );
146
  $response['aaData'][] = array(
147
+ $post->getPost()->ID,
148
+ $post->getPost()->post_status,
149
+ get_edit_post_link($post->getPost()->ID),
150
+ $post->getPost()->post_title,
151
+ $wp_post_statuses[$post->getPost()->post_status]->label,
152
+ '',
153
+ ($post->getOption() && !$post->getInherited() ? 1 : 0)
154
  );
155
  }
156
 
157
  return json_encode($response);
158
  }
159
+
160
+ /**
161
+ * Get Taxonomy by Term ID
162
+ *
163
+ * @global type $wpdb
164
+ * @param type $object_id
165
+ * @return type
166
+ */
167
+ private function getTaxonomy($object_id) {
168
+ global $wpdb;
169
+
170
+ $query = "SELECT taxonomy FROM {$wpdb->term_taxonomy} ";
171
+ $query .= "WHERE term_id = {$object_id}";
172
+
173
+ return $wpdb->get_var($query);
174
+ }
175
 
176
  /**
177
  *
219
 
220
  return json_encode($tree);
221
  }
222
+
223
+ /**
224
+ * Delete Post
225
+ *
226
+ * @return string
227
+ *
228
+ * @access public
229
+ */
230
+ public function deletePost(){
231
+ $post_id = aam_Core_Request::post('post');
232
+
233
+ if (aam_Core_Request::post('force')){
234
+ $result = wp_delete_post($post_id, true);
235
+ } else {
236
+ $result = wp_trash_post($post_id);
237
+ }
238
+
239
+ return json_encode(array('status' => ($result ? 'success' : 'failure')));
240
+ }
241
 
242
  /**
243
  *
447
  aam_Core_API::getBlogOption('aam_access_limit', 0)
448
  );
449
 
450
+ if ($limit_counter == -1 || $limit_counter <= 10) {
451
  $access = aam_Core_Request::post('access');
452
  if (aam_Core_Request::post('type') == 'term') {
453
  $object = $this->getSubject()->getObject(
application/view/tmpl/configpress.phtml CHANGED
@@ -1,15 +1,66 @@
1
- <?php
2
- /**
3
- * ======================================================================
4
- * LICENSE: This file is subject to the terms and conditions defined in *
5
- * file 'license.txt', which is part of this source code package. *
6
- * ======================================================================
7
- */
8
- ?>
9
- <div class="feature-content-container" id="configpress_content">
10
- <div class="configpress-top-actions">
11
- <a href="<?php echo AAM_BASE_URL . '/docs/configpress.pdf' ?>" target="_blank" class="configpress-top-action-item configpress-top-action-tutorial" tooltip="<?php echo __('Download ConfigPress Tutorial', 'aam'); ?>"></a>
12
- </div>
13
-
14
- <textarea id="configpress" style="width:100%; height: 400px;"><?php echo $this->getSubject()->getObject(aam_Control_Object_ConfigPress::UID)->getConfig(); ?></textarea>
15
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap" id="aam">
2
+ <div class="postbox-container" style="width:70%;">
3
+ <div class="metabox-holder">
4
+ <div class="meta-box-sortables">
5
+ <div class="postbox">
6
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
7
+ <h3 class="hndle">
8
+ <span>
9
+ <?php echo __('AAM ConfigPress', 'aam'); ?>
10
+ </span>
11
+ </h3>
12
+ <div class="inside">
13
+ <textarea id="configpress" style="width:100%; height: 400px;"><?php echo aam_Core_ConfigPress::read(); ?></textarea>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ </div>
19
+
20
+ <?php if (aam_Core_Console::hasIssues()) { ?>
21
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
22
+ <div class="metabox-holder">
23
+ <div class="meta-box-sortables">
24
+ <div class="postbox">
25
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
26
+ <h3 class="hndle">
27
+ <span><?php echo __('AAM Warnings', 'aam'); ?></span>
28
+ </h3>
29
+ <div class="inside">
30
+ <?php foreach (aam_Core_Console::getWarnings() as $warning) { ?>
31
+ <div class="aam-warning"><span><?php echo $warning; ?></span></div>
32
+ <?php } ?>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ <?php } ?>
39
+
40
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
41
+ <div class="metabox-holder">
42
+ <div class="meta-box-sortables">
43
+ <div class="postbox" id="control_panel">
44
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
45
+ <h3 class="hndle">
46
+ <span><?php echo __('Control Panel', 'aam'); ?></span>
47
+ </h3>
48
+ <div class="inside">
49
+ <div class="cpanel-major">
50
+ <a href="<?php echo AAM_BASE_URL . '/docs/configpress.pdf' ?>" target="_blank" class="cpanel-item cpanel-item-tutorial"><?php echo __('Tutorial', 'aam'); ?></a>
51
+ <a href="#" class="cpanel-item cpanel-item-save" id="save_config" ><?php echo __('Save', 'aam'); ?></a>
52
+ </div>
53
+ <div class="cpanel-minor">
54
+ <a href="https://twitter.com/wpaam" target="_blank" class="cpanel-item cpanel-item-twitter" id="aam_twitter" aam-tooltip="<?php echo __('Follow @wpaam', 'aam'); ?>"><?php echo __('Follow', 'aam'); ?></a>
55
+ <a href="http://wpaam.com/support" target="_blank" class="cpanel-item cpanel-item-help" id="aam_help" aam-tooltip="<?php echo __('Help Forum', 'aam'); ?>"><?php echo __('Help', 'aam'); ?></a>
56
+ <a href="mailto:support@wpaam.com" class="cpanel-item cpanel-item-message" id="aam_message" aam-tooltip="<?php echo __('E-mail Us', 'aam'); ?>"><?php echo __('E-mail Us', 'aam'); ?></a>
57
+ <a href="http://wordpress.org/support/view/plugin-reviews/advanced-access-manager" target="_blank" class="cpanel-item cpanel-item-star" aam-tooltip="<?php echo __('Rate AAM', 'aam'); ?>"><?php echo __('Rate Us', 'aam'); ?></a>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </div>
65
+
66
+
application/view/tmpl/extension.phtml CHANGED
@@ -36,11 +36,32 @@
36
  <td class="extension-price payed">$30.00</td>
37
  <td>
38
  <div class="extension-actions">
39
- <a href="http://wpaam.com/support#viewtopic.php?f=7&t=10" target="_blank" class="extension-action extension-action-forum" tooltip="Visit Our Forum"></a>
40
  <?php if ($this->hasExtension('AAM Plus Package')) { ?>
41
- <a href="#" extension="AAM Plus Package" license="<?php echo $this->getExtension('AAM Plus Package')->license; ?>" class="extension-action extension-action-ok" tooltip="Installed Successfully"></a>
42
  <?php } else { ?>
43
- <a href="#" extension="AAM Plus Package" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UEM8U65HFEG4Q" class="extension-action extension-action-purchase" tooltip="Get it Today"></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  <?php } ?>
45
  </div>
46
  </td>
@@ -53,7 +74,7 @@
53
  <input type="text" class="license-input" id="license_key" placeholder="License Key" />
54
  </p>
55
  </div>
56
- <div id="update_extension" class="aam-dialog" title="<?php echo __('Update Extension', 'aam'); ?>">
57
  <p class="dialog-content" style="text-align: center;">
58
  <?php echo __('Extension has been installed. Your license key: ', 'aam'); ?><br/>
59
  <b><span id="installed_license_key"></span></b>
@@ -64,6 +85,27 @@
64
  </div>
65
  </div>
66
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  <div class="postbox-container" style="width:25%; margin-left: 2%;">
68
  <div class="metabox-holder">
69
  <div class="meta-box-sortables">
@@ -74,9 +116,9 @@
74
  </h3>
75
  <div class="inside">
76
  <div id="misc-publishing-actions" class="cpanel">
77
- <a href="https://twitter.com/wpaam" class="cpanel-item cpanel-item-twitter" tooltip="Follow @wpaam" target="_blank">Follow</a>
78
- <a href="mailto:support@wpaam.com" class="cpanel-item cpanel-item-message" tooltip="Send Us Email">Send Message</a>
79
- <a href="http://wpaam.com" class="cpanel-item cpanel-item-website" tooltip="Visit Us" target="_blank">Website</a>
80
  </div>
81
  </div>
82
  </div>
36
  <td class="extension-price payed">$30.00</td>
37
  <td>
38
  <div class="extension-actions">
39
+ <a href="http://wpaam.com/support#viewtopic.php?f=7&t=10" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Forum"></a>
40
  <?php if ($this->hasExtension('AAM Plus Package')) { ?>
41
+ <a href="#" extension="AAM Plus Package" license="<?php echo $this->getExtension('AAM Plus Package')->license; ?>" class="extension-action extension-action-ok" aam-tooltip="Installed Successfully"></a>
42
  <?php } else { ?>
43
+ <a href="#" extension="AAM Plus Package" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UEM8U65HFEG4Q" class="extension-action extension-action-purchase" aam-tooltip="Get it Today"></a>
44
+ <?php } ?>
45
+ </div>
46
+ </td>
47
+ </tr>
48
+ <tr>
49
+ <td>
50
+ <span class="extension-name">AAM Activities</span>
51
+ </td>
52
+ <td class="extension-description">
53
+ Extend the list of activities that AAM can track. By default AAM logs only user <i>login</i> and <i>logout</i>.
54
+ By purchasing this extension you can also track activities like post trash, delete, update etc.
55
+ As well as we can implement any additional activity on demand. Read our <a href="http://wpaam.com/forum/viewtopic.php?f=7&t=91#p243" traget="_blank">Forum</a> for more details.
56
+ </td>
57
+ <td class="extension-price payed">$20.00</td>
58
+ <td>
59
+ <div class="extension-actions">
60
+ <a href="http://wpaam.com/forum/viewtopic.php?f=7&t=91#p243" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Forum"></a>
61
+ <?php if ($this->hasExtension('AAM Activities')) { ?>
62
+ <a href="#" extension="AAM Activities" license="<?php echo $this->getExtension('AAM Activities')->license; ?>" class="extension-action extension-action-ok" aam-tooltip="Installed Successfully"></a>
63
+ <?php } else { ?>
64
+ <a href="#" extension="AAM Activities" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HME9DTSFSJH4W" class="extension-action extension-action-purchase" aam-tooltip="Get it Today"></a>
65
  <?php } ?>
66
  </div>
67
  </td>
74
  <input type="text" class="license-input" id="license_key" placeholder="License Key" />
75
  </p>
76
  </div>
77
+ <div id="update_extension" class="aam-dialog" title="<?php echo __('Update Extension', 'aam'); ?>">
78
  <p class="dialog-content" style="text-align: center;">
79
  <?php echo __('Extension has been installed. Your license key: ', 'aam'); ?><br/>
80
  <b><span id="installed_license_key"></span></b>
85
  </div>
86
  </div>
87
  </div>
88
+
89
+ <?php if (aam_Core_Console::hasIssues()) { ?>
90
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
91
+ <div class="metabox-holder">
92
+ <div class="meta-box-sortables">
93
+ <div class="postbox">
94
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
95
+ <h3 class="hndle">
96
+ <span><?php echo __('AAM Warnings', 'aam'); ?></span>
97
+ </h3>
98
+ <div class="inside">
99
+ <?php foreach (aam_Core_Console::getWarnings() as $warning) { ?>
100
+ <div class="aam-warning"><span><?php echo $warning; ?></span></div>
101
+ <?php } ?>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ </div>
106
+ </div>
107
+ <?php } ?>
108
+
109
  <div class="postbox-container" style="width:25%; margin-left: 2%;">
110
  <div class="metabox-holder">
111
  <div class="meta-box-sortables">
116
  </h3>
117
  <div class="inside">
118
  <div id="misc-publishing-actions" class="cpanel">
119
+ <a href="https://twitter.com/wpaam" class="cpanel-item cpanel-item-twitter" aam-tooltip="Follow @wpaam" target="_blank">Follow</a>
120
+ <a href="mailto:support@wpaam.com" class="cpanel-item cpanel-item-message" aam-tooltip="Send Us Email">Send Message</a>
121
+ <a href="http://wpaam.com" class="cpanel-item cpanel-item-website" aam-tooltip="Visit Us" target="_blank">Website</a>
122
  </div>
123
  </div>
124
  </div>
application/view/tmpl/manager.phtml CHANGED
@@ -29,6 +29,26 @@
29
  </div>
30
  </div>
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  <div class="postbox-container" style="width:25%; margin-left: 2%;">
33
  <div class="metabox-holder" id="control_panel">
34
  <div class="meta-box-sortables">
@@ -38,17 +58,15 @@
38
  <span><?php echo __('Control Panel', 'aam'); ?></span>
39
  </h3>
40
  <div class="inside">
41
- <div>
42
- <div class="cpanel-major">
43
- <a href="#" class="cpanel-item cpanel-item-restore" id="aam_roleback" tooltip="<?php echo __('Undo Change', 'aam'); ?>"><?php echo __('Undo Change', 'aam'); ?></a>
44
- <a href="#" class="cpanel-item cpanel-item-save" id="aam_save" ><?php echo __('Save', 'aam'); ?></a>
45
- </div>
46
  </div>
47
  <div class="cpanel-minor">
48
- <a href="https://twitter.com/wpaam" target="_blank" class="cpanel-item cpanel-item-twitter" id="aam_twitter" tooltip="<?php echo __('Follow @wpaam', 'aam'); ?>"><?php echo __('Follow', 'aam'); ?></a>
49
- <a href="http://wpaam.com/support" target="_blank" class="cpanel-item cpanel-item-help" id="aam_help" tooltip="<?php echo __('Help Forum', 'aam'); ?>"><?php echo __('Help', 'aam'); ?></a>
50
- <a href="#" class="cpanel-item cpanel-item-message" id="aam_message" tooltip="<?php echo __('E-mail Us', 'aam'); ?>"><?php echo __('E-mail Us', 'aam'); ?></a>
51
- <a href="http://wordpress.org/support/view/plugin-reviews/advanced-access-manager" target="_blank" class="cpanel-item cpanel-item-star" tooltip="<?php echo __('Rate AAM', 'aam'); ?>"><?php echo __('Rate Us', 'aam'); ?></a>
52
  </div>
53
  <div class="aam-metabox-loader"></div>
54
  </div>
@@ -75,7 +93,7 @@
75
  <?php
76
  foreach ($this->getCManager() as $item) {
77
  echo '<a href="#" class="', $item['class'], '" ';
78
- echo 'id="', $item['id'], '" tooltip="', $item['title'], '" segment="' . $item['segment'] . '">';
79
  echo $item['label'], '</a>';
80
  }
81
  ?>
29
  </div>
30
  </div>
31
 
32
+ <?php if (aam_Core_Console::hasIssues()) { ?>
33
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
34
+ <div class="metabox-holder">
35
+ <div class="meta-box-sortables">
36
+ <div class="postbox">
37
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
38
+ <h3 class="hndle">
39
+ <span><?php echo __('AAM Warnings', 'aam'); ?></span>
40
+ </h3>
41
+ <div class="inside">
42
+ <?php foreach (aam_Core_Console::getWarnings() as $warning) { ?>
43
+ <div class="aam-warning"><span><?php echo $warning; ?></span></div>
44
+ <?php } ?>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ <?php } ?>
51
+
52
  <div class="postbox-container" style="width:25%; margin-left: 2%;">
53
  <div class="metabox-holder" id="control_panel">
54
  <div class="meta-box-sortables">
58
  <span><?php echo __('Control Panel', 'aam'); ?></span>
59
  </h3>
60
  <div class="inside">
61
+ <div class="cpanel-major">
62
+ <a href="#" class="cpanel-item cpanel-item-restore" id="aam_roleback" aam-tooltip="<?php echo __('Undo Change', 'aam'); ?>"><?php echo __('Undo Change', 'aam'); ?></a>
63
+ <a href="#" class="cpanel-item cpanel-item-save" id="aam_save" ><?php echo __('Save', 'aam'); ?></a>
 
 
64
  </div>
65
  <div class="cpanel-minor">
66
+ <a href="https://twitter.com/wpaam" target="_blank" class="cpanel-item cpanel-item-twitter" id="aam_twitter" aam-tooltip="<?php echo __('Follow @wpaam', 'aam'); ?>"><?php echo __('Follow', 'aam'); ?></a>
67
+ <a href="http://wpaam.com/support" target="_blank" class="cpanel-item cpanel-item-help" id="aam_help" aam-tooltip="<?php echo __('Help Forum', 'aam'); ?>"><?php echo __('Help', 'aam'); ?></a>
68
+ <a href="#" class="cpanel-item cpanel-item-message" id="aam_message" aam-tooltip="<?php echo __('E-mail Us', 'aam'); ?>"><?php echo __('E-mail Us', 'aam'); ?></a>
69
+ <a href="http://wordpress.org/support/view/plugin-reviews/advanced-access-manager" target="_blank" class="cpanel-item cpanel-item-star" aam-tooltip="<?php echo __('Rate AAM', 'aam'); ?>"><?php echo __('Rate Us', 'aam'); ?></a>
70
  </div>
71
  <div class="aam-metabox-loader"></div>
72
  </div>
93
  <?php
94
  foreach ($this->getCManager() as $item) {
95
  echo '<a href="#" class="', $item['class'], '" ';
96
+ echo 'id="', $item['id'], '" aam-tooltip="', $item['title'], '" segment="' . $item['segment'] . '">';
97
  echo $item['label'], '</a>';
98
  }
99
  ?>
application/view/tmpl/menu.phtml CHANGED
@@ -43,7 +43,7 @@ $menu = $this->getMenu();
43
  }
44
  ?>
45
  <div class="menu-submenu-item">
46
- <label for="m<?php echo $menu_id . $j; ?>" tooltip="<?php echo $submenu['name']; ?>" ><?php echo $submenu['short']; ?></label>
47
  <input type="checkbox" id="m<?php echo $menu_id . $j; ?>" name="aam[<?php echo aam_Control_Object_Menu::UID; ?>][<?php echo $submenu['id']; ?>]" <?php echo ($menuControl->has($submenu['id']) ? 'checked="checked"' : ''); ?> />
48
  <label for="m<?php echo $menu_id . $j; ?>"><span></span></label>
49
  </div>
43
  }
44
  ?>
45
  <div class="menu-submenu-item">
46
+ <label for="m<?php echo $menu_id . $j; ?>" aam-tooltip="<?php echo $submenu['name']; ?>" ><?php echo $submenu['short']; ?></label>
47
  <input type="checkbox" id="m<?php echo $menu_id . $j; ?>" name="aam[<?php echo aam_Control_Object_Menu::UID; ?>][<?php echo $submenu['id']; ?>]" <?php echo ($menuControl->has($submenu['id']) ? 'checked="checked"' : ''); ?> />
48
  <label for="m<?php echo $menu_id . $j; ?>"><span></span></label>
49
  </div>
application/view/tmpl/metabox.phtml CHANGED
@@ -11,8 +11,8 @@
11
  <div class="metabox-top-action-link">
12
  <input type="text" class="link-text" id="metabox_link" />
13
  </div>
14
- <a href="#" class="metabox-top-action metabox-top-action-add" tooltip="<?php echo __('Retrieve Metaboxes From Link', 'aam') ;?>"></a>
15
- <a href="#" class="metabox-top-action metabox-top-action-refresh" tooltip="<?php echo __('Refresh the List', 'aam') ;?>"></a>
16
  <br class="clear" />
17
  </div>
18
  <div class="aam-metabox-loader"></div>
11
  <div class="metabox-top-action-link">
12
  <input type="text" class="link-text" id="metabox_link" />
13
  </div>
14
+ <a href="#" class="metabox-top-action metabox-top-action-add" aam-tooltip="<?php echo __('Retrieve Metaboxes From Link', 'aam') ;?>"></a>
15
+ <a href="#" class="metabox-top-action metabox-top-action-refresh" aam-tooltip="<?php echo __('Refresh the List', 'aam') ;?>"></a>
16
  <br class="clear" />
17
  </div>
18
  <div class="aam-metabox-loader"></div>
application/view/tmpl/post.phtml CHANGED
@@ -16,11 +16,16 @@
16
  <th width="60%"><?php echo __('Name', 'aam'); ?></th>
17
  <th width="20%"><?php echo __('Status', 'aam'); ?></th>
18
  <th><?php echo __('Control', 'aam'); ?></th>
 
19
  </tr>
20
  </thead>
21
  <tbody>
22
  </tbody>
23
  </table>
 
 
 
 
24
 
25
  <div id="filter_post_dialog" class="aam-dialog" title="<?php echo __('Filter Posts by Type', 'aam'); ?>">
26
  <div class="tree-holder postbox">
@@ -36,7 +41,7 @@
36
 
37
  <div id="access_dialog" class="aam-dialog">
38
  <div class="aam-lock-message">
39
- <span><?php echo __('You riched the limit. Get <a href="' . admin_url('admin.php?page=aam-ext') . '" target="_blank">AAM Plus Package</a> to unlock the feature.'); ?></span>
40
  </div>
41
  <div class="post-access-inherited"></div>
42
  <?php if ($this->getSubject()->getUID() != 'visitor') { ?>
16
  <th width="60%"><?php echo __('Name', 'aam'); ?></th>
17
  <th width="20%"><?php echo __('Status', 'aam'); ?></th>
18
  <th><?php echo __('Control', 'aam'); ?></th>
19
+ <th>Restriction Status</th>
20
  </tr>
21
  </thead>
22
  <tbody>
23
  </tbody>
24
  </table>
25
+
26
+ <div id="delete_post_dialog" class="aam-dialog" title="<?php echo __('Delete Post', 'aam'); ?>">
27
+ <p class="dialog-content"></p>
28
+ </div>
29
 
30
  <div id="filter_post_dialog" class="aam-dialog" title="<?php echo __('Filter Posts by Type', 'aam'); ?>">
31
  <div class="tree-holder postbox">
41
 
42
  <div id="access_dialog" class="aam-dialog">
43
  <div class="aam-lock-message">
44
+ <span><?php echo __('You reached the limit. Get <a href="' . admin_url('admin.php?page=aam-ext') . '" target="_blank">AAM Plus Package</a> to unlock the feature.'); ?></span>
45
  </div>
46
  <div class="post-access-inherited"></div>
47
  <?php if ($this->getSubject()->getUID() != 'visitor') { ?>
config.php CHANGED
@@ -7,11 +7,10 @@
7
  */
8
 
9
  //AAM Version for Update purpose
10
- define('AAM_VERSION', '2.1');
11
 
12
  define('AAM_BASE_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
13
 
14
- //jean.yves.dumaine@gmail.com feedback - thank you
15
  $base_url = WP_PLUGIN_URL . '/' . basename(AAM_BASE_DIR) . '/';
16
  if (force_ssl_admin()) {
17
  $base_url = str_replace('http', 'https', $base_url);
@@ -53,43 +52,16 @@ function aam_autoload($class_name) {
53
 
54
  spl_autoload_register('aam_autoload');
55
 
56
- function aam_content_folder() {
57
- echo "<div class='update-nag'>";
58
- echo __('<b>wp-content</b> folder is not writable or does not exists. ', 'aam');
59
- echo '<a href="http://wpaam.com/support#viewtopic.php?f=4&t=23" target="_blank">';
60
- echo __('Read more.', 'aam') . '</a>';
61
- echo '</div>';
62
- }
63
-
64
  //make sure that we have always content dir
65
  if (!file_exists(AAM_TEMP_DIR)) {
66
  if (@mkdir(AAM_TEMP_DIR)) {
67
  //silence the directory
68
  file_put_contents(AAM_TEMP_DIR . '/index.php', '');
69
- } else {
70
- define('AAM_CONTENT_DIR_FAILURE', 1);
71
- if (is_multisite()) {
72
- add_action('network_admin_notices', 'aam_content_folder');
73
- } else {
74
- add_action('admin_notices', 'aam_content_folder');
75
- }
76
- }
77
- }
78
-
79
- load_plugin_textdomain('aam', false, basename(AAM_BASE_DIR) . '/lang');
80
-
81
- //set migration admin notice. TODO - remove in July 15 2014
82
- function aam_migration_note() {
83
- if (class_exists('aam_Core_Migrate') && !aam_Core_API::getBlogOption('aam_migrated')) {
84
- echo "<div class='update-nag'>";
85
- echo __('Migrate your old AAM settings to the new AAM platform. ', 'aam');
86
- echo '<a href="#" id="aam_migrate">' . __('Click to Migrate', 'aam') . '</a>';
87
- echo '</div>';
88
  }
 
 
89
  }
90
 
91
- if (is_multisite()) {
92
- add_action('network_admin_notices', 'aam_migration_note');
93
- } else {
94
- add_action('admin_notices', 'aam_migration_note');
95
- }
7
  */
8
 
9
  //AAM Version for Update purpose
10
+ define('AAM_VERSION', '2.2');
11
 
12
  define('AAM_BASE_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
13
 
 
14
  $base_url = WP_PLUGIN_URL . '/' . basename(AAM_BASE_DIR) . '/';
15
  if (force_ssl_admin()) {
16
  $base_url = str_replace('http', 'https', $base_url);
52
 
53
  spl_autoload_register('aam_autoload');
54
 
 
 
 
 
 
 
 
 
55
  //make sure that we have always content dir
56
  if (!file_exists(AAM_TEMP_DIR)) {
57
  if (@mkdir(AAM_TEMP_DIR)) {
58
  //silence the directory
59
  file_put_contents(AAM_TEMP_DIR . '/index.php', '');
60
+ } else {
61
+ aam_Core_Console::add(__('Failed to create wp-content/aam folder', 'aam'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
+ } elseif(!is_writable(AAM_TEMP_DIR)){
64
+ aam_Core_Console::add(__('Folder wp-content/aam is not writable', 'aam'));
65
  }
66
 
67
+ load_plugin_textdomain('aam', false, basename(AAM_BASE_DIR) . '/lang');
 
 
 
 
docs/configpress.pdf CHANGED
Binary file
extension/AAM_Activity_Log/activity.css ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * ======================================================================
3
+ * LICENSE: This file is subject to the terms and conditions defined in *
4
+ * file 'license.txt', which is part of this source code package. *
5
+ * ======================================================================
6
+ */
7
+ .activity-top-actions{
8
+ float: right;
9
+ display: inline-table;
10
+ width: auto;
11
+ text-align: right;
12
+ }
13
+
14
+ .activity-top-action{
15
+ width: 24px;
16
+ height: 24px;
17
+ display: table-cell;
18
+ text-indent: -9999px;
19
+ padding-right: 10px;
20
+ background-repeat: no-repeat;
21
+ background-position: center;
22
+ }
23
+
24
+ .activity-top-action-clear{
25
+ background-image: url('images/trash.png');
26
+ }
27
+
28
+ .activity-top-action-clear:hover{
29
+ background-image: url('images/trash-active.png');
30
+ }
31
+
32
+ .activity-top-action-clear-active{
33
+ background-image: url('images/trash-active.png');
34
+ }
35
+
36
+ .activity-top-action-info{
37
+ background-image: url('images/info.png');
38
+ }
39
+
40
+ .activity-top-action-info:hover{
41
+ background-image: url('images/info-active.png');
42
+ }
43
+
44
+ .activity-top-action-info-active{
45
+ background-image: url('images/info-active.png');
46
+ }
extension/AAM_Activity_Log/activity.js ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * ======================================================================
3
+ * LICENSE: This file is subject to the terms and conditions defined in *
4
+ * file 'license.txt', which is part of this source code package. *
5
+ * ======================================================================
6
+ */
7
+
8
+ /**
9
+ * Activity List
10
+ *
11
+ * @type object
12
+ */
13
+ AAM.prototype.blogTables.activityList = null;
14
+
15
+ /**
16
+ * Initialize and load activity tab
17
+ *
18
+ * @returns void
19
+ */
20
+ AAM.prototype.loadActivityTab = function() {
21
+ var _this = this;
22
+
23
+ if (this.blogTables.activityList === null) {
24
+ this.blogTables.activityList = jQuery('#activity_list').dataTable({
25
+ sDom: "<'top'lf<'activity-top-actions'><'clear'>>t<'footer'ip<'clear'>>",
26
+ sPaginationType: "full_numbers",
27
+ bAutoWidth: false,
28
+ bDestroy: true,
29
+ bSort: false,
30
+ sAjaxSource: ajaxurl,
31
+ fnServerParams: function(aoData) {
32
+ aoData.push({
33
+ name: 'action',
34
+ value: 'aam'
35
+ });
36
+ aoData.push({
37
+ name: 'sub_action',
38
+ value: 'activity_list'
39
+ });
40
+ aoData.push({
41
+ name: 'subject',
42
+ value: _this.getSubject().type
43
+ });
44
+ aoData.push({
45
+ name: 'subject_id',
46
+ value: _this.getSubject().id
47
+ });
48
+ aoData.push({
49
+ name: '_ajax_nonce',
50
+ value: aamLocal.nonce
51
+ });
52
+ },
53
+ fnInitComplete: function() {
54
+ var a = jQuery('#activity_list_wrapper .activity-top-actions');
55
+
56
+ var clear = jQuery('<a/>', {
57
+ 'href': '#',
58
+ 'class': 'activity-top-action activity-top-action-clear',
59
+ 'aam-tooltip': aamLocal.labels['Clear Logs']
60
+ }).bind('click', function(event) {
61
+ event.preventDefault();
62
+ _this.launch(jQuery(this), 'activity-top-action-clear');
63
+ _this.launchClearActivityLog();
64
+ });
65
+ jQuery(a).append(clear);
66
+
67
+ var info = jQuery('<a/>', {
68
+ 'href': '#',
69
+ 'class': 'activity-top-action activity-top-action-info',
70
+ 'aam-tooltip': aamLocal.labels['Get More']
71
+ }).bind('click', function(event) {
72
+ event.preventDefault();
73
+ _this.launch(jQuery(this), 'activity-top-action-info');
74
+ _this.launchActivityLogInfo();
75
+ });
76
+ jQuery(a).append(info);
77
+
78
+ _this.doAction('aam_activity_top_actions', {container: a});
79
+ },
80
+ fnRowCallback: function(nRow, aData) {
81
+ jQuery('td:eq(0)', nRow).html(jQuery('<a/>', {
82
+ href: aamLocal.editUserURI + '?user_id=' + aData[0],
83
+ target: '_blank'
84
+ }).html(aData[1]));
85
+ },
86
+ aoColumnDefs: [
87
+ {bVisible: false, aTargets: [0]}
88
+ ],
89
+ oLanguage: {
90
+ sSearch: "",
91
+ oPaginate: {
92
+ sFirst: "&Lt;",
93
+ sLast: "&Gt;",
94
+ sNext: "&gt;",
95
+ sPrevious: "&lt;"
96
+ },
97
+ sLengthMenu: "_MENU_"
98
+ }
99
+ });
100
+ }
101
+ };
102
+
103
+ /**
104
+ * Show Clear Activity Log Confirmation dialog
105
+ *
106
+ * @returns {void}
107
+ *
108
+ * @access public
109
+ */
110
+ AAM.prototype.launchClearActivityLog = function() {
111
+ var _this = this;
112
+
113
+ var buttons = {};
114
+
115
+ buttons[aamLocal.labels['Clear Logs']] = function() {
116
+ jQuery.ajax(aamLocal.ajaxurl, {
117
+ type: 'POST',
118
+ dataType: 'json',
119
+ data: _this.compileAjaxPackage('clear_activities', true),
120
+ complete: function() {
121
+ jQuery('#clear_activity_dialog').dialog("close");
122
+ }
123
+ });
124
+ };
125
+
126
+ buttons[aamLocal.labels['Cancel']] = function() {
127
+ jQuery('#clear_activity_dialog').dialog("close");
128
+ };
129
+
130
+ jQuery('#clear_activity_dialog').dialog({
131
+ resizable: false,
132
+ height: 'auto',
133
+ width: '20%',
134
+ modal: true,
135
+ buttons: buttons,
136
+ close: function() {
137
+ _this.terminate(
138
+ jQuery('.activity-top-action-clear'),
139
+ 'activity-top-action-clear'
140
+ );
141
+ //refresh the table
142
+ _this.blogTables.activityList = null;
143
+ _this.loadActivityTab();
144
+ }
145
+ });
146
+ };
147
+
148
+ /**
149
+ * Show Activation Log Information Dialog
150
+ *
151
+ * @returns {void}
152
+ *
153
+ * @access public
154
+ */
155
+ AAM.prototype.launchActivityLogInfo = function() {
156
+ var _this = this;
157
+
158
+ var buttons = {};
159
+
160
+ buttons[aamLocal.labels['Close']] = function() {
161
+ jQuery('#info_activity_dialog').dialog("close");
162
+ };
163
+
164
+ jQuery('#info_activity_dialog').dialog({
165
+ resizable: false,
166
+ height: 'auto',
167
+ width: '30%',
168
+ modal: true,
169
+ buttons: buttons,
170
+ close: function() {
171
+ _this.terminate(
172
+ jQuery('.activity-top-action-info'),
173
+ 'activity-top-action-info'
174
+ );
175
+ }
176
+ });
177
+ };
178
+
179
+ jQuery(document).ready(function() {
180
+ aamInterface.addAction('aam_feature_activation', function(params) {
181
+ if (params.feature === 'activity_log') {
182
+ aamInterface.loadActivityTab();
183
+ }
184
+ });
185
+ });
extension/AAM_Activity_Log/activity.php ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ *
12
+ * @package AAM
13
+ * @author Vasyl Martyniuk <support@wpaam.com>
14
+ * @copyright Copyright C 2013 Vasyl Martyniuk
15
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
16
+ */
17
+ class aam_Control_Object_Activity extends aam_Control_Object {
18
+
19
+ /**
20
+ * Control Object UID
21
+ */
22
+ const UID = 'activity';
23
+
24
+ /**
25
+ * Activity User Login
26
+ */
27
+ const ACTIVITY_LOGIN = 'login';
28
+
29
+ /**
30
+ * Activity User Logout
31
+ */
32
+ const ACTIVITY_LOGOUT = 'logout';
33
+
34
+ /**
35
+ * Set of Activities
36
+ *
37
+ * @var array
38
+ *
39
+ * @access private
40
+ */
41
+ private $_option = array();
42
+
43
+ /**
44
+ * Initialize the Activity list
45
+ *
46
+ * Based on subject type, load the list of activities
47
+ *
48
+ * @param int $object_id
49
+ *
50
+ * @return void
51
+ *
52
+ * @access public
53
+ */
54
+ public function init($object_id) {
55
+ if ($this->getSubject()->getUID() == aam_Control_Subject_User::UID) {
56
+ //get single user activity list
57
+ $option = array(
58
+ $this->getSubject()->getId() => $this->getSubject()->readOption(
59
+ self::UID, $object_id, false
60
+ ));
61
+ } else {
62
+ //get all users in Role and combine the activities
63
+ $query = new WP_User_Query(array(
64
+ 'number' => '',
65
+ 'blog_id' => get_current_blog_id(),
66
+ 'role' => $this->getSubject()->getId(),
67
+ 'fields' => 'id'
68
+ ));
69
+ $option = array();
70
+
71
+ foreach ($query->get_results() as $user) {
72
+ $dump = get_user_option('aam_activity', $user);
73
+ if (is_array($dump) && count($dump)) {
74
+ $option[$user] = $dump;
75
+ }
76
+ }
77
+ }
78
+
79
+ if (is_array($option)) {
80
+ $this->setOption($option);
81
+ //filter old activities
82
+ $this->filter();
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Decorate Activity description
88
+ *
89
+ * @param array $activity
90
+ *
91
+ * @return string
92
+ *
93
+ * @access public
94
+ */
95
+ public function decorate($activity) {
96
+ switch ($activity['action']) {
97
+ case self::ACTIVITY_LOGIN:
98
+ $response = __('System Login', 'aam');
99
+ break;
100
+
101
+ case self::ACTIVITY_LOGOUT:
102
+ $response = __('System Logout', 'aam');
103
+ break;
104
+
105
+ default:
106
+ $response = apply_filters(
107
+ 'aam_activity_decorator',
108
+ __('Unknown Activity', 'aam'),
109
+ $activity
110
+ );
111
+ break;
112
+ }
113
+
114
+ return $response;
115
+ }
116
+
117
+ /**
118
+ * Add User's Activity
119
+ *
120
+ * This method can be used only for Subject User
121
+ *
122
+ * @param int $timestamp
123
+ * @param array $activity
124
+ *
125
+ * @return void
126
+ *
127
+ * @access public
128
+ */
129
+ public function add($timestamp, array $activity) {
130
+ //make sure that user's activity is array
131
+ $user_id = $this->getSubject()->getId();
132
+ if (empty($this->_option[$user_id]) || !is_array($this->_option[$user_id])) {
133
+ $this->_option[$user_id] = array();
134
+ }
135
+ //add activity
136
+ $this->_option[$user_id][$timestamp] = $activity;
137
+
138
+ //finally save the activity
139
+ $this->save($this->_option[$user_id]);
140
+ }
141
+
142
+ /**
143
+ * Filter old activities
144
+ *
145
+ * Based on aam.extension.AAM_Activity_Log.date config, filter old activities
146
+ *
147
+ * @return void
148
+ *
149
+ * @access public
150
+ */
151
+ public function filter() {
152
+ $date = strtotime(
153
+ aam_Core_ConfigPress::getParam(
154
+ 'aam.extension.AAM_Activity_Log.date', 'today - 30 days'
155
+ )
156
+ );
157
+ foreach ($this->_option as $user_id => $activities) {
158
+ if (is_array($activities)) {
159
+ foreach ($activities as $timestamp => $activity) {
160
+ if ($timestamp < $date) {
161
+ unset($this->_option[$user_id][$timestamp]);
162
+ }
163
+ }
164
+ }
165
+ }
166
+ }
167
+
168
+ /**
169
+ * Save Activities
170
+ *
171
+ * @param array $events
172
+ *
173
+ * @return void
174
+ *
175
+ * @access public
176
+ */
177
+ public function save($activities = null) {
178
+ if (is_array($activities)) {
179
+ $this->getSubject()->updateOption($activities, self::UID);
180
+ }
181
+ }
182
+
183
+ /**
184
+ * @inheritdoc
185
+ */
186
+ public function cacheObject() {
187
+ return false;
188
+ }
189
+
190
+ /**
191
+ *
192
+ * @return type
193
+ */
194
+ public function backup() {
195
+ return array();
196
+ }
197
+
198
+ /**
199
+ *
200
+ * @return type
201
+ */
202
+ public function getUID() {
203
+ return self::UID;
204
+ }
205
+
206
+ /**
207
+ *
208
+ * @param type $option
209
+ */
210
+ public function setOption($option) {
211
+ $this->_option = (is_array($option) ? $option : array());
212
+ }
213
+
214
+ /**
215
+ *
216
+ * @return type
217
+ */
218
+ public function getOption() {
219
+ return $this->_option;
220
+ }
221
+
222
+ }
extension/AAM_Activity_Log/extension.php ADDED
@@ -0,0 +1,295 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ *
12
+ * @package AAM
13
+ * @author Vasyl Martyniuk <support@wpaam.com>
14
+ * @copyright Copyright C 2013 Vasyl Martyniuk
15
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
16
+ */
17
+ class AAM_Extension_ActivityLog {
18
+
19
+ /**
20
+ *
21
+ * @var type
22
+ */
23
+ private $_parent = null;
24
+
25
+ /**
26
+ *
27
+ * @var type
28
+ */
29
+ private $_subject = null;
30
+
31
+ /**
32
+ *
33
+ * @param aam|aam_View_Connector $parent
34
+ */
35
+ public function __construct(aam $parent) {
36
+ $this->setParent($parent);
37
+
38
+ //include activity object
39
+ require_once(__DIR__ . '/activity.php');
40
+
41
+ if (is_admin()) {
42
+ add_action('admin_print_scripts', array($this, 'printScripts'));
43
+ add_action('admin_print_styles', array($this, 'printStyles'));
44
+ add_filter('aam_ui_features', array($this, 'feature'), 10);
45
+ add_filter('aam_ajax_call', array($this, 'ajax'), 10, 2);
46
+ add_action('aam_localization_labels', array($this, 'localizationLabels'));
47
+ }
48
+
49
+ //define new Activity Object
50
+ add_filter('aam_object', array($this, 'activityObject'), 10, 3);
51
+
52
+ //login & logout hooks
53
+ add_action('wp_login', array($this, 'login'), 10, 2);
54
+ add_action('wp_logout', array($this, 'logout'));
55
+ }
56
+
57
+ /**
58
+ *
59
+ * @param type $username
60
+ * @param type $user
61
+ */
62
+ public function login($username, $user) {
63
+ $subject = new aam_Control_Subject_User($user->ID);
64
+ $subject->getObject(aam_Control_Object_Activity::UID)->add(
65
+ time(),
66
+ array(
67
+ 'action' => aam_Control_Object_Activity::ACTIVITY_LOGIN
68
+ )
69
+ );
70
+ }
71
+
72
+ /**
73
+ *
74
+ */
75
+ public function logout() {
76
+ $user = $this->getParent()->getUser();
77
+ $user->getObject(aam_Control_Object_Activity::UID)->add(
78
+ time(),
79
+ array(
80
+ 'action' => aam_Control_Object_Activity::ACTIVITY_LOGOUT
81
+ )
82
+ );
83
+ }
84
+
85
+ /**
86
+ *
87
+ * @param aam_Control_Object_Activity $object
88
+ * @param type $object_uid
89
+ * @param type $object_id
90
+ * @return \aam_Control_Object_Activity
91
+ */
92
+ public function activityObject($object, $object_uid, $object_id) {
93
+ if ($object_uid === aam_Control_Object_Activity::UID) {
94
+ $object = new aam_Control_Object_Activity(
95
+ $this->getParent()->getUser(), $object_id
96
+ );
97
+ }
98
+
99
+ return $object;
100
+ }
101
+
102
+ /**
103
+ *
104
+ * @param type $features
105
+ * @return string
106
+ */
107
+ public function feature($features) {
108
+ //add feature
109
+ $features['activity_log'] = array(
110
+ 'id' => 'activity_log',
111
+ 'position' => 35,
112
+ 'title' => __('Activity Log', 'aam'),
113
+ 'anonimus' => false,
114
+ 'content' => array($this, 'content'),
115
+ 'help' => __(
116
+ 'Tracks User Activities like user login/logout or post changes. '
117
+ . 'Check <b>AAM Activities</b> Extension to get advanced list of possible '
118
+ . 'activities.', 'aam'
119
+ )
120
+ );
121
+
122
+ return $features;
123
+ }
124
+
125
+ /**
126
+ *
127
+ * @return type
128
+ */
129
+ public function content() {
130
+ ob_start();
131
+ require dirname(__FILE__) . '/ui.phtml';
132
+ $content = ob_get_contents();
133
+ ob_end_clean();
134
+
135
+ return $content;
136
+ }
137
+
138
+ /**
139
+ * Print necessary scripts
140
+ *
141
+ * @return void
142
+ *
143
+ * @access public
144
+ */
145
+ public function printScripts() {
146
+ if ($this->getParent()->isAAMScreen()) {
147
+ wp_enqueue_script(
148
+ 'aam-activity-log-admin',
149
+ AAM_ACTIVITY_LOG_BASE_URL . '/activity.js',
150
+ array('aam-admin')
151
+ );
152
+ }
153
+ }
154
+
155
+ /**
156
+ *
157
+ */
158
+ public function printStyles() {
159
+ if ($this->getParent()->isAAMScreen()) {
160
+ wp_enqueue_style(
161
+ 'aam-activity-log-admin',
162
+ AAM_ACTIVITY_LOG_BASE_URL . '/activity.css'
163
+ );
164
+ }
165
+ }
166
+
167
+ /**
168
+ * Add extra UI labels
169
+ *
170
+ * @param array $labels
171
+ *
172
+ * @return array
173
+ *
174
+ * @access public
175
+ */
176
+ public function localizationLabels($labels) {
177
+ $labels['Clear Logs'] = __('Clear Logs', 'aam');
178
+ $labels['Get More'] = __('Get More', 'aam');
179
+
180
+ return $labels;
181
+ }
182
+
183
+ /**
184
+ * Hanlde Ajax call
185
+ *
186
+ * @param mixed $default
187
+ * @param aam_Control_Subject $subject
188
+ *
189
+ * @return mixed
190
+ *
191
+ * @access public
192
+ */
193
+ public function ajax($default, aam_Control_Subject $subject = null) {
194
+ $this->setSubject($subject);
195
+
196
+ switch (aam_Core_Request::request('sub_action')) {
197
+ case 'activity_list':
198
+ $response = $this->getActivityList();
199
+ break;
200
+
201
+ case 'clear_activities':
202
+ $response = $this->clearActivities();
203
+ break;
204
+
205
+ default:
206
+ $response = $default;
207
+ break;
208
+ }
209
+
210
+ return $response;
211
+ }
212
+
213
+ /**
214
+ *
215
+ * @return type
216
+ */
217
+ protected function getActivityList() {
218
+ $response = array(
219
+ 'iTotalRecords' => 0,
220
+ 'iTotalDisplayRecords' => 0,
221
+ 'sEcho' => aam_Core_Request::request('sEcho'),
222
+ 'aaData' => array(),
223
+ );
224
+
225
+ $activity = $this->getSubject()->getObject(aam_Control_Object_Activity::UID);
226
+ $activities = $activity->getOption();
227
+
228
+ foreach ($activities as $user_id => $list) {
229
+ $user = new WP_User($user_id);
230
+ if ($user->ID && is_array($list)) {
231
+ foreach ($list as $time => $data) {
232
+ $response['aaData'][] = array(
233
+ $user->ID,
234
+ ($user->display_name ? $user->display_name : $user->user_nicename),
235
+ $activity->decorate($data),
236
+ date('Y-m-d H:i:s', $time)
237
+ );
238
+ }
239
+ }
240
+ }
241
+
242
+ return json_encode($response);
243
+ }
244
+
245
+ /**
246
+ * Clear the activities
247
+ *
248
+ * @global wpdb $wpdb
249
+ *
250
+ * @return string
251
+ *
252
+ * @access public
253
+ */
254
+ protected function clearActivities() {
255
+ $activity = $this->getSubject()->getObject(aam_Control_Object_Activity::UID);
256
+ foreach ($activity->getOption() as $user_id => $list) {
257
+ delete_user_option($user_id, 'aam_activity');
258
+ }
259
+
260
+ return json_encode(array('status' => 'success'));
261
+ }
262
+
263
+ /**
264
+ *
265
+ * @param aam $parent
266
+ */
267
+ public function setParent(aam $parent) {
268
+ $this->_parent = $parent;
269
+ }
270
+
271
+ /**
272
+ *
273
+ * @return aam
274
+ */
275
+ public function getParent() {
276
+ return $this->_parent;
277
+ }
278
+
279
+ /**
280
+ *
281
+ * @param type $subject
282
+ */
283
+ public function setSubject($subject) {
284
+ $this->_subject = $subject;
285
+ }
286
+
287
+ /**
288
+ *
289
+ * @return type
290
+ */
291
+ public function getSubject() {
292
+ return $this->_subject;
293
+ }
294
+
295
+ }
extension/AAM_Activity_Log/images/info-active.png ADDED
Binary file
extension/AAM_Activity_Log/images/info.png ADDED
Binary file
extension/AAM_Activity_Log/images/trash-active.png ADDED
Binary file
extension/AAM_Activity_Log/images/trash.png ADDED
Binary file
extension/AAM_Activity_Log/index.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ======================================================================
4
+ * LICENSE: This file is subject to the terms and conditions defined in *
5
+ * file 'license.txt', which is part of this source code package. *
6
+ * ======================================================================
7
+ */
8
+
9
+ $dirname = basename(dirname(__FILE__));
10
+ define('AAM_ACTIVITY_LOG_BASE_URL', AAM_BASE_URL . 'extension/' . $dirname);
11
+
12
+ require_once dirname(__FILE__) . '/extension.php';
13
+
14
+ return new AAM_Extension_ActivityLog($this->getParent());
extension/AAM_Activity_Log/ui.phtml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ======================================================================
4
+ * LICENSE: This file is subject to the terms and conditions defined in *
5
+ * file 'license.txt', which is part of this source code package. *
6
+ * ======================================================================
7
+ */
8
+ ?>
9
+ <div class="feature-content-container" id="activity_log_content">
10
+ <table id="activity_list">
11
+ <thead>
12
+ <tr>
13
+ <th>User ID</th>
14
+ <th style="width:25%;"><?php echo __('Username', 'aam'); ?></th>
15
+ <th><?php echo __('Activity', 'aam'); ?></th>
16
+ <th style="width:30%;"><?php echo __('Time', 'aam'); ?></th>
17
+ </tr>
18
+ </thead>
19
+ <tbody></tbody>
20
+ </table>
21
+
22
+ <div id="clear_activity_dialog" class="aam-dialog" title="<?php echo __('Clear Activity Log', 'aam'); ?>">
23
+ <p class="dialog-content">
24
+ <?php echo __('Are you sure you want to clear activity log?', 'aam'); ?>
25
+ </p>
26
+ </div>
27
+ <div id="info_activity_dialog" class="aam-dialog" title="<?php echo __('Activity Log Info', 'aam'); ?>">
28
+ <p>
29
+ <?php echo sprintf(__('Basic version of Activity Log tracks only user\'s login and logout. Consider to purchase the <b>%s</b> Extension today to get access to advanced list of activities as well as we can develop additional activities on demand.', 'aam'), '<a href="http://wpaam.com/forum/viewtopic.php?f=7&t=91" target="_blank">AAM Activities</a>'); ?>
30
+ </p>
31
+ </div>
32
+ </div>
extension/AAM_Multisite_Support/multisite.js CHANGED
@@ -70,14 +70,14 @@ AAM.prototype.loadMultisiteSegment = function() {
70
  'href': aamMultisiteLocal.addSiteURI,
71
  'target': '_blank',
72
  'class': 'multisite-top-action multisite-top-action-add',
73
- 'tooltip': aamLocal.labels['Add New Site']
74
  });
75
  jQuery('#site_list_wrapper .multisite-top-actions').append(add);
76
 
77
  var refresh = jQuery('<a/>', {
78
  'href': '#',
79
  'class': 'multisite-top-action multisite-top-action-refresh',
80
- 'tooltip': aamLocal.labels['Refresh']
81
  }).bind('click', function(event) {
82
  event.preventDefault();
83
  _this.siteList.fnDraw();
@@ -127,7 +127,7 @@ AAM.prototype.loadMultisiteSegment = function() {
127
  jQuery('.multisite-actions', nRow).append(jQuery('<a/>', {
128
  'href': '#',
129
  'class': 'multisite-action multisite-action-manage' + (current ? '-active' : ''),
130
- 'tooltip': aamLocal.labels['Manage']
131
  }).bind('click', function(event) {
132
  event.preventDefault();
133
  //change title
@@ -140,7 +140,7 @@ AAM.prototype.loadMultisiteSegment = function() {
140
  jQuery('.multisite-actions', nRow).append(jQuery('<a/>', {
141
  'href': '#',
142
  'class': 'multisite-action multisite-action-pin' + (def_site ? '-active' : ''),
143
- 'tooltip': (def_site ? aamLocal.labels['Unset Default'] : aamLocal.labels['Set as Default'])
144
  }).bind('click', function(event) {
145
  event.preventDefault();
146
  var button = this;
@@ -205,7 +205,7 @@ AAM.prototype.loadMultisiteSegment = function() {
205
  'href': aamMultisiteLocal.editSiteURI + '?id=' + aData[0],
206
  'class': 'multisite-action multisite-action-edit',
207
  'target': '_blank',
208
- 'tooltip': aamLocal.labels['Edit']
209
  }));
210
 
211
  _this.initTooltip(nRow);
70
  'href': aamMultisiteLocal.addSiteURI,
71
  'target': '_blank',
72
  'class': 'multisite-top-action multisite-top-action-add',
73
+ 'aam-tooltip': aamLocal.labels['Add New Site']
74
  });
75
  jQuery('#site_list_wrapper .multisite-top-actions').append(add);
76
 
77
  var refresh = jQuery('<a/>', {
78
  'href': '#',
79
  'class': 'multisite-top-action multisite-top-action-refresh',
80
+ 'aam-tooltip': aamLocal.labels['Refresh']
81
  }).bind('click', function(event) {
82
  event.preventDefault();
83
  _this.siteList.fnDraw();
127
  jQuery('.multisite-actions', nRow).append(jQuery('<a/>', {
128
  'href': '#',
129
  'class': 'multisite-action multisite-action-manage' + (current ? '-active' : ''),
130
+ 'aam-tooltip': aamLocal.labels['Manage']
131
  }).bind('click', function(event) {
132
  event.preventDefault();
133
  //change title
140
  jQuery('.multisite-actions', nRow).append(jQuery('<a/>', {
141
  'href': '#',
142
  'class': 'multisite-action multisite-action-pin' + (def_site ? '-active' : ''),
143
+ 'aam-tooltip': (def_site ? aamLocal.labels['Unset Default'] : aamLocal.labels['Set as Default'])
144
  }).bind('click', function(event) {
145
  event.preventDefault();
146
  var button = this;
205
  'href': aamMultisiteLocal.editSiteURI + '?id=' + aData[0],
206
  'class': 'multisite-action multisite-action-edit',
207
  'target': '_blank',
208
+ 'aam-tooltip': aamLocal.labels['Edit']
209
  }));
210
 
211
  _this.initTooltip(nRow);
extension/AAM_My_Feature/extension.php CHANGED
@@ -46,7 +46,7 @@ class AAM_Extension_MyFeature {
46
  //add feature
47
  $features['my_feature'] = array(
48
  'id' => 'my_feature',
49
- 'position' => 35,
50
  'title' => __('My Feature', 'aam'),
51
  'anonimus' => true,
52
  'content' => array($this, 'content'),
46
  //add feature
47
  $features['my_feature'] = array(
48
  'id' => 'my_feature',
49
+ 'position' => 100,
50
  'title' => __('My Feature', 'aam'),
51
  'anonimus' => true,
52
  'content' => array($this, 'content'),
lang/aam-ru_RU.mo ADDED
Binary file
lang/aam-ru_RU.po ADDED
@@ -0,0 +1,334 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: AAM\n"
4
+ "POT-Creation-Date: 2013-12-01 14:07-0500\n"
5
+ "PO-Revision-Date: 2014-01-31 21:24+0400\n"
6
+ "Last-Translator: Maxim Kernozhitskiy <maxim@aeromultimedia.com>\n"
7
+ "Language-Team: WPAAM <support@wpaam.com>\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "Language: en_US\n"
12
+ "X-Generator: Poedit 1.5.7\n"
13
+
14
+ #: aam.php:243 aam.php:248 aam.php:267
15
+ msgid "Access denied"
16
+ msgstr "Доступ запрещен"
17
+
18
+ #: aam.php:691 aam.php:692
19
+ msgid "AAM"
20
+ msgstr "AAM"
21
+
22
+ #: aam.php:701 aam.php:702
23
+ msgid "Access Control"
24
+ msgstr "Контроль доступа"
25
+
26
+ #: aam.php:709 aam.php:710
27
+ msgid "Extensions"
28
+ msgstr "Расширение"
29
+
30
+ #: application/view/capability.php:98 application/view/capability.php:179
31
+ msgid "System"
32
+ msgstr "Система"
33
+
34
+ #: application/view/capability.php:99 application/view/capability.php:181
35
+ msgid "Post & Page"
36
+ msgstr "Пост и Страница"
37
+
38
+ #: application/view/capability.php:100 application/view/capability.php:183
39
+ msgid "Backend Interface"
40
+ msgstr "Интерфейс Админа"
41
+
42
+ #: application/view/capability.php:101
43
+ msgid "Miscellaneous"
44
+ msgstr "Разное"
45
+
46
+ #: application/view/capability.php:185
47
+ msgid "Miscelaneous"
48
+ msgstr "Разное"
49
+
50
+ #: application/view/manager.php:59
51
+ msgid "Roles"
52
+ msgstr "Роли"
53
+
54
+ #: application/view/manager.php:60
55
+ msgid "Role Manager"
56
+ msgstr "Менеджер ролей"
57
+
58
+ #: application/view/manager.php:68
59
+ msgid "Users"
60
+ msgstr "Пользователи"
61
+
62
+ #: application/view/manager.php:69
63
+ msgid "User Manager"
64
+ msgstr "Менеджер пользователей"
65
+
66
+ #: application/view/manager.php:77
67
+ msgid "Visitor"
68
+ msgstr "Посетители"
69
+
70
+ #: application/view/manager.php:78
71
+ msgid "Visitor Manager"
72
+ msgstr "Менеджер посетителей"
73
+
74
+ #: application/view/manager.php:95
75
+ msgid "Admin Menu"
76
+ msgstr "Меню Админа"
77
+
78
+ #: application/view/manager.php:98
79
+ msgid ""
80
+ "Control Access to Admin Menu. Restrict access to entire Menu or Submenu. "
81
+ "<b>Notice</b>, the menu is rendered based on Role's or User's capabilities."
82
+ msgstr ""
83
+ "Контроль доступа к меню Администратора. Запретить доступ ко всему меню или в "
84
+ "подменю. <b>Внимание</b>, меню отображается основываясь на Роли или доступе "
85
+ "пользователя."
86
+
87
+ #: application/view/manager.php:103
88
+ msgid "Metabox & Widget"
89
+ msgstr "Виджеты и Метабоксы"
90
+
91
+ #: application/view/manager.php:106
92
+ msgid ""
93
+ "Filter the list of Metaboxes or Widgets for selected Role or User. If "
94
+ "metabox or widget is not listed, try to click <b>Refresh the List</b> button "
95
+ "or Copy & Paste direct link to page where specific metabox or widget is "
96
+ "shown and hit <b>Retrieve Metaboxes from Link</b> button."
97
+ msgstr ""
98
+ "Фильтрует лист Виджетов или Метабоксов для выбранной Роли Пользователя. Если "
99
+ "метабокс или виджет не в списке попробуйте нажать кнопку <b>Обновить список</"
100
+ "b> или скопировать и вставить прямую ссылку на страницу, где показан "
101
+ "метабокс или виджет и нажать кнопку <b>Извлеч Метабоксы из ссылки</b>"
102
+
103
+ #: application/view/manager.php:111
104
+ msgid "Capability"
105
+ msgstr "Возможность"
106
+
107
+ #: application/view/manager.php:114
108
+ msgid ""
109
+ "Manage the list of Capabilities for selected User or Role. <b>Notice</b>, "
110
+ "list of user's capabilities are inherited from user's Role.<br/><b>Warning!</"
111
+ "b> Be very careful with capabilities. Deleting or unchecking any capability "
112
+ "may cause temporary or permanent constrol lost over some features or "
113
+ "WordPress dashboard."
114
+ msgstr ""
115
+ "Управляйте листом возможностей для выбранных Пользователя или Роли. "
116
+ "<b>Внимание</b>, лист пользовательских возможностей унаследован от Роли "
117
+ "пользователя.<br/> <b>ВНИМАНИЕ!</b> будьте осторожны с возможностями. "
118
+ "Удаление или снятие некоторых возможностей пользователя может привести к "
119
+ "временной, либо постоянной потере контроля над некоторыми функциями "
120
+ "Wordpress."
121
+
122
+ #: application/view/manager.php:119
123
+ msgid "Posts & Categories"
124
+ msgstr "Посты и Категории"
125
+
126
+ #: application/view/manager.php:122
127
+ msgid ""
128
+ "Manage access to individual <b>Post</b> or <b>Term</b>. Notice, under "
129
+ "<b>Post</b>, we assume any post, page or custom post type. And under "
130
+ "<b>Term</b> - any term like Post Categories."
131
+ msgstr ""
132
+ "Управляйте доступом к индивидуальным <b>Постам</b> или <b>Терминам</b>. "
133
+ "Понятие <b>Пост</b> в данном случае - любой пост, страница или Собственный "
134
+ "тип поста. А под <b>Термином</b> - любой термин типа Категории поста."
135
+
136
+ #: application/view/manager.php:127
137
+ msgid "Event Manager"
138
+ msgstr "Менеджер событий"
139
+
140
+ #: application/view/manager.php:130
141
+ msgid ""
142
+ "Define your own action when some event appeared in your WordPress blog. This "
143
+ "sections allows you to trigger an action on event like post content change, "
144
+ "or page status update. You can setup to send email notification, change the "
145
+ "post status or write your own custom event handler."
146
+ msgstr ""
147
+ "Укажите ваше собственное действие, когда происходит некоторое событие в "
148
+ "Wordpress. Эта секция позволяет вам отрабатывать действие или даже изменение "
149
+ "контента, или изменение статуса страницы. Вы можете отправлять уведомления "
150
+ "на email, менять статус поста или написать свой собственный обработчик."
151
+
152
+ #: application/view/manager.php:135
153
+ msgid "ConfigPress"
154
+ msgstr "ConfigPress"
155
+
156
+ #: application/view/manager.php:138
157
+ msgid ""
158
+ "Control <b>AAM</b> behavior with ConfigPress. For more details please check "
159
+ "<b>ConfigPress tutorial</b>."
160
+ msgstr ""
161
+ "Контролируйте поведение <b>AAM</b> с ConfigPress. Для подробностей "
162
+ "посмотрите <b>ConfigPress туториал</b>."
163
+
164
+ #: application/view/manager.php:342
165
+ msgid "Rollback Settings"
166
+ msgstr "Настройки Rollback"
167
+
168
+ #: application/view/manager.php:343
169
+ msgid "Cancel"
170
+ msgstr "Отменить"
171
+
172
+ #: application/view/manager.php:344
173
+ msgid "Send E-mail"
174
+ msgstr "Отправить E-mail"
175
+
176
+ #: application/view/manager.php:345 application/view/manager.php:351
177
+ msgid "Add New Role"
178
+ msgstr "Добавить Роль"
179
+
180
+ #: application/view/manager.php:346
181
+ msgid "Manage"
182
+ msgstr "Управление"
183
+
184
+ #: application/view/manager.php:347
185
+ msgid "Edit"
186
+ msgstr "Редактировать"
187
+
188
+ #: application/view/manager.php:348
189
+ msgid "Delete"
190
+ msgstr "Удалить"
191
+
192
+ #: application/view/manager.php:349
193
+ msgid "Filtered"
194
+ msgstr "Фильтровано"
195
+
196
+ #: application/view/manager.php:350
197
+ msgid "Clear"
198
+ msgstr "Отчистить"
199
+
200
+ #: application/view/manager.php:352
201
+ msgid "Save Changes"
202
+ msgstr "Сохранить изменения"
203
+
204
+ #: application/view/manager.php:353
205
+ #, php-format
206
+ msgid ""
207
+ "System detected %d user(s) with this role. All Users with Role <b>%s</b> "
208
+ "will be deleted automatically!"
209
+ msgstr ""
210
+ "Система определила %d пользователя(лей) с этой ролью. Все Пользователи с "
211
+ "Ролью <b>%s</b> будут удалены автоматически!"
212
+
213
+ #: application/view/manager.php:354
214
+ #, php-format
215
+ msgid "Are you sure that you want to delete role <b>%s</b>?"
216
+ msgstr "Вы уверены, что хотите удалить роль <b>%s</b>?"
217
+
218
+ #: application/view/manager.php:355
219
+ msgid "Delete Role"
220
+ msgstr "Удалить Роль"
221
+
222
+ #: application/view/manager.php:356
223
+ msgid "Add User"
224
+ msgstr "Добавить пользователя"
225
+
226
+ #: application/view/manager.php:357
227
+ msgid "Filter Users"
228
+ msgstr "Фильтр пользователей"
229
+
230
+ #: application/view/manager.php:358 application/view/manager.php:374
231
+ msgid "Refresh List"
232
+ msgstr "Обновить список"
233
+
234
+ #: application/view/manager.php:359
235
+ msgid "Block"
236
+ msgstr "Заблокировать"
237
+
238
+ #: application/view/manager.php:360
239
+ #, php-format
240
+ msgid "Are you sure you want to delete user <b>%s</b>?"
241
+ msgstr "Вы уверены, что хотите удалить пользователя <b>%s</b>?"
242
+
243
+ #: application/view/manager.php:361
244
+ msgid "Filter Capabilities by Category"
245
+ msgstr "Фильтр возможностей по категории"
246
+
247
+ #: application/view/manager.php:362
248
+ msgid "Inherit Capabilities"
249
+ msgstr "Назледовать возможности"
250
+
251
+ #: application/view/manager.php:363
252
+ msgid "Add New Capability"
253
+ msgstr "Добавить новую возможность"
254
+
255
+ #: application/view/manager.php:364
256
+ #, php-format
257
+ msgid "Are you sure that you want to delete capability <b>%s</b>?"
258
+ msgstr "Вы уверены, что хотите удалить возможность <b>%s</b>?"
259
+
260
+ #: application/view/manager.php:365
261
+ msgid "Delete Capability"
262
+ msgstr "Удалить возможность"
263
+
264
+ #: application/view/manager.php:366
265
+ msgid "Select Role"
266
+ msgstr "Выбрать роль"
267
+
268
+ #: application/view/manager.php:367
269
+ msgid "Add Capability"
270
+ msgstr "Добавить возможность"
271
+
272
+ #: application/view/manager.php:368
273
+ msgid "Add Event"
274
+ msgstr "Добавить событие"
275
+
276
+ #: application/view/manager.php:369
277
+ msgid "Edit Event"
278
+ msgstr "Редактировать событие"
279
+
280
+ #: application/view/manager.php:370 application/view/manager.php:372
281
+ msgid "Delete Event"
282
+ msgstr "Удалить событие"
283
+
284
+ #: application/view/manager.php:371
285
+ msgid "Save Event"
286
+ msgstr "Сохранить событие"
287
+
288
+ #: application/view/manager.php:373
289
+ msgid "Filter Posts by Post Type"
290
+ msgstr "Фильтр постов по Типу"
291
+
292
+ #: application/view/manager.php:375
293
+ msgid "Restore Default"
294
+ msgstr "Сбросить настройки"
295
+
296
+ #: application/view/manager.php:376
297
+ msgid "Apply"
298
+ msgstr "Применить"
299
+
300
+ #: application/view/manager.php:377
301
+ msgid "Edit Term"
302
+ msgstr "Редактировать Термин"
303
+
304
+ #: application/view/manager.php:378
305
+ msgid "Manager Access"
306
+ msgstr "Диспетчер доступу"
307
+
308
+ #: application/view/manager.php:379
309
+ msgid "Unlock Default Accesss Control"
310
+ msgstr "Разблокировать стандартный контроль доступа"
311
+
312
+ #: application/view/manager.php:380
313
+ msgid "Close"
314
+ msgstr "Закрыть"
315
+
316
+ #: application/view/manager.php:381
317
+ msgid "Edit Role"
318
+ msgstr "Редактировать роль"
319
+
320
+ #: application/view/metabox.php:179
321
+ msgid "Dashboard Widgets"
322
+ msgstr "Панель виджетов"
323
+
324
+ #: application/view/metabox.php:183
325
+ msgid "Frontend Widgets"
326
+ msgstr "Frontend виджеты"
327
+
328
+ #: application/view/post.php:181
329
+ msgid "[empty]"
330
+ msgstr "[пусто]"
331
+
332
+ #: application/view/post.php:345 application/view/post.php:353
333
+ msgid "All"
334
+ msgstr "Все"
media/css/aam.css CHANGED
@@ -532,6 +532,14 @@
532
  background-image: url('images/cmanager/block-user-active.png');
533
  }
534
 
 
 
 
 
 
 
 
 
535
  .user-action-delete{
536
  background-image: url('images/cmanager/delete.png');
537
  }
@@ -1044,7 +1052,6 @@ a.capability-action{
1044
  width: 16px;
1045
  height: 16px;
1046
  display: table-cell;
1047
- cursor: pointer;
1048
  padding: 2px 0;
1049
  background-repeat: no-repeat;
1050
  background-position: center;
@@ -1075,6 +1082,39 @@ a.capability-action{
1075
  background-image: url('images/post/edit-active.png');
1076
  }
1077
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1078
  .post-action-lock{
1079
  background-image: url('images/lock.png');
1080
  }
@@ -1383,29 +1423,20 @@ a.aam-lock-big{
1383
  display:none;
1384
  }
1385
 
1386
- /** CONFIGPRESS STYLES **/
1387
- .configpress-top-actions{
1388
- padding: 2px 0;
1389
  width: 100%;
1390
- margin-bottom: 2px;
1391
- text-align: right;
1392
- position: relative;
1393
- }
1394
-
1395
- .configpress-top-action-item{
1396
- width:24px;
1397
- height: 24px;
1398
- display: inline-block;
1399
- background-repeat: no-repeat;
1400
- background-position: center;
1401
- text-indent: -9999px;
1402
- text-decoration: none;
1403
- }
1404
-
1405
- .configpress-top-action-tutorial{
1406
- background-image: url('images/configpress/pdf.png');
1407
  }
1408
 
1409
- .configpress-top-action-tutorial:hover{
1410
- background-image: url('images/configpress/pdf-active.png');
 
 
 
1411
  }
532
  background-image: url('images/cmanager/block-user-active.png');
533
  }
534
 
535
+ .user-action-restore{
536
+ background-image: url('images/cmanager/restore.png');
537
+ }
538
+
539
+ .user-action-restore:hover{
540
+ background-image: url('images/cmanager/restore-active.png');
541
+ }
542
+
543
  .user-action-delete{
544
  background-image: url('images/cmanager/delete.png');
545
  }
1052
  width: 16px;
1053
  height: 16px;
1054
  display: table-cell;
 
1055
  padding: 2px 0;
1056
  background-repeat: no-repeat;
1057
  background-position: center;
1082
  background-image: url('images/post/edit-active.png');
1083
  }
1084
 
1085
+ .post-action-restore{
1086
+ background-image: url('images/post/restore.png');
1087
+ }
1088
+
1089
+ .post-action-restore:hover{
1090
+ background-image: url('images/post/restore-active.png');
1091
+ }
1092
+
1093
+ .post-action-delete{
1094
+ background-image: url('images/post/delete.png');
1095
+ }
1096
+
1097
+ .post-action-delete:hover{
1098
+ background-image: url('images/post/delete-active.png');
1099
+ }
1100
+
1101
+ .post-action-delete-active{
1102
+ background-image: url('images/post/delete-active.png');
1103
+ }
1104
+
1105
+ .post-action-trash{
1106
+ background-image: url('images/post/trash.png');
1107
+ }
1108
+
1109
+ .post-action-trash:hover{
1110
+ background-image: url('images/post/trash-active.png');
1111
+ }
1112
+
1113
+ .post-action-trash-active{
1114
+ background-image: url('images/post/trash-active.png');
1115
+ }
1116
+
1117
+
1118
  .post-action-lock{
1119
  background-image: url('images/lock.png');
1120
  }
1423
  display:none;
1424
  }
1425
 
1426
+ .aam-warning{
 
 
1427
  width: 100%;
1428
+ height: 40px;
1429
+ display: table-row;
1430
+ background: transparent url('images/warning.png') no-repeat 2px center;
1431
+ -moz-box-sizing: border-box;
1432
+ -webkit-box-sizing: border-box;
1433
+ box-sizing: border-box;
1434
+ margin-top: 1px;
 
 
 
 
 
 
 
 
 
 
1435
  }
1436
 
1437
+ .aam-warning span{
1438
+ display: table-cell;
1439
+ vertical-align: middle;
1440
+ padding-left: 30px;
1441
+ font-size: 0.9em;
1442
  }
media/css/codemirror.css CHANGED
@@ -106,9 +106,11 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
106
  line-height: 1;
107
  position: relative;
108
  overflow: hidden;
109
- background: white;
110
  color: black;
111
- border-top: 1px solid #BBBBBB;
 
 
112
  }
113
 
114
  .CodeMirror-scroll {
106
  line-height: 1;
107
  position: relative;
108
  overflow: hidden;
109
+ background: #FFFFFF;
110
  color: black;
111
+ border: 1px solid #CCCCCC;
112
+ border-radius: 4px;
113
+ padding: 1px;
114
  }
115
 
116
  .CodeMirror-scroll {
media/css/configpress.css ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cpanel-major{
2
+ display: table;
3
+ width: 100%;
4
+ margin-bottom: 5px;
5
+ padding-bottom: 5px;
6
+ border-bottom: 1px solid #CCCCCC;
7
+ }
8
+
9
+ .cpanel-major .cpanel-item{
10
+ height: 64px;
11
+ width: 50%;
12
+ display: table-cell;
13
+ text-align: center;
14
+ vertical-align: bottom;
15
+ text-decoration: none;
16
+ text-transform: uppercase;
17
+ font-size: 10px;
18
+ font-weight: bold;
19
+ color: #333333;
20
+ background-repeat: no-repeat;
21
+ background-position: center top;
22
+ }
23
+
24
+ .cpanel-minor{
25
+ display: table;
26
+ width: 100%;
27
+ margin-top: 10px;
28
+ }
29
+
30
+ .cpanel-minor .cpanel-item{
31
+ height: 40px;
32
+ width: 25%;
33
+ display: table-cell;
34
+ text-align: center;
35
+ vertical-align: bottom;
36
+ text-decoration: none;
37
+ text-transform: uppercase;
38
+ font-size: 9px;
39
+ font-weight: bold;
40
+ color: #333333;
41
+ background-repeat: no-repeat;
42
+ background-position: center top;
43
+ }
44
+
45
+ .cpanel-item-tutorial{
46
+ background-image: url('images/configpress/pdf.png');
47
+ }
48
+
49
+ .cpanel-item-tutorial:hover{
50
+ background-image: url('images/configpress/pdf-active.png');
51
+ }
52
+
53
+ .cpanel-item-save{
54
+ background-image: url('images/cpanel/save.png');
55
+ }
56
+
57
+ .cpanel-item-save:hover{
58
+ background-image: url('images/cpanel/save-active.png');
59
+ }
60
+
61
+ .cpanel-item-help{
62
+ background-image: url('images/cpanel/help-forum.png');
63
+ }
64
+
65
+ .cpanel-item-help:hover{
66
+ background-image: url('images/cpanel/help-forum-active.png');
67
+ }
68
+
69
+ .cpanel-item-twitter{
70
+ background-image: url('images/cpanel/twitter.png');
71
+ }
72
+
73
+ .cpanel-item-twitter:hover{
74
+ background-image: url('images/cpanel/twitter-active.png');
75
+ }
76
+
77
+ .cpanel-item-message{
78
+ background-image: url('images/cpanel/message.png');
79
+ }
80
+
81
+ .cpanel-item-message:hover{
82
+ background-image: url('images/cpanel/message-active.png');
83
+ }
84
+
85
+ .cpanel-item-star{
86
+ background-image: url('images/cpanel/star.png');
87
+ }
88
+
89
+ .cpanel-item-star:hover{
90
+ background-image: url('images/cpanel/star-active.png');
91
+ }
92
+
93
+ #major-publishing-actions{
94
+ margin-top: 5px;
95
+ border-top: 1px solid #D5D5D5;
96
+ }
97
+
98
+ .aam-warning{
99
+ width: 100%;
100
+ height: 40px;
101
+ display: table-row;
102
+ background: transparent url('images/warning.png') no-repeat 2px center;
103
+ -moz-box-sizing: border-box;
104
+ -webkit-box-sizing: border-box;
105
+ box-sizing: border-box;
106
+ margin-top: 1px;
107
+ }
108
+
109
+ .aam-warning span{
110
+ display: table-cell;
111
+ vertical-align: middle;
112
+ padding-left: 30px;
113
+ font-size: 0.9em;
114
+ }
media/css/extension.css CHANGED
@@ -190,4 +190,22 @@ input.license-input{
190
  top: 0;
191
  left: 0;
192
  opacity: 0.8;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  }
190
  top: 0;
191
  left: 0;
192
  opacity: 0.8;
193
+ }
194
+
195
+ .aam-warning{
196
+ width: 100%;
197
+ height: 40px;
198
+ display: table-row;
199
+ background: transparent url('images/warning.png') no-repeat 2px center;
200
+ -moz-box-sizing: border-box;
201
+ -webkit-box-sizing: border-box;
202
+ box-sizing: border-box;
203
+ margin-top: 1px;
204
+ }
205
+
206
+ .aam-warning span{
207
+ display: table-cell;
208
+ vertical-align: middle;
209
+ padding-left: 30px;
210
+ font-size: 0.9em;
211
  }
media/css/images/cmanager/restore-active.png ADDED
Binary file
media/css/images/cmanager/restore.png ADDED
Binary file
media/css/images/configpress/pdf-active.png CHANGED
Binary file
media/css/images/configpress/pdf.png CHANGED
Binary file
media/css/images/post/delete-active.png ADDED
Binary file
media/css/images/post/delete.png ADDED
Binary file
media/css/images/post/restore-active.png ADDED
Binary file
media/css/images/post/restore.png ADDED
Binary file
media/css/images/post/trash-active.png ADDED
Binary file
media/css/images/post/trash.png ADDED
Binary file
media/css/images/warning.png ADDED
Binary file
media/css/jquery.dt.css CHANGED
@@ -66,7 +66,7 @@ table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; }
66
 
67
  .dataTables_filter input{
68
  width: 90%;
69
- height: 24px;
70
  padding-left: 24px;
71
  background: transparent url('images/search.png') no-repeat 5px center;
72
  }
66
 
67
  .dataTables_filter input{
68
  width: 90%;
69
+ height: 28px;
70
  padding-left: 24px;
71
  background: transparent url('images/search.png') no-repeat 5px center;
72
  }
media/css/migrate.css DELETED
@@ -1,67 +0,0 @@
1
- .migration-dialog{
2
- position: fixed;
3
- width: 30%;
4
- top: 25%;
5
- left: 50%;
6
- margin-left: -12.5%;
7
- border: 2px solid #CCCCCC;
8
- background-color: #F5F5F5;
9
- opacity: 0.9;
10
- }
11
-
12
- .migration-header{
13
- height: 20px;
14
- width: 100%;
15
- background-color: #0074a2;
16
- color: #FFFFFF;
17
- font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
18
- padding-left: 10px;
19
- font-size: 12px;
20
- padding-top: 4px;
21
- box-sizing: border-box;
22
- -moz-box-sizing: border-box;
23
- -webkit-box-sizing: border-box;
24
- }
25
-
26
- .migration-notice{
27
- margin: 5px 10px;
28
- border: 1px solid #FF6666;
29
- text-align: center;
30
- font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
31
- font-size: 12px;
32
- font-weight: bold;
33
- }
34
-
35
- .migration-steps{
36
- margin: 5px 10px;
37
- }
38
-
39
- .migration-step{
40
- border: 1px solid #CCCCCC;
41
- margin-top: 2px;
42
- background-color: #EAEBFF;
43
- height: 28px;
44
- font-family: "Trebuchet MS", Helvetica, sans-serif;
45
- box-sizing: border-box;
46
- -moz-box-sizing: border-box;
47
- -webkit-box-sizing: border-box;
48
- font-size: 14px;
49
- padding: 3px 0 3px 34px;
50
- opacity: 0.3;
51
- }
52
-
53
- .migration-step-pending{
54
- background: #EAEBFF url('migrate/pending.png') no-repeat 5px center;
55
- }
56
-
57
- .migration-step-running{
58
- background: #EAEBFF url('migrate/wait.png') no-repeat 5px center;
59
- }
60
-
61
- .migration-step-completed{
62
- background: #EAEBFF url('migrate/completed.png') no-repeat 5px center;
63
- }
64
-
65
- .migration-step-failed{
66
- background: #EAEBFF url('migrate/failure.png') no-repeat 5px center;
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
media/css/migrate/completed.png DELETED
Binary file
media/css/migrate/failure.png DELETED
Binary file
media/css/migrate/pending.png DELETED
Binary file
media/css/migrate/wait.png DELETED
Binary file
media/js/aam.js CHANGED
@@ -176,16 +176,16 @@ AAM.prototype.initUI = function() {
176
  * @access public
177
  */
178
  AAM.prototype.initTooltip = function(selector) {
179
- jQuery('[tooltip]', selector).hover(function() {
180
  // Hover over code
181
- var title = jQuery(this).attr('tooltip');
182
- jQuery(this).data('tipText', title).removeAttr('tooltip');
183
  jQuery('<div/>', {
184
  'class': 'aam-tooltip'
185
  }).text(title).appendTo('body').fadeIn('slow');
186
  }, function() {
187
  //Hover out code
188
- jQuery(this).attr('tooltip', jQuery(this).data('tipText'));
189
  jQuery('.aam-tooltip').remove();
190
  }).mousemove(function(e) {
191
  jQuery('.aam-tooltip').css({
@@ -329,9 +329,6 @@ AAM.prototype.initControlPanel = function() {
329
  }
330
  }
331
 
332
- //5. Collect ConfigPress
333
- data['aam[configpress]'] = _this.editor.getValue();
334
-
335
  //send the Ajax request to save the data
336
  jQuery.ajax(aamLocal.ajaxurl, {
337
  type: 'POST',
@@ -482,7 +479,7 @@ AAM.prototype.loadRoleSegment = function() {
482
  var add = jQuery('<a/>', {
483
  'href': '#',
484
  'class': 'role-top-action role-top-action-add',
485
- 'tooltip': aamLocal.labels['Add New Role']
486
  }).bind('click', function(event) {
487
  event.preventDefault();
488
  _this.launch(jQuery(this), 'role-top-action-add');
@@ -524,7 +521,7 @@ AAM.prototype.loadRoleSegment = function() {
524
  jQuery('.role-actions', nRow).append(jQuery('<a/>', {
525
  'href': '#',
526
  'class': 'role-action role-action-manage',
527
- 'tooltip': aamLocal.labels['Manage']
528
  }).bind('click', {
529
  role: aData[0]
530
  }, function(event) {
@@ -541,7 +538,7 @@ AAM.prototype.loadRoleSegment = function() {
541
  jQuery('.role-actions', nRow).append(jQuery('<a/>', {
542
  'href': '#',
543
  'class': 'role-action role-action-edit',
544
- 'tooltip': aamLocal.labels['Edit']
545
  }).bind('click', function(event) {
546
  event.preventDefault();
547
  _this.launch(jQuery(this), 'role-action-edit');
@@ -551,7 +548,7 @@ AAM.prototype.loadRoleSegment = function() {
551
  jQuery('.role-actions', nRow).append(jQuery('<a/>', {
552
  'href': '#',
553
  'class': 'role-action role-action-delete',
554
- 'tooltip': aamLocal.labels['Delete']
555
  }).bind('click', function(event) {
556
  event.preventDefault();
557
  if ((aData[0] === 'administrator')) {
@@ -762,7 +759,7 @@ AAM.prototype.launchDeleteRoleDialog = function(button, aData) {
762
  if (aData[1]) {
763
  var message = aamLocal.labels['Delete Role with Users Message'].replace(
764
  '%d', aData[1]
765
- );
766
  message = message.replace('%s', aData[2]);
767
  jQuery('#delete_role_dialog .dialog-content').html(message);
768
  } else {
@@ -874,13 +871,13 @@ AAM.prototype.loadUserSegment = function() {
874
  'href': aamLocal.addUserURI,
875
  'target': '_blank',
876
  'class': 'user-top-action user-top-action-add',
877
- 'tooltip': aamLocal.labels['Add User']
878
  });
879
 
880
  var filter = jQuery('<a/>', {
881
  'href': '#',
882
  'class': 'user-top-action user-top-action-filter',
883
- 'tooltip': aamLocal.labels['Filter Users']
884
  }).bind('click', function(event) {
885
  event.preventDefault();
886
  _this.launch(jQuery(this), 'user-top-action-filter');
@@ -890,7 +887,7 @@ AAM.prototype.loadUserSegment = function() {
890
  var refresh = jQuery('<a/>', {
891
  'href': '#',
892
  'class': 'user-top-action user-top-action-refresh',
893
- 'tooltip': aamLocal.labels['Refresh List']
894
  }).bind('click', function(event) {
895
  event.preventDefault();
896
  _this.segmentTables.userList.fnDraw();
@@ -928,7 +925,7 @@ AAM.prototype.loadUserSegment = function() {
928
  jQuery('.user-actions', nRow).append(jQuery('<a/>', {
929
  'href': '#',
930
  'class': 'user-action user-action-manage',
931
- 'tooltip': aamLocal.labels['Manager']
932
  }).bind('click', function(event) {
933
  event.preventDefault();
934
  _this.setSubject('user', aData[0]);
@@ -940,23 +937,31 @@ AAM.prototype.loadUserSegment = function() {
940
  'href': aamLocal.editUserURI + '?user_id=' + aData[0],
941
  'target': '_blank',
942
  'class': 'user-action user-action-edit',
943
- 'tooltip': aamLocal.labels['Edit']
944
  }));
945
 
946
  var status = (aData[4] === '1' ? 'user-action-block-active' : 'user-action-block');
947
  jQuery('.user-actions', nRow).append(jQuery('<a/>', {
948
  'href': '#',
949
  'class': 'user-action ' + status,
950
- 'tooltip': aamLocal.labels['Block']
951
  }).bind('click', function(event) {
952
  event.preventDefault();
953
  _this.blockUser(this, aData);
954
  }));
955
-
 
 
 
 
 
 
 
 
956
  jQuery('.user-actions', nRow).append(jQuery('<a/>', {
957
  'href': '#',
958
  'class': 'user-action user-action-delete',
959
- 'tooltip': aamLocal.labels['Delete']
960
  }).bind('click', function(event) {
961
  event.preventDefault();
962
  _this.launch(jQuery(this), 'user-action-delete');
@@ -1144,7 +1149,7 @@ AAM.prototype.launchFilterUserDialog = function(button) {
1144
  jQuery('.user-actions', nRow).append(jQuery('<a/>', {
1145
  'href': '#',
1146
  'class': 'user-action user-action-select',
1147
- 'tooltip': 'Select Role'
1148
  }).bind('click', function(event) {
1149
  event.preventDefault();
1150
  _this.userRoleFilter = aData[0];
@@ -1203,6 +1208,11 @@ AAM.prototype.retrieveSettings = function() {
1203
  jQuery('.aam-main-loader').show();
1204
  jQuery('.aam-main-content').empty();
1205
 
 
 
 
 
 
1206
  jQuery.ajax(aamLocal.siteURI, {
1207
  type: 'POST',
1208
  dataType: 'html',
@@ -1256,15 +1266,23 @@ AAM.prototype.checkRoleback = function() {
1256
  * @access public
1257
  */
1258
  AAM.prototype.initSettings = function() {
 
 
1259
  //remove all dialogs to make sure that there are no confusions
1260
  jQuery('.ui-dialog').remove();
1261
 
1262
  //init Settings Menu
1263
  jQuery('.feature-list .feature-item').each(function() {
1264
  jQuery(this).bind('click', function() {
 
 
 
 
 
 
1265
  jQuery('.feature-list .feature-item').removeClass(
1266
  'feature-item-active'
1267
- );
1268
  jQuery(this).addClass('feature-item-active');
1269
  jQuery('.feature-content .feature-content-container').hide();
1270
  jQuery('#' + jQuery(this).attr('feature') + '_content').show();
@@ -1272,7 +1290,7 @@ AAM.prototype.initSettings = function() {
1272
  jQuery('.aam-help > span').hide();
1273
  jQuery('#feature_help_' + jQuery(this).attr('feature')).css(
1274
  'display', 'table-cell'
1275
- );
1276
  });
1277
  });
1278
 
@@ -1281,25 +1299,12 @@ AAM.prototype.initSettings = function() {
1281
  this.initCapabilityTab();
1282
  this.initPostTab();
1283
  this.initEventTab();
1284
- this.initConfigPressTab();
1285
 
1286
  this.doAction('aam_init_features');
1287
 
1288
  jQuery('.feature-list .feature-item:eq(0)').trigger('click');
1289
  };
1290
 
1291
- /**
1292
- * Initialize ConfigPress Feature
1293
- *
1294
- * @returns {void}
1295
- *
1296
- * @access public
1297
- */
1298
- AAM.prototype.initConfigPressTab = function() {
1299
- this.editor = CodeMirror.fromTextArea(document.getElementById("configpress"), {});
1300
- this.initTooltip('#configpress_content');
1301
- };
1302
-
1303
  /**
1304
  * Initialize Capability Feature
1305
  *
@@ -1366,7 +1371,7 @@ AAM.prototype.initCapabilityTab = function() {
1366
  var filter = jQuery('<a/>', {
1367
  'href': '#',
1368
  'class': 'capability-top-action capability-top-action-filter',
1369
- 'tooltip': aamLocal.labels['Filter Capabilities by Category']
1370
  }).bind('click', function(event) {
1371
  event.preventDefault();
1372
  _this.launch(jQuery(this), 'capability-top-action-filter');
@@ -1380,7 +1385,7 @@ AAM.prototype.initCapabilityTab = function() {
1380
  var copy = jQuery('<a/>', {
1381
  'href': '#',
1382
  'class': 'capability-top-action capability-top-action-copy',
1383
- 'tooltip': aamLocal.labels['Inherit Capabilities']
1384
  }).bind('click', function(event) {
1385
  event.preventDefault();
1386
  _this.launch(jQuery(this), 'capability-top-action-copy');
@@ -1390,7 +1395,7 @@ AAM.prototype.initCapabilityTab = function() {
1390
  var add = jQuery('<a/>', {
1391
  'href': '#',
1392
  'class': 'capability-top-action capability-top-action-add',
1393
- 'tooltip': aamLocal.labels['Add New Capability']
1394
  }).bind('click', function(event) {
1395
  event.preventDefault();
1396
  _this.launch(jQuery(this), 'capability-top-action-add');
@@ -1404,7 +1409,7 @@ AAM.prototype.initCapabilityTab = function() {
1404
  var restore = jQuery('<a/>', {
1405
  'href': '#',
1406
  'class': 'capability-top-action capability-top-action-restore',
1407
- 'tooltip': aamLocal.labels['Restore Default Capabilities']
1408
  }).bind('click', function(event) {
1409
  event.preventDefault();
1410
  var data = _this.compileAjaxPackage('restore_capability', true);
@@ -1463,7 +1468,7 @@ AAM.prototype.initCapabilityTab = function() {
1463
  jQuery(actions).append(jQuery('<a/>', {
1464
  'href': '#',
1465
  'class': 'capability-action capability-action-delete',
1466
- 'tooltip': aamLocal.labels['Delete']
1467
  }).bind('click', function(event) {
1468
  event.preventDefault();
1469
  _this.launch(jQuery(this), 'capability-action-delete');
@@ -2023,7 +2028,7 @@ AAM.prototype.initEventTab = function() {
2023
  var filter = jQuery('<a/>', {
2024
  'href': '#',
2025
  'class': 'event-top-action event-top-action-add',
2026
- 'tooltip': aamLocal.labels['Add Event']
2027
  }).bind('click', function(event) {
2028
  event.preventDefault();
2029
  _this.launch(jQuery(this), 'event-top-action-add');
@@ -2050,7 +2055,7 @@ AAM.prototype.initEventTab = function() {
2050
  jQuery('.event-actions', nRow).append(jQuery('<a/>', {
2051
  'href': '#',
2052
  'class': 'event-action event-action-edit',
2053
- 'tooltip': aamLocal.labels['Edit Event']
2054
  }).bind('click', function(event) {
2055
  event.preventDefault();
2056
  _this.launch(jQuery(this), 'event-action-edit');
@@ -2059,7 +2064,7 @@ AAM.prototype.initEventTab = function() {
2059
  jQuery('.event-actions', nRow).append(jQuery('<a/>', {
2060
  'href': '#',
2061
  'class': 'event-action event-action-delete',
2062
- 'tooltip': aamLocal.labels['Delete Event']
2063
  }).bind('click', function(event) {
2064
  event.preventDefault();
2065
  _this.launch(jQuery(this), 'event-action-delete');
@@ -2263,6 +2268,14 @@ AAM.prototype.initPostTab = function() {
2263
  name: '_ajax_nonce',
2264
  value: aamLocal.nonce
2265
  });
 
 
 
 
 
 
 
 
2266
  aoData.push({
2267
  name: 'term',
2268
  value: _this.postTerm
@@ -2274,7 +2287,7 @@ AAM.prototype.initPostTab = function() {
2274
  var filter = jQuery('<a/>', {
2275
  'href': '#',
2276
  'class': 'post-top-action post-top-action-filter',
2277
- 'tooltip': aamLocal.labels['Filter Posts by Post Type']
2278
  }).bind('click', function(event) {
2279
  event.preventDefault();
2280
  _this.launch(jQuery(this), 'post-top-action-filter');
@@ -2284,7 +2297,7 @@ AAM.prototype.initPostTab = function() {
2284
  var refresh = jQuery('<a/>', {
2285
  'href': '#',
2286
  'class': 'post-top-action post-top-action-refresh',
2287
- 'tooltip': aamLocal.labels['Refresh List']
2288
  }).bind('click', function(event) {
2289
  event.preventDefault();
2290
  _this.blogTables.postList.fnDraw();
@@ -2306,7 +2319,7 @@ AAM.prototype.initPostTab = function() {
2306
  aoColumnDefs: [
2307
  {
2308
  bVisible: false,
2309
- aTargets: [0, 1, 2]
2310
  }
2311
  ],
2312
  fnRowCallback: function(nRow, aData, iDisplayIndex) { //format data
@@ -2319,27 +2332,63 @@ AAM.prototype.initPostTab = function() {
2319
  _this.launch(button, 'post-action-manage');
2320
  _this.launchManageAccessDialog(button, nRow, aData, 'post');
2321
  }).text(aData[3]));
 
2322
  jQuery('td:eq(2)', nRow).append(jQuery('<div/>', {
2323
  'class': 'post-actions'
2324
  }));
2325
 
2326
- jQuery('.post-actions', nRow).append(jQuery('<a/>', {
2327
- 'href': aData[2].replace('&amp;', '&'),
2328
- 'class': 'post-action post-action-edit',
2329
- 'target': '_blank',
2330
- 'tooltip': aamLocal.labels['Edit']
2331
- }));
2332
-
2333
  jQuery('.post-actions', nRow).append(jQuery('<a/>', {
2334
  'href': '#',
2335
  'class': 'post-action post-action-manage',
2336
- 'tooltip': aamLocal.labels['Manage Access']
2337
  }).bind('click', function(event) {
2338
  event.preventDefault();
2339
  _this.launch(jQuery(this), 'post-action-manage');
2340
  _this.launchManageAccessDialog(this, nRow, aData, 'post');
2341
  }));
2342
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2343
  _this.initTooltip(nRow);
2344
  },
2345
  fnDrawCallback: function() {
@@ -2456,26 +2505,11 @@ AAM.prototype.launchManageAccessDialog = function(button, nRow, aData, type) {
2456
 
2457
  var buttons = {};
2458
  buttons[aamLocal.labels['Restore Default']] = function() {
2459
- //retrieve settings and display the dialog
2460
- var data = _this.compileAjaxPackage('clear_access', true);
2461
- data.id = aData[0];
2462
- data.type = type;
2463
-
2464
- jQuery.ajax(aamLocal.ajaxurl, {
2465
- type: 'POST',
2466
- dataType: 'json',
2467
- data: data,
2468
- success: function(response) {
2469
- _this.highlight(nRow, response.status);
2470
- },
2471
- error: function() {
2472
- _this.highlight(nRow, 'failure');
2473
- }
2474
- });
2475
  jQuery('#access_dialog').dialog("close");
2476
  };
2477
 
2478
- if (response.counter <= 5) {
2479
  buttons[aamLocal.labels['Apply']] = function() {
2480
  _this.showMetaboxLoader('#access_dialog');
2481
  var data = _this.compileAjaxPackage('save_access', true);
@@ -2536,6 +2570,114 @@ AAM.prototype.launchManageAccessDialog = function(button, nRow, aData, type) {
2536
  });
2537
  };
2538
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2539
  /**
2540
  * Build Post Breadcrumb
2541
  *
@@ -2580,12 +2722,12 @@ AAM.prototype.buildPostBreadcrumb = function(response) {
2580
  'href': response.link,
2581
  'target': '_blank',
2582
  'class': 'post-breadcrumb-line-action post-breadcrumb-line-action-edit',
2583
- 'tooltip': aamLocal.labels['Edit Term']
2584
  }));
2585
  jQuery('.post-breadcrumb-line-actions').append(jQuery('<a/>', {
2586
  'href': '#',
2587
  'class': 'post-breadcrumb-line-action post-breadcrumb-line-action-manage',
2588
- 'tooltip': aamLocal.labels['Manager Access']
2589
  }).bind('click', {id: response.breadcrumb[i][0]}, function(event) {
2590
  event.preventDefault();
2591
  _this.launch(this, 'post-breadcrumb-line-action-manage');
@@ -2600,7 +2742,7 @@ AAM.prototype.buildPostBreadcrumb = function(response) {
2600
  'href': 'http://wpaam.com',
2601
  'target': '_blank',
2602
  'class': 'post-breadcrumb-line-action post-breadcrumb-line-action-lock',
2603
- 'tooltip': aamLocal.labels['Unlock Default Accesss Control']
2604
  }));
2605
  this.doAction('aam_breadcrumb_action', response);
2606
  }
176
  * @access public
177
  */
178
  AAM.prototype.initTooltip = function(selector) {
179
+ jQuery('[aam-tooltip]', selector).hover(function() {
180
  // Hover over code
181
+ var title = jQuery(this).attr('aam-tooltip');
182
+ jQuery(this).data('tipText', title).removeAttr('aam-tooltip');
183
  jQuery('<div/>', {
184
  'class': 'aam-tooltip'
185
  }).text(title).appendTo('body').fadeIn('slow');
186
  }, function() {
187
  //Hover out code
188
+ jQuery(this).attr('aam-tooltip', jQuery(this).data('tipText'));
189
  jQuery('.aam-tooltip').remove();
190
  }).mousemove(function(e) {
191
  jQuery('.aam-tooltip').css({
329
  }
330
  }
331
 
 
 
 
332
  //send the Ajax request to save the data
333
  jQuery.ajax(aamLocal.ajaxurl, {
334
  type: 'POST',
479
  var add = jQuery('<a/>', {
480
  'href': '#',
481
  'class': 'role-top-action role-top-action-add',
482
+ 'aam-tooltip': aamLocal.labels['Add New Role']
483
  }).bind('click', function(event) {
484
  event.preventDefault();
485
  _this.launch(jQuery(this), 'role-top-action-add');
521
  jQuery('.role-actions', nRow).append(jQuery('<a/>', {
522
  'href': '#',
523
  'class': 'role-action role-action-manage',
524
+ 'aam-tooltip': aamLocal.labels['Manage']
525
  }).bind('click', {
526
  role: aData[0]
527
  }, function(event) {
538
  jQuery('.role-actions', nRow).append(jQuery('<a/>', {
539
  'href': '#',
540
  'class': 'role-action role-action-edit',
541
+ 'aam-tooltip': aamLocal.labels['Edit']
542
  }).bind('click', function(event) {
543
  event.preventDefault();
544
  _this.launch(jQuery(this), 'role-action-edit');
548
  jQuery('.role-actions', nRow).append(jQuery('<a/>', {
549
  'href': '#',
550
  'class': 'role-action role-action-delete',
551
+ 'aam-tooltip': aamLocal.labels['Delete']
552
  }).bind('click', function(event) {
553
  event.preventDefault();
554
  if ((aData[0] === 'administrator')) {
759
  if (aData[1]) {
760
  var message = aamLocal.labels['Delete Role with Users Message'].replace(
761
  '%d', aData[1]
762
+ );
763
  message = message.replace('%s', aData[2]);
764
  jQuery('#delete_role_dialog .dialog-content').html(message);
765
  } else {
871
  'href': aamLocal.addUserURI,
872
  'target': '_blank',
873
  'class': 'user-top-action user-top-action-add',
874
+ 'aam-tooltip': aamLocal.labels['Add User']
875
  });
876
 
877
  var filter = jQuery('<a/>', {
878
  'href': '#',
879
  'class': 'user-top-action user-top-action-filter',
880
+ 'aam-tooltip': aamLocal.labels['Filter Users']
881
  }).bind('click', function(event) {
882
  event.preventDefault();
883
  _this.launch(jQuery(this), 'user-top-action-filter');
887
  var refresh = jQuery('<a/>', {
888
  'href': '#',
889
  'class': 'user-top-action user-top-action-refresh',
890
+ 'aam-tooltip': aamLocal.labels['Refresh List']
891
  }).bind('click', function(event) {
892
  event.preventDefault();
893
  _this.segmentTables.userList.fnDraw();
925
  jQuery('.user-actions', nRow).append(jQuery('<a/>', {
926
  'href': '#',
927
  'class': 'user-action user-action-manage',
928
+ 'aam-tooltip': aamLocal.labels['Manager']
929
  }).bind('click', function(event) {
930
  event.preventDefault();
931
  _this.setSubject('user', aData[0]);
937
  'href': aamLocal.editUserURI + '?user_id=' + aData[0],
938
  'target': '_blank',
939
  'class': 'user-action user-action-edit',
940
+ 'aam-tooltip': aamLocal.labels['Edit']
941
  }));
942
 
943
  var status = (aData[4] === '1' ? 'user-action-block-active' : 'user-action-block');
944
  jQuery('.user-actions', nRow).append(jQuery('<a/>', {
945
  'href': '#',
946
  'class': 'user-action ' + status,
947
+ 'aam-tooltip': aamLocal.labels['Block']
948
  }).bind('click', function(event) {
949
  event.preventDefault();
950
  _this.blockUser(this, aData);
951
  }));
952
+ /**
953
+ jQuery('.user-actions', nRow).append(jQuery('<a/>', {
954
+ 'href': '#',
955
+ 'class': 'user-action user-action-restore',
956
+ 'aam-tooltip': aamLocal.labels['Restore Default']
957
+ }).bind('click', function(event) {
958
+ event.preventDefault();
959
+ }));
960
+ */
961
  jQuery('.user-actions', nRow).append(jQuery('<a/>', {
962
  'href': '#',
963
  'class': 'user-action user-action-delete',
964
+ 'aam-tooltip': aamLocal.labels['Delete']
965
  }).bind('click', function(event) {
966
  event.preventDefault();
967
  _this.launch(jQuery(this), 'user-action-delete');
1149
  jQuery('.user-actions', nRow).append(jQuery('<a/>', {
1150
  'href': '#',
1151
  'class': 'user-action user-action-select',
1152
+ 'aam-tooltip': aamLocal.labels['Select Role']
1153
  }).bind('click', function(event) {
1154
  event.preventDefault();
1155
  _this.userRoleFilter = aData[0];
1208
  jQuery('.aam-main-loader').show();
1209
  jQuery('.aam-main-content').empty();
1210
 
1211
+ //reset blog Tables first
1212
+ for (var i in this.blogTables) {
1213
+ this.blogTables[i] = null;
1214
+ }
1215
+
1216
  jQuery.ajax(aamLocal.siteURI, {
1217
  type: 'POST',
1218
  dataType: 'html',
1266
  * @access public
1267
  */
1268
  AAM.prototype.initSettings = function() {
1269
+ var _this = this;
1270
+
1271
  //remove all dialogs to make sure that there are no confusions
1272
  jQuery('.ui-dialog').remove();
1273
 
1274
  //init Settings Menu
1275
  jQuery('.feature-list .feature-item').each(function() {
1276
  jQuery(this).bind('click', function() {
1277
+ //feature activation hook
1278
+ _this.doAction(
1279
+ 'aam_feature_activation',
1280
+ {'feature': jQuery(this).attr('feature')}
1281
+ );
1282
+
1283
  jQuery('.feature-list .feature-item').removeClass(
1284
  'feature-item-active'
1285
+ );
1286
  jQuery(this).addClass('feature-item-active');
1287
  jQuery('.feature-content .feature-content-container').hide();
1288
  jQuery('#' + jQuery(this).attr('feature') + '_content').show();
1290
  jQuery('.aam-help > span').hide();
1291
  jQuery('#feature_help_' + jQuery(this).attr('feature')).css(
1292
  'display', 'table-cell'
1293
+ );
1294
  });
1295
  });
1296
 
1299
  this.initCapabilityTab();
1300
  this.initPostTab();
1301
  this.initEventTab();
 
1302
 
1303
  this.doAction('aam_init_features');
1304
 
1305
  jQuery('.feature-list .feature-item:eq(0)').trigger('click');
1306
  };
1307
 
 
 
 
 
 
 
 
 
 
 
 
 
1308
  /**
1309
  * Initialize Capability Feature
1310
  *
1371
  var filter = jQuery('<a/>', {
1372
  'href': '#',
1373
  'class': 'capability-top-action capability-top-action-filter',
1374
+ 'aam-tooltip': aamLocal.labels['Filter Capabilities by Category']
1375
  }).bind('click', function(event) {
1376
  event.preventDefault();
1377
  _this.launch(jQuery(this), 'capability-top-action-filter');
1385
  var copy = jQuery('<a/>', {
1386
  'href': '#',
1387
  'class': 'capability-top-action capability-top-action-copy',
1388
+ 'aam-tooltip': aamLocal.labels['Inherit Capabilities']
1389
  }).bind('click', function(event) {
1390
  event.preventDefault();
1391
  _this.launch(jQuery(this), 'capability-top-action-copy');
1395
  var add = jQuery('<a/>', {
1396
  'href': '#',
1397
  'class': 'capability-top-action capability-top-action-add',
1398
+ 'aam-tooltip': aamLocal.labels['Add New Capability']
1399
  }).bind('click', function(event) {
1400
  event.preventDefault();
1401
  _this.launch(jQuery(this), 'capability-top-action-add');
1409
  var restore = jQuery('<a/>', {
1410
  'href': '#',
1411
  'class': 'capability-top-action capability-top-action-restore',
1412
+ 'aam-tooltip': aamLocal.labels['Restore Default Capabilities']
1413
  }).bind('click', function(event) {
1414
  event.preventDefault();
1415
  var data = _this.compileAjaxPackage('restore_capability', true);
1468
  jQuery(actions).append(jQuery('<a/>', {
1469
  'href': '#',
1470
  'class': 'capability-action capability-action-delete',
1471
+ 'aam-tooltip': aamLocal.labels['Delete']
1472
  }).bind('click', function(event) {
1473
  event.preventDefault();
1474
  _this.launch(jQuery(this), 'capability-action-delete');
2028
  var filter = jQuery('<a/>', {
2029
  'href': '#',
2030
  'class': 'event-top-action event-top-action-add',
2031
+ 'aam-tooltip': aamLocal.labels['Add Event']
2032
  }).bind('click', function(event) {
2033
  event.preventDefault();
2034
  _this.launch(jQuery(this), 'event-top-action-add');
2055
  jQuery('.event-actions', nRow).append(jQuery('<a/>', {
2056
  'href': '#',
2057
  'class': 'event-action event-action-edit',
2058
+ 'aam-tooltip': aamLocal.labels['Edit Event']
2059
  }).bind('click', function(event) {
2060
  event.preventDefault();
2061
  _this.launch(jQuery(this), 'event-action-edit');
2064
  jQuery('.event-actions', nRow).append(jQuery('<a/>', {
2065
  'href': '#',
2066
  'class': 'event-action event-action-delete',
2067
+ 'aam-tooltip': aamLocal.labels['Delete Event']
2068
  }).bind('click', function(event) {
2069
  event.preventDefault();
2070
  _this.launch(jQuery(this), 'event-action-delete');
2268
  name: '_ajax_nonce',
2269
  value: aamLocal.nonce
2270
  });
2271
+ aoData.push({
2272
+ name: 'subject',
2273
+ value: _this.getSubject().type
2274
+ });
2275
+ aoData.push({
2276
+ name: 'subject_id',
2277
+ value: _this.getSubject().id
2278
+ });
2279
  aoData.push({
2280
  name: 'term',
2281
  value: _this.postTerm
2287
  var filter = jQuery('<a/>', {
2288
  'href': '#',
2289
  'class': 'post-top-action post-top-action-filter',
2290
+ 'aam-tooltip': aamLocal.labels['Filter Posts by Post Type']
2291
  }).bind('click', function(event) {
2292
  event.preventDefault();
2293
  _this.launch(jQuery(this), 'post-top-action-filter');
2297
  var refresh = jQuery('<a/>', {
2298
  'href': '#',
2299
  'class': 'post-top-action post-top-action-refresh',
2300
+ 'aam-tooltip': aamLocal.labels['Refresh List']
2301
  }).bind('click', function(event) {
2302
  event.preventDefault();
2303
  _this.blogTables.postList.fnDraw();
2319
  aoColumnDefs: [
2320
  {
2321
  bVisible: false,
2322
+ aTargets: [0, 1, 2, 6]
2323
  }
2324
  ],
2325
  fnRowCallback: function(nRow, aData, iDisplayIndex) { //format data
2332
  _this.launch(button, 'post-action-manage');
2333
  _this.launchManageAccessDialog(button, nRow, aData, 'post');
2334
  }).text(aData[3]));
2335
+
2336
  jQuery('td:eq(2)', nRow).append(jQuery('<div/>', {
2337
  'class': 'post-actions'
2338
  }));
2339
 
 
 
 
 
 
 
 
2340
  jQuery('.post-actions', nRow).append(jQuery('<a/>', {
2341
  'href': '#',
2342
  'class': 'post-action post-action-manage',
2343
+ 'aam-tooltip': aamLocal.labels['Manage Access']
2344
  }).bind('click', function(event) {
2345
  event.preventDefault();
2346
  _this.launch(jQuery(this), 'post-action-manage');
2347
  _this.launchManageAccessDialog(this, nRow, aData, 'post');
2348
  }));
2349
 
2350
+ jQuery('.post-actions', nRow).append(jQuery('<a/>', {
2351
+ 'href': aData[2].replace('&amp;', '&'),
2352
+ 'class': 'post-action post-action-edit',
2353
+ 'target': '_blank',
2354
+ 'aam-tooltip': aamLocal.labels['Edit']
2355
+ }));
2356
+
2357
+ if (aData[1] == 'trash') {
2358
+ jQuery('.post-actions', nRow).append(jQuery('<a/>', {
2359
+ 'href': '#',
2360
+ 'class': 'post-action post-action-delete',
2361
+ 'aam-tooltip': aamLocal.labels['Delete Post']
2362
+ }).bind('click', function(event) {
2363
+ event.preventDefault();
2364
+ _this.launch(jQuery(this), 'post-action-delete');
2365
+ _this.launchDeletePostDialog(this, nRow, aData, true);
2366
+ }));
2367
+ } else {
2368
+ jQuery('.post-actions', nRow).append(jQuery('<a/>', {
2369
+ 'href': '#',
2370
+ 'class': 'post-action post-action-trash',
2371
+ 'aam-tooltip': aamLocal.labels['Move to Trash']
2372
+ }).bind('click', function(event) {
2373
+ event.preventDefault();
2374
+ _this.launch(jQuery(this), 'post-action-trash');
2375
+ _this.launchDeletePostDialog(this, nRow, aData, false);
2376
+ }));
2377
+ }
2378
+
2379
+ if (parseInt(aData[6]) === 1) {
2380
+ jQuery('.post-actions', nRow).append(jQuery('<a/>', {
2381
+ 'href': '#',
2382
+ 'class': 'post-action post-action-restore',
2383
+ 'aam-tooltip': aamLocal.labels['Restore Default Access']
2384
+ }).bind('click', function(event) {
2385
+ event.preventDefault();
2386
+ _this.restorePostAccess(aData[0], 'post', nRow);
2387
+ jQuery(this).remove();
2388
+ }));
2389
+ }
2390
+
2391
+
2392
  _this.initTooltip(nRow);
2393
  },
2394
  fnDrawCallback: function() {
2505
 
2506
  var buttons = {};
2507
  buttons[aamLocal.labels['Restore Default']] = function() {
2508
+ _this.restorePostAccess(aData[0], type, nRow);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2509
  jQuery('#access_dialog').dialog("close");
2510
  };
2511
 
2512
+ if (response.counter <= 10) {
2513
  buttons[aamLocal.labels['Apply']] = function() {
2514
  _this.showMetaboxLoader('#access_dialog');
2515
  var data = _this.compileAjaxPackage('save_access', true);
2570
  });
2571
  };
2572
 
2573
+ /**
2574
+ * Restore Default Post/Term Access
2575
+ *
2576
+ * @param {type} id
2577
+ * @param {type} type
2578
+ * @param {type} nRow
2579
+ *
2580
+ * @returns {void}
2581
+ */
2582
+ AAM.prototype.restorePostAccess = function(id, type, nRow) {
2583
+ var _this = this;
2584
+
2585
+ //retrieve settings and display the dialog
2586
+ var data = this.compileAjaxPackage('clear_access', true);
2587
+ data.id = id;
2588
+ data.type = type;
2589
+
2590
+ jQuery.ajax(aamLocal.ajaxurl, {
2591
+ type: 'POST',
2592
+ dataType: 'json',
2593
+ data: data,
2594
+ success: function(response) {
2595
+ _this.highlight(nRow, response.status);
2596
+ },
2597
+ error: function() {
2598
+ _this.highlight(nRow, 'failure');
2599
+ }
2600
+ });
2601
+ };
2602
+
2603
+ /**
2604
+ * Launch the Delete Post Dialog
2605
+ *
2606
+ * @param {Object} button
2607
+ * @param {Object} aRow
2608
+ * @param {Object} aData
2609
+ * @param {Boolean} force
2610
+ *
2611
+ * @returns {void}
2612
+ *
2613
+ * @access public
2614
+ */
2615
+ AAM.prototype.launchDeletePostDialog = function(button, nRow, aData, force) {
2616
+ var _this = this;
2617
+
2618
+ jQuery('#delete_post_dialog .dialog-content').html(
2619
+ aamLocal.labels[(force ? 'Delete' : 'Trash') + ' Post Message'].replace('%s', aData[3])
2620
+ );
2621
+ var buttons = {};
2622
+
2623
+ if (force === false) {
2624
+ buttons[aamLocal.labels['Delete Permanently']] = function() {
2625
+ _this.deletePost(aData[0], true, nRow);
2626
+ };
2627
+ }
2628
+
2629
+ buttons[aamLocal.labels[(force ? 'Delete' : 'Trash') + ' Post']] = function() {
2630
+ _this.deletePost(aData[0], force, nRow);
2631
+ };
2632
+ buttons[aamLocal.labels['Cancel']] = function() {
2633
+ jQuery('#delete_post_dialog').dialog("close");
2634
+ };
2635
+
2636
+ jQuery('#delete_post_dialog').dialog({
2637
+ resizable: false,
2638
+ height: 'auto',
2639
+ width: '30%',
2640
+ modal: true,
2641
+ title: aamLocal.labels[(force ? 'Delete' : 'Trash') + ' Post'],
2642
+ buttons: buttons,
2643
+ close: function() {
2644
+ _this.terminate(jQuery(button), 'post-action-' + (force ? 'delete' : 'trash'));
2645
+ }
2646
+ });
2647
+ };
2648
+
2649
+ /**
2650
+ * Delete or Trash the Post
2651
+ *
2652
+ * @param {type} id
2653
+ * @param {type} force
2654
+ * @param {type} nRow
2655
+ *
2656
+ * @returns {void}
2657
+ */
2658
+ AAM.prototype.deletePost = function(id, force, nRow) {
2659
+ var _this = this;
2660
+
2661
+ var data = _this.compileAjaxPackage('delete_post');
2662
+ data.post = id;
2663
+ data.force = (force ? 1 : 0);
2664
+ jQuery.ajax(aamLocal.ajaxurl, {
2665
+ type: 'POST',
2666
+ dataType: 'json',
2667
+ data: data,
2668
+ success: function(response) {
2669
+ if (response.status === 'success') {
2670
+ _this.blogTables.postList.fnDeleteRow(nRow);
2671
+ }
2672
+ _this.highlight('#post_list_wrapper', response.status);
2673
+ },
2674
+ error: function() {
2675
+ _this.highlight('#post_list_wrapper', 'failure');
2676
+ }
2677
+ });
2678
+ jQuery('#delete_post_dialog').dialog("close");
2679
+ };
2680
+
2681
  /**
2682
  * Build Post Breadcrumb
2683
  *
2722
  'href': response.link,
2723
  'target': '_blank',
2724
  'class': 'post-breadcrumb-line-action post-breadcrumb-line-action-edit',
2725
+ 'aam-tooltip': aamLocal.labels['Edit Term']
2726
  }));
2727
  jQuery('.post-breadcrumb-line-actions').append(jQuery('<a/>', {
2728
  'href': '#',
2729
  'class': 'post-breadcrumb-line-action post-breadcrumb-line-action-manage',
2730
+ 'aam-tooltip': aamLocal.labels['Manager Access']
2731
  }).bind('click', {id: response.breadcrumb[i][0]}, function(event) {
2732
  event.preventDefault();
2733
  _this.launch(this, 'post-breadcrumb-line-action-manage');
2742
  'href': 'http://wpaam.com',
2743
  'target': '_blank',
2744
  'class': 'post-breadcrumb-line-action post-breadcrumb-line-action-lock',
2745
+ 'aam-tooltip': aamLocal.labels['Unlock Default Accesss Control']
2746
  }));
2747
  this.doAction('aam_breadcrumb_action', response);
2748
  }
media/js/configpress.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * ======================================================================
3
+ * LICENSE: This file is subject to the terms and conditions defined in *
4
+ * file 'license.txt', which is part of this source code package. *
5
+ * ======================================================================
6
+ */
7
+
8
+ jQuery(document).ready(function() {
9
+
10
+ /**
11
+ * Highlight the specified DOM area
12
+ *
13
+ * @param {String} selector
14
+ * @param {String} status
15
+ *
16
+ * @returns {void}
17
+ *
18
+ * @access public
19
+ */
20
+ function highlight(selector, status) {
21
+ if (status === 'success') {
22
+ jQuery(selector).effect("highlight", {
23
+ color: '#98CE90'
24
+ }, 3000);
25
+ } else {
26
+ jQuery(selector).effect("highlight", {
27
+ color: '#FFAAAA'
28
+ }, 3000);
29
+ }
30
+ }
31
+
32
+ var editor = CodeMirror.fromTextArea(
33
+ document.getElementById("configpress"), {}
34
+ );
35
+
36
+ jQuery('#save_config').bind('click', function(event) {
37
+ event.preventDefault();
38
+ jQuery.ajax(aamLocal.ajaxurl, {
39
+ type: 'POST',
40
+ dataType: 'json',
41
+ data: {
42
+ action: 'aam',
43
+ sub_action: 'save_configpress',
44
+ config: editor.getValue(),
45
+ _ajax_nonce: aamLocal.nonce
46
+ },
47
+ success: function(response) {
48
+ highlight('#control_panel', response.status);
49
+ },
50
+ error: function() {
51
+ highlight('#control_panel', 'failure');
52
+ }
53
+ });
54
+ })
55
+ });
56
+
media/js/migrate.js DELETED
@@ -1,147 +0,0 @@
1
- /**
2
- * ======================================================================
3
- * LICENSE: This file is subject to the terms and conditions defined in *
4
- * file 'license.txt', which is part of this source code package. *
5
- * ======================================================================
6
- */
7
-
8
- function aamMigration() {
9
- this.steps = {
10
- 1: {
11
- id: 'aam_collect_data',
12
- action: 'collect'
13
- },
14
- 2: {
15
- id: 'aam_migrating',
16
- action: 'migrate'
17
- },
18
- 3: {
19
- id: 'aam_cleanup',
20
- action: 'cleanup'
21
- },
22
- 4: {
23
- id: 'aam_migration_complete',
24
- action: 'complete'
25
- }
26
- };
27
- }
28
-
29
- aamMigration.prototype.run = function() {
30
- this.activateStep(1);
31
- };
32
-
33
- aamMigration.prototype.activateStep = function(index) {
34
- if (typeof this.steps[index] !== 'undefined') {
35
- jQuery('#' + this.steps[index].id).css('opacity', '1');
36
- jQuery('#' + this.steps[index].id).removeClass('migration-step-pending').addClass('migration-step-running');
37
- this.sendRequest(index);
38
- }
39
- };
40
-
41
- aamMigration.prototype.completeStep = function(index) {
42
- jQuery('#' + this.steps[index].id).removeClass('migration-step-running').addClass('migration-step-completed');
43
- };
44
-
45
- aamMigration.prototype.failedStep = function(index) {
46
- jQuery('#' + this.steps[index].id).removeClass('migration-step-running').addClass('migration-step-failed');
47
- };
48
-
49
- aamMigration.prototype.sendRequest = function(index) {
50
- var _this = this;
51
- jQuery.ajax(aamMigrateLocal.ajaxurl, {
52
- type: 'POST',
53
- dataType: 'json',
54
- data: {
55
- action: 'aam',
56
- sub_action: 'migrate',
57
- step: this.steps[index].action,
58
- _ajax_nonce: aamMigrateLocal.nonce
59
- },
60
- success: function(response) {
61
- if (response.status === 'success') {
62
- if (parseInt(response.stop) === 1) {
63
- _this.completeStep(index);
64
- _this.activateStep(index + 1);
65
- } else {
66
- _this.sendRequest(index);
67
- }
68
- } else {
69
- _this.failedStep(index);
70
- }
71
- },
72
- error: function() {
73
- _this.failedStep(index);
74
- }
75
- });
76
- };
77
-
78
-
79
- jQuery(document).ready(function() {
80
- jQuery('#aam_migrate').bind('click', function() {
81
- var holder = jQuery('<div/>', {'class': 'migration-dialog'});
82
- //add header
83
- jQuery(holder).append(jQuery('<div/>', {
84
- 'class': 'migration-header'
85
- }).html('Migration Process Status'));
86
- //add notice
87
- jQuery(holder).append(jQuery('<div/>', {
88
- 'class': 'migration-notice'
89
- }).html('Warning! Please take a minute to read about migration process. <a href="http://wpaam.com/forum/viewtopic.php?f=2&t=20" target="_blank">Read more</a>'));
90
- jQuery(holder).append(jQuery('<div/>', {
91
- 'class': 'migration-notice'
92
- }).html('Please do not reload the page until process is complete! <a href="#" id="start_migration">Start the Migration</a> or <a href="#" id="dont_bother">No Thank you</a>'));
93
-
94
- //add migration steps
95
- var step_holder = jQuery('<div/>', {'class': 'migration-steps'});
96
- jQuery(step_holder).append(jQuery('<div/>', {
97
- 'class': 'migration-step migration-step-pending',
98
- 'id': 'aam_collect_data'
99
- }).html('Collecting AAM Data'));
100
- jQuery(step_holder).append(jQuery('<div/>', {
101
- 'class': 'migration-step migration-step-pending',
102
- 'id': 'aam_migrating'
103
- }).html('Migrating Settings'));
104
- jQuery(step_holder).append(jQuery('<div/>', {
105
- 'class': 'migration-step migration-step-pending',
106
- 'id': 'aam_cleanup'
107
- }).html('Migration Clean-up'));
108
- jQuery(step_holder).append(jQuery('<div/>', {
109
- 'class': 'migration-step migration-step-pending',
110
- 'id': 'aam_migration_complete'
111
- }).html('Migration Completed (You can Reload the Page)'));
112
-
113
- jQuery(holder).append(step_holder);
114
-
115
- jQuery('body').append(holder);
116
-
117
- jQuery('#start_migration').bind('click', function(event) {
118
- event.preventDefault();
119
- migration.run();
120
- });
121
-
122
- jQuery('#dont_bother').bind('click', function(event) {
123
- event.preventDefault();
124
- jQuery.ajax(aamMigrateLocal.ajaxurl, {
125
- type: 'POST',
126
- dataType: 'json',
127
- data: {
128
- action: 'aam',
129
- sub_action: 'migrate',
130
- step: 'complete',
131
- _ajax_nonce: aamMigrateLocal.nonce
132
- },
133
- success: function(response) {
134
- if (response.status === 'success') {
135
- location.reload();
136
- }
137
- },
138
- error: function() {
139
- alert('Failed to Update Database');
140
- }
141
- });
142
- });
143
-
144
- //run the migration process
145
- var migration = new aamMigration();
146
- });
147
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -2,36 +2,63 @@
2
  Contributors: vasyl_m
3
  Tags: access manager, access, access control, comments, capability, widget, filter menu, role manager, user access, user control, user
4
  Requires at least: 3.4.2
5
- Tested up to: 3.8
6
- Stable tag: 2.1
7
 
8
- Graphic interface to manage User Access to your Front-end and Back-end
9
 
10
  == Description ==
11
 
12
- Advanced Access Manager is very powerful and flexible Access Control tool for
13
- your WordPress website. It supports Single WordPress installation and Multisite
14
- setup.
15
- This is the basic list of features you can perform this AAM:
16
 
17
- * Filter Admin Menu
18
- * Filter Dashboard Widgets
19
- * Filter Metaboxes
20
- * Filter Frontend Widgets
21
- * Manage Comments
22
- * Manage Capabilities (Create, Delete)
23
- * Manage User Roles (Create, Edit, Delete)
24
- * Manage Access to your Posts, Pages or even Custom Post Types
25
 
26
- And many-many other features.
27
 
28
- The AAM support also next languages:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  * English
31
  * German (by Kolja www.Reggae-Party.de)
32
  * Spanish (by Etruel www.netmdp.com)
33
  * Polish (by Gustaw Lasek www.servitium.pl)
34
  * French (by Moskito7)
 
35
 
36
  == Installation ==
37
 
@@ -59,6 +86,28 @@ the list of additional metaboxes can be picked by AAM.
59
 
60
  == Changelog ==
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  = 2.1 =
63
  * Fixed issue with Admin Menu restrictions (thanks to MikeB2B)
64
  * Added Polish Translation
2
  Contributors: vasyl_m
3
  Tags: access manager, access, access control, comments, capability, widget, filter menu, role manager, user access, user control, user
4
  Requires at least: 3.4.2
5
+ Tested up to: 3.8.1
6
+ Stable tag: 2.2
7
 
8
+ Graphic interface to manage Access control to your Front-end and Back-end
9
 
10
  == Description ==
11
 
12
+ Are you looking for free and powerful plugin for WordPress Access Control?
 
 
 
13
 
14
+ Nowadays AAM is one of the most popular access control plugins. It is easy-to-use but
15
+ at the same time very powerful tool that gives you a flexible control over your either
16
+ single WordPress site or Multisite Network. With AAM you are allowed to configure access
17
+ to different parts of your website for any Role or individual User.
 
 
 
 
18
 
19
+ In Current version you are allowed to do next:
20
 
21
+ **Control Access to Admin Menu (including submenu)**
22
+ As example you can restrict access for Role Editor to Menu "Pages" or does not allow
23
+ individual User to manage Post's Categories.
24
+
25
+ **Filter Widgets & Metaboxes**
26
+ Filter the list of metaboxes that User can see during Post/Page editing. At the same
27
+ time you can filter the list of Dashboard and Frontend widgets.
28
+
29
+ **Manage Role's or User's Capabilities**
30
+ AAM, with simple interface, allows you to grand or remove capabilities from Role or User.
31
+ You can also create new capabilities or remove existing.
32
+
33
+ **Control Access to Posts, Pages, CPTs or Terms**
34
+ You can restrict access to individual page or post for any user or role as well as
35
+ restrict access to entire Term and all posts inside it. You can also restrict
36
+ page commenting for individual pages or exclude them from Frontend menu. We are
37
+ extending the list of possible restrictions with each new version.
38
+
39
+ **Create custom actions for system events**
40
+ As example your system can trigger email to you if some user published Post/Page or
41
+ modified content. You are also allowed to develop your own custom action for event.
42
+
43
+ **Track User Activities**
44
+ With AAM you can track user activities within your website. So you can easily find out
45
+ when user was logged in or modified some Post/Page. There are many activities that can
46
+ be tracked. We constantly adding more and more.
47
+
48
+ **Manage Role List**
49
+ AAM allows you to create new Roles or Delete existing.
50
+
51
+ There are a lot of small and hidden features included in AAM that we are not listing
52
+ here but you can find more about them on our [Forum](http://wpaam.com/forum).
53
+
54
+ The AAM support also these languages:
55
 
56
  * English
57
  * German (by Kolja www.Reggae-Party.de)
58
  * Spanish (by Etruel www.netmdp.com)
59
  * Polish (by Gustaw Lasek www.servitium.pl)
60
  * French (by Moskito7)
61
+ * Russian (by Maxim Kernozhickii www.aeromultimedia.com)
62
 
63
  == Installation ==
64
 
86
 
87
  == Changelog ==
88
 
89
+ = 2.2 =
90
+ * Fixed issue with jQuery UI Tooltip Widget
91
+ * Added AAM Warning Panel
92
+ * Added Event Log Feature
93
+ * Moved ConfigPress to separate Page (refactored internal handling)
94
+ * Reverted back the SSL handling
95
+ * Added Post Delete feature
96
+ * Added Post's Restore Default Restrictions feature
97
+ * Added ConfigPress Extension turn on/off setting
98
+ * Russian translation by (Maxim Kernozhitskiy http://aeromultimedia.com)
99
+ * Removed Migration possibility
100
+ * Refactored AAM Core Console model
101
+ * Increased the number of saved restriction for basic version
102
+ * Simplified Undo feature
103
+
104
+ = 2.1.1 =
105
+ * Fixed fatal error in caching mechanism
106
+ * Extended ConfigPress tutorial
107
+ * Fixed error for AAM Plus Package for PHP earlier versions
108
+ * Improved Admin over SSL check
109
+ * Improved Taxonomy Query handling mechanism
110
+
111
  = 2.1 =
112
  * Fixed issue with Admin Menu restrictions (thanks to MikeB2B)
113
  * Added Polish Translation