File: D:/HostingSpaces/EvLuik/vanluiktegelwerken.nl/wwwroot/plugins/fhs_adminmenu/index.php
<?php
// if jQuery4CMSimple is installed
if (XH_ADM && is_readable($pth['folder']['plugins'].'jquery/jquery.inc.php')) {
include_once $pth['folder']['plugins'].'jquery/jquery.inc.php';
include_jQuery();
}
// FA_XH required
if (XH_ADM && $cf['editmenu']['external'] === 'fhs_adminmenu') {
if (class_exists('Fa\\RequireCommand')) {
$command = new Fa\RequireCommand;
$command->execute();
} else {
$hjs .= '<script>
$(document).ready(function() {
$( "body" ).prepend("<div id=\'fa-required\'><div><p>\"fhs_adminmenu\" requires the plugin \"FA_XH\".<br><a href=\"http://3-magi.net/?CMSimple_XH/Fa_XH\" target=\"_blank\">Download here</a><br><br><button type=\"button\" onclick=\"document.getElementById(\'fa-required\').style.visibility = \'hidden\'\">close</button></p></div></div>");
document.getElementById("fa-required").style.visibility = "visible";
});
</script>';
}
$hjs .= "\n" . tag('link rel="stylesheet" type="text/css" href="' . $pth['folder']['plugins'] . 'fhs_adminmenu/mCustomScrollbars/jquery.mCustomScrollbar.min.css"') . "\n";
}
/*
* Returns a navigation menu as select element.
* The navigation requires JavaScript to be enabled.
* obtained from hi_Admin for CMSimple_XH Version: 1.0beta1 - 2014-05-30
* ©2014 Holger Irmler - all rights reserved - http://CMSimple.HolgerIrmler.de
* @return (X)HTML.
*/
function xhDashSelectNav()
{
global $sn, $h, $u, $l, $s;
$pref = ' ';
$o = '<select class="xhDashSelectNav" onchange="if (this.value) location = this.value">';
if ($s < 0) {
$o .= '<option value=""></option>';
}
foreach ($h as $k => $v) {
$indent = str_repeat($pref, $l[$k] - 1);
$selected = $k == $s ? ' selected="selected"' : '';
$url = $sn . '?' . $u[$k];
$o .= '<option value="' . $url . '"' . $selected . '>' . $indent . $h[$k] . '</option>';
}
$o.= '</select>';
return $o;
}
/* end */
function fhs_admMenuTheme() {
global $plugin_cf;
$myarray = array('dark' , 'light');
$myconfig = $plugin_cf['fhs_adminmenu']['menu_Theme'];
if (in_array($myconfig, $myarray)) {
$admMenuThem = $plugin_cf['fhs_adminmenu']['menu_Theme'];
}
else {
$admMenuThem = 'dark';
}
return $admMenuThem;
}
$admMenuTheme = fhs_admMenuTheme();
if (XH_ADM) {
$hjs .= tag('link rel="stylesheet" type="text/css" href="' . $pth['folder']['plugins'] . 'fhs_adminmenu/css/' . $admMenuTheme . '-stylesheet.css"');
}
function fhs_admMenuPosition() {
global $plugin_cf;
$myarray = array('left' , 'right');
$myconfig = $plugin_cf['fhs_adminmenu']['menu_Position'];
if (in_array($myconfig, $myarray)) {
$admAnimatePos = $plugin_cf['fhs_adminmenu']['menu_Position'];
}
else {
$admAnimatePos = 'left';
}
return $admAnimatePos;
}
function fhs_admMenuWidth() {
global $plugin_cf;
$myconfig = $plugin_cf['fhs_adminmenu']['menu_Width'];
if ($myconfig !== '') {
$admMenuWid = $plugin_cf['fhs_adminmenu']['menu_Width'];
}
else {
$admMenuWid = '255';
}
return $admMenuWid;
}
function fhs_admButtonLabel()
{
global $plugin_tx;
$myconfig = $plugin_tx['fhs_adminmenu']['button_Label'];
if ($myconfig !== '') {
$buttonLabel = $plugin_tx['fhs_adminmenu']['button_Label'];
}
else {
$buttonLabel = 'XH Admin Menu ';
}
return $buttonLabel;
}
function fhs_adminmenu(array $plugins = array())
{
global $pth, $hjs, $bjs;
$admAnimatePosition = fhs_admMenuPosition();
$admMenuWidth = fhs_admMenuWidth();
$admMenuTheme = fhs_admMenuTheme();
$buttonLabel = fhs_admButtonLabel();
if ($admMenuTheme == 'dark') {
$admMenuThemeScrl = '';
} else {
$admMenuThemeScrl = '-dark';
}
$bjs .= '
<div id="xhDashBoard" class="draggable item">
<p class="xhDash">CMSimple_XH – DashBoard</p>
<div id="xhDashSelectNav">' . xhDashSelectNav() . '</div>
<div class="fhsLangMenu">' . languagemenu() . '</div>
</div>
<script>var admMenuWidth = "' . $admMenuWidth . '"; var buttonLabel = "' . $buttonLabel . '"; var admAnimatePosition = "' . $admAnimatePosition . '";</script>'
. '
<style>
#fhs_adminmenu_fixed {
width: ' . $admMenuWidth . ' !important;
}
</style>
<script src="' . $pth['folder']['plugins'] . 'fhs_adminmenu/mCustomScrollbars/jquery.mCustomScrollbar.concat.min.js"></script>'
. '
<script src="' . $pth['folder']['plugins'] . 'fhs_adminmenu/draggabilly/draggabilly.pkgd.min.js"></script>'
. '
<script src="' . $pth['folder']['plugins'] . 'fhs_adminmenu/fhs_adminmenu.js"></script>'
. '
<script>
$(function () {
$("#fhs_adminmenu_fixed").mCustomScrollbar({
theme: "minimal' . $admMenuThemeScrl . '",
scrollInertia: 200
});
$("#fhs_adminmenu_fixed").mCustomScrollbar("scrollTo", "#currentMenuItem");
$("#fhs_adminmenu_fixed").mCustomScrollbar("scrollTo", "+150");
});
</script>';
return XH_adminMenu($plugins);
}