Esempio n. 1
0
 /**
  * Builds a list of all links for a specific element (here: BE user) and returns it for print.
  *
  * @param	string		the db table that should be used
  * @param	array		the BE user record to use
  * @return	string		a HTML formatted list of the link
  */
 function elementLinks($table, $row)
 {
     // Info:
     $cells[] = '<a href="#" onclick="top.launchView(\'' . $table . '\', \'' . $row['uid'] . '\',\'' . $GLOBALS['BACK_PATH'] . '\'); return false;" title="' . $GLOBALS['LANG']->getLL('showInformation', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-info') . '</a>';
     // Edit:
     $params = '&edit[' . $table . '][' . $row['uid'] . ']=edit';
     $cells[] = '<a href="#" onclick="' . t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], '') . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:edit', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
     // Hide:
     $hiddenField = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'];
     if ($row[$hiddenField]) {
         $params = '&data[' . $table . '][' . $row['uid'] . '][' . $hiddenField . ']=0';
         $cells[] = '<a href="' . $this->doc->issueCommand($params) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:enable', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-unhide') . '</a>';
     } else {
         $params = '&data[' . $table . '][' . $row['uid'] . '][' . $hiddenField . ']=1';
         $cells[] = '<a href="' . $this->doc->issueCommand($params) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:disable', true) . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-hide') . '</a>';
     }
     // Delete
     $params = '&cmd[' . $table . '][' . $row['uid'] . '][delete]=1';
     $cells[] = '<a href="' . $this->doc->issueCommand($params) . '" onclick="return confirm(unescape(\'' . $GLOBALS['LANG']->getLL('sureToDelete', TRUE) . '\'));" title="' . $GLOBALS['LANG']->getLL('delete', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-delete') . '</a>';
     return implode('', $cells);
 }