moduleName = get_class(); $this->pathToModule = 'modules/'.$this->moduleName.'/'; $this->setParams($params); echo ' '; echo '
'; $options = ''; foreach (self::$paramsList as $paramName){ if(isset($this->params[$paramName])) $options .= $paramName.' : "'.$this->params[$paramName].'",'; } echo ''; } private function setParams($params){ $this->params = $params; } public static function start($params){ $clockAdvanced = new clockAdvanced($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='clockAdvanced']"); $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='clockAdvanced']"); $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='clockAdvanced']"); $path[0]->visibility = $visibility; $xmla->asXML('../'.AccueilModules::CONFIG_FILE); echo "ok"; } public function setFontFamily($fontFamily){ // Saving the position and z-index of the note: $xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE); $path = $xmla->xpath("//item[@id='clockAdvanced']"); $path[0]->fontFamily = $fontFamily; $xmla->asXML('../'.AccueilModules::CONFIG_FILE); echo "ok"; } public function setFontSize($fontSize){ // Saving the position and z-index of the note: $xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE); $path = $xmla->xpath("//item[@id='clockAdvanced']"); $path[0]->fontSize = $fontSize; $xmla->asXML('../'.AccueilModules::CONFIG_FILE); echo "ok"; } public function setColor($color){ // Saving the position and z-index of the note: $xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE); $path = $xmla->xpath("//item[@id='clockAdvanced']"); $path[0]->color = $color; $xmla->asXML('../'.AccueilModules::CONFIG_FILE); echo "ok"; } public function setFormat($format){ // Saving the position and z-index of the note: $xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE); $path = $xmla->xpath("//item[@id='clockAdvanced']"); $path[0]->format = $format; $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); } } } }