From 5c60146a97b80ce7578406c3a534f04393ad03d1 Mon Sep 17 00:00:00 2001 From: Chouchen Date: Wed, 15 Sep 2010 14:55:54 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20des=20class=20pour=20chaque=20module=20?= =?UTF-8?q?et=20pour=20la=20config=20du=20site,=20Correction=20module=20m?= =?UTF-8?q?=C3=A9t=C3=A9o=20en=20cas=20de=20ville=20non=20trouv=C3=A9e,=20?= =?UTF-8?q?Correction=20d'ajout=20de=20t=C3=A2che=20dans=20Todoist,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GoogleMeteo.php | 3 +- class/AccueilModules.php | 51 ++++++++++++++++++++++++++++++++ class/Blogs.php | 35 ++++++++++++++++++++++ class/Clock.php | 18 ++++++++++++ class/Links.php | 60 ++++++++++++++++++++++++++++++++++++++ class/Notes.php | 20 +++++++++++++ class/Search.php | 30 +++++++++++++++++++ class/Todo.php | 57 ++++++++++++++++++++++++++++++++++++ class/Weather.php | 26 +++++++++++++++++ js/getUncompletedTasks.php | 2 +- 10 files changed, 300 insertions(+), 2 deletions(-) create mode 100644 class/AccueilModules.php create mode 100644 class/Blogs.php create mode 100644 class/Clock.php create mode 100644 class/Links.php create mode 100644 class/Notes.php create mode 100644 class/Search.php create mode 100644 class/Todo.php create mode 100644 class/Weather.php diff --git a/GoogleMeteo.php b/GoogleMeteo.php index 5e1adb3..2409af6 100644 --- a/GoogleMeteo.php +++ b/GoogleMeteo.php @@ -8,7 +8,7 @@ if($gweather->isFound()) { $currentTemp = $gweather->getCurrent(); $forecastTemp = $gweather->getForecast(); - } + $present_weather = 'Actuellement : '.$currentTemp['temp_c'].'°C - '.$currentTemp['condition']; $i=0; foreach($forecastTemp as $temp) { @@ -31,6 +31,7 @@ if(strpos(strtolower($present_weather),"neige") !== false) {?> persistance)){ + $config_xml = $config->item; + foreach($config_xml as $item){ + $this->modules["$item[id]"] = $item; + } + $this->getModules(); + $this->buildConfigMenu(); + }else{ + echo 'baaaaad persistance...'; + } + } + + function getModules(){ + foreach($this->modules as $module=>$moduleConf){ + if(file_exists('class/'.ucfirst($module).'.php') && $moduleConf->visibility == "true"){ + $params = array(); + foreach($moduleConf as $confParam){ + $params[$confParam->getName()] = "$confParam"; + } + require ucfirst($module).'.php'; + call_user_func(array($module, "start"), $params); + } + } + } + + function buildConfigMenu(){ + echo 'Configuration +
+
+
+

Modules configuration


'; + foreach($this->modules as $module=>$moduleConf){ + echo $module.' module : visibility == "true") echo " checked"; + echo '/>true  visibility == "false") echo " checked"; + echo '/>false

'; + } + echo 'Enregistrer +
+
+
'; + } +} \ No newline at end of file diff --git a/class/Blogs.php b/class/Blogs.php new file mode 100644 index 0000000..5514b69 --- /dev/null +++ b/class/Blogs.php @@ -0,0 +1,35 @@ +setParams($params); + require('blogs_last_post.php'); + echo ''; + echo 'Manage blog links'; + echo '
+
+

Blogs Management


+

Delete Site feed

+
    '; + $blogs = new Blogs_last_post(); + foreach($blogs->getLinks() as $link) + echo '
  • '.$link['url'].'
  • '; + echo '
+

Insert Site feed

