本文整理汇总了PHP中t3lib_iconWorks类的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_iconWorks类的具体用法?PHP t3lib_iconWorks怎么用?PHP t3lib_iconWorks使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了t3lib_iconWorks类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Render javascript in header
*
* @return string the rendered page info icon
* @see template::getPageInfo() Note: can't call this method as it's protected!
*/
public function render()
{
$doc = $this->getDocInstance();
$id = t3lib_div::_GP('id');
$pageRecord = t3lib_BEfunc::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
// Add icon with clickmenu, etc:
if ($pageRecord['uid']) {
// If there IS a real page
$alttext = t3lib_BEfunc::getRecordIconAltText($pageRecord, 'pages');
$iconImg = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageRecord, array('title' => htmlspecialchars($alttext)));
// Make Icon:
$theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', $pageRecord['uid']);
} else {
// On root-level of page tree
// Make Icon
$iconImg = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/i/_icon_website.gif') . ' alt="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '" />';
if ($BE_USER->user['admin']) {
$theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', 0);
} else {
$theIcon = $iconImg;
}
}
// Setting icon with clickmenu + uid
$pageInfo = $theIcon . '<em>[pid: ' . $pageRecord['uid'] . ']</em>';
return $pageInfo;
}
示例2: render
/**
* Renders an icon link as known from the TYPO3 backend
*
* @param string $uri the target URI for the link. If you want to execute JavaScript here, prefix the URI with "javascript:"
* @param string $icon Icon to be used. See self::allowedIcons for a list of allowed icon names
* @param string $title Title attribte of the resulting link
* @return string the rendered icon link
*/
public function render($uri, $icon = 'closedok', $title = '')
{
if (!in_array($icon, $this->allowedIcons)) {
throw new Tx_Fluid_Core_ViewHelper_Exception('"' . $icon . '" is no valid icon. Allowed are "' . implode('", "', $this->allowedIcons) . '".', 1253208523);
}
$skinnedIcon = t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/' . $icon . '.gif', '');
return '<a href="' . $uri . '"><img' . $skinnedIcon . '" title="' . htmlspecialchars($title) . '" alt="" /></a>';
}
示例3: render
/**
* Render the sprite icon
*
* @param string $table table name
* @param integer $uid uid of record
* @param string $title title
* @return string sprite icon
*/
public function render($table, $uid, $title)
{
$icon = '';
$row = t3lib_BEfunc::getRecord($table, $uid);
if (is_array($row)) {
$icon = t3lib_iconWorks::getSpriteIconForRecord($table, $row, array('title' => htmlspecialchars($title)));
}
return $icon;
}
示例4: manipulateCacheActions
/**
* modifies CacheMenuItems array
*
* @param array array of CacheMenuItems
* @param array array of AccessConfigurations-identifiers (typically used by userTS with options.clearCache.identifier)
* @return void
*/
public function manipulateCacheActions(&$cacheActions, &$optionValues)
{
if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.clearRTECache')) {
// Add new cache menu item
$title = $GLOBALS['LANG']->sL('LLL:EXT:rtehtmlarea/hooks/clearrtecache/locallang.xml:title');
$cacheActions[] = array('id' => 'clearRTECache', 'title' => $title, 'href' => $GLOBALS['BACK_PATH'] . 'ajax.php?ajaxID=rtehtmlarea::clearTempDir', 'icon' => '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'sysext/rtehtmlarea/hooks/clearrtecache/clearrtecache.png', 'width="16" height="16"') . ' title="' . $title . '" alt="' . $title . '" />');
$optionValues[] = 'clearRTECache';
}
}
示例5: manipulateCacheActions
public function manipulateCacheActions(&$cacheActions, &$optionValues)
{
if ($GLOBALS['BE_USER']->isAdmin()) {
// Add new cache menu item
$title = $GLOBALS['LANG']->sL('LLL:EXT:tq_seo/hooks/sitemap/locallang.xml:clearSeoSitemap');
$cacheActions[] = array('id' => 'clearRTECache', 'title' => $title, 'href' => $GLOBALS['BACK_PATH'] . 'ajax.php?ajaxID=tx_tqseo_sitemap::clearSeoSitemap', 'icon' => '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, t3lib_extMgm::extRelPath('tq_seo') . 'res/images/clear-sitemap.png', 'width="16" height="16"') . ' title="' . $title . '" alt="' . $title . '" />');
$optionValues[] = 'clearSeoSitemap';
}
}
示例6: getFlagIconForLanguage
/**
*
* @param string $lang
* @return string
*/
public static function getFlagIconForLanguage($flagName, $options = array())
{
$flag = null;
if (!strlen($flagName)) {
$flagName = 'unknown';
}
$flag = t3lib_iconWorks::getSpriteIcon('flags-' . $flagName, $options);
return $flag;
}
示例7: buildRepresentationForNode
/**
* Builds a complete node including children
*
* @param \t3lib_tree_Node|\TYPO3\CMS\Backend\Tree\TreeNode $basicNode
* @param NULL|t3lib_tree_tca_DatabaseNode $parent
* @param integer $level
* @param bool $restriction
* @return t3lib_tree_tca_DatabaseNode node
*/
protected function buildRepresentationForNode(t3lib_tree_Node $basicNode, t3lib_tree_tca_DatabaseNode $parent = NULL, $level = 0, $restriction = FALSE)
{
/**@param $node t3lib_tree_tca_DatabaseNode */
$node = t3lib_div::makeInstance('t3lib_tree_tca_DatabaseNode');
$row = array();
if ($basicNode->getId() == 0) {
$node->setSelected(FALSE);
$node->setExpanded(TRUE);
$node->setLabel($GLOBALS['LANG']->sL($GLOBALS['TCA'][$this->tableName]['ctrl']['title']));
} else {
$row = t3lib_BEfunc::getRecordWSOL($this->tableName, $basicNode->getId(), '*', '', FALSE);
if ($this->getLabelField() !== '') {
$label = Tx_News_Service_CategoryService::translateCategoryRecord($row[$this->getLabelField()], $row);
$node->setLabel($label);
} else {
$node->setLabel($basicNode->getId());
}
$node->setSelected(t3lib_div::inList($this->getSelectedList(), $basicNode->getId()));
$node->setExpanded($this->isExpanded($basicNode));
$node->setLabel($node->getLabel());
}
$node->setId($basicNode->getId());
// Break to force single category activation
if ($parent != NULL && $level != 0 && $this->isSingleCategoryAclActivated() && !$this->isCategoryAllowed($node)) {
return NULL;
}
$node->setSelectable(!t3lib_div::inList($this->getNonSelectableLevelList(), $level) && !in_array($basicNode->getId(), $this->getItemUnselectableList()));
$node->setSortValue($this->nodeSortValues[$basicNode->getId()]);
$node->setIcon(t3lib_iconWorks::mapRecordTypeToSpriteIconClass($this->tableName, $row));
$node->setParentNode($parent);
if ($basicNode->hasChildNodes()) {
$node->setHasChildren(TRUE);
$childNodes = t3lib_div::makeInstance('t3lib_tree_SortedNodeCollection');
$foundSomeChild = FALSE;
foreach ($basicNode->getChildNodes() as $child) {
// Change in custom TreeDataProvider by adding the if clause
if ($restriction || $this->isCategoryAllowed($child)) {
$returnedChild = $this->buildRepresentationForNode($child, $node, $level + 1, TRUE);
if (!is_null($returnedChild)) {
$foundSomeChild = TRUE;
$childNodes->append($returnedChild);
} else {
$node->setParentNode(NULL);
$node->setHasChildren(FALSE);
}
}
// Change in custom TreeDataProvider end
}
if ($foundSomeChild) {
$node->setChildNodes($childNodes);
}
}
return $node;
}
示例8: render
/**
* Renders an icon link as known from the TYPO3 backend
*
* @param string $icon Icon to be used
* @param string $uri the target URI for the link
* @param string $title Title attribute of the resulting link
* @param string $onclick onclick setting
* @return string the rendered icon link
*/
public function render($icon = 'closedok', $uri = '', $title = '', $onclick = '')
{
$icon = t3lib_iconWorks::getSpriteIcon($icon, array('title' => $title));
$content = '';
if (empty($uri) && empty($onclick)) {
$content = $icon;
} else {
$content = '<a onclick="' . htmlspecialchars($onclick) . '" href="' . htmlspecialchars($uri) . '">' . $icon . '</a>';
}
return $content;
}
示例9: render
/**
* Creates the selector for workspaces
*
* @return string workspace selector as HTML select
*/
public function render()
{
$title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.search', true);
$this->addJavascriptToBackend();
$searchMenu = array();
$searchMenu[] = '<a href="#" class="toolbar-item">' . t3lib_iconWorks::getSpriteIcon('apps-toolbar-menu-search', array('title' => $title)) . '</a>';
$searchMenu[] = '<div class="toolbar-item-menu" style="display: none;">';
$searchMenu[] = '<input type="text" id="search-query" name="search-query" value="" />';
$searchMenu[] = '</div>';
return implode(LF, $searchMenu);
}
示例10: main
/**
* Main function, returning the HTML content of the module
*
* @return string HTML
*/
function main()
{
global $BACK_PATH;
// PHP and TYPO3 version check
if (intval(phpversion()) < 5 || TYPO3_branch < 4.2) {
return '<div style="padding-top: 10px;"></div><p>Updater <strong>requires</strong> PHP5 and TYPO3 v4.2+</p>';
}
$this->diffPath['required'] = t3lib_extMgm::extPath('tinymce_rte') . 'patcher/diffs/';
$this->diffPath['optional'] = t3lib_extMgm::extPath('tinymce_rte') . 'patcher/diffs2/';
$this->filePath = t3lib_extMgm::extPath('tinymce_rte');
if (t3lib_div::_GP('update') && ($descKey = t3lib_div::_GP('desckey'))) {
$content = '<h2 class="typo3-tstemplate-ceditor-subcat">' . $this->desc[$descKey]['title'] . '</h2>';
$patches = t3lib_div::_GP($descKey . 'patch');
$updated = false;
foreach ($patches as $patchName => $value) {
if ($value = intval($value)) {
$content .= $this->appplyPatch($patchName, $this->diffPath[$descKey], $value - 1);
$updated = true;
}
}
$content .= '<div style="padding-top: 10px;"></div>';
$content .= $updated ? 'Patching done..' : 'Nothing selected to patch..';
$content .= '<div style="padding-top: 25px;"></div><a href="' . htmlspecialchars(t3lib_div::linkThisScript()) . '" class="typo3-goBack"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/goback.gif', 'width="14" height="14"') . ' alt="" />Go back</a>';
// Remove cache files
$this->removeCachedFiles();
} elseif (t3lib_div::_GP('clear')) {
$content = '<h2 class="typo3-tstemplate-ceditor-subcat">Clearing gzip and TYPO3 cache.</h2>';
$content .= 'Gzip and TYPO3 cache cleared..';
$content .= '<div style="padding-top: 25px;"></div><a href="' . htmlspecialchars(t3lib_div::linkThisScript()) . '" class="typo3-goBack"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/goback.gif', 'width="14" height="14"') . ' alt="" />Go back</a>';
// Remove cache files
$this->removeCachedFiles();
} else {
$content .= '
<script type="text/javascript">
/* <![CDATA[ */
function difftoggle(val,descKey) {
els = document.getElementsByTagName("select");
var matchregexp = new RegExp("^"+descKey+"patch");
for (var i=0;i<els.length;i++) {
if (els[i].name.match(matchregexp)) els[i].selectedIndex = val;
}
return false;
}
/* ]]> */
</script>';
// display form
$content .= $this->displayDiffs($this->diffPath['required'], 'required');
$content .= $this->displayDiffs($this->diffPath['optional'], 'optional');
$content .= $this->displayRemoveCache();
}
return $content;
}
示例11: render
public function render()
{
$this->addJavascriptToBackend();
$this->addCssToBackend();
$devLinks = array();
$devLinks[] = '<a href="#" class="toolbar-item"> <img' . t3lib_iconWorks::skinImg($this->backPath, t3lib_extMgm::extRelPath($this->EXTKEY) . 'bomb.png', 'width="16" height="16"') . ' title="Developer Links" alt="" /></a>';
$devLinks[] = '<ul class="toolbar-item-menu" style="display: none;">';
foreach ($this->docLinks as $linkConf) {
$icon = '<img' . t3lib_iconWorks::skinImg($this->backPath, $linkConf[2], 'width="16" height="16"') . ' title="' . $linkConf[0] . '" alt="" /> ';
$devLinks[] = '<li><a href="' . $linkConf[1] . '" target="_blank">' . $icon . htmlspecialchars($linkConf[0]) . '</a></li>';
}
$devLinks[] = '</ul>';
return implode("\n", $devLinks);
}
示例12: main
/**
* Adding various standard options to the context menu.
* This includes both first and second level.
*
* @param object The calling object. Value by reference.
* @param array Array with the currently collected menu items to show.
* @param string Table name of clicked item.
* @param integer UID of clicked item.
* @return array Modified $menuItems array
*/
function main(&$backRef, $menuItems, $table, $uid)
{
global $BE_USER, $TCA, $LANG;
$localItems = array();
// Accumulation of local items.
// Detecting menu level
if ($BE_USER->isAdmin() && !$backRef->cmLevel && $table == 'be_users') {
// LEVEL: Primary menu.
// "SU" element added:
$url = 'mod.php?M=tools_beuser&SwitchUser=' . rawurlencode($uid) . '&switchBackUser=1';
$localItems[] = $backRef->linkItem('Switch To User', $backRef->excludeIcon(t3lib_iconWorks::getSpriteIcon('actions-system-backend-user-emulate')), $backRef->urlRefForCM($url, '', 1, 'top'), 1);
$menuItems = array_merge($menuItems, $localItems);
}
return $menuItems;
}
示例13: render
/**
* renders the actual logo code
*
* @return string logo html code snippet to use in the backend
*/
public function render()
{
$logoFile = 'gfx/alt_backend_logo.gif';
// default
if (is_string($this->logo)) {
// overwrite
$logoFile = $this->logo;
}
$imgInfo = getimagesize(PATH_site . TYPO3_mainDir . $logoFile);
$logo = '<a href="http://www.typo3.com/" target="_blank">' . '<img' . t3lib_iconWorks::skinImg('', $logoFile, $imgInfo[3]) . ' title="TYPO3 Content Management System" alt="" />' . '</a>';
// overwrite with custom logo
if ($GLOBALS['TBE_STYLES']['logo']) {
$imgInfo = @getimagesize(t3lib_div::resolveBackPath(PATH_typo3 . $GLOBALS['TBE_STYLES']['logo'], 3));
$logo = '<a href="http://www.typo3.com/" target="_blank">' . '<img src="' . $GLOBALS['TBE_STYLES']['logo'] . '" ' . $imgInfo[3] . ' title="TYPO3 Content Management System" alt="" />' . '</a>';
}
return $logo;
}
示例14: fwd_rwd_HTML
/**
* Creates the button with link to either forward or reverse
*
* @param string Type: "fwd" or "rwd"
* @param integer Pointer
* @param string Table name
* @return string
*/
function fwd_rwd_HTML($type,$pointer,$table='') {
$content = '';
switch($type) {
case 'fwd':
$href = $this->returnUrl . '&SET[recordsView_start]='.($pointer-$this->iLimit).'&SET[recordsView_table]='.$table;
$content = '<a href="'.htmlspecialchars($href).'">'.
t3lib_iconWorks::getSpriteIcon('actions-move-up').
'</a> <i>[1 - '.$pointer.']</i>';
break;
case 'rwd':
$href = $this->returnUrl . '&SET[recordsView_start]='.$pointer.'&SET[recordsView_table]='.$table;
$content = '<a href="'.htmlspecialchars($href).'">'.
t3lib_iconWorks::getSpriteIcon('actions-move-down').
'</a> <i>['.($pointer+1).' - '.$this->totalItems.']</i>';
break;
}
return $content;
}
示例15: getRowDetails
/**
* Fetch futher information to current selected worspace record.
*
* @param object $parameter
* @return array $data
*/
public function getRowDetails($parameter)
{
global $TCA, $BE_USER;
$diffReturnArray = array();
$liveReturnArray = array();
$t3lib_diff = t3lib_div::makeInstance('t3lib_diff');
$stagesService = t3lib_div::makeInstance('Tx_Workspaces_Service_Stages');
$liveRecord = t3lib_BEfunc::getRecord($parameter->table, $parameter->t3ver_oid);
$versionRecord = t3lib_BEfunc::getRecord($parameter->table, $parameter->uid);
$icon_Live = t3lib_iconWorks::mapRecordTypeToSpriteIconClass($parameter->table, $liveRecord);
$icon_Workspace = t3lib_iconWorks::mapRecordTypeToSpriteIconClass($parameter->table, $versionRecord);
$stagePosition = $stagesService->getPositionOfCurrentStage($parameter->stage);
$fieldsOfRecords = array_keys($liveRecord);
// get field list from TCA configuration, if available
if ($TCA[$parameter->table]) {
if ($TCA[$parameter->table]['interface']['showRecordFieldList']) {
$fieldsOfRecords = $TCA[$parameter->table]['interface']['showRecordFieldList'];
$fieldsOfRecords = t3lib_div::trimExplode(',', $fieldsOfRecords, 1);
}
}
foreach ($fieldsOfRecords as $fieldName) {
// check for exclude fields
if ($GLOBALS['BE_USER']->isAdmin() || $TCA[$parameter->table]['columns'][$fieldName]['exclude'] == 0 || t3lib_div::inList($BE_USER->groupData['non_exclude_fields'], $parameter->table . ':' . $fieldName)) {
// call diff class only if there is a difference
if (strcmp($liveRecord[$fieldName], $versionRecord[$fieldName]) !== 0) {
// Select the human readable values before diff
$liveRecord[$fieldName] = t3lib_BEfunc::getProcessedValue($parameter->table, $fieldName, $liveRecord[$fieldName], 0, 1);
$versionRecord[$fieldName] = t3lib_BEfunc::getProcessedValue($parameter->table, $fieldName, $versionRecord[$fieldName], 0, 1);
$fieldTitle = $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel($parameter->table, $fieldName));
if ($TCA[$parameter->table]['columns'][$fieldName]['config']['type'] == 'group' && $TCA[$parameter->table]['columns'][$fieldName]['config']['internal_type'] == 'file') {
$versionThumb = t3lib_BEfunc::thumbCode($versionRecord, $parameter->table, $fieldName, '');
$liveThumb = t3lib_BEfunc::thumbCode($liveRecord, $parameter->table, $fieldName, '');
$diffReturnArray[] = array('label' => $fieldTitle, 'content' => $versionThumb);
$liveReturnArray[] = array('label' => $fieldTitle, 'content' => $liveThumb);
} else {
$diffReturnArray[] = array('label' => $fieldTitle, 'content' => $t3lib_diff->makeDiffDisplay($liveRecord[$fieldName], $versionRecord[$fieldName]));
$liveReturnArray[] = array('label' => $fieldTitle, 'content' => $liveRecord[$fieldName]);
}
}
}
}
$commentsForRecord = $this->getCommentsForRecord($parameter->uid, $parameter->table);
return array('total' => 1, 'data' => array(array('diff' => $diffReturnArray, 'live_record' => $liveReturnArray, 'path_Live' => $parameter->path_Live, 'label_Stage' => $parameter->label_Stage, 'stage_position' => $stagePosition['position'], 'stage_count' => $stagePosition['count'], 'comments' => $commentsForRecord, 'icon_Live' => $icon_Live, 'icon_Workspace' => $icon_Workspace)));
}