From 16096105416bcf2560dd90e53934307f530b5ebf Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 15 Jul 2015 07:24:32 +0200 Subject: [PATCH] pass previewer to printClipboard, call hook for menuitems, ... backported from develop --- views/bootstrap/class.Bootstrap.php | 77 ++++++++++++++++++----------- 1 file changed, 47 insertions(+), 30 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index a018ca86c..b3d68f5d2 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -443,33 +443,41 @@ $(document).ready(function () { echo "".getMLText("document")."\n"; echo "
\n"; echo "
    \n"; + $menuitems = array(); if ($accessMode >= M_READWRITE) { if (!$document->isLocked()) { - echo "
  • ".getMLText("update_document")."
  • "; - echo "
  • ".getMLText("lock_document")."
  • "; - echo "
  • ".getMLText("edit_document_props")."
  • "; - echo "
  • ".getMLText("move_document")."
  • "; + $menuitems['update_document'] = array('link'=>"../out/out.UpdateDocument".$docid, 'label'=>'update_document'); + $menuitems['lock_document'] = array('link'=>"../op/op.LockDocument".$docid, 'label'=>'lock_document'); + $menuitems['edit_document_props'] = array('link'=>"../out/out.EditDocument".$docid , 'label'=>'edit_document_props'); + $menuitems['move_document'] = array('link'=>"../out/out.MoveDocument".$docid, 'label'=>'move_document'); } else { $lockingUser = $document->getLockingUser(); if (($lockingUser->getID() == $this->params['user']->getID()) || ($document->getAccessMode($this->params['user']) == M_ALL)) { - echo "
  • ".getMLText("update_document")."
  • "; - echo "
  • ".getMLText("unlock_document")."
  • "; - echo "
  • ".getMLText("edit_document_props")."
  • "; - echo "
  • ".getMLText("move_document")."
  • "; + $menuitems['update_document'] = array('link'=>"../out/out.UpdateDocument".$docid, 'label'=>'update_document'); + $menuitems['unlock_document'] = array('link'=>"../op/op.UnlockDocument".$docid, 'label'=>'unlock_document'); + $menuitems['edit_document_props'] = array('link'=>"../out/out.EditDocument".$docid, 'label'=>'edit_document_props'); + $menuitems['move_document'] = array('link'=>"../out/out.MoveDocument".$docid, 'label'=>'move_document'); } } if($this->params['accessobject']->maySetExpires()) { - echo "
  • ".getMLText("expires")."
  • "; + $menuitems['expires'] = array('link'=>"../out/out.SetExpires".$docid, 'label'=>'expires'); } } if ($accessMode == M_ALL) { - echo "
  • ".getMLText("rm_document")."
  • "; - echo "
  • ".getMLText("edit_document_access")."
  • "; + $menuitems['rm_document'] = array('link'=>"../out/out.RemoveDocument".$docid, 'label'=>'rm_document'); + $menuitems['edit_document_access'] = array('link'=>"../out/out.DocumentAccess". $docid, 'label'=>'edit_document_access'); } if ($accessMode >= M_READ && !$this->params['user']->isGuest()) { - echo "
  • ".getMLText("edit_existing_notify")."
  • "; + $menuitems['edit_existing_notify'] = array('link'=>"../out/out.DocumentNotify". $docid, 'label'=>'edit_existing_notify'); + } + + $this->hasHook('documentNavigationBar'); + $this->callHook('documentNavigationBar', $document, $menuitems); + + foreach($menuitems as $menuitem) { + echo "
  • ".getMLText($menuitem['label'])."
  • "; } echo "
\n"; echo "
\n"; @@ -1029,7 +1037,7 @@ function folderSelected(id, name) { if(!$attrdef->getMultipleValues()) { echo ""; } - $objvalue = $attribute ? $attribute->getValueAsArray() : array(); + $objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : $attribute) : array(); foreach($valueset as $value) { if($value) { echo "