private function injectNewCity ($domain) { if (! $domain) return; $used = CLUtil::getUsedCities (); $found = array_search ($domain, $used); if ($found === false) { $used[] = $domain; sort ($used); $this->cities = $used; CLUtil::cookieDomains ($used); } }
protected function setupVars () { $this->searchOptions = new Stub; $this->searchOptions->cities = CLUtil::getUsedCities (); }
protected function getSearchOptions () { return CLUtil::getSearchOptions ($this->searchType, $_GET['q'], $this->getPage (), CLUtil::getUsedCities()); }
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/container/container-min.js"></script> <div id="cityDialog"> <div class="hd">Pick Which Cities You Wanna Search</div> <div class="bd"> <form name="cityDialogForm" method="POST" action="/ajax/saveCityConfig"> <div class="controls"> <a id="cityDialogCheckAll" href="javascript: checkAll ('cityDialogForm', 'cityDialogCheckAll')">select all</a> <a href="javascript: checkDefault ()">restore default</a><br /> </div> <div class="cityHolder"> <? $allCities = CLUtil::getAllCities (); $usedCities = CLUtil::getUsedCities (); $defaultCities = CLUtil::getDefaultCities (); foreach ($allCities as $domain => $label) { $sel = (array_search ($domain, $usedCities) !== false) ? 'checked="true"' : ''; $class = ($defaultCities[$domain]) ? 'bold' : ''; echo "<div class=\"dialogCity\">", "<input type=\"checkbox\" id=\"cityDialog_{$domain}\" name=\"city[$domain]\" value=\"$domain\" $sel> ", "<label class=\"{$class}\" for=\"cityDialog_{$domain}\">{$label}</label>", "</div>"; } ?> <br class="clear" /> </div>