当前位置: 首页>>代码示例>>PHP>>正文


PHP IconFactory::getIcon方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Core\Imaging\IconFactory::getIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP IconFactory::getIcon方法的具体用法?PHP IconFactory::getIcon怎么用?PHP IconFactory::getIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Core\Imaging\IconFactory的用法示例。


在下文中一共展示了IconFactory::getIcon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getIcon

 /**
  * @param string $icon
  * @return string
  */
 public static function getIcon($icon)
 {
     if (NULL === static::$iconFactory) {
         static::$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
     }
     return static::$iconFactory->getIcon($icon, Icon::SIZE_SMALL);
 }
开发者ID:busynoggin,项目名称:flux,代码行数:11,代码来源:MiscellaneousUtility.php

示例2: getDropDown

 /**
  * Get drop down
  *
  * @return string
  */
 public function getDropDown()
 {
     $backendUser = $this->getBackendUser();
     $languageService = $this->getLanguageService();
     $index = 0;
     $activeWorkspace = (int) $backendUser->workspace;
     $stateCheckedIcon = $this->iconFactory->getIcon('status-status-checked', Icon::SIZE_SMALL)->render();
     $stateUncheckedIcon = '<span title="' . $languageService->getLL('bookmark_inactive', true) . '">' . $this->iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render() . '</span>';
     $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="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('main', array('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);
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:34,代码来源:WorkspaceSelectorToolbarItem.php

示例3: main

 /**
  * Processing of clickmenu items
  *
  * @param \TYPO3\CMS\Backend\ClickMenu\ClickMenu $backRef parent
  * @param array $menuItems Menu items array to modify
  * @param string $table Table name
  * @param int $uid Uid of the record
  * @return array Menu item array, returned after modification
  * @todo Skinning for icons...
  */
 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($this->iconFactory->getIcon('actions-document-export-t3d', Icon::SIZE_SMALL)), $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($this->iconFactory->getIcon('actions-document-import-t3d', Icon::SIZE_SMALL)), $backRef->urlRefForCM($url), 1);
         }
     }
     return array_merge($menuItems, $localItems);
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:35,代码来源:Clickmenu.php

示例4: main

 /**
  * Main function, adding the item to input menuItems array
  *
  * @param ClickMenu $backRef References to parent clickmenu objects.
  * @param array $menuItems Array of existing menu items accumulated. New element added to this.
  * @param string $table Table name of the element
  * @param int $uid Record UID of the element
  * @return array Modified menuItems array
  */
 public function main(&$backRef, $menuItems, $table, $uid)
 {
     $localItems = array();
     if (!$backRef->cmLevel && $uid > 0 && $GLOBALS['BE_USER']->check('modules', 'web_txversionM1')) {
         // Returns directly, because the clicked item was not from the pages table
         if (in_array('versioning', $backRef->disabledItems) || !$GLOBALS['TCA'][$table] || !$GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
             return $menuItems;
         }
         // Adds the regular item
         $LL = $this->includeLL();
         // "Versioning" element added:
         $url = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txversionM1', array('table' => $table, 'uid' => $uid));
         $localItems[] = $backRef->linkItem($GLOBALS['LANG']->getLLL('title', $LL), $backRef->excludeIcon($this->iconFactory->getIcon('actions-version-open', Icon::SIZE_SMALL)->render()), $backRef->urlRefForCM($url), true);
         // Find position of "delete" element:
         $c = 0;
         foreach ($menuItems as $k => $value) {
             $c++;
             if ($k === 'delete') {
                 break;
             }
         }
         // .. subtract two (delete item + divider line)
         $c -= 2;
         // ... and insert the items just before the delete element.
         array_splice($menuItems, $c, 0, $localItems);
     }
     return $menuItems;
 }
开发者ID:hlop,项目名称:TYPO3.CMS,代码行数:37,代码来源:VersionClickMenu.php

