diff --git a/class/AccueilModules.php b/class/AccueilModules.php index b3f1f01..955d75f 100644 --- a/class/AccueilModules.php +++ b/class/AccueilModules.php @@ -19,7 +19,7 @@ class AccueilModules { $this->getModules(); $this->buildConfigMenu(); }else{ - echo 'baaaaad persistance...'; + echo 'Impossible de trouver le fichier de configuration.'; } } @@ -29,12 +29,12 @@ class AccueilModules { */ function getModules(){ foreach($this->modules as $module=>$moduleConf){ - if(file_exists('class/'.ucfirst($module).'.php') && $moduleConf->visibility == "true"){ + if(file_exists('modules/'.$module.'/'.ucfirst($module).'.php') && $moduleConf->visibility == "true"){ $params = array(); foreach($moduleConf as $confParam){ $params[$confParam->getName()] = "$confParam"; } - require ucfirst($module).'.php'; + require 'modules/'.$module.'/'.ucfirst($module).'.php'; call_user_func(array($module, "start"), $params); } } @@ -88,7 +88,7 @@ class AccueilModules { * @return "ok" String si c'est bon, ou le message d'erreur */ public static function updateModule($module, $things2change){ - require ucfirst($module).'.php'; + require '../modules/'.$module.'/'.ucfirst($module).'.php'; return call_user_func(array($module, "updateConfig"), $things2change); } } \ No newline at end of file diff --git a/class/Clock.php b/class/Clock.php deleted file mode 100644 index 5c0ed2f..0000000 --- a/class/Clock.php +++ /dev/null @@ -1,33 +0,0 @@ -setParams($params); - echo ''; - echo '
'; - } - - private function setParams($params){ - $this->params = $params; - } - - public static function start($params){ - $clock = new clock($params); - } - - public static function updateConfig($updated){ - foreach ($updated as $what=>$withWhat){ - if(in_array($what, self::$paramsList)){ - call_user_func(array(get_class(), "set".ucfirst($what)), $withWhat); - } - } - } -} \ No newline at end of file diff --git a/class/Module.php b/class/Module.php index 616900c..05ec710 100644 --- a/class/Module.php +++ b/class/Module.php @@ -8,6 +8,15 @@ abstract class Module */ protected static $paramsList = array(); + // Nom du module (aka le nom de la classe en minuscule) + protected $moduleName; + + // Libellé du module (aka le nom affiché) + protected $moduleTitle; + + // Le chemin vers le module + protected $pathToModule; + /** * Liste des paramètres et leurs valeurs de l'object * diff --git a/class/Search.php b/class/Search.php deleted file mode 100644 index 5b7bcf3..0000000 --- a/class/Search.php +++ /dev/null @@ -1,39 +0,0 @@ - - -
-
- - - - - -
-
'; - } - - private function setParams($params){ - $this->params = $params; - } - - public static function start($params){ - $search = new search($params); - } - - public static function updateConfig($updated){ - - } -} \ No newline at end of file diff --git a/getUncompletedTasks.php b/getUncompletedTasks.php deleted file mode 100644 index a7a33ce..0000000 --- a/getUncompletedTasks.php +++ /dev/null @@ -1,12 +0,0 @@ -token== '' || $xmla->token == null) - header('Location: index.php'); -if($xmla->id != '' || $xmla->id != null): -$token = $xmla->token; -$id = $xmla->id;?> - - - s - // Get rid of them - .replace(/]+?\/>|/gi, '') - }, 'success'); - } - - }; - })(o.success); - - } - - return _ajax.apply(this, arguments); - - }; - -})(jQuery.ajax); \ No newline at end of file diff --git a/class/Blogs.php b/modules/blogs/Blogs.php similarity index 76% rename from class/Blogs.php rename to modules/blogs/Blogs.php index 5bf5fe7..b028717 100644 --- a/class/Blogs.php +++ b/modules/blogs/Blogs.php @@ -9,10 +9,13 @@ class blogs extends Module { public $params = array(); public function __construct($params){ + $this->moduleName = get_class(); + $this->pathToModule = 'modules/'.$this->moduleName.'/'; $this->setParams($params); - require('blogs_last_post.php'); - echo ' -
'; + echo ' + '; + require($this->pathToModule.'includes/blogs_last_post.php'); + echo '
'; echo ''; echo '
@@ -24,7 +27,7 @@ class blogs extends Module { echo '
  • '.$link['url'].'
  • '; echo '

    Insert Site feed

    -
    +
    diff --git a/modules/blogs/css/blogs.css b/modules/blogs/css/blogs.css new file mode 100644 index 0000000..e69de29 diff --git a/db/blog_links.xml b/modules/blogs/db/blog_links.xml similarity index 100% rename from db/blog_links.xml rename to modules/blogs/db/blog_links.xml diff --git a/CURL.php b/modules/blogs/includes/CURL.php similarity index 100% rename from CURL.php rename to modules/blogs/includes/CURL.php diff --git a/addSite.php b/modules/blogs/includes/addSite.php similarity index 100% rename from addSite.php rename to modules/blogs/includes/addSite.php diff --git a/blogs.php b/modules/blogs/includes/blogs.php similarity index 100% rename from blogs.php rename to modules/blogs/includes/blogs.php diff --git a/blogs_last_post.php b/modules/blogs/includes/blogs_last_post.php similarity index 93% rename from blogs_last_post.php rename to modules/blogs/includes/blogs_last_post.php index 952afc4..20fd63e 100644 --- a/blogs_last_post.php +++ b/modules/blogs/includes/blogs_last_post.php @@ -30,7 +30,7 @@ function getResult() } public function getLinks(){ - if($linksXML = simplexml_load_file('db/blog_links.xml')){ + if($linksXML = simplexml_load_file('../db/blog_links.xml')){ foreach($linksXML->link as $individualLink){ $this->link[] = array('name'=>$individualLink->name, 'url'=>$individualLink->url, 'number'=>$individualLink->number); } diff --git a/js/jquery.blogs.js b/modules/blogs/js/blogs.js similarity index 88% rename from js/jquery.blogs.js rename to modules/blogs/js/blogs.js index 01cd285..7a030db 100644 --- a/js/jquery.blogs.js +++ b/modules/blogs/js/blogs.js @@ -10,7 +10,7 @@ var tmp; make_draggable($('#blogs')); $.ajax( - {url : "blogs.php", + {url : "modules/blogs/includes/blogs.php", timeout : 36000, error: function(data){ $("#blogs").html(' Délai dépassé !'); diff --git a/modules/clock/Clock.php b/modules/clock/Clock.php new file mode 100644 index 0000000..0e948f4 --- /dev/null +++ b/modules/clock/Clock.php @@ -0,0 +1,48 @@ +moduleName = get_class(); + $this->pathToModule = 'modules/'.$this->moduleName.'/'; + $this->setParams($params); + echo ' + '; + echo '
    '; + } + + private function setParams($params){ + $this->params = $params; + } + + public static function start($params){ + $clock = new clock($params); + } + + public function setVisibility($visibility){ + // Saving the position and z-index of the note: + $xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE); + + $path = $xmla->xpath("//item[@id='clock']"); + $path[0]->visibility = $visibility; + + $xmla->asXML('../'.AccueilModules::CONFIG_FILE); + + echo "ok"; + } + + public static function updateConfig($updated){ + foreach ($updated as $what=>$withWhat){ + if(in_array($what, self::$paramsList)){ + call_user_func(array(get_class(), "set".ucfirst($what)), $withWhat); + } + } + } +} \ No newline at end of file diff --git a/modules/clock/css/clock.css b/modules/clock/css/clock.css new file mode 100644 index 0000000..e69de29 diff --git a/js/jquery.jclock.js b/modules/clock/js/clock.js similarity index 100% rename from js/jquery.jclock.js rename to modules/clock/js/clock.js diff --git a/class/ClockAdvanced.php b/modules/clockAdvanced/ClockAdvanced.php similarity index 88% rename from class/ClockAdvanced.php rename to modules/clockAdvanced/ClockAdvanced.php index 3e6ce58..560b6e8 100644 --- a/class/ClockAdvanced.php +++ b/modules/clockAdvanced/ClockAdvanced.php @@ -13,8 +13,11 @@ class clockAdvanced extends Module { public $params = array(); public function __construct($params){ + $this->moduleName = get_class(); + $this->pathToModule = 'modules/'.$this->moduleName.'/'; $this->setParams($params); - echo ''; + echo ' + '; echo '
    '; $options = ''; foreach (self::$paramsList as $paramName){ diff --git a/modules/clockAdvanced/css/clockAdvanced.css b/modules/clockAdvanced/css/clockAdvanced.css new file mode 100644 index 0000000..e69de29 diff --git a/js/jquery.jclockAdvanced.js b/modules/clockAdvanced/js/clockAdvanced.js similarity index 100% rename from js/jquery.jclockAdvanced.js rename to modules/clockAdvanced/js/clockAdvanced.js diff --git a/class/Gmap.php b/modules/gmap/Gmap.php similarity index 51% rename from class/Gmap.php rename to modules/gmap/Gmap.php index 2a033f3..53840d6 100644 --- a/class/Gmap.php +++ b/modules/gmap/Gmap.php @@ -9,27 +9,14 @@ class gmap extends Module { public $params = array(); public function __construct($params){ + $this->moduleName = get_class(); + $this->pathToModule = 'modules/'.$this->moduleName.'/'; $this->setParams($params); - echo ' - + echo ' + + -
    '; - - include 'GoogleMapAPIv3.class.php'; - $gmap = new GoogleMapAPI(); - $gmap->setDivId('mymap'); //crée une div avec l'id donnée - //$gmap->setDirectionDivId('route'); - $gmap->setCenter('Paris France'); // Adresse du centre par défaut - $gmap->setEnableWindowZoom(true); // Permet de zoomer (trop important !) - $gmap->setEnableAutomaticCenterZoom(false); // FALSE ! ou sinon le setCenter ne sert à rien ! - //$gmap->setDisplayDirectionFields(false); - $gmap->setSize('400px','400px'); // La taille... duh ! - $gmap->setZoom(11); // Le zoom (+ il est haut, plus le zoom est proche) - $gmap->setLang('fr'); // La langue par défaut - $gmap->setDefaultHideMarker(false); // Cache les markers ? - $gmap->generate(); // Génère le JS - echo $gmap->getGoogleMap(); - echo '
    '; +
    '; } private function setParams($params){ diff --git a/css/gmap.css b/modules/gmap/css/gmap.css similarity index 100% rename from css/gmap.css rename to modules/gmap/css/gmap.css diff --git a/modules/gmap/js/gmap.js b/modules/gmap/js/gmap.js new file mode 100644 index 0000000..1461275 --- /dev/null +++ b/modules/gmap/js/gmap.js @@ -0,0 +1,89 @@ + +$(document).ready(function(){ +var geocoder = new google.maps.Geocoder(); +var map; +var gmarkers = []; +var infowindow; +var directions = new google.maps.DirectionsRenderer(); +var directionsService = new google.maps.DirectionsService(); +var current_lat = 0; +var current_lng = 0; +function getCurrentLat() { + return current_lat; +} +function getCurrentLng() { + return current_lng; +} +function addMarker(latlng,title,content,category,icon) { + var marker = new google.maps.Marker({ + map: map, + title : title, + icon: new google.maps.MarkerImage(icon, new google.maps.Size(57,34)), + position: latlng + }); + var html = '
    '+content+'
    ' + google.maps.event.addListener(marker, "click", function() { + if (infowindow) infowindow.close(); + infowindow = new google.maps.InfoWindow({content: html}); + infowindow.open(map,marker); + map.setCenter(new google.maps.LatLng(latlng.lat(),latlng.lng()),3); + }); + marker.mycategory = category; + gmarkers.push(marker); +} +function geocodeMarker(address,title,content,category,icon) { + if (geocoder) { + geocoder.geocode( { "address" : address}, function(results, status) { + if (status == google.maps.GeocoderStatus.OK) { + var latlng = results[0].geometry.location; + addMarker(results[0].geometry.location,title,content,category,icon) + } + }); + } +} +function geocodeCenter(address) { + if (geocoder) { + geocoder.geocode( { "address": address}, function(results, status) { + if (status == google.maps.GeocoderStatus.OK) { + map.setCenter(results[0].geometry.location); + } else { + alert("Geocode was not successful for the following reason: " + status); + } + }); + } +} +function initialize() { + var myLatlng = new google.maps.LatLng(48.8792,2.34778); + var myOptions = { + zoom: 11, + center: myLatlng, + mapTypeId: google.maps.MapTypeId.ROADMAP + } + map = new google.maps.Map(document.getElementById("mymap"), myOptions); + geocodeCenter("Paris France"); + google.maps.event.addListener(map,"click",function(event) { if (event) { current_lat=event.latLng.lat();current_lng=event.latLng.lng(); }}) ; + directions.setMap(map); + directions.setPanel(document.getElementById("route")) +} + initialize(); + $('#menu-bar').append($('#myAdress')); + $('#map').css({'visibility':'hidden'}); + $('#gmapLink').fancybox({ + 'transitionIn': 'elastic', + 'transitionOut': 'elastic', + 'onClosed': function(){$('#map').css({'visibility':'hidden'});}, + 'onStart': function(){$('#map').css({'visibility':'visible'});} + }); + $('#myAdressField').keydown(function(e){ + var code = (e.keyCode ? e.keyCode : e.which); + if(code == 13) { + e.preventDefault(); + var adress = $(this).val(); + geocodeMarker(adress,adress,adress,'','http://maps.gstatic.com/intl/fr_ALL/mapfiles/markers/marker_sprite.png'); + geocodeCenter(adress); + $('#gmapLink').trigger('click'); + + } + }); +}); + diff --git a/class/Links.php b/modules/links/Links.php similarity index 74% rename from class/Links.php rename to modules/links/Links.php index b57e95c..dc4decc 100644 --- a/class/Links.php +++ b/modules/links/Links.php @@ -1,6 +1,10 @@ moduleName = get_class(); + $this->pathToModule = 'modules/'.$this->moduleName.'/'; $this->setParams($params); - echo ' - + echo ' +
    '; - if($links_xml = simplexml_load_file(self::LINKS_FILE)){ + if($links_xml = simplexml_load_file($this->pathToModule.self::LINKS_FILE)){ $links = $links_xml->label; foreach($links as $label){ //'.$label['id'].' @@ -27,7 +33,7 @@ class links {
    '; } }else{ - echo 'Can\'t find '.self::LINKS_FILE; + echo 'Can\'t find '.$this->pathToModule.self::LINKS_FILE; } echo '
    '; diff --git a/ajax/listToReserve.php b/modules/links/ajax/listToReserve.php similarity index 100% rename from ajax/listToReserve.php rename to modules/links/ajax/listToReserve.php diff --git a/ajax/loadReserve.php b/modules/links/ajax/loadReserve.php similarity index 78% rename from ajax/loadReserve.php rename to modules/links/ajax/loadReserve.php index 0985268..4832053 100644 --- a/ajax/loadReserve.php +++ b/modules/links/ajax/loadReserve.php @@ -1,6 +1,5 @@ reserve; foreach($links as $label){ echo '
      '; diff --git a/ajax/reserveToList.php b/modules/links/ajax/reserveToList.php similarity index 100% rename from ajax/reserveToList.php rename to modules/links/ajax/reserveToList.php diff --git a/ajax/update-links-order.php b/modules/links/ajax/update-links-order.php similarity index 100% rename from ajax/update-links-order.php rename to modules/links/ajax/update-links-order.php diff --git a/css/links.css b/modules/links/css/links.css similarity index 100% rename from css/links.css rename to modules/links/css/links.css diff --git a/db/links.xml b/modules/links/db/links.xml similarity index 100% rename from db/links.xml rename to modules/links/db/links.xml diff --git a/js/jquery.links.js b/modules/links/js/links.js similarity index 85% rename from js/jquery.links.js rename to modules/links/js/links.js index e2e6dbb..a3ed412 100644 --- a/js/jquery.links.js +++ b/modules/links/js/links.js @@ -15,7 +15,7 @@ $(document).ready(function(){ // Apparition de la reserve de liens $('#links-menu').live('click', function(){ - $.get('ajax/loadReserve.php', function(html){ + $.get('modules/links/ajax/loadReserve.php', function(html){ $.fancybox( html, { @@ -32,7 +32,7 @@ $(document).ready(function(){ // Passage Reserve => Liste $('#reserveiconlist .iconitem').live('click', function(e){ e.preventDefault(); - $.post("ajax/reserveToList.php", {reserve: $(this).attr('id')}); + $.post("modules/links/ajax/reserveToList.php", {reserve: $(this).attr('id')}); $('.iconlist').last().append('
    • '+$(this).html()+'
    • '); $.fancybox.close(); }); @@ -47,7 +47,7 @@ $(document).ready(function(){ }); $('.deleteLink').click(function(){ - $.post("ajax/listToReserve.php", {reserve: $(this).parent().attr('id')}); + $.post("modules/links/ajax/listToReserve.php", {reserve: $(this).parent().attr('id')}); $(this).parent().fadeOut(); }); @@ -59,7 +59,7 @@ $(document).ready(function(){ var linkOrder = $(this).sortable('toArray').toString(); var label = $(ui.item).parent()[0].id; var itemMoved = $(ui.item)[0].id; - $.post("ajax/update-links-order.php", {order: linkOrder, label : label, itemMoved: itemMoved}); + $.post("modules/links/ajax/update-links-order.php", {order: linkOrder, label : label, itemMoved: itemMoved}); }, start: function(e) { // have to remvoe click handler off item so drop doesn't click diff --git a/class/Mappy.php b/modules/mappy/Mappy.php similarity index 77% rename from class/Mappy.php rename to modules/mappy/Mappy.php index 130f4c3..62a0392 100644 --- a/class/Mappy.php +++ b/modules/mappy/Mappy.php @@ -8,10 +8,12 @@ class mappy extends Module { public $params = array(); public function __construct($params){ + $this->moduleName = get_class(); + $this->pathToModule = 'modules/'.$this->moduleName.'/'; $this->setParams($params); + echo ' + '; echo ' - -
      '; } diff --git a/css/mappy.css b/modules/mappy/css/mappy.css similarity index 100% rename from css/mappy.css rename to modules/mappy/css/mappy.css diff --git a/js/mappy.js b/modules/mappy/js/mappy.js similarity index 100% rename from js/mappy.js rename to modules/mappy/js/mappy.js diff --git a/class/News.php b/modules/news/News.php similarity index 100% rename from class/News.php rename to modules/news/News.php diff --git a/class/Notes.php b/modules/notes/Notes.php similarity index 59% rename from class/Notes.php rename to modules/notes/Notes.php index 2fbc07a..f7a0dab 100644 --- a/class/Notes.php +++ b/modules/notes/Notes.php @@ -1,6 +1,10 @@ moduleName = get_class(); + $this->pathToModule = 'modules/'.$this->moduleName.'/'; $this->setParams($params); - echo ' - - Add a note'; - include 'notes_extract.php'; + echo ' + + Add a note'; + include $this->pathToModule.'includes/notes_extract.php'; } private function setParams($params){ diff --git a/ajax/update_position.php b/modules/notes/ajax/update_position.php similarity index 100% rename from ajax/update_position.php rename to modules/notes/ajax/update_position.php diff --git a/css/note.css b/modules/notes/css/notes.css similarity index 90% rename from css/note.css rename to modules/notes/css/notes.css index 2124335..d0cdae4 100644 --- a/css/note.css +++ b/modules/notes/css/notes.css @@ -112,7 +112,7 @@ h3.popupTitle{ } #note-submit{ margin:20px auto; } -.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;} +.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;} .delete:hover{cursor:pointer !important;} diff --git a/db/notes.xml b/modules/notes/db/notes.xml similarity index 100% rename from db/notes.xml rename to modules/notes/db/notes.xml diff --git a/add_note.html b/modules/notes/includes/add_note.html similarity index 100% rename from add_note.html rename to modules/notes/includes/add_note.html diff --git a/notes_extract.php b/modules/notes/includes/notes_extract.php similarity index 87% rename from notes_extract.php rename to modules/notes/includes/notes_extract.php index 00c7660..81c78ed 100644 --- a/notes_extract.php +++ b/modules/notes/includes/notes_extract.php @@ -1,5 +1,5 @@ 
      note[$i]->text;?>
      note[$i]['id'];?>
      diff --git a/js/jquery.notes.js b/modules/notes/js/notes.js similarity index 91% rename from js/jquery.notes.js rename to modules/notes/js/notes.js index a0fcba5..fb32e78 100644 --- a/js/jquery.notes.js +++ b/modules/notes/js/notes.js @@ -14,7 +14,7 @@ $(document).ready(function(){ var data2 = {'id' : $(this).attr("id")}; $(this).replaceWith(''); /* Sending an AJAX POST request: */ - $.post('ajax/delete-notes.php',data2,function(msg2){ + $.post('modules/notes/ajax/delete-notes.php',data2,function(msg2){ if(parseInt(msg2)) { msg2--; @@ -88,7 +88,7 @@ $(document).ready(function(){ }; /* Sending an AJAX POST request: */ - $.post('ajax/post-notes.php',data,function(msg){ + $.post('modules/notes/ajax/post-notes.php',data,function(msg){ if(parseInt(msg)) { @@ -119,7 +119,7 @@ function make_draggable(elements) stop:function(e,ui){ /* Sending the z-index and positon of the note to update_position.php via AJAX GET: */ - $.get('ajax/update_position.php',{ + $.get('modules/notes/ajax/update_position.php',{ x : ui.position.left, y : ui.position.top, z : zIndex, diff --git a/class/Ouifm.php b/modules/ouifm/Ouifm.php similarity index 73% rename from class/Ouifm.php rename to modules/ouifm/Ouifm.php index 42dfd9a..202ba22 100644 --- a/class/Ouifm.php +++ b/modules/ouifm/Ouifm.php @@ -10,8 +10,11 @@ class ouifm extends Module { public $params = array(); public function __construct($params){ + $this->moduleName = get_class(); + $this->pathToModule = 'modules/'.$this->moduleName.'/'; $this->setParams($params); - echo ''; + echo ' + '; echo '
      '; } diff --git a/modules/ouifm/css/ouifm.css b/modules/ouifm/css/ouifm.css new file mode 100644 index 0000000..e69de29 diff --git a/js/jquery.ouifm.js b/modules/ouifm/js/ouifm.js similarity index 100% rename from js/jquery.ouifm.js rename to modules/ouifm/js/ouifm.js diff --git a/class/Rssblogs.php b/modules/rssblogs/Rssblogs.php similarity index 82% rename from class/Rssblogs.php rename to modules/rssblogs/Rssblogs.php index 22c7b37..a43239f 100644 --- a/class/Rssblogs.php +++ b/modules/rssblogs/Rssblogs.php @@ -10,8 +10,11 @@ class rssblogs extends Module { public $params = array(); public function __construct($params){ + $this->moduleName = get_class(); + $this->pathToModule = 'modules/'.$this->moduleName.'/'; $this->setParams($params); - echo '
      '; + echo ' + '; require('class/lastRSS.php'); $rss = new lastRSS; // options lastRSS @@ -19,7 +22,7 @@ class rssblogs extends Module { $rss->cache_time = 3600; // fréquence de mise à jour du cache (en secondes) $rss->date_format = 'd/m/y'; // format de la date (voir fonction date() pour syntaxe) $rss->CDATA = 'content'; // on retire les tags CDATA en conservant leur contenu - if($linksXML = simplexml_load_file('db/rss.xml')){ + if($linksXML = simplexml_load_file($this->pathToModule.'db/rss.xml')){ foreach($linksXML->link as $individualLink){ if ($rs = $rss->get($individualLink->url)) echo ''.$rs['items'][0]['pubDate'].' '.$rs['items'][0]['title'].'
      '; diff --git a/css/rssblogs.css b/modules/rssblogs/css/rssblogs.css similarity index 100% rename from css/rssblogs.css rename to modules/rssblogs/css/rssblogs.css diff --git a/db/rss.xml b/modules/rssblogs/db/rss.xml similarity index 100% rename from db/rss.xml rename to modules/rssblogs/db/rss.xml diff --git a/modules/rssblogs/js/rssblogs.js b/modules/rssblogs/js/rssblogs.js new file mode 100644 index 0000000..e69de29 diff --git a/modules/search/Search.php b/modules/search/Search.php new file mode 100644 index 0000000..e1c7b24 --- /dev/null +++ b/modules/search/Search.php @@ -0,0 +1,62 @@ +moduleName = get_class(); + $this->pathToModule = 'modules/'.$this->moduleName.'/'; + $this->setParams($params); + echo ' + +
      +
      + + + +
        +
      • Web
      • +
      • Images
      • +
      • News
      • +
      • Videos
      • +
      + +
      +
      '; + } + + private function setParams($params){ + $this->params = $params; + } + + public static function start($params){ + $search = new search($params); + } + + public function setVisibility($visibility){ + // Saving the position and z-index of the note: + $xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE); + + $path = $xmla->xpath("//item[@id='search']"); + $path[0]->visibility = $visibility; + + $xmla->asXML('../'.AccueilModules::CONFIG_FILE); + + echo "ok"; + } + + public static function updateConfig($updated){ + foreach ($updated as $what=>$withWhat){ + if(in_array($what, self::$paramsList)){ + call_user_func(array(get_class(), "set".ucfirst($what)), $withWhat); + } + } + } +} \ No newline at end of file diff --git a/css/search.css b/modules/search/css/search.css similarity index 87% rename from css/search.css rename to modules/search/css/search.css index 77ceee5..973bca9 100644 --- a/css/search.css +++ b/modules/search/css/search.css @@ -21,7 +21,7 @@ fieldset{ border:none; color:#888888; /*background:url("../images/interface/searchBox.png") no-repeat;*/ - background:url('../images/interface/zoom.png') 10px center no-repeat; + background:url('../../../images/interface/zoom.png') 10px center no-repeat; border:1px solid #888888; float:left; font-family:Arial,Helvetica,sans-serif; @@ -58,7 +58,7 @@ fieldset{ } .icons li{ - background:url("../images/interface/icons.png") no-repeat; + background:url("../../../images/interface/icons.png") no-repeat; float:left; height:19px; text-indent:-999px; @@ -91,7 +91,7 @@ span.arrow{ height:6px; margin:21px 0 0 5px; position:absolute; - background:url('../images/interface/arrow.png') no-repeat; + background:url('../../../images/interface/arrow.png') no-repeat; left:0; } @@ -154,7 +154,7 @@ span.arrow{ #more{ width:83px; height:24px; - background:url('../images/interface/more.png') no-repeat; + background:url('../../../images/interface/more.png') no-repeat; cursor:pointer; margin:40px auto; } diff --git a/js/jquery.search.js b/modules/search/js/search.js similarity index 100% rename from js/jquery.search.js rename to modules/search/js/search.js diff --git a/class/Todo.php b/modules/todo/Todo.php similarity index 73% rename from class/Todo.php rename to modules/todo/Todo.php index 9b4eb82..6ff2c2e 100644 --- a/class/Todo.php +++ b/modules/todo/Todo.php @@ -1,6 +1,7 @@ moduleName = get_class(); + $this->pathToModule = 'modules/'.$this->moduleName.'/'; $this->setParams($params); - echo ''; - if($xmla = simplexml_load_file($this->persistance)){ + echo ' + '; + if($xmla = simplexml_load_file($this->pathToModule.self::TODO_FILE)){ $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.
      '; + echo 'Impossible de trouver votre configuration. Cliquez ici pour la mettre en place.
      '; else{ $token = $xmla->token; $id = $xmla->id; - echo '
    '; + echo '
    '; } echo ''; }else{ echo 'baaaaad persistance...'; diff --git a/ajax/saveTodoist.php b/modules/todo/ajax/saveTodoist.php similarity index 100% rename from ajax/saveTodoist.php rename to modules/todo/ajax/saveTodoist.php diff --git a/css/todo.css b/modules/todo/css/todo.css similarity index 85% rename from css/todo.css rename to modules/todo/css/todo.css index 10df132..f3e6655 100644 --- a/css/todo.css +++ b/modules/todo/css/todo.css @@ -6,12 +6,12 @@ #todo ul{list-style:none;} #todo ul li{white-space : nowrap; padding-left:16px;} -#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;} +#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;} .ui-resizable { position: relative;} -.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);} +.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);} .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } diff --git a/db/todoist.xml b/modules/todo/db/todoist.xml similarity index 100% rename from db/todoist.xml rename to modules/todo/db/todoist.xml diff --git a/getProjectsList.php b/modules/todo/includes/getProjectsList.php similarity index 75% rename from getProjectsList.php rename to modules/todo/includes/getProjectsList.php index f89a6a4..ba97bba 100644 --- a/getProjectsList.php +++ b/modules/todo/includes/getProjectsList.php @@ -1,5 +1,5 @@ token== '' || $xmla->token == null) header('Location: install-todoist.php'); if($xmla->name == '' || $xmla->name == null):?> @@ -7,7 +7,7 @@ if($xmla->name == '' || $xmla->name == null):?> Todoist : getProjects - + diff --git a/modules/todo/includes/getUncompletedTasks.php b/modules/todo/includes/getUncompletedTasks.php new file mode 100644 index 0000000..14a2d3f --- /dev/null +++ b/modules/todo/includes/getUncompletedTasks.php @@ -0,0 +1,12 @@ +token== '' || $xmla->token == null) + header('Location: ./'); +if($xmla->id != '' || $xmla->id != null): +$token = $xmla->token; +$id = $xmla->id;?> + + + token == '' || $xmla->token == null):?> Todoist : Login - + diff --git a/js/getProjectsList.php b/modules/todo/js/getProjectsList.php similarity index 74% rename from js/getProjectsList.php rename to modules/todo/js/getProjectsList.php index 13a27f3..24f4e53 100644 --- a/js/getProjectsList.php +++ b/modules/todo/js/getProjectsList.php @@ -2,5 +2,5 @@ $token = $_GET['token']; ?> function cbfunc(o){ $('body').append('

    Select your project

    '); $('#results').append('