less and less global includes \o/
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 22 Oct 2006 22:56:06 +0000 (22:56 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 22 Oct 2006 22:56:06 +0000 (22:56 +0000)
 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

classes/trombi.inc.php [moved from include/trombi.inc.php with 91% similarity]
classes/xorgplugin.php [moved from include/xorg.plugin.inc.php with 93% similarity]
modules/carnet.php
modules/geoloc.php
modules/lists.php
modules/profile.php
modules/search.php
modules/search/classes.inc.php [moved from include/search/classes.inc.php with 100% similarity]
modules/search/search.inc.php [moved from include/search.inc.php with 99% similarity]

similarity index 91%
rename from include/trombi.inc.php
rename to classes/trombi.inc.php
index 034c9ac..1f688f3 100644 (file)
  *  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:
 ?>
similarity index 93%
rename from include/xorg.plugin.inc.php
rename to classes/xorgplugin.php
index f6fba18..5b294cb 100644 (file)
@@ -19,8 +19,6 @@
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-// {{{ class XOrgPlugin
-
 /**
  * XOrg Plugins class
  *
  */
 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('&amp;', $get);
     }
 
-    // }}}
-    // {{{ function show()
-
     /** need to be overriden.  */
     function show ()
-    { return ''; }
-
-    // }}}
+    {
+        return '';
+    }
 }
 
-// }}}
-
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
 ?>
index d96dcb6..4cafae1 100644 (file)
@@ -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);
index 2abe8a7..f1a5b31 100644 (file)
@@ -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('&amp;','&',$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);
index 4fd6b00..0682ea9 100644 (file)
@@ -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]);
index cd4bc6b..ec07500 100644 (file)
@@ -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');
 
index 096b61e..d06b5e3 100644 (file)
@@ -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';
 
similarity index 99%
rename from include/search.inc.php
rename to modules/search/search.inc.php
index c3601a2..51dabf5 100644 (file)
@@ -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) {