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

@@ -11,7 +11,8 @@ class blogs extends Module {
public function __construct($params){
$this->setParams($params);
require('blogs_last_post.php');
echo '<script type="text/javascript" src="js/jquery.blogs.js"></script>';
echo '<script type="text/javascript" src="js/jquery.blogs.js"></script>
<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">
@@ -39,7 +40,46 @@ class blogs extends Module {
$blogs = new blogs($params);
}
public static function updateConfig($updated){
public function setX($x){
$xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE);
$path = $xmla->xpath("//item[@id='blogs']");
$path[0]->x = $x;
$xmla->asXML('../'.AccueilModules::CONFIG_FILE);
echo "ok";
}
public function setY($y){
$xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE);
$path = $xmla->xpath("//item[@id='blogs']");
$path[0]->y = $y;
$xmla->asXML('../'.AccueilModules::CONFIG_FILE);
echo "ok";
}
public function setVisibility($visibility){
$xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE);
$path = $xmla->xpath("//item[@id='blogs']");
$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);
}
}
}
}