示例5: renderMenuEntry

    /**
     * Returns the recent documents list as an array
     *
     * @param array $document
     * @param string $md5sum
     * @param bool $isRecentDoc
     * @param bool $isFirstDoc
     * @return array All recent documents as list-items
     */
    protected function renderMenuEntry($document, $md5sum, $isRecentDoc = false, $isFirstDoc = false)
    {
        $table = $document[3]['table'];
        $uid = $document[3]['uid'];
        $record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL($table, $uid);
        if (!is_array($record)) {
            // Record seems to be deleted
            return '';
        }
        $label = htmlspecialchars(strip_tags(htmlspecialchars_decode($document[0])));
        $icon = $this->iconFactory->getIconForRecord($table, $record, Icon::SIZE_SMALL)->render();
        $link = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('record_edit') . '&' . $document[2];
        $pageId = (int) $document[3]['uid'];
        if ($document[3]['table'] !== 'pages') {
            $pageId = (int) $document[3]['pid'];
        }
        $onClickCode = 'jump(' . GeneralUtility::quoteJSvalue($link) . ', \'web_list\', \'web\', ' . $pageId . '); TYPO3.OpendocsMenu.toggleMenu(); return false;';
        if (!$isRecentDoc) {
            $title = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', true);
            // Open document
            $closeIcon = $this->iconFactory->getIcon('actions-close', Icon::SIZE_SMALL)->render('inline');
            $entry = '
				<li class="opendoc">
					<a href="#" class="dropdown-list-link dropdown-link-list-add-close" onclick="' . htmlspecialchars($onClickCode) . '" target="content">' . $icon . ' ' . $label . '</a>
					<a href="#" class="dropdown-list-link-close" data-opendocsidentifier="' . $md5sum . '" title="' . $title . '">' . $closeIcon . '</a>
				</li>';
        } else {
            // Recently used document
            $entry = '
				<li>
					<a href="#" class="dropdown-list-link" onclick="' . htmlspecialchars($onClickCode) . '" target="content">' . $icon . ' ' . $label . '</a>
				</li>';
        }
        return $entry;
    }
开发者ID:graurus,项目名称:testgit_t37,代码行数:44,代码来源:OpendocsToolbarItem.php

示例6: openInNewWindow

 /**
  * This method prepares the link for opening the devlog in a new window
  *
  * @return string Hyperlink with icon and appropriate JavaScript
  */
 protected function openInNewWindow()
 {
     $url = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL');
     $onClick = 'devlogWin=window.open(' . GeneralUtility::quoteJSvalue($url) . ',\'taskcenter\',\'width=790,status=0,menubar=1,resizable=1,location=0,scrollbars=1,toolbar=0\');return false;';
     $content = '<a href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.openInNewWindow', true) . '">' . $this->iconFactory->getIcon('actions-window-open', Icon::SIZE_SMALL)->render() . '</a>';
     return $content;
 }
开发者ID:hlop,项目名称:TYPO3.CMS,代码行数:12,代码来源:TaskModuleController.php