+
+ + +
+
+
'; + } + + private function setParams($params){ + $this->params = $params; + } + + public static function start($params){ + $blogs = new blogs($params); + } +} \ No newline at end of file diff --git a/class/Clock.php b/class/Clock.php new file mode 100644 index 0000000..066986d --- /dev/null +++ b/class/Clock.php @@ -0,0 +1,18 @@ +setParams($params); + echo ''; + echo '
'; + } + + private function setParams($params){ + $this->params = $params; + } + + public static function start($params){ + $clock = new clock($params); + } +} \ No newline at end of file diff --git a/class/Links.php b/class/Links.php new file mode 100644 index 0000000..344a115 --- /dev/null +++ b/class/Links.php @@ -0,0 +1,60 @@ +setParams($params); + echo '
+ Google Apps + +
+ + Media + +
+ + Desk Accessories + +
+ + Entertainment + +
+ +
'; + } + + private function setParams($params){ + $this->params = $params; + } + + public static function start($params){ + $links = new links($params); + } +} \ No newline at end of file diff --git a/class/Notes.php b/class/Notes.php new file mode 100644 index 0000000..ece7bea --- /dev/null +++ b/class/Notes.php @@ -0,0 +1,20 @@ +setParams($params); + echo ' + + Add a note'; + include 'notes_extract.php'; + } + + private function setParams($params){ + $this->params = $params; + } + + public static function start($params){ + $notes = new notes($params); + } +} \ No newline at end of file diff --git a/class/Search.php b/class/Search.php new file mode 100644 index 0000000..19d96ce --- /dev/null +++ b/class/Search.php @@ -0,0 +1,30 @@ + +
+ +
+ + + + + + + + +
+
+'; + } + + private function setParams($params){ + $this->params = $params; + } + + public static function start($params){ + $search = new search($params); + } +} \ No newline at end of file diff --git a/class/Todo.php b/class/Todo.php new file mode 100644 index 0000000..fd88b98 --- /dev/null +++ b/class/Todo.php @@ -0,0 +1,57 @@ +setParams($params); + echo ''; + if($xmla = simplexml_load_file($this->persistance)){ + $this->setToken($xmla->token); + $this->setProjectName($xmla->name); + $this->setProjectId($xmla->id); + echo '
'; + if($this->token == null || $this->project_id == null) + echo 'Impossible de trouver votre configuration. Cliquez ici pour la mettre en place.
'; + else{ + $token = $xmla->token; + $id = $xmla->id; + echo ''; + } + }else{ + echo 'baaaaad persistance...'; + } + } + + private function setToken($token){ + if($token == '' || $token == null) + $this->token = null; + else + $this->token = $token; + } + + private function setProjectName($name){ + if($name == '' || $name == null) + $this->project_name = null; + else + $this->project_name = $name; + } + + private function setProjectId($id){ + if($id == '' || $id == null) + $this->project_id = null; + else + $this->project_id = $id; + } + + private function setParams($params){ + $this->params = $params; + } + + public static function start($params){ + $todo = new todo($params); + } +} \ No newline at end of file diff --git a/class/Weather.php b/class/Weather.php new file mode 100644 index 0000000..8e17aaa --- /dev/null +++ b/class/Weather.php @@ -0,0 +1,26 @@ +setParams($params); + $city = $params['city']; + include 'GoogleMeteo.php'; + echo ' + '; + echo '
+
+ '.$present_weather.'
+ '.$future_weather1.'
+ '.$future_weather2.' +
'; + } + + private function setParams($params){ + $this->params = $params; + } + + public static function start($params){ + $weather = new weather($params); + } +} \ No newline at end of file diff --git a/js/getUncompletedTasks.php b/js/getUncompletedTasks.php index 81fbf80..3688448 100644 --- a/js/getUncompletedTasks.php +++ b/js/getUncompletedTasks.php @@ -11,7 +11,7 @@ function cbfunc(o){ } function cbfunc2(o){ - $('#uncompletedList').append('
  • '+o.content+' - '+o.date_string+'
  • '); + $('#uncompletedList').append('
  • '+o.content+' - '+o.date_string+'
  • '); } $(document).ready(function(){