Accueil/modules/links/Links.php

36 lines
1.3 KiB
PHP
Raw Permalink Normal View History

<?php
2010-09-27 12:48:53 +02:00
class links extends Module{
protected $moduleTitle = 'Liens';
protected $paramsList = array(
2010-09-20 11:40:27 +02:00
'visibility'
);
2010-09-21 16:00:04 +02:00
const LINKS_FILE = 'db/links.xml';
public function __construct($params){
parent::__construct(__CLASS__, $params);
}
public function build(){
2010-09-27 12:48:53 +02:00
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />
<div style="display:none;"><div id="links-add-fancy"></div></div>
2010-09-21 16:00:04 +02:00
<div class="appscontainer">';
2010-09-27 12:48:53 +02:00
if($links_xml = simplexml_load_file($this->pathToModule.self::LINKS_FILE)){
2010-09-21 16:00:04 +02:00
$links = $links_xml->label;
foreach($links as $label){
//<span class="label">'.$label['id'].'</span>
echo '<ul class="iconlist" id="'.$label['id'].'">';
2010-09-21 16:00:04 +02:00
foreach($label->link as $link){
echo '<li class="iconitem" id="'.$link->title.'"><img src="images/interface/delete.png" class="deleteLink" /><a href="'.$link->url.'" class="'.$link->onclick.'"><img src="images/links/'.$link->img.'" /><br>'.$link->title.'</a></li>';
2010-09-21 16:00:04 +02:00
}
echo '</ul>
<hr>';
}
2010-09-21 17:09:31 +02:00
}else{
2010-09-27 12:48:53 +02:00
echo 'Can\'t find '.$this->pathToModule.self::LINKS_FILE;
2010-09-21 16:00:04 +02:00
}
2010-09-23 15:02:42 +02:00
echo '</div>';
}
}