示例7: getDropDown

 /**
  * Render drop down
  *
  * @return string HTML
  */
 public function getDropDown()
 {
     $backendUser = $this->getBackendUser();
     $languageService = $this->getLanguageService();
     $dropdown = array();
     $dropdown[] = '<ul class="dropdown-list">';
     /** @var BackendModuleRepository $backendModuleRepository */
     $backendModuleRepository = GeneralUtility::makeInstance(BackendModuleRepository::class);
     /** @var \TYPO3\CMS\Backend\Domain\Model\Module\BackendModule $userModuleMenu */
     $userModuleMenu = $backendModuleRepository->findByModuleName('user');
     if ($userModuleMenu != false && $userModuleMenu->getChildren()->count() > 0) {
         foreach ($userModuleMenu->getChildren() as $module) {
             /** @var BackendModule $module */
             $dropdown[] = '<li' . ' id="' . htmlspecialchars($module->getName()) . '"' . ' class="typo3-module-menu-item submodule mod-' . htmlspecialchars($module->getName()) . '" ' . ' data-modulename="' . htmlspecialchars($module->getName()) . '"' . ' data-navigationcomponentid="' . htmlspecialchars($module->getNavigationComponentId()) . '"' . ' data-navigationframescript="' . htmlspecialchars($module->getNavigationFrameScript()) . '"' . ' data-navigationframescriptparameters="' . htmlspecialchars($module->getNavigationFrameScriptParameters()) . '"' . '>';
             $dropdown[] = '<a title="' . htmlspecialchars($module->getDescription()) . '" href="' . htmlspecialchars($module->getLink()) . '" class="dropdown-list-link modlink">';
             $dropdown[] = '<span class="submodule-icon typo3-app-icon"><span><span>' . $module->getIcon() . '</span></span></span>';
             $dropdown[] = '<span class="submodule-label">' . htmlspecialchars($module->getTitle()) . '</span>';
             $dropdown[] = '</a>';
             $dropdown[] = '</li>';
         }
         $dropdown[] = '<li class="divider"></li>';
     }
     // Logout button
     $buttonLabel = 'LLL:EXT:lang/locallang_core.xlf:' . ($backendUser->user['ses_backuserid'] ? 'buttons.exit' : 'buttons.logout');
     $dropdown[] = '<li class="reset-dropdown">';
     $dropdown[] = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('logout')) . '" class="btn btn-danger pull-right" target="_top">';
     $dropdown[] = $this->iconFactory->getIcon('actions-logout', Icon::SIZE_SMALL)->render('inline') . ' ';
     $dropdown[] = $languageService->sL($buttonLabel, true);
     $dropdown[] = '</a>';
     $dropdown[] = '</li>';
     $dropdown[] = '</ul>';
     return implode(LF, $dropdown);
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:38,代码来源:UserToolbarItem.php

示例8: tt_content_drawColHeader

    /**
     * Draw header for a content element column:
     *
     * @param string $colName Column name
     * @param string $editParams Edit params (Syntax: &edit[...] for FormEngine)
     * @param \TYPO3\CMS\Backend\View\PageLayoutView $parentObject
     * @param boolean $expanded
     *
     * @return string HTML table
     */
    public function tt_content_drawColHeader($colName, $editParams, PageLayoutView $parentObject, $expanded = true)
    {
        $iconsArr = array();
        // Create command links:
        if ($parentObject->tt_contentConfig['showCommands']) {
            // Edit whole of column:
            if ($editParams) {
                $iconsArr['edit'] = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($editParams)) . '" title="' . $this->getLanguageService()->getLL('editColumn', true) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
            }
        }
        if ($expanded) {
            $state = 'expanded';
            $title = $this->languageService->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:tx_gridelements_collapsecontent');
            $toggleTitle = $this->languageService->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:tx_gridelements_expandcontent');
        } else {
            $state = 'collapsed';
            $title = $this->languageService->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:tx_gridelements_expandcontent');
            $toggleTitle = $this->languageService->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:tx_gridelements_collapsecontent');
        }
        $iconsArr['toggleContent'] = '<a href="#" class="btn btn-default t3js-toggle-gridelements-column toggle-content" title="' . $title . '" data-toggle-title="' . $toggleTitle . '" data-state="' . $state . '">' . $this->iconFactory->getIcon('actions-view-list-collapse', 'small') . $this->iconFactory->getIcon('actions-view-list-expand', 'small') . '</a>';
        $icons = '<div class="t3-page-column-header-icons btn-group btn-group-sm">' . implode('', $iconsArr) . '</div>';
        // Create header row:
        $out = '<div class="t3-page-column-header">
					' . $icons . '
					<div class="t3-page-column-header-label">' . htmlspecialchars($colName) . '</div>
				</div>';
        return $out;
    }
开发者ID:stigfaerch,项目名称:gridelements,代码行数:38,代码来源:DrawItem.php

