X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fuserset.inc.php;h=be9e74092b19f340b8a1ab1fda04edb0a3b1a817;hb=2aa2c77aef77e0bfba275dfcb3b257a8f8d66ef1;hp=5251d4475758bfc654797ab2b491c7db58cf5dd0;hpb=d6eb05548595574ca9b970cd181ae270cfcb3fb9;p=platal.git diff --git a/include/userset.inc.php b/include/userset.inc.php index 5251d44..be9e740 100644 --- a/include/userset.inc.php +++ b/include/userset.inc.php @@ -367,102 +367,6 @@ class TrombiView extends MultipageView } } -class GeolocView implements PlView -{ - private $set; - private $type; - private $params; - - public function __construct(PlSet &$set, $data, array $params) - { - $this->params = $params; - $this->set =& $set; - $this->type = $data; - } - - private function use_map() - { - return is_file(dirname(__FILE__) . '/../modules/geoloc/dynamap.swf') && - is_file(dirname(__FILE__) . '/../modules/geoloc/icon.swf'); - } - - public function args() - { - $args = $this->set->args(); - unset($args['initfile']); - unset($args['mapid']); - return $args; - } - - public function apply(PlPage &$page) - { - require_once 'geoloc.inc.php'; - require_once '../modules/search/search.inc.php'; - - switch ($this->type) { - case 'icon.swf': - header("Content-type: application/x-shockwave-flash"); - header("Pragma:"); - readfile(dirname(__FILE__).'/../modules/geoloc/icon.swf'); - exit; - - case 'dynamap.swf': - header("Content-type: application/x-shockwave-flash"); - header("Pragma:"); - readfile(dirname(__FILE__).'/../modules/geoloc/dynamap.swf'); - exit; - - case 'init': - $page->changeTpl('geoloc/init.tpl', NO_SKIN); - header('Content-Type: text/xml'); - header('Pragma:'); - if (!empty($GLOBALS['IS_XNET_SITE'])) { - $page->assign('background', 0xF2E9D0); - } - break; - - case 'city': - $page->changeTpl('geoloc/city.tpl', NO_SKIN); - header('Content-Type: text/xml'); - header('Pragma:'); - $only_current = Env::v('only_current', false)? ' AND FIND_IN_SET(\'current\', adrf.flags)' : ''; - $it =& $this->set->get('u.user_id AS id, u.prenom, u.nom, d.promo, al.alias', - "INNER JOIN profile-addresses AS adrf ON (adrf.pid = u.user_id $only_current) - INNER JOIN profile_display AS d ON (d.pid = u.user_id) - LEFT JOIN aliases AS al ON (u.user_id = al.id - AND FIND_IN_SET('bestalias', al.flags)) - INNER JOIN profile_addresses AS avg ON (" . getadr_join('avg') . ")", - 'adrf.localityId = ' . Env::i('cityid'), null, null, 11); - $page->assign('users', $it); - break; - - case 'country': - if (Env::has('debug')) { - $page->changeTpl('geoloc/country.tpl', SIMPLE); - } else { - $page->changeTpl('geoloc/country.tpl', NO_SKIN); - header('Content-Type: text/xml'); - header('Pragma:'); - } - $mapid = Env::has('mapid') ? Env::i('mapid', -2) : false; - list($countries, $cities) = geoloc_getData_subcountries($mapid, $this->set, 10); - $page->assign('countries', $countries); - $page->assign('cities', $cities); - break; - - default: - global $globals; - if (!$this->use_map()) { - $page->assign('request_geodesix', true); - } - $page->assign('annu', @$this->params['with_annu']); - $page->assign('protocole', @$_SERVER['HTTPS'] ? 'https' : 'http'); - $this->set->get('u.user_id', null, "u.perms != 'pending' AND u.deces = 0", "u.user_id", null); - return 'include/plview.geoloc.tpl'; - } - } -} - class GadgetView implements PlView { public function __construct(PlSet &$set, $data, array $params)