Index: trunk/kernel/include/parseditem.php
===================================================================
diff -u -r341 -r342
--- trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 341)
+++ trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 342)
@@ -2774,7 +2774,53 @@
}
}
}
- }
+ }
+
+ function AdminPrintItems($template)
+ {
+ // prints item listing for admin (browse/advanced view) tabs
+ $o = '
';
+
+ $i = 1;
+
+ $topleft = 0;
+ $topright = 0;
+ $rightcount = 0;
+ $total_items = $this->NumItems();
+ $topleft = ceil($total_items / 2);
+ $topright = $total_items - $topleft;
+
+ for($x = 0; $x < $topleft; $x++)
+ {
+ //printingleft
+ $item = $this->Items[$x];
+ if ($i > 2)
+ {
+ $o .= "
\n";
+ $i = 1;
+ }
+ $o .= $item->AdminParseTemplate($template);
+ $i++;
+
+ //printingright
+ if ($rightcount < $topright && ( ($x + $topleft) < $total_items) )
+ {
+ $item = $this->Items[ $x + $topleft ];
+ if ($i > 2)
+ {
+ $o.="
\n";
+ $i = 1;
+ }
+ $o .= $item->AdminParseTemplate($template);
+ $i++;
+ $rightcount++;
+ }
+ }
+ $o .= "\n
\n";
+
+ return $o;
+ }
+
}
// -------------- NEW CLASSES -----------------------
Index: trunk/admin/browse/checkboxes_new.js
===================================================================
diff -u -r123 -r342
--- trunk/admin/browse/checkboxes_new.js (.../checkboxes_new.js) (revision 123)
+++ trunk/admin/browse/checkboxes_new.js (.../checkboxes_new.js) (revision 342)
@@ -76,8 +76,7 @@
checkBox.onclick = checkBoxClick;
checkBox.container = checkBoxContainers[i];
- var selNode = (checkBox.container.getAttribute("inportalType") == "categories" || checkBox.container.getAttribute("inportalType") == "category") ? checkBox.container.parentNode : checkBox.container.parentNode.parentNode;
-
+ var selNode = (checkBox.container.getAttribute("inportalType") != "topics") ? checkBox.container.parentNode : checkBox.container.parentNode.parentNode;
selNode.chB = checkBox;
document.body.onclick = function(e)
@@ -525,26 +524,24 @@
function selectContainer(checkBox, value, doNotFireSelectionEvent)
{
//alert('select cont');
- if (!checkBox) return;
- if (checkBox.checked != value)
- {
- //alert('setting '+value);
- checkBox.checked = value;
- if (value)
- tabSelection[checkBox.inportalType]++
- else
- tabSelection[checkBox.inportalType]--;
- }
- var selNode = (checkBox.container.getAttribute("inportalType") == "categories" || checkBox.container.getAttribute("inportalType") == "category") ? checkBox.container.parentNode : checkBox.container.parentNode.parentNode;
+ if (!checkBox) return;
+ if (checkBox.checked != value)
+ {
+ //alert('setting '+value);
+ checkBox.checked = value;
+ if(value)
+ tabSelection[checkBox.inportalType]++
+ else
+ tabSelection[checkBox.inportalType]--;
+ }
+ var selNode = (checkBox.container.getAttribute("inportalType") != "topics") ? checkBox.container.parentNode : checkBox.container.parentNode.parentNode;
+ if (!selNode.oriCN && checkBox.checked || selNode.className != "selectedContainer" && selNode.className != "unselectedContainer")
+ selNode.oriCN = (selNode.className) ? selNode.className : "";
- if (!selNode.oriCN && checkBox.checked || selNode.className != "selectedContainer" && selNode.className != "unselectedContainer")
- selNode.oriCN = (selNode.className) ? selNode.className : "";
-
- selNode.className = (checkBox.checked) ? "selectedContainer" : ((selNode.oriCN != "") ? selNode.oriCN : "unselectedContainer");
-// checkBox.container.className = (checkBox.checked) ? "selectedContainer" : "unselectedContainer";
- if (!doNotFireSelectionEvent)
- selectionChanged();
+ selNode.className = (checkBox.checked) ? "selectedContainer" : ((selNode.oriCN != "") ? selNode.oriCN : "unselectedContainer");
+ //checkBox.container.className = (checkBox.checked) ? "selectedContainer" : "unselectedContainer";
+ if (!doNotFireSelectionEvent) selectionChanged();
}
function updateStatus()
Index: trunk/kernel/include/permissions.php
===================================================================
diff -u -r13 -r342
--- trunk/kernel/include/permissions.php (.../permissions.php) (revision 13)
+++ trunk/kernel/include/permissions.php (.../permissions.php) (revision 342)
@@ -193,6 +193,18 @@
}
}
+ function Set_Permission($CategoryId,$GroupId,$PermName,$Value,$Type)
+ {
+ $Perm = $this->GetPermByName($PermName);
+ if($Perm)
+ {
+ $Id = $Perm->Get("PermissionId");
+ $this->Edit_Permission($Id,$CategoryId,$GroupId,$PermName,$Value,$Type);
+ }
+ else
+ $this->Add_Permission($CategoryId,$GroupId,$PermName,$Value,$Type);
+ }
+
function Add_Permission($CategoryId,$GroupId,$PermName,$Value,$Type)
{
$p = new clsPermission();
Index: trunk/kernel/include/itemdb.php
===================================================================
diff -u -r16 -r342
--- trunk/kernel/include/itemdb.php (.../itemdb.php) (revision 16)
+++ trunk/kernel/include/itemdb.php (.../itemdb.php) (revision 342)
@@ -343,6 +343,13 @@
{
if($first)
{
+ if( is_array($value) )
+ {
+ echo "Invalid Value: ";
+ print_pre($value);
+ echo "Tracing:
";
+ trace();
+ }
$sql = sprintf("%s %s",$sql,$this->adodbConnection->qstr(stripslashes($value)));
$first = 0;
}