當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SettingsPiwik::getWebsitesCountToDisplay方法代碼示例

本文整理匯總了PHP中Piwik\SettingsPiwik::getWebsitesCountToDisplay方法的典型用法代碼示例。如果您正苦於以下問題:PHP SettingsPiwik::getWebsitesCountToDisplay方法的具體用法?PHP SettingsPiwik::getWebsitesCountToDisplay怎麽用?PHP SettingsPiwik::getWebsitesCountToDisplay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Piwik\SettingsPiwik的用法示例。


在下文中一共展示了SettingsPiwik::getWebsitesCountToDisplay方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getPatternMatchSites

 public function getPatternMatchSites($pattern)
 {
     $ids = $this->getSitesIdWithAtLeastViewAccess();
     if (empty($ids)) {
         return array();
     }
     $ids_str = '';
     foreach ($ids as $id_val) {
         $ids_str .= $id_val . ' , ';
     }
     $ids_str .= $id_val;
     $db = Db::get();
     $bind = array('%' . $pattern . '%', 'http%' . $pattern . '%', '%' . $pattern . '%');
     // Also match the idsite
     $where = '';
     if (is_numeric($pattern)) {
         $bind[] = $pattern;
         $where = 'OR  s.idsite = ?';
     }
     $sites = $db->fetchAll("SELECT idsite, name, main_url, `group`\n\t\t\t\t\t\t\t\tFROM " . Common::prefixTable('site') . " s\n\t\t\t\t\t\t\t\tWHERE (\t\ts.name like ?\n\t\t\t\t\t\t\t\t\t\tOR \ts.main_url like ?\n\t\t\t\t\t\t\t\t\t\tOR \ts.`group` like ?\n\t\t\t\t\t\t\t\t\t\t {$where} )\n\t\t\t\t\t\t\t\t\tAND idsite in ({$ids_str})\n\t\t\t\t\t\t\t\tLIMIT " . SettingsPiwik::getWebsitesCountToDisplay(), $bind);
     return $sites;
 }
開發者ID:a4tunado,項目名稱:piwik,代碼行數:22,代碼來源:API.php

示例2: getPatternMatchSites

 public function getPatternMatchSites($pattern)
 {
     $ids = $this->getSitesIdWithAtLeastViewAccess();
     if (empty($ids)) {
         return array();
     }
     $limit = SettingsPiwik::getWebsitesCountToDisplay();
     $sites = $this->getModel()->getPatternMatchSites($ids, $pattern, $limit);
     return $sites;
 }
開發者ID:CaptainSharf,項目名稱:SSAD_Project,代碼行數:10,代碼來源:API.php

示例3: getSitesIdFromPattern

 /**
  * Fetches the list of sites which names match the string pattern
  *
  * @param string $pattern
  * @param bool   $_restrictSitesToLogin
  * @return array|string
  */
 private function getSitesIdFromPattern($pattern, $_restrictSitesToLogin)
 {
     // First clear cache
     Site::clearCache();
     if (empty($pattern)) {
         /** @var Scheduler $scheduler */
         $scheduler = StaticContainer::getContainer()->get('Piwik\\Scheduler\\Scheduler');
         // Then, warm the cache with only the data we should have access to
         if (Piwik::hasUserSuperUserAccess() && !$scheduler->isRunningTask()) {
             APISitesManager::getInstance()->getAllSites();
         } else {
             APISitesManager::getInstance()->getSitesWithAtLeastViewAccess($limit = false, $_restrictSitesToLogin);
         }
     } else {
         $sites = Request::processRequest('SitesManager.getPatternMatchSites', array('pattern' => $pattern, 'limit' => SettingsPiwik::getWebsitesCountToDisplay(), 'showColumns' => '', 'hideColumns' => '', 'format' => 'original'));
         if (!empty($sites)) {
             Site::setSitesFromArray($sites);
         }
     }
     // Both calls above have called Site::setSitesFromArray. We now get these sites:
     $sitesToProblablyAdd = Site::getSites();
     return $sitesToProblablyAdd;
 }
開發者ID:JoeHorn,項目名稱:piwik,代碼行數:30,代碼來源:API.php

示例4: getNumWebsitesToDisplayPerPage

 /**
  * Returns the number of websites to display per page.
  *
  * For example this is used in the All Websites Dashboard, in the Website Selector etc. If multiple websites are
  * shown somewhere, one should request this method to detect how many websites should be shown per page when
  * using paging. To use paging is always recommended since some installations have thousands of websites.
  *
  * @return int
  */
 public function getNumWebsitesToDisplayPerPage()
 {
     Piwik::checkUserHasSomeViewAccess();
     return SettingsPiwik::getWebsitesCountToDisplay();
 }
開發者ID:annaduraig,項目名稱:piwik,代碼行數:14,代碼來源:API.php

示例5: render

 /**
  * Renders the current view. Also sends the stored 'Content-Type' HTML header.
  * See {@link setContentType()}.
  *
  * @return string Generated template.
  */
 public function render()
 {
     try {
         $this->currentModule = Piwik::getModule();
         $this->currentAction = Piwik::getAction();
         $userLogin = Piwik::getCurrentUserLogin();
         $this->userLogin = $userLogin;
         $count = SettingsPiwik::getWebsitesCountToDisplay();
         $sites = APISitesManager::getInstance()->getSitesWithAtLeastViewAccess($count);
         usort($sites, function ($site1, $site2) {
             return strcasecmp($site1["name"], $site2["name"]);
         });
         $this->sites = $sites;
         $this->url = Common::sanitizeInputValue(Url::getCurrentUrl());
         $this->token_auth = Piwik::getCurrentUserTokenAuth();
         $this->userHasSomeAdminAccess = Piwik::isUserHasSomeAdminAccess();
         $this->userIsSuperUser = Piwik::isUserIsSuperUser();
         $this->latest_version_available = UpdateCheck::isNewestVersionAvailable();
         $this->disableLink = Common::getRequestVar('disableLink', 0, 'int');
         $this->isWidget = Common::getRequestVar('widget', 0, 'int');
         if (Config::getInstance()->General['autocomplete_min_sites'] <= count($sites)) {
             $this->show_autocompleter = true;
         } else {
             $this->show_autocompleter = false;
         }
         $this->loginModule = Piwik::getLoginPluginName();
         $user = APIUsersManager::getInstance()->getUser($userLogin);
         $this->userAlias = $user['alias'];
     } catch (Exception $e) {
         // can fail, for example at installation (no plugin loaded yet)
     }
     try {
         $this->totalTimeGeneration = Registry::get('timer')->getTime();
         $this->totalNumberOfQueries = Profiler::getQueryCount();
     } catch (Exception $e) {
         $this->totalNumberOfQueries = 0;
     }
     ProxyHttp::overrideCacheControlHeaders('no-store');
     @header('Content-Type: ' . $this->contentType);
     // always sending this header, sometimes empty, to ensure that Dashboard embed loads (which could call this header() multiple times, the last one will prevail)
     @header('X-Frame-Options: ' . (string) $this->xFrameOptions);
     return $this->renderTwigTemplate();
 }
開發者ID:KiwiJuicer,項目名稱:handball-dachau,代碼行數:49,代碼來源:View.php


注:本文中的Piwik\SettingsPiwik::getWebsitesCountToDisplay方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。