示例9: viewSqlQuery

 /**
  * Action to view the result of a SQL query
  *
  * @param array $record sys_action record
  * @return string Result of the query
  */
 protected function viewSqlQuery($record)
 {
     $content = '';
     if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('lowlevel')) {
         $sql_query = unserialize($record['t2_data']);
         if (!is_array($sql_query) || is_array($sql_query) && strtoupper(substr(trim($sql_query['qSelect']), 0, 6)) === 'SELECT') {
             $actionContent = '';
             $fullsearch = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\QueryView::class);
             $fullsearch->formW = 40;
             $fullsearch->noDownloadB = 1;
             $type = $sql_query['qC']['search_query_makeQuery'];
             if ($sql_query['qC']['labels_noprefix'] === 'on') {
                 $GLOBALS['SOBE']->MOD_SETTINGS['labels_noprefix'] = 'on';
             }
             $sqlQuery = $sql_query['qSelect'];
             $queryIsEmpty = false;
             if ($sqlQuery) {
                 $res = $this->getDatabaseConnection()->sql_query($sqlQuery);
                 if (!$this->getDatabaseConnection()->sql_error()) {
                     $fullsearch->formW = 48;
                     // Additional configuration
                     $GLOBALS['SOBE']->MOD_SETTINGS['search_result_labels'] = 1;
                     $GLOBALS['SOBE']->MOD_SETTINGS['queryFields'] = $sql_query['qC']['queryFields'];
                     $cP = $fullsearch->getQueryResultCode($type, $res, $sql_query['qC']['queryTable']);
                     $actionContent = $cP['content'];
                     // If the result is rendered as csv or xml, show a download link
                     if ($type === 'csv' || $type === 'xml') {
                         $actionContent .= '<a href="' . GeneralUtility::getIndpEnv('REQUEST_URI') . '&download_file=1"><strong>' . $this->getLanguageService()->getLL('action_download_file') . '</strong></a>';
                     }
                 } else {
                     $actionContent .= $this->getDatabaseConnection()->sql_error();
                 }
             } else {
                 // Query is empty (not built)
                 $queryIsEmpty = true;
                 $this->addMessage($this->getLanguageService()->getLL('action_emptyQuery'), $this->getLanguageService()->getLL('action_error'), FlashMessage::ERROR);
                 $content .= $this->renderFlashMessages();
             }
             // Admin users are allowed to see and edit the query
             if ($this->getBackendUser()->isAdmin()) {
                 if (!$queryIsEmpty) {
                     $actionContent .= '<div class="panel panel-default"><div class="panel-body">' . $fullsearch->tableWrap($sql_query['qSelect']) . '</div></div>';
                 }
                 $actionContent .= '<a title="' . $this->getLanguageService()->getLL('action_editQuery') . '" class="btn btn-default" href="' . htmlspecialchars(BackendUtility::getModuleUrl('system_dbint') . '&id=' . '&SET[function]=search' . '&SET[search]=query' . '&storeControl[STORE]=-' . $record['uid'] . '&storeControl[LOAD]=1') . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render() . ' ' . $this->getLanguageService()->getLL($queryIsEmpty ? 'action_createQuery' : 'action_editQuery') . '</a>';
             }
             $content .= '<h2>' . $this->getLanguageService()->getLL('action_t2_result', true) . '</h2>' . $actionContent;
         } else {
             // Query is not configured
             $this->addMessage($this->getLanguageService()->getLL('action_notReady'), $this->getLanguageService()->getLL('action_error'), FlashMessage::ERROR);
             $content .= $this->renderFlashMessages();
         }
     } else {
         // Required sysext lowlevel is not installed
         $this->addMessage($this->getLanguageService()->getLL('action_lowlevelMissing'), $this->getLanguageService()->getLL('action_error'), FlashMessage::ERROR);
         $content .= $this->renderFlashMessages();
     }
     return $content;
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:64,代码来源:ActionTask.php

