Index: branches/unlabeled/unlabeled-1.18.2/admin/category/addcategory.php =================================================================== diff -u -r4382 -r4438 --- branches/unlabeled/unlabeled-1.18.2/admin/category/addcategory.php (.../addcategory.php) (revision 4382) +++ branches/unlabeled/unlabeled-1.18.2/admin/category/addcategory.php (.../addcategory.php) (revision 4438) @@ -4,10 +4,11 @@ define('REL_PATH', 'admin/category'); $relation_level = count( explode('/', REL_PATH) ); define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) ); - require_once FULL_PATH.'/kernel/startup.php'; // new startup: end +$objSession->SetVariable('IsHomeCategory', 0); + require_once ($pathtoroot.$admin."/include/elements.php"); require_once ($pathtoroot."kernel/admin/include/navmenu.php"); //require_once ($pathtolocal."admin/include/navmenu.php"); Index: branches/unlabeled/unlabeled-1.8.2/admin/category/addpermission.php =================================================================== diff -u -r4044 -r4438 --- branches/unlabeled/unlabeled-1.8.2/admin/category/addpermission.php (.../addpermission.php) (revision 4044) +++ branches/unlabeled/unlabeled-1.8.2/admin/category/addpermission.php (.../addpermission.php) (revision 4438) @@ -39,11 +39,16 @@ unset($objEditItems); $objEditItems = new clsCatList(); -$objEditItems->SourceTable = $objSession->GetEditTable("Category"); +$objEditItems->SourceTable = $objSession->GetEditTable('Category'); +$live_editing = $objSession->GetVariable('IsHomeCategory'); +if ($live_editing) { + $objEditItems->SourceTable = TABLE_PREFIX.'Category'; +} + //Multiedit init $en = (int)$_GET["en"]; -$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable.($objEditItems->isLiveTable() ? ' WHERE CategoryId = 0' : '')); $itemcount=$objEditItems->NumItems(); $c = $objEditItems->GetItemByIndex($en); Index: branches/unlabeled/unlabeled-1.88.2/kernel/include/parseditem.php =================================================================== diff -u -r4080 -r4438 --- branches/unlabeled/unlabeled-1.88.2/kernel/include/parseditem.php (.../parseditem.php) (revision 4080) +++ branches/unlabeled/unlabeled-1.88.2/kernel/include/parseditem.php (.../parseditem.php) (revision 4438) @@ -683,6 +683,12 @@ */ var $Conn = null; + function isLiveTable() + { + global $objSession; + return !preg_match('/'.GetTablePrefix().'ses_'.$objSession->GetSessionKey().'_edit_(.*)/', $this->SourceTable); + } + function SetTable($action, $table_name = null) // new by Alex { // $action = {'live', 'restore','edit'} Index: branches/unlabeled/unlabeled-1.108.2/kernel/action.php =================================================================== diff -u -r4354 -r4438 --- branches/unlabeled/unlabeled-1.108.2/kernel/action.php (.../action.php) (revision 4354) +++ branches/unlabeled/unlabeled-1.108.2/kernel/action.php (.../action.php) (revision 4438) @@ -2316,7 +2316,10 @@ { $adodbConnection = &GetADODBConnection(); // $sql = "SELECT * FROM ".$objSession->GetEditTable("Category")." WHERE CategoryId=0"; - $sql = "SELECT ParentId FROM ".$objSession->GetEditTable("Category")." WHERE CategoryId=-1"; + $category_table = $objSession->GetVariable('IsHomeCategory') ? TABLE_PREFIX.'Category' : $objSession->GetEditTable('Category'); + $sql = 'SELECT ParentId + FROM '.$category_table.' + WHERE CategoryId = -1'; $rs = $adodbConnection->Execute($sql); while ($rs && !$rs->EOF) @@ -2325,17 +2328,20 @@ $rs->MoveNext(); } - $cat_ids = $objCatList->CopyFromEditTable("CategoryId"); - if ($cat_ids) { - $objCustomDataList->CopyFromEditTable('c'); - } - $objCatList->Clear(); - if($_REQUEST['CategoryId'] > 0) // not root category is updated { + $cat_ids = $objCatList->CopyFromEditTable("CategoryId"); + if ($cat_ids) { + $objCustomDataList->CopyFromEditTable('c'); + } + $objCatList->Clear(); + $objImages = new clsImageList(); $objImages->CopyFromEditTable("ImageId"); } + else { + $objCatList->Clear(); + } } if( GetVar('CatEditStatus') == 2 ) Index: branches/unlabeled/unlabeled-1.9.2/admin/category/addcategory_permissions.php =================================================================== diff -u -r4227 -r4438 --- branches/unlabeled/unlabeled-1.9.2/admin/category/addcategory_permissions.php (.../addcategory_permissions.php) (revision 4227) +++ branches/unlabeled/unlabeled-1.9.2/admin/category/addcategory_permissions.php (.../addcategory_permissions.php) (revision 4438) @@ -20,6 +20,12 @@ require_once FULL_PATH.'/kernel/startup.php'; // new startup: end +// Permissions tab is opened first -> Home category live permissions editing +$item_resource_id = $application->GetVar('item'); +if (($item_resource_id !== false) && ((int)$item_resource_id === 0)) { + $objSession->SetVariable('IsHomeCategory', 1); +} + require_once ($pathtoroot.$admin."/include/elements.php"); require_once ($pathtoroot."kernel/admin/include/navmenu.php"); //require_once ($pathtolocal."admin/include/navmenu.php"); @@ -41,10 +47,15 @@ $objEditItems = new clsCatList(); $objEditItems->SourceTable = $objSession->GetEditTable("Category"); +$live_editing = $objSession->GetVariable('IsHomeCategory'); +if ($live_editing) { + $objEditItems->SourceTable = TABLE_PREFIX.'Category'; +} + //Multiedit init $en = (int)$_GET["en"]; -$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); -$itemcount=$objEditItems->NumItems(); +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable.($objEditItems->isLiveTable() ? ' WHERE CategoryId = 0' : '')); +$itemcount = $objEditItems->NumItems(); if(isset($_GET["en"])) { $c = $objEditItems->GetItemByIndex($en); @@ -55,6 +66,7 @@ $c = new clsCategory($m_var_list["cat"]); $c->Set("CategoryId",$m_var_list["cat"]); } + if($itemcount>1) { if ($en+1 == $itemcount) Index: branches/unlabeled/unlabeled-1.19.2/kernel/admin/include/navmenu.php =================================================================== diff -u -r4411 -r4438 --- branches/unlabeled/unlabeled-1.19.2/kernel/admin/include/navmenu.php (.../navmenu.php) (revision 4411) +++ branches/unlabeled/unlabeled-1.19.2/kernel/admin/include/navmenu.php (.../navmenu.php) (revision 4438) @@ -198,31 +198,42 @@ NULL,NULL,NULL,$admin."/icons/icon46_list_banlist.gif","la_updating_rules"); /*Edit Category Section*/ -$objSections->AddSection("in-portal:editcategory_general","la_tab_General",NULL,$admin."/category/", - "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory.php',0);", - $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", - NULL, "in-portal:browse",NULL, "in-portal:editcategory_relations",-1); +$home_category = $objSession->GetVariable('IsHomeCategory'); -$objSections->AddSection("in-portal:editcategory_relations","la_tab_Relations",NULL, $admin."/category/", - "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_relations.php',0);", - $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", - NULL,"in-portal:browse","in-portal:editcategory_general","in-portal:editcategory_images",-1); +if(!$home_category) { + $objSections->AddSection("in-portal:editcategory_general","la_tab_General",NULL,$admin."/category/", + "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory.php',0);", + $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", + NULL, "in-portal:browse",NULL, "in-portal:editcategory_relations",-1); + + $objSections->AddSection("in-portal:editcategory_relations","la_tab_Relations",NULL, $admin."/category/", + "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_relations.php',0);", + $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", + NULL,"in-portal:browse","in-portal:editcategory_general","in-portal:editcategory_images",-1); + + $objSections->AddSection("in-portal:editcategory_images","la_tab_Images", NULL,$admin."/category/", + "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_images.php',0);", + $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", + NULL, "in-portal:browse", "in-portal:editcategory_relations", "in-portal:editcategory_permissions",-1); -$objSections->AddSection("in-portal:editcategory_images","la_tab_Images", NULL,$admin."/category/", - "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_images.php',0);", - $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", - NULL, "in-portal:browse", "in-portal:editcategory_relations", "in-portal:editcategory_permissions",-1); -$objSections->AddSection("in-portal:editcategory_permissions","la_tab_Permissions", NULL,$admin."/category/", + $objSections->AddSection("in-portal:editcategory_permissions","la_tab_Permissions", NULL,$admin."/category/", + "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_permissions.php',0);", + $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", + NULL, "in-portal:browse", 'in-portal:editcategory_images', 'in-portal:editcategory_custom', -1); + + $objSections->AddSection("in-portal:editcategory_custom", "la_tab_Custom", NULL, $admin."/category/", + "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_custom.php',0);", + $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", NULL, + "in-portal:browse", "in-portal:editcategory_permissions", NULL,-1); +} +else { + $objSections->AddSection("in-portal:editcategory_permissions","la_tab_Permissions", NULL,$admin."/category/", "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_permissions.php',0);", $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", - NULL, "in-portal:browse", "in-portal:editcategory_images","in-portal:editcategory_custom",-1); + NULL, "in-portal:browse", null, null, -1); +} -$objSections->AddSection("in-portal:editcategory_custom", "la_tab_Custom", NULL, $admin."/category/", - "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_custom.php',0);", - $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", NULL, - "in-portal:browse", "in-portal:editcategory_permissions", NULL,-1); - /* category edit subitems */ $objSections->AddSection("in-portal:cat_imageedit","la_tab_Images","la_title_edit_category",$admin."/category/", "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addimage.php',0);", Index: branches/unlabeled/unlabeled-1.9.2/admin/category/addpermission_modules.php =================================================================== diff -u -r4227 -r4438 --- branches/unlabeled/unlabeled-1.9.2/admin/category/addpermission_modules.php (.../addpermission_modules.php) (revision 4227) +++ branches/unlabeled/unlabeled-1.9.2/admin/category/addpermission_modules.php (.../addpermission_modules.php) (revision 4438) @@ -41,9 +41,14 @@ $objEditItems = new clsCatList(); $objEditItems->SourceTable = $objSession->GetEditTable("Category"); +$live_editing = $objSession->GetVariable('IsHomeCategory'); +if ($live_editing) { + $objEditItems->SourceTable = TABLE_PREFIX.'Category'; +} + //Multiedit init $en = (int)$_GET["en"]; -$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable.($objEditItems->isLiveTable() ? ' WHERE CategoryId = 0' : '')); $itemcount=$objEditItems->NumItems(); if(isset($_GET["en"])) Index: branches/unlabeled/unlabeled-1.19.2/kernel/include/portalgroup.php =================================================================== diff -u -r4248 -r4438 --- branches/unlabeled/unlabeled-1.19.2/kernel/include/portalgroup.php (.../portalgroup.php) (revision 4248) +++ branches/unlabeled/unlabeled-1.19.2/kernel/include/portalgroup.php (.../portalgroup.php) (revision 4438) @@ -212,14 +212,13 @@ global $var_list_update, $objConfig, $objSession; $tagname = is_object($tag) ? $tag->name : $tag; - $is_temp = strpos($this->SourceTable, $objSession->Get('SessionKey') ) !== false; - switch($tagname) { case 'GroupName': $db =& GetADODBConnection(); - $table = $is_temp ? $objSession->GetEditTable('PortalGroup') : GetTablePrefix().'PortalGroup'; - $sql = 'SELECT Name FROM '.$table.' WHERE GroupId = '.$this->Get('GroupId'); + $sql = 'SELECT Name + FROM '.TABLE_PREFIX.'PortalGroup + WHERE GroupId = '.$this->Get('GroupId'); return $db->GetOne($sql); break;