Browse Source

Version avec modules séparés !

remotes/svn/tags/beta-1.0.0
Chouchen 9 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 {
$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);
}
}

+ 0
- 33
class/Clock.php View File

@@ -1,33 +0,0 @@
<?php
class clock extends Module {
protected static $paramsList = array(
'visibility',
'x',
'y'
);
public $params = array();
public function __construct($params){
$this->setParams($params);
echo '<script type="text/javascript" src="js/jquery.jclock.js"></script>';
echo '<div class="jclock" id="clock" style="left:'.$params['x'].'; top:'.$params['y'].';"></div>';
}
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);
}
}
}
}

+ 9
- 0
class/Module.php View File

@@ -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
*

+ 0
- 39
class/Search.php View File

@@ -1,39 +0,0 @@
<?php
class search extends Module {
protected static $paramsList = array(
'visibility'
);
public $params = array();
public function __construct($params){
echo '<link rel="stylesheet" type="text/css" href="css/search.css">
<script type="text/javascript" src="js/jquery.search.js"></script>
<form id="searchForm" method="post">
<fieldset>
<input id="s" type="text" />
<input type="submit" value="Submit" id="submitButton" class="searchbutton" />
<ul class="icons">
<li class="web" title="Web Search" data-searchType="web">Web</li>
<li class="images" title="Image Search" data-searchType="images">Images</li>
<li class="news" title="News Search" data-searchType="news">News</li>
<li class="videos" title="Video Search" data-searchType="video">Videos</li>
</ul>
</fieldset>
</form>';
}
private function setParams($params){
$this->params = $params;
}
public static function start($params){
$search = new search($params);
}
public static function updateConfig($updated){
}
}

+ 0
- 12
getUncompletedTasks.php View File

@@ -1,12 +0,0 @@
<?
$xmla = simplexml_load_file('todoist.xml');
if($xmla->token== '' || $xmla->token == null)
header('Location: index.php');
if($xmla->id != '' || $xmla->id != null):
$token = $xmla->token;
$id = $xmla->id;?>
<script type="text/javascript" src="js/getUncompletedTasks.php?token=<?=$token?>&id=<?=$id?>"></script>
<? else:
header('Location: getProjectsList.php');
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 @@
$(document).ready(function(){
$('#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) {
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');
}
});
});

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

@@ -1,75 +0,0 @@
/**
* jQuery.ajax mid - CROSS DOMAIN AJAX
* ---
* @author James Padolsey (http://james.padolsey.com)
* @version 0.11
* @updated 12-JAN-10
* ---
* Note: Read the README!
* ---
* @info http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/
*/
jQuery.ajax = (function(_ajax){
var protocol = location.protocol,
hostname = location.hostname,
exRegex = RegExp(protocol + '//' + hostname),
YQL = 'http' + (/^https/.test(protocol)?'s':'') + '://query.yahooapis.com/v1/public/yql?callback=?',
query = 'select * from html where url="{URL}" and xpath="*"';
function isExternal(url) {
return !exRegex.test(url) && /:\/\//.test(url);
}
return function(o) {
var url = o.url;
if ( /get/i.test(o.type) && !/json/i.test(o.dataType) && isExternal(url) ) {
// Manipulate options so that JSONP-x request is made to YQL
o.url = YQL;
o.dataType = 'json';
o.data = {
q: query.replace(
'{URL}',
url + (o.data ?
(/\?/.test(url) ? '&' : '?') + jQuery.param(o.data)
: '')
),
format: 'xml'
};
// Since it's a JSONP request
// complete === success
if (!o.success && o.complete) {
o.success = o.complete;
delete o.complete;
}
o.success = (function(_success){
return function(data) {
if (_success) {
// Fake XHR callback.
_success.call(this, {
responseText: data.results[0]
// YQL screws with <script>s
// Get rid of them
.replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')
}, 'success');
}
};
})(o.success);
}
return _ajax.apply(this, arguments);
};
})(jQuery.ajax);

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

