BUG 0000 the option "Enterprise Plugins Manager" is always first.
Additionally, improved the code to meet coding standards.
This commit is contained in:
@@ -1,64 +1,83 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
$request = isset($_POST['request'])? $_POST['request']: (isset($_GET['request'])? $_GET['request']: null);
|
$request = isset($_POST['request'])? $_POST['request'] : (isset($_GET['request'])? $_GET['request'] : null);
|
||||||
|
|
||||||
switch($request){
|
switch ($request) {
|
||||||
case 'loadMenu':
|
case 'loadMenu':
|
||||||
if( ! isset($_GET['menu']) ) {
|
if (!isset($_GET['menu'])) {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
global $G_TMP_MENU;
|
global $G_TMP_MENU;
|
||||||
|
|
||||||
$oMenu = new Menu();
|
$oMenu = new Menu();
|
||||||
$oMenu->load('setup');
|
$oMenu->load('setup');
|
||||||
$items = Array();
|
$items = array();
|
||||||
|
|
||||||
foreach( $oMenu->Options as $i=>$option) {
|
foreach ($oMenu->Options as $i => $option) {
|
||||||
if( $oMenu->Types[$i] == $_GET['menu'] ){
|
if ($oMenu->Types[$i] == $_GET['menu']) {
|
||||||
$items[] = Array(
|
$items[] = array(
|
||||||
'id' => $oMenu->Id[$i],
|
'id' => $oMenu->Id[$i],
|
||||||
'url' => ($oMenu->Options[$i]!='')? $oMenu->Options[$i]: '#',
|
'url' => ($oMenu->Options[$i] != '')? $oMenu->Options[$i] : '#',
|
||||||
//'onclick' => ($oMenu->JS[$i]!='')? $oMenu->JS[$i]: '',
|
//'onclick' => ($oMenu->JS[$i] != '')? $oMenu->JS[$i] : '',
|
||||||
'text' => $oMenu->Labels[$i],
|
'text' => $oMenu->Labels[$i],
|
||||||
//'icon' => ($oMenu->Icons[$i]!='')? $oMenu->Icons[$i]: 'icon-pmlogo.png',
|
//'icon' => ($oMenu->Icons[$i] != '')? $oMenu->Icons[$i] : 'icon-pmlogo.png',
|
||||||
//'target'=> ($oMenu->Types[$i]=='admToolsContent')? 'admToolsContent': ''
|
//'target'=> ($oMenu->Types[$i] == 'admToolsContent')? 'admToolsContent' : ''
|
||||||
'loaded' => true,
|
'loaded' => true,
|
||||||
'leaf' => true,
|
'leaf' => true,
|
||||||
'cls' => 'pm-tree-node',
|
'cls' => 'pm-tree-node',
|
||||||
'iconCls'=> 'ICON_'.$oMenu->Id[$i]
|
'iconCls' => 'ICON_' . $oMenu->Id[$i]
|
||||||
);
|
);
|
||||||
} else if( in_array($oMenu->Types[$i], Array('', 'admToolsContent')) && $_GET['menu'] == 'plugins' ){
|
} else if (in_array($oMenu->Types[$i], array('', 'admToolsContent')) && $_GET['menu'] == 'plugins') {
|
||||||
$items[] = Array(
|
$items[] = array(
|
||||||
'id' => $oMenu->Id[$i],
|
'id' => $oMenu->Id[$i],
|
||||||
'url' => ($oMenu->Options[$i]!='')? $oMenu->Options[$i]: '#',
|
'url' => ($oMenu->Options[$i] != '')? $oMenu->Options[$i] : '#',
|
||||||
//'onclick' => ($oMenu->JS[$i]!='')? $oMenu->JS[$i]: '',
|
//'onclick' => ($oMenu->JS[$i] != '')? $oMenu->JS[$i] : '',
|
||||||
'text' => $oMenu->Labels[$i],
|
'text' => $oMenu->Labels[$i],
|
||||||
//'icon' => ($oMenu->Icons[$i]!='')? $oMenu->Icons[$i]: 'icon-pmlogo.png',
|
//'icon' => ($oMenu->Icons[$i] != '')? $oMenu->Icons[$i] : 'icon-pmlogo.png',
|
||||||
//'target'=> ($oMenu->Types[$i]=='admToolsContent')? 'admToolsContent': ''
|
//'target'=> ($oMenu->Types[$i] == 'admToolsContent')? 'admToolsContent' : ''
|
||||||
'loaded' => true,
|
'loaded' => true,
|
||||||
'leaf' => true,
|
'leaf' => true,
|
||||||
'cls' => 'pm-tree-node',
|
'cls' => 'pm-tree-node',
|
||||||
'iconCls'=> 'ICON_'.$oMenu->Id[$i]
|
'iconCls' => 'ICON_'.$oMenu->Id[$i]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( isset($_SESSION['DEV_FLAG']) && $_SESSION['DEV_FLAG'] && $_GET['menu'] == 'settings' ){
|
if (isset($_SESSION['DEV_FLAG']) && $_SESSION['DEV_FLAG'] && $_GET['menu'] == 'settings') {
|
||||||
$items[] = Array(
|
$items[] = array(
|
||||||
'id' => 'translations',
|
'id' => 'translations',
|
||||||
'url' => '../tools/main',
|
'url' => '../tools/main',
|
||||||
'text' => 'Translations',
|
'text' => 'Translations',
|
||||||
'loaded' => true,
|
'loaded' => true,
|
||||||
'leaf' => true,
|
'leaf' => true,
|
||||||
'cls' => 'pm-tree-node',
|
'cls' => 'pm-tree-node',
|
||||||
'iconCls'=> 'ICON_'
|
'iconCls' => 'ICON_'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$x = ob_get_contents();
|
$x = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|
||||||
|
///////
|
||||||
|
if ($_GET["menu"] == "plugins") {
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
foreach ($items as $index => $value) {
|
||||||
|
if ($items[$index]["id"] == "PMENTERPRISE") {
|
||||||
|
$i = $index;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$itemAux = $items[$i];
|
||||||
|
|
||||||
|
array_splice($items, $i, 1);
|
||||||
|
array_unshift($items, $itemAux);
|
||||||
|
}
|
||||||
|
|
||||||
|
///////
|
||||||
echo G::json_encode($items);
|
echo G::json_encode($items);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user