本文整理汇总了PHP中t3lib_iconWorks::getIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_iconWorks::getIcon方法的具体用法?PHP t3lib_iconWorks::getIcon怎么用?PHP t3lib_iconWorks::getIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_iconWorks
的用法示例。
在下文中一共展示了t3lib_iconWorks::getIcon方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTable
/**
* Creates the listing of records from a single table
*
* @param string Table name
* @param integer Page id
* @param string List of fields to show in the listing. Pseudo fields will be added including the record header.
* @return string HTML table with the listing for the record.
*/
function getTable($table, $rowlist)
{
global $TCA, $BACK_PATH, $LANG;
// Loading all TCA details for this table:
t3lib_div::loadTCA($table);
// Init
$addWhere = '';
$titleCol = $TCA[$table]['ctrl']['label'];
$thumbsCol = $TCA[$table]['ctrl']['thumbnail'];
$l10nEnabled = $TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField'] && !$TCA[$table]['ctrl']['transOrigPointerTable'];
$selFieldList = $this->getSelFieldList($table, $rowlist);
$dbCount = 0;
if ($this->pointer->countTotal and $this->res) {
$dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($this->res);
}
$shEl = $this->showElements;
$out = '';
if ($dbCount) {
// half line is drawn
$theData = array();
if (!$this->table && !$rowlist) {
$theData[$titleCol] = '<img src="clear.gif" width="' . ($GLOBALS['SOBE']->MOD_SETTINGS['bigControlPanel'] ? '230' : '350') . '" height="1">';
if (in_array('_CONTROL_', $this->fieldArray)) {
$theData['_CONTROL_'] = '';
}
}
# $out.=$this->addelement('', $theData);
// Header line is drawn
$theData = array();
# $theData[$titleCol] = '<b>'.$GLOBALS['LANG']->sL($TCA[$table]['ctrl']['title'],1).'</b> ('.$this->resCount.')';
$theUpIcon = ' ';
// todo csh
# $theData[$titleCol].= t3lib_BEfunc::cshItem($table,'',$this->backPath,'',FALSE,'margin-bottom:0px; white-space: normal;');
# $out.=$this->addelement($theUpIcon, $theData, '', '', 'background-color:'.$this->headLineCol.'; border-bottom:1px solid #000');
// Fixing a order table for sortby tables
$this->currentTable = array();
$currentIdList = array();
$doSort = $TCA[$table]['ctrl']['sortby'] && !$this->sortField;
$prevUid = 0;
$prevPrevUid = 0;
$accRows = array();
// Accumulate rows here
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($this->res)) {
$accRows[] = $row;
$currentIdList[] = $row['uid'];
if ($doSort) {
if ($prevUid) {
$this->currentTable['prev'][$row['uid']] = $prevPrevUid;
$this->currentTable['next'][$prevUid] = '-' . $row['uid'];
$this->currentTable['prevUid'][$row['uid']] = $prevUid;
}
$prevPrevUid = isset($this->currentTable['prev'][$row['uid']]) ? -$prevUid : $row['pid'];
$prevUid = $row['uid'];
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($this->res);
// items
$itemContentTRows = '';
$this->duplicateStack = array();
$this->eCounter = $this->pointer->firstItemNum;
$cc = 0;
$itemContentTRows .= $this->fwd_rwd_nav('rwd');
foreach ($accRows as $row) {
$this->alternateBgColors = false;
$cc++;
$row_bgColor = $this->alternateBgColors ? $cc % 2 ? ' class="item"' : ' class="item" bgColor="' . t3lib_div::modifyHTMLColor($GLOBALS['SOBE']->doc->bgColor4, +10, +10, +10) . '"' : ' class="item"';
// Initialization
$iconfile = t3lib_iconWorks::getIcon($table, $row);
$alttext = t3lib_BEfunc::getRecordIconAltText($row, $table);
$recTitle = t3lib_BEfunc::getRecordTitle($table, $row, 1);
// The icon with link
$theIcon = '<img src="' . $this->backPath . $iconfile . '" width="18" height="16" border="0" title="' . $alttext . '" />';
$theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon, $table, $row['uid']);
$thumbImg = '';
if ($this->thumbs) {
$thumbImg = '<div style="margin:2px 0 2px 0;">' . $this->getThumbNail(tx_dam::path_makeAbsolute($row['file_path']) . $row['file_name']) . '</div>';
}
// Preparing and getting the data-array
$theData = array();
reset($this->fieldArray);
while (list(, $fCol) = each($this->fieldArray)) {
if ($fCol == $titleCol) {
$theData[$fCol] = $this->linkWrapItems($table, $row['uid'], $recTitle, $row) . $thumbImg;
} elseif ($fCol == 'pid') {
$theData[$fCol] = $row[$fCol];
} elseif ($fCol == '_CONTROL_') {
$theData[$fCol] = $this->makeControl($table, $row);
} else {
$theData[$fCol] = t3lib_BEfunc::getProcessedValueExtra($table, $fCol, $row[$fCol], 100);
}
}
$actionIcon = '';
//.........这里部分代码省略.........
示例2: getShortcutIcon
/**
* gets the icon for the shortcut
*
* @param string backend module name
* @return string shortcut icon as img tag
*/
protected function getShortcutIcon($row, $shortcut)
{
global $TCA;
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 (t3lib_extMgm::isLoaded('cms')) {
$selectFields[] = 'module';
$selectFields[] = 'extendToSubpages';
}
$selectFields[] = 'doktype';
}
if (is_array($TCA[$table]['ctrl']['enablecolumns'])) {
$selectFields = array_merge($selectFields, $TCA[$table]['ctrl']['enablecolumns']);
}
if ($TCA[$table]['ctrl']['type']) {
$selectFields[] = $TCA[$table]['ctrl']['type'];
}
if ($TCA[$table]['ctrl']['typeicon_column']) {
$selectFields[] = $TCA[$table]['ctrl']['typeicon_column'];
}
if ($TCA[$table]['ctrl']['versioningWS']) {
$selectFields[] = 't3ver_state';
}
$selectFields = array_unique($selectFields);
// Unique list!
$permissionClause = $table == 'pages' && $this->perms_clause ? ' AND ' . $this->perms_clause : '';
$sqlQueryParts = array('SELECT' => implode(',', $selectFields), 'FROM' => $table, 'WHERE' => 'uid IN (' . $recordid . ') ' . $permissionClause . t3lib_BEfunc::deleteClause($table) . t3lib_BEfunc::versioningPlaceholderClause($table));
$result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($sqlQueryParts);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
$icon = t3lib_iconWorks::getIcon($table, $row, $this->backPath);
} elseif ($shortcut['type'] == 'new') {
$icon = t3lib_iconWorks::getIcon($table, '', $this->backPath);
}
$icon = t3lib_iconWorks::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 (t3lib_div::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) . '" />';
}
示例3: getContentTree_element
/**
* Returns the content tree (based on the data structure) for a certain page or a flexible content element. In case of a page it will contain all the references
* to content elements (and some more information) and in case of a FCE, references to its sub-elements.
*
* @param string $table: Table which contains the (XML) data structure. Only records from table 'pages' or flexible content elements from 'tt_content' are handled
* @param array $row: Record of the root element where the tree starts (Possibly overlaid with workspace content)
* @param array $tt_content_elementRegister: Register of used tt_content elements, don't mess with it! (passed by reference since data is built up)
* @param string $prevRecList: comma separated list of uids, used internally for recursive calls. Don't mess with it!
* @return array The content tree
* @access protected
*/
function getContentTree_element($table, $row, &$tt_content_elementRegister, $prevRecList = '')
{
global $TCA, $LANG;
$tree = array();
$tree['el'] = array('table' => $table, 'uid' => $row['uid'], 'pid' => $row['pid'], '_ORIG_uid' => $row['_ORIG_uid'], 'title' => t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($table, $row), 50), 'icon' => t3lib_iconWorks::getIcon($table, $row), 'sys_language_uid' => $row['sys_language_uid'], 'l18n_parent' => $row['l18n_parent'], 'CType' => $row['CType']);
if ($this->includePreviewData) {
$tree['previewData'] = array('fullRow' => $row);
}
// If element is a Flexible Content Element (or a page) then look at the content inside:
if ($table == 'pages' || $table == $this->rootTable || $table == 'tt_content' && $row['CType'] == 'templavoila_pi1') {
t3lib_div::loadTCA($table);
$rawDataStructureArr = t3lib_BEfunc::getFlexFormDS($TCA[$table]['columns']['tx_templavoila_flex']['config'], $row, $table);
$expandedDataStructureArr = $this->ds_getExpandedDataStructure($table, $row);
switch ($table) {
case 'pages':
$currentTemplateObject = $this->getContentTree_fetchPageTemplateObject($row);
break;
case 'tt_content':
$currentTemplateObject = t3lib_beFunc::getRecordWSOL('tx_templavoila_tmplobj', $row['tx_templavoila_to']);
break;
default:
$currentTemplateObject = FALSE;
}
if (is_array($currentTemplateObject)) {
$templateMappingArr = unserialize($currentTemplateObject['templatemapping']);
}
$tree['ds_is_found'] = is_array($rawDataStructureArr);
$tree['ds_meta'] = $rawDataStructureArr['meta'];
$flexformContentArr = t3lib_div::xml2array($row['tx_templavoila_flex']);
if (!is_array($flexformContentArr)) {
$flexformContentArr = array();
}
// Respect the currently selected language, for both concepts - with langChildren enabled and disabled:
$langChildren = intval($tree['ds_meta']['langChildren']);
$langDisable = intval($tree['ds_meta']['langDisable']);
$lKeys = $langDisable ? array('lDEF') : ($langChildren ? array('lDEF') : $this->allSystemWebsiteLanguages['all_lKeys']);
$vKeys = $langDisable ? array('vDEF') : ($langChildren ? $this->allSystemWebsiteLanguages['all_vKeys'] : array('vDEF'));
// Traverse each sheet in the FlexForm Structure:
foreach ($expandedDataStructureArr as $sheetKey => $sheetData) {
// Add some sheet meta information:
$tree['sub'][$sheetKey] = array();
$tree['contentFields'][$sheetKey] = array();
$tree['meta'][$sheetKey] = array('title' => is_array($sheetData) && $sheetData['ROOT']['TCEforms']['sheetTitle'] ? $LANG->sL($sheetData['ROOT']['TCEforms']['sheetTitle']) : '', 'description' => is_array($sheetData) && $sheetData['ROOT']['TCEforms']['sheetDescription'] ? $LANG->sL($sheetData['ROOT']['TCEforms']['sheetDescription']) : '', 'short' => is_array($sheetData) && $sheetData['ROOT']['TCEforms']['sheetShortDescr'] ? $LANG->sL($sheetData['ROOT']['TCEforms']['sheetShortDescr']) : '');
// Traverse the sheet's elements:
if (is_array($sheetData) && is_array($sheetData['ROOT']['el'])) {
foreach ($sheetData['ROOT']['el'] as $fieldKey => $fieldData) {
// Compile preview data:
if ($this->includePreviewData) {
$tree['previewData']['sheets'][$sheetKey][$fieldKey] = array('TCEforms' => $fieldData['TCEforms'], 'type' => $fieldData['type'], 'section' => $fieldData['section'], 'data' => array(), 'subElements' => array(), 'isMapped' => is_array($templateMappingArr['MappingInfo']['ROOT']['el'][$fieldKey]));
foreach ($lKeys as $lKey) {
foreach ($vKeys as $vKey) {
if (is_array($flexformContentArr['data'])) {
$tree['previewData']['sheets'][$sheetKey][$fieldKey]['data'][$lKey][$vKey] = $flexformContentArr['data'][$sheetKey][$lKey][$fieldKey][$vKey];
}
}
if ($fieldData['type'] == 'array') {
$tree['previewData']['sheets'][$sheetKey][$fieldKey]['subElements'][$lKey] = $flexformContentArr['data'][$sheetKey][$lKey][$fieldKey]['el'];
}
}
}
// If the current field points to other content elements, process them:
if ($fieldData['TCEforms']['config']['type'] == 'group' && $fieldData['TCEforms']['config']['internal_type'] == 'db' && $fieldData['TCEforms']['config']['allowed'] == 'tt_content') {
foreach ($lKeys as $lKey) {
foreach ($vKeys as $vKey) {
$listOfSubElementUids = $flexformContentArr['data'][$sheetKey][$lKey][$fieldKey][$vKey];
$tree['sub'][$sheetKey][$lKey][$fieldKey][$vKey] = $this->getContentTree_processSubContent($listOfSubElementUids, $tt_content_elementRegister, $prevRecList);
$tree['sub'][$sheetKey][$lKey][$fieldKey][$vKey]['meta']['title'] = $fieldData['TCEforms']['label'];
}
}
} elseif ($fieldData['type'] != 'array' && $fieldData['TCEforms']['config']) {
// If generally there are non-container fields, register them:
$tree['contentFields'][$sheetKey][] = $fieldKey;
}
}
}
}
}
// Add localization info for this element:
$tree['localizationInfo'] = $this->getContentTree_getLocalizationInfoForElement($tree, $tt_content_elementRegister);
return $tree;
}
示例4: processUserAndGroups
/**
* Callback function to blind user and group accounts. Used as <code>itemsProcFunc</code> in <code>$TCA</code>.
*
* @param array $conf Configuration array. The following elements are set:<ul><li>items - initial set of items (empty in our case)</li><li>config - field config from <code>$TCA</code></li><li>TSconfig - this function name</li><li>table - table name</li><li>row - record row (???)</li><li>field - field name</li></ul>
* @param object $tceforms <code>t3lib_div::TCEforms</code> object
* @return void
*/
function processUserAndGroups($conf, $tceforms)
{
// Get usernames and groupnames
$be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
$groupArray = array_keys($be_group_Array);
$be_user_Array = t3lib_BEfunc::getUserNames();
$be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array, $groupArray, 1);
// users
$title = $GLOBALS['LANG']->sL($GLOBALS['TCA']['be_users']['ctrl']['title']);
foreach ($be_user_Array as $uid => $user) {
$conf['items'][] = array($user['username'] . ' (' . $title . ')', 'be_users_' . $user['uid'], t3lib_iconWorks::getIcon('be_users', $user));
}
// Process groups only if necessary -- save time!
if (strstr($conf['config']['mod_ws_allowed'], 'be_groups')) {
// groups
$be_group_Array = $be_group_Array_o = t3lib_BEfunc::getGroupNames();
$be_group_Array = t3lib_BEfunc::blindGroupNames($be_group_Array_o, $groupArray, 1);
$title = $GLOBALS['LANG']->sL($GLOBALS['TCA']['be_groups']['ctrl']['title']);
foreach ($be_group_Array as $uid => $group) {
$conf['items'][] = array($group['title'] . ' (' . $title . ')', 'be_groups_' . $group['uid'], t3lib_iconWorks::getIcon('be_groups', $user));
}
}
}
示例5: TBE_expandPage
/**
* For TYPO3 Element Browser: This lists all content elements from the given list of tables
*
* @param string Commalist of tables. Set to "*" if you want all tables.
* @return string HTML output.
*/
function TBE_expandPage($tables)
{
global $TCA, $BE_USER, $BACK_PATH;
$out = '';
if ($this->expandPage >= 0 && t3lib_div::testInt($this->expandPage) && $BE_USER->isInWebMount($this->expandPage)) {
// Set array with table names to list:
if (!strcmp(trim($tables), '*')) {
$tablesArr = array_keys($TCA);
} else {
$tablesArr = t3lib_div::trimExplode(',', $tables, 1);
}
reset($tablesArr);
// Headline for selecting records:
$out .= $this->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 = t3lib_BEfunc::getRecordWSOL('pages', $this->expandPage);
$ATag = '';
$ATag_e = '';
$ATag2 = '';
if (in_array('pages', $tablesArr)) {
$ficon = t3lib_iconWorks::getIcon('pages', $mainPageRec);
$ATag = "<a href=\"#\" onclick=\"return insertElement('pages', '" . $mainPageRec['uid'] . "', 'db', " . t3lib_div::quoteJSvalue($mainPageRec['title']) . ", '', '', '" . $ficon . "','',1);\">";
$ATag2 = "<a href=\"#\" onclick=\"return insertElement('pages', '" . $mainPageRec['uid'] . "', 'db', " . t3lib_div::quoteJSvalue($mainPageRec['title']) . ", '', '', '" . $ficon . "','',0);\">";
$ATag_alt = substr($ATag, 0, -4) . ",'',1);\">";
$ATag_e = '</a>';
}
$picon = t3lib_iconWorks::getSpriteIconForRecord('pages', $mainPageRec);
$pBicon = $ATag2 ? '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/plusbullet2.gif', 'width="18" height="16"') . ' alt="" />' : '';
$pText = htmlspecialchars(t3lib_div::fixed_lgd_cs($mainPageRec['title'], $titleLen));
$out .= $picon . $ATag2 . $pBicon . $ATag_e . $ATag . $pText . $ATag_e . '<br />';
// Initialize the record listing:
$id = $this->expandPage;
$pointer = t3lib_div::intInRange($this->pointer, 0, 100000);
$perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
$pageinfo = t3lib_BEfunc::readPageAccess($id, $perms_clause);
$table = '';
// Generate the record list:
$dblist = t3lib_div::makeInstance('TBE_browser_recordList');
$dblist->thisScript = $this->thisScript;
$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);
$dblist->start($id, t3lib_div::_GP('table'), $pointer, t3lib_div::_GP('search_field'), t3lib_div::_GP('search_levels'), t3lib_div::_GP('showLimit'));
$dblist->setDispFields();
$dblist->generateList();
$dblist->writeBottom();
// Add the HTML for the record list to output variable:
$out .= $dblist->HTMLcode;
// Add support for fieldselectbox in singleTableMode
if ($dblist->table) {
$out .= $dblist->fieldSelectBox($dblist->table);
}
$out .= $dblist->getSearchBox();
}
// Return accumulated content:
return $out;
}
示例6: sidebar_renderNonUsedElements
/**
* Displays a list of local content elements on the page which were NOT used in the hierarchical structure of the page.
*
* @param $pObj: Reference to the parent object ($this)
* @return string HTML output
* @access protected
*/
function sidebar_renderNonUsedElements()
{
global $LANG, $TYPO3_DB, $BE_USER;
$output = '';
$elementRows = array();
$usedUids = array_keys($this->pObj->global_tt_content_elementRegister);
$usedUids[] = 0;
$pid = $this->pObj->id;
// If workspaces should evaluated non-used elements it must consider the id: For "element" and "branch" versions it should accept the incoming id, for "page" type versions it must be remapped (because content elements are then related to the id of the offline version)
$res = $TYPO3_DB->exec_SELECTquery(t3lib_BEfunc::getCommonSelectFields('tt_content', '', array('uid', 'header', 'bodytext', 'sys_language_uid')), 'tt_content', 'pid=' . intval($pid) . ' ' . 'AND uid NOT IN (' . implode(',', $usedUids) . ') ' . 'AND t3ver_state!=1' . t3lib_BEfunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content'), '', 'uid');
$this->deleteUids = array();
// Used to collect all those tt_content uids with no references which can be deleted
while (false !== ($row = $TYPO3_DB->sql_fetch_assoc($res))) {
$elementPointerString = 'tt_content:' . $row['uid'];
// Prepare the language icon:
$languageLabel = htmlspecialchars($this->pObj->allAvailableLanguages[$row['sys_language_uid']]['title']);
$languageIcon = $this->pObj->allAvailableLanguages[$row['sys_language_uid']]['flagIcon'] ? '<img src="' . $this->pObj->allAvailableLanguages[$row['sys_language_uid']]['flagIcon'] . '" title="' . $languageLabel . '" alt="' . $languageLabel . '" />' : ($languageLabel && $row['sys_language_uid'] ? '[' . $languageLabel . ']' : '');
// Prepare buttons:
$cutButton = $this->element_getSelectButtons($elementPointerString, 'ref');
$recordIcon = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, t3lib_iconWorks::getIcon('tt_content', $row), '') . ' width="18" height="16" border="0" title="[tt_content:' . $row['uid'] . '" alt="" />';
$recordButton = $this->pObj->doc->wrapClickMenuOnIcon($recordIcon, 'tt_content', $row['uid'], 1, '&callingScriptId=' . rawurlencode($this->pObj->doc->scriptID), 'new,copy,cut,pasteinto,pasteafter,delete');
$elementRows[] = '
<tr class="bgColor4">
<td style="width:1%">' . $cutButton . '</td>
<td style="width:1%;">' . $languageIcon . '</td>
<td style="width:1%;">' . $this->renderReferenceCount($row['uid']) . '</td>
<td>' . $recordButton . htmlspecialchars(' ' . t3lib_div::fixed_lgd_cs(trim(strip_tags($row['header'] . ($row['header'] && $row['bodytext'] ? ' - ' : '') . $row['bodytext'])), 100)) . '
</td>
</tr>
';
}
if (count($elementRows)) {
// Control for deleting all deleteable records:
$deleteAll = '';
if (count($this->deleteUids) && 0 === $BE_USER->workspace) {
$params = '';
foreach ($this->deleteUids as $deleteUid) {
$params .= '&cmd[tt_content][' . $deleteUid . '][delete]=1';
}
$label = $LANG->getLL('rendernonusedelements_deleteall');
$deleteAll = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(\'' . $this->doc->issueCommand($params, '') . '\');') . '">' . '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/garbage.gif', 'width="11" height="12"') . ' title="' . htmlspecialchars($label) . '" alt="" />' . htmlspecialchars($label) . '</a>';
}
// Create table and header cell:
$output = '
<table border="0" cellpadding="0" cellspacing="1" width="100%" class="lrPadding">
<tr class="bgColor4-20">
<td colspan="5">' . $LANG->getLL('inititemno_elementsNotBeingUsed', '1') . ':</td>
</tr>
' . implode('', $elementRows) . '
<tr class="bgColor4">
<td colspan="5">' . $deleteAll . '</td>
</tr>
</table>
';
}
return $output;
}
示例7: icon_getFileTypeImgTag
/**
* Returns a file or folder icon for a given (file)path as HTML img tag.
*
* @param array $infoArr info array: eg. $pathInfo = tx_dam::path_getInfo($path)
* @param boolean $addAttrib Additional attributes for the image tag..
* @param string $mode TYPO3_MODE to be used: 'FE', 'BE'. Constant TYPO3_MODE is default.
* @return string Icon img tag
* @see tx_dam::path_getInfo()
*/
function icon_getFileTypeImgTag($infoArr, $addAttrib = '', $mode = TYPO3_MODE)
{
global $TYPO3_CONF_VARS, $TCA;
static $iconCacheSize = array();
require_once PATH_t3lib . 'class.t3lib_iconworks.php';
if (isset($infoArr['dir_name'])) {
$iconfile = tx_dam::icon_getFolder($infoArr);
} elseif (isset($infoArr['file_name']) or isset($infoArr['file_type']) or isset($infoArr['media_type'])) {
$iconfile = tx_dam::icon_getFileType($infoArr);
if ($mode === 'BE') {
$tca_temp_typeicons = $TCA['tx_dam']['ctrl']['typeicons'];
$tca_temp_iconfile = $TCA['tx_dam']['ctrl']['iconfile'];
unset($TCA['tx_dam']['ctrl']['typeicons']);
$TCA['tx_dam']['ctrl']['iconfile'] = $iconfile;
$iconfile = t3lib_iconWorks::getIcon('tx_dam', $infoArr, $shaded = false);
$TCA['tx_dam']['ctrl']['iconfile'] = $tca_temp_iconfile;
$TCA['tx_dam']['ctrl']['typeicons'] = $tca_temp_typeicons;
}
}
if (!$iconCacheSize[$iconfile]) {
// Get width/height:
$iInfo = @getimagesize(t3lib_div::resolveBackPath(PATH_site . TYPO3_mainDir . $iconfile));
$iconCacheSize[$iconfile] = $iInfo[3];
}
$icon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], $iconfile, $iconCacheSize[$iconfile]) . ' class="typo3-icon" alt="" ' . trim($addAttrib) . ' />';
return $icon;
}
示例8: drawTableOfIndexedPages
/**
* Produces a table with indexing information for each page.
*
* @return string HTML output
*/
function drawTableOfIndexedPages()
{
global $BACK_PATH;
// Drawing tree:
$tree = t3lib_div::makeInstance('t3lib_pageTree');
$perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
$tree->init('AND ' . $perms_clause);
$HTML = '<img src="' . $BACK_PATH . t3lib_iconWorks::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(t3lib_div::fixed_lgd_cs($data['row']['title'], 20), $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;
}
示例9: 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 = t3lib_iconWorks::getIcon($this->mmForeignTable ? $this->mmForeignTable : $this->table, $row);
return t3lib_iconWorks::skinImg('', $icon, '', 1);
}
示例10: main
/**
* [Describe function...]
*
* @return [type] ...
*/
function main()
{
global $SOBE, $BE_USER, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
global $tmpl, $tplRow, $theConstants;
$POST = t3lib_div::_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"];
}
// **************************
// Main
// **************************
// BUGBUG: Should we check if the uset 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 .= '<h4 style="margin-bottom:5px;">' . $GLOBALS['LANG']->getLL('currentTemplate') . ' <img ' . t3lib_iconWorks::skinImg($BACK_PATH, t3lib_iconWorks::getIcon('sys_template', $tplRow)) . ' align="top" /> <strong>' . $this->pObj->linkWrapTemplateTitle($tplRow["title"], $bType == "setup" ? "config" : "constants") . '</strong>' . htmlspecialchars(trim($tplRow["sitetitle"]) ? ' - (' . $tplRow["sitetitle"] . ')' : '') . '</h4>';
if ($manyTemplatesMenu) {
$theOutput .= $this->pObj->doc->section("", $manyTemplatesMenu);
$theOutput .= $this->pObj->doc->divider(5);
}
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 = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->getLL('noSpaces') . '<br />' . $GLOBALS['LANG']->getLL('nothingUpdated'), $GLOBALS['LANG']->getLL('badProperty'), t3lib_FlashMessage::ERROR);
t3lib_FlashMessageQueue::addMessage($badPropertyMessage);
} else {
$pline = $name . '.' . $property . ' = ' . trim($POST['data'][$name]['propertyValue']);
$propertyAddedMessage = t3lib_div::makeInstance('t3lib_FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('propertyAdded'));
t3lib_FlashMessageQueue::addMessage($propertyAddedMessage);
$line .= LF . $pline;
}
} elseif ($POST['update_value']) {
$pline = $name . " = " . trim($POST['data'][$name]['value']);
$updatedMessage = t3lib_div::makeInstance('t3lib_FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('valueUpdated'));
t3lib_FlashMessageQueue::addMessage($updatedMessage);
$line .= LF . $pline;
} elseif ($POST['clear_object']) {
if ($POST['data'][$name]['clearValue']) {
$pline = $name . ' >';
$objectClearedMessage = t3lib_div::makeInstance('t3lib_FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('objectCleared'));
t3lib_FlashMessageQueue::addMessage($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 = t3lib_div::makeInstance("t3lib_TCEmain");
$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 = t3lib_div::_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);
//.........这里部分代码省略.........
示例11: wrapTitle
/**
* Wrapping the title in a link, if applicable.
*
* @param string Title, ready for output.
* @param array The record
* @param boolean If set, pages clicked will return immediately, otherwise reload page.
* @return string Wrapping title string.
*/
function wrapTitle($title, $v, $ext_pArrPages)
{
if ($ext_pArrPages) {
$ficon = t3lib_iconWorks::getIcon('pages', $v);
$onClick = "return insertElement('pages', '" . $v['uid'] . "', 'db', " . t3lib_div::quoteJSvalue($v['title']) . ", '', '', '" . $ficon . "','',1);";
} else {
$onClick = htmlspecialchars('return jumpToUrl(\'' . $this->thisScript . '?act=' . $GLOBALS['SOBE']->browser->act . '&mode=' . $GLOBALS['SOBE']->browser->mode . '&expandPage=' . $v['uid'] . '\');');
}
return '<a href="#" onclick="' . $onClick . '">' . $title . '</a>';
}
示例12: foreignTable
/**
* Adds records from a foreign table (for selector boxes)
*
* @param array The array of items (label,value,icon)
* @param array The 'columns' array for the field (from TCA)
* @param array TSconfig for the table/row
* @param string The fieldname
* @param boolean If set, then we are fetching the 'neg_' foreign tables.
* @return array The $items array modified.
* @see addSelectOptionsToItemArray(), t3lib_BEfunc::exec_foreign_table_where_query()
*/
function foreignTable($items, $fieldValue, $TSconfig, $field, $pFFlag = 0)
{
global $TCA;
// Init:
$pF = $pFFlag ? 'neg_' : '';
$f_table = $fieldValue['config'][$pF . 'foreign_table'];
$uidPre = $pFFlag ? '-' : '';
// Get query:
$res = t3lib_BEfunc::exec_foreign_table_where_query($fieldValue, $field, $TSconfig, $pF);
// Perform lookup
if ($GLOBALS['TYPO3_DB']->sql_error()) {
echo $GLOBALS['TYPO3_DB']->sql_error() . "\n\nThis may indicate a table defined in tables.php is not existing in the database!";
return array();
}
// Get label prefix.
$lPrefix = $this->sL($fieldValue['config'][$pF . 'foreign_table_prefix']);
// Get icon field + path if any:
$iField = $TCA[$f_table]['ctrl']['selicon_field'];
$iPath = trim($TCA[$f_table]['ctrl']['selicon_field_path']);
// Traverse the selected rows to add them:
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
t3lib_BEfunc::workspaceOL($f_table, $row);
if (is_array($row)) {
// Prepare the icon if available:
if ($iField && $iPath && $row[$iField]) {
$iParts = t3lib_div::trimExplode(',', $row[$iField], 1);
$icon = '../' . $iPath . '/' . trim($iParts[0]);
} elseif (t3lib_div::inList('singlebox,checkbox', $fieldValue['config']['renderMode'])) {
$icon = '../' . TYPO3_mainDir . t3lib_iconWorks::skinImg($this->backPath, t3lib_iconWorks::getIcon($f_table, $row), '', 1);
} else {
$icon = '';
}
// Add the item:
$items[] = array($lPrefix . htmlspecialchars(t3lib_BEfunc::getRecordTitle($f_table, $row)), $uidPre . $row['uid'], $icon);
}
}
return $items;
}
示例13: renderDoktype_254
/**
* Displays the edit page screen if the currently selected page is of the doktype "Sysfolder"
*
* @param array $pageRecord: The current page record
* @return mixed HTML output from this submodule or FALSE if this submodule doesn't feel responsible
* @access public
*/
function renderDoktype_254($pageRecord)
{
global $LANG, $BE_USER, $TYPO3_CONF_VARS;
// Prepare the record icon including a content sensitive menu link wrapped around it:
$pageTitle = htmlspecialchars(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle('pages', $pageRecord), 50));
$recordIcon = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, t3lib_iconWorks::getIcon('pages', $pageRecord), '') . ' style="text-align: center; vertical-align: middle;" width="18" height="16" border="0" title="' . $pageTitle . '" alt="" />';
$editButton = $this->pObj->link_edit('<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/edit2.gif', '') . ' title="' . htmlspecialchars($LANG->sL('LLL:EXT:lang/locallang_mod_web_list.xml:editPage')) . '" alt="" style="text-align: center; vertical-align: middle; border:0;" />', 'pages', $pageRecord['uid']);
if ($this->userHasAccessToListModule()) {
$listModuleURL = $this->doc->backPath . 'db_list.php?id=' . intval($this->pObj->id);
$onClick = "top.nextLoadModuleUrl='" . $listModuleURL . "';top.fsMod.recentIds['web']=" . intval($this->pObj->id) . ";top.goToModule('web_list',1);";
$listModuleLink = '<br /><br />
<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'mod/web/list/list.gif', '') . ' style="text-align:center; vertical-align: middle; border:0;" />
<strong><a href="#" onClick="' . $onClick . '">' . $LANG->getLL('editpage_sysfolder_switchtolistview', '', 1) . '</a></strong>
';
} else {
$listModuleLink = $LANG->getLL('editpage_sysfolder_listview_noaccess', '', 1);
}
$content = $this->doc->icons(1) . $LANG->getLL('editpage_sysfolder_intro', '', 1) . $listModuleLink;
return $content;
}
示例14: getDummyIconPath
private function getDummyIconPath()
{
$icon = t3lib_iconWorks::getIcon('tx_news_domain_model_tag');
return t3lib_iconWorks::skinImg('', $icon, '', 1);
}