/** * Loads access scope. * * @return void */ protected function loadAccessibilityScope() { parent::loadAccessibilityScope(); $this->scope = array('permissions' => Helpers\CMSUsers::getAccessibilityScope(), 'ownership' => Helpers\Ownership::getScope($this->modules)); }
/** * Get either a Gravatar URL or complete image tag for a specified email address. * * @param integer $size Size in pixels, defaults to 80px [ 1 - 2048 ]. * @param string $type Default image-set to use [ 404 | mm | identicon | monsterid | wavatar ]. * @param string $rating Maximum rating (inclusive) [ g | pg | r | x ]. * * @return string */ public function getAvatar($size = 70, $type = 'mm', $rating = 'g') { return CMS\Helpers\CMSUsers::getGravatar($this->email, $size, $type, $rating); }
/** * Loads CMS accessibility scope. * * @see \CMS\Helpers\CMSUsers::userCan() * * @return void */ protected function loadAccessibilityScope() { $this->modules = array_keys($this->labels['modules']); foreach ($this->modules as $key => $module) { if (!Helpers\CMSUsers::userCan(array('controller' => $module, 'action' => 'index'))) { unset($this->modules[$key]); } } }
/** * User can access a specific content helper to use in templates. * * @param array $options Options example [controller => '', action => '']. * @param Smarty_Internal_Template $template Template engine object. * * @uses \Core\Helpers\CMSUsers * * @return string */ function smarty_function_user_can(array $options, Smarty_Internal_Template $template) { return \CMS\Helpers\CMSUsers::userCan($options); }