setBasicVariablesAdminView() публичный статический Метод

Assigns the following variables: - **statisticsNotRecorded** - Set to true if the [Tracker] record_statistics INI config is 0. If not 0, this variable will not be defined. - **topMenu** - The result of MenuTop::getInstance()->getMenu(). - **enableFrames** - The value of the [General] enable_framed_pages INI config option. If true, {@link Piwik\View::setXFrameOptions()} is called on the view. - **isSuperUser** - Whether the current user is a superuser or not. - **usingOldGeoIPPlugin** - Whether this Piwik install is currently using the old GeoIP plugin or not. - **invalidPluginsWarning** - Set if some of the plugins to load (determined by INI configuration) are invalid or missing. - **phpVersion** - The current PHP version. - **phpIsNewEnough** - Whether the current PHP version is new enough to run Piwik. - **adminMenu** - The result of MenuAdmin::getInstance()->getMenu().
public static setBasicVariablesAdminView ( View $view )
$view Piwik\View
Пример #1
0
 public function detection()
 {
     Piwik::checkUserHasSomeAdminAccess();
     $view = new View('@DevicesDetection/detection');
     $this->setBasicVariablesView($view);
     ControllerAdmin::setBasicVariablesAdminView($view);
     $userAgent = Common::getRequestVar('ua', $_SERVER['HTTP_USER_AGENT'], 'string');
     $uaParser = new DeviceDetector($userAgent);
     $uaParser->parse();
     $view->userAgent = $userAgent;
     $view->browser_name = $uaParser->getClient('name');
     $view->browser_short_name = $uaParser->getClient('short_name');
     $view->browser_version = $uaParser->getClient('version');
     $view->browser_logo = getBrowserLogo($uaParser->getClient('short_name'));
     $view->browser_family = \DeviceDetector\Parser\Client\Browser::getBrowserFamily($uaParser->getClient('short_name'));
     $view->browser_family_logo = getBrowserFamilyLogo($view->browser_family);
     $view->os_name = $uaParser->getOs('name');
     $view->os_logo = getOsLogo($uaParser->getOs('short_name'));
     $view->os_short_name = $uaParser->getOs('short_name');
     $view->os_family = \DeviceDetector\Parser\OperatingSystem::getOsFamily($uaParser->getOs('short_name'));
     $view->os_family_logo = getOsFamilyLogo($view->os_family);
     $view->os_version = $uaParser->getOs('version');
     $view->device_type = getDeviceTypeLabel($uaParser->getDeviceName());
     $view->device_type_logo = getDeviceTypeLogo($uaParser->getDeviceName());
     $view->device_model = $uaParser->getModel();
     $view->device_brand = getDeviceBrandLabel($uaParser->getBrand());
     $view->device_brand_logo = getBrandLogo($uaParser->getBrand());
     return $view->render();
 }
Пример #2
0
 public function deviceDetection()
 {
     Piwik::checkUserHasSomeAdminAccess();
     $view = new View('@DevicesDetection/detection');
     $this->setBasicVariablesView($view);
     ControllerAdmin::setBasicVariablesAdminView($view);
     $userAgent = Common::getRequestVar('ua', $_SERVER['HTTP_USER_AGENT'], 'string');
     $parsedUA = DeviceDetector::getInfoFromUserAgent($userAgent);
     $view->userAgent = $userAgent;
     $view->browser_name = $parsedUA['browser']['name'];
     $view->browser_short_name = $parsedUA['browser']['short_name'];
     $view->browser_version = $parsedUA['browser']['version'];
     $view->browser_logo = getBrowserLogoExtended($parsedUA['browser']['short_name']);
     $view->browser_family = $parsedUA['browser_family'];
     $view->browser_family_logo = getBrowserFamilyLogoExtended($parsedUA['browser_family']);
     $view->os_name = $parsedUA['os']['name'];
     $view->os_logo = getOsLogoExtended($parsedUA['os']['short_name']);
     $view->os_short_name = $parsedUA['os']['short_name'];
     $view->os_family = $parsedUA['os_family'];
     $view->os_family_logo = getOsFamilyLogoExtended($parsedUA['os_family']);
     $view->os_version = $parsedUA['os']['version'];
     $view->device_type = getDeviceTypeLabel($parsedUA['device']['type']);
     $view->device_type_logo = getDeviceTypeLogo($parsedUA['device']['type']);
     $view->device_model = $parsedUA['device']['model'];
     $view->device_brand = getDeviceBrandLabel($parsedUA['device']['brand']);
     $view->device_brand_logo = getBrandLogo($view->device_brand);
     return $view->render();
 }
Пример #3
0
 /**
  * @return string
  */
 public function admin()
 {
     Piwik::checkUserHasSuperUserAccess();
     $view = new View('@LoginLdap/index');
     ControllerAdmin::setBasicVariablesAdminView($view);
     if (!function_exists('ldap_connect')) {
         $notification = new Notification(Piwik::translate('LoginLdap_LdapFunctionsMissing'));
         $notification->context = Notification::CONTEXT_ERROR;
         $notification->type = Notification::TYPE_PERSISTENT;
         Notification\Manager::notify('LoginLdap_LdapFunctionsMissing', $notification);
     }
     $this->setBasicVariablesView($view);
     $serverNames = Config::getServerNameList() ?: array();
     $view->servers = array();
     if (empty($serverNames)) {
         try {
             $serverInfo = ServerInfo::makeFromOldConfig()->getProperties();
             $serverInfo['name'] = 'server';
             $view->servers[] = $serverInfo;
         } catch (Exception $ex) {
             // ignore
         }
     } else {
         foreach ($serverNames as $server) {
             $serverConfig = Config::getServerConfig($server);
             if (!empty($serverConfig)) {
                 $serverConfig['name'] = $server;
                 $view->servers[] = $serverConfig;
             }
         }
     }
     $view->ldapConfig = Config::getPluginOptionValuesWithDefaults();
     $view->isLoginControllerActivated = PluginManager::getInstance()->isPluginActivated('Login');
     $view->updatedFromPre30 = Option::get('LoginLdap_updatedFromPre3_0');
     return $view->render();
 }