コード例 #1
0
ファイル: ClickMenu.php プロジェクト: vip3out/TYPO3.CMS
 /**
  * Make 2nd level clickmenu (only for DBmenus)
  *
  * @param string $table Table name
  * @param int $uid UID for the current record.
  * @return string HTML content
  */
 public function printNewDBLevel($table, $uid)
 {
     $localItems = [];
     $uid = (int) $uid;
     // Setting internal record to the table/uid :
     $this->rec = BackendUtility::getRecordWSOL($table, $uid);
     $menuItems = array();
     $root = 0;
     // Rootlevel
     if ($table === 'pages' && $uid === 0) {
         $root = 1;
     }
     // If record was found, check permissions and get menu items.
     if (is_array($this->rec) || $root) {
         $lCP = $this->backendUser->calcPerms(BackendUtility::getRecord('pages', $table === 'pages' ? (int) $this->rec['uid'] : (int) $this->rec['pid']));
         // Edit:
         if (!$root && ($this->backendUser->isPSet($lCP, $table, 'edit') || $this->backendUser->isPSet($lCP, $table, 'editcontent'))) {
             $this->editOK = true;
         }
         $menuItems = $this->processingByExtClassArray($menuItems, $table, $uid);
     }
     $subname = GeneralUtility::_GP('subname');
     if ($subname === 'moreoptions') {
         // If the page can be edited, then show this:
         if ($this->editOK) {
             if (($table === 'pages' || $table === 'tt_content') && !in_array('move_wizard', $this->disabledItems, true)) {
                 $localItems['move_wizard'] = $this->DB_moveWizard($table, $uid, $this->rec);
             }
             if (($table === 'pages' || $table === 'tt_content') && !in_array('new_wizard', $this->disabledItems, true)) {
                 $localItems['new_wizard'] = $this->DB_newWizard($table, $uid, $this->rec);
             }
             if ($table === 'pages' && !in_array('perms', $this->disabledItems, true) && $this->backendUser->check('modules', 'system_BeuserTxPermission')) {
                 $localItems['perms'] = $this->DB_perms($table, $uid, $this->rec);
             }
             if (!in_array('db_list', $this->disabledItems, true) && $this->backendUser->check('modules', 'web_list')) {
                 $localItems['db_list'] = $this->DB_db_list($table, $uid, $this->rec);
             }
         }
         // Temporary mount point item:
         if ($table === 'pages') {
             $localItems['temp_mount_point'] = $this->DB_tempMountPoint($uid);
         }
         // Merge the locally created items into the current menu items passed to this function.
         $menuItems = array_merge($menuItems, $localItems);
     }
     // Return the printed elements:
     if (!is_array($menuItems)) {
         $menuItems = array();
     }
     return $this->printItems($menuItems);
 }