diff --git a/application/controllers/jobs/AmpelMail.php b/application/controllers/jobs/AmpelMail.php
index f77122735..fdc6ad405 100644
--- a/application/controllers/jobs/AmpelMail.php
+++ b/application/controllers/jobs/AmpelMail.php
@@ -17,10 +17,10 @@ if (! defined('BASEPATH'))
class AmpelMail extends FHC_Controller
{
const CIS_AMPELVERWALTUNG_URL =
- CIS_ROOT. "index.php?sprache=German&content_id=&menu=".
- CIS_ROOT. "menu.php?content_id=&content=".
- CIS_ROOT. "private/tools/ampelverwaltung.php";
-
+ CIS_ROOT. "cis/index.php?menu=".
+ CIS_ROOT. "cis/menu.php?content_id=&content=".
+ CIS_ROOT. "cis/private/tools/ampelverwaltung.php";
+
/**
* Constructor
*/
@@ -39,11 +39,11 @@ class AmpelMail extends FHC_Controller
echo "Jobs must be run from the CLI";
exit;
}
-
+
// Load models
$this->load->model('content/Ampel_model', 'AmpelModel');
$this->load->model('person/Person_model', 'PersonModel');
-
+
// Load helpers
$this->load->helper('sancho');
}
@@ -60,7 +60,7 @@ class AmpelMail extends FHC_Controller
echo $result. PHP_EOL;
}
-
+
/**
* Generates mail content for new and overdue Ampeln, which
* 1. are not confirmed by the user yet and
@@ -81,7 +81,7 @@ class AmpelMail extends FHC_Controller
if (hasData($result_active_ampeln))
{
$ampel_arr = $result_active_ampeln->retval;
-
+
// Loop through ampeln
foreach ($ampel_arr as $ampel)
{
@@ -95,11 +95,11 @@ class AmpelMail extends FHC_Controller
// get all user, who get this ampel
$result_ampel_user = $this->AmpelModel->execBenutzerSelect($qry_all_ampel_user);
-
+
if (hasData($result_ampel_user))
{
$ampel_user_arr = $result_ampel_user->retval;
-
+
// loop through all user, who get this ampel
foreach ($ampel_user_arr as $ampel_user)
{
@@ -131,7 +131,7 @@ class AmpelMail extends FHC_Controller
$html_text = '
'. strtoupper($ampel->kurzbz). '
- Die Deadline für die Bestätigung war am
+ Die Deadline für die Bestätigung war am
'. date_format($deadline, 'Y-m-d'). '
';
@@ -177,7 +177,7 @@ class AmpelMail extends FHC_Controller
);
};
}
-
+
// ------------------------------------------------------------------------
// Private methods
/**
@@ -190,10 +190,10 @@ class AmpelMail extends FHC_Controller
private function _getAmpelContentData($uid, $html_text, $ampel_data_arr)
{
$firstName = $this->PersonModel->getByUid($uid)->retval[0]->vorname;
-
+
// check if user already exists in the array
$key_position = array_search($uid, array_column($ampel_data_arr, 'uid'));
-
+
// If user already exists in the array, add only new ampel data to users ampel list
if ($key_position !== false)
{
diff --git a/application/controllers/system/Filters.php b/application/controllers/system/Filters.php
index 9de16ff20..2a9919e35 100644
--- a/application/controllers/system/Filters.php
+++ b/application/controllers/system/Filters.php
@@ -178,7 +178,7 @@ class Filters extends FHC_Controller
}
else
{
- $this->outputJsonError('Wrong parameter');
+ $this->outputJsonError('An error occurred while saving a custom filter');
}
}
diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php
index 1f464e09b..e57d3c1be 100644
--- a/application/controllers/system/infocenter/InfoCenter.php
+++ b/application/controllers/system/infocenter/InfoCenter.php
@@ -1199,14 +1199,16 @@ class InfoCenter extends Auth_Controller
$notizenBewerbung = $this->NotizModel->getNotizByTitel($person_id, 'Anmerkung zur Bewerbung')->retval;
- $notizentext = '';
- $lastElement = end($notizenBewerbung);
+ $notizentext = '
';
foreach ($notizenBewerbung as $notiz)
{
- $notizentext .= $notiz->text;
- if ($notiz != $lastElement)
- $notizentext .= ' | ';
+ // For applicant-notices the user is not shown
+ if ($notiz->insertvon != 'online_notiz')
+ $notizentext .= '
'.$notiz->text.' ('.$notiz->insertvon.')
';
+ else
+ $notizentext .= '
'.$notiz->text.'
';
}
+ $notizentext .= '
';
$mailadresse = '';
foreach ($person->kontakte as $kontakt)
diff --git a/application/libraries/NavigationLib.php b/application/libraries/NavigationLib.php
index a30c3943a..4fa47b9ce 100644
--- a/application/libraries/NavigationLib.php
+++ b/application/libraries/NavigationLib.php
@@ -47,114 +47,23 @@ class NavigationLib
// Public methods
/**
- * Creates the left Menu for each Page
- * @param navigation_widget_called GET Parameter witch holds the currently called Page
+ * Creates the left menu for each Page
+ * @param navigationPage GET Parameter witch holds the currently called Page
* @return array with the Menu Entries
*/
public function getMenuArray($navigationPage)
{
- $menuArray = array();
-
- if (isset($navigationPage))
- {
- // Get Menu Entries of the Core
- $navigationMenuArray = $this->_ci->config->item(self::CONFIG_MENU_NAME);
- $menuArray = $this->_wildcardsearch($navigationMenuArray, $navigationPage);
-
- // Load Menu Entries of Extensions
- $extensions = $this->_ci->extensionslib->getInstalledExtensions();
- if(hasData($extensions))
- {
- $json_extension = array();
- foreach($extensions->retval as $ext)
- {
- $filename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/'.self::CONFIG_NAVIGATION_FILENAME;
- if (file_exists($filename))
- {
- unset($config);
- include($filename);
- if(isset($config[self::CONFIG_MENU_NAME]) && is_array($config[self::CONFIG_MENU_NAME]))
- {
- $json_extension = array_merge_recursive(
- $json_extension,
- $this->_wildcardsearch($config[self::CONFIG_MENU_NAME],
- $navigationPage)
- );
- }
- }
- }
- // Merge Extension Menuentries with the Core Entries
- $menuArray = array_merge_recursive($menuArray, $json_extension);
- }
-
- // Load dynamic Menu Entries from Session
- if (($navigationMenuSessionArray = $this->getSessionMenu()) != null)
- {
- if (isset($navigationMenuSessionArray) && is_array($navigationMenuSessionArray))
- {
- $menuArray = array_merge_recursive($menuArray, $navigationMenuSessionArray);
- }
- }
- }
-
- $this->_sortArray($menuArray);
-
- return $menuArray;
+ return $this->_getNavigationArray($navigationPage, self::CONFIG_MENU_NAME, $this->getSessionMenu());
}
/**
- * Creates the Top Menu for each Page
- * @param navigation_widget_called GET Parameter witch holds the currently called Page
+ * Creates the header menu for each Page
+ * @param navigationPage GET Parameter witch holds the currently called Page
* @return array with the Menu Entries
*/
public function getHeaderArray($navigationPage)
{
- $headerArray = array();
-
- if (isset($navigationPage))
- {
- // Load Header Entries of Core
- $navigationHeaderArray = $this->_ci->config->item(self::CONFIG_HEADER_NAME);
- $headerArray = $this->_wildcardsearch($navigationHeaderArray, $navigationPage);
-
- // Load Header Entries of Extensions
- $extensions = $this->_ci->extensionslib->getInstalledExtensions();
- if(hasData($extensions))
- {
- $headerArray_extension = array();
- foreach($extensions->retval as $ext)
- {
- $filename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/'.self::CONFIG_NAVIGATION_FILENAME;
- if (file_exists($filename))
- {
- unset($config);
- include($filename);
- if(isset($config[self::CONFIG_HEADER_NAME]) && is_array($config[self::CONFIG_HEADER_NAME]))
- {
- $headerArray_extension = array_merge_recursive(
- $json_extension,
- $this->_wildcardsearch($config[self::CONFIG_HEADER_NAME],
- $navigationPage)
- );
- }
- }
- }
- $headerArray = array_merge_recursive($headerArray, $headerArray_extension);
- }
-
- // Load dynamic Header Entries from Session
- if (($navigationHeaderSessionArray = $this->getSessionHeader()) != null)
- {
- if (isset($navigationHeaderSessionArray) && is_array($navigationHeaderSessionArray))
- {
- $headerArray = array_merge_recursive($headerArray, $navigationHeaderSessionArray);
- }
- }
- }
-
- $this->_sortArray($headerArray);
-
- return $headerArray;
+ return $this->_getNavigationArray($navigationPage, self::CONFIG_HEADER_NAME, $this->getSessionHeader());
}
/**
@@ -292,6 +201,61 @@ class NavigationLib
//------------------------------------------------------------------------------------------------------------------
// Private methods
+ /**
+ * Build the array needed by the NavigationWidget to render the left menu or the header
+ * menu depending on the given parameters
+ * @param navigationPage GET Parameter witch holds the currently called Page
+ * @param configName the name of the navigation config entry
+ * @param sessionArray array present in the session that could contains other menu entries
+ * @return array with the Menu Entries
+ */
+ private function _getNavigationArray($navigationPage, $configName, $sessionArray)
+ {
+ $navigationArray = array();
+
+ if (isset($navigationPage))
+ {
+ // Load Header Entries of Core
+ $configArray = $this->_ci->config->item($configName);
+ $navigationArray = $this->_wildcardsearch($configArray, $navigationPage);
+
+ // Load Header Entries of Extensions
+ $extensions = $this->_ci->extensionslib->getInstalledExtensions();
+ if (hasData($extensions))
+ {
+ $extensionArray = array();
+ foreach ($extensions->retval as $ext)
+ {
+ $filename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/'.self::CONFIG_NAVIGATION_FILENAME;
+ if (file_exists($filename))
+ {
+ unset($config);
+ include($filename);
+ if (isset($config[$configName]) && is_array($config[$configName]))
+ {
+ $extensionArray = array_merge_recursive(
+ $json_extension,
+ $this->_wildcardsearch($config[$configName],
+ $navigationPage)
+ );
+ }
+ }
+ }
+ $navigationArray = array_merge_recursive($navigationArray, $extensionArray);
+ }
+
+ // Load dynamic header entries from session
+ if ($sessionArray != null && is_array($sessionArray))
+ {
+ $navigationArray = array_merge_recursive($navigationArray, $sessionArray);
+ }
+ }
+
+ $this->_sortArray($navigationArray);
+
+ return $navigationArray;
+ }
+
/**
* Searches a Menuentry. If there is no exact entry it searches for Wildcard Entries with a Star
* Example:
@@ -311,20 +275,20 @@ class NavigationLib
krsort($navigationArray);
// 100% match found
- if(isset($navigationArray[$navigationPage]))
+ if (isset($navigationArray[$navigationPage]))
{
return $navigationArray[$navigationPage];
}
else
{
- foreach($navigationArray as $key=>$row)
+ foreach ($navigationArray as $key=>$row)
{
// Search for * Entries
- if(mb_strpos($key, '*') === 0 || mb_strpos($key, '*') === mb_strlen($key) - 1)
+ if (mb_strpos($key, '*') === 0 || mb_strpos($key, '*') === mb_strlen($key) - 1)
{
// Take * Entry if Matches
$search = mb_substr($key, 0, -1);
- if($search == '' || mb_strpos($navigationPage, $search) === 0)
+ if ($search == '' || mb_strpos($navigationPage, $search) === 0)
{
return $row;
}
diff --git a/application/models/content/Ampel_model.php b/application/models/content/Ampel_model.php
index e569755df..aeb260a5c 100644
--- a/application/models/content/Ampel_model.php
+++ b/application/models/content/Ampel_model.php
@@ -10,7 +10,7 @@ class Ampel_model extends DB_Model
$this->dbTable = 'public.tbl_ampel';
$this->pk = 'ampel_id';
}
-
+
/**
* Returns all active Ampeln, that are actually:
* 1. not after the deadline date
@@ -25,24 +25,24 @@ class Ampel_model extends DB_Model
SELECT *
FROM public.tbl_ampel
WHERE';
-
+
if ($email === true)
{
$parametersArray['email'] = $email;
$query .= ' email = ? AND';
}
-
+
$query .= '
- (NOW()<(deadline+(verfallszeit || \' days\')::interval)::date)
- OR (verfallszeit IS NULL AND NOW() < deadline)
- AND (NOW()>(deadline-(vorlaufzeit || \' days\')::interval)::date)
- OR (vorlaufzeit IS NULL AND NOW() > deadline)';
-
+ (NOW()<(deadline+(COALESCE(verfallszeit,0) || \' days\')::interval)::date)
+ OR (verfallszeit IS NULL)
+ AND (NOW()>(deadline-(COALESCE(vorlaufzeit,0) || \' days\')::interval)::date)
+ OR (vorlaufzeit IS NULL AND NOW() < deadline)';
+
$query .= ' ORDER BY deadline DESC';
-
+
return $this->execQuery($query, $parametersArray);
}
-
+
/**
* Returns all Ampel-receiver of a specific Ampel.
* @param string $benutzer_select SQL Statement which defines the Ampel-receiver.
@@ -55,7 +55,7 @@ class Ampel_model extends DB_Model
return $this->execQuery($benutzer_select);
}
}
-
+
/**
* Checks if Ampel was confirmed by the user.
* @param int $ampel_id Ampel-ID
@@ -75,7 +75,7 @@ class Ampel_model extends DB_Model
{
$result = $this->execQuery($query, array($ampel_id, $uid));
}
-
+
if ($result)
{
if (count($result->retval) > 0)
@@ -87,7 +87,7 @@ class Ampel_model extends DB_Model
return false;
}
}
- else
+ else
return $result; //will contain the error-msg from execQuery
}
}
diff --git a/cis/ampel.php b/cis/ampel.php
index e767d9a6f..2f80092d5 100644
--- a/cis/ampel.php
+++ b/cis/ampel.php
@@ -24,75 +24,75 @@ function hide_ampel_div()
if(is_user_logged_in())
{
$user = get_uid();
-
+
$ampel = new ampel();
$ampel->loadUserAmpel($user);
$rot=0;
- $gelb = 0;
+ $gelb = 0;
$gruen = 0;
$verpflichtend = false;
- $cnt_verpflichtend = 0;
- $cnt_abgelaufen = 0;
+ $cnt_verpflichtend = 0;
+ $cnt_abgelaufen = 0;
$cnt_notConf_notOverdue = 0; //counts mandatory, not confirmed && not overdued ampeln (for popup)
-
+
$datum = new datum();
$now = $datum->mktime_fromdate(date('Y-m-d'));
foreach($ampel->result as $row)
- {
+ {
$deadline =$datum->mktime_fromdate($row->deadline);
$vorlaufzeit = $row->vorlaufzeit;
$verfallszeit = $row->verfallszeit;
$bestaetigt = $ampel->isBestaetigt($user, $row->ampel_id);
$verpflichtend = $row->verpflichtend;
$abgelaufen = false;
-
+
$datum_liegt_vor_vorlaufzeit = false;
$datum_liegt_nach_verfallszeit = false;
-
+
if (!is_null($vorlaufzeit))
- $datum_liegt_vor_vorlaufzeit = $now < strtotime('-' . $vorlaufzeit . ' day', $deadline);
-
+ $datum_liegt_vor_vorlaufzeit = $now < strtotime('-' . $vorlaufzeit . ' day', $deadline);
+
if (!is_null($verfallszeit))
$datum_liegt_nach_verfallszeit = $now > strtotime('+' . $verfallszeit . ' day', $deadline);
-
+
//count mandatory
if($verpflichtend == 't')
$cnt_verpflichtend++;
-
+
//count overdue
if ($datum_liegt_nach_verfallszeit)
$cnt_abgelaufen++;
//set status
if ($bestaetigt)
- $gruen++;
- else if ($now >= $deadline && !$datum_liegt_nach_verfallszeit && !$bestaetigt)
+ $gruen++;
+ else if ($now >= $deadline && !$datum_liegt_nach_verfallszeit && !$bestaetigt)
$rot++;
else if (!$datum_liegt_nach_verfallszeit && !$datum_liegt_vor_vorlaufzeit)
- $gelb++;
-
+ $gelb++;
+
//count mandatory ampeln that are not confirmed and not overdue (for popup)
if ($verpflichtend == 't' && !$bestaetigt && !$datum_liegt_nach_verfallszeit && !$datum_liegt_vor_vorlaufzeit)
- $cnt_notConf_notOverdue++;
+ $cnt_notConf_notOverdue++;
}
-
+
//if at least ONE mandatory notification, which is not overdue -> trigger notification-POPUP
if ($cnt_notConf_notOverdue > 0)
- {
+ {
echo ' ';
-
+
echo ' ';
}
-
+
//show & color header ampel-link
if($rot > 0)
echo ''.$p->t("tools/ampelsystem").'| ';
elseif($gelb > 0)
echo ''.$p->t("tools/ampelsystem").'| ';
elseif($rot==0 || $rot <= $cnt_abgelaufen && $gelb==0)
- echo ''.$p->t("tools/ampelsystem").'| ';
+ echo ''.$p->t("tools/ampelsystem").'| ';
}
else
{
echo "";
}
-?>
\ No newline at end of file
+?>
diff --git a/cis/index.php b/cis/index.php
index 401f0d51f..60c9aceeb 100644
--- a/cis/index.php
+++ b/cis/index.php
@@ -165,11 +165,12 @@ $db = new basis_db();
-
-
-
-
-
+
+
+
+
+
+
-
+
' . $p->t('tools/ampelsystem') . '';
- //title in popup for mandatory ampeln
+ //***************************************** AROUSE SANCHO for mandatory ampeln
if ($is_popup)
- echo '
isLocked($id))
$dokumente_person = new dokument();
$dokumente_person->getAllDokumenteForPerson($person_id, true);
+
$dokumente_arr = array();
foreach ($dokumente_person->result AS $row)
$dokumente_arr[] .= $row->dokument_kurzbz;
-
+
+ // An der FHTW wird das vorläufige ZGV Dokument verlangt und kann somit auch heruntergeladen werden
+ if (CAMPUS_NAME == 'FH Technikum Wien')
+ {
+ $dokumente_arr[] .= 'ZgvBaPre';
+ }
if ($person_id!=$akte_person || !in_array($akte_dokument_kurzbz, $dokumente_arr))
die('Sie haben keinen Zugriff auf dieses Dokument');
}
diff --git a/include/akte.class.php b/include/akte.class.php
index 6c053f6a5..8a454c0bf 100644
--- a/include/akte.class.php
+++ b/include/akte.class.php
@@ -316,7 +316,7 @@ class akte extends basis_db
$qry.=" AND dokument_kurzbz=".$this->db_add_param($dokument_kurzbz);
if($stg_kz != null && $prestudent_id != null)
$qry.=" AND dokument_kurzbz not in (SELECT dokument_kurzbz FROM public.tbl_dokument JOIN public.tbl_dokumentstudiengang USING(dokument_kurzbz)
- WHERE studiengang_kz= ".$this->db_add_param($stg_kz).") AND dokument_kurzbz NOT IN ('Zeugnis') AND dokument_kurzbz NOT IN
+ WHERE studiengang_kz= ".$this->db_add_param($stg_kz).") AND dokument_kurzbz NOT IN ('Zeugnis','DiplSupp','Bescheid') AND dokument_kurzbz NOT IN
(SELECT dokument_kurzbz FROM public.tbl_dokumentprestudent JOIN public.tbl_dokument USING(dokument_kurzbz)
WHERE prestudent_id=".$this->db_add_param($prestudent_id).")";
diff --git a/locale/de-AT/tools.php b/locale/de-AT/tools.php
index 7465d93c2..5d579e177 100644
--- a/locale/de-AT/tools.php
+++ b/locale/de-AT/tools.php
@@ -57,8 +57,10 @@ $this->phrasen['tools/ampelBitteBestaetigen']='Bitte bestätigen Sie diese jetzt
$this->phrasen['tools/ampelAbgelaufenTitel']='Abgelaufene oder bereits bestätigte Ampeln';
$this->phrasen['tools/ampelAbgelaufenTxt']='Sie können diese Ampeln weiterhin lesen, aber nicht mehr bestätigen.';
$this->phrasen['tools/ampelBestaetigtAbgelaufen']='Bereits bestätigt oder abgelaufen';
+$this->phrasen['tools/ampelAktuelleAmpeln']='Aktuelle Ampeln';
$this->phrasen['tools/ampelKeineAktuellen']='Keine aktuellen Ampeln';
$this->phrasen['tools/ampelKeineAktuellenTxt']='Sie haben zur Zeit keine aktuellen Ampeln.';
+$this->phrasen['tools/ampelClose']='Jetzt nicht';
//Software fuer Lehre -> Softgrid
$this->phrasen['tools/applikationsliste']='Applikationsliste';
diff --git a/locale/en-US/tools.php b/locale/en-US/tools.php
index 33e95efdc..276c72bbb 100644
--- a/locale/en-US/tools.php
+++ b/locale/en-US/tools.php
@@ -59,6 +59,7 @@ $this->phrasen['tools/ampelBitteBestaetigen']='Please confirm now!';
$this->phrasen['tools/ampelAbgelaufenTitel']='Notifications expired or confirmed';
$this->phrasen['tools/ampelAbgelaufenTxt']='Notifications can still be read, but not confirmed anymore.';
$this->phrasen['tools/ampelBestaetigtAbgelaufen']='Almost confirmed or expired';
+$this->phrasen['tools/ampelAktuelleAmpeln']='Actual notifications';
$this->phrasen['tools/ampelKeineAktuellen']='No current notifications.';
$this->phrasen['tools/ampelKeineAktuellenTxt']='You currently do not have any notifications.';
diff --git a/public/css/NavigationWidget.css b/public/css/NavigationWidget.css
index 9d7753825..b6d6c800e 100644
--- a/public/css/NavigationWidget.css
+++ b/public/css/NavigationWidget.css
@@ -48,7 +48,7 @@
float: left;
height: 50px;
padding-top: 15px;
- padding-right: 12px;
padding-left: 7px;
font-size: 16px;
+ margin-right: 3px;
}
diff --git a/public/js/FilterWidget.js b/public/js/FilterWidget.js
index f47481ee2..b87019a55 100644
--- a/public/js/FilterWidget.js
+++ b/public/js/FilterWidget.js
@@ -11,6 +11,8 @@
/**
* Global function used by NavigationWidget JS to bind events to side menu elements
+ * NOTE: it is called from the NavigationWidget JS therefore must be a global function
+ * Be carefull about recursive function calls!!!
*/
function sideMenuHook()
{
@@ -32,10 +34,10 @@ function sideMenuHook()
}
else
{
- // If a success and refreshSideMenu is a valid function then call it to refresh the side menu
- if (typeof refreshSideMenu == "function")
+ // If a success and refreshSideMenuHook is a valid function then call it to refresh the side menu
+ if (typeof refreshSideMenuHook == "function")
{
- refreshSideMenu();
+ refreshSideMenuHook();
}
}
}
@@ -493,7 +495,7 @@ var FHC_FilterWidget = {
filter_page: FHC_FilterWidget.getFilterPage()
},
{
- successCallback: refreshSideMenu // NOTE: to be checked
+ successCallback: refreshSideMenuHook // NOTE: to be checked
}
);
}
diff --git a/public/js/NavigationWidget.js b/public/js/NavigationWidget.js
index 4f7d05792..ee9adb83d 100644
--- a/public/js/NavigationWidget.js
+++ b/public/js/NavigationWidget.js
@@ -20,7 +20,8 @@ var FHC_NavigationWidget = {
* Renders the header menu (top horizontal menu)
*/
renderHeaderMenu: function() {
- //
+
+ // Retrives the header menu array
FHC_AjaxClient.ajaxCallGet(
'system/Navigation/header',
{
@@ -28,24 +29,16 @@ var FHC_NavigationWidget = {
},
{
successCallback: function(data, textStatus, jqXHR) {
+
if (FHC_AjaxClient.hasData(data))
{
+ var strHeaderMenu = '';
+
jQuery.each(FHC_AjaxClient.getData(data), function(i, e) {
-
- var headerEntry = '';
-
- if (e['icon'] != 'undefined' && e['icon'] != '')
- {
- headerEntry += '';
- }
-
- var target = '';
- if (e['target'] != null) target = e['target'];
-
- headerEntry += '' + e['description'] + '';
-
- $(".menu-header-items").append(headerEntry);
+ if (e != null) strHeaderMenu += FHC_NavigationWidget._buildHeaderMenuStructure(e);
});
+
+ $(".menu-header-items").html(strHeaderMenu);
}
}
}
@@ -56,7 +49,8 @@ var FHC_NavigationWidget = {
* Renders the side left menu
*/
renderSideMenu: function() {
- //
+
+ // Retrives the left menu array
FHC_AjaxClient.ajaxCallGet(
'system/Navigation/menu',
{
@@ -64,39 +58,67 @@ var FHC_NavigationWidget = {
},
{
successCallback: function(data, textStatus, jqXHR) {
+
if (FHC_AjaxClient.hasData(data))
{
- var strMenu = '';
+ FHC_NavigationWidget._printCollapseIcon(); // Applies bootstrap SB Admin 2 theme elements to the left menu
- FHC_NavigationWidget._printCollapseIcon();
+ var strLeftMenu = '';
+ // Builds left menu
jQuery.each(FHC_AjaxClient.getData(data), function(i, e) {
- if (e != null) strMenu += FHC_NavigationWidget._printNavItem(e);
+ if (e != null) strLeftMenu += FHC_NavigationWidget._buildLeftMenuStructure(e);
});
- $("#side-menu").html(strMenu);
- $("#side-menu").metisMenu();
+ $("#side-menu").html(strLeftMenu); // render left menu
+ $("#side-menu").metisMenu(); // call the Bootstrap SB Admin 2 theme renderer
}
+ // If this global function is present...
if (typeof sideMenuHook == 'function')
{
- sideMenuHook();
+ sideMenuHook(); // ...then call it
}
}
}
);
},
+ /**
+ * Calls URL to retrive a refreshed menu array
+ */
+ refreshSideMenuHook: function(url) {
+
+ FHC_AjaxClient.ajaxCallGet(
+ url,
+ {
+ navigation_page: FHC_NavigationWidget._getNavigationWidgetCalled()
+ },
+ {
+ successCallback: function(data, textStatus, jqXHR) {
+ FHC_NavigationWidget.renderSideMenu();
+ },
+ errorCallback: function(jqXHR, textStatus, errorThrown) {
+ alert(textStatus);
+ }
+ }
+ );
+ },
+
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
- *
+ * Applies bootstrap SB Admin 2 theme elements to the left menu
*/
_printCollapseIcon: function() {
// Hiding/showing navigation menu - works only with sb admin 2 template!!
if(!$("#collapseicon").length)
- $("#side-menu").parent().append('