diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php
index 6c3b90c40..4c91dbea7 100644
--- a/views/bootstrap4/class.Bootstrap4.php
+++ b/views/bootstrap4/class.Bootstrap4.php
@@ -79,12 +79,8 @@ class SeedDMS_Theme_Style extends SeedDMS_View_Common {
header($name . ": " . $value);
}
}
- $hookObjs = $this->getHookObjects('SeedDMS_View_Bootstrap');
- foreach($hookObjs as $hookObj) {
- if (method_exists($hookObj, 'startPage')) {
- $hookObj->startPage($this);
- }
- }
+ if($this->hasHook('startPage'))
+ $this->callHook('startPage');
echo "\n";
echo "\n
\n";
echo "\n";
@@ -147,11 +143,8 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
echo "".$flashmsg['msg']."
\n";
}
echo "".getMLText('recent_uploads')."
\n";
- foreach($hookObjs as $hookObj) {
- if (method_exists($hookObj, 'startBody')) {
- $hookObj->startBody($this);
- }
- }
+ if($this->hasHook('startBody'))
+ $this->callHook('startBody');
} /* }}} */
function htmlAddHeader($head, $type='js') { /* {{{ */
@@ -166,13 +159,9 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
function htmlEndPage($nofooter=false) { /* {{{ */
if(!$nofooter) {
- $hookObjs = $this->getHookObjects('SeedDMS_View_Bootstrap');
$html = $this->footNote();
- foreach($hookObjs as $hookObj) {
- if (method_exists($hookObj, 'footNote')) {
- $html = $hookObj->footNote($this, $html);
- }
- }
+ if($this->hasHook('footNote'))
+ $html = $this->callHook('footNote', $html);
echo $html;
if($this->params['showmissingtranslations']) {
$this->missingLanguageKeys();
@@ -317,15 +306,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
}
echo " \n";
- $hookObjs = $this->getHookObjects('SeedDMS_View_Bootstrap');
echo " \n";
$menuitems = array();
/* Check if hook exists because otherwise callHook() will override $menuitems */
- foreach($hookObjs as $hookObj) {
- if (method_exists($hookObj, 'globalNavigationBar')) {
- $menuitems = $hookObj->globalNavigationBar($this, $menuitems);
- }
- }
+ if($this->hasHook('globalNavigationBar'))
+ $menuitems = $this->callHook('globalNavigationBar', $menuitems);
foreach($menuitems as $menuitem) {
if(!empty($menuitem['children'])) {
echo " - \n";
@@ -413,11 +398,8 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
$menuitems['my_account'] = array('link'=>"../out/out.MyAccount.php", 'label'=>'my_account');
if ($accessobject->check_view_access('TransmittalMgr'))
$menuitems['my_transmittals'] = array('link'=>"../out/out.TransmittalMgr.php", 'label'=>'my_transmittals');
- foreach($hookObjs as $hookObj) {
- if (method_exists($hookObj, 'userMenuItems')) {
- $menuitems = $hookObj->userMenuItems($this, $menuitems);
- }
- }
+ if($this->hasHook('userMenuItems'))
+ $menuitems = $this->callHook('userMenuItems', $menuitems);
if($menuitems) {
foreach($menuitems as $menuitem) {
echo " ".getMLText($menuitem['label'])."\n";
@@ -2842,13 +2824,16 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
* @return string
*/
function getListRowPath($object) { /* {{{ */
- $belowtitle = "
".getMLText('in_folder').": /";
+ $belowtitle = '';
$folder = $object->getParent();
- $path = $folder->getPath();
- for ($i = 1; $i < count($path); $i++) {
- $belowtitle .= htmlspecialchars($path[$i]->getName())."/";
+ if($folder) {
+ $belowtitle .= "
".getMLText('in_folder').": /";
+ $path = $folder->getPath();
+ for ($i = 1; $i < count($path); $i++) {
+ $belowtitle .= htmlspecialchars($path[$i]->getName())."/";
+ }
+ $belowtitle .= "";
}
- $belowtitle .= "";
return $belowtitle;
} /* }}} */
@@ -3156,10 +3141,12 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
if(!empty($extracontent['begin_action_list']))
$content .= $extracontent['begin_action_list'];
$subFolderAccessMode = $subFolder->getAccessMode($user);
- if($subFolderAccessMode >= M_ALL) {
- $content .= $this->printDeleteFolderButton($subFolder, 'splash_rm_folder', true);
- } else {
- $content .= '';
+ if ($accessop->check_view_access('RemoveFolder')) {
+ if($subFolderAccessMode >= M_ALL) {
+ $content .= $this->printDeleteFolderButton($subFolder, 'splash_rm_folder', true);
+ } else {
+ $content .= '';
+ }
}
if($subFolderAccessMode >= M_READWRITE) {
$content .= '';