Browse Source

Correction du bug de l'ajout de module avec la nouvelle classe Module

remotes/svn/trunk
Chouchen 9 years ago
parent
commit
3574fc102c
15 changed files with 29 additions and 35 deletions
  1. +6
    -14
      class/AccueilModules.php
  2. +10
    -8
      class/Module.php
  3. +1
    -1
      modules/blogs/Blogs.php
  4. +1
    -1
      modules/clock/Clock.php
  5. +1
    -1
      modules/clockAdvanced/ClockAdvanced.php
  6. +1
    -1
      modules/gmap/Gmap.php
  7. +1
    -1
      modules/links/Links.php
  8. +1
    -1
      modules/mappy/Mappy.php
  9. +1
    -1
      modules/news/News.php
  10. +1
    -1
      modules/notes/Notes.php
  11. +1
    -1
      modules/ouifm/Ouifm.php
  12. +1
    -1
      modules/rssblogs/Rssblogs.php
  13. +1
    -1
      modules/search/Search.php
  14. +1
    -1
      modules/todo/Todo.php
  15. +1
    -1
      modules/weather/Weather.php

+ 6
- 14
class/AccueilModules.php View File

@@ -121,19 +121,10 @@ class AccueilModules {
</script>';
}
/**
*
* @property Chaque module possède la fonction updateModule en static qui permet de changer un ou plusieurs de ses attributs
* @param $module String Nom du module à modifier
* @param $things2change Array du ou des attributs à modifier avec sa ou ses nouvelles valeurs
* @return "ok" String si c'est bon, ou le message d'erreur
*/
/*public static function updateModule($module, $things2change){
//require 'Module.php';
//require '../modules/'.$module.'/'.ucfirst($module).'.php';
$module = new $module();
return call_user_func(array($module, "updateConfig"), $things2change);
}*/
public static function retrieveModuleParams($module){
$temp = new $module;
return $temp->getParamsList();
}
/**
*
@@ -161,7 +152,8 @@ class AccueilModules {
if($config = simplexml_load_file('../'.self::CONFIG_FILE)){
$newItem = $config->addChild('item');
$newItem->addAttribute('id', $name);
$params = call_user_func(array($name, 'getParamList'));
//$params = call_user_func(array($name, 'getParamList'));
$params = self::retrieveModuleParams($name);
foreach($params as $param){
if($param == 'visibility')
$newItem->AddChild($param, 'true');


+ 10
- 8
class/Module.php View File

@@ -1,13 +1,7 @@
<?php
class Module
{
/**
* Liste des paramètres du module en concordance avec le "config.xml"
* Ses éléments ne peuvent être modifiés
* @var array
*/
protected static $paramsList = array();
// Nom du module (aka le nom de la classe en minuscule)
protected $moduleName;
@@ -24,8 +18,9 @@ class Module
*/
private $params = array();
public function __construct($class, $params){
public function __construct($class, $params = null){
$this->setNames($class, $this->moduleTitle);
if($params != null && is_array($params))
$this->setParams($params);
}
@@ -72,6 +67,13 @@ class Module
}
/**
* @return la liste des paramètres du module
*/
public function getParamsList(){
return $this->paramsList;
}
/**
* @param $class string nom du module
* @param $key string le nom du paramètre à changer
* @param $value string valeur du paramètre


+ 1
- 1
modules/blogs/Blogs.php View File

@@ -1,7 +1,7 @@
<?php
class blogs extends Module {
protected $moduleTitle = 'Blogs BD';
protected static $paramsList = array(
protected $paramsList = array(
'visibility',
'x',
'y'


+ 1
- 1
modules/clock/Clock.php View File

@@ -1,7 +1,7 @@
<?php
class clock extends Module {
protected $moduleTitle = 'Horloge Simple';
protected static $paramsList = array(
protected $paramsList = array(
'visibility',
'x',
'y'


+ 1
- 1
modules/clockAdvanced/ClockAdvanced.php View File

@@ -1,7 +1,7 @@
<?php
class clockAdvanced extends Module {
protected $moduleTitle = 'Horloge Avancée';
protected static $paramsList = array(
protected $paramsList = array(
'visibility',
'x',
'y',


+ 1
- 1
modules/gmap/Gmap.php View File

@@ -1,7 +1,7 @@
<?php
class gmap extends Module {
protected $moduleTitle = 'Google Maps';
protected static $paramsList = array(
protected $paramsList = array(
'visibility'
);


+ 1
- 1
modules/links/Links.php View File

@@ -1,7 +1,7 @@
<?php
class links extends Module{
protected $moduleTitle = 'Liens';
protected static $paramsList = array(
protected $paramsList = array(
'visibility'
);


+ 1
- 1
modules/mappy/Mappy.php View File

@@ -1,7 +1,7 @@
<?php
class mappy extends Module {
protected $moduleTitle = 'Mappy';
protected static $paramsList = array(
protected $paramsList = array(
'visibility'
);


+ 1
- 1
modules/news/News.php View File

@@ -1,7 +1,7 @@
<?php
class news extends Module{
protected $moduleTitle = 'Google News';
protected static $paramsList = array(
protected $paramsList = array(
'visibility',
'x',
'y'


+ 1
- 1
modules/notes/Notes.php View File

@@ -2,7 +2,7 @@
class notes extends Module {
protected $moduleTitle = 'Post-It';
protected static $paramsList = array(
protected $paramsList = array(
'visibility'
);


+ 1
- 1
modules/ouifm/Ouifm.php View File

@@ -1,7 +1,7 @@
<?php
class ouifm extends Module {
protected $moduleTitle = 'Oui FM Radio';
protected static $paramsList = array(
protected $paramsList = array(
'visibility',
'x',
'y'


+ 1
- 1
modules/rssblogs/Rssblogs.php View File

@@ -1,7 +1,7 @@
<?php
class rssblogs extends Module {
protected $moduleTitle = 'Lecteur de flux RSS';
protected static $paramsList = array(
protected $paramsList = array(
'visibility',
'x',
'y'


+ 1
- 1
modules/search/Search.php View File

@@ -1,7 +1,7 @@
<?php
class search extends Module {
protected $moduleTitle = 'Recherche';
protected static $paramsList = array(
protected $paramsList = array(
'visibility'
);


+ 1
- 1
modules/todo/Todo.php View File

@@ -3,7 +3,7 @@ class todo extends Module {
protected $moduleTitle = 'Todo List';
protected static $paramsList = array(
protected $paramsList = array(
'visibility',
'x',
'y'


+ 1
- 1
modules/weather/Weather.php View File

@@ -3,7 +3,7 @@ class weather extends Module {
protected $moduleTitle = 'Météo';
protected static $paramsList = array(
protected $paramsList = array(
'visibility',
'city',
'x',


Loading…
Cancel
Save