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.

58 lines
1.5 KiB

<?php
class links {
protected static $paramsList = array(
'visibility'
);
const LINKS_FILE = 'db/links.xml';
public $params = array();
public function __construct($params){
$this->setParams($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.'" onclick="'.$link->onclick.'"><img src="images/links/'.$link->img.'" /><br>'.$link->title.'</a></li>';
}
echo '</ul>
<hr>';
}
}
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;
$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);
}
}
}
}