mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Addons fuer LBS
This commit is contained in:
@@ -3,6 +3,9 @@ Coding Guidlines für Addon-Entwickung
|
||||
|
||||
Hier sind einige Coding Guidlines die beachtet werden sollten um Konflikte zu vermeiden
|
||||
|
||||
Bennung von Addons
|
||||
==================
|
||||
Der Name des Addons (Ordnerbezeichnung) darf keine Leerzeichen, Umlaute oder Sonderzeichen enthalten
|
||||
|
||||
XUL-Applikationen
|
||||
=================
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
// Name des Addons
|
||||
$addon_name = 'FH-Complete Addon Template';
|
||||
$addon_name = 'Template';
|
||||
|
||||
// Versionsnummer des Addons
|
||||
$addon_version = '0.01';
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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.
|
||||
*
|
||||
*/
|
||||
require_once('../../../config/vilesci.config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
|
||||
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="stylesheet" href="../../../skin/fhcomplete.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../../skin/vilesci.css" type="text/css">
|
||||
<title>Template</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Template</h1>';
|
||||
|
||||
$uid = get_uid();
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
|
||||
if(!$rechte->isBerechtigt('basis/addon'))
|
||||
{
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
}
|
||||
echo 'Template Addon Vilesci Integration';
|
||||
?>
|
||||
+5
-3
@@ -26,6 +26,7 @@ require_once('../include/functions.inc.php');
|
||||
require_once('../include/benutzerberechtigung.class.php');
|
||||
require_once('../include/studiensemester.class.php');
|
||||
require_once('../include/variable.class.php');
|
||||
require_once('../include/addon.class.php');
|
||||
|
||||
$user=get_uid();
|
||||
|
||||
@@ -73,10 +74,11 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/fasoverlay.xul.php"?>';
|
||||
|
||||
<?php
|
||||
// ADDONS
|
||||
$addons = explode(";",ACTIVE_ADDONS);
|
||||
foreach($addons as $addon)
|
||||
$addon_obj = new addon();
|
||||
$addon_obj->loadAddons();
|
||||
foreach($addon_obj->result as $addon)
|
||||
{
|
||||
echo '<script type="application/x-javascript" src="'.APP_ROOT.'addons/'.$addon.'/content/init.js.php" />';
|
||||
echo '<script type="application/x-javascript" src="'.APP_ROOT.'addons/'.$addon->kurzbz.'/content/init.js.php" />';
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -412,9 +412,13 @@ foreach ($studiengang as $stg)
|
||||
{
|
||||
$outp.="<OPTION value='$stg->studiengang_kz' ".($stg->studiengang_kz==$stg_kz?'selected':'').">".$db->convert_html_chars($stg->kuerzel.' - '.$stg->kurzbzlang)."</OPTION>";
|
||||
}
|
||||
if(!isset($s[$stg->studiengang_kz]))
|
||||
$s[$stg->studiengang_kz]=new stdClass();
|
||||
$s[$stg->studiengang_kz]->max_sem=9; // $stg->max_semester;
|
||||
$s[$stg->studiengang_kz]->kurzbz=$stg->kurzbzlang;
|
||||
}
|
||||
if(!isset($s['']))
|
||||
$s['']=new stdClass();
|
||||
$s['']->max_sem=9;
|
||||
|
||||
$outp.='</SELECT>';
|
||||
|
||||
Reference in New Issue
Block a user