Ver código fonte

#13 - small temporary fix to hide single view menu item

Alex Trofimov 13 anos atrás
pai
commit
2579fefb21
1 arquivos alterados com 2 adições e 10 exclusões
  1. 2 10
      modules/boonex/notes/classes/BxNotesMenuViewNote.php

+ 2 - 10
modules/boonex/notes/classes/BxNotesMenuViewNote.php

@@ -31,12 +31,6 @@ class BxNotesMenuViewNote extends BxTemplMenu {
             $this->addMarkers(array('content_id' => $this->_aContentInfo['id']));
     }
 
-    public function getCode () {
-        if (!bx_get_logged_profile_id())
-            return false;
-        return parent::getCode ();
-    }
-
     /**
      * Check if menu items is visible.
      * @param $a menu item array
@@ -46,13 +40,11 @@ class BxNotesMenuViewNote extends BxTemplMenu {
 
         $iProfileId = bx_get_logged_profile_id();
 
-        // all links are visible for owner
-        if ($this->_aContentInfo['author'] == $iProfileId)
-            return true;
-
         $sFuncCheckAccess = false;
         switch ($a['name']) {
             case 'view-note':
+                if ($this->_aContentInfo[BxNotesConfig::$FIELD_AUTHOR] != $iProfileId && 'bx_notes_view' == $this->_sObject) // TODO: this is temporary - to hide single view item from menu
+                    return false;
                 $sFuncCheckAccess = 'isAllowedView';
                 break;
             case 'edit-note':