示例10: deleteLink

 /**
  * Create delete link with trash icon
  *
  * @param int $uid Uid of the record
  *
  * @return string Link with the trash icon
  */
 function deleteLink($uid)
 {
     $icon = $this->iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL);
     $dmail = BackendUtility::getRecord('sys_dmail', $uid);
     if (!$dmail['scheduled_begin']) {
         return '<a href="' . BackendUtility::getModuleUrl('txdirectmailM1_txdirectmailM5') . '&id=' . $this->id . '&cmd=delete&uid=' . $uid . '">' . $icon . '</a>';
     }
     return "";
 }
开发者ID:Teddytrombone,项目名称:direct_mail,代码行数:16,代码来源:MailerEngine.php

示例11: getNewsletterTabIcon

 /**
  * The icon for the source tab
  *
  * @param bool $expand State of the tab
  *
  * @return string
  */
 protected function getNewsletterTabIcon($expand = false)
 {
     if ($expand) {
         // opened
         return $this->iconFactory->getIcon('apps-pagetree-expand', Icon::SIZE_SMALL);
     }
     // closes
     return $this->iconFactory->getIcon('apps-pagetree-collapse', Icon::SIZE_SMALL);
 }
开发者ID:kartolo,项目名称:direct_mail,代码行数:16,代码来源:Dmail.php

