Addons fuer LBS

This commit is contained in:
Andreas Österreicher
2013-04-25 12:33:37 +00:00
parent c841aeb131
commit 8074e5befd
7 changed files with 167 additions and 4 deletions
+91
View File
@@ -0,0 +1,91 @@
<?php
/* Copyright (C) 2013 FH Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
class addon extends basis_db
{
public $new;
public $result=array();
public $addon_name;
public $addon_version;
public $addon_description;
public $fhcomplete_target_version;
public $aktive_addons=array();
/**
* Konstruktor
*/
public function __construct()
{
parent::__construct();
$this->aktive_addons = array_filter(explode(";", ACTIVE_ADDONS));
}
/**
* Liefert alle aktivierten Addons
*/
public function loadAddons()
{
foreach($this->aktive_addons as $addon)
{
$addon_name='';
$addon_version='';
$addon_description='';
$fhcomplete_target_version='';
include(dirname(__FILE__).'/../addons/'.$addon.'/version.php');
$obj = new stdClass();
$obj->kurzbz = $addon;
$obj->addon_name = $addon_name;
$obj->addon_version = $addon_version;
$obj->addon_description = $addon_description;
$obj->fhcomplete_target_version = $fhcomplete_target_version;
$this->result[] = $obj;
}
return true;
}
/**
* Laedt Information zu dem Addon
*/
public function getInformation($addon)
{
$addon_name='';
$addon_version='';
$addon_description='';
$fhcomplete_target_version='';
include(dirname(__FILE__).'/../addons/'.$addon.'/version.php');
$this->addon_name = $addon_name;
$this->addon_version = $addon_version;
$this->addon_description = $addon_description;
$this->fhcomplete_target_version = $fhcomplete_target_version;
}
}
?>
+19
View File
@@ -275,4 +275,23 @@ $statistik = new statistik();
$statistik = $statistik->getMenueArray(1);
$menu['Auswertung']=array_merge($menu['Auswertung'],$statistik);
//var_dump($menu['Auswertung']);
require_once(dirname(__FILE__).'/../addon.class.php');
$addon_obj = new addon();
if($addon_obj->loadAddons())
{
if(count($addon_obj->result)>0)
{
$menu['Addons']=array
(
'name'=>'Addons', 'opener'=>'true', 'hide'=>'true', 'permissions'=>array('basis/addon'), 'image'=>'statistic.png',
'link'=>'left.php?categorie=Addons', 'target'=>'nav'
);
foreach($addon_obj->result as $row)
{
$menu['Addons'][$row->kurzbz]=array('name'=>$row->addon_name, 'link'=>'../addons/'.$row->kurzbz.'/vilesci/index.php', 'target'=>'main');
}
}
}
?>