+
+
+
+ : ">
+
+
+
Index: branches/RC/core/units/general/cat_event_handler.php
===================================================================
diff -u -N -r9839 -r9866
--- branches/RC/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 9839)
+++ branches/RC/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 9866)
@@ -192,9 +192,9 @@
$to_delete = array();
if ($recycle_bin = $this->Application->ConfigValue('RecycleBinFolder')) {
- $rb = $this->Application->recallObject('c.recycle', null, array('skip_autoload' => true));
+ $rb =& $this->Application->recallObject('c.recycle', null, array('skip_autoload' => true));
$rb->Load($recycle_bin);
- $object = $this->Application->recallObject($event->Prefix.'.recycleitem', null, array('skip_autoload'=>true));
+ $object =& $this->Application->recallObject($event->Prefix.'.recycleitem', null, Array ('skip_autoload' => true));
foreach ($ids as $id) {
$object->Load($id);
if (preg_match('/^'.preg_quote($rb->GetDBField('ParentPath'),'/').'/', $object->GetDBField('ParentPath'))) {
@@ -412,6 +412,7 @@
parent::SetCustomQuery($event);
$object =& $event->getObject();
+ /* @var $object kDBList */
// add category filter if needed
if ($event->Special != 'showall') {
@@ -444,6 +445,12 @@
}
else {
$object->addFilter('primary_filter', 'PrimaryCat = 1');
+
+ // if using recycle bin don't show items from there
+ $recycle_bin = $this->Application->ConfigValue('RecycleBinFolder');
+ if ($recycle_bin) {
+ $object->addFilter('recyclebin_filter', TABLE_PREFIX.'CategoryItems.CategoryId <> '.$recycle_bin);
+ }
}
// add permission filter
Index: branches/RC/core/units/categories/categories_event_handler.php
===================================================================
diff -u -N -r9854 -r9866
--- branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 9854)
+++ branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 9866)
@@ -144,6 +144,19 @@
// hide categories with status = 4 (system categories)
$object->addFilter('system_categories', '%1$s.Status <> 4');
+ if ($event->Special == 'showall') {
+ // if using recycle bin don't show categories from there
+ $recycle_bin = $this->Application->ConfigValue('RecycleBinFolder');
+ if ($recycle_bin) {
+ $sql = 'SELECT TreeLeft, TreeRight
+ FROM '.TABLE_PREFIX.'Category
+ WHERE CategoryId = '.$recycle_bin;
+ $tree_indexes = $this->Conn->GetRow($sql);
+
+ $object->addFilter('recyclebin_filter', '%1$s.TreeLeft < '.$tree_indexes['TreeLeft'].' OR %1$s.TreeLeft > '.$tree_indexes['TreeRight']);
+ }
+ }
+
if ($event->getEventParam('parent_cat_id') !== false) {
$parent_cat_id = $event->getEventParam('parent_cat_id');
@@ -560,9 +573,9 @@
$ids = $this->StoreSelectedIDs($event);
$to_delete = array();
if ($recycle_bin = $this->Application->ConfigValue('RecycleBinFolder')) {
- $rb = $this->Application->recallObject('c.recycle', null, array('skip_autoload' => true));
+ $rb =& $this->Application->recallObject('c.recycle', null, Array ('skip_autoload' => true));
$rb->Load($recycle_bin);
- $cat = $event->getObject(array('skip_autoload'=>true));
+ $cat =& $event->getObject(Array('skip_autoload' => true));
foreach ($ids as $id) {
$cat->Load($id);
if (preg_match('/^'.preg_quote($rb->GetDBField('ParentPath'),'/').'/', $cat->GetDBField('ParentPath'))) {
Index: branches/RC/core/admin_templates/categories/ci_blocks.tpl
===================================================================
diff -u -N -r8929 -r9866
--- branches/RC/core/admin_templates/categories/ci_blocks.tpl (.../ci_blocks.tpl) (revision 8929)
+++ branches/RC/core/admin_templates/categories/ci_blocks.tpl (.../ci_blocks.tpl) (revision 9866)
@@ -14,6 +14,14 @@
+
+
+
+
+
+ : ">
+
+
Index: branches/RC/admin/install/inportal_data.sql
===================================================================
diff -u -N -r9531 -r9866
--- branches/RC/admin/install/inportal_data.sql (.../inportal_data.sql) (revision 9531)
+++ branches/RC/admin/install/inportal_data.sql (.../inportal_data.sql) (revision 9866)
@@ -1,8 +1,10 @@
-INSERT INTO ConfigurationAdmin VALUES ('AllowDeleteRootCats', 'la_Text_General', 'la_AllowDeleteRootCats', 'checkbox', NULL , NULL , 10.08, 0, 0);
-INSERT INTO ConfigurationAdmin VALUES ('Catalog_PreselectModuleTab', 'la_Text_General', 'la_config_CatalogPreselectModuleTab', 'checkbox', NULL, NULL, 10.09, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('AllowDeleteRootCats', 'la_Text_General', 'la_AllowDeleteRootCats', 'checkbox', NULL , NULL , 10.09, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('Catalog_PreselectModuleTab', 'la_Text_General', 'la_config_CatalogPreselectModuleTab', 'checkbox', NULL, NULL, 10.10, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('RecycleBinFolder', 'la_Text_General', 'la_config_RecycleBinFolder', 'text', NULL , NULL , 10.11, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AllowDeleteRootCats', '0', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Catalog_PreselectModuleTab', 1, 'In-Portal', 'in-portal:configure_categories');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'RecycleBinFolder', '', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ItemTypes VALUES (1, 'In-Portal', 'c', 'Category', 'Name', 'CreatedById', NULL, NULL, 'la_ItemTab_Categories', 1, 'admin/category/addcategory.php', 'clsCategory', 'Category');
INSERT INTO ItemTypes VALUES (6, 'In-Portal', 'u', 'PortalUser', 'Login', 'PortalUserId', NULL, NULL, '', 0, '', 'clsPortalUser', 'User');
@@ -231,4 +233,4 @@
INSERT INTO Stylesheets VALUES (8, 'Default', 'In-Portal Default Theme', '', 1124952555, 1);
-INSERT INTO Modules VALUES ('In-Portal', 'kernel/', 'm', '4.2.1', 1, 0, '', 0, '1054738405');
+INSERT INTO Modules VALUES ('In-Portal', 'kernel/', 'm', '4.2.2', 1, 0, '', 0, '1054738405');
Index: branches/RC/admin/install/upgrades/inportal_upgrade_v4.2.2.sql
===================================================================
diff -u -N
--- branches/RC/admin/install/upgrades/inportal_upgrade_v4.2.2.sql (revision 0)
+++ branches/RC/admin/install/upgrades/inportal_upgrade_v4.2.2.sql (revision 9866)
@@ -0,0 +1,8 @@
+UPDATE ConfigurationAdmin SET DisplayOrder = 10.09 WHERE VariableName = 'AllowDeleteRootCats';
+UPDATE ConfigurationAdmin SET DisplayOrder = 10.10 WHERE VariableName = 'Catalog_PreselectModuleTab';
+
+INSERT INTO ConfigurationAdmin VALUES ('RecycleBinFolder', 'la_Text_General', 'la_config_RecycleBinFolder', 'text', NULL , NULL , 10.11, 0, 0);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'RecycleBinFolder', '', 'In-Portal', 'in-portal:configure_categories');
+
+UPDATE Modules SET Version = '4.2.2' WHERE Name = 'Core';
+UPDATE Modules SET Version = '4.2.2' WHERE Name = 'In-Portal';
\ No newline at end of file
Index: branches/RC/kernel/admin_templates/categories/ci_blocks.tpl
===================================================================
diff -u -N -r8929 -r9866
--- branches/RC/kernel/admin_templates/categories/ci_blocks.tpl (.../ci_blocks.tpl) (revision 8929)
+++ branches/RC/kernel/admin_templates/categories/ci_blocks.tpl (.../ci_blocks.tpl) (revision 9866)
@@ -14,6 +14,14 @@
+
+
+
+
+
+ : ">
+
+