";
+ $trow.="";
+
+ // Save rendered entry
+ $this->entry[$row]['_rendered']= $trow;
$alt++;
}
+ // Complete list by sorting entries for _sort$index and appending them to the output
+ $entryIterator= new listingSortIterator($this->entries, $this->sortDirection[$this->sortColumn], "_sort".$this->sortColumn, $this->sortType);
+ foreach ($entryIterator as $row => $entry){
+ $result.= $entry['_rendered'];
+ }
+
// Need to fill the list if it's not full (nobody knows why this is 22 ;-))
- $emptyListStyle= (count($this->entries) + count($deps) == 0)?"border:0;":"";
- if (count($this->entries) + count($deps) < 22) {
+ $emptyListStyle= (count($this->entries) + $deps == 0)?"border:0;":"";
+ if ((count($this->entries) + $deps) < 22) {
$result.= "
";
for ($i= 0; $i<$this->numColumns; $i++) {
if ($i == 0) {
@@ -303,6 +360,7 @@ echo "sizelimit, copypaste handler, snapshot handler, daemon handler ";
$smarty= get_smarty();
$smarty->assign("FILTER", $this->filter->render());
+ $smarty->assign("SIZELIMIT", print_sizelimit_warning());
$smarty->assign("LIST", $result);
// Assign navigation elements
@@ -325,22 +383,14 @@ echo "sizelimit, copypaste handler, snapshot handler, daemon handler ";
}
- function setFilter($filter)
- {
- $this->filter= &$filter;
- if ($this->departmentBrowser){
- $this->departments= $this->getDepartments();
- }
- $this->filter->setBase($this->base);
- $this->entries= $this->filter->query();
- }
-
-
function update()
{
global $config;
$ui= get_userinfo();
+ // Reset object counter
+ $this->objectTypeCount= array();
+
// Do not do anything if this is not our PID
if(isset($_REQUEST['PID']) && $_REQUEST['PID'] != $this->pid) {
return;
@@ -476,6 +526,10 @@ echo "sizelimit, copypaste handler, snapshot handler, daemon handler ";
// Watch out for filters and prepare to execute them
$data= $this->processElementFilter($data, $config, $row);
+ // Replace all non replaced %{...} instances because they
+ // are non resolved attributes or filters
+ $data= preg_replace('/%{[^}]+}/', ' ', $data);
+
return $data;
}
@@ -666,19 +720,21 @@ echo "sizelimit, copypaste handler, snapshot handler, daemon handler ";
}
// Handle special types
- if ($action['type'] == "snapshot") {
- #TODO
- #echo "actiontriggers: snapshot missing ";
- }
- if ($action['type'] == "copypaste") {
- #TODO
- #echo "actiontriggers: copypaste missing ";
- }
- if ($action['type'] == "daemon") {
- #TODO
- #echo "actiontriggers: daemon missing ";
- }
+ if ($action['type'] == "copypaste" || $action['type'] == "snapshot") {
+ $objectType= $this->getObjectType($this->objectTypes, $this->entries[$row]['objectClass']);
+ $category= $class= null;
+ if ($objectType) {
+ $category= $objectType['category'];
+ $class= $objectType['class'];
+ }
+
+ if ($action['type'] == "copypaste") {
+ $result.= $this->renderCopyPasteActions($row, $this->entries[$row]['dn'], $category, $class);
+ } else {
+ $result.= $this->renderSnapshotActions($row, $this->entries[$row]['dn'], $category, $class);
+ }
+ }
}
return $result;
@@ -860,7 +916,7 @@ echo "sizelimit, copypaste handler, snapshot handler, daemon handler ";
$actions= &$this->xmlData['actionmenu']['action'];
$result= "".
"
Aktionen ";
+ "border=0 class='center' src='images/lists/sort-down.png'>";
// Build ul/li list
$result.= $this->recurseActions($actions);
@@ -885,7 +941,7 @@ echo "sizelimit, copypaste handler, snapshot handler, daemon handler ";
// Fill image if set
$img= "";
if (isset($action['image'])){
- $img= " ";
+ $img= " ";
}
if ($action['type'] == "separator"){
@@ -913,18 +969,15 @@ echo "sizelimit, copypaste handler, snapshot handler, daemon handler ";
// Check for special types
switch ($action['type']) {
case 'copypaste':
- #TODO
- #echo "actionmenu: copypaste missing ";
+ $result.= $this->renderCopyPasteMenu($separator);
break;
case 'snapshot':
- #TODO
- #echo "actionmenu: snapshot missing ";
+ $result.= $this->renderSnapshotMenu($separator);
break;
case 'daemon':
- #TODO
- #echo "actionmenu: daemon missing ";
+ $result.= $this->renderDaemonMenu($separator);
break;
}
@@ -949,7 +1002,7 @@ echo "sizelimit, copypaste handler, snapshot handler, daemon handler ";
// Every ACL has to pass
foreach ($acls as $acl) {
$module= $this->module;
- $acllist= array();
+ $aclList= array();
// Split for category and plugins if needed
// match for "[rw]" style entries
@@ -1072,6 +1125,184 @@ echo "sizelimit, copypaste handler, snapshot handler, daemon handler ";
return $departments;
}
+
+ function renderCopyPasteMenu($separator, $copy= true, $cut= true)
+ {
+ // We can only provide information if we've got a copypaste handler
+ // instance
+ if(!(isset($this->copyPasteHandler) && is_object($this->copyPasteHandler))){
+ return "";
+ }
+
+ // Presets
+ $result= "";
+ $read= $paste= false;
+ $ui= get_userinfo();
+
+ // Switch flags to on if there's at least one category which allows read/paste
+ foreach($this->categories as $category){
+ $read= $read || preg_match('/r/', $ui->get_category_permissions($this->base, $category));
+ $paste= $paste || $ui->is_pasteable($this->base, $category) == 1;
+ }
+
+
+ // Draw entries that allow copy and cut
+ if($read){
+
+ // Copy entry
+ if($copy){
+ $result.= "