Skip to content
Extraits de code Groupes Projets
API.php 928 octets
Newer Older
  • Learn to ignore specific revisions
  •  * Piwik - free/libre analytics platform
    
     *
     * @link http://piwik.org
     * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
     *
     */
    namespace Piwik\Plugins\LeftMenu;
    
    /**
     * API for plugin LeftMenu
     *
     * @method static \Piwik\Plugins\LeftMenu\API getInstance()
     */
    class API extends \Piwik\Plugin\API
    {
        /**
         * Returns true if the left menu is enabled for the current user.
         *
         * @return bool
         */
        public function isEnabled()
        {
            $settings = new Settings('LeftMenu');
    
            $default  = $settings->globalEnabled->getValue();
    
            if (!$settings->userEnabled->isReadableByCurrentUser()) {
                return $default;
            }
    
            if (empty($user) || $user === 'system') {