Browse Source

Version avec modules séparés !

remotes/svn/tags/beta-1.0.0
Chouchen 8 years ago
parent
commit
734e6f4829
81 changed files with 324 additions and 264 deletions
  1. 4
    4
      class/AccueilModules.php
  2. 0
    33
      class/Clock.php
  3. 9
    0
      class/Module.php
  4. 0
    39
      class/Search.php
  5. 0
    12
      getUncompletedTasks.php
  6. BIN
      images/weather/nuage.png
  7. BIN
      images/weather/peu-nuageux.png
  8. BIN
      images/weather/pluie.png
  9. BIN
      images/weather/soleil.png
  10. 0
    0
      includes/addLink.php
  11. 0
    0
      includes/calculator.html
  12. 0
    0
      includes/notepad.html
  13. 0
    23
      js/gmap.js
  14. 0
    75
      js/jquery.xdomainajax.js
  15. 7
    4
      modules/blogs/Blogs.php
  16. 0
    0
      modules/blogs/css/blogs.css
  17. 0
    0
      modules/blogs/db/blog_links.xml
  18. 0
    0
      modules/blogs/includes/CURL.php
  19. 0
    0
      modules/blogs/includes/addSite.php
  20. 0
    0
      modules/blogs/includes/blogs.php
  21. 1
    1
      modules/blogs/includes/blogs_last_post.php
  22. 1
    1
      modules/blogs/js/blogs.js
  23. 48
    0
      modules/clock/Clock.php
  24. 0
    0
      modules/clock/css/clock.css
  25. 0
    0
      modules/clock/js/clock.js
  26. 4
    1
      modules/clockAdvanced/ClockAdvanced.php
  27. 0
    0
      modules/clockAdvanced/css/clockAdvanced.css
  28. 0
    0
      modules/clockAdvanced/js/clockAdvanced.js
  29. 6
    19
      modules/gmap/Gmap.php
  30. 0
    0
      modules/gmap/css/gmap.css
  31. 89
    0
      modules/gmap/js/gmap.js
  32. 11
    5
      modules/links/Links.php
  33. 0
    0
      modules/links/ajax/listToReserve.php
  34. 1
    2
      modules/links/ajax/loadReserve.php
  35. 0
    0
      modules/links/ajax/reserveToList.php
  36. 0
    0
      modules/links/ajax/update-links-order.php
  37. 0
    0
      modules/links/css/links.css
  38. 0
    0
      modules/links/db/links.xml
  39. 4
    4
      modules/links/js/links.js
  40. 4
    2
      modules/mappy/Mappy.php
  41. 0
    0
      modules/mappy/css/mappy.css
  42. 0
    0
      modules/mappy/js/mappy.js
  43. 0
    0
      modules/news/News.php
  44. 10
    4
      modules/notes/Notes.php
  45. 0
    0
      modules/notes/ajax/update_position.php
  46. 1
    1
      modules/notes/css/notes.css
  47. 0
    0
      modules/notes/db/notes.xml
  48. 0
    0
      modules/notes/includes/add_note.html
  49. 1
    1
      modules/notes/includes/notes_extract.php
  50. 3
    3
      modules/notes/js/notes.js
  51. 4
    1
      modules/ouifm/Ouifm.php
  52. 0
    0
      modules/ouifm/css/ouifm.css
  53. 0
    0
      modules/ouifm/js/ouifm.js
  54. 5
    2
      modules/rssblogs/Rssblogs.php
  55. 0
    0
      modules/rssblogs/css/rssblogs.css
  56. 0
    0
      modules/rssblogs/db/rss.xml
  57. 0
    0
      modules/rssblogs/js/rssblogs.js
  58. 62
    0
      modules/search/Search.php
  59. 4
    4
      modules/search/css/search.css
  60. 0
    0
      modules/search/js/search.js
  61. 10
    6
      modules/todo/Todo.php
  62. 0
    0
      modules/todo/ajax/saveTodoist.php
  63. 2
    2
      modules/todo/css/todo.css
  64. 0
    0
      modules/todo/db/todoist.xml
  65. 2
    2
      modules/todo/includes/getProjectsList.php
  66. 12
    0
      modules/todo/includes/getUncompletedTasks.php
  67. 2
    2
      modules/todo/includes/install-todoist.php
  68. 1
    1
      modules/todo/js/getProjectsList.php
  69. 0
    0
      modules/todo/js/getUncompletedTasks.php
  70. 1
    1
      modules/todo/js/index.js
  71. 0
    0
      modules/todo/js/todo.js
  72. 10
    4
      modules/weather/Weather.php
  73. 0
    0
      modules/weather/css/neige.css
  74. 0
    0
      modules/weather/css/nuage.css
  75. 0
    0
      modules/weather/css/peunuage.css
  76. 0
    0
      modules/weather/css/pluie.css
  77. 0
    0
      modules/weather/css/soleil.css
  78. 0
    0
      modules/weather/css/weather.css
  79. 5
    5
      modules/weather/includes/GoogleMeteo.php
  80. 0
    0
      modules/weather/includes/meteo.php
  81. 0
    0
      modules/weather/js/weather.js

+ 4
- 4
class/AccueilModules.php View File

@@ -19,7 +19,7 @@ class AccueilModules {
19 19
 			$this->getModules();
20 20
 			$this->buildConfigMenu();
21 21
 		}else{
22
-			echo 'baaaaad persistance...';
22
+			echo 'Impossible de trouver le fichier de configuration.';
23 23
 		}
24 24
 	}
25 25
 	
