/** * 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; }
/** * 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>'; }
/** * 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; }
/** * 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'; } }
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'; } }
/** * * @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; }
/** * 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; }
/** * 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; }
/** * 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); }
/** * 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; }
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); }
/** * 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='******'&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; }
/** * 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; }
/** * 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; }
/** * 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))); }
/** * renders the toolbar menu * * @return string the rendered backend menu * @author Ingo Renner <*****@*****.**> */ public function render() { $actionMenu = array(); $actionEntries = $this->getActionEntries(); if ($actionEntries) { $this->addJavascriptToBackend(); $this->addCssToBackend(); $title = $GLOBALS['LANG']->getLL('action_toolbaritem', TRUE); $actionMenu[] = '<a href="#" class="toolbar-item">' . t3lib_iconWorks::getSpriteIcon('apps-toolbar-menu-actions', array('title' => $title)) . '</a>'; $actionMenu[] = '<ul class="toolbar-item-menu" style="display: none;">'; foreach ($actionEntries as $linkConf) { $actionMenu[] = '<li><a href="' . htmlspecialchars($linkConf[1]) . '" target="content">' . $linkConf[2] . htmlspecialchars($linkConf[0]) . '</a></li>'; } $actionMenu[] = '</ul>'; return implode("\n", $actionMenu); } else { return ''; } }
/** * This method returns the severity of the entry using TYPO3's icon and labels * * @param array $PA: information related to the field * @param t3lib_tceforms $fobj: reference to calling TCEforms object * * @return string The HTML for the form field */ public function displaySeverity($PA, $fobj) { $html = ''; $this->doc = t3lib_div::makeInstance('template'); $severity = $PA['row']['severity']; // Gets the image if ($severity == 0) { $html .= '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/info.gif', 'width="18" height="16" alt="pictogram"') . ' alt="" />'; } else { $html .= $this->doc->icons($severity); } // Change severity for the label if ($severity == -1) { $severity = 4; } $html .= ' <span style="font-weight: bold; margin-left: 5px">'; $html .= $GLOBALS['LANG']->sL('LLL:EXT:devlog/locallang_db.xml:tx_devlog.severity.I.' . $severity); $html .= '</span>'; return $html; }
/** * * @param string $lang * @return string */ public static function getFlagIconForLanguage($flagName, $options = array()) { $flag = null; if (!strlen($flagName)) { $flagName = 'unknown'; } if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000) { if ($flagName == 'unknown') { $flagName = $flagName . '.gif'; } elseif($flagName == 'multiple') { $flagName = 'multi-language.gif'; } $alt = isset($options['alt']) ? ' alt="' . $options['alt'] . '"' : ' alt=""'; $title = isset($options['title']) ? ' title="' . $options['title'] . '"' : ''; $flag = '<img src="' . self::getFlagIconFileForLanguage($flagName) . '"'. $title . $alt .'/>'; } else { $flag = t3lib_iconWorks::getSpriteIcon('flags-' . $flagName, $options); } return $flag; }
/** * List media types, along with options to edit & delete * * @return string HTML table of all the mimetypes */ function listMimeTypes() { global $LANG, $BACK_PATH, $BE_USER; // Load template $content = t3lib_parsehtml::getSubpart(t3lib_div::getURL($BACK_PATH . t3lib_extMgm::extRelPath('dam') . 'modfunc_tools_mimetypes/template.html'), '###MOD_TEMPLATE###'); $rowTemplate[1] = t3lib_parsehtml::getSubpart($content, '###ROW_1###'); $rowTemplate[2] = t3lib_parsehtml::getSubpart($content, '###ROW_2###'); // Add some JS $this->pObj->doc->JScode .= $this->pObj->doc->wrapScriptTags(' function deleteRecord(id) { // if (confirm(' . $LANG->JScharCode($LANG->getLL('deleteWarning')) . ')) { window.location.href = "' . $BACK_PATH . 'tce_db.php?cmd[tx_dam_media_types]["+id+"][delete]=1&redirect=' . rawurlencode(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL')) . '&id=' . tx_dam_db::getPid() . '&vC=' . $BE_USER->veriCode() . '&prErr=1&uPT=1"; } return false; } '); // Get content $alternate = 1; $rows = ''; $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_dam_media_types', '', '', 'ext ASC'); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $editURL = $BACK_PATH . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL')) . '&id=' . tx_dam_db::getPid() . '&edit[tx_dam_media_types][' . $row['uid'] . ']=edit'; //$deleteURL = $BACK_PATH . 'alt_doc.php?returnUrl=' . rawurlencode( t3lib_div::getIndpEnv('TYPO3_REQUEST_URL') ) . '&id=' . tx_dam_db::getPid() . '&edit[tx_dam_media_types][' . $row['uid'] . '][delete]=1'; $rowMarkers['EDIT'] = '<a href="#" onclick="window.location.href=\'' . $editURL . '\'; return false;"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/edit2.gif', 'width="11" height="12"') . ' title="Edit this type" alt="" height="16" width="16"></a>'; $rowMarkers['DELETE'] = '<a href="#" onclick="deleteRecord(' . $row['uid'] . ')"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/deletedok.gif', 'width="11" height="12"') . ' title="Delete this type" alt="" height="16" width="16"></a>'; $rowMarkers['EXTENSION'] = $row['ext']; $rowMarkers['MIME'] = $row['mime']; $rowMarkers['ICON'] = '<img src="' . $BACK_PATH . tx_dam::icon_getFileType(array('file_type' => $row['ext'], 'media_type' => $row['type'])) . '" />'; $rows .= t3lib_parsehtml::substituteMarkerArray($rowTemplate[$alternate], $rowMarkers, '###|###'); // Cycle the alternating rows if ($alternate == 2) { $alternate = 1; } else { $alternate = 2; } } $content = t3lib_parsehtml::substituteSubpart($content, '###ROWS###', $rows); $GLOBALS['TYPO3_DB']->sql_free_result($res); return $content; }
/** * Processing of clickmenu items * * @param object $backRef Reference to parent * @param array $menuItems Menu items array to modify * @param string $table Table name * @param integer $uid Uid of the record * @return array Menu item array, returned after modification * @todo Skinning for icons... * @todo Define visibility */ public function main(&$backRef, $menuItems, $table, $uid) { $localItems = array(); // Show import/export on second level menu OR root level. if ($backRef->cmLevel && \t3lib_div::_GP('subname') == 'moreoptions' || $table === 'pages' && $uid == 0) { $LL = $this->includeLL(); $modUrl = $backRef->backPath . t3lib_extMgm::extRelPath('impexp') . 'app/index.php'; $url = $modUrl . '?tx_impexp[action]=export&id=' . ($table == 'pages' ? $uid : $backRef->rec['pid']); if ($table == 'pages') { $url .= '&tx_impexp[pagetree][id]=' . $uid; $url .= '&tx_impexp[pagetree][levels]=0'; $url .= '&tx_impexp[pagetree][tables][]=_ALL'; } else { $url .= '&tx_impexp[record][]=' . rawurlencode($table . ':' . $uid); $url .= '&tx_impexp[external_ref][tables][]=_ALL'; } $localItems[] = $backRef->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('export', $LL)), $backRef->excludeIcon(\t3lib_iconWorks::getSpriteIcon('actions-document-export-t3d')), $backRef->urlRefForCM($url), 1); if ($table == 'pages') { $url = $modUrl . '?id=' . $uid . '&table=' . $table . '&tx_impexp[action]=import'; $localItems[] = $backRef->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('import', $LL)), $backRef->excludeIcon(\t3lib_iconWorks::getSpriteIcon('actions-document-import-t3d')), $backRef->urlRefForCM($url), 1); } } return array_merge($menuItems, $localItems); }
/** * Constructor for initializing the class * * @return void */ function init() { // Initialize GPvars: $this->number = t3lib_div::_GP('number'); $this->target = t3lib_div::_GP('target'); $this->returnUrl = t3lib_div::_GP('returnUrl'); $this->returnUrl = $this->returnUrl ? $this->returnUrl : t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'file_list.php?id=' . rawurlencode($this->target); // set the number of input fields if (empty($this->number)) { $this->number = $GLOBALS['BE_USER']->getTSConfigVal('options.defaultFileUploads'); } $this->number = t3lib_div::intInRange($this->number, 1, $this->uploadNumber); // Init basic-file-functions object: $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions'); $this->basicff->init($GLOBALS['FILEMOUNTS'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']); // Init basic-charset-functions object: $this->charsetConversion = t3lib_div::makeInstance('t3lib_cs'); // Cleaning and checking target $this->target = $this->charsetConversion->conv($this->target, 'utf-8', $GLOBALS['LANG']->charSet); $this->target = $this->basicff->is_directory($this->target); $key = $this->basicff->checkPathAgainstMounts($this->target . '/'); if (!$this->target || !$key) { t3lib_BEfunc::typo3PrintError($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', true), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', true), ''); exit; } // Finding the icon switch ($GLOBALS['FILEMOUNTS'][$key]['type']) { case 'user': $this->icon = 'gfx/i/_icon_ftp_user.gif'; break; case 'group': $this->icon = 'gfx/i/_icon_ftp_group.gif'; break; default: $this->icon = 'gfx/i/_icon_ftp.gif'; break; } $this->icon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], $this->icon, 'width="18" height="16"') . ' title="" alt="" />'; // Relative path to filemount, $key: $this->shortPath = substr($this->target, strlen($GLOBALS['FILEMOUNTS'][$key]['path'])); // Setting title: $this->title = $this->icon . htmlspecialchars($GLOBALS['FILEMOUNTS'][$key]['name']) . ': ' . $this->shortPath; // Setting template object $this->doc = t3lib_div::makeInstance('template'); $this->doc->setModuleTemplate('templates/file_upload.html'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->form = '<form action="tce_file.php" method="post" name="editform" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '">'; if ($GLOBALS['BE_USER']->jsConfirmation(1)) { $confirm = ' && confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.redraw')) . ')'; } else { $confirm = ''; } $this->doc->JScode = $this->doc->wrapScriptTags(' var path = "' . $this->target . '"; function reload(a) { // if (!changed || (changed ' . $confirm . ')) { var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl=' . urlencode($this->charsetConversion->conv($this->returnUrl, $GLOBALS['LANG']->charSet, 'utf-8')) . '"; window.location.href = "file_upload.php?"+params; } } function backToList() { // top.goToModule("file_list"); } var changed = 0; '); }
/** * Prints the selector box form-field for the db/file/select elements (multiple) * * @param string Form element name * @param string Mode "db", "file" (internal_type for the "group" type) OR blank (then for the "select" type). Seperated with '|' a user defined mode can be set to be passed as param to the EB. * @param string Commalist of "allowed" * @param array The array of items. For "select" and "group"/"file" this is just a set of value. For "db" its an array of arrays with table/uid pairs. * @param string Alternative selector box. * @param array An array of additional parameters, eg: "size", "info", "headers" (array with "selector" and "items"), "noBrowser", "thumbnails" * @param string On focus attribute string * @param string $user_el_param Additional parameter for the EB * @return string The form fields for the selection. */ function dbFileIcons($fName, $mode, $allowed, $itemArray, $selector = '', $params = array(), $onFocus = '', $userEBParam = '') { list($mode, $modeEB) = explode('|', $mode); $modeEB = $modeEB ? $modeEB : $mode; $disabled = ''; if ($this->tceforms->renderReadonly || $params['readOnly']) { $disabled = ' disabled="disabled"'; } // Sets a flag which means some JavaScript is included on the page to support this element. $this->tceforms->printNeededJS['dbFileIcons'] = 1; // INIT $uidList = array(); $opt = array(); $itemArrayC = 0; // Creating <option> elements: if (is_array($itemArray)) { $itemArrayC = count($itemArray); reset($itemArray); switch ($mode) { case 'db': while (list(, $pp) = each($itemArray)) { if ($pp['title']) { $pTitle = $pp['title']; } else { if (function_exists('t3lib_BEfunc::getRecordWSOL')) { $pRec = t3lib_BEfunc::getRecordWSOL($pp['table'], $pp['id']); } else { $pRec = t3lib_BEfunc::getRecord($pp['table'], $pp['id']); } $pTitle = is_array($pRec) ? $pRec[$GLOBALS['TCA'][$pp['table']]['ctrl']['label']] : NULL; } if ($pTitle) { $pTitle = $pTitle ? t3lib_div::fixed_lgd_cs($pTitle, $this->tceforms->titleLen) : t3lib_BEfunc::getNoRecordTitle(); $pUid = $pp['table'] . '_' . $pp['id']; $uidList[] = $pUid; $opt[] = '<option value="' . htmlspecialchars($pUid) . '">' . htmlspecialchars($pTitle) . '</option>'; } } break; case 'folder': case 'file': while (list(, $pp) = each($itemArray)) { $pParts = explode('|', $pp); $uidList[] = $pUid = $pTitle = $pParts[0]; $opt[] = '<option value="' . htmlspecialchars(rawurldecode($pParts[0])) . '">' . htmlspecialchars(rawurldecode($pParts[0])) . '</option>'; } break; default: while (list(, $pp) = each($itemArray)) { $pParts = explode('|', $pp, 2); $uidList[] = $pUid = $pParts[0]; $pTitle = $pParts[1] ? $pParts[1] : $pParts[0]; $opt[] = '<option value="' . htmlspecialchars(rawurldecode($pUid)) . '">' . htmlspecialchars(rawurldecode($pTitle)) . '</option>'; } break; } } // Create selector box of the options $sSize = $params['autoSizeMax'] ? t3lib_div::intInRange($itemArrayC + 1, t3lib_div::intInRange($params['size'], 1), $params['autoSizeMax']) : $params['size']; if (!$selector) { $selector = '<select size="' . $sSize . '"' . $this->tceforms->insertDefStyle('group') . ' multiple="multiple" name="' . $fName . '_list" ' . $onFocus . $params['style'] . $disabled . '>' . implode('', $opt) . '</select>'; } $icons = array('L' => array(), 'R' => array()); if (!$params['readOnly']) { if (!$params['noBrowser']) { $aOnClick = 'setFormValueOpenBrowser(\'' . $modeEB . '\',\'' . ($fName . '|||' . $allowed . '|' . $userEBParam . '|') . '\'); return false;'; $icons['R'][] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/insert3.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_browse_' . ($mode === 'file' ? 'file' : 'db'))) . ' />' . '</a>'; } if (!$params['dontShowMoveIcons']) { if ($sSize >= 5) { $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Top\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/group_totop.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_move_to_top')) . ' />' . '</a>'; } $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Up\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/up.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_move_up')) . ' />' . '</a>'; $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Down\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/down.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_move_down')) . ' />' . '</a>'; if ($sSize >= 5) { $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Bottom\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/group_tobottom.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_move_to_bottom')) . ' />' . '</a>'; } } // todo Clipboard $clipElements = $this->tceforms->getClipboardElements($allowed, $mode); if (count($clipElements)) { $aOnClick = ''; # $counter = 0; foreach ($clipElements as $elValue) { if ($mode === 'file' or $mode === 'folder') { $itemTitle = 'unescape(\'' . rawurlencode(tx_dam::file_basename($elValue)) . '\')'; } else { // 'db' mode assumed list($itemTable, $itemUid) = explode('|', $elValue); if (function_exists('t3lib_BEfunc::getRecordWSOL')) { $rec = t3lib_BEfunc::getRecordWSOL($itemTable, $itemUid); } else { $rec = t3lib_BEfunc::getRecord($itemTable, $itemUid); } $itemTitle = $GLOBALS['LANG']->JScharCode(t3lib_BEfunc::getRecordTitle($itemTable, $rec)); $elValue = $itemTable . '_' . $itemUid; } $aOnClick .= 'setFormValueFromBrowseWin(\'' . $fName . '\',\'' . t3lib_div::slashJS(t3lib_div::rawUrlEncodeJS($elValue)) . '\',' . t3lib_div::slashJS($itemTitle) . ');'; #$aOnClick .= 'setFormValueFromBrowseWin(\''.$fName.'\',unescape(\''.rawurlencode(str_replace('%20', ' ', $elValue)).'\'),'.$itemTitle.');'; # $counter++; # if ($params['maxitems'] && $counter >= $params['maxitems']) { break; } // Makes sure that no more than the max items are inserted... for convenience. } $aOnClick .= 'return false;'; $icons['R'][] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/insert5.png', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib(sprintf($this->tceforms->getLL('l_clipInsert_' . ($mode === 'file' ? 'file' : 'db')), count($clipElements))) . ' />' . '</a>'; } $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Remove\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/group_clear.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_remove_selected')) . ' />' . '</a>'; } $str = '<table border="0" cellpadding="0" cellspacing="0" width="1"> ' . ($params['headers'] ? ' <tr> <td>' . $this->tceforms->wrapLabels($params['headers']['selector']) . '</td> <td></td> <td></td> <td></td> <td>' . ($params['thumbnails'] ? $this->tceforms->wrapLabels($params['headers']['items']) : '') . '</td> </tr>' : '') . ' <tr> <td valign="top">' . $selector . '<br />' . $this->tceforms->wrapLabels($params['info']) . '</td> <td valign="top">' . implode('<br />', $icons['L']) . '</td> <td valign="top">' . implode('<br />', $icons['R']) . '</td> <td style="height:5px;"><span></span></td> <td valign="top">' . $this->tceforms->wrapLabels($params['thumbnails']) . '</td> </tr> </table>'; // Creating the hidden field which contains the actual value as a comma list. $str .= '<input type="hidden" name="' . $fName . '" value="' . htmlspecialchars(implode(',', $uidList)) . '" />'; return $str; }
/** * Gets the buttons that shall be rendered in the docHeader. * * @return array Available buttons for the docHeader */ protected function getDocHeaderButtons() { $buttons = array( 'csh' => t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaCM1', '', $this->backPath), 'back' => '', 'shortcut' => $this->getShortcutButton(), ); // Back if ($this->returnUrl) { $backIcon = t3lib_iconWorks::getSpriteIcon('actions-view-go-back'); $buttons['back'] = '<a href="' . htmlspecialchars(t3lib_div::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', TRUE) . '">' . $backIcon . '</a>'; } return $buttons; }
/** * Main function of class * * @return string HTML output */ function main() { global $LANG; $menu = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[tsconf_parts]', $this->pObj->MOD_SETTINGS['tsconf_parts'], $this->pObj->MOD_MENU['tsconf_parts']); $menu .= '<br /><label for="checkTsconf_alphaSort">' . $GLOBALS['LANG']->getLL('sort_alphabetic', true) . '</label> ' . t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[tsconf_alphaSort]', $this->pObj->MOD_SETTINGS['tsconf_alphaSort'], '', '', 'id="checkTsconf_alphaSort"'); $menu .= '<br /><br />'; if ($this->pObj->MOD_SETTINGS['tsconf_parts'] == 99) { $TSparts = t3lib_BEfunc::getPagesTSconfig($this->pObj->id, '', 1); $lines = array(); $pUids = array(); foreach ($TSparts as $k => $v) { if ($k != 'uid_0') { if ($k == 'defaultPageTSconfig') { $pTitle = '<strong>' . $GLOBALS['LANG']->getLL('editTSconfig_default', 1) . '</strong>'; $editIcon = ''; } else { $pUids[] = substr($k, 4); $row = t3lib_BEfunc::getRecordWSOL('pages', substr($k, 4)); $pTitle = $this->pObj->doc->getHeader('pages', $row, '', 0); $editIdList = substr($k, 4); $params = '&edit[pages][' . $editIdList . ']=edit&columnsOnly=TSconfig'; $onclickUrl = t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], ''); $editIcon = '<a href="#" onclick="' . htmlspecialchars($onclickUrl) . '" title="' . $GLOBALS['LANG']->getLL('editTSconfig', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>'; } $TScontent = nl2br(htmlspecialchars(trim($v) . chr(10))); $tsparser = t3lib_div::makeInstance('t3lib_TSparser'); $tsparser->lineNumberOffset = 0; $TScontent = $tsparser->doSyntaxHighlight(trim($v) . LF, '', 0); $lines[] = ' <tr><td nowrap="nowrap" class="bgColor5">' . $pTitle . '</td></tr> <tr><td nowrap="nowrap" class="bgColor4">' . $TScontent . $editIcon . '</td></tr> <tr><td> </td></tr> '; } } if (count($pUids)) { $params = '&edit[pages][' . implode(',', $pUids) . ']=edit&columnsOnly=TSconfig'; $onclickUrl = t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], ''); $editIcon = '<a href="#" onclick="' . htmlspecialchars($onclickUrl) . '" title="' . $GLOBALS['LANG']->getLL('editTSconfig_all', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '<strong>' . $GLOBALS['LANG']->getLL('editTSconfig_all', 1) . '</strong>' . '</a>'; } else { $editIcon = ''; } $theOutput .= $this->pObj->doc->section($LANG->getLL('tsconf_title'), t3lib_BEfunc::cshItem('_MOD_' . $GLOBALS['MCONF']['name'], 'tsconfig_edit', $GLOBALS['BACK_PATH'], '|<br />') . $menu . ' <br /><br /> <!-- Edit fields: --> <table border="0" cellpadding="0" cellspacing="1">' . implode('', $lines) . '</table><br />' . $editIcon, 0, 1); } else { $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); // Defined global here! $tmpl->tt_track = 0; // Do not log time-performance information $tmpl->fixedLgd = 0; $tmpl->linkObjects = 0; $tmpl->bType = ''; $tmpl->ext_expandAllNotes = 1; $tmpl->ext_noPMicons = 1; switch ($this->pObj->MOD_SETTINGS['tsconf_parts']) { case '1': $modTSconfig = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'mod'); break; case '1a': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_layout', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1b': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_view', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1c': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_modules', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1d': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_list', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1e': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_info', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1f': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_func', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1g': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_ts', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '2': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '5': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEFORM', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '6': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '3': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TSFE', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '4': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('user', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; default: $modTSconfig['properties'] = t3lib_BEfunc::getPagesTSconfig($this->pObj->id); break; } $modTSconfig = $modTSconfig['properties']; if (!is_array($modTSconfig)) { $modTSconfig = array(); } $theOutput .= $this->pObj->doc->section($LANG->getLL('tsconf_title'), t3lib_BEfunc::cshItem('_MOD_' . $GLOBALS['MCONF']['name'], 'tsconfig_hierarchy', $GLOBALS['BACK_PATH'], '|<br />') . $menu . ' <!-- Page TSconfig Tree: --> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td nowrap="nowrap">' . $tmpl->ext_getObjTree($modTSconfig, '', '', '', '', $this->pObj->MOD_SETTINGS['tsconf_alphaSort']) . '</td> </tr> </table>', 0, 1); } // Return output: return $theOutput; }
/** * Returns an image-tag with an 18x16 icon of the following types: * * $type: * -1: OK icon (Check-mark) * 1: Notice (Speach-bubble) * 2: Warning (Yellow triangle) * 3: Fatal error (Red stop sign) * * @param integer See description * @return string HTML image tag (if applicable) */ function infoIcon($type) { global $BACK_PATH; $title = ''; switch ($type) { case '3': $icon = 'gfx/icon_fatalerror.gif'; $title = 'File does not exist!'; break; case '2': $icon = 'gfx/icon_warning.gif'; $title = 'File changed'; break; case '1': $icon = 'gfx/icon_note.gif'; break; case '-1': $icon = 'gfx/icon_ok.gif'; break; default: break; } if ($icon) { return '<img' . t3lib_iconWorks::skinImg($BACK_PATH, $icon, 'width="18" height="16"') . ' class="absmiddle" title="' . htmlspecialchars($title) . '" alt="" />'; } }
/** * Return a control (eg. selection icons) for the element * * @param string Title string * @param string Item record * @param integer Bank pointer (which mount point number) * @return string */ function getControl($title, $row) { global $BACK_PATH; $control = ''; if ($this->modeSelIcons and !($this->mode === 'tceformsSelect') and ($row['uid'] or $row['uid'] == '0' and $this->linkRootCat)) { $aOnClick = 'return jumpTo(\'' . $this->getJumpToParam($row, 'OR') . '\',this,\'' . $this->treeName . '\');'; $icon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/plus.gif', 'width="8" height="11"') . ' alt="" />'; $control .= '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $icon . '</a>'; $aOnClick = 'return jumpTo(\'' . $this->getJumpToParam($row, 'AND') . '\',this,\'' . $this->treeName . '\');'; $icon = '<img src="' . $BACK_PATH . PATH_txdam_rel . 'i/equals.gif" width="8" height="11" border="0" alt="" />'; $icon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/equals.gif', 'width="8" height="11"') . ' alt="" />'; $control .= '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $icon . '</a>'; $aOnClick = 'return jumpTo(\'' . $this->getJumpToParam($row, 'NOT') . '\',this,\'' . $this->treeName . '\');'; $icon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/minus.gif', 'width="8" height="11"') . ' alt="" />'; $control .= '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $icon . '</a>'; $control .= '<img src="' . $BACK_PATH . 'clear.gif" width="12" height="11" border="0" alt="" />'; } return $control; }
/** * Returns the icon of an item * * @param string The select value/id * @param string The select value (true/false,...) * @return string */ function selection_getItemIcon($id, $value) { if ($icon = $this->getDefaultIcon()) { $icon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], $icon, 'width="18" height="16"') . ' class="typo3-icon" alt="" />'; } return $icon; }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @return array all available buttons as an assoc. array */ protected function getButtons() { $buttons = array('csh' => '', 'back' => ''); // CSH $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'history_log', $GLOBALS['BACK_PATH'], '', TRUE); // Start history object $historyObj = t3lib_div::makeInstance('recordHistory'); if ($historyObj->returnUrl) { $buttons['back'] = '<a href="' . htmlspecialchars($historyObj->returnUrl) . '" class="typo3-goBack">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-back') . '</a>'; } return $buttons; }
/** * Making the form for create file * * @return string HTML content */ function renderForm($fileContent = '') { global $BE_USER, $LANG, $TYPO3_CONF_VARS; $content = ''; $msg = array(); $this->pObj->markers['FOLDER_INFO'] = tx_dam_guiFunc::getFolderInfoBar(tx_dam::path_compileInfo($this->pObj->media->pathAbsolute)); $msg[] = ' '; $this->pObj->markers['FILE_INFO'] = $GLOBALS['LANG']->sL('LLL:EXT:dam/locallang_db.xml:tx_dam_item.file_name', 1) . ' <strong>' . htmlspecialchars($this->pObj->media->filename) . '</strong>'; $msg[] = ' '; $msg[] = $GLOBALS['LANG']->getLL('tx_dam_cmd_filenew.text_content', 1); $msg[] = '<textarea rows="30" name="data[file_content]" wrap="off"' . $this->pObj->doc->formWidthText(48, 'width:99%;height:65%', 'off') . ' class="fixed-font enable-tab">' . t3lib_div::formatForTextarea($fileContent) . '</textarea>'; $this->pObj->docHeaderButtons['SAVE'] = '<input class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/savedok.gif') . ' title="' . $GLOBALS['LANG']->getLL('labelCmdSave', 1) . '" height="16" type="image" width="16">'; $this->pObj->docHeaderButtons['SAVE_CLOSE'] = '<input class="c-inputButton" name="_saveandclosedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/saveandclosedok.gif') . ' title="' . $GLOBALS['LANG']->getLL('labelCmdSaveClose', 1) . '" height="16" type="image" width="16">'; $this->pObj->docHeaderButtons['CLOSE'] = '<a href="#" onclick="jumpBack(); return false;"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" alt="" height="16" width="16"></a>'; if (tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.displayExtraButtons', 1)) { $buttons = ' <input type="submit" name="save" value="' . $GLOBALS['LANG']->getLL('labelCmdSave', 1) . '" /> <input type="submit" name="_saveandclosedok_x" value="' . $GLOBALS['LANG']->getLL('labelCmdSaveClose', 1) . '" /> <input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />'; } $content .= $GLOBALS['SOBE']->getMessageBox($GLOBALS['SOBE']->pageTitle, $msg, $buttons, 1); return $content; }
/** * 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 ...) */ function expandPage() { $out = ''; $expPageId = $this->browseLinks->expandPage; // Set page id (if any) to expand // If there is an anchor value (content element reference) in the element reference, then force an ID to expand: if (!$this->browseLinks->expandPage && $this->browseLinks->curUrlInfo['cElement']) { $expPageId = $this->browseLinks->curUrlInfo['pageid']; // Set to the current link page id. } // Draw the record list IF there is a page id to expand: if ($expPageId && t3lib_utility_Math::canBeInterpretedAsInteger($expPageId) && $GLOBALS['BE_USER']->isInWebMount($expPageId)) { // Set header: $out .= $this->browseLinks->barheader($GLOBALS['LANG']->getLL('contentElements') . ':'); // Create header for listing, showing the page title/icon: $titleLen = intval($GLOBALS['BE_USER']->uc['titleLen']); $mainPageRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL('pages', $expPageId); $picon = t3lib_iconWorks::getSpriteIconForRecord('pages', $mainPageRec); $picon .= \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $mainPageRec, TRUE); $out .= $picon . '<br />'; // Look up tt_content elements from the expanded page: $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,header,hidden,starttime,endtime,fe_group,CType,colPos,bodytext,tx_jfmulticontent_view,tx_jfmulticontent_pages,tx_jfmulticontent_contents', 'tt_content', 'pid=' . intval($expPageId) . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tt_content') . \TYPO3\CMS\Backend\Utility\BackendUtility::versioningPlaceholderClause('tt_content'), '', 'colPos,sorting'); $cc = $GLOBALS['TYPO3_DB']->sql_num_rows($res); // Traverse list of records: $c = 0; while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $c++; $icon = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $row); if ($this->browseLinks->curUrlInfo['act'] == 'page' && $this->browseLinks->curUrlInfo['cElement'] == $row['uid']) { $arrCol = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/blinkarrow_left.gif', 'width="5" height="9"') . ' class="c-blinkArrowL" alt="" />'; } else { $arrCol = ''; } // Putting list element HTML together: $out .= '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/join' . ($c == $cc ? 'bottom' : '') . '.gif', 'width="18" height="16"') . ' alt="" />' . $arrCol . '<a href="#" onclick="return link_typo3Page(\'' . $expPageId . '\',\'#' . $row['uid'] . '\');">' . $icon . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('tt_content', $row, TRUE) . '</a><br />'; $contents = array(); // get all contents switch ($row['tx_jfmulticontent_view']) { case "page": $contents = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(",", $row['tx_jfmulticontent_pages']); break; case "content": $contents = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(",", $row['tx_jfmulticontent_contents']); break; case "irre": $resIrre = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'tx_jfmulticontent_irre_parentid=' . intval($row['uid']) . ' AND deleted = 0 AND hidden = 0', '', ''); while ($rowIrre = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resIrre)) { $contents[] = $rowIrre['uid']; } break; } if (count($contents) > 0) { $out .= '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/line.gif', 'width="18" height="16"') . ' alt="" />' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/blank.gif', 'width="18" height="16"') . ' alt="" />'; foreach ($contents as $key => $content) { $out .= '<a href="#" onclick="return link_typo3Page(\'' . $expPageId . '\',\'#jfmulticontent_c' . $row['uid'] . '-' . ($key + 1) . '\');">' . ' ' . ($key + 1) . ' ' . '</a>'; } $out .= '<br/>'; } } } return $out; }