コード例 #1
0
 /**
  * @inheritDoc IComponentType::isSelectable()
  *
  * @return bool
  */
 public function isSelectable()
 {
     // Only admins get the Get Help widget.
     if (parent::isSelectable() && craft()->userSession->isAdmin()) {
         return true;
     }
     return false;
 }
コード例 #2
0
 /**
  * @inheritDoc IComponentType::isSelectable()
  *
  * @return bool
  */
 public function isSelectable()
 {
     // Gotta have update permission to get this widget
     if (parent::isSelectable() && craft()->userSession->checkPermission('performUpdates')) {
         return true;
     }
     return false;
 }
コード例 #3
0
 public function isSelectable()
 {
     $plugin = craft()->plugins->getPlugin('analytics');
     $settings = $plugin->getSettings();
     if (empty($settings['enableRealtime'])) {
         return false;
     }
     return parent::isSelectable();
 }