Amélioration des scripts AJAX et des styles

Ajout de la fonctionnalité "changement d'options" pour la clockAdvanced
This commit is contained in:
Chouchen
2010-09-20 14:39:08 +00:00
parent 136be98daa
commit fdc7719815
18 changed files with 306 additions and 61 deletions

View File

@@ -20,7 +20,7 @@ class todo extends Module {
$this->setToken($xmla->token);
$this->setProjectName($xmla->name);
$this->setProjectId($xmla->id);
echo '<div id="todoList">';
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>';
else{
@@ -30,7 +30,7 @@ class todo extends Module {
}
echo '<script>
$(document).ready(function(){
$(\'#todoList\').resizable();
$(\'#todo\').resizable();
});</script>';
}else{
echo 'baaaaad persistance...';
@@ -66,7 +66,47 @@ class todo extends Module {
$todo = new todo($params);
}
public function setX($x){
// Saving the position and z-index of the note:
$xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE);
$path = $xmla->xpath("//item[@id='todo']");
$path[0]->x = $x;
$xmla->asXML('../'.AccueilModules::CONFIG_FILE);
echo "ok";
}
public function setY($y){
// Saving the position and z-index of the note:
$xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE);
$path = $xmla->xpath("//item[@id='todo']");
$path[0]->y = $y;
$xmla->asXML('../'.AccueilModules::CONFIG_FILE);
echo "ok";
}
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='todo']");
$path[0]->visibility = $visibility;
$xmla->asXML('../'.AccueilModules::CONFIG_FILE);
echo "ok";
}
public static function updateConfig($updated){
return;
foreach ($updated as $what=>$withWhat){
if(in_array($what, self::$paramsList)){
call_user_func(array(get_class(), "set".ucfirst($what)), $withWhat);
}
}
}
}