mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
- Include Templates für Menu Addons
- Variablen für Redirect Templates - diverse Menü Addons
This commit is contained in:
Executable
+59
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011 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__).'/../../include/basis_db.class.php');
|
||||
|
||||
class menu_addon extends basis_db
|
||||
{
|
||||
protected $items=array(); //title, link, target, name
|
||||
protected $block;
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt alle Items als Linkliste aus
|
||||
*
|
||||
*/
|
||||
public function outputItems()
|
||||
{
|
||||
echo '<ul style="margin-top: 0px; margin-bottom: 0px;">';
|
||||
foreach($this->items as $row)
|
||||
{
|
||||
echo '<li>
|
||||
<a class="Item2" title="'.$row['title'].'" href="'.$row['link'].'" target="'.$row['target'].'">'.$row['name'].'</a>
|
||||
</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt einen CodeBlock aus
|
||||
*/
|
||||
public function outputBlock()
|
||||
{
|
||||
echo $this->block;
|
||||
}
|
||||
}
|
||||
?>
|
||||
+164
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
require_once(dirname(__FILE__).'/menu_addon.class.php');
|
||||
require_once(dirname(__FILE__).'/../../include/studiengang.class.php');
|
||||
require_once(dirname(__FILE__).'/../../include/lehrveranstaltung.class.php');
|
||||
require_once(dirname(__FILE__).'/../../include/organisationsform.class.php');
|
||||
require_once(dirname(__FILE__).'/../../include/functions.inc.php');
|
||||
require_once(dirname(__FILE__).'/../../include/phrasen.class.php');
|
||||
require_once(dirname(__FILE__).'/../../include/student.class.php');
|
||||
|
||||
class menu_addon_lehrveranstaltungen extends menu_addon
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$sprache = getSprache();
|
||||
$user = get_uid();
|
||||
$student = new student();
|
||||
if($student->load($user))
|
||||
$studiengang_kz=$student->studiengang_kz;
|
||||
|
||||
$p = new phrasen($sprache);
|
||||
|
||||
|
||||
$this->block.='
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
function MM_jumpMenu(targ, selObj, restore)
|
||||
{
|
||||
eval(targ + ".location=\'" + selObj.options[selObj.selectedIndex].value + "\'");
|
||||
|
||||
if(restore)
|
||||
{
|
||||
selObj.selectedIndex = 0;
|
||||
}
|
||||
}
|
||||
//-->
|
||||
</script>';
|
||||
|
||||
$this->block.='
|
||||
<table class="tabcontent">
|
||||
<tr>
|
||||
<td width="81" class="tdwrap">'.$p->t('global/studiengang').': </td>
|
||||
<td class="tdwrap">
|
||||
<select name="course" onChange="MM_jumpMenu(\'self\',this,0)">';
|
||||
|
||||
$stg_obj = new studiengang();
|
||||
$stg_obj->getAll('typ, kurzbz');
|
||||
|
||||
if(isset($_GET['studiengang_kz']) && is_numeric($_GET['studiengang_kz']))
|
||||
$studiengang_kz=$_GET['studiengang_kz'];
|
||||
|
||||
if(isset($_GET['semester']) && is_numeric($_GET['semester']))
|
||||
$semester=$_GET['semester'];
|
||||
else
|
||||
$semester=1;
|
||||
|
||||
$sel_kurzbzlang='';
|
||||
foreach($stg_obj->result as $row)
|
||||
{
|
||||
if($row->studiengang_kz!=0)
|
||||
{
|
||||
if(isset($studiengang_kz) AND $studiengang_kz == $row->studiengang_kz)
|
||||
{
|
||||
$this->block.= '<option value="?content_id='.$_GET['content_id'].'&studiengang_kz='.$row->studiengang_kz.'&semester='.$semester.'" selected>'.$row->kuerzel .' ('.$row->kurzbzlang.')</option>';
|
||||
$sel_kurzbzlang=$row->kurzbzlang;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->block.='<option value="?content_id='.$_GET['content_id'].'&studiengang_kz='.$row->studiengang_kz.'&semester='.$semester.'">'.$row->kuerzel .' ('.$row->kurzbzlang.')</option>';
|
||||
}
|
||||
if(!isset($studiengang_kz))
|
||||
{
|
||||
$studiengang_kz=$row->studiengang_kz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->block.='
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tdwrap"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tdwrap">'.$p->t('global/semester').': </td>
|
||||
<td class="tdwrap">
|
||||
<select name="term" onChange="MM_jumpMenu(\'self\',this,0)">';
|
||||
|
||||
$short = 'Fehler Stg.Kz '.$studiengang_kz;
|
||||
$max = 1;
|
||||
if ($stg_obj=new studiengang($studiengang_kz))
|
||||
{
|
||||
$short = $stg_obj->kuerzel;
|
||||
$max = $stg_obj->max_semester;
|
||||
}
|
||||
if($semester>$max)
|
||||
$semester=1;
|
||||
for($i=0;$i<$max;$i++)
|
||||
{
|
||||
if(($i+1)==$semester)
|
||||
$this->block.= '<option value="?content_id='.$_GET['content_id'].'&studiengang_kz='.$studiengang_kz.'&semester='.($i+1).'" selected >'.($i+1).'. Semester</option>';
|
||||
else
|
||||
$this->block.= '<option value="?content_id='.$_GET['content_id'].'&studiengang_kz='.$studiengang_kz.'&semester='.($i+1).'">'.($i+1).'. Semester</option>';
|
||||
}
|
||||
|
||||
$this->block.='
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>';
|
||||
$this->block.= '<script language="JavaScript" type="text/javascript">';
|
||||
$this->block.= ' parent.content.location.href="../cms/news.php?studiengang_kz='.$studiengang_kz.'&semester='.$semester.'"';
|
||||
$this->block.= '</script>';
|
||||
$this->block.='
|
||||
<tr>
|
||||
<td class="tdwrap"> </td>
|
||||
</tr>';
|
||||
|
||||
|
||||
if (!$lv_obj = new lehrveranstaltung())
|
||||
die('Fehler beim Oeffnen der Lehrveranstaltung');
|
||||
|
||||
$lv_obj->lehrveranstaltungen=array();
|
||||
if ($lv_obj->load_lva($studiengang_kz,$semester,null,TRUE,TRUE,'orgform_kurzbz DESC, bezeichnung'))
|
||||
{
|
||||
$lastform=null;
|
||||
foreach ($lv_obj->lehrveranstaltungen as $row)
|
||||
{
|
||||
if($row->orgform_kurzbz!=$lastform)
|
||||
{
|
||||
$orgform = new organisationsform();
|
||||
$orgform->load($row->orgform_kurzbz);
|
||||
|
||||
$this->block.= "<tr><td><b>$orgform->bezeichnung</b></td></tr>";
|
||||
|
||||
$lastform=$row->orgform_kurzbz;
|
||||
}
|
||||
$this->block.= '<tr>';
|
||||
$this->block.= ' <td class="tdwrap"><ul style="margin: 0px; padding: 0px; padding-left: 20px;">';
|
||||
$this->block.= "<li><a class=\"Item2\" title=\"".$row->bezeichnung."\" href=\"private/lehre/lesson.php?lvid=$row->lehrveranstaltung_id\" target=\"content\">".$this->CutString($row->bezeichnung, 21).' '.$row->lehrform_kurzbz."</a></li>";
|
||||
$this->block.= ' </ul></td>';
|
||||
$this->block.= '</tr>';
|
||||
}
|
||||
}
|
||||
$this->block.='</table>';
|
||||
$this->outputBlock();
|
||||
}
|
||||
|
||||
private function CutString($strVal, $limit)
|
||||
{
|
||||
if(mb_strlen($strVal) > $limit+3)
|
||||
{
|
||||
return mb_substr($strVal, 0, $limit) . "...";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $strVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new menu_addon_lehrveranstaltungen();
|
||||
?>
|
||||
Executable
+117
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
require_once(dirname(__FILE__).'/menu_addon.class.php');
|
||||
require_once(dirname(__FILE__).'/../../include/functions.inc.php');
|
||||
require_once(dirname(__FILE__).'/../../include/phrasen.class.php');
|
||||
require_once(dirname(__FILE__).'/../../include/studiensemester.class.php');
|
||||
|
||||
class menu_addon_meinelv extends menu_addon
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$sprache = getSprache();
|
||||
$user = get_uid();
|
||||
|
||||
$is_lector=check_lektor($user);
|
||||
|
||||
$p = new phrasen($sprache);
|
||||
$cutlength=21;
|
||||
//Meine LVs Student
|
||||
if(!$is_lector)
|
||||
{
|
||||
if ($stsemobj = new studiensemester())
|
||||
{
|
||||
$stsem = $stsemobj->getAktorNext();
|
||||
$qry = "SELECT distinct lehrveranstaltung_id, bezeichnung, studiengang_kz, semester, lehre, lehreverzeichnis from campus.vw_student_lehrveranstaltung WHERE uid='$user' AND studiensemester_kurzbz='$stsem' AND lehre=true AND lehreverzeichnis<>'' ORDER BY studiengang_kz, semester, bezeichnung";
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
{
|
||||
if($row->studiengang_kz==0 && $row->semester==0) // Freifach
|
||||
{
|
||||
$this->items[] = array('title'=>$row->bezeichnung,
|
||||
'target'=>'content',
|
||||
'link'=>'private/freifaecher/lesson.php?lvid='.$row->lehrveranstaltung_id,
|
||||
'name'=>'FF '.$this->CutString($row->bezeichnung, $cutlength)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->items[] = array('title'=>$row->bezeichnung,
|
||||
'target'=>'content',
|
||||
'link'=>'private/lehre/lesson.php?lvid='.$row->lehrveranstaltung_id,
|
||||
'name'=>$stg[$row->studiengang_kz].$row->semester.' '.$this->CutString($row->bezeichnung, $cutlength)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
echo "Fehler beim Auslesen der LV";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Fehler Semester beim Auslesen der LV";
|
||||
}
|
||||
}
|
||||
|
||||
//Eigenen LV des eingeloggten Lektors anzeigen
|
||||
if($is_lector)
|
||||
{
|
||||
if ($stsemobj = new studiensemester())
|
||||
{
|
||||
$stsem = $stsemobj->getAktorNext();
|
||||
$qry = "SELECT distinct bezeichnung, studiengang_kz, semester, lehreverzeichnis, tbl_lehrveranstaltung.lehrveranstaltung_id FROM lehre.tbl_lehrveranstaltung, lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter
|
||||
WHERE tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_lehreinheit.lehrveranstaltung_id AND
|
||||
tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND
|
||||
mitarbeiter_uid='$user' AND tbl_lehreinheit.studiensemester_kurzbz='$stsem'";
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
{
|
||||
if($row->studiengang_kz==0 AND $row->semester==0)
|
||||
{
|
||||
$this->items[] = array('title'=>$row->bezeichnung,
|
||||
'target'=>'content',
|
||||
'link'=>'private/freifaecher/lesson.php?lvid='.$row->lehrveranstaltung_id,
|
||||
'name'=>'FF '.$this->CutString($row->lehreverzeichnis, $cutlength)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$stg_obj = new studiengang();
|
||||
$stg_obj->load($row->studiengang_kz);
|
||||
$kurzbz = $stg_obj->kuerzel.'-'.$row->semester;
|
||||
|
||||
$this->items[] = array('title'=>$row->bezeichnung,
|
||||
'target'=>'content',
|
||||
'link'=>'private/lehre/lesson.php?lvid='.$row->lehrveranstaltung_id,
|
||||
'name'=>$kurzbz.' '.$this->CutString($row->bezeichnung, $cutlength)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
echo "Fehler beim Auslesen des Lehrfaches";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Fehler Semester beim Auslesen der LV";
|
||||
}
|
||||
}
|
||||
$this->outputItems();
|
||||
}
|
||||
|
||||
private function CutString($strVal, $limit)
|
||||
{
|
||||
if(mb_strlen($strVal) > $limit+3)
|
||||
{
|
||||
return mb_substr($strVal, 0, $limit) . "...";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $strVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new menu_addon_meinelv();
|
||||
?>
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
require_once(dirname(__FILE__).'/menu_addon.class.php');
|
||||
|
||||
class menu_addon_test extends menu_addon
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
//Liste mit Links
|
||||
$this->items[]=array('title'=>'Testlink 1',
|
||||
'target'=>'content',
|
||||
'link'=>'lesson.php',
|
||||
'name'=>'tl1');
|
||||
$this->items[]=array('title'=>'Testlink 2',
|
||||
'target'=>'content',
|
||||
'link'=>'lesson.php',
|
||||
'name'=>'tl2');
|
||||
$this->items[]=array('title'=>'Testlink 3',
|
||||
'target'=>'content',
|
||||
'link'=>'lesson.php',
|
||||
'name'=>'tl3');
|
||||
$this->outputItems();
|
||||
|
||||
|
||||
// Eigener Codeblock
|
||||
$this->block='
|
||||
<form method="POST">
|
||||
<select name="stg_kz">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
</select>
|
||||
<input type="submit" value="ok">
|
||||
</form>
|
||||
';
|
||||
if(isset($_POST['stg_kz']))
|
||||
$this->block.='KZ:'.$_POST['stg_kz'];
|
||||
$this->outputBlock();
|
||||
}
|
||||
}
|
||||
|
||||
new menu_addon_test();
|
||||
?>
|
||||
Executable
+78
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
require_once(dirname(__FILE__).'/menu_addon.class.php');
|
||||
require_once(dirname(__FILE__).'/../../include/functions.inc.php');
|
||||
require_once(dirname(__FILE__).'/../../include/phrasen.class.php');
|
||||
require_once(dirname(__FILE__).'/../../include/benutzerberechtigung.class.php');
|
||||
require_once(dirname(__FILE__).'/../../include/funktion.class.php');
|
||||
|
||||
class menu_addon_zeitsperren extends menu_addon
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$sprache = getSprache();
|
||||
$user = get_uid();
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
$p = new phrasen($sprache);
|
||||
|
||||
$fkt=new funktion();
|
||||
$fkt->getAll($user);
|
||||
|
||||
if ($rechte->isFix() || $rechte->isBerechtigt('mitarbeiter/zeitsperre'))
|
||||
{
|
||||
$this->items[] = array('title' => $p->t('menu/zeitsperren'),
|
||||
'target'=> 'content',
|
||||
'link' => 'private/profile/zeitsperre_days.php?days=12',
|
||||
'name' => $p->t('menu/zeitsperren')
|
||||
);
|
||||
|
||||
if ($rechte->isBerechtigt('admin',0) || $rechte->isBerechtigt('mitarbeiter'))
|
||||
{
|
||||
$this->items[] = array('title' => $p->t('menu/resturlaub'),
|
||||
'target'=> 'content',
|
||||
'link' => 'private/profile/resturlaub.php',
|
||||
'name' => $p->t('menu/resturlaub')
|
||||
);
|
||||
}
|
||||
|
||||
if ($rechte->isBerechtigt('admin',0) || $rechte->isBerechtigt('mitarbeiter')
|
||||
|| $fkt->checkFunktion('stvLtg')|| $fkt->checkFunktion('gLtg')
|
||||
|| $fkt->checkFunktion('Leitung') || $fkt->checkFunktion('ass'))
|
||||
{
|
||||
$this->items[] = array('title' => $p->t('menu/fixangestellte'),
|
||||
'target'=> 'content',
|
||||
'link' => 'private/profile/zeitsperre.php?fix=true',
|
||||
'name' => $p->t('menu/fixangestellte')
|
||||
);
|
||||
$this->items[] = array('title' => $p->t('menu/fixelektoren'),
|
||||
'target'=> 'content',
|
||||
'link' => 'private/profile/zeitsperre.php?fix=true&lektor=true',
|
||||
'name' => $p->t('menu/fixelektoren')
|
||||
);
|
||||
$this->items[] = array('title' => $p->t('menu/organisationseinheit'),
|
||||
'target'=> 'content',
|
||||
'link' => 'private/profile/zeitsperre.php?organisationseinheit=',
|
||||
'name' => $p->t('menu/organisationseinheit')
|
||||
);
|
||||
}
|
||||
|
||||
$stg_obj = new studiengang();
|
||||
$stg_obj->loadArray($rechte->getStgKz('admin'), 'typ, kurzbz', true);
|
||||
foreach($stg_obj->result as $row)
|
||||
{
|
||||
$this->items[] = array('title' => 'Lektoren '.$row->kurzbzlang,
|
||||
'target'=> 'content',
|
||||
'link' => 'private/profile/zeitsperre.php?funktion=lkt&stg_kz='.$row->studiengang_kz,
|
||||
'name' => $p->t('menu/lektoren').' '.$row->kurzbzlang
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
$this->outputItems();
|
||||
}
|
||||
}
|
||||
|
||||
new menu_addon_zeitsperren();
|
||||
?>
|
||||
Reference in New Issue
Block a user