@@ -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 '<script type="text/javascript" src="js/jquery.blogs.js"></script>
<div id="blogs" style="top:'.$params['y'].'; left :'.$params['x'].';"></div>';
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />';
require($this->pathToModule.'includes/blogs_last_post.php');
echo '<div id="blogs" style="top:'.$params['y'].'; left :'.$params['x'].';"></div>';
echo '<a href="#blogLinksManager" id="blog-links-manager"><img src="images/interface/blogs_edit.png" /></a>';
echo '<div style="display:none;">
<div id="blogLinksManager">
@@ -24,7 +27,7 @@ class blogs extends Module {
echo '<li>'.$link['url'].' <img src="images/interface/delete.png" id="link-'.$link['name'].'"/></li>';
echo '</ul>
<h4>Insert Site feed</h4>
<form action="addSite.php" method="POST">
<form action="modules/blogs/includes/addSite.php" method="POST">
<input type="text" id="newLink" name="newLink" value="url" />
<input type="submit" id="link-submit" class="green-button" value="Ajouter"></input>
</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()
}
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);
}

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

@@ -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('<img src="images/interface/error.png"/> Délai dépassé !');

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

@@ -0,0 +1,48 @@
<?php
class clock extends Module {
protected static $paramsList = array(
'visibility',
'x',
'y'
);
public $params = array();
public function __construct($params){
$this->moduleName = get_class();
$this->pathToModule = 'modules/'.$this->moduleName.'/';
$this->setParams($params);
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />';
echo '<div class="jclock" id="clock" style="left:'.$params['x'].'; top:'.$params['y'].';"></div>';
}
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);
}
}
}
}

+ 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 {
public $params = array();
public function __construct($params){
$this->moduleName = get_class();
$this->pathToModule = 'modules/'.$this->moduleName.'/';
$this->setParams($params);
echo '<script type="text/javascript" src="js/jquery.jclockAdvanced.js"></script>';
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />';
echo '<div class="jclockAdvanced" id="clockAdvanced" style="left:'.$params['x'].'; top:'.$params['y'].';"></div>';
$options = '';
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 {
public $params = array();
public function __construct($params){
$this->moduleName = get_class();
$this->pathToModule = 'modules/'.$this->moduleName.'/';
$this->setParams($params);
echo '<script type="text/javascript" src="js/gmap.js"></script>
<link type="text/css" rel="stylesheet" href="css/gmap.css" />
echo '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=fr"></script>
<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />
<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">';
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 '</div>';
<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>';
}
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 @@
$(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 = '<div style="float:left;text-align:left;width:250;">'+content+'</div>'
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');
}
});
});

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

