本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\IconUtility类的典型用法代码示例。如果您正苦于以下问题:PHP IconUtility类的具体用法?PHP IconUtility怎么用?PHP IconUtility使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IconUtility类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderStatic
/**
* @param array $arguments
* @param callable $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @return string
* @throws Exception
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$object = $arguments['object'];
$table = $arguments['table'];
if (!is_object($object) || !method_exists($object, 'getUid')) {
return '';
}
$row = array('uid' => $object->getUid(), 'startTime' => FALSE, 'endTime' => FALSE);
if (method_exists($object, 'getIsDisabled')) {
$row['disable'] = $object->getIsDisabled();
}
if (method_exists($object, 'getHidden')) {
$row['hidden'] = $object->getHidden();
}
if ($table === 'be_users' && $object instanceof BackendUser) {
$row['admin'] = $object->getIsAdministrator();
}
if (method_exists($object, 'getStartDateAndTime')) {
$row['startTime'] = $object->getStartDateAndTime();
}
if (method_exists($object, 'getEndDateAndTime')) {
$row['endTime'] = $object->getEndDateAndTime();
}
return IconUtility::getSpriteIconForRecord($table, $row);
}
示例2: init
public function init($PA, $fobj)
{
$GLOBALS['LANG']->includeLLFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('cal') . 'Resources/Private/Language/locallang_db.xml');
$this->frequency = $PA['row']['freq'];
if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7005000) {
$this->frequency = $PA['row']['freq'][0];
}
$this->uid = $PA['row']['uid'];
$this->row = $PA['row'];
$this->table = $PA['table'];
$this->rdateType = $this->row['rdate_type'];
$this->rdate = $this->row['rdate'];
$this->rdateValues = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->row['rdate'], 1);
if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7004000) {
$this->garbageIcon = '<span class="t3-icon fa t3-icon fa fa-trash"> </span>';
$this->newIcon = '<span title="' . $GLOBALS['LANG']->getLL('tx_cal_event.add_recurrence') . '" class="t3-icon fa t3-icon fa fa-plus-square"> </span>';
} else {
$this->garbageIcon = '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/garbage.gif') . ' title="' . $GLOBALS['LANG']->getLL('tx_cal_event.remove_recurrence') . '" alt="' . $GLOBALS['LANG']->getLL('tx_cal_event.delete_recurrence') . '" />';
$this->newIcon = '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/new_el.gif') . ' title="' . $GLOBALS['LANG']->getLL('tx_cal_event.add_recurrence') . '" alt="' . $GLOBALS['LANG']->getLL('tx_cal_event.add_recurrence') . '" />';
}
$this->commonJS = '';
if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7004000) {
$this->commonJS .= '<script src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('cal') . 'Resources/Public/js/recurui2.js" type="text/javascript"></script>' . chr(10) . '<script src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('cal') . 'Resources/Public/js/url2.js" type="text/javascript"></script>';
} else {
$this->commonJS .= '<script src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('cal') . 'Resources/Public/js/recurui.js" type="text/javascript"></script>' . chr(10) . '<script src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('cal') . 'Resources/Public/js/url.js" type="text/javascript"></script>';
}
$this->everyMonthText = $GLOBALS['LANG']->getLL('tx_cal_event.recurs_every_month');
$this->selectedMonthText = $GLOBALS['LANG']->getLL('tx_cal_event.recurs_selected_months');
$this->counts = $this->getCountsArray();
$startDay = $this->getWeekStartDay($PA);
$this->weekdays = $this->getWeekDaysArray($startDay);
$this->months = $this->getMonthsArray();
}
示例3: PMicon
/**
* Generate the plus/minus icon for the browsable tree.
* In this case, there is no plus-minus icon displayed.
*
* @param array $row Record for the entry
* @param integer $a The current entry number
* @param integer $c The total number of entries. If equal to $a, a 'bottom' element is returned.
* @param integer $nextCount The number of sub-elements to the current element.
* @param boolean $exp The element was expanded to render subelements if this flag is set.
* @return string Image tag with the plus/minus icon.
* @access private
* @see AbstarctTreeView::PMicon()
* @todo Define visibility
*/
public function PMicon($row, $a, $c, $nextCount, $exp)
{
$PM = 'join';
$BTM = $a == $c ? 'bottom' : '';
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('treeline-' . $PM . $BTM);
return $icon;
}
示例4: render
/**
* Render javascript in header
*
* @return string the rendered page info icon
* @see template::getPageInfo() Note: can't call this method as it's protected!
*/
public function render()
{
$doc = $this->getDocInstance();
$id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
$pageRecord = BackendUtility::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
// Add icon with clickmenu, etc:
if ($pageRecord['uid']) {
// If there IS a real page
$alttext = BackendUtility::getRecordIconAltText($pageRecord, 'pages');
$iconImg = IconUtility::getSpriteIconForRecord('pages', $pageRecord, array('title' => htmlspecialchars($alttext)));
// Make Icon:
$theIcon = $doc->wrapClickMenuOnIcon($iconImg, 'pages', $pageRecord['uid']);
} else {
// On root-level of page tree
// Make Icon
$iconImg = '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/i/_icon_website.gif') . ' alt="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '" />';
if ($GLOBALS['BE_USER']->user['admin']) {
$theIcon = $doc->wrapClickMenuOnIcon($iconImg, 'pages', 0);
} else {
$theIcon = $iconImg;
}
}
// Setting icon with clickmenu + uid
$pageInfo = $theIcon . '<em>[pid: ' . $pageRecord['uid'] . ']</em>';
return $pageInfo;
}
示例5: manipulateCacheActions
/**
* Modifies CacheMenuItems array
*
* @param array $cacheActions Array of CacheMenuItems
* @param array $optionValues Array of AccessConfigurations-identifiers (typically used by userTS with options.clearCache.identifier)
*
* @return void
*/
public function manipulateCacheActions(&$cacheActions, &$optionValues)
{
if ($this->getBackendUser()->getTSConfigVal('options.clearCache.system') || GeneralUtility::getApplicationContext()->isDevelopment() || (bool) $GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] === TRUE && $this->getBackendUser()->isAdmin()) {
$cacheActions[] = array('id' => 'dyncss', 'title' => $this->getLanguageService()->sL('LLL:EXT:dyncss/Resources/Private/Language/locallang.xlf:dyncss.toolbar.clearcache.title', TRUE), 'description' => $this->getLanguageService()->sL('LLL:EXT:dyncss/Resources/Private/Language/locallang.xlf:dyncss.toolbar.clearcache.description', TRUE), 'href' => BackendUtility::getModuleUrl('tce_db') . '&vC=' . $this->getBackendUser()->veriCode() . '&cacheCmd=dyncss&ajaxCall=1' . BackendUtility::getUrlToken('tceAction'), 'icon' => IconUtility::getSpriteIcon('extensions-dyncss-lightning-blue'));
$optionValues[] = 'dyncss';
}
}
示例6: generateButtons
/**
* Generate album add/edit buttons for click menu or toolbar
*
* @param string $combinedIdentifier
* @return array
*/
protected function generateButtons($combinedIdentifier)
{
$buttons = array();
// In some folder copy/move actions in file list a invalid id is passed
try {
/** @var $file \TYPO3\CMS\Core\Resource\Folder */
$folder = ResourceFactory::getInstance()->retrieveFileOrFolderObject($combinedIdentifier);
} catch (ResourceDoesNotExistException $exception) {
$folder = NULL;
} catch (InsufficientFolderAccessPermissionsException $exception) {
$folder = NULL;
}
if ($folder && $folder instanceof Folder && !$folder->getStorage()->isPublic() && in_array($folder->getRole(), array(Folder::ROLE_DEFAULT, Folder::ROLE_USERUPLOAD))) {
/** @var \BeechIt\FalSecuredownload\Service\Utility $utility */
$utility = GeneralUtility::makeInstance('BeechIt\\FalSecuredownload\\Service\\Utility');
$folderRecord = $utility->getFolderRecord($folder);
$menuItems[] = 'spacer';
if ($folderRecord) {
$buttons[] = $this->createLink($this->sL('clickmenu.folderpermissions'), $this->sL('clickmenu.folderpermissions'), IconUtility::getSpriteIcon('extensions-fal_securedownload-folder', array(), array('status-overlay-access-restricted' => '')), "alt_doc.php?edit[tx_falsecuredownload_folder][" . $folderRecord['uid'] . "]=edit");
} else {
$buttons[] = $this->createLink($this->sL('clickmenu.folderpermissions'), $this->sL('clickmenu.folderpermissions'), IconUtility::getSpriteIcon('extensions-fal_securedownload-folder', array(), array('extensions-fal_securedownload-overlay-permissions' => '')), "alt_doc.php?edit[tx_falsecuredownload_folder][0]=new&defVals[tx_falsecuredownload_folder][folder_hash]=" . $folder->getHashedIdentifier() . "&defVals[tx_falsecuredownload_folder][storage]=" . $folder->getStorage()->getUid() . "&defVals[tx_falsecuredownload_folder][folder]=" . $folder->getIdentifier());
}
}
return $buttons;
}
示例7: render
/**
* Prints sprite icon html for $iconName key.
*
* @param string $iconName
* @param array $options
* @param int $uid
* @return string
*/
public function render($iconName, $options = array(), $uid = 0)
{
if (!isset($options['title']) && $uid > 0) {
$options['title'] = 'id=' . $uid;
}
return \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon($iconName, $options);
}
示例8: renderStatic
/**
* @param array $arguments
* @param callable $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @return string
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$documentTranslation = $arguments['documentTranslation'];
$icons = array('html' => '<a class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</a>', 'pdf' => '<a class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</a>', 'sxw' => '<a class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</a>');
$formats = $documentTranslation->getFormats();
foreach ($formats as $format) {
$output = '';
/** @var \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $format */
$output .= '<a ';
$uri = '../' . $format->getPath();
$extension = substr($uri, strrpos($uri, '.') + 1);
if (strlen($extension) < 5) {
// This is direct link to a file
$output .= 'href="' . $uri . '" class="btn btn-default"';
} else {
$extension = $format->getFormat();
if ($extension === 'json') {
$extension = 'js';
}
$output .= 'href="#" onclick="top.TYPO3.Backend.ContentContainer.setUrl(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($uri) . ')" class="btn btn-default"';
}
$xliff = 'LLL:EXT:documentation/Resources/Private/Language/locallang.xlf';
$title = sprintf($GLOBALS['LANG']->sL($xliff . ':tx_documentation_domain_model_documentformat.format.title'), $format->getFormat());
$output .= ' title="' . htmlspecialchars($title) . '">';
$spriteIconHtml = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForFile($extension);
$output .= $spriteIconHtml . '</a>' . LF;
$keyFormat = $format->getFormat();
if ($keyFormat === 'json') {
// It should take over the place of sxw which will then never be used
$keyFormat = 'sxw';
}
$icons[$keyFormat] = $output;
}
return implode('', array_values($icons));
}
示例9: init
/**
* Constructor for initializing the class
*
* @return void
* @todo Define visibility
*/
public function init()
{
// Initialize GPvars:
$this->target = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('target');
$this->returnUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::sanitizeLocalUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('returnUrl'));
if (!$this->returnUrl) {
$this->returnUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('file_list') . '&id=' . rawurlencode($this->target);
}
// Create the folder object
if ($this->target) {
$this->folderObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($this->target);
}
// Cleaning and checking target directory
if (!$this->folderObject) {
$title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE);
$message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE);
throw new \RuntimeException($title . ': ' . $message, 1294586843);
}
// Setting the title and the icon
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('apps-filetree-root');
$this->title = $icon . htmlspecialchars($this->folderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->folderObject->getIdentifier());
// Setting template object
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->setModuleTemplate('templates/file_upload.html');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->form = '<form action="tce_file.php" method="post" name="editform" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '">';
}
示例10: render
/**
* Renders all format download links.
*
* @param \TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation $documentTranslation
* @return string
*/
public function render(\TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation $documentTranslation)
{
$output = '';
foreach ($documentTranslation->getFormats() as $format) {
/** @var \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $format */
$output .= '<a ';
$uri = '../' . $format->getPath();
$extension = substr($uri, strrpos($uri, '.') + 1);
if (strlen($extension) < 5) {
// This is direct link to a file
$output .= 'href="' . $uri . '"';
} else {
$extension = $format->getFormat();
if ($extension === 'json') {
$extension = 'js';
}
$output .= 'href="#" onclick="top.TYPO3.Backend.ContentContainer.setUrl(\'' . $uri . '\')"';
}
$xliff = 'LLL:EXT:documentation/Resources/Private/Language/locallang.xlf';
$title = sprintf($GLOBALS['LANG']->sL($xliff . ':tx_documentation_domain_model_documentformat.format.title'), $format->getFormat());
$output .= ' title="' . htmlspecialchars($title) . '">';
$spriteIconHtml = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForFile($extension);
$output .= $spriteIconHtml . '</a>' . LF;
}
return $output;
}
示例11: adminLinks
/**
* Administrative links for a table / record
*
* @param string $table Table name
* @param array $row Record for which administrative links are generated.
*
* @return string HTML link tags.
*/
public function adminLinks($table, array $row)
{
if ($table !== 'tx_commerce_products') {
return parent::adminLinks($table, $row);
} else {
$language = $this->getLanguageService();
// Edit link:
$adminLink = '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[' . $table . '][' . $row['uid'] . ']=edit', $this->doc->backPath)) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open', array('title' => $language->sL('LLL:EXT:lang/locallang_core.xml:cm.edit', TRUE))) . '</a>';
// Delete link:
$adminLink .= '<a href="' . htmlspecialchars($this->doc->issueCommand('&cmd[' . $table . '][' . $row['uid'] . '][delete]=1')) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-delete', array('title' => $language->sL('LLL:EXT:lang/locallang_core.php:cm.delete', TRUE))) . '</a>';
if ($row['pid'] == -1) {
// get page TSconfig
$pagesTyposcriptConfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($GLOBALS['_POST']['popViewId']);
if ($pagesTyposcriptConfig['tx_commerce.']['singlePid']) {
$previewPageId = $pagesTyposcriptConfig['tx_commerce.']['singlePid'];
} else {
$previewPageId = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][COMMERCE_EXTKEY]['extConf']['previewPageID'];
}
$sysLanguageUid = (int) $row['sys_language_uid'];
/**
* Product
*
* @var $product Tx_Commerce_Domain_Model_Product
*/
$product = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Commerce_Domain_Model_Product', $row['t3ver_oid'], $sysLanguageUid);
$product->loadData();
$getVars = ($sysLanguageUid > 0 ? '&L=' . $sysLanguageUid : '') . '&ADMCMD_vPrev[' . rawurlencode($table . ':' . $row['t3ver_oid']) . ']=' . $row['uid'] . '&no_cache=1&tx_commerce_pi1[showUid]=' . $product->getUid() . '&tx_commerce_pi1[catUid]=' . current($product->getMasterparentCategory());
$adminLink .= '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($previewPageId, $this->doc->backPath, \TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine($row['_REAL_PID']), '', '', $getVars)) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-view') . '</a>';
}
return $adminLink;
}
}
示例12: printTree
/**
* Create the page navigation tree in HTML
*
* @param array Tree array
* @return string HTML output.
* @todo Define visibility
*/
public function printTree($treeArr = '')
{
$titleLen = (int) $GLOBALS['BE_USER']->uc['titleLen'];
if (!is_array($treeArr)) {
$treeArr = $this->tree;
}
$out = '';
$c = 0;
foreach ($treeArr as $k => $v) {
$c++;
$bgColorClass = ($c + 1) % 2 ? 'bgColor' : 'bgColor-10';
if ($GLOBALS['SOBE']->browser->curUrlInfo['act'] == 'page' && $GLOBALS['SOBE']->browser->curUrlInfo['pageid'] == $v['row']['uid'] && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']) {
$arrCol = '<td><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/blinkarrow_right.gif', 'width="5" height="9"') . ' class="c-blinkArrowR" alt="" /></td>';
$bgColorClass = 'bgColor4';
} else {
$arrCol = '<td></td>';
}
$aOnClick = 'return jumpToUrl(' . GeneralUtility::quoteJSvalue($this->getThisScript() . 'act=' . $GLOBALS['SOBE']->browser->act . '&editorNo=' . $GLOBALS['SOBE']->browser->editorNo . '&contentTypo3Language=' . $GLOBALS['SOBE']->browser->contentTypo3Language . '&mode=' . $GLOBALS['SOBE']->browser->mode . '&expandPage=' . $v['row']['uid']) . ');';
$cEbullet = $this->ext_isLinkable($v['row']['doktype'], $v['row']['uid']) ? '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '"><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/arrowbullet.gif', 'width="18" height="16"') . ' alt="" /></a>' : '';
$out .= '
<tr class="' . $bgColorClass . '">
<td nowrap="nowrap"' . ($v['row']['_CSSCLASS'] ? ' class="' . $v['row']['_CSSCLASS'] . '"' : '') . '>' . $v['HTML'] . $this->wrapTitle($this->getTitleStr($v['row'], $titleLen), $v['row'], $this->ext_pArrPages) . '</td>' . $arrCol . '<td>' . $cEbullet . '</td>
</tr>';
}
$out = '
<!--
Navigation Page Tree:
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
' . $out . '
</table>';
return $out;
}
示例13: getDropDown
/**
* Get drop down
*
* @return string
*/
public function getDropDown()
{
$backendUser = $this->getBackendUser();
$languageService = $this->getLanguageService();
$index = 0;
$activeWorkspace = (int) $backendUser->workspace;
$stateCheckedIcon = IconUtility::getSpriteIcon('status-status-checked');
$stateUncheckedIcon = IconUtility::getSpriteIcon('empty-empty', array('title' => $languageService->getLL('bookmark_inactive')));
$workspaceSections = array('top' => array(), 'items' => array());
foreach ($this->availableWorkspaces as $workspaceId => $label) {
$workspaceId = (int) $workspaceId;
$iconState = $workspaceId === $activeWorkspace ? $stateCheckedIcon : $stateUncheckedIcon;
$classValue = $workspaceId === $activeWorkspace ? ' class="selected"' : '';
$sectionName = $index++ === 0 ? 'top' : 'items';
$workspaceSections[$sectionName][] = '<li' . $classValue . '>' . '<a href="backend.php?changeWorkspace=' . $workspaceId . '" data-workspaceid="' . $workspaceId . '" class="dropdown-list-link tx-workspaces-switchlink">' . $iconState . ' ' . htmlspecialchars($label) . '</a></li>';
}
if (!empty($workspaceSections['top'])) {
// Add the "Go to workspace module" link
// if there is at least one icon on top and if the access rights are there
if ($backendUser->check('modules', 'web_WorkspacesWorkspaces')) {
$workspaceSections['top'][] = '<li><a target="content" data-module="web_WorkspacesWorkspaces" class="dropdown-list-link tx-workspaces-modulelink">' . $stateUncheckedIcon . ' ' . $languageService->getLL('bookmark_workspace', TRUE) . '</a></li>';
}
} else {
// no items on top (= no workspace to work in)
$workspaceSections['top'][] = '<li>' . $stateUncheckedIcon . ' ' . $languageService->getLL('bookmark_noWSfound', TRUE) . '</li>';
}
$workspaceMenu = array('<ul class="dropdown-list">', implode(LF, $workspaceSections['top']), !empty($workspaceSections['items']) ? '<li class="divider"></li>' : '', implode(LF, $workspaceSections['items']), '</ul>');
return implode(LF, $workspaceMenu);
}
示例14: main
/**
* Processing of clickmenu items
*
* @param object $backRef Reference to parent
* @param array $menuItems Menu items array to modify
* @param string $table Table name
* @param integer $uid Uid of the record
* @return array Menu item array, returned after modification
* @todo Skinning for icons...
* @todo Define visibility
*/
public function main(&$backRef, $menuItems, $table, $uid)
{
$localItems = array();
// Show import/export on second level menu OR root level.
if ($backRef->cmLevel && \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('subname') == 'moreoptions' || $table === 'pages' && $uid == 0) {
$LL = $this->includeLL();
$urlParameters = array('tx_impexp' => array('action' => 'export'), 'id' => $table == 'pages' ? $uid : $backRef->rec['pid']);
if ($table == 'pages') {
$urlParameters['tx_impexp']['pagetree']['id'] = $uid;
$urlParameters['tx_impexp']['pagetree']['levels'] = 0;
$urlParameters['tx_impexp']['pagetree']['tables'][] = '_ALL';
} else {
$urlParameters['tx_impexp']['record'][] = $table . ':' . $uid;
$urlParameters['tx_impexp']['external_ref']['tables'][] = '_ALL';
}
$url = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('xMOD_tximpexp', $urlParameters);
$localItems[] = $backRef->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('export', $LL)), $backRef->excludeIcon(\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-export-t3d')), $backRef->urlRefForCM($url), 1);
if ($table == 'pages') {
$urlParameters = array('id' => $uid, 'table' => $table, 'tx_impexp' => array('action' => 'import'));
$url = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('xMOD_tximpexp', $urlParameters);
$localItems[] = $backRef->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('import', $LL)), $backRef->excludeIcon(\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-import-t3d')), $backRef->urlRefForCM($url), 1);
}
}
return array_merge($menuItems, $localItems);
}
示例15: getTableContextHelp
/**
* Fetch the context help for the given table
*
* @param string $table Table identifier
* @return array Complete help information
*/
public function getTableContextHelp($table)
{
$output = array();
if (!isset($GLOBALS['TCA_DESCR'][$table]['columns'])) {
$GLOBALS['LANG']->loadSingleTableDescription($table);
}
if (is_array($GLOBALS['TCA_DESCR'][$table]) && is_array($GLOBALS['TCA_DESCR'][$table]['columns'])) {
$arrow = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-forward');
foreach ($GLOBALS['TCA_DESCR'][$table]['columns'] as $field => $data) {
$output[$field] = array('description' => NULL, 'title' => NULL, 'moreInfo' => FALSE, 'id' => $table . '.' . $field);
// Add alternative title, if defined
if ($data['alttitle']) {
$output[$field]['title'] = $data['alttitle'];
}
// If we have more information to show
if ($data['image_descr'] || $data['seeAlso'] || $data['details'] || $data['syntax']) {
$output[$field]['moreInfo'] = TRUE;
}
// Add description
if ($data['description']) {
$output[$field]['description'] = $data['description'] . ($output[$field]['moreInfo'] ? $arrow : '');
}
}
}
return $output;
}