@@ -29,12 +29,12 @@ class AccueilModules {
29 29
 	 */
30 30
 	function getModules(){
31 31
 		foreach($this->modules as $module=>$moduleConf){
32
-			if(file_exists('class/'.ucfirst($module).'.php') && $moduleConf->visibility == "true"){
32
+			if(file_exists('modules/'.$module.'/'.ucfirst($module).'.php') && $moduleConf->visibility == "true"){
33 33
 				$params = array();
34 34
 				foreach($moduleConf as $confParam){
35 35
 					$params[$confParam->getName()] = "$confParam";
36 36
 				}
37
-				require ucfirst($module).'.php';
37
+				require 'modules/'.$module.'/'.ucfirst($module).'.php';
38 38
 				call_user_func(array($module, "start"), $params);
39 39
 			}
40 40
 		}
@@ -88,7 +88,7 @@ class AccueilModules {
88 88
 	 * @return "ok" String si c'est bon, ou le message d'erreur
89 89
 	 */
90 90
 	public static function updateModule($module, $things2change){
91
-		require ucfirst($module).'.php';
91
+		require '../modules/'.$module.'/'.ucfirst($module).'.php';
92 92
 		return call_user_func(array($module, "updateConfig"), $things2change);
93 93
 	}
94 94
 }

+ 0
- 33
class/Clock.php View File

@@ -1,33 +0,0 @@
1
-<?php
2
-class clock extends Module {
3
-
4
-	protected static $paramsList = array(
5
-		'visibility',
6
-		'x',
7
-		'y'
8
-	);
9
-	
10
-	public $params = array();
11
-	
12
-	public function __construct($params){
13
-		$this->setParams($params);
14
-		echo '<script type="text/javascript" src="js/jquery.jclock.js"></script>';
15
-		echo '<div class="jclock" id="clock" style="left:'.$params['x'].'; top:'.$params['y'].';"></div>';
16
-	}
17
-	
18
-	private function setParams($params){
19
-		$this->params = $params;
20
-	}
21
-	
22
-	public static function start($params){
23
-		$clock = new clock($params);
24
-	}
25
-	
26
-	public static function updateConfig($updated){
27
-		foreach ($updated as $what=>$withWhat){
28
-			if(in_array($what, self::$paramsList)){
29
-				call_user_func(array(get_class(), "set".ucfirst($what)), $withWhat);
30
-			}
31
-		}
32
-	}
33
-}

+ 9
- 0
class/Module.php View File

@@ -8,6 +8,15 @@ abstract class Module
8 8
 	*/
9 9
 	protected static $paramsList = array();
10 10
 	
11
+	// Nom du module (aka le nom de la classe en minuscule)
12
+	protected $moduleName;
13
+	
14
+	// Libellé du module (aka le nom affiché)
15
+	protected $moduleTitle;
16
+	
17
+	// Le chemin vers le module
18
+	protected $pathToModule;
19
+	
11 20
 	/**
12 21
 	* Liste des paramètres et leurs valeurs de l'object
13 22
 	*

+ 0
- 39
class/Search.php View File

@@ -1,39 +0,0 @@
1
-<?php
2
-class search extends Module {
3
-
4
-	protected static $paramsList = array(
5
-		'visibility'
6
-	);
7
-	public $params = array();
8
-	
9
-	public function __construct($params){
10
-		echo '<link rel="stylesheet" type="text/css" href="css/search.css">
11
-				<script type="text/javascript" src="js/jquery.search.js"></script>
12
-				<form id="searchForm" method="post">
13
-				<fieldset>
14
-					<input id="s" type="text" />
15
-					<input type="submit" value="Submit" id="submitButton" class="searchbutton" />
16
-
17
-					<ul class="icons">
18
-						<li class="web" title="Web Search" data-searchType="web">Web</li>
19
-						<li class="images" title="Image Search" data-searchType="images">Images</li>
20
-						<li class="news" title="News Search" data-searchType="news">News</li>
21
-						<li class="videos" title="Video Search" data-searchType="video">Videos</li>
22
-					</ul>
23
-
24
-				</fieldset>
25
-			</form>';
26
-	}
27
-	
28
-	private function setParams($params){
29
-		$this->params = $params;
30
-	}
31
-	
32
-	public static function start($params){
33
-		$search = new search($params);
34
-	}
35
-	
36
-	public static function updateConfig($updated){
37
-	
38
-	}
39
-}

+ 0
- 12
getUncompletedTasks.php View File

@@ -1,12 +0,0 @@
1
-<?

2
-$xmla = simplexml_load_file('todoist.xml');

3
-if($xmla->token== '' || $xmla->token == null)

4
-	header('Location: index.php');

5
-if($xmla->id != '' || $xmla->id != null): 

6
-$token 	= $xmla->token;

7
-$id		= $xmla->id;?>

8
-

9
-<script type="text/javascript" src="js/getUncompletedTasks.php?token=<?=$token?>&id=<?=$id?>"></script>

10
-	<? else:

11
-		header('Location: getProjectsList.php');

12
-	endif;

BIN
images/weather/nuage.png View File


BIN
images/weather/peu-nuageux.png View File


BIN
images/weather/pluie.png View File


BIN
images/weather/soleil.png View File


addLink.php → includes/addLink.php View File


calculator.html → includes/calculator.html View File


notepad.html → includes/notepad.html View File


+ 0
- 23
js/gmap.js View File

@@ -1,23 +0,0 @@
1
-
2
-$(document).ready(function(){
3
-	
4
-	$('#menu-bar').append($('#myAdress'));
5
-	$('#map').css({'visibility':'hidden'});
6
-	$('#gmapLink').fancybox({
7
-		'transitionIn': 'elastic',
8
-		'transitionOut': 'elastic',
9
-		'onClosed': function(){$('#map').css({'visibility':'hidden'});},
10
-		'onStart': function(){$('#map').css({'visibility':'visible'});}
11
-	});
12
-	$('#myAdressField').keydown(function(e){
13
-		var code = (e.keyCode ? e.keyCode : e.which);
14
-		if(code == 13) {
15
-			var adress = $(this).val();
16
-			geocodeMarker(adress,adress,adress,'','http://maps.gstatic.com/intl/fr_ALL/mapfiles/markers/marker_sprite.png');
17
-			geocodeCenter(adress);
18
-			$('#gmapLink').trigger('click');
19
-			
20
-		}
21
-	});
22
-});
23
-

+ 0
- 75
js/jquery.xdomainajax.js View File

@@ -1,75 +0,0 @@
1
-/**

2
- * jQuery.ajax mid - CROSS DOMAIN AJAX 

3
- * ---

4
- * @author James Padolsey (http://james.padolsey.com)

5
- * @version 0.11

6
- * @updated 12-JAN-10

7
- * ---

8
- * Note: Read the README!

9
- * ---

10
- * @info http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/

11
- */

12
-

13
-jQuery.ajax = (function(_ajax){

14
-    

15
-    var protocol = location.protocol,

16
-        hostname = location.hostname,

17
-        exRegex = RegExp(protocol + '//' + hostname),

18
-        YQL = 'http' + (/^https/.test(protocol)?'s':'') + '://query.yahooapis.com/v1/public/yql?callback=?',

19
-        query = 'select * from html where url="{URL}" and xpath="*"';

20
-    

21
-    function isExternal(url) {

22
-        return !exRegex.test(url) && /:\/\//.test(url);

23
-    }

24
-    

25
-    return function(o) {

26
-        

27
-        var url = o.url;

28
-        

29
-        if ( /get/i.test(o.type) && !/json/i.test(o.dataType) && isExternal(url) ) {

30
-            

31
-            // Manipulate options so that JSONP-x request is made to YQL

32
-            

33
-            o.url = YQL;

34
-            o.dataType = 'json';

35
-            

36
-            o.data = {

37
-                q: query.replace(

38
-                    '{URL}',

39
-                    url + (o.data ?

40
-                        (/\?/.test(url) ? '&' : '?') + jQuery.param(o.data)

41
-                    : '')

42
-                ),

43
-                format: 'xml'

44
-            };

45
-            

46
-            // Since it's a JSONP request

47
-            // complete === success

48
-            if (!o.success && o.complete) {

49
-                o.success = o.complete;

50
-                delete o.complete;

51
-            }

52
-            

53
-            o.success = (function(_success){

54
-                return function(data) {

55
-                    

56
-                    if (_success) {

57
-                        // Fake XHR callback.

58
-                        _success.call(this, {

59
-                            responseText: data.results[0]

60
-                                // YQL screws with <script>s

61
-                                // Get rid of them

62
-                                .replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')

63
-                        }, 'success');

64
-                    }

65
-                    

66
-                };

67
-            })(o.success);

68
-            

69
-        }

70
-        

71
-        return _ajax.apply(this, arguments);

72
-        

73
-    };

74
-    

75
-})(jQuery.ajax);

class/Blogs.php → modules/blogs/Blogs.php View File

@@ -9,10 +9,13 @@ class blogs extends Module {
9 9
 	public $params = array();
10 10
 	
11 11
 	public function __construct($params){
12
+		$this->moduleName = get_class();
13
+		$this->pathToModule = 'modules/'.$this->moduleName.'/';
12 14
 		$this->setParams($params);
13
-		require('blogs_last_post.php');
14
-		echo '<script type="text/javascript" src="js/jquery.blogs.js"></script>
15
-				<div id="blogs" style="top:'.$params['y'].'; left :'.$params['x'].';"></div>';
15
+		echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
16
+				<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />';
17
+		require($this->pathToModule.'includes/blogs_last_post.php');
18
+		echo '<div id="blogs" style="top:'.$params['y'].'; left :'.$params['x'].';"></div>';
16 19
 		echo '<a href="#blogLinksManager" id="blog-links-manager"><img src="images/interface/blogs_edit.png" /></a>';
17 20
 		echo '<div style="display:none;">
18 21
 				<div id="blogLinksManager">
@@ -24,7 +27,7 @@ class blogs extends Module {
24 27
 			echo '<li>'.$link['url'].' <img src="images/interface/delete.png" id="link-'.$link['name'].'"/></li>';
25 28
 		echo '</ul>
26 29
 				<h4>Insert Site feed</h4>
27
-				<form action="addSite.php" method="POST">
30
+				<form action="modules/blogs/includes/addSite.php" method="POST">
28 31
 				<input type="text" id="newLink" name="newLink" value="url" />
29 32
 				<input type="submit" id="link-submit" class="green-button" value="Ajouter"></input>
30 33
 				</form>

+ 0
- 0
modules/blogs/css/blogs.css View File


db/blog_links.xml → modules/blogs/db/blog_links.xml View File


CURL.php → modules/blogs/includes/CURL.php View File


addSite.php → modules/blogs/includes/addSite.php View File


blogs.php → modules/blogs/includes/blogs.php View File


blogs_last_post.php → modules/blogs/includes/blogs_last_post.php View File

@@ -30,7 +30,7 @@ function getResult()
30 30
 }
31 31
 
32 32
 public function getLinks(){
33
-	if($linksXML = simplexml_load_file('db/blog_links.xml')){
33
+	if($linksXML = simplexml_load_file('../db/blog_links.xml')){
34 34
 		foreach($linksXML->link as $individualLink){
35 35
 			$this->link[] = array('name'=>$individualLink->name, 'url'=>$individualLink->url, 'number'=>$individualLink->number);
36 36
 		}

js/jquery.blogs.js → modules/blogs/js/blogs.js View File

@@ -10,7 +10,7 @@ var tmp;
10 10
 make_draggable($('#blogs'));
11 11
 
12 12
 $.ajax(
13
-	{url : "blogs.php", 
13
+	{url : "modules/blogs/includes/blogs.php", 
14 14
 	timeout : 36000,
15 15
 	error: function(data){
16 16
 		$("#blogs").html('<img src="images/interface/error.png"/> Délai dépassé !');

+ 48
- 0
modules/clock/Clock.php View File

@@ -0,0 +1,48 @@
1
+<?php
2
+class clock extends Module {
3
+
4
+	protected static $paramsList = array(
5
+		'visibility',
6
+		'x',
7
+		'y'
8
+	);
9
+	
10
+	public $params = array();
11
+	
12
+	public function __construct($params){
13
+		$this->moduleName = get_class();
14
+		$this->pathToModule = 'modules/'.$this->moduleName.'/';
15
+		$this->setParams($params);
16
+		echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
17
+				<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />';
18
+		echo '<div class="jclock" id="clock" style="left:'.$params['x'].'; top:'.$params['y'].';"></div>';
19
+	}
20
+	
21
+	private function setParams($params){
22
+		$this->params = $params;
23
+	}
24
+	
25
+	public static function start($params){
26
+		$clock = new clock($params);
27
+	}
28
+	
29
+	public function setVisibility($visibility){
30
+		// Saving the position and z-index of the note:
31
+		$xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE);
32
+
33
+		$path = $xmla->xpath("//item[@id='clock']"); 
34
+		$path[0]->visibility = $visibility;
35
+		
36
+		$xmla->asXML('../'.AccueilModules::CONFIG_FILE);
37
+		
38
+		echo "ok";
39
+	}
40
+	
41
+	public static function updateConfig($updated){
42
+		foreach ($updated as $what=>$withWhat){
43
+			if(in_array($what, self::$paramsList)){
44
+				call_user_func(array(get_class(), "set".ucfirst($what)), $withWhat);
45
+			}
46
+		}
47
+	}
48
+}

+ 0
- 0
modules/clock/css/clock.css View File


js/jquery.jclock.js → modules/clock/js/clock.js View File


class/ClockAdvanced.php → modules/clockAdvanced/ClockAdvanced.php View File

@@ -13,8 +13,11 @@ class clockAdvanced extends Module {
13 13
 	public $params = array();
14 14
 	
15 15
 	public function __construct($params){
16
+		$this->moduleName = get_class();
17
+		$this->pathToModule = 'modules/'.$this->moduleName.'/';
16 18
 		$this->setParams($params);
17
-		echo '<script type="text/javascript" src="js/jquery.jclockAdvanced.js"></script>';
19
+		echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
20
+				<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />';
18 21
 		echo '<div class="jclockAdvanced" id="clockAdvanced" style="left:'.$params['x'].'; top:'.$params['y'].';"></div>';
19 22
 		$options = '';
20 23
 		foreach (self::$paramsList as $paramName){

+ 0
- 0
modules/clockAdvanced/css/clockAdvanced.css View File


js/jquery.jclockAdvanced.js → modules/clockAdvanced/js/clockAdvanced.js View File


class/Gmap.php → modules/gmap/Gmap.php View File

@@ -9,27 +9,14 @@ class gmap extends Module {
9 9
 	public $params = array();
10 10
 
11 11
 	public function __construct($params){
12
+		$this->moduleName = get_class();
13
+		$this->pathToModule = 'modules/'.$this->moduleName.'/';
12 14
 		$this->setParams($params);
13
-		echo '<script type="text/javascript" src="js/gmap.js"></script>
14
-				<link type="text/css" rel="stylesheet" href="css/gmap.css" />
15
+		echo '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=fr"></script>
16
+		<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
17
+				<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />
15 18
 				
16
-				<div id="myAdress"><label for="myAdressField"><img src="images/interface/map.png" /> Adresse pour Google Maps :</label><input type="text" name="myAdressField" id="myAdressField" /></div><a href="#map" id="gmapLink"></a><div id="map">';
17
-				
18
-		include 'GoogleMapAPIv3.class.php';
19
-		$gmap = new GoogleMapAPI();
20
-		$gmap->setDivId('mymap'); //crée une div avec l'id donnée
21
-		//$gmap->setDirectionDivId('route');
22
-		$gmap->setCenter('Paris France'); // Adresse du centre par défaut
23
-		$gmap->setEnableWindowZoom(true); // Permet de zoomer (trop important !)
24
-		$gmap->setEnableAutomaticCenterZoom(false); // FALSE ! ou sinon le setCenter ne sert à rien !
25
-		//$gmap->setDisplayDirectionFields(false);
26
-		$gmap->setSize('400px','400px'); // La taille... duh !
27
-		$gmap->setZoom(11); // Le zoom (+ il est haut, plus le zoom est proche)
28
-		$gmap->setLang('fr'); // La langue par défaut
29
-		$gmap->setDefaultHideMarker(false); // Cache les markers ?
30
-		$gmap->generate(); // Génère le JS
31
-		echo $gmap->getGoogleMap(); 
32
-		echo '</div>';
19
+				<div id="myAdress"><label for="myAdressField"><img src="images/interface/map.png" /> Adresse pour Google Maps :</label><input type="text" name="myAdressField" id="myAdressField" /></div><a href="#map" id="gmapLink"></a><div id="map"><div id="mymap" style="width:400px;height:400px"></div></div>';
33 20
 	}
34 21
 
35 22
 	private function setParams($params){

css/gmap.css → modules/gmap/css/gmap.css View File


+ 89
- 0
modules/gmap/js/gmap.js View File

@@ -0,0 +1,89 @@
1
+
2
+$(document).ready(function(){
3
+var geocoder = new google.maps.Geocoder();
4
+var map;
5
+var gmarkers = [];
6
+var infowindow;
7
+var directions = new google.maps.DirectionsRenderer();
8
+var directionsService = new google.maps.DirectionsService();
9
+var current_lat = 0;
10
+var current_lng = 0;
11
+function getCurrentLat() {
12
+	return current_lat;
13
+}
14
+function getCurrentLng() {
15
+	return current_lng;
16
+}
17
+function addMarker(latlng,title,content,category,icon) {
18
+	var marker = new google.maps.Marker({
19
+		map: map,
20
+		title : title,
21
+		icon:  new google.maps.MarkerImage(icon, new google.maps.Size(57,34)),
22
+		position: latlng
23
+	});
24
+	var html = '<div style="float:left;text-align:left;width:250;">'+content+'</div>'
25
+	google.maps.event.addListener(marker, "click", function() {
26
+		if (infowindow) infowindow.close();
27
+		infowindow = new google.maps.InfoWindow({content: html});
28
+		infowindow.open(map,marker);
29
+	map.setCenter(new google.maps.LatLng(latlng.lat(),latlng.lng()),3);
30
+	});
31
+	marker.mycategory = category;
32
+	gmarkers.push(marker);
33
+}
34
+function geocodeMarker(address,title,content,category,icon) {
35
+	if (geocoder) {
36
+		geocoder.geocode( { "address" : address}, function(results, status) {
37
+			if (status == google.maps.GeocoderStatus.OK) {
38
+				var latlng = 	results[0].geometry.location;
39
+				addMarker(results[0].geometry.location,title,content,category,icon)
40
+			}
41
+		});
42
+	}
43
+}
44
+function geocodeCenter(address) {
45
+	if (geocoder) {
46
+		geocoder.geocode( { "address": address}, function(results, status) {
47
+			if (status == google.maps.GeocoderStatus.OK) {
48
+			map.setCenter(results[0].geometry.location);
49
+			} else {
50
+			alert("Geocode was not successful for the following reason: " + status);
51
+			}
52
+		});
53
+	}
54
+}
55
+function initialize() {
56
+	var myLatlng = new google.maps.LatLng(48.8792,2.34778);
57
+	var myOptions = {
58
+		zoom: 11,
59
+		center: myLatlng,
60
+		mapTypeId: google.maps.MapTypeId.ROADMAP
61
+	}
62
+	map = new google.maps.Map(document.getElementById("mymap"), myOptions);
63
+	geocodeCenter("Paris France");
64
+	google.maps.event.addListener(map,"click",function(event) { if (event) { current_lat=event.latLng.lat();current_lng=event.latLng.lng(); }}) ;
65
+	directions.setMap(map);
66
+	directions.setPanel(document.getElementById("route"))
67
+}
68
+	initialize();
69
+	$('#menu-bar').append($('#myAdress'));
70
+	$('#map').css({'visibility':'hidden'});
71
+	$('#gmapLink').fancybox({
72
+		'transitionIn': 'elastic',
73
+		'transitionOut': 'elastic',
74
+		'onClosed': function(){$('#map').css({'visibility':'hidden'});},
75
+		'onStart': function(){$('#map').css({'visibility':'visible'});}
76
+	});
77
+	$('#myAdressField').keydown(function(e){
78
+		var code = (e.keyCode ? e.keyCode : e.which);
79
+		if(code == 13) {
80
+			e.preventDefault();
81
+			var adress = $(this).val();
82
+			geocodeMarker(adress,adress,adress,'','http://maps.gstatic.com/intl/fr_ALL/mapfiles/markers/marker_sprite.png');
83
+			geocodeCenter(adress);
84
+			$('#gmapLink').trigger('click');
85
+			
86
+		}
87
+	});
88
+});
89
+

class/Links.php → modules/links/Links.php View File

@@ -1,6 +1,10 @@
1 1
 <?php
2
-class links {
2
+class links extends Module{
3 3
 
4
+	protected $moduleName;
5
+	protected $moduleTitle;
6
+	protected $pathToModule;
7
+	
4 8
 	protected static $paramsList = array(
5 9
 		'visibility'
6 10
 	);
@@ -10,12 +14,14 @@ class links {
10 14
 	public $params = array();
11 15
 	
12 16
 	public function __construct($params){
17
+		$this->moduleName = get_class();
18
+		$this->pathToModule = 'modules/'.$this->moduleName.'/';
13 19
 		$this->setParams($params);
14
-		echo '<script type="text/javascript" src="js/jquery.links.js"></script>
15
-				<link rel="stylesheet" href="css/links.css" type="text/css" />
20
+		echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
21
+				<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />
16 22
 				<div style="display:none;"><div id="links-add-fancy"></div></div>
17 23
 				<div class="appscontainer">';
18
-		if($links_xml = simplexml_load_file(self::LINKS_FILE)){
24
+		if($links_xml = simplexml_load_file($this->pathToModule.self::LINKS_FILE)){
19 25
 			$links = $links_xml->label;
20 26
 			foreach($links as $label){
21 27
 				//<span class="label">'.$label['id'].'</span>
@@ -27,7 +33,7 @@ class links {
27 33
 						<hr>';
28 34
 			}
29 35
 		}else{
30
-			echo 'Can\'t find '.self::LINKS_FILE;
36
+			echo 'Can\'t find '.$this->pathToModule.self::LINKS_FILE;
31 37
 		}
32 38
 		echo '</div>';
33 39
 		

ajax/listToReserve.php → modules/links/ajax/listToReserve.php View File


ajax/loadReserve.php → modules/links/ajax/loadReserve.php View File

@@ -1,6 +1,5 @@
1 1
 <?
2
-include '../class/Links.php';
3
-if($links_xml = simplexml_load_file('../'.links::LINKS_FILE)){
2
+if($links_xml = simplexml_load_file("../db/links.xml")){
4 3
 	$links = $links_xml->reserve;
5 4
 	foreach($links as $label){
6 5
 		echo '<ul id="reserveiconlist">';

ajax/reserveToList.php → modules/links/ajax/reserveToList.php View File


ajax/update-links-order.php → modules/links/ajax/update-links-order.php View File


css/links.css → modules/links/css/links.css View File


db/links.xml → modules/links/db/links.xml View File


js/jquery.links.js → modules/links/js/links.js View File

@@ -15,7 +15,7 @@ $(document).ready(function(){
15 15
 	
16 16
 	// Apparition de la reserve de liens
17 17
 	$('#links-menu').live('click', function(){
18
-		$.get('ajax/loadReserve.php', function(html){
18
+		$.get('modules/links/ajax/loadReserve.php', function(html){
19 19
 			$.fancybox(
20 20
 					html,
21 21
 					{
@@ -32,7 +32,7 @@ $(document).ready(function(){
32 32
 	// Passage Reserve => Liste
33 33
 	$('#reserveiconlist .iconitem').live('click', function(e){
34 34
 		e.preventDefault();
35
-		$.post("ajax/reserveToList.php", {reserve: $(this).attr('id')});
35
+		$.post("modules/links/ajax/reserveToList.php", {reserve: $(this).attr('id')});
36 36
 		$('.iconlist').last().append('<li class="iconitem" id="'+$(this).attr('id')+'">'+$(this).html()+'</li>');
37 37
 		$.fancybox.close();
38 38
 	});
@@ -47,7 +47,7 @@ $(document).ready(function(){
47 47
 	});
48 48
 	
49 49
 	$('.deleteLink').click(function(){
50
-		$.post("ajax/listToReserve.php", {reserve: $(this).parent().attr('id')});
50
+		$.post("modules/links/ajax/listToReserve.php", {reserve: $(this).parent().attr('id')});
51 51
 		$(this).parent().fadeOut();
52 52
 	});
53 53
 	
@@ -59,7 +59,7 @@ $(document).ready(function(){
59 59
 				var linkOrder 	= $(this).sortable('toArray').toString();
60 60
 				var label		= $(ui.item).parent()[0].id;
61 61
 				var itemMoved 	= $(ui.item)[0].id;
62
-				$.post("ajax/update-links-order.php", {order: linkOrder, label : label, itemMoved: itemMoved});
62
+				$.post("modules/links/ajax/update-links-order.php", {order: linkOrder, label : label, itemMoved: itemMoved});
63 63
 			},
64 64
 			start: function(e) {
65 65
 				// have to remvoe click handler off item so drop doesn't click

class/Mappy.php → modules/mappy/Mappy.php View File

@@ -8,10 +8,12 @@ class mappy extends Module {
8 8
 	public $params = array();
9 9
 	
10 10
 	public function __construct($params){
11
+		$this->moduleName = get_class();
12
+		$this->pathToModule = 'modules/'.$this->moduleName.'/';
11 13
 		$this->setParams($params);
14
+		echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
15
+				<link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css">';
12 16
 		echo '<script src="http://axe.mappy.com/1v1/init/get.aspx?version=2.01&solution=ajax&auth=HbTTpMfC4//GWuldL2IsF+HJA4xVuTBsIQi0wcC7xRz+e17hobrJ+1947aq34rdjYAPy6nBYBQF8o56Qzdun9w=="></script>
13
-				<script type="text/javascript" src="js/mappy.js"></script>
14
-				<link type="text/css" rel="stylesheet" href="css/mappy.css" />
15 17
 				<div id="mymap"></div>
16 18
 				<div id="myAdress"><input type="text" name="myAdressField" id="myAdressField" /></div>';
17 19
 	}

css/mappy.css → modules/mappy/css/mappy.css View File


js/mappy.js → modules/mappy/js/mappy.js View File


class/News.php → modules/news/News.php View File


class/Notes.php → modules/notes/Notes.php View File

@@ -1,6 +1,10 @@
1 1
 <?php
2 2
 class notes extends Module {
3 3
 
4
+	protected $moduleName;
5
+	protected $moduleTitle;
6
+	protected $pathToModule;
7
+
4 8
 	protected static $paramsList = array(
5 9
 		'visibility'
6 10
 	);
@@ -8,11 +12,13 @@ class notes extends Module {
8 12
 	public $params = array();
9 13
 	
10 14
 	public function __construct($params){
15
+		$this->moduleName = get_class();
16
+		$this->pathToModule = 'modules/'.$this->moduleName.'/';
11 17
 		$this->setParams($params);
12
-		echo '<script type="text/javascript" src="js/jquery.notes.js"></script>
13
-				<link rel="stylesheet" type="text/css" href="css/note.css">
14
-				<a id="addButton" class="green-button" href="add_note.html">Add a note</a>';
15
-		include 'notes_extract.php';
18
+		echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
19
+				<link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css">
20
+				<a id="addButton" class="green-button" href="'.$this->pathToModule.'includes/add_note.html">Add a note</a>';
21
+		include $this->pathToModule.'includes/notes_extract.php';
16 22
 	}
17 23
 	
18 24
 	private function setParams($params){

ajax/update_position.php → modules/notes/ajax/update_position.php View File


css/note.css → modules/notes/css/notes.css View File

@@ -112,7 +112,7 @@ h3.popupTitle{
112 112
 }
113 113
 
114 114
 #note-submit{	margin:20px auto; }
115
-.delete {display:none; height:16px; width:16px; background:url(../images/interface/delete.png) top left no-repeat; position:absolute; top:5px; right:5px; z-index:9999;}
115
+.delete {display:none; height:16px; width:16px; background:url(../../../images/interface/delete.png) top left no-repeat; position:absolute; top:5px; right:5px; z-index:9999;}
116 116
 .delete:hover{cursor:pointer !important;}
117 117
 
118 118
 

db/notes.xml → modules/notes/db/notes.xml View File


add_note.html → modules/notes/includes/add_note.html View File


notes_extract.php → modules/notes/includes/notes_extract.php View File

@@ -1,5 +1,5 @@
1 1
 <?php $nb = 0;
2
-$notes = simplexml_load_file('db/notes.xml');
2
+$notes = simplexml_load_file('modules/notes/db/notes.xml');
3 3
 foreach($notes as $test){$nb++;}
4 4
 for($i=0; $i<$nb; $i++){?>
5 5
 <div class="note <?echo $notes->note[$i]->color;?>" style="position:absolute; left:<? echo $notes->note[$i]->left;?>; top:<? echo $notes->note[$i]->top;?>;z-index:<? echo $notes->note[$i]->zindex;?>;"><div class="delete" id="r-<?echo $notes->note[$i]['id'];?>"></div><? echo $notes->note[$i]->text;?><br/><span class="data"><?echo $notes->note[$i]['id'];?></span></div>

js/jquery.notes.js → modules/notes/js/notes.js View File

@@ -14,7 +14,7 @@ $(document).ready(function(){
14 14
 		var data2 = {'id' : $(this).attr("id")};
15 15
 		$(this).replaceWith('<img src="images/interface/ajax_load.gif" style="display:block" />');
16 16
 		/* Sending an AJAX POST request: */
17
-		$.post('ajax/delete-notes.php',data2,function(msg2){
17
+		$.post('modules/notes/ajax/delete-notes.php',data2,function(msg2){
18 18
 			if(parseInt(msg2))
19 19
 			{
20 20
 			msg2--;
@@ -88,7 +88,7 @@ $(document).ready(function(){
88 88
 		};
89 89
 
90 90
 		/* Sending an AJAX POST request: */
91
-		$.post('ajax/post-notes.php',data,function(msg){
91
+		$.post('modules/notes/ajax/post-notes.php',data,function(msg){
92 92
 
93 93
 			if(parseInt(msg))
94 94
 			{
@@ -119,7 +119,7 @@ function make_draggable(elements)
119 119
 		stop:function(e,ui){
120 120
 
121 121
 			/* Sending the z-index and positon of the note to update_position.php via AJAX GET: */
122
-			$.get('ajax/update_position.php',{
122
+			$.get('modules/notes/ajax/update_position.php',{
123 123
 				x		: ui.position.left,
124 124
 				y		: ui.position.top,
125 125
 				z		: zIndex,

class/Ouifm.php → modules/ouifm/Ouifm.php View File

@@ -10,8 +10,11 @@ class ouifm extends Module {
10 10
 	public $params = array();
11 11
 	
12 12
 	public function __construct($params){
13
+		$this->moduleName = get_class();
14
+		$this->pathToModule = 'modules/'.$this->moduleName.'/';
13 15
 		$this->setParams($params);
14
-		echo '<script type="text/javascript" src="js/jquery.ouifm.js"></script>';
16
+		echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
17
+				<link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css">';
15 18
 		echo '<div id="ouifm" style="left:'.$params['x'].'; top:'.$params['y'].';"></div>';
16 19
 	}
17 20
 	

+ 0
- 0
modules/ouifm/css/ouifm.css View File


js/jquery.ouifm.js → modules/ouifm/js/ouifm.js View File


class/Rssblogs.php → modules/rssblogs/Rssblogs.php View File

@@ -10,8 +10,11 @@ class rssblogs extends Module {
10 10
 	public $params = array();
11 11
 
12 12
 	public function __construct($params){
13
+		$this->moduleName = get_class();
14
+		$this->pathToModule = 'modules/'.$this->moduleName.'/';
13 15
 		$this->setParams($params);
14
-		echo '<link rel="stylesheet" type="text/css" href="css/rssblogs.css"><div id="rssblogs">';
16
+		echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
17
+				<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />';
15 18
 		require('class/lastRSS.php');
16 19
 		$rss = new lastRSS;
17 20
 		// options lastRSS
@@ -19,7 +22,7 @@ class rssblogs extends Module {
19 22
 		$rss->cache_time  = 3600;      // fréquence de mise à jour du cache (en secondes)
20 23
 		$rss->date_format = 'd/m/y';     // format de la date (voir fonction date() pour syntaxe)
21 24
 		$rss->CDATA       = 'content'; // on retire les tags CDATA en conservant leur contenu
22
-		if($linksXML = simplexml_load_file('db/rss.xml')){
25
+		if($linksXML = simplexml_load_file($this->pathToModule.'db/rss.xml')){
23 26
 			foreach($linksXML->link as $individualLink){
24 27
 				if ($rs = $rss->get($individualLink->url)) 
25 28
 					echo '<span class="date">'.$rs['items'][0]['pubDate'].'</span> <a href="'.$rs['items'][0]['link'].'">'.$rs['items'][0]['title'].'</a><br />';

css/rssblogs.css → modules/rssblogs/css/rssblogs.css View File


db/rss.xml → modules/rssblogs/db/rss.xml View File


+ 0
- 0
modules/rssblogs/js/rssblogs.js View File


+ 62
- 0
modules/search/Search.php View File

@@ -0,0 +1,62 @@
1
+<?php
2
+class search extends Module {
3
+	
4
+	protected $moduleName;
5
+	protected $moduleTitle;
6
+	protected $pathToModule;
7
+
8
+	protected static $paramsList = array(
9
+		'visibility'
10
+	);
11
+	public $params = array();
12
+	
13
+	public function __construct($params){
14
+		$this->moduleName = get_class();
15
+		$this->pathToModule = 'modules/'.$this->moduleName.'/';
16
+		$this->setParams($params);
17
+		echo '<link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/search.css">
18
+				<script type="text/javascript" src="'.$this->pathToModule.'js/jquery.search.js"></script>
19
+				<form id="searchForm" method="post">
20
+				<fieldset>
21
+					<input id="s" type="text" />
22
+					<input type="submit" value="Submit" id="submitButton" class="searchbutton" />
23
+
24
+					<ul class="icons">
25
+						<li class="web" title="Web Search" data-searchType="web">Web</li>
26
+						<li class="images" title="Image Search" data-searchType="images">Images</li>
27
+						<li class="news" title="News Search" data-searchType="news">News</li>
28
+						<li class="videos" title="Video Search" data-searchType="video">Videos</li>
29
+					</ul>
30
+
31
+				</fieldset>
32
+			</form>';
33
+	}
34
+	
35
+	private function setParams($params){
36
+		$this->params = $params;
37
+	}
38
+	
39
+	public static function start($params){
40
+		$search = new search($params);
41
+	}
42
+	
43
+	public function setVisibility($visibility){
44
+		// Saving the position and z-index of the note:
45
+		$xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE);
46
+
47
+		$path = $xmla->xpath("//item[@id='search']"); 
48
+		$path[0]->visibility = $visibility;
49
+		
50
+		$xmla->asXML('../'.AccueilModules::CONFIG_FILE);
51
+		
52
+		echo "ok";
53
+	}
54
+	
55
+	public static function updateConfig($updated){
56
+		foreach ($updated as $what=>$withWhat){
57
+			if(in_array($what, self::$paramsList)){
58
+				call_user_func(array(get_class(), "set".ucfirst($what)), $withWhat);
59
+			}
60
+		}
61
+	}
62
+}

css/search.css → modules/search/css/search.css View File

@@ -21,7 +21,7 @@ fieldset{
21 21
 	border:none;
22 22
 	color:#888888;
23 23
 	/*background:url("../images/interface/searchBox.png") no-repeat;*/
24
-	background:url('../images/interface/zoom.png') 10px center no-repeat;
24
+	background:url('../../../images/interface/zoom.png') 10px center no-repeat;
25 25
 	border:1px solid #888888;
26 26
 	float:left;
27 27
 	font-family:Arial,Helvetica,sans-serif;
@@ -58,7 +58,7 @@ fieldset{
58 58
 }
59 59
 
60 60
 .icons li{
61
-	background:url("../images/interface/icons.png") no-repeat;
61
+	background:url("../../../images/interface/icons.png") no-repeat;
62 62
 	float:left;
63 63
 	height:19px;
64 64
 	text-indent:-999px;
@@ -91,7 +91,7 @@ span.arrow{
91 91
 	height:6px;
92 92
 	margin:21px 0 0 5px;
93 93
 	position:absolute;
94
-	background:url('../images/interface/arrow.png') no-repeat;
94
+	background:url('../../../images/interface/arrow.png') no-repeat;
95 95
 	left:0;
96 96
 }
97 97
 
@@ -154,7 +154,7 @@ span.arrow{
154 154
 #more{
155 155
 	width:83px;
156 156
 	height:24px;
157
-	background:url('../images/interface/more.png') no-repeat;
157
+	background:url('../../../images/interface/more.png') no-repeat;
158 158
 	cursor:pointer;
159 159
 	margin:40px auto;
160 160
 }

js/jquery.search.js → modules/search/js/search.js View File


class/Todo.php → modules/todo/Todo.php View File

@@ -1,6 +1,7 @@
1 1
 <?php
2 2
 class todo extends Module {
3 3
 
4
+	
4 5
 	protected static $paramsList = array(
5 6
 		'visibility',
6 7
 		'x',
@@ -8,29 +9,32 @@ class todo extends Module {
8 9
 	);
9 10
 
10 11
 	public $params = array();
11
-	private $persistance = 'db/todoist.xml';
12
+	const TODO_FILE = 'db/todoist.xml';
12 13
 	private $token;
13 14
 	private $project_name;
14 15
 	private $project_id;
15 16
 	
16 17
 	public function __construct($params){
18
+		$this->moduleName = get_class();
19
+		$this->pathToModule = 'modules/'.$this->moduleName.'/';
17 20
 		$this->setParams($params);
18
-		echo '<link rel="stylesheet" type="text/css" href="css/todo.css">';
19
-		if($xmla = simplexml_load_file($this->persistance)){
21
+		echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
22
+				<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />';
23
+		if($xmla = simplexml_load_file($this->pathToModule.self::TODO_FILE)){
20 24
 			$this->setToken($xmla->token);
21 25
 			$this->setProjectName($xmla->name);
22 26
 			$this->setProjectId($xmla->id);
23 27
 			echo '<div id="todo" style="top:'.$params['y'].'; left :'.$params['x'].';">';
24 28
 			if($this->token == null || $this->project_id == null)
25
-				echo 'Impossible de trouver votre configuration. <a href="install-todoist.php">Cliquez ici</a> pour la mettre en place.</div>';
29
+				echo 'Impossible de trouver votre configuration. <a href="'.$this->pathToModule.'includes/install-todoist.php">Cliquez ici</a> pour la mettre en place.</div>';
26 30
 			else{
27 31
 				$token 	= $xmla->token;
28 32
 				$id		= $xmla->id;
29
-				echo '</div><script type="text/javascript" src="js/getUncompletedTasks.php?token='.$token.'&id='.$id.'"></script>';
33
+				echo '</div><script type="text/javascript" src="'.$this->pathToModule.'js/getUncompletedTasks.php?token='.$token.'&id='.$id.'"></script>';
30 34
 			}
31 35
 			echo '<script>
32 36
 					$(document).ready(function(){
33
-					$(\'#todo\').resizable();
37
+						$(\'#todo\').resizable();
34 38
 					});</script>';
35 39
 		}else{
36 40
 			echo 'baaaaad persistance...';

ajax/saveTodoist.php → modules/todo/ajax/saveTodoist.php View File


css/todo.css → modules/todo/css/todo.css View File

@@ -6,12 +6,12 @@
6 6
 
7 7
 #todo ul{list-style:none;}
8 8
 #todo ul li{white-space : nowrap; padding-left:16px;}
9
-#todo ul li div.puce{width: 16px; height: 16px; background:url(../images/interface/ui-icons_888888_256x240.png) -32px -48px no-repeat; display:inline-block;}
9
+#todo ul li div.puce{width: 16px; height: 16px; background:url(../../../images/interface/ui-icons_888888_256x240.png) -32px -48px no-repeat; display:inline-block;}
10 10
 
11 11
 
12 12
 		
13 13
 .ui-resizable { position: relative;}
14
-.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; background-position: -80px -224px;background-image: url(../images/interface/ui-icons_888888_256x240.png);}
14
+.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; background-position: -80px -224px;background-image: url(../../../images/interface/ui-icons_888888_256x240.png);}
15 15
 .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
16 16
 .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
17 17
 .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }

db/todoist.xml → modules/todo/db/todoist.xml View File


getProjectsList.php → modules/todo/includes/getProjectsList.php View File

@@ -1,5 +1,5 @@
1 1
 <?

2
-$xmla = simplexml_load_file('db/todoist.xml');

2
+$xmla = simplexml_load_file('../db/todoist.xml');

3 3
 if($xmla->token== '' || $xmla->token == null)

4 4
 	header('Location: install-todoist.php');

5 5
 if($xmla->name == '' || $xmla->name == null):?>

@@ -7,7 +7,7 @@ if($xmla->name == '' || $xmla->name == null):?>
7 7
 	<head>
		
		<style>
			.selectableProject{text-decoration:underline; color:blue; cursor:pointer;}
		</style>
8 8
 		<title>Todoist : getProjects</title>   

9 9
 		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

10
-		<script type="text/javascript" src="js/getProjectsList.php?token=<?=$xmla->token?>"></script>

10
+		<script type="text/javascript" src="../js/getProjectsList.php?token=<?=$xmla->token?>"></script>

11 11
       </head>  

12 12
       <body>  

13 13
 		


+ 12
- 0
modules/todo/includes/getUncompletedTasks.php View File

@@ -0,0 +1,12 @@
1
+<?

2
+$xmla = simplexml_load_file('../db/todoist.xml');

3
+if($xmla->token== '' || $xmla->token == null)

4
+	header('Location: ./');

5
+if($xmla->id != '' || $xmla->id != null): 

6
+$token 	= $xmla->token;

7
+$id		= $xmla->id;?>

8
+

9
+<script type="text/javascript" src="../js/getUncompletedTasks.php?token=<?=$token?>&id=<?=$id?>"></script>

10
+	<? else:

11
+		header('Location: getProjectsList.php');

12
+	endif;

install-todoist.php → modules/todo/includes/install-todoist.php View File

@@ -1,11 +1,11 @@
1 1
 <?
2
-$xmla = simplexml_load_file('db/todoist.xml');
2
+$xmla = simplexml_load_file('../db/todoist.xml');
3 3
 if($xmla->token == '' || $xmla->token == null):?>
4 4
 <html>  
5 5
 	<head>
6 6
 		<title>Todoist : Login</title>   
7 7
 		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
8
-		<script type="text/javascript" src="js/index.js"></script>
8
+		<script type="text/javascript" src="../js/index.js"></script>
9 9
  
10 10
       </head>  
11 11
       <body> 

modules/todo/js/getProjectsList.php
File diff suppressed because it is too large
View File


js/getUncompletedTasks.php → modules/todo/js/getUncompletedTasks.php View File


js/index.js → modules/todo/js/index.js View File

@@ -3,7 +3,7 @@ function cbfunc(o){
3 3
 	if(token == undefined){

4 4
 		$('#error').html('Identification erronnée');

5 5
 	}else{

6
-		$.post('ajax/saveTodoist.php', {token: token}, function(data){
			$('body').append('<a href="getProjectsList.php">Etape suivante</a>');
			if(data=="ok"){
6
+		$.post('../ajax/saveTodoist.php', {token: token}, function(data){
			$('body').append('<a href="getProjectsList.php">Etape suivante</a>');
			if(data=="ok"){
7 7
 				location.reload();
			}else{
				alert(data);
			}
8 8
 		}); 

9 9
 	}


+ 0
- 0
modules/todo/js/todo.js View File


class/Weather.php → modules/weather/Weather.php View File

@@ -1,7 +1,11 @@
1 1
 <?php
2 2
 
3 3
 class weather extends Module {
4
-	//TODO rajouter les params en détail
4
+
5
+	protected $moduleName;
6
+	protected $moduleTitle;
7
+	protected $pathToModule;
8
+	
5 9
 	protected static $paramsList = array(
6 10
 		'visibility',
7 11
 		'city',
@@ -12,11 +16,13 @@ class weather extends Module {
12 16
 	public $params = array();
13 17
 
14 18
 	public function __construct($params){
19
+		$this->moduleName = get_class();
20
+		$this->pathToModule = 'modules/'.$this->moduleName.'/';
15 21
 		$this->setParams($params);
16 22
 		$ville = $params['city'];
17
-		include 'GoogleMeteo.php';
18
-		echo '<script type="text/javascript" src="js/jquery.weather.js"></script>
19
-				<link rel="stylesheet" type="text/css" href="css/weather.css">';
23
+		include $this->pathToModule.'includes/GoogleMeteo.php';
24
+		echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
25
+				<link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css">';
20 26
 		echo '<div id="weather" style="left:'.$params['x'].'; top:'.$params['y'].';">
21 27
 				'.$city.'<br/>
22 28
 				<div class="weatherpic"></div>

css/neige.css → modules/weather/css/neige.css View File


css/nuage.css → modules/weather/css/nuage.css View File


css/peunuage.css → modules/weather/css/peunuage.css View File


css/pluie.css → modules/weather/css/pluie.css View File


css/soleil.css → modules/weather/css/soleil.css View File


css/weather.css → modules/weather/css/weather.css View File


GoogleMeteo.php → modules/weather/includes/GoogleMeteo.php View File

@@ -18,19 +18,19 @@
18 18
 	}
19 19
 
20 20
 	if(strpos(strtolower($present_weather),"soleil") !== false) {?>
21
-		<link rel="stylesheet" type="text/css" href="css/soleil.css">
21
+		<link rel="stylesheet" type="text/css" href="modules/weather/css/soleil.css">
22 22
 			<?}
23 23
 			if(strpos(strtolower($present_weather),"nuage") !== false) {?>
24
-				<link rel="stylesheet" type="text/css" href="css/nuage.css">
24
+				<link rel="stylesheet" type="text/css" href="modules/weather/css/nuage.css">
25 25
 			<?}
26 26
 			if(strpos(strtolower($present_weather),"peu nuageux") !== false) {?>
27
-				<link rel="stylesheet" type="text/css" href="css/peunuage.css">
27
+				<link rel="stylesheet" type="text/css" href="modules/weather/css/peunuage.css">
28 28
 			<?}
29 29
 			if((strpos(strtolower($present_weather),"pluie") !== false) || (strpos(strtolower($present_weather),"averse") !== false)) {?>
30
-				<link rel="stylesheet" type="text/css" href="css/pluie.css">
30
+				<link rel="stylesheet" type="text/css" href="modules/weather/css/pluie.css">
31 31
 			<?}
32 32
 			if(strpos(strtolower($present_weather),"neige") !== false) {?>
33
-				<link rel="stylesheet" type="text/css" href="css/neige.css">
33
+				<link rel="stylesheet" type="text/css" href="modules/weather/css/neige.css">
34 34
 			<?}
35 35
 		}else{ $present_weather = 'Ville non trouvé : '.$city; }
36 36
 	}else

meteo.php → modules/weather/includes/meteo.php View File


js/jquery.weather.js → modules/weather/js/weather.js View File


Loading…
Cancel
Save