BUG 0000 "The activation of a tab in ADMIN does not work with URL" SOLVED
- The activation of a tab in ADMIN does not work with URL (setup/main?s=PMENTERPRISE or setup/main_init?s=PMENTERPRISE) - Solved the problem, now looks for the variable "s" in the menu to set the active tab
This commit is contained in:
@@ -23,50 +23,83 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$RBAC->requirePermissions('PM_SETUP', 'PM_USERS');
|
$RBAC->requirePermissions("PM_SETUP", "PM_USERS");
|
||||||
|
|
||||||
$oHeadPublisher =& headPublisher::getSingleton();
|
///////
|
||||||
|
$adminSelected = null;
|
||||||
|
|
||||||
global $G_TMP_MENU;
|
if (isset($_REQUEST["s"])) {
|
||||||
$oMenu = new Menu();
|
$adminSelected = $_REQUEST["s"];
|
||||||
$oMenu->load('setup');
|
}
|
||||||
$items = Array();
|
else {
|
||||||
|
if (isset($_SESSION["ADMIN_SELECTED"])) {
|
||||||
|
$adminSelected = $_SESSION["ADMIN_SELECTED"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$menuTypes = array_unique($oMenu->Types);
|
///////
|
||||||
foreach($menuTypes as $i=>$v){
|
$oHeadPublisher = &headPublisher::getSingleton();
|
||||||
if( $v == 'admToolsContent'){
|
|
||||||
unset($menuTypes[$i]);
|
global $G_TMP_MENU;
|
||||||
|
|
||||||
|
$oMenu = new Menu();
|
||||||
|
$oMenu->load("setup");
|
||||||
|
$items = array();
|
||||||
|
|
||||||
|
$menuTypes = array_unique($oMenu->Types);
|
||||||
|
foreach ($menuTypes as $i => $v) {
|
||||||
|
if ($v == "admToolsContent") {
|
||||||
|
unset($menuTypes[$i]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//sort($menuTypes);
|
||||||
|
|
||||||
|
$tabItems = array();
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
foreach ($menuTypes as $menuType) {
|
||||||
|
$tabItems[$i]->id = $menuType;
|
||||||
|
$LABEL_TRANSLATION = G::LoadTranslation("ID_" . strtoupper($menuType));
|
||||||
|
|
||||||
|
if (substr($LABEL_TRANSLATION, 0, 2) !== "**") {
|
||||||
|
$title = $LABEL_TRANSLATION;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$title = str_replace("_", " ", ucwords($menuType));
|
||||||
|
}
|
||||||
|
|
||||||
|
$tabItems[$i]->title = $title;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
///////
|
||||||
|
$tabActive = "";
|
||||||
|
|
||||||
|
if ($adminSelected != null) {
|
||||||
|
foreach ($oMenu->Options as $i => $option) {
|
||||||
|
if ($oMenu->Id[$i] == $adminSelected) {
|
||||||
|
$tabActive = (in_array($oMenu->Types[$i], array("", "admToolsContent")))? "plugins" : $oMenu->Types[$i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//sort($menuTypes);
|
}
|
||||||
|
|
||||||
$tabItems = Array();
|
///////
|
||||||
$i=0;
|
$oHeadPublisher->addExtJsScript("setup/main", true); //adding a javascript file .js
|
||||||
foreach( $menuTypes as $menuType ){
|
$oHeadPublisher->addContent("setup/main"); //adding a html file .html.
|
||||||
$tabItems[$i]->id = $menuType;
|
$oHeadPublisher->assign("tabActive", $tabActive);
|
||||||
$LABEL_TRANSLATION = G::LoadTranslation("ID_".strtoupper($menuType));
|
$oHeadPublisher->assign("tabItems", $tabItems);
|
||||||
|
$oHeadPublisher->assign("_item_selected", (($adminSelected != null)? $adminSelected : ""));
|
||||||
if( substr($LABEL_TRANSLATION,0,2) !== '**' ){
|
|
||||||
$title = $LABEL_TRANSLATION;
|
|
||||||
} else {
|
|
||||||
$title = str_replace('_', ' ', ucwords($menuType));
|
|
||||||
}
|
|
||||||
$tabItems[$i]->title = $title;
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$oHeadPublisher->addExtJsScript('setup/main', true); //adding a javascript file .js
|
G::RenderPage("publish", "extJs");
|
||||||
$oHeadPublisher->addContent('setup/main'); //adding a html file .html.
|
|
||||||
$oHeadPublisher->assign('tabItems', $tabItems);
|
|
||||||
$oHeadPublisher->assign('_item_selected', (isset($_SESSION['ADMIN_SELECTED'])?$_SESSION['ADMIN_SELECTED']:''));
|
|
||||||
|
|
||||||
G::RenderPage('publish', 'extJs');
|
//this patch enables the load of the plugin list panel inside de main admin panel iframe
|
||||||
// this patch enables the load of the plugin list panel inside de main admin panel iframe
|
if (isset($_GET["action"]) && $_GET["action"] == "pluginsList") {
|
||||||
if (isset($_GET['action'])&&$_GET['action']=='pluginsList'){
|
echo "
|
||||||
print "
|
<script type=\"text/javascript\">
|
||||||
<script>
|
document.getElementById(\"setup-frame\").src = \"pluginsList\";
|
||||||
document.getElementById('setup-frame').src = 'pluginsList';
|
</script>
|
||||||
</script>
|
";
|
||||||
";
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,11 +5,21 @@
|
|||||||
|
|
||||||
var _NODE_SELECTED;
|
var _NODE_SELECTED;
|
||||||
var main = function(){
|
var main = function(){
|
||||||
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
|
var cookiep = new Ext.state.CookieProvider();
|
||||||
|
|
||||||
var items = [];
|
var items = [];
|
||||||
var nodeLoad = [];
|
var nodeLoad = [];
|
||||||
var i;
|
var i;
|
||||||
|
|
||||||
|
if (tabActive != "") {
|
||||||
|
for(i = 0; i<= tabItems.length - 1; i++) {
|
||||||
|
if (tabItems[i].id == tabActive) {
|
||||||
|
cookiep.set("admin-tabpanel", {"activeTab": i});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ext.state.Manager.setProvider(cookiep);
|
||||||
|
|
||||||
for(i=0; i<tabItems.length; i++){
|
for(i=0; i<tabItems.length; i++){
|
||||||
|
|
||||||
@@ -47,6 +57,10 @@ var main = function(){
|
|||||||
loader.on("load", function () {
|
loader.on("load", function () {
|
||||||
if (_item_selected != "") {
|
if (_item_selected != "") {
|
||||||
node = tp.getNodeById(_item_selected);
|
node = tp.getNodeById(_item_selected);
|
||||||
|
|
||||||
|
if (typeof node == "undefined") {
|
||||||
|
node = tp.getRootNode().childNodes[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
node = tp.getRootNode().childNodes[0];
|
node = tp.getRootNode().childNodes[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user