Beispiel #1
0
 /**
  * Register feature
  *
  * @return void
  *
  * @access protected
  */
 protected function registerFeature()
 {
     //add feature
     $capability = aam_Core_ConfigPress::getParam('aam.feature.my_feature.capability', 'administrator');
     if (current_user_can($capability)) {
         add_action('admin_print_scripts', array($this, 'printScripts'));
         add_action('admin_print_styles', array($this, 'printStyles'));
         aam_View_Collection::registerFeature((object) array('uid' => 'my_feature', 'position' => 100, 'title' => __('My Feature', 'aam'), 'subjects' => array(aam_Control_Subject_Role::UID, aam_Control_Subject_User::UID, aam_Control_Subject_Visitor::UID), 'controller' => $this));
     }
 }
 /**
  * Register new UI feature
  *
  * @return void
  *
  * @access protected
  */
 protected function registerFeature()
 {
     $capability = aam_Core_ConfigPress::getParam('aam.feature.activity_log.capability', 'administrator');
     if (current_user_can($capability)) {
         add_action('admin_print_scripts', array($this, 'printScripts'));
         add_action('admin_print_styles', array($this, 'printStyles'));
         add_filter('aam_ajax_call', array($this, 'ajax'), 10, 2);
         add_action('aam_localization_labels', array($this, 'localizationLabels'));
         aam_View_Collection::registerFeature((object) array('uid' => 'activity_log', 'position' => 35, 'title' => __('Activity Log', 'aam'), 'subjects' => array(aam_Control_Subject_Role::UID, aam_Control_Subject_User::UID), 'controller' => $this));
     }
 }
 /**
  * Register new subject Multisite
  *
  * @return void
  *
  * @access public
  */
 public function registerSubject()
 {
     aam_View_Collection::registerSubject((object) array('position' => 1, 'segment' => 'multisite', 'label' => __('Sites', 'aam'), 'title' => __('Site Manager', 'aam'), 'class' => 'manager-item manager-item-multisite', 'uid' => 'multisite', 'controller' => $this));
 }
 /**
  * Get Event List
  *
  * @return string
  *
  * @access public
  */
 public function eventList()
 {
     if (aam_View_Collection::hasFeature(self::FEATURE_EVENT_MANAGER)) {
         $event = new aam_View_Event();
         $response = $event->retrieveEventList();
     } else {
         $response = self::DEFAULT_AJAX_RESPONSE;
     }
     return $response;
 }
 /**
  * Register feature
  * 
  * The Feature Example Extension has UI interface. That is why it is very 
  * important to make sure that it is backend (there is no need to load this 
  * Extension if user is browsing frontend).
  * 
  * From release 2.5, each Extension has its own capability assigned to it. By
  * default all Extensions have capability "Administrator" but this can be changed
  * with ConfigPress setting aam.feature.[you feature ID].capability.
  * For more information about this part of functionality chech official AAM
  * tutorial "AAM Super Admin" http://wpaam.com/tutorials/aam-super-admin/
  *
  * @return void
  *
  * @access protected
  */
 protected function registerFeature()
 {
     //add feature
     $capability = aam_Core_ConfigPress::getParam('aam.feature.' . self::FEATURE_ID . '.capability', 'administrator');
     //makre sure that current user has access to current Extension. This is
     //mandatory check and should be obeyed by all developers
     if (current_user_can($capability)) {
         //register the Extension's javascript
         add_action('admin_print_scripts', array($this, 'printScripts'));
         //register the Extension's stylesheet
         add_action('admin_print_styles', array($this, 'printStyles'));
         //register the Feature
         aam_View_Collection::registerFeature((object) array('uid' => self::FEATURE_ID, 'position' => 150, 'title' => __('Feature Example', 'aam'), 'subjects' => array(aam_Control_Subject_Role::UID, aam_Control_Subject_User::UID, aam_Control_Subject_Visitor::UID), 'controller' => $this));
     }
 }