Piwik\SettingsPiwik::getWebsitesCountToDisplay PHP Method

getWebsitesCountToDisplay() public static method

Number of websites to show in the Website selector
public static getWebsitesCountToDisplay ( ) : integer
return integer
    public static function getWebsitesCountToDisplay()
    {
        $count = max(Config::getInstance()->General['site_selector_max_sites'], Config::getInstance()->General['autocomplete_min_sites']);
        return (int) $count;
    }

Usage Example

Esempio n. 1
0
 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;
 }
All Usage Examples Of Piwik\SettingsPiwik::getWebsitesCountToDisplay