You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.9 KiB

class links {
protected static $paramsList = array(
const LINKS_FILE = 'db/links.xml';
public $params = array();
public function __construct($params){
echo '<script type="text/javascript" src="js/jquery.links.js"></script>
<div class="appscontainer">';
if($links_xml = simplexml_load_file(self::LINKS_FILE)){
$links = $links_xml->label;
foreach($links as $label){
echo '<span class="label">'.$label['id'].'</span>
<ul class="iconlist" id="'.$label['id'].'">';
foreach($label->link as $link){
echo '<li class="item" id="'.$link->title.'"><a href="'.$link->url.'" class="'.$link->onclick.'"><img src="images/links/'.$link->img.'" /><br>'.$link->title.'</a></li>';
echo '</ul>
echo 'Can\'t find '.self::LINKS_FILE;
echo '</div>';
private function setParams($params){
$this->params = $params;
public static function start($params){
$links = new links($params);
public function setLink($link){
// Saving the position and z-index of the note:
$xmla = simplexml_load_file('../'.self::LINKS_FILE);
$path = $xmla->xpath("//item[@id='weather']");
$path[0]->x = $x;
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='links']");
$path[0]->visibility = $visibility;
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);