本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\IconUtility::getIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP IconUtility::getIcon方法的具体用法?PHP IconUtility::getIcon怎么用?PHP IconUtility::getIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Utility\IconUtility
的用法示例。
在下文中一共展示了IconUtility::getIcon方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main
*
* @return string
* @todo Define visibility
*/
public function main()
{
global $BACK_PATH;
global $tmpl, $tplRow, $theConstants;
$POST = GeneralUtility::_POST();
// Checking for more than one template an if, set a menu...
$manyTemplatesMenu = $this->pObj->templateMenu();
$template_uid = 0;
if ($manyTemplatesMenu) {
$template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
}
// BUGBUG: Should we check if the user may at all read and write template-records???
$bType = $this->pObj->MOD_SETTINGS['ts_browser_type'];
$existTemplate = $this->initialize_editor($this->pObj->id, $template_uid);
// initialize
if ($existTemplate) {
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('currentTemplate'), ' <img ' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], \TYPO3\CMS\Backend\Utility\IconUtility::getIcon('sys_template', $tplRow)) . ' align="top" /> <strong>' . $this->pObj->linkWrapTemplateTitle($tplRow['title'], $bType == 'setup' ? 'config' : 'constants') . '</strong>' . htmlspecialchars(trim($tplRow['sitetitle']) ? ' (' . $tplRow['sitetitle'] . ')' : ''));
if ($manyTemplatesMenu) {
$theOutput .= $this->pObj->doc->section('', $manyTemplatesMenu);
}
$theOutput .= $this->pObj->doc->spacer(10);
if ($POST['add_property'] || $POST['update_value'] || $POST['clear_object']) {
// add property
$line = '';
if (is_array($POST['data'])) {
$name = key($POST['data']);
if ($POST['data'][$name]['name'] !== '') {
// Workaround for this special case: User adds a key and submits by pressing the return key. The form however will use "add_property" which is the name of the first submit button in this form.
unset($POST['update_value']);
$POST['add_property'] = 'Add';
}
if ($POST['add_property']) {
$property = trim($POST['data'][$name]['name']);
if (preg_replace('/[^a-zA-Z0-9_\\.]*/', '', $property) != $property) {
$badPropertyMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('noSpaces') . '<br />' . $GLOBALS['LANG']->getLL('nothingUpdated'), $GLOBALS['LANG']->getLL('badProperty'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
$this->addFlashMessage($badPropertyMessage);
} else {
$pline = $name . '.' . $property . ' = ' . trim($POST['data'][$name]['propertyValue']);
$propertyAddedMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('propertyAdded'));
$this->addFlashMessage($propertyAddedMessage);
$line .= LF . $pline;
}
} elseif ($POST['update_value']) {
$pline = $name . ' = ' . trim($POST['data'][$name]['value']);
$updatedMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('valueUpdated'));
$this->addFlashMessage($updatedMessage);
$line .= LF . $pline;
} elseif ($POST['clear_object']) {
if ($POST['data'][$name]['clearValue']) {
$pline = $name . ' >';
$objectClearedMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('objectCleared'));
$this->addFlashMessage($objectClearedMessage);
$line .= LF . $pline;
}
}
}
if ($line) {
$saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
// Set the data to be saved
$recData = array();
$field = $bType == 'setup' ? 'config' : 'constants';
$recData['sys_template'][$saveId][$field] = $tplRow[$field] . $line;
// Create new tce-object
$tce = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
$tce->stripslashes_values = 0;
// Initialize
$tce->start($recData, array());
// Saved the stuff
$tce->process_datamap();
// Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
$tce->clear_cacheCmd('all');
// re-read the template ...
$this->initialize_editor($this->pObj->id, $template_uid);
}
}
}
$tsbr = GeneralUtility::_GET('tsbr');
$update = 0;
if (is_array($tsbr)) {
// If any plus-signs were clicked, it's registred.
$this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType] = $tmpl->ext_depthKeys($tsbr, $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType]);
$update = 1;
}
if ($POST['Submit']) {
// If any POST-vars are send, update the condition array
$this->pObj->MOD_SETTINGS['tsbrowser_conditions'] = $POST['conditions'];
$update = 1;
}
if ($update) {
$GLOBALS['BE_USER']->pushModuleData($this->pObj->MCONF['name'], $this->pObj->MOD_SETTINGS);
}
$tmpl->matchAlternative = $this->pObj->MOD_SETTINGS['tsbrowser_conditions'];
$tmpl->matchAlternative[] = 'dummydummydummydummydummydummydummydummydummydummydummy';
// This is just here to make sure that at least one element is in the array so that the tsparser actually uses this array to match.
//.........这里部分代码省略.........
开发者ID:khanhdeux,项目名称:typo3test,代码行数:101,代码来源:TypoScriptTemplateObjectBrowserModuleFunctionController.php
示例2: getDummyIconPath
private function getDummyIconPath()
{
$icon = IconUtility::getIcon('tx_news_domain_model_tag');
return IconUtility::skinImg('', $icon, '', 1);
}
示例3: getIconImage
/**
* Returns an icon image tag, 18x16 pixels, based on input information.
* This function is recommended to use in your backend modules.
* Usage: 60
*
* @param string The table name
* @param array The table row ("enablefields" are at least needed for correct icon display and for pages records some more fields in addition!)
* @param string The backpath to the main TYPO3 directory (relative path back to PATH_typo3)
* @param string Additional attributes for the image tag
* @param boolean If set, the icon will be grayed/shaded
* @return string <img>-tag
* @see getIcon()
*/
public function getIconImage($table, $row = array(), $backPath, $params = '', $shaded = FALSE)
{
$str = '<img' . $this->skinImg($backPath, \TYPO3\CMS\Backend\Utility\IconUtility::getIcon($table, $row, $shaded), 'width="18" height="16"') . (trim($params) ? ' ' . trim($params) : '');
if (!stristr($str, 'alt="')) {
$str .= ' alt=""';
}
$str .= ' />';
return $str;
}
示例4: getIcon
/**
* Return the icon for a record - just a wrapper for two functions from t3lib_iconWorks
*
* @param array $row The record to get the icon for
* @return string The path to the icon
*/
protected function getIcon($row)
{
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getIcon($this->mmForeignTable ? $this->mmForeignTable : $this->table, $row);
return \TYPO3\CMS\Backend\Utility\IconUtility::skinImg('', $icon, '', 1);
}
示例5: getDummyIconPath
private function getDummyIconPath()
{
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getIcon('tx_news_domain_model_tag');
return \TYPO3\CMS\Backend\Utility\IconUtility::skinImg('', $icon, '', 1);
}
示例6: linkWrapItems
/**
* Returns the title (based on $code) of a record (from table $table) with the proper link around (that is for "pages"-records a link to the level of that record...)
*
* @param string $table Table name
* @param integer $uid UID (not used here)
* @param string $code Title string
* @param array $row Records array (from table name)
* @return string
* @todo Define visibility
*/
public function linkWrapItems($table, $uid, $code, $row)
{
if (!$code) {
$code = '<i>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title', 1) . ']</i>';
} else {
$code = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitlePrep($code, $this->fixedL);
}
$title = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle($table, $row, FALSE, TRUE);
$ficon = \TYPO3\CMS\Backend\Utility\IconUtility::getIcon($table, $row);
$aOnClick = 'return insertElement(\'' . $table . '\', \'' . $row['uid'] . '\', \'db\', ' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($title) . ', \'\', \'\', \'' . $ficon . '\');';
$ATag = '<a href="#" onclick="' . $aOnClick . '">';
$ATag_alt = substr($ATag, 0, -4) . ',\'\',1);">';
$ATag_e = '</a>';
return $ATag . '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/plusbullet2.gif', 'width="18" height="16"') . ' title="' . $GLOBALS['LANG']->getLL('addToList', 1) . '" alt="" />' . $ATag_e . $ATag_alt . $code . $ATag_e;
}
示例7: expandPageRecords
/**
* For RTE: This displays all content elements on a page and lets you create a link to the element.
*
* @return string HTML output. Returns content only if the ->expandPage value is set (pointing to a page uid to show tt_content records from ...)
*/
protected function expandPageRecords()
{
$out = '';
if ($this->expandPage >= 0 && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->expandPage) && $GLOBALS['BE_USER']->isInWebMount($this->expandPage)) {
$tables = '*';
if (isset($this->configuration['listTables'])) {
$tables = $this->configuration['listTables'];
}
// Set array with table names to list:
if (!strcmp(trim($tables), '*')) {
$tablesArr = array_keys($GLOBALS['TCA']);
} else {
$tablesArr = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $tables, 1);
}
reset($tablesArr);
// Headline for selecting records:
$out .= $this->browseLinksObj->barheader($GLOBALS['LANG']->getLL('selectRecords') . ':');
// Create the header, showing the current page for which the listing is. Includes link to the page itself, if pages are amount allowed tables.
$titleLen = intval($GLOBALS['BE_USER']->uc['titleLen']);
$mainPageRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL('pages', $this->expandPage);
$aTag = '';
$aTagEnd = '';
$aTag2 = '';
if (in_array('pages', $tablesArr)) {
$ficon = \TYPO3\CMS\Backend\Utility\IconUtility::getIcon('pages', $mainPageRec);
$aTag = "<a href=\"#\" onclick=\"return insertElement('pages', '" . $mainPageRec['uid'] . "', 'db', " . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($mainPageRec['title']) . ", '', '', '" . $ficon . "', '',1);\">";
$aTag2 = "<a href=\"#\" onclick=\"return insertElement('pages', '" . $mainPageRec['uid'] . "', 'db', " . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($mainPageRec['title']) . ", '', '', '" . $ficon . "', '',0);\">";
$aTagEnd = '</a>';
}
$picon = \TYPO3\CMS\Backend\Utility\IconUtility::getIconImage('pages', $mainPageRec, $GLOBALS['BACK_PATH'], '');
$pBicon = $aTag2 ? '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/plusbullet2.gif', 'width="18" height="16"') . ' alt="" />' : '';
$pText = htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($mainPageRec['title'], $titleLen));
$out .= $picon . $aTag2 . $pBicon . $aTagEnd . $aTag . $pText . $aTagEnd . '<br />';
// Initialize the record listing:
$id = $this->expandPage;
$pointer = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->pointer, 0, 100000);
$pagePermsClause = $GLOBALS['BE_USER']->getPagePermsClause(1);
$pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($id, $pagePermsClause);
// Generate the record list:
// unfortunately we have to set weird dependencies.
/** @var \AOE\Linkhandler\Record\ElementBrowserRecordList $dblist */
$dblist = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('AOE\\Linkhandler\\Record\\ElementBrowserRecordList');
$dblist->setAddPassOnParameters($this->addPassOnParams);
$dblist->browselistObj = $this->browseLinksObj;
$dblist->backPath = $GLOBALS['BACK_PATH'];
$dblist->thumbs = 0;
$dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageinfo);
$dblist->noControlPanels = 1;
$dblist->clickMenuEnabled = 0;
$dblist->tableList = implode(',', $tablesArr);
if (array_key_exists('overwriteHandler', $this->configuration)) {
$dblist->setOverwriteLinkHandler($this->configuration['overwriteHandler']);
}
$dblist->start($id, \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('table'), $pointer, \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('search_field'), \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('search_levels'), \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('showLimit'));
$dblist->setDispFields();
$dblist->generateList();
$dblist->writeBottom();
// Add the HTML for the record list to output variable:
$out .= $dblist->HTMLcode;
$out .= $dblist->getSearchBox();
}
return $out;
}
示例8: getShortcutIcon
/**
* Gets the icon for the shortcut
*
* @param array $row
* @param array $shortcut
* @return string Shortcut icon as img tag
*/
protected function getShortcutIcon($row, $shortcut)
{
switch ($row['module_name']) {
case 'xMOD_alt_doc.php':
$table = $shortcut['table'];
$recordid = $shortcut['recordid'];
if ($shortcut['type'] == 'edit') {
// Creating the list of fields to include in the SQL query:
$selectFields = $this->fieldArray;
$selectFields[] = 'uid';
$selectFields[] = 'pid';
if ($table == 'pages') {
if (\TYPO3\CMS\Core\Extension\ExtensionManager::isLoaded('cms')) {
$selectFields[] = 'module';
$selectFields[] = 'extendToSubpages';
}
$selectFields[] = 'doktype';
}
if (is_array($GLOBALS['TCA'][$table]['ctrl']['enablecolumns'])) {
$selectFields = array_merge($selectFields, $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']);
}
if ($GLOBALS['TCA'][$table]['ctrl']['type']) {
$selectFields[] = $GLOBALS['TCA'][$table]['ctrl']['type'];
}
if ($GLOBALS['TCA'][$table]['ctrl']['typeicon_column']) {
$selectFields[] = $GLOBALS['TCA'][$table]['ctrl']['typeicon_column'];
}
if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
$selectFields[] = 't3ver_state';
}
// Unique list!
$selectFields = array_unique($selectFields);
$permissionClause = $table == 'pages' && $this->perms_clause ? ' AND ' . $this->perms_clause : '';
$sqlQueryParts = array('SELECT' => implode(',', $selectFields), 'FROM' => $table, 'WHERE' => 'uid IN (' . $recordid . ') ' . $permissionClause . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table) . \TYPO3\CMS\Backend\Utility\BackendUtility::versioningPlaceholderClause($table));
$result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($sqlQueryParts);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getIcon($table, $row, $this->backPath);
} elseif ($shortcut['type'] == 'new') {
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getIcon($table, '', $this->backPath);
}
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->backPath, $icon, '', 1);
break;
case 'xMOD_file_edit.php':
$icon = 'gfx/edit_file.gif';
break;
case 'xMOD_wizard_rte.php':
$icon = 'gfx/edit_rtewiz.gif';
break;
default:
if ($GLOBALS['LANG']->moduleLabels['tabs_images'][$row['module_name'] . '_tab']) {
$icon = $GLOBALS['LANG']->moduleLabels['tabs_images'][$row['module_name'] . '_tab'];
// Change icon of fileadmin references - otherwise it doesn't differ with Web->List
$icon = str_replace('mod/file/list/list.gif', 'mod/file/file.gif', $icon);
if (\TYPO3\CMS\Core\Utility\GeneralUtility::isAbsPath($icon)) {
$icon = '../' . substr($icon, strlen(PATH_site));
}
} else {
$icon = 'gfx/dummy_module.gif';
}
}
return '<img src="' . $icon . '" alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.shortcut', TRUE) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.shortcut', TRUE) . '" />';
}
示例9: getIcon
/**
* Return the icon for a record - just a wrapper for two functions from \TYPO3\CMS\Backend\Utility\IconUtility
*
* @param array $row The record to get the icon for
* @return string The path to the icon
*/
protected function getIcon($row)
{
$icon = IconUtility::getIcon($this->mmForeignTable ? $this->mmForeignTable : $this->table, $row);
return IconUtility::skinImg('', $icon, '', 1);
}
示例10: drawTableOfIndexedPages
/**
* Produces a table with indexing information for each page.
*
* @return string HTML output
* @todo Define visibility
*/
public function drawTableOfIndexedPages()
{
global $BACK_PATH;
// Drawing tree:
$tree = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\View\\PageTreeView');
$perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
$tree->init('AND ' . $perms_clause);
$HTML = '<img src="' . $BACK_PATH . \TYPO3\CMS\Backend\Utility\IconUtility::getIcon('pages', $this->pObj->pageinfo) . '" width="18" height="16" align="top" alt="" />';
$tree->tree[] = array('row' => $this->pObj->pageinfo, 'HTML' => $HTML);
if ($this->pObj->MOD_SETTINGS['depth']) {
$tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'], '');
}
// Traverse page tree:
$code = '';
foreach ($tree->tree as $data) {
$code .= $this->indexed_info($data['row'], $data['HTML'] . $this->showPageDetails(BackendUtility::getRecordTitlePrep($data['row']['title']), $data['row']['uid']));
}
if ($code) {
$code = '<br /><br />
<table border="0" cellspacing="1" cellpadding="2" class="c-list">' . $this->printPhashRowHeader() . $code . '</table>';
// Create section to output:
$theOutput .= $this->pObj->doc->section('', $code, 0, 1);
} else {
$theOutput .= $this->pObj->doc->section('', '<br /><br />' . $this->pObj->doc->icons(1) . 'There were no indexed pages found in the tree.<br /><br />', 0, 1);
}
return $theOutput;
}
示例11: renderListRow
/**
* Rendering a single row for the list
*
* @param string $table Table name
* @param array $row Current record
* @param int $cc Counter, counting for each time an element
* is rendered (used for alternating colors)
* @param string $titleCol Table field (column) where header value is found
* @param string $thumbsCol Table field (column) where (possible)
* thumbnails can be found
* @param int $indent Indent from left.
*
* @return string Table row for the element
* @see getTable()
*/
public function renderListRow($table, array $row, $cc, $titleCol, $thumbsCol, $indent = 0)
{
$backendUser = $this->getBackendUser();
$iOut = '';
$extConf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][COMMERCE_EXTKEY]['extConf'];
if (substr(TYPO3_version, 0, 3) >= '4.0') {
// In offline workspace, look for alternative record:
BackendUtility::workspaceOL($table, $row, $GLOBALS['BE_USER']->workspace);
}
$rowBackgroundColor = '';
if ($this->alternateBgColors) {
$rowBackgroundColor = $cc % 2 ? '' : ' bgcolor="' . GeneralUtility::modifyHTMLColor($GLOBALS['SOBE']->doc->bgColor4, 10, 10, 10) . '"';
}
if ($backendUser->getModuleData('commerce_orders/index.php/userid', 'ses') == $row['uid']) {
$rowBackgroundColor = ' bgcolor="' . GeneralUtility::modifyHTMLColor($GLOBALS['SOBE']->doc->bgColor4, 30, 30, 30) . '"';
}
// Overriding with versions background color if any:
$rowBackgroundColor = $row['_CSSCLASS'] ? ' class="' . $row['_CSSCLASS'] . '"' : $rowBackgroundColor;
// Initialization
$alttext = BackendUtility::getRecordIconAltText($row, $table);
// Incr. counter.
$this->counter++;
// The icon with link
$iconImg = IconUtility::skinImg($this->backPath, IconUtility::getIcon($table, $row), 'title="' . htmlspecialchars($alttext) . '"' . ($indent ? ' style="margin-left: ' . $indent . 'px;"' : ''));
$theIcon = $this->clickMenuEnabled ? $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, $table, $row['uid']) : $iconImg;
// Preparing and getting the data-array
$theData = array();
foreach ($this->fieldArray as $fCol) {
if ($fCol == 'pid') {
$theData[$fCol] = $row[$fCol];
}
if ($fCol == 'username') {
$theData[$fCol] = $row[$fCol];
} elseif ($fCol == 'crdate') {
$theData[$fCol] = BackendUtility::date($row[$fCol]);
} elseif ($fCol == '_PATH_') {
$theData[$fCol] = $this->recPath($row['pid']);
} elseif ($fCol == '_CONTROL_') {
$theData[$fCol] = $this->makeControl($table, $row);
} elseif ($fCol == '_CLIPBOARD_') {
$theData[$fCol] = $this->makeClip($table, $row);
} elseif ($fCol == '_LOCALIZATION_') {
list($lC1, $lC2) = $this->makeLocalizationPanel($table, $row);
$theData[$fCol] = $lC1;
$theData[$fCol . 'b'] = $lC2;
} elseif ($fCol == '_LOCALIZATION_b') {
// Do nothing, has been done above.
$theData[$fCol] .= '';
} else {
/**
* Use own method, if typo3 4.0.0 is not installed
*/
if (substr(TYPO3_version, 0, 3) >= '4.0') {
$theData[$fCol] = $this->linkUrlMail(htmlspecialchars(BackendUtility::getProcessedValueExtra($table, $fCol, $row[$fCol], 100, $row['uid'])), $row[$fCol]);
} else {
$theData[$fCol] = $this->myLinkUrlMail(htmlspecialchars(BackendUtility::getProcessedValueExtra($table, $fCol, $row[$fCol], 100, $row['uid'])), $row[$fCol]);
}
}
}
// Add row to CSV list:
if ($this->csvOutput) {
// Charset Conversion
/**
* Charset converter
*
* @var \TYPO3\CMS\Core\Charset\CharsetConverter $csObj
*/
$csObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Charset\\CharsetConverter');
$csObj->initCharset($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']);
if (!$extConf['BECSVCharset']) {
$extConf['BECSVCharset'] = 'iso-8859-1';
}
$csObj->initCharset($extConf['BECSVCharset']);
$csObj->convArray($row, $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'], $extConf['BECSVCharset']);
$this->addToCSV($row);
}
// Create element in table cells:
$iOut .= $this->addelement(1, $theIcon, $theData, $rowBackgroundColor);
// Render thumbsnails if a thumbnail column exists and there is content in it:
if ($this->thumbs && trim($row[$thumbsCol])) {
$iOut .= $this->addelement(4, '', array($titleCol => $this->thumbCode($row, $table, $thumbsCol)), $rowBackgroundColor);
}
// Finally, return table row element:
return $iOut;
}
示例12: showCopyWizard
/**
* Shows the copy wizard.
*
* @param int $uidClip Uid of the clipped item
* @param int $uidTarget Uid of target
* @param string $command Command
*/
protected function showCopyWizard($uidClip, $uidTarget, $command)
{
$language = $this->getLanguageService();
$str = '';
$this->pageinfo = BackendUtility::readCategoryAccess($uidTarget, BackendUtility::getCategoryPermsClause(1));
$str .= $this->doc->header($language->getLL('Copy'));
$str .= $this->doc->spacer(5);
// flag if neither sorting nor localizations
// are existing and we can immediately copy
$noActionReq = false;
// First prepare user defined hooks
$hooks = \CommerceTeam\Commerce\Factory\HookFactory::getHooks('Utility/DataHandlerUtility', 'showCopyWizard');
switch ($command) {
case 'overwrite':
// pass through
// pass through
case 'pasteProduct':
// chose local to copy from product
/**
* Product.
*
* @var \CommerceTeam\Commerce\Domain\Model\Product $product
*/
$product = GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Domain\\Model\\Product', $uidClip);
$product->loadData();
$prods = $product->getL18nProducts();
if (!empty($prods)) {
$str .= '<h1>' . $language->getLL('copy.head.l18n') . '</h1>
<h2>' . $language->getLL('copy.product') . ': ' . $product->getTitle() . '</h2>
<ul>';
// walk the l18n and get the selector box
$l = count($prods);
for ($i = 0; $i < $l; ++$i) {
$tmpProd = $prods[$i];
$flag = $tmpProd['flag'] != '' ? '<img src="' . $this->getBackPath() . 'gfx/flags/' . $tmpProd['flag'] . '" alt="Flag" />' : '';
$str .= '<li><input type="checkbox" name="locale[]" id="loc_' . $tmpProd['uid'] . '" value="' . $tmpProd['sys_language'] . '" /><label for="loc_' . $tmpProd['uid'] . '">' . $flag . $tmpProd['title'] . '</label></li>';
}
$str .= '</ul>';
}
$records = array();
// chose sorting position
if ($command != 'overwrite') {
// Initialize tree object:
/**
* Product data.
*
* @var \CommerceTeam\Commerce\Tree\Leaf\ProductData $productData
*/
$productData = GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Tree\\Leaf\\ProductData');
$productData->init();
$records = $productData->getRecordsDbList($uidTarget);
}
$l = count($records['pid'][$uidTarget]);
// Hook: beforeFormClose
$userIgnoreClose = false;
foreach ($hooks as $hookObj) {
if (method_exists($hookObj, 'beforeFormClose')) {
// set $user_ignoreClose to true if you want to
// force the script to print out the execute button
$str .= $hookObj->beforeFormClose($uidClip, $uidTarget, $command, $userIgnoreClose);
}
}
if (0 >= $l && (!empty($prods) || $userIgnoreClose)) {
// no child object - sorting position is irrelevant - just print a submit button
// and notify users that there are not products in the category yet
$str .= '<input type="submit" value="' . $language->getLL('copy.submit') . '" />';
} elseif (0 < $l) {
// at least 1 item - offer choice
$icon = '<img' . IconUtility::skinImg($this->getBackPath(), 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' alt="" title="Insert the category" />';
$prodIcon = '<img' . IconUtility::skinImg($this->getBackPath(), IconUtility::getIcon('tx_commerce_products', array('uid' => $uidTarget)), 'width="18" height="16"') . 'align="top" class="c-recIcon"/>';
$str .= '<h1>' . $language->getLL('copy.position') . '</h1>';
$onClickAction = 'onclick="submitForm(' . $records['pid'][$uidTarget][0]['uid'] . ')"';
$str .= '<span class="nobr"><a href="javascript:void(0)" ' . $onClickAction . '>' . $icon . '</a></span><br />';
for ($i = 0; $i < $l; ++$i) {
$record = $records['pid'][$uidTarget][$i];
$onClickAction = 'onclick="submitForm(-' . $record['uid'] . ')"';
$str .= '<span class="nobr">' . $prodIcon . $record['title'] . '</span><br />';
$str .= '<span class="nobr"><a href="javascript:void(0)" ' . $onClickAction . '>' . $icon . '</a></span><br />';
}
} else {
$noActionReq = true;
}
break;
case 'pasteCategory':
// chose locale to copy from category
/**
* Category.
*
* @var \CommerceTeam\Commerce\Domain\Model\Category $category
*/
$category = GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Domain\\Model\\Category', $uidClip);
$category->loadData();
$cats = $category->getL18nCategories();
//.........这里部分代码省略.........
示例13: renderListRow
/**
* Rendering a single row for the list.
*
* @param string $table Table name
* @param array $row Current record
* @param int $cc Counter, counting for each time an element is rendered
* (used for alternating colors)
* @param string $titleCol Table field (column) where header value is found
* @param string $thumbsCol Table field (column) where (possible) thumbnails
* can be found
* @param int $indent Indent from left.
*
* @return string Table row for the element
*/
public function renderListRow($table, array $row, $cc, $titleCol, $thumbsCol, $indent = 0)
{
$database = $this->getDatabaseConnection();
$language = $this->getLanguageService();
$iOut = '';
if (substr(TYPO3_version, 0, 3) >= '4.0') {
// In offline workspace, look for alternative record:
BackendUtility::workspaceOL($table, $row, $this->getBackendUser()->workspace);
}
// Background color, if any:
$rowBackgroundColor = '';
if ($this->alternateBgColors) {
$rowBackgroundColor = $cc % 2 ? '' : ' bgcolor="' . GeneralUtility::modifyHTMLColor($this->getControllerDocumentTemplate()->bgColor4, 10, 10, 10) . '"';
}
// Overriding with versions background color if any:
$rowBackgroundColor = $row['_CSSCLASS'] ? ' class="' . $row['_CSSCLASS'] . '"' : $rowBackgroundColor;
// Initialization
$alttext = BackendUtility::getRecordIconAltText($row, $table);
// Incr. counter.
++$this->counter;
$indentStyle = $indent ? ' style="margin-left: ' . $indent . 'px;"' : '';
$iconAttributes = 'title="' . htmlspecialchars($alttext) . '"' . $indentStyle;
// Icon for order comment and delivery address
$iconPath = '';
$iconImg = '';
if ($row['comment'] != '' && $row['internalcomment'] != '') {
if ($row['tx_commerce_address_type_id'] == 2) {
$iconPath = 'orders_add_user_int.gif';
} else {
$iconPath = 'orders_user_int.gif';
}
} elseif ($row['comment'] != '') {
if ($row['tx_commerce_address_type_id'] == 2) {
$iconPath = 'orders_add_user.gif';
} else {
$iconPath = 'orders_user.gif';
}
} elseif ($row['internalcomment'] != '') {
if ($row['tx_commerce_address_type_id'] == 2) {
$iconPath = 'orders_add_int.gif';
} else {
$iconPath = 'orders_int.gif';
}
} else {
if ($row['tx_commerce_address_type_id'] == 2) {
$iconPath = 'orders_add.gif';
} else {
$iconImg = '<img ' . IconUtility::skinImg($this->backPath, IconUtility::getIcon($table, $row), $iconAttributes) . ' />';
}
}
if ($iconPath != '') {
$iconImg = '<img' . IconUtility::skinImg($this->backPath, PATH_TXCOMMERCE_REL . 'Resources/Public/Icons/Table/' . $iconPath, $iconAttributes) . '/>';
}
$theIcon = $this->clickMenuEnabled ? $this->getControllerDocumentTemplate()->wrapClickMenuOnIcon($iconImg, $table, $row['uid']) : $iconImg;
// Preparing and getting the data-array
$theData = array();
foreach ($this->fieldArray as $fCol) {
if ($fCol == 'pid') {
$theData[$fCol] = $row[$fCol];
} elseif ($fCol == 'sum_price_gross') {
if ($this->csvOutput) {
$row[$fCol] = $row[$fCol] / 100;
} else {
$theData[$fCol] = \CommerceTeam\Commerce\ViewHelpers\Money::format($row[$fCol], $row['cu_iso_3'], false);
}
} elseif ($fCol == 'crdate') {
$theData[$fCol] = BackendUtility::date($row[$fCol]);
$row[$fCol] = BackendUtility::date($row[$fCol]);
} elseif ($fCol == 'tstamp') {
$theData[$fCol] = BackendUtility::date($row[$fCol]);
$row[$fCol] = BackendUtility::date($row[$fCol]);
} elseif ($fCol == 'articles') {
$articleNumber = array();
$articleName = array();
$resArticles = $database->exec_SELECTquery('article_number, title, order_uid', 'tx_commerce_order_articles', 'order_uid = ' . (int) $row['uid']);
$articles = array();
while ($lokalRow = $database->sql_fetch_assoc($resArticles)) {
$articles[] = $lokalRow['article_number'] . ':' . $lokalRow['title'];
$articleNumber[] = $lokalRow['article_number'];
$articleName[] = $lokalRow['title'];
}
if ($this->csvOutput) {
$theData[$fCol] = implode(',', $articles);
$row[$fCol] = implode(',', $articles);
} else {
$theData[$fCol] = '<input type="checkbox" name="orderUid[]" value="' . $row['uid'] . '">';
//.........这里部分代码省略.........
示例14: getIcon
/**
* Creates the icon image tag for record from table and wraps it in a link which will trigger the click menu.
*
* @param string Table name
* @param array Record array
* @param string Record title (NOT USED)
* @return string HTML for the icon
*/
function getIcon($table, $row, $noEdit)
{
// Initialization
$alttext = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordIconAltText($row, $table);
$iconImg = '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->backPath, \TYPO3\CMS\Backend\Utility\IconUtility::getIcon($table, $row), 'width="18" height="16"') . 'title="' . $alttext . '"';
$iconImg .= ' />';
$this->counter++;
$disableList = '';
if ($noEdit) {
$disableList = '+info,copy';
}
// The icon with link
$theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, $table, $row['uid'], '', '', $disableList);
return $theIcon;
}