示例12: getWorkspaceInfo

 /**
  * Create the workspace information
  *
  * @return string HTML containing workspace info
  */
 protected function getWorkspaceInfo()
 {
     if (ExtensionManagementUtility::isLoaded('workspaces') && ($this->getBackendUser()->workspace !== 0 || $this->getBackendUser()->getTSConfigVal('options.pageTree.onlineWorkspaceInfo'))) {
         $wsTitle = htmlspecialchars(WorkspaceService::getWorkspaceTitle($this->getBackendUser()->workspace));
         $workspaceInfo = '<div class="bgColor4 workspace-info"><span title="' . $wsTitle . '" onclick="top.goToModule(\'web_WorkspacesWorkspaces\');" style="cursor:pointer;">' . $this->iconFactory->getIcon('apps-toolbar-menu-workspace', Icon::SIZE_SMALL)->render() . '</span>' . $wsTitle . '</div>';
     } else {
         $workspaceInfo = '';
     }
     return $workspaceInfo;
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:15,代码来源:PageTreeNavigationController.php

示例13: renderToggleEditLock

 /**
  * Print the string with the new edit lock state of a page record
  *
  * @param int $page The TYPO3 page id
  * @param string $editLockState The state of the TYPO3 page (locked, unlocked)
  * @return string The new edit lock string wrapped in HTML
  */
 protected function renderToggleEditLock($page, $editLockState)
 {
     $page = (int) $page;
     if ($editLockState === 1) {
         $ret = '<span id="el_' . $page . '"><a class="editlock btn btn-default" data-page="' . $page . '" data-lockstate="1" title="The page and all content is locked for editing by all non-Admin users.">' . $this->iconFactory->getIcon('actions-lock', Icon::SIZE_SMALL)->render() . '</a></span>';
     } else {
         $ret = '<span id="el_' . $page . '"><a class="editlock btn btn-default" data-page="' . $page . '" data-lockstate="0" title="Enable the &raquo;Admin-only&laquo; edit lock for this page">' . $this->iconFactory->getIcon('actions-unlock', Icon::SIZE_SMALL)->render() . '</a></span>';
     }
     return $ret;
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:17,代码来源:PermissionAjaxController.php

示例14: renderPossibleRecordsSelectorTypeSelect

    /**
     * Get a selector as used for the select type, to select from all available
     * records and to create a relation to the embedding record (e.g. like MM).
     *
     * @param array $selItems Array of all possible records
     * @param array $conf TCA configuration of the parent(!) field
     * @param array $PA An array with additional configuration options
     * @param array $uniqueIds The uids that have already been used and should be unique
     * @return string A HTML <select> box with all possible records
     */
    protected function renderPossibleRecordsSelectorTypeSelect($selItems, $conf, &$PA, $uniqueIds = array())
    {
        $foreign_table = $conf['foreign_table'];
        $foreign_selector = $conf['foreign_selector'];
        $PA = array();
        $PA['fieldConf'] = $GLOBALS['TCA'][$foreign_table]['columns'][$foreign_selector];
        $PA['fieldTSConfig'] = FormEngineUtility::getTSconfigForTableRow($foreign_table, array(), $foreign_selector);
        $config = $PA['fieldConf']['config'];
        $item = '';
        // @todo $disabled is not present - should be read from config?
        $disabled = false;
        if (!$disabled) {
            $nameObject = $this->inlineStackProcessor->getCurrentStructureDomObjectIdPrefix($this->data['inlineFirstPid']);
            // Create option tags:
            $opt = array();
            foreach ($selItems as $p) {
                if (!in_array($p[1], $uniqueIds)) {
                    $opt[] = '<option value="' . htmlspecialchars($p[1]) . '">' . htmlspecialchars($p[0]) . '</option>';
                }
            }
            // Put together the selector box:
            $itemListStyle = isset($config['itemListStyle']) ? ' style="' . htmlspecialchars($config['itemListStyle']) . '"' : '';
            $size = (int) $conf['size'];
            $size = $conf['autoSizeMax'] ? MathUtility::forceIntegerInRange(count($selItems) + 1, MathUtility::forceIntegerInRange($size, 1), $conf['autoSizeMax']) : $size;
            $onChange = 'return inline.importNewRecord(' . GeneralUtility::quoteJSvalue($nameObject . '-' . $conf['foreign_table']) . ')';
            $item = '
				<select id="' . $nameObject . '-' . $conf['foreign_table'] . '_selector" class="form-control"' . ($size ? ' size="' . $size . '"' : '') . ' onchange="' . htmlspecialchars($onChange) . '"' . $PA['onFocus'] . $itemListStyle . ($conf['foreign_unique'] ? ' isunique="isunique"' : '') . '>
					' . implode('', $opt) . '
				</select>';
            if ($size <= 1) {
                // Add a "Create new relation" link for adding new relations
                // This is necessary, if the size of the selector is "1" or if
                // there is only one record item in the select-box, that is selected by default
                // The selector-box creates a new relation on using an onChange event (see some line above)
                if (!empty($conf['appearance']['createNewRelationLinkTitle'])) {
                    $createNewRelationText = $this->getLanguageService()->sL($conf['appearance']['createNewRelationLinkTitle'], true);
                } else {
                    $createNewRelationText = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.createNewRelation', true);
                }
                $item .= '
				<span class="input-group-btn">
					<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($onChange) . '" title="' . $createNewRelationText . '">
						' . $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render() . $createNewRelationText . '
					</a>
				</span>';
            } else {
                $item .= '
				<span class="input-group-btn btn"></span>';
            }
            // Wrap the selector and add a spacer to the bottom
            $item = '<div class="input-group form-group t3js-formengine-validation-marker ' . $this->inlineData['config'][$nameObject]['md5'] . '">' . $item . '</div>';
        }
        return $item;
    }
开发者ID:hlop,项目名称:TYPO3.CMS,代码行数:64,代码来源:InlineControlContainer.php

示例15: ext_makeToolBar

 /**
  * Creates the tool bar links for the "edit" section of the Admin Panel.
  *
  * @return string A string containing images wrapped in <a>-tags linking them to proper functions.
  */
 public function ext_makeToolBar()
 {
     $tsfe = $this->getTypoScriptFrontendController();
     //  If mod.web_list.newContentWiz.overrideWithExtension is set, use that extension's create new content wizard instead:
     $tsConfig = BackendUtility::getModTSconfig($tsfe->page['uid'], 'mod.web_list');
     $tsConfig = $tsConfig['properties']['newContentWiz.']['overrideWithExtension'];
     $newContentWizScriptPath = ExtensionManagementUtility::isLoaded($tsConfig) ? ExtensionManagementUtility::extRelPath($tsConfig) . 'mod1/db_new_content_el.php?' : BackendUtility::getModuleUrl('new_content_element') . '&';
     $perms = $this->getBackendUser()->calcPerms($tsfe->page);
     $langAllowed = $this->getBackendUser()->checkLanguageAccess($tsfe->sys_language_uid);
     $id = $tsfe->id;
     $returnUrl = GeneralUtility::getIndpEnv('REQUEST_URI');
     $icon = $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL)->render();
     $link = BackendUtility::getModuleUrl('record_history', array('element' => 'pages:' . $id, 'returnUrl' => $returnUrl));
     $toolBar = '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '#latest" title="' . $this->extGetLL('edit_recordHistory') . '">' . $icon . '</a>';
     if ($perms & Permission::CONTENT_EDIT && $langAllowed) {
         $params = '';
         if ($tsfe->sys_language_uid) {
             $params = '&sys_language_uid=' . $tsfe->sys_language_uid;
         }
         $icon = $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render();
         $link = $newContentWizScriptPath . 'id=' . $id . $params . '&returnUrl=' . rawurlencode($returnUrl);
         $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '" title="' . $this->extGetLL('edit_newContentElement') . '"">' . $icon . '</a>';
     }
     if ($perms & Permission::PAGE_EDIT) {
         $icon = $this->iconFactory->getIcon('actions-document-move', Icon::SIZE_SMALL)->render();
         $link = BackendUtility::getModuleUrl('move_element', ['table' => 'pages', 'uid' => $id, 'returnUrl' => $returnUrl]);
         $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($link) . '" title="' . $this->extGetLL('edit_move_page') . '">' . $icon . '</a>';
     }
     if ($perms & Permission::PAGE_NEW) {
         $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars(BackendUtility::getModuleUrl('db_new', ['id' => $id, 'pagesOnly' => 1, 'returnUrl' => $returnUrl])) . '" title="' . $this->extGetLL('edit_newPage') . '">' . $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL)->render() . '</a>';
     }
     if ($perms & Permission::PAGE_EDIT) {
         $icon = $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render();
         $url = BackendUtility::getModuleUrl('record_edit', array('edit[pages][' . $id . ']' => 'edit', 'noView' => 1, 'returnUrl' => $returnUrl));
         $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars($url) . '">' . $icon . '</a>';
         if ($tsfe->sys_language_uid && $langAllowed) {
             $row = $this->getDatabaseConnection()->exec_SELECTgetSingleRow('uid,pid,t3ver_state', 'pages_language_overlay', 'pid=' . (int) $id . ' AND sys_language_uid=' . $tsfe->sys_language_uid . $tsfe->sys_page->enableFields('pages_language_overlay'));
             $tsfe->sys_page->versionOL('pages_language_overlay', $row);
             if (is_array($row)) {
                 $icon = '<span title="' . $this->extGetLL('edit_editPageOverlay', true) . '">' . $this->iconFactory->getIcon('mimetypes-x-content-page-language-overlay', Icon::SIZE_SMALL)->render() . '</span>';
                 $url = BackendUtility::getModuleUrl('record_edit', array('edit[pages_language_overlay][' . $row['uid'] . ']' => 'edit', 'noView' => 1, 'returnUrl' => $returnUrl));
                 $toolBar .= '<a href="' . htmlspecialchars($url) . '">' . $icon . '</a>';
             }
         }
     }
     if ($this->getBackendUser()->check('modules', 'web_list')) {
         $urlParams = array('id' => $id, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI'));
         $icon = '<span title="' . $this->extGetLL('edit_db_list', false) . '">' . $this->iconFactory->getIcon('actions-system-list-open', Icon::SIZE_SMALL)->render() . '</span>';
         $toolBar .= '<a class="t3-icon btn btn-default" href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_list', $urlParams)) . '">' . $icon . '</a>';
     }
     $toolBar = '<div class="toolbar btn-group" role="group">' . $toolBar . '</div>';
     return $toolBar;
 }
开发者ID:Gregpl,项目名称:TYPO3.CMS,代码行数:58,代码来源:AdminPanelView.php


注:本文中的TYPO3\CMS\Core\Imaging\IconFactory::getIcon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。