@@ -1,6 +1,10 @@
<?php
class links {
class links extends Module{
protected $moduleName;
protected $moduleTitle;
protected $pathToModule;
protected static $paramsList = array(
'visibility'
);
@@ -10,12 +14,14 @@ class links {
public $params = array();
public function __construct($params){
$this->moduleName = get_class();
$this->pathToModule = 'modules/'.$this->moduleName.'/';
$this->setParams($params);
echo '<script type="text/javascript" src="js/jquery.links.js"></script>
<link rel="stylesheet" href="css/links.css" type="text/css" />
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />
<div style="display:none;"><div id="links-add-fancy"></div></div>
<div class="appscontainer">';
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){
//<span class="label">'.$label['id'].'</span>
@@ -27,7 +33,7 @@ class links {
<hr>';
}
}else{
echo 'Can\'t find '.self::LINKS_FILE;
echo 'Can\'t find '.$this->pathToModule.self::LINKS_FILE;
}
echo '</div>';

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


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

@@ -1,6 +1,5 @@
<?
include '../class/Links.php';
if($links_xml = simplexml_load_file('../'.links::LINKS_FILE)){
if($links_xml = simplexml_load_file("../db/links.xml")){
$links = $links_xml->reserve;
foreach($links as $label){
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(){
// 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('<li class="iconitem" id="'+$(this).attr('id')+'">'+$(this).html()+'</li>');
$.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

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

@@ -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 '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css">';
echo '<script src="http://axe.mappy.com/1v1/init/get.aspx?version=2.01&solution=ajax&auth=HbTTpMfC4//GWuldL2IsF+HJA4xVuTBsIQi0wcC7xRz+e17hobrJ+1947aq34rdjYAPy6nBYBQF8o56Qzdun9w=="></script>
<script type="text/javascript" src="js/mappy.js"></script>
<link type="text/css" rel="stylesheet" href="css/mappy.css" />
<div id="mymap"></div>
<div id="myAdress"><input type="text" name="myAdressField" id="myAdressField" /></div>';
}

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 @@
<?php
class notes extends Module {
protected $moduleName;
protected $moduleTitle;
protected $pathToModule;
protected static $paramsList = array(
'visibility'
);
@@ -8,11 +12,13 @@ class notes extends Module {
public $params = array();
public function __construct($params){
$this->moduleName = get_class();
$this->pathToModule = 'modules/'.$this->moduleName.'/';
$this->setParams($params);
echo '<script type="text/javascript" src="js/jquery.notes.js"></script>
<link rel="stylesheet" type="text/css" href="css/note.css">
<a id="addButton" class="green-button" href="add_note.html">Add a note</a>';
include 'notes_extract.php';
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css">
<a id="addButton" class="green-button" href="'.$this->pathToModule.'includes/add_note.html">Add a note</a>';
include $this->pathToModule.'includes/notes_extract.php';
}
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{
}
#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;}

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 @@
<?php $nb = 0;
$notes = simplexml_load_file('db/notes.xml');
$notes = simplexml_load_file('modules/notes/db/notes.xml');
foreach($notes as $test){$nb++;}
for($i=0; $i<$nb; $i++){?>
<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(){
var data2 = {'id' : $(this).attr("id")};
$(this).replaceWith('<img src="images/interface/ajax_load.gif" style="display:block" />');
/* 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,

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

@@ -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 '<script type="text/javascript" src="js/jquery.ouifm.js"></script>';
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css">';
echo '<div id="ouifm" style="left:'.$params['x'].'; top:'.$params['y'].';"></div>';
}

+ 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 {
public $params = array();
public function __construct($params){
$this->moduleName = get_class();
$this->pathToModule = 'modules/'.$this->moduleName.'/';
$this->setParams($params);
echo '<link rel="stylesheet" type="text/css" href="css/rssblogs.css"><div id="rssblogs">';
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />';
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 '<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 @@
<?php
class search extends Module {
protected $moduleName;
protected $moduleTitle;
protected $pathToModule;
protected static $paramsList = array(
'visibility'
);
public $params = array();
public function __construct($params){
$this->moduleName = get_class();
$this->pathToModule = 'modules/'.$this->moduleName.'/';
$this->setParams($params);
echo '<link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/search.css">
<script type="text/javascript" src="'.$this->pathToModule.'js/jquery.search.js"></script>
<form id="searchForm" method="post">
<fieldset>
<input id="s" type="text" />
<input type="submit" value="Submit" id="submitButton" class="searchbutton" />
<ul class="icons">
<li class="web" title="Web Search" data-searchType="web">Web</li>
<li class="images" title="Image Search" data-searchType="images">Images</li>
<li class="news" title="News Search" data-searchType="news">News</li>
<li class="videos" title="Video Search" data-searchType="video">Videos</li>
</ul>
</fieldset>
</form>';
}
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);
}
}
}
}

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

@@ -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;
}

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


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

@@ -1,6 +1,7 @@
<?php
class todo extends Module {
protected static $paramsList = array(
'visibility',
'x',
@@ -8,29 +9,32 @@ class todo extends Module {
);
public $params = array();
private $persistance = 'db/todoist.xml';
const TODO_FILE = 'db/todoist.xml';
private $token;
private $project_name;
private $project_id;
public function __construct($params){
$this->moduleName = get_class();
$this->pathToModule = 'modules/'.$this->moduleName.'/';
$this->setParams($params);
echo '<link rel="stylesheet" type="text/css" href="css/todo.css">';
if($xmla = simplexml_load_file($this->persistance)){
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />';
if($xmla = simplexml_load_file($this->pathToModule.self::TODO_FILE)){
$this->setToken($xmla->token);
$this->setProjectName($xmla->name);
$this->setProjectId($xmla->id);
echo '<div id="todo" style="top:'.$params['y'].'; left :'.$params['x'].';">';
if($this->token == null || $this->project_id == null)
echo 'Impossible de trouver votre configuration. <a href="install-todoist.php">Cliquez ici</a> pour la mettre en place.</div>';
echo 'Impossible de trouver votre configuration. <a href="'.$this->pathToModule.'includes/install-todoist.php">Cliquez ici</a> pour la mettre en place.</div>';
else{
$token = $xmla->token;
$id = $xmla->id;
echo '</div><script type="text/javascript" src="js/getUncompletedTasks.php?token='.$token.'&id='.$id.'"></script>';
echo '</div><script type="text/javascript" src="'.$this->pathToModule.'js/getUncompletedTasks.php?token='.$token.'&id='.$id.'"></script>';
}
echo '<script>
$(document).ready(function(){
$(\'#todo\').resizable();
$(\'#todo\').resizable();
});</script>';
}else{
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 @@
#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; }

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


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

@@ -1,5 +1,5 @@
<?
$xmla = simplexml_load_file('db/todoist.xml');
$xmla = simplexml_load_file('../db/todoist.xml');
if($xmla->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):?>
<head> <style> .selectableProject{text-decoration:underline; color:blue; cursor:pointer;} </style>
<title>Todoist : getProjects</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="js/getProjectsList.php?token=<?=$xmla->token?>"></script>
<script type="text/javascript" src="../js/getProjectsList.php?token=<?=$xmla->token?>"></script>
</head>
<body>

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

@@ -0,0 +1,12 @@
<?
$xmla = simplexml_load_file('../db/todoist.xml');
if($xmla->token== '' || $xmla->token == null)
header('Location: ./');
if($xmla->id != '' || $xmla->id != null):
$token = $xmla->token;
$id = $xmla->id;?>
<script type="text/javascript" src="../js/getUncompletedTasks.php?token=<?=$token?>&id=<?=$id?>"></script>
<? else:
header('Location: getProjectsList.php');
endif;

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

@@ -1,11 +1,11 @@
<?
$xmla = simplexml_load_file('db/todoist.xml');
$xmla = simplexml_load_file('../db/todoist.xml');
if($xmla->token == '' || $xmla->token == null):?>
<html>
<head>
<title>Todoist : Login</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="../js/index.js"></script>
</head>
<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){
if(token == undefined){
$('#error').html('Identification erronnée');
}else{
$.post('ajax/saveTodoist.php', {token: token}, function(data){ $('body').append('<a href="getProjectsList.php">Etape suivante</a>'); if(data=="ok"){
$.post('../ajax/saveTodoist.php', {token: token}, function(data){ $('body').append('<a href="getProjectsList.php">Etape suivante</a>'); if(data=="ok"){
location.reload(); }else{ alert(data); }
});
}

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


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

@@ -1,7 +1,11 @@
<?php
class weather extends Module {
//TODO rajouter les params en détail
protected $moduleName;
protected $moduleTitle;
protected $pathToModule;
protected static $paramsList = array(
'visibility',
'city',
@@ -12,11 +16,13 @@ class weather extends Module {
public $params = array();
public function __construct($params){
$this->moduleName = get_class();
$this->pathToModule = 'modules/'.$this->moduleName.'/';
$this->setParams($params);
$ville = $params['city'];
include 'GoogleMeteo.php';
echo '<script type="text/javascript" src="js/jquery.weather.js"></script>
<link rel="stylesheet" type="text/css" href="css/weather.css">';
include $this->pathToModule.'includes/GoogleMeteo.php';
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css">';
echo '<div id="weather" style="left:'.$params['x'].'; top:'.$params['y'].';">
'.$city.'<br/>
<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 @@
}
if(strpos(strtolower($present_weather),"soleil") !== false) {?>
<link rel="stylesheet" type="text/css" href="css/soleil.css">
<link rel="stylesheet" type="text/css" href="modules/weather/css/soleil.css">
<?}
if(strpos(strtolower($present_weather),"nuage") !== false) {?>
<link rel="stylesheet" type="text/css" href="css/nuage.css">
<link rel="stylesheet" type="text/css" href="modules/weather/css/nuage.css">
<?}
if(strpos(strtolower($present_weather),"peu nuageux") !== false) {?>
<link rel="stylesheet" type="text/css" href="css/peunuage.css">
<link rel="stylesheet" type="text/css" href="modules/weather/css/peunuage.css">
<?}
if((strpos(strtolower($present_weather),"pluie") !== false) || (strpos(strtolower($present_weather),"averse") !== false)) {?>
<link rel="stylesheet" type="text/css" href="css/pluie.css">
<link rel="stylesheet" type="text/css" href="modules/weather/css/pluie.css">
<?}
if(strpos(strtolower($present_weather),"neige") !== false) {?>
<link rel="stylesheet" type="text/css" href="css/neige.css">
<link rel="stylesheet" type="text/css" href="modules/weather/css/neige.css">
<?}
}else{ $present_weather = 'Ville non trouvé : '.$city; }
}else

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


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


Loading…
Cancel
Save