moduleName = get_class();
$this->pathToModule = 'modules/'.$this->moduleName.'/';
$this->setParams($params);
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.
';
else{
$token = $xmla->token;
$id = $xmla->id;
echo '';
}
echo '';
}else{
echo 'baaaaad persistance...';
}
}
private function setToken($token){
if($token == '' || $token == null)
$this->token = null;
else
$this->token = $token;
}
private function setProjectName($name){
if($name == '' || $name == null)
$this->project_name = null;
else
$this->project_name = $name;
}
private function setProjectId($id){
if($id == '' || $id == null)
$this->project_id = null;
else
$this->project_id = $id;
}
private function setParams($params){
$this->params = $params;
}
public static function start($params){
$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){
foreach ($updated as $what=>$withWhat){
if(in_array($what, self::$paramsList)){
call_user_func(array(get_class(), "set".ucfirst($what)), $withWhat);
}
}
}
}