From: x2000habouzit Date: Sun, 22 Oct 2006 22:56:06 +0000 (+0000) Subject: less and less global includes \o/ X-Git-Tag: xorg/0.9.12~172 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=abc680841e38e93931ad07d40f5feab67c3505de;p=platal.git less and less global includes \o/ carnet.php | 2 -- geoloc.php | 7 ++++--- lists.php | 1 - profile.php | 2 -- search.php | 4 ++-- 5 files changed, 6 insertions(+), 10 deletions(-) git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1014 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/include/trombi.inc.php b/classes/trombi.inc.php similarity index 91% rename from include/trombi.inc.php rename to classes/trombi.inc.php index 034c9ac..1f688f3 100644 --- a/include/trombi.inc.php +++ b/classes/trombi.inc.php @@ -19,40 +19,22 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -require_once('xorg.plugin.inc.php'); - -// {{{ class Trombi - class Trombi extends XOrgPlugin { - // {{{ properties - var $_get_vars = array('offset'); var $limit = 24; var $admin = false; var $showpromo = true; - // }}} - // {{{ function setNbRows() - function setNbRows($row) { $this->limit = $row*3; } - // }}} - // {{{ function setAdmin() - function setAdmin() { $this->admin = true; } - // }}} - // {{{ function hidePromo() - function hidePromo() { $this->showpromo = false; } - // }}} - // {{{ function show() - function show() { /* this point is nasty... but since show() is called from the template ... @@ -81,11 +63,7 @@ class Trombi extends XOrgPlugin $page->assign('trombi_admin', $this->admin); return $page->fetch('include/trombi.tpl'); } - - // }}} } -// }}} - // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: ?> diff --git a/include/xorg.plugin.inc.php b/classes/xorgplugin.php similarity index 93% rename from include/xorg.plugin.inc.php rename to classes/xorgplugin.php index f6fba18..5b294cb 100644 --- a/include/xorg.plugin.inc.php +++ b/classes/xorgplugin.php @@ -19,8 +19,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -// {{{ class XOrgPlugin - /** * XOrg Plugins class * @@ -34,16 +32,11 @@ */ class XOrgPlugin { - // {{{ properties - /** have to override, contents the fields names used to drive the plugin */ var $_get_vars = array(); /** some polymorphism at low cost, may be used, or not */ var $_callback; - // }}} - // {{{ function XOrgPlugin() - /** constructor. * the constructor override $_get_vars settings by prefixing the names with $prefix */ @@ -56,9 +49,6 @@ class XOrgPlugin } } - // }}} - // {{{ function get_value() - /** transparent access to $_GET, wrt the right $prefix */ function get_value($key) @@ -66,9 +56,6 @@ class XOrgPlugin return Get::v($this->_prefix.$key); } - // }}} - // {{{ function make_url() - /** construct an url with the given parameters to drive the plugin. * leave all other GET params alone */ @@ -104,17 +91,12 @@ class XOrgPlugin return pl_self() . '?' . join('&', $get); } - // }}} - // {{{ function show() - /** need to be overriden. */ function show () - { return ''; } - - // }}} + { + return ''; + } } -// }}} - // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: ?> diff --git a/modules/carnet.php b/modules/carnet.php index d96dcb6..4cafae1 100644 --- a/modules/carnet.php +++ b/modules/carnet.php @@ -233,8 +233,6 @@ class CarnetModule extends PLModule } if ($action == 'trombi') { - require_once 'trombi.inc.php'; - $trombi = new Trombi(array($this, '_get_list')); $trombi->setNbRows(4); $page->assign_by_ref('trombi',$trombi); diff --git a/modules/geoloc.php b/modules/geoloc.php index 2abe8a7..f1a5b31 100644 --- a/modules/geoloc.php +++ b/modules/geoloc.php @@ -73,7 +73,8 @@ class GeolocModule extends PLModule $page->assign('no_annu', 1); } - require_once 'search.inc.php'; + require_once dirname(__FILE__).'/search/search.inc.php'; + $page->changeTpl('geoloc/index.tpl'); $fields = new SFieldGroup(true, advancedSearchFromInput()); $search = str_replace('&','&',$fields->get_url()); @@ -144,8 +145,8 @@ class GeolocModule extends PLModule $page->changeTpl('geoloc/city.tpl', NO_SKIN); + require_once dirname(__FILE__).'/search/search.inc.php'; require_once('geoloc.inc.php'); - require_once('search.inc.php'); if (empty($GLOBALS['IS_XNET_SITE'])) { $usual_fields = advancedSearchFromInput(); @@ -186,8 +187,8 @@ class GeolocModule extends PLModule $page->changeTpl('geoloc/country.tpl', NO_SKIN); } + require_once dirname(__FILE__).'/search/search.inc.php'; require_once 'geoloc.inc.php'; - require_once 'search.inc.php'; $querystring = $this->_make_qs(); $page->assign('searchvars', $querystring); diff --git a/modules/lists.php b/modules/lists.php index 4fd6b00..0682ea9 100644 --- a/modules/lists.php +++ b/modules/lists.php @@ -253,7 +253,6 @@ class ListsModule extends PLModule $owners = $this->client->get_owners($liste); if (is_array($owners)) { - require_once 'trombi.inc.php'; $moderos = list_sort_owners($owners[1]); $page->assign_by_ref('details', $owners[0]); diff --git a/modules/profile.php b/modules/profile.php index cd4bc6b..ec07500 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -635,8 +635,6 @@ class ProfileModule extends PLModule function handler_trombi(&$page, $promo = null) { - require_once 'trombi.inc.php'; - $page->changeTpl('trombipromo.tpl'); $page->assign('xorg_title', 'Polytechnique.org - Trombi Promo'); diff --git a/modules/search.php b/modules/search.php index 096b61e..d06b5e3 100644 --- a/modules/search.php +++ b/modules/search.php @@ -167,7 +167,7 @@ class SearchModule extends PLModule { global $globals; - require_once 'search.inc.php'; + require_once dirname(__FILE__).'/search/search.inc.php'; $page->changeTpl('search/index.tpl'); @@ -204,7 +204,7 @@ class SearchModule extends PLModule { global $globals; - require_once 'search.inc.php' ; + require_once dirname(__FILE__).'/search/search.inc.php'; require_once 'applis.func.inc.php'; require_once 'geoloc.inc.php'; diff --git a/include/search/classes.inc.php b/modules/search/classes.inc.php similarity index 100% rename from include/search/classes.inc.php rename to modules/search/classes.inc.php diff --git a/include/search.inc.php b/modules/search/search.inc.php similarity index 99% rename from include/search.inc.php rename to modules/search/search.inc.php index c3601a2..51dabf5 100644 --- a/include/search.inc.php +++ b/modules/search/search.inc.php @@ -19,8 +19,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -require_once('xorg.plugin.inc.php'); -require_once("search/classes.inc.php"); +require_once dirname(__FILE__).'/classes.inc.php'; // {{{ function advancedSearchFromInput function getadr_join($table) {