add new hooks folderInfo and folderListItem

This commit is contained in:
Uwe Steinmann 2013-08-11 08:32:23 +02:00
parent c5a7ff83f0
commit 35063313a9

View File

@ -131,6 +131,10 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
echo "</div>\n"; echo "</div>\n";
echo "<div class=\"span".$RightColumnSpan."\">\n"; echo "<div class=\"span".$RightColumnSpan."\">\n";
$txt = $this->callHook('folderInfo', $folder);
if(is_string($txt))
echo $txt;
else {
$this->contentHeading(getMLText("folder_infos")); $this->contentHeading(getMLText("folder_infos"));
$owner = $folder->getOwner(); $owner = $folder->getOwner();
@ -187,6 +191,7 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
} }
echo "</table>\n"; echo "</table>\n";
$this->contentContainerEnd(); $this->contentContainerEnd();
}
$this->contentHeading(getMLText("folder_contents")); $this->contentHeading(getMLText("folder_contents"));
@ -210,7 +215,10 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
foreach($subFolders as $subFolder) { foreach($subFolders as $subFolder) {
$txt = $this->callHook('folderListItem', $subFolder);
if(is_string($txt))
echo $txt;
else {
$owner = $subFolder->getOwner(); $owner = $subFolder->getOwner();
$comment = $subFolder->getComment(); $comment = $subFolder->getComment();
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "..."; if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";
@ -228,7 +236,7 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
print "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>"; print "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";
} }
print "</td>\n"; print "</td>\n";
// print "<td>".htmlspecialchars($owner->getFullName())."</td>"; // print "<td>".htmlspecialchars($owner->getFullName())."</td>";
print "<td colspan=\"1\" nowrap><small>"; print "<td colspan=\"1\" nowrap><small>";
if($enableRecursiveCount) { if($enableRecursiveCount) {
if($user->isAdmin()) { if($user->isAdmin()) {
@ -249,34 +257,35 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
print count($subsub)." ".getMLText("folders")."<br />".count($subdoc)." ".getMLText("documents"); print count($subsub)." ".getMLText("folders")."<br />".count($subdoc)." ".getMLText("documents");
} }
print "</small></td>"; print "</small></td>";
// print "<td></td>"; // print "<td></td>";
print "<td>"; print "<td>";
print "<div class=\"list-action\">"; print "<div class=\"list-action\">";
if($subFolder->getAccessMode($user) >= M_ALL) { if($subFolder->getAccessMode($user) >= M_ALL) {
?> ?>
<a class_="btn btn-mini" href="../out/out.RemoveFolder.php?folderid=<?php echo $subFolder->getID(); ?>"><i class="icon-remove"></i></a> <a class_="btn btn-mini" href="../out/out.RemoveFolder.php?folderid=<?php echo $subFolder->getID(); ?>"><i class="icon-remove"></i></a>
<?php <?php
} else { } else {
?> ?>
<span style="padding: 2px; color: #CCC;"><i class="icon-remove"></i></span> <span style="padding: 2px; color: #CCC;"><i class="icon-remove"></i></span>
<?php <?php
} }
if($subFolder->getAccessMode($user) >= M_READWRITE) { if($subFolder->getAccessMode($user) >= M_READWRITE) {
?> ?>
<a class_="btn btn-mini" href="../out/out.EditFolder.php?folderid=<?php echo $subFolder->getID(); ?>"><i class="icon-edit"></i></a> <a class_="btn btn-mini" href="../out/out.EditFolder.php?folderid=<?php echo $subFolder->getID(); ?>"><i class="icon-edit"></i></a>
<?php <?php
} else { } else {
?> ?>
<span style="padding: 2px; color: #CCC;"><i class="icon-edit"></i></span> <span style="padding: 2px; color: #CCC;"><i class="icon-edit"></i></span>
<?php <?php
} }
?> ?>
<a class="addtoclipboard" rel="<?php echo "F".$subFolder->getID(); ?>" msg="<?php printMLText('splash_added_to_clipboard'); ?>" _href="../op/op.AddToClipboard.php?folderid=<?php echo $folder->getID(); ?>&type=folder&id=<?php echo $subFolder->getID(); ?>" title="<?php printMLText("add_to_clipboard");?>"><i class="icon-copy"></i></a> <a class="addtoclipboard" rel="<?php echo "F".$subFolder->getID(); ?>" msg="<?php printMLText('splash_added_to_clipboard'); ?>" _href="../op/op.AddToClipboard.php?folderid=<?php echo $folder->getID(); ?>&type=folder&id=<?php echo $subFolder->getID(); ?>" title="<?php printMLText("add_to_clipboard");?>"><i class="icon-copy"></i></a>
<?php <?php
print "</div>"; print "</div>";
print "</td>"; print "</td>";
print "</tr>\n"; print "</tr>\n";
} }
}
$previewer = new SeedDMS_Preview_Previewer($cachedir, 40); $previewer = new SeedDMS_Preview_Previewer($cachedir, 40);
foreach($documents as $document) { foreach($documents as $document) {