From 90ccb0625d5bdeafaf852ab5c9fb25ef230778b2 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Mon, 2 Apr 2007 00:15:44 +0000 Subject: [PATCH] Port Xnet trombi and geoloc using PlSet Remove a lot of code deprecated by PlSet (XorgPlugin is dead) Fix countries in advance search form git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1652 839d8a87-29fc-0310-9880-83ba4fa771e5 --- classes/platalpage.php | 2 +- classes/plset.php | 6 +- classes/trombi.php | 74 --------------- classes/xorgplugin.php | 102 --------------------- include/geoloc.inc.php | 4 +- modules/geoloc.php | 175 ------------------------------------ modules/profile.php | 24 ----- modules/search.php | 95 ++------------------ modules/search/search.inc.php | 115 ------------------------ modules/xnetgrp.php | 13 +-- templates/geoloc/index.tpl | 108 ---------------------- templates/include/plview.geoloc.tpl | 10 +-- templates/profile/trombipromo.tpl | 71 --------------- 13 files changed, 25 insertions(+), 774 deletions(-) delete mode 100644 classes/trombi.php delete mode 100644 classes/xorgplugin.php delete mode 100644 templates/geoloc/index.tpl delete mode 100644 templates/profile/trombipromo.tpl diff --git a/classes/platalpage.php b/classes/platalpage.php index e2011dd..b0a561b 100644 --- a/classes/platalpage.php +++ b/classes/platalpage.php @@ -136,7 +136,7 @@ class PlatalPage extends Smarty } $this->assign('validate', true); - #error_reporting(0); + error_reporting(0); $result = $this->fetch($skin); $ttime = sprintf('Temps total: %.02fs - Mémoire totale : %dKo
', microtime(true) - $TIME_BEGIN , memory_get_peak_usage(true) / 1024); diff --git a/classes/plset.php b/classes/plset.php index d2267d0..9ca8d57 100644 --- a/classes/plset.php +++ b/classes/plset.php @@ -138,7 +138,11 @@ class PlSet if (is_null($view)) { return false; } - $page->changeTpl('core/plset.tpl'); + if (empty($GLOBALS['IS_XNET_SITE'])) { + $page->changeTpl('core/plset.tpl'); + } else { + new_group_open_page('core/plset.tpl'); + } $page->assign('plset_base', $baseurl); $page->assign('plset_mods', $this->mods); $page->assign('plset_mod', $this->mod); diff --git a/classes/trombi.php b/classes/trombi.php deleted file mode 100644 index 31aa528..0000000 --- a/classes/trombi.php +++ /dev/null @@ -1,74 +0,0 @@ -_get_vars = array('offset'); - parent::__construct($funcname, $prefix); - } - - public function setNbRows($row) - { $this->limit = $row*3; } - - public function setAdmin() - { $this->admin = true; } - - public function hidePromo() - { $this->showpromo = false; } - - public function show() - { - /* this point is nasty... but since show() is called from the template ... - * I can't see any more clever way to achieve that - */ - global $page; - - $offset = intval($this->get_value('offset')); - list($total, $list) = call_user_func($this->_callback, $offset, $this->limit); - $page_max = intval(($total-1)/$this->limit); - - $links = Array(); - if ($offset) { - $links[] = Array('u'=> $this->make_url($offset-1), 'i' => $offset-1, 'text' => 'précédent'); - } - for ($i = 0; $i <= $page_max ; $i++) { - $links[] = Array('u'=>$this->make_url($i), 'i' => $i, 'text' => $i+1); - } - if ($offset < $page_max) { - $links[] = Array ('u' => $this->make_url($offset+1), 'i' => $offset+1, 'text' => 'suivant'); - } - - $page->assign_by_ref('trombi_show_promo', $this->showpromo); - $page->assign_by_ref('trombi_list', $list); - $page->assign_by_ref('trombi_links', $links); - $page->assign('trombi_admin', $this->admin); - return $page->fetch('include/trombi.tpl'); - } -} - -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: -?> diff --git a/classes/xorgplugin.php b/classes/xorgplugin.php deleted file mode 100644 index 90fc62e..0000000 --- a/classes/xorgplugin.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @access public - * @since Classe available since 0.9.2 - */ -class XOrgPlugin -{ - /** have to override, contents the fields names used to drive the plugin */ - public $_get_vars = array(); - /** some polymorphism at low cost, may be used, or not */ - public $_callback; - - /** constructor. - * the constructor override $_get_vars settings by prefixing the names with $prefix - */ - public function __construct($funcname='', $prefix='') - { - $this->_callback = $funcname; - $this->_prefix = $prefix; - foreach ($this->_get_vars as $key=>$val) { - $this->_get_vars[$key] = $prefix.$val; - } - } - - /** transparent access to $_GET, wrt the right $prefix - */ - public function get_value($key) - { - return Get::v($this->_prefix.$key); - } - - /** construct an url with the given parameters to drive the plugin. - * leave all other GET params alone - */ - public function make_url($params) - { - $get = Array(); - $args = isset($params) ? $params : Array(); - - if (!is_array($args)) { - $args = array($this->_get_vars[0]=>$params); - } - - foreach ($_GET as $key=>$val) { - if ($key == 'n') { - continue; - } - if (in_array($key, $this->_get_vars) && array_key_exists($key, $args)) { - continue; - } - $get[] = urlencode($key) . '=' . urlencode($val); - } - - foreach ($this->_get_vars as $key) { - if (array_key_exists($key, $args)) { - if ($args[$key]) { - $get[] = urlencode($key) . '=' . urlencode($args[$key]); - } - } elseif (Get::has('key')) { - $get[] = urlencode($key) . '=' . urlencode(Get::v($key)); - } - } - - return pl_self() . '?' . join('&', $get); - } - - /** need to be overriden. */ - public function show() - { - return ''; - } -} - -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: -?> diff --git a/include/geoloc.inc.php b/include/geoloc.inc.php index 107a562..6a460bc 100644 --- a/include/geoloc.inc.php +++ b/include/geoloc.inc.php @@ -44,6 +44,7 @@ function geoloc_country($current, $avail_only = false) function _geoloc_country_smarty($params) { + echo "miqjfmeij"; if(!isset($params['country'])) { return; } @@ -77,10 +78,9 @@ function geoloc_region($country, $current, $avail_only = false) $regid, ($current==$regid?"selected='selected'":""), $regname); } return $html; - } -function _geoloc_region_smarty($params) +function _geoloc_region_smarty($params, &$smarty) { if(!isset($params['country']) || !isset($params['region'])) { return; diff --git a/modules/geoloc.php b/modules/geoloc.php index e4b549e..0336637 100644 --- a/modules/geoloc.php +++ b/modules/geoloc.php @@ -24,43 +24,13 @@ class GeolocModule extends PLModule function handlers() { return array( -// 'icon.swf' => $this->make_hook('icon', AUTH_COOKIE), 'geoloc' => $this->make_hook('default', AUTH_COOKIE), -// 'geoloc/icon.swf' => $this->make_hook('icon', AUTH_COOKIE), -// 'geoloc/dynamap.swf' => $this->make_hook('dynamap', AUTH_COOKIE), -// 'geoloc/init' => $this->make_hook('init', AUTH_COOKIE), -// 'geoloc/city' => $this->make_hook('city', AUTH_COOKIE), -// 'geoloc/country' => $this->make_hook('country', AUTH_COOKIE), '%grp/geoloc' => $this->make_hook('default',AUTH_COOKIE), - '%grp/geoloc/icon.swf' => $this->make_hook('icon', AUTH_COOKIE), - '%grp/geoloc/dynamap.swf'=> $this->make_hook('dynamap',AUTH_COOKIE), - '%grp/geoloc/init' => $this->make_hook('init', AUTH_COOKIE), - '%grp/geoloc/city' => $this->make_hook('city', AUTH_COOKIE), - '%grp/geoloc/country' => $this->make_hook('country',AUTH_COOKIE), 'admin/geoloc' => $this->make_hook('admin', AUTH_MDP, 'admin'), 'admin/geoloc/dynamap' => $this->make_hook('admin_dynamap', AUTH_MDP, 'admin'), ); } - function _make_qs() - { - $querystring = ""; - - foreach ($_GET as $v => $a) { - if ($v != 'initfile' && $v != 'n' && $v != 'mapid') { - $querystring .= urlencode($v).'='.urlencode($a).'&'; - } - } - - return $querystring; - } - - function use_map() - { - return is_file(dirname(__FILE__).'/geoloc/dynamap.swf') && - is_file(dirname(__FILE__).'/geoloc/icon.swf'); - } - function handler_default(&$page, $action = null, $subaction = null) { global $globals; @@ -68,151 +38,6 @@ class GeolocModule extends PLModule $set = new UserSet(); $set->addMod('geoloc', 'Geolocalisation', true); $set->apply('geoloc', $page, $action, $subaction); - return; - - if (!$this->use_map()) - $page->assign('request_geodesix', 1); - - if (!empty($GLOBALS['IS_XNET_SITE'])) { - $page->assign('no_annu', 1); - new_annu_page('geoloc/index.tpl'); - } else { - $page->changeTpl('geoloc/index.tpl'); - } - - require_once dirname(__FILE__).'/search/search.inc.php'; - - $fields = new SFieldGroup(true, advancedSearchFromInput()); - $search = str_replace('&','&',$fields->get_url()); - if ((!Env::has('only_current') && !Env::has('rechercher')) || Env::v('only_current') == 'on') - $search .= '&only_current=on'; - elseif (Env::i('only_current') != 'on') - $search .= '&only_current='; - - $search = preg_replace('/(^|&)mapid=([0-9]+)(&)/','\1\3', $search); - if ($search) - $search = '?'.$search; - $page->assign('search_nourlencode',$search); - $page->assign('search',urlencode($search)); - - $page->assign('protocole', substr($globals->baseurl,0,strpos($globals->baseurl,':'))); - - if (!$search) { - $res = XDB::query('SELECT COUNT(DISTINCT uid) - FROM adresses WHERE cityid IS NOT NULL'); - $page->assign('localises', $res->fetchOneCell()); - } - } - - function handler_icon(&$page) - { - global $globals; - - header("Content-type: application/x-shockwave-flash"); - header("Pragma:"); - - readfile(dirname(__FILE__).'/geoloc/icon.swf'); - exit; - - return PL_NOT_FOUND; - } - - function handler_dynamap(&$page) - { - global $globals; - - header("Content-type: application/x-shockwave-flash"); - - header("Pragma:"); - readfile(dirname(__FILE__).'/geoloc/dynamap.swf'); - exit; - - return PL_NOT_FOUND; - } - - function handler_init(&$page) - { - global $globals; - - $page->changeTpl('geoloc/init.tpl', NO_SKIN); - - header('Content-type: text/xml'); - header('Pragma:'); - if(!empty($GLOBALS['IS_XNET_SITE'])) - $page->assign('background', 0xF2E9D0); - $page->assign('querystring', $this->_make_qs()); - } - - function handler_city(&$page) - { - global $globals; - - header("Content-type: text/xml"); - header("Pragma:"); - - $page->changeTpl('geoloc/city.tpl', NO_SKIN); - - require_once dirname(__FILE__).'/search/search.inc.php'; - require_once('geoloc.inc.php'); - - if (empty($GLOBALS['IS_XNET_SITE'])) { - $usual_fields = advancedSearchFromInput(); - $fields = new SFieldGroup(true, $usual_fields); - } else { - $_REQUEST['asso_id'] = $globals->asso('id'); - $_REQUEST['only_current'] = 'on'; - $fields = new SFieldGroup(true, array( - new RefSField('asso_id',array('gxm.asso_id'),'groupex.membres','gxm','u.user_id=gxm.uid'), - new RefSField('cityid',array('av.cityid'),'adresses','av',getadr_join('av')))); - } - $where = $fields->get_where_statement(); - if ($where) $where = "WHERE ".$where; - - $users = XDB::iterator(" - SELECT u.user_id AS id, u.prenom, u.nom, u.promo, alias - FROM adresses AS a - INNER JOIN auth_user_md5 AS u ON(u.user_id = a.uid) - INNER JOIN auth_user_quick AS q ON(q.user_id = a.uid) - LEFT JOIN aliases ON(u.user_id = aliases.id AND FIND_IN_SET(aliases.flags,'bestalias')) - ".$fields->get_select_statement()." - ".$where." - GROUP BY u.user_id LIMIT 11", $id); - - $page->assign('users', $users); - } - - function handler_country(&$page) - { - global $globals; - - // to debug sql use the next line - if (Env::has('debug')) { - $page->changeTpl('geoloc/country.tpl', SIMPLE); - } else { - header("Content-type: text/xml"); - header("Pragma:"); - $page->changeTpl('geoloc/country.tpl', NO_SKIN); - } - - require_once dirname(__FILE__).'/search/search.inc.php'; - require_once 'geoloc.inc.php'; - - $querystring = $this->_make_qs(); - $page->assign('searchvars', $querystring); - - $mapid = Env::has('mapid') ? Env::i('mapid', -2) : false; - if (empty($GLOBALS['IS_XNET_SITE'])) { - $fields = advancedSearchFromInput(); - } else { - $_REQUEST['asso_id'] = $globals->asso('id'); - $_REQUEST['only_current'] = 'on'; - $fields = array(new RefSField('asso_id',array('gxm.asso_id'),'groupex.membres','gxm','u.user_id=gxm.uid')); - } - - list($countries, $cities) = geoloc_getData_subcountries($mapid, $fields, 10); - - $page->assign('countries', $countries); - $page->assign('cities', $cities); } function handler_admin(&$page, $action = false) { diff --git a/modules/profile.php b/modules/profile.php index a7bc193..c47b3e6 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -37,7 +37,6 @@ class ProfileModule extends PLModule 'referent' => $this->make_hook('referent', AUTH_COOKIE), 'referent/search' => $this->make_hook('ref_search', AUTH_COOKIE), - 'trombi' => $this->make_hook('trombi', AUTH_COOKIE), 'groupes-x' => $this->make_hook('xnet', AUTH_COOKIE), 'vcard' => $this->make_hook('vcard', AUTH_COOKIE), @@ -664,29 +663,6 @@ class ProfileModule extends PLModule } } - function handler_trombi(&$page, $promo = null) - { - $page->changeTpl('profile/trombipromo.tpl'); - $page->assign('xorg_title', 'Polytechnique.org - Trombi Promo'); - - if (is_null($promo)) { - return; - } - - $this->promo = $promo = intval($promo); - - if ($promo >= 1900 && ($promo < intval(date('Y')) || ($promo == intval(date('Y')) && intval(date('m')) >= 9)) - || ($promo == -1 && S::has_perms())) - { - $trombi = new Trombi(array($this, '_trombi_getlist')); - $trombi->hidePromo(); - $trombi->setAdmin(); - $page->assign_by_ref('trombi', $trombi); - } else { - $page->trig('Promotion incorrecte (saisir au format YYYY). Recommence.'); - } - } - function handler_xnet(&$page) { $page->changeTpl('profile/groupesx.tpl'); diff --git a/modules/search.php b/modules/search.php index 2f281f5..2847322 100644 --- a/modules/search.php +++ b/modules/search.php @@ -46,48 +46,6 @@ class SearchModule extends PLModule user_reindex($uid); } - function get_quick($offset, $limit, $order) - { - global $globals; - if (!S::logged()) { - Env::kill('with_soundex'); - } - $qSearch = new QuickSearch('quick'); - $fields = new SFieldGroup(true, array($qSearch)); - - if ($qSearch->isempty()) { - new ThrowError('Recherche trop générale.'); - } - - $sql = 'SELECT SQL_CALC_FOUND_ROWS - UPPER(IF(u.nom!="",u.nom,u.nom_ini)) AS nom, - IF(u.prenom!="",u.prenom,u.prenom_ini) AS prenom, - '.$globals->search->result_fields.' - c.uid AS contact, w.ni_id AS watch, - '.$qSearch->get_score_statement().' - FROM auth_user_md5 AS u - '.$fields->get_select_statement().' - LEFT JOIN auth_user_quick AS q ON (u.user_id = q.user_id) - LEFT JOIN aliases AS a ON (u.user_id = a.id AND a.type="a_vie") - LEFT JOIN contacts AS c ON (c.uid='.S::i('uid', -1).' - AND c.contact=u.user_id) - LEFT JOIN watch_nonins AS w ON (w.ni_id=u.user_id - AND w.uid='.S::i('uid', -1).') - '.$globals->search->result_where_statement.' - WHERE '.$fields->get_where_statement() - .(S::logged() && Env::has('nonins') ? ' AND u.perms="pending" AND u.deces=0' : '') - .' - GROUP BY u.user_id - ORDER BY '.($order?($order.', '):'') - .implode(',',array_filter(array($fields->get_order_statement(), - 'u.promo DESC, NomSortKey, prenom'))).' - LIMIT '.$offset * $globals->search->per_page.',' - .$globals->search->per_page; - $list = XDB::iterator($sql); - $res = XDB::query("SELECT FOUND_ROWS()"); - $nb_tot = $res->fetchOneCell(); - return array($list, $nb_tot); - } function form_prepare() { @@ -123,48 +81,6 @@ class SearchModule extends PLModule $page->assign('choix_diplomas', explode(',',$types)); } - function get_advanced($offset, $limit, $order) - { - $fields = new SFieldGroup(true, advancedSearchFromInput()); - if ($fields->too_large()) { - $this->form_prepare(); - new ThrowError('Recherche trop générale.'); - } - global $globals, $page; - - $page->assign('search_vars', $fields->get_url()); - - $where = $fields->get_where_statement(); - if ($where) { - $where = "WHERE $where"; - } - $sql = 'SELECT SQL_CALC_FOUND_ROWS DISTINCT - u.nom, u.prenom, - '.$globals->search->result_fields.' - c.uid AS contact, - w.ni_id AS watch - FROM auth_user_md5 AS u - LEFT JOIN auth_user_quick AS q USING(user_id) - '.$fields->get_select_statement().' - '.(Env::has('only_referent') ? ' INNER JOIN mentor AS m ON (m.uid = u.user_id)' : '').' - LEFT JOIN aliases AS a ON (u.user_id = a.id AND a.type="a_vie") - LEFT JOIN contacts AS c ON (c.uid='.S::v('uid').' - AND c.contact=u.user_id) - LEFT JOIN watch_nonins AS w ON (w.ni_id=u.user_id - AND w.uid='.S::v('uid').') - '.$globals->search->result_where_statement." - $where - GROUP BY u.user_id - ORDER BY ".($order?($order.', '):'') - .implode(',',array_filter(array($fields->get_order_statement(), - 'promo DESC, NomSortKey, prenom'))).' - LIMIT '.($offset * $limit).','.$limit; - $liste = XDB::iterator($sql); - $res = XDB::query("SELECT FOUND_ROWS()"); - $nb_tot = $res->fetchOneCell(); - return Array($liste, $nb_tot); - } - function handler_quick(&$page, $action = null, $subaction = null) { global $globals; @@ -201,15 +117,17 @@ class SearchModule extends PLModule $page->addJsLink('ajax.js'); } + require_once dirname(__FILE__) . '/search/search.inc.php'; $page->changeTpl('search/index.tpl'); $page->assign('xorg_title','Polytechnique.org - Annuaire'); $page->assign('baseurl', $globals->baseurl); + $page->register_modifier('display_lines', 'display_lines'); } - function handler_advanced(&$page, $mode = null) + function handler_advanced(&$page, $action = null, $subaction = null) { global $globals; - if (!Env::has('rechercher')) { + if (!Env::has('rechercher') && $action != 'geoloc') { $this->form_prepare(); } else { require_once 'userset.inc.php'; @@ -229,10 +147,13 @@ class SearchModule extends PLModule } } - $page->changeTpl('search/index.tpl', $mode == 'mini' ? SIMPLE : SKINNED); + require_once 'geoloc.inc.php'; + require_once dirname(__FILE__) . '/search/search.inc.php'; + $page->changeTpl('search/index.tpl', $action == 'mini' ? SIMPLE : SKINNED); $page->addJsLink('ajax.js'); $page->assign('advanced',1); $page->assign('public_directory',0); + $page->register_modifier('display_lines', 'display_lines'); } function handler_region(&$page, $country = null) diff --git a/modules/search/search.inc.php b/modules/search/search.inc.php index dcbf7aa..eae0a04 100644 --- a/modules/search/search.inc.php +++ b/modules/search/search.inc.php @@ -74,120 +74,5 @@ function advancedSearchFromInput() // }}} -// {{{ class XOrgSearch - -class XOrgSearch extends XOrgPlugin -{ - // {{{ properties - - var $_get_vars = Array('offset', 'order', 'order_inv', 'rechercher'); - var $limit = 20; - var $order_defaut = 'promo'; - // type of orders : (field name, default ASC, text name, auth) - var $orders = array( - 'nom' =>array('nom,prenom', true, 'nom', AUTH_PUBLIC), - 'promo' =>array('promo,nom', false, 'promotion', AUTH_PUBLIC), - 'date_mod' =>array('u.date,nom', false, 'dernière modification', AUTH_COOKIE) - ); - - // }}} - // {{{ function setNbLines() - - function setNbLines($lines) - { $this->limit = $lines; } - - // }}} - // {{{ function setAuth() - - function setAuth() - { - foreach ($this->orders as $key=>$o) { - if ($o[3] == AUTH_COOKIE) { - $this->orders[$key][3] = S::logged(); - } elseif ($o[3] == AUTH_PUBLIC) { - $this->orders[$key][3] = true; - } else { - $this->orders[$key][3] = S::identified(); - } - } - } - - // }}} - // {{{ function addOrder() - - function addOrder($name, $field, $inv_order, $text, $auth, $defaut=false) - { - // reverse the array, to get the defaut order first - if ($defaut) - $this->orders = array_reverse($this->orders); - $this->orders[$name] = array($field, $inv_order, $text, $auth); - if ($defaut) { - $this->orders = array_reverse($this->orders); - $this->order_defaut = $name; - } - } - - // }}} - // {{{ function show() - - function show() - { - $this->setAuth(); - global $page, $globals; - - $offset = intval($this->get_value('offset')); - $tab = @$this->orders[$this->get_value('order')]; - if (!$tab || !$tab[3]) { - $tab = $this->orders[$this->order_defaut]; - } - $order = $tab[0]; - $order_inv = ($this->get_value('order_inv') != '') == $tab[1]; - - if ($order_inv && $order) - $sql_order = str_replace(",", " DESC,", $order)." DESC"; - else $sql_order = $order; - - list($list, $total) = call_user_func($this->_callback, $offset, $this->limit, $sql_order); - - $page_max = intval(($total-1)/$this->limit); - if(!S::logged() && $page_max > $globals->search->public_max) - $page_max = $globals->search->public_max; - - $links = Array(); - if ($offset) { - $links[] = Array('u'=> $this->make_url(Array('offset'=>$offset-1)), 'i' => $offset-1, 'text' => 'précédent'); - } - for ($i = 0; $i <= $page_max ; $i++) { - $links[] = Array('u'=>$this->make_url(Array('offset'=>$i)), 'i' => $i, 'text' => $i+1); - } - if ($offset < $page_max) { - $links[] = Array ('u' => $this->make_url(Array('offset'=>$offset+1)), 'i' => $offset+1, 'text' => 'suivant'); - } - - $page->assign('search_results', $list); - $page->assign('search_results_nb', $total); - $page->assign('search_page', $offset); - $page->assign('search_pages_nb', $page_max+1); - $page->assign('search_pages_link', $links); - - $order_links = Array(); - foreach ($this->orders as $key=>$o) if ($o[3]) { - $order_links[] = Array( - "text" => $o[2], - "url" => $this->make_url(Array('order' => $key, 'order_inv' => ($o[0] == $order) && ($order_inv != $o[1]))), - "asc" => ($o[0] == $order) && $order_inv, - "desc" => ($o[0] == $order) && !$order_inv - ); - } - $page->assign('search_order_link', $order_links); - - return $total; - } - - // }}} -} - -// }}} - // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?> diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 4115206..9fcfd9f 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -428,16 +428,11 @@ class XnetGrpModule extends PLModule $page->jsonAssign('ann', $ann); } - function handler_trombi(&$page, $num = 1) + function handler_trombi(&$page, $action = null, $subaction = null) { - global $globals; - new_annu_page('xnetgrp/trombi.tpl'); - - $page->assign('urlmainsite', "https://www.polytechnique.org/"); - $trombi = new Trombi(array($this, '_trombi_getlist')); - $trombi->hidePromo(); - $trombi->setAdmin(); - $page->assign_by_ref('trombi', $trombi); + $view = new UserSet(); + $view->addMod('trombi', 'Trombinoscope', true, array('with_admin' => false, 'with_promo' => true)); + $view->apply('trombi', $page, 'trombi', $action, $subaction); } function _trombi_getlist($offset, $limit) diff --git a/templates/geoloc/index.tpl b/templates/geoloc/index.tpl deleted file mode 100644 index 655aa71..0000000 --- a/templates/geoloc/index.tpl +++ /dev/null @@ -1,108 +0,0 @@ -{**************************************************************************} -{* *} -{* Copyright (C) 2003-2007 Polytechnique.org *} -{* http://opensource.polytechnique.org/ *} -{* *} -{* This program is free software; you can redistribute it and/or modify *} -{* it under the terms of the GNU General Public License as published by *} -{* the Free Software Foundation; either version 2 of the License, or *} -{* (at your option) any later version. *} -{* *} -{* This program is distributed in the hope that it will be useful, *} -{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} -{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} -{* GNU General Public License for more details. *} -{* *} -{* You should have received a copy of the GNU General Public License *} -{* along with this program; if not, write to the Free Software *} -{* Foundation, Inc., *} -{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} -{* *} -{**************************************************************************} - -

Géolocalisation

- - -{if $localises} -

- Aujourd'hui {$localises} de nos camarades sont localisés grâce à leurs adresses personnelles. -

-{/if} -{if !$request_geodesix} -

- - - - - - - - -

-

Carte fournie gracieusement par Geodesix.

- {if !$no_annu} -
-

- -

-
- {/if} -{else} -

Le moteur de carte n'a pas été installé sur cette version de plat/al. Veuillez contacter Geodesix.

-{/if} -

Pour toute question, problème ou suggestion tu peux envoyer un mail à geoloc@staff.polytechnique.org

- -{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/include/plview.geoloc.tpl b/templates/include/plview.geoloc.tpl index 141e4d1..2c6bc57 100644 --- a/templates/include/plview.geoloc.tpl +++ b/templates/include/plview.geoloc.tpl @@ -60,7 +60,7 @@ function searchMapId(f) {if $smarty.request.only_current neq 'on'}

- [Ne voir que les adresses principales] + [Ne voir que les adresses principales]

{/if} @@ -71,13 +71,13 @@ function searchMapId(f) width="600" height="450" align="middle"> - + - + - Trombinoscope promo - -

-Cette page te permet de voir l'album photo d'une promotion -donnée. -

-

-Fais attention, si tu as une connexion à internet lente (par -exemple si tu es sur un vieux modem), la page que tu vas télécharger -en validant peut être longue à afficher. -

- -
- - - - - - - - -
- Trombinoscope -
- Promotion - - - -
-
- -{if $trombi} - -

- Album photo - {if $platal->argv[1] eq -1} - {#globals.core.sitename#} - {else} - promotion {$platal->argv[1]} - {/if} -

- -{$trombi->show()|smarty:nodefaults} - -{/if} - -{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} -- 2.1.4