original_string: public function userSettings()
      {
          Piwik::checkUserIsNotAnonymous();
  
          $view = new View('@UsersManager/userSettings');
  
          $userLogin = Piwik::getCurrentUserLogin();
          $user = Request::processRequest('UsersManager.getUser', array('userLogin' => $userLogin));
          $view->userEmail = $user['email'];
          $view->userTokenAuth = Piwik::getCurrentUserTokenAuth();
          $view->ignoreSalt = $this->getIgnoreCookieSalt();
  
          $userPreferences = new UserPreferences();
          $defaultReport   = $userPreferences->getDefaultReport();
  
          if ($defaultReport === false) {
              $defaultReport = $userPreferences->getDefaultWebsiteId();
          }
  
          $view->defaultReport = $defaultReport;
  
          if ($defaultReport == 'MultiSites') {
  
              $defaultSiteId = $userPreferences->getDefaultWebsiteId();
              $reportOptionsValue = $defaultSiteId;
  
              $view->defaultReportIdSite   = $defaultSiteId;
              $view->defaultReportSiteName = Site::getNameFor($defaultSiteId);
          } else {
              $reportOptionsValue = $defaultReport;
              $view->defaultReportIdSite   = $defaultReport;
              $view->defaultReportSiteName = Site::getNameFor($defaultReport);
          }
  
          $view->defaultReportOptions = array(
              array('key' => 'MultiSites', 'value' => Piwik::translate('General_AllWebsitesDashboard')),
              array('key' => $reportOptionsValue, 'value' => Piwik::translate('General_DashboardForASpecificWebsite')),
          );
  
          $view->defaultDate = $this->getDefaultDateForUser($userLogin);
          $view->availableDefaultDates = $this->getDefaultDates();
  
          $languages = APILanguagesManager::getInstance()->getAvailableLanguageNames();
          $languageOptions = array();
          foreach ($languages as $language) {
              $languageOptions[] = array(
                  'key' => $language['code'],
                  'value' => $language['name']
              );
          }
  
          $view->languageOptions = $languageOptions;
          $view->currentLanguageCode = LanguagesManager::getLanguageCodeForCurrentUser();
          $view->currentTimeformat = (int) LanguagesManager::uses12HourClockForCurrentUser();
          $view->ignoreCookieSet = IgnoreCookie::isIgnoreCookieFound();
          $view->piwikHost = Url::getCurrentHost();
          $this->setBasicVariablesView($view);
  
          $view->timeFormats = array(
              '1' => Piwik::translate('General_12HourClock'),
              '0' => Piwik::translate('General_24HourClock')
          );
  
          return $view->render();
      }
code: public function userSettings()
      {
          Piwik::checkUserIsNotAnonymous();
  
          $view = new View('@UsersManager/userSettings');
  
          $userLogin = Piwik::getCurrentUserLogin();
          $user = Request::processRequest('UsersManager.getUser', array('userLogin' => $userLogin));
          $view->userEmail = $user['email'];
          $view->userTokenAuth = Piwik::getCurrentUserTokenAuth();
          $view->ignoreSalt = $this->getIgnoreCookieSalt();
  
          $userPreferences = new UserPreferences();
          $defaultReport   = $userPreferences->getDefaultReport();
  
          if ($defaultReport === false) {
              $defaultReport = $userPreferences->getDefaultWebsiteId();
          }
  
          $view->defaultReport = $defaultReport;
  
          if ($defaultReport == 'MultiSites') {
  
              $defaultSiteId = $userPreferences->getDefaultWebsiteId();
              $reportOptionsValue = $defaultSiteId;
  
              $view->defaultReportIdSite   = $defaultSiteId;
              $view->defaultReportSiteName = Site::getNameFor($defaultSiteId);
          } else {
              $reportOptionsValue = $defaultReport;
              $view->defaultReportIdSite   = $defaultReport;
              $view->defaultReportSiteName = Site::getNameFor($defaultReport);
          }
  
          $view->defaultReportOptions = array(
              array('key' => 'MultiSites', 'value' => Piwik::translate('General_AllWebsitesDashboard')),
              array('key' => $reportOptionsValue, 'value' => Piwik::translate('General_DashboardForASpecificWebsite')),
          );
  
          $view->defaultDate = $this->getDefaultDateForUser($userLogin);
          $view->availableDefaultDates = $this->getDefaultDates();
  
          $languages = APILanguagesManager::getInstance()->getAvailableLanguageNames();
          $languageOptions = array();
          foreach ($languages as $language) {
              $languageOptions[] = array(
                  'key' => $language['code'],
                  'value' => $language['name']
              );
          }
  
          $view->languageOptions = $languageOptions;
          $view->currentLanguageCode = LanguagesManager::getLanguageCodeForCurrentUser();
          $view->currentTimeformat = (int) LanguagesManager::uses12HourClockForCurrentUser();
          $view->ignoreCookieSet = IgnoreCookie::isIgnoreCookieFound();
          $view->piwikHost = Url::getCurrentHost();
          $this->setBasicVariablesView($view);
  
          $view->timeFormats = array(
              '1' => Piwik::translate('General_12HourClock'),
              '0' => Piwik::translate('General_24HourClock')
          );
  
          return $view->render();
      }
code_tokens: public function userSettings ( ) { Piwik :: checkUserIsNotAnonymous ( ) ; $ view = new View ( '@UsersManager/userSettings' ) ; $ userLogin = Piwik :: getCurrentUserLogin ( ) ; $ user = Request :: processRequest ( 'UsersManager.getUser' , array ( 'userLogin' => $ userLogin ) ) ; $ view -> userEmail = $ user [ 'email' ] ; $ view -> userTokenAuth = Piwik :: getCurrentUserTokenAuth ( ) ; $ view -> ignoreSalt = $ this -> getIgnoreCookieSalt ( ) ; $ userPreferences = new UserPreferences ( ) ; $ defaultReport = $ userPreferences -> getDefaultReport ( ) ; if ( $ defaultReport === false ) { $ defaultReport = $ userPreferences -> getDefaultWebsiteId ( ) ; } $ view -> defaultReport = $ defaultReport ; if ( $ defaultReport == 'MultiSites' ) { $ defaultSiteId = $ userPreferences -> getDefaultWebsiteId ( ) ; $ reportOptionsValue = $ defaultSiteId ; $ view -> defaultReportIdSite = $ defaultSiteId ; $ view -> defaultReportSiteName = Site :: getNameFor ( $ defaultSiteId ) ; } else { $ reportOptionsValue = $ defaultReport ; $ view -> defaultReportIdSite = $ defaultReport ; $ view -> defaultReportSiteName = Site :: getNameFor ( $ defaultReport ) ; } $ view -> defaultReportOptions = array ( array ( 'key' => 'MultiSites' , 'value' => Piwik :: translate ( 'General_AllWebsitesDashboard' ) ) , array ( 'key' => $ reportOptionsValue , 'value' => Piwik :: translate ( 'General_DashboardForASpecificWebsite' ) ) , ) ; $ view -> defaultDate = $ this -> getDefaultDateForUser ( $ userLogin ) ; $ view -> availableDefaultDates = $ this -> getDefaultDates ( ) ; $ languages = APILanguagesManager :: getInstance ( ) -> getAvailableLanguageNames ( ) ; $ languageOptions = array ( ) ; foreach ( $ languages as $ language ) { $ languageOptions [ ] = array ( 'key' => $ language [ 'code' ] , 'value' => $ language [ 'name' ] ) ; } $ view -> languageOptions = $ languageOptions ; $ view -> currentLanguageCode = LanguagesManager :: getLanguageCodeForCurrentUser ( ) ; $ view -> currentTimeformat = ( int ) LanguagesManager :: uses12HourClockForCurrentUser ( ) ; $ view -> ignoreCookieSet = IgnoreCookie :: isIgnoreCookieFound ( ) ; $ view -> piwikHost = Url :: getCurrentHost ( ) ; $ this -> setBasicVariablesView ( $ view ) ; $ view -> timeFormats = array ( '1' => Piwik :: translate ( 'General_12HourClock' ) , '0' => Piwik :: translate ( 'General_24HourClock' ) ) ; return $ view -> render ( ) ; }
docstring: The "User Settings" admin UI screen view
docstring_tokens: The User Settings admin UI screen view