From: x2000habouzit
Date: Sun, 23 Jul 2006 22:42:05 +0000 (+0000)
Subject: remove use_map for geoloc, use a setting instead (is that really useful ?
X-Git-Tag: xorg/0.9.11~289
X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=138b3c8e4a3f4aae65c72e594105502859b9bdd7;p=platal.git
remove use_map for geoloc, use a setting instead (is that really useful ?
why so many complication !?)
remove the config hook for real, all is now set as default in platal.ini,
and platal.conf is used as an override.
yay, it's one step in the hooks disparition sense !
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@617 839d8a87-29fc-0310-9880-83ba4fa771e5
---
diff --git a/configs/platal.ini b/configs/platal.ini
index 350fc58..2c9e019 100644
--- a/configs/platal.ini
+++ b/configs/platal.ini
@@ -9,6 +9,12 @@ web_pass = "***"
table_prefix = "banana_"
+[Geoloc]
+use_map = 0
+webservice_url = ""
+dynamap_path = ""
+icon_path = ""
+
[Mail]
domain = ""
domain2 = ""
diff --git a/hooks/geoloc.inc.php b/hooks/geoloc.inc.php
deleted file mode 100644
index 3a9ca55..0000000
--- a/hooks/geoloc.inc.php
+++ /dev/null
@@ -1,47 +0,0 @@
-dynamap_path != false && is_file($this->dynamap_path) && is_file($this->icon_path);
- return $use_map;
- }
-}
-
-function geoloc_config()
-{
- global $globals;
- $globals->geoloc = new GeolocConfig;
-}
-
-// }}}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-?>
diff --git a/htdocs.net/groupe/dynamap.php b/htdocs.net/groupe/dynamap.php
index 2b0cfb8..07410a4 100644
--- a/htdocs.net/groupe/dynamap.php
+++ b/htdocs.net/groupe/dynamap.php
@@ -36,7 +36,7 @@ if (urlencode(Env::v('initfile')) != $initfile)
header("Content-type: application/x-shockwave-flash");
-if ($globals->geoloc->use_map())
+if ($globals->geoloc->use_map)
readfile($globals->geoloc->dynamap_path);
?>
diff --git a/htdocs.net/groupe/geoloc.php b/htdocs.net/groupe/geoloc.php
index ecbb45e..c0164bc 100644
--- a/htdocs.net/groupe/geoloc.php
+++ b/htdocs.net/groupe/geoloc.php
@@ -21,14 +21,14 @@
require_once 'xnet.inc.php';
-if ($globals->asso('pub') == 'public')
- new_group_page('geoloc/index.tpl');
-else
- new_groupadmin_page('geoloc/index.tpl');
+if ($globals->asso('pub') == 'public') {
+ new_group_page('geoloc/index.tpl');
+} else {
+ new_groupadmin_page('geoloc/index.tpl');
+}
-$page->assign('use_map', $globals->geoloc->use_map());
$page->assign('no_annu', true);
$page->assign('dynamap_vars', 'none');
$page->run();
-?>
\ No newline at end of file
+?>
diff --git a/htdocs.net/groupe/icon.php b/htdocs.net/groupe/icon.php
index b6a46d0..fb284e0 100644
--- a/htdocs.net/groupe/icon.php
+++ b/htdocs.net/groupe/icon.php
@@ -26,7 +26,8 @@ new_nonhtml_page('');
header("Content-type: application/x-shockwave-flash");
-if ($globals->geoloc->use_map())
- readfile($globals->geoloc->icon_path);
+if ($globals->geoloc->use_map) {
+ readfile($globals->geoloc->icon_path);
+}
?>
diff --git a/include/geoloc.inc.php b/include/geoloc.inc.php
index e06a051..c23da8c 100644
--- a/include/geoloc.inc.php
+++ b/include/geoloc.inc.php
@@ -19,7 +19,6 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-
// {{{ liste les pays ou les régions d'un pays
/** donne la liste déroulante des pays
* @param $current pays actuellement selectionné
@@ -419,5 +418,7 @@ function geoloc_getData_subcountries($mapid, $SFields, $minentities) {
return array($countries, $cities);
}
+// }}}
+
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
?>
diff --git a/include/xnet/globals.inc.php b/include/xnet/globals.inc.php
index 585dbd5..e1863d1 100644
--- a/include/xnet/globals.inc.php
+++ b/include/xnet/globals.inc.php
@@ -37,8 +37,6 @@ class XnetGlobals extends PlatalGlobals
$globals->core = new CoreConfig;
$globals->hook = new XOrgHook();
- $globals->hook->config(null);
-
$globals->read_config();
$globals->dbconnect();
diff --git a/include/xorg/globals.inc.php b/include/xorg/globals.inc.php
index a8bea5a..2561df2 100644
--- a/include/xorg/globals.inc.php
+++ b/include/xorg/globals.inc.php
@@ -37,8 +37,6 @@ class XorgGlobals extends PlatalGlobals
$globals->core = new CoreConfig;
$globals->hook = new XOrgHook();
- $globals->hook->config(null);
-
$globals->read_config();
$globals->dbconnect();
diff --git a/include/xorg/hook.inc.php b/include/xorg/hook.inc.php
index d94e7c8..69ea5a1 100644
--- a/include/xorg/hook.inc.php
+++ b/include/xorg/hook.inc.php
@@ -72,17 +72,6 @@ class XOrgHook
}
// }}}
- // {{{ function config
-
- function config()
- {
- foreach ($this->_mods as $mod) {
- if (!function_exists($mod.'_config')) continue;
- call_user_func($mod.'_config');
- }
- }
-
- // }}}
// {{{ function subscribe
function subscribe($forlife, $uid, $promo, $pass)
diff --git a/modules/geoloc.php b/modules/geoloc.php
index 49f3895..c808fbd 100644
--- a/modules/geoloc.php
+++ b/modules/geoloc.php
@@ -67,8 +67,6 @@ class GeolocModule extends PLModule
if ($search) {
$page->assign('dynamap_vars', $search);
}
-
- $page->assign('use_map', $globals->geoloc->use_map());
}
function handler_icon(&$page)
@@ -77,7 +75,7 @@ class GeolocModule extends PLModule
header("Content-type: application/x-shockwave-flash");
- if ($globals->geoloc->use_map()) {
+ if ($globals->geoloc->use_map) {
readfile($globals->geoloc->icon_path);
exit;
}
@@ -99,7 +97,7 @@ class GeolocModule extends PLModule
header("Content-type: application/x-shockwave-flash");
- if ($globals->geoloc->use_map()) {
+ if ($globals->geoloc->use_map) {
readfile($globals->geoloc->dynamap_path);
exit;
}
diff --git a/modules/search.php b/modules/search.php
index db1eb6a..7cd0c58 100644
--- a/modules/search.php
+++ b/modules/search.php
@@ -199,7 +199,6 @@ class SearchModule extends PLModule
$page->assign('advanced',1);
$page->assign('public_directory',0);
- $page->assign('use_map', $globals->geoloc->use_map());
if (!Env::has('rechercher')) {
$this->form_prepare();
diff --git a/templates/geoloc/index.tpl b/templates/geoloc/index.tpl
index 5341780..8d0983e 100644
--- a/templates/geoloc/index.tpl
+++ b/templates/geoloc/index.tpl
@@ -62,7 +62,7 @@ function searchMapId(f)
Aujourd'hui {$localises} de nos camarades sont localisés grâce à leurs adresses personnelles.
{/if}
-{if $use_map}
+{if $globals->geoloc->use_map}