/** * 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>'; }
/** * 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'; } }
/** * 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); }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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="" />'; } }
/** * Creates lines for the editing form. * * @return void */ function editLoadedFunc() { global $BE_USER, $LANG; $this->editLoaded = 0; if (is_array($this->editSC_rec) && ($this->editSC_rec['sc_group'] >= 0 || $BE_USER->isAdmin())) { // sc_group numbers below 0 requires admin to edit those. sc_group numbers above zero must always be owned by the user himself. $this->editLoaded = 1; $opt = array(); $opt[] = '<option value="0"></option>'; foreach ($this->groupLabels as $k => $v) { if ($v && strcmp('1', $v)) { $label = $v; } else { $label = $LANG->getLL('shortcut_group_' . $k, 1); if (!$label) { $label = $LANG->getLL('shortcut_group', 1) . ' ' . $k; } // Fallback label } $opt[] = '<option value="' . $k . '"' . (!strcmp($this->editSC_rec['sc_group'], $k) ? ' selected="selected"' : '') . '>' . $label . '</option>'; } if ($BE_USER->isAdmin()) { foreach ($this->groupLabels as $k => $v) { if ($v && strcmp('1', $v)) { $label = $v; } else { $label = $LANG->getLL('shortcut_group_' . $k, 1); if (!$label) { $label = $LANG->getLL('shortcut_group', 1) . ' ' . $k; } // Fallback label } $label = $LANG->getLL('shortcut_global', 1) . ': ' . $label; // Add a prefix for global groups $opt[] = '<option value="-' . $k . '"' . (!strcmp($this->editSC_rec['sc_group'], '-' . $k) ? ' selected="selected"' : '') . '>' . $label . '</option>'; } $opt[] = '<option value="-100"' . (!strcmp($this->editSC_rec['sc_group'], '-100') ? ' selected="selected"' : '') . '>' . $LANG->getLL('shortcut_global', 1) . ': ' . $LANG->getLL('shortcut_all', 1) . '</option>'; } // border="0" hspace="2" width="21" height="16" - not XHTML compliant in <input type="image" ...> $manageForm = ' <!-- Shortcut Editing Form: --> <table border="0" cellpadding="0" cellspacing="0" id="typo3-shortcuts-editing"> <tr> <td> </td> <td><input type="image" class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedok.gif', '') . ' title="' . $LANG->getLL('shortcut_save', 1) . '" /></td> <td><input type="image" class="c-inputButton" name="_saveclosedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/saveandclosedok.gif', '') . ' title="' . $LANG->getLL('shortcut_saveClose', 1) . '" /></td> <td><input type="image" class="c-inputButton" name="_closedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/closedok.gif', '') . ' title="' . $LANG->getLL('shortcut_close', 1) . '" /></td> <td><input type="image" class="c-inputButton" name="_deletedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/deletedok.gif', '') . ' title="' . $LANG->getLL('shortcut_delete', 1) . '" /></td> <td><input name="editName" type="text" value="' . htmlspecialchars($this->editSC_rec['description']) . '"' . $this->doc->formWidth(15) . ' /></td> <td><select name="editGroup">' . implode('', $opt) . '</select></td> </tr> </table> <input type="hidden" name="whichItem" value="' . $this->editSC_rec['uid'] . '" /> '; } else { $manageForm = ''; } if (!$this->editLoaded && count($this->selOpt) > 1) { $this->lines[] = '<td> </td>'; $this->lines[] = '<td><select name="_selSC" onchange="eval(this.options[this.selectedIndex].value);this.selectedIndex=0;">' . implode('', $this->selOpt) . '</select></td>'; } // $this->linesPre contains elements with sc_group>=0 $this->lines = array_merge($this->linesPre, $this->lines); if (count($this->lines)) { if (!$BE_USER->getTSConfigVal('options.mayNotCreateEditShortcuts')) { $this->lines = array_merge(array('<td><input type="checkbox" id="editShortcut_check" name="editShortcut_check" value="1"' . ($this->editSC ? ' checked="checked"' : '') . ' /> <label for="editShortcut_check">' . $LANG->getLL('shortcut_edit', 1) . '</label> </td>'), $this->lines); $this->lines[] = '<td>' . $manageForm . '</td>'; } $this->lines[] = '<td><img src="clear.gif" width="10" height="1" alt="" /></td>'; } }
/** * Rendering the copy file form for a multiple items * * @return string HTML content */ function renderFormMulti($items, $targetFolder) { global $BACK_PATH, $LANG, $TCA; $content = ''; $references = 0; // FOLDER_INFO is missing due to missing param in current function - so we set it to nothing $this->pObj->markers['FOLDER_INFO'] = ''; $titleNotExists = 'title="' . $GLOBALS['LANG']->getLL('fileNotExists', true) . '"'; $iconNotExists = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/error_h.gif', 'width="10" height="10"') . ' ' . $titleNotExists . ' valign="top" alt="" />'; $referencedIcon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/is_referenced.gif', 'width="15" height="12"') . ' title="' . $LANG->getLL($this->langPrefix . 'messageReferencesUsed', 1) . '" alt="" />'; // init table layout $tableLayout = array('table' => array('<table cellpadding="2" cellspacing="1" border="0" width="100%">', '</table>'), '0' => array('defCol' => array('<th nowrap="nowrap" class="bgColor5">', '</th>'), '0' => array('<th width="1%" class="bgColor5">', '</th>'), '1' => array('<th width="1%" class="bgColor5">', '</th>'), '3' => array('<th width="1%" class="bgColor5">', '</th>'), '4' => array('<th width="1%" class="bgColor5">', '</th>'), '5' => array('<th width="1%" class="bgColor5">', '</th>')), 'defRow' => array('defCol' => array('<td nowrap="nowrap" class="bgColor4">', '</td>'), '2' => array('<td class="bgColor4">', '</td>'), '3' => array('<td style="text-align:center" class="bgColor4">', '</td>'), '4' => array('<td style="padding:0 5px 0 5px" class="bgColor4">', '</td>'), '5' => array('<td style="text-align:center" class="bgColor4">', '</td>'))); $cTable = array(); $tr = 0; $td = 0; $cTable[$tr][$td++] = ' '; $cTable[$tr][$td++] = ' '; $cTable[$tr][$td++] = $LANG->sL($TCA['tx_dam']['columns']['title']['label'], 1); $cTable[$tr][$td++] = ' '; $cTable[$tr][$td++] = ' '; $cTable[$tr][$td++] = $LANG->sL($TCA['tx_dam']['columns']['file_path']['label'], 1); $tr++; foreach ($items as $id => $meta) { $filepath = tx_dam::file_absolutePath($meta); if ($meta['file_accessable']) { $checkbox = '<input type="checkbox" name="data[' . $this->copyOrMove . '][' . $id . '][data]" value="' . htmlspecialchars($filepath) . '" checked="checked" />'; } else { $checkbox = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/error_h.gif', 'width="10" height="10"') . ' title="' . $LANG->getLL('accessDenied', true) . '" alt="" />'; } $title = $meta['title'] ? $meta['title'] : $meta['file_name']; $title = t3lib_div::fixed_lgd_cs($title, 50); $icon = tx_dam_guiFunc::icon_getFileTypeImgTag($meta, 'class="c-recicon"', false); if (!@file_exists($filepath)) { $icon .= $iconNotExists; $info = ''; } else { $info = $GLOBALS['SOBE']->btn_infoFile($meta); } // Add row to table $td = 0; $cTable[$tr][$td++] = $checkbox; $cTable[$tr][$td++] = $icon; $cTable[$tr][$td++] = htmlspecialchars($title); $cTable[$tr][$td++] = htmlspecialchars(strtoupper($meta['file_type'])); $cTable[$tr][$td++] = $info; $cTable[$tr][$td++] = htmlspecialchars(t3lib_div::fixed_lgd_cs($meta['file_path'], -15)); $tr++; } $itemTable = $this->pObj->doc->table($cTable, $tableLayout); $targetFolderRel = tx_dam::path_makeRelative($targetFolder); $msg = array(); $msg[] = ' '; $msg[] = $LANG->getLL('labelTargetFolder', 1) . ' <strong>' . htmlspecialchars($targetFolderRel) . '</strong>'; $msg[] = ' '; $msg[] = htmlspecialchars(sprintf($LANG->getLL($this->langPrefix . 'message'), $targetFolderRel)); $msg[] = ' '; $msg[] = $itemTable; $buttons = ' <input type="hidden" name="data[' . $this->copyOrMove . '][' . $id . '][data]" value="' . htmlspecialchars($filepath) . '" /> <input type="hidden" name="data[' . $this->copyOrMove . '][' . $id . '][target]" value="' . htmlspecialchars($targetFolder) . '" />'; if (tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.displayExtraButtons', 1)) { if ($this->copyOrMove == 'copy') { $buttons .= ' <input type="submit" value="' . $LANG->getLL('tx_dam_cmd_filecopy.submit', 1) . '" /> <input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />'; } else { $buttons .= ' <input type="submit" value="' . $LANG->getLL('tx_dam_cmd_filemove.submit', 1) . '" /> <input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />'; } } $this->pObj->docHeaderButtons['SAVE'] = '<input class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/clip_copy.gif') . ' title="' . $LANG->getLL($this->langPrefix . 'submit', 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>'; $content .= $GLOBALS['SOBE']->getMessageBox($GLOBALS['SOBE']->pageTitle, $msg, $buttons, 1); return $content; }
/** * Creates the control panel for a single record in the listing. * * @param string The table * @param array The record for which to make the control panel. * @return string HTML table with the control panel (unless disabled) */ function makeControl($table, $row) { global $TCA, $LANG, $BACK_PATH; // Return blank, if disabled: # if ($this->dontShowClipControlPanels) return ''; // Initialize: t3lib_div::loadTCA($table); $cells = array(); $shEl = $this->showElements; // If the listed table is 'pages' we have to request the permission settings for each page: if ($table == 'pages') { $localCalcPerms = $GLOBALS['BE_USER']->calcPerms(t3lib_BEfunc::getRecord('pages', $row['uid'])); } // This expresses the edit permissions for this particular element: $permsEdit = $table == 'pages' && $localCalcPerms & 2 || $table != 'pages' && $this->calcPerms & 16; // "Edit" link: ( Only if permissions to edit the page-record of the content of the parent page ($this->id) if ($permsEdit && in_array('editRec', $shEl)) { $params = '&edit[' . $table . '][' . $row['uid'] . ']=edit'; $icon = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/edit2' . (!$TCA[$table]['ctrl']['readOnly'] ? '' : '_d') . '.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('edit', 1) . '" alt="" />'; $cells[] = $this->wrapEditLink($icon, $params); } // If the extended control panel is enabled OR if we are seeing a single table: if ($GLOBALS['SOBE']->MOD_SETTINGS['bigControlPanel'] || $this->table) { // "Info": (All records) if (in_array('infoRec', $shEl)) { $cells[] = '<a href="#" onclick="' . htmlspecialchars('top.launchView(\'' . $table . '\', \'' . $row['uid'] . '\'); return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/zoom2.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('showInfo', 1) . '" alt="" />' . '</a>'; } // If the table is NOT a read-only table, then show these links: if (!$TCA[$table]['ctrl']['readOnly']) { // "Revert" link (history/undo) if (in_array('revertRec', $shEl)) { $cells[] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $this->backPath . 'show_rechis.php?element=' . rawurlencode($table . ':' . $row['uid']) . '\',\'#latest\');') . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/history2.gif', 'width="13" height="12"') . ' title="' . $LANG->getLL('history', 1) . '" alt="" />' . '</a>'; } // Versioning: if (t3lib_extMgm::isLoaded('version')) { $vers = t3lib_BEfunc::selectVersionsOfRecord($table, $row['uid'], $fields = 'uid'); if (is_array($vers)) { // If table can be versionized. if (count($vers) > 1) { $st = 'background-color: #FFFF00; font-weight: bold;'; $lab = count($vers) - 1; } else { $st = 'background-color: #9999cc; font-weight: bold;'; $lab = 'V'; } $cells[] = '<a href="' . htmlspecialchars($this->backPath . t3lib_extMgm::extRelPath('version')) . 'cm1/index.php?table=' . rawurlencode($table) . '&uid=' . rawurlencode($row['uid']) . '" class="typo3-ctrl-versioning" style="' . htmlspecialchars($st) . '">' . $lab . '</a>'; } } // "Edit Perms" link: if ($table == 'pages' && in_array('permsRec', $shEl) && $GLOBALS['BE_USER']->check('modules', 'web_perm')) { $cells[] = '<a href="' . htmlspecialchars($this->backPath . 'mod/web/perm/index.php?id=' . $row['uid'] . '&return_id=' . $row['uid'] . '&edit=1') . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/perm.gif', 'width="7" height="12"') . ' title="' . $LANG->getLL('permissions', 1) . '" alt="" />' . '</a>'; } // "Up/Down" links if ($permsEdit && $TCA[$table]['ctrl']['sortby'] && !$this->sortField && in_array('sortRec', $shEl)) { // if (isset($this->currentTable['prev'][$row['uid']])) { // Up $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['prev'][$row['uid']]; $cells[] = '<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/button_up.gif', 'width="11" height="10"') . ' title="' . $LANG->getLL('moveUp', 1) . '" alt="" />' . '</a>'; } else { $cells[] = '<img src="clear.gif" ' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/button_up.gif', 'width="11" height="10"', 2) . ' alt="" />'; } if ($this->currentTable['next'][$row['uid']]) { // Down $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['next'][$row['uid']]; $cells[] = '<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/button_down.gif', 'width="11" height="10"') . ' title="' . $LANG->getLL('moveDown', 1) . '" alt="" />' . '</a>'; } else { $cells[] = '<img src="clear.gif" ' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/button_down.gif', 'width="11" height="10"', 2) . ' alt="" />'; } } // "Hide/Unhide" links: $hiddenField = $TCA[$table]['ctrl']['enablecolumns']['disabled']; if ($permsEdit && $hiddenField && $TCA[$table]['columns'][$hiddenField] && in_array('unHideRec', $shEl) && (!$TCA[$table]['columns'][$hiddenField]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $table . ':' . $hiddenField))) { if ($row[$hiddenField]) { $params = '&data[' . $table . '][' . $row['uid'] . '][' . $hiddenField . ']=0'; $cells[] = '<a title="' . $LANG->getLL('unHide' . ($table == 'pages' ? 'Page' : ''), 1) . '" href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-unhide') . '</a>'; } else { $params = '&data[' . $table . '][' . $row['uid'] . '][' . $hiddenField . ']=1'; $cells[] = '<a title="' . $LANG->getLL('hide' . ($table == 'pages' ? 'Page' : ''), 1) . '" href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-hide') . '</a>'; } } // "Delete" link: // if ( ($table=='pages' && ($localCalcPerms&4)) || ($table!='pages' && ($this->calcPerms&16)) && in_array('delRec',$shEl) ) { // $params='&cmd['.$table.']['.$row['uid'].'][delete]=1'; // $title = $row['title'].' ('.$row['file_name'].')'; // // $cells[]='<a href="#" onclick="if (confirm('.$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.delete'),$title)).')) {jumpToUrl(\''.$GLOBALS['SOBE']->doc->issueCommand($params,-1).'\');} return false;"><img src="'.$this->backPath.'gfx/delete_record.gif" width="12" height="12" border="0" align="top" title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.delete',1).'" /></a>'; // } // ToDo: weird: quickDelete = true means that there is a confirmation message // Todo: quickDelete=true is hardcoded $quickDelete = true; // "Delete" with confirmation (default) if ($quickDelete and $table == 'pages' && $localCalcPerms & 4 || $table != 'pages' && $this->calcPerms & 16 && in_array('delRec', $shEl)) { $params = '&cmd[tx_dam_cat][' . $row['uid'] . '][delete]=1'; $title = $row['title'] . ' (' . $row['file_name'] . ')'; $onClick = 'if (confirm(' . $GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.delete'), $title)) . ')) {jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');} return false;'; $cells[] = '<a title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.delete', 1) . '" href="#" onclick="' . $onClick . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-delete') . '</a>'; } // Todo: Quick delete. Works but without redirect back to the overview. if (!$quickDelete and $table == 'pages' && $localCalcPerms & 4 || $table != 'pages' && $this->calcPerms & 16 && in_array('delRec', $shEl)) { $cmd = 'tx_dam_cmd_filedelete'; $script = $BACK_PATH . PATH_txdam_rel . 'mod_cmd/index.php?CMD=' . $cmd . '&vC=' . $GLOBALS['BE_USER']->veriCode() . '&id=' . rawurlencode($row['uid']) . '&returnUrl=' . t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'); $cells[] = '<a href="' . htmlspecialchars($script) . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/delete_record.gif', 'width="12" height="12"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.delete', 1) . '" alt="" />' . '</a>'; } } } // If the record is edit-locked by another user, we will show a little warning sign: if ($lockInfo = t3lib_BEfunc::isRecordLocked($table, $row['uid'])) { $cells[] = '<a href="#" onclick="' . htmlspecialchars('alert(' . $LANG->JScharCode($lockInfo['msg']) . ');return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/recordlock_warning3.gif', 'width="17" height="12"') . ' title="' . htmlspecialchars($lockInfo['msg']) . '" alt="" />' . '</a>'; } // Compile items into a DIV-element: return ' <!-- CONTROL PANEL: ' . $table . ':' . $row['uid'] . ' --> <div class="typo3-DBctrl">' . implode('', $cells) . '</div>'; }
/** * Constructor function for class * * @return void */ function init() { //TODO remove global global $LANG, $BACK_PATH, $TYPO3_CONF_VARS; // Initialize GPvars: $this->target = t3lib_div::_GP('target'); $this->returnUrl = t3lib_div::_GP('returnUrl'); // Init basic-file-functions object: $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions'); $this->basicff->init($GLOBALS['FILEMOUNTS'], $TYPO3_CONF_VARS['BE']['fileExtensions']); // Cleaning and checking target if (file_exists($this->target)) { $this->target = $this->basicff->cleanDirectoryName($this->target); // Cleaning and checking target (file or dir) } else { $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($this->backPath, $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_rename.html'); $this->doc->backPath = $BACK_PATH; $this->doc->JScode = $this->doc->wrapScriptTags(' function backToList() { // top.goToModule("file_list"); } '); }
/** * 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; }
/** * Tree rendering * * @param integer PID value * @param string Additional where clause * @return array Array of tree elements */ function ext_tree($pid, $clause = '') { // Initialize: $this->init(' AND ' . $this->permsC() . $clause); // Get stored tree structure: $this->stored = unserialize($this->BE_USER->uc['browseTrees']['browsePages']); // PM action: $PM = t3lib_div::intExplode('_', t3lib_div::_GP('PM')); // traverse mounts: $titleLen = intval($this->BE_USER->uc['titleLen']); $treeArr = array(); $idx = 0; // Set first: $this->bank = $idx; $isOpen = $this->stored[$idx][$pid] || $this->expandFirst; $curIds = $this->ids; // save ids $this->reset(); $this->ids = $curIds; // Set PM icon: $cmd = $this->bank . '_' . ($isOpen ? '0_' : '1_') . $pid; $icon = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/ol/' . ($isOpen ? 'minus' : 'plus') . 'only.gif', 'width="18" height="16"') . ' align="top" alt="" />'; $firstHtml = $this->PM_ATagWrap($icon, $cmd); if ($pid > 0) { $rootRec = t3lib_befunc::getRecordWSOL('pages', $pid); $firstHtml .= $this->wrapIcon(t3lib_iconWorks::getSpriteIconForRecord('pages', $rootRec), $rootRec); } else { $rootRec = array('title' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'], 'uid' => 0); $firstHtml .= $this->wrapIcon('<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/i/_icon_website.gif', 'width="18" height="16"') . ' align="top" alt="" />', $rootRec); } $this->tree[] = array('HTML' => $firstHtml, 'row' => $rootRec); if ($isOpen) { // Set depth: $depthD = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/ol/blank.gif', 'width="18" height="16"') . ' align="top" alt="" />'; if ($this->addSelfId) { $this->ids[] = $pid; } $this->getTree($pid, 999, $depthD); $idH = array(); $idH[$pid]['uid'] = $pid; if (count($this->buffer_idH)) { $idH[$pid]['subrow'] = $this->buffer_idH; } $this->buffer_idH = $idH; } // Add tree: $treeArr = array_merge($treeArr, $this->tree); return $treeArr; }
/** * Creating the module output. * * @return void * @todo provide position mapping if no position is given already. Like the columns selector but for our cascading element style ... */ function main() { global $LANG, $BACK_PATH; if ($this->id && $this->access) { // Creating content $this->content = $this->doc->header($LANG->getLL('newContentElement')); $this->content .= $this->doc->spacer(5); $elRow = t3lib_BEfunc::getRecordWSOL('pages', $this->id); $header = t3lib_iconWorks::getSpriteIconForRecord('pages', $elRow); $header .= t3lib_BEfunc::getRecordTitle('pages', $elRow, 1); $this->content .= $this->doc->section('', $header, 0, 1); $this->content .= $this->doc->spacer(10); // Wizard $wizardCode = ''; $tableRows = array(); $wizardItems = $this->getWizardItems(); // Wrapper for wizards $this->elementWrapper['sectionHeader'] = array('<h3 class="bgColor5">', '</h3>'); $this->elementWrapper['section'] = array('<table border="0" cellpadding="1" cellspacing="2">', '</table>'); $this->elementWrapper['wizard'] = array('<tr>', '</tr>'); $this->elementWrapper['wizardPart'] = array('<td>', '</td>'); // copy wrapper for tabs $this->elementWrapperForTabs = $this->elementWrapper; // Hook for manipulating wizardItems, wrapper, onClickEvent etc. if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['templavoila']['db_new_content_el']['wizardItemsHook'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['templavoila']['db_new_content_el']['wizardItemsHook'] as $classData) { $hookObject = t3lib_div::getUserObj($classData); if (!$hookObject instanceof cms_newContentElementWizardsHook) { throw new UnexpectedValueException('$hookObject must implement interface cms_newContentElementWizardItemsHook', 1227834741); } $hookObject->manipulateWizardItems($wizardItems, $this); } } if ($this->config['renderMode'] == 'tabs' && $this->elementWrapperForTabs != $this->elementWrapper) { // restore wrapper for tabs if they are overwritten in hook $this->elementWrapper = $this->elementWrapperForTabs; } // add document inline javascript $this->doc->JScode = $this->doc->wrapScriptTags(' function goToalt_doc() { // ' . $this->onClickEvent . ' } Event.observe(window, \'load\', function() { if(top.refreshMenu) { top.refreshMenu(); } else { top.TYPO3ModuleMenu.refreshMenu(); } if(top.shortcutFrame) { top.shortcutFrame.refreshShortcuts(); } }); '); // Traverse items for the wizard. // An item is either a header or an item rendered with a title/description and icon: $counter = 0; foreach ($wizardItems as $k => $wInfo) { if ($wInfo['header']) { $menuItems[] = array('label' => htmlspecialchars($wInfo['header']), 'content' => $this->elementWrapper['section'][0]); $key = count($menuItems) - 1; } else { $content = ''; // href URI for icon/title: $newRecordLink = 'index.php?' . $this->linkParams() . '&createNewRecord=' . rawurlencode($this->parentRecord) . $wInfo['params']; // Icon: $iInfo = @getimagesize($wInfo['icon']); $content .= $this->elementWrapper['wizardPart'][0] . '<a href="' . htmlspecialchars($newRecordLink) . '"> <img' . t3lib_iconWorks::skinImg($this->doc->backPath, $wInfo['icon'], '') . ' alt="" /></a>' . $this->elementWrapper['wizardPart'][1]; // Title + description: $content .= $this->elementWrapper['wizardPart'][0] . '<a href="' . htmlspecialchars($newRecordLink) . '"><strong>' . htmlspecialchars($wInfo['title']) . '</strong><br />' . nl2br(htmlspecialchars(trim($wInfo['description']))) . '</a>' . $this->elementWrapper['wizardPart'][1]; // Finally, put it together in a container: $menuItems[$key]['content'] .= $this->elementWrapper['wizard'][0] . $content . $this->elementWrapper['wizard'][1]; } } // add closing section-tag foreach ($menuItems as $key => $val) { $menuItems[$key]['content'] .= $this->elementWrapper['section'][1]; } // Add the wizard table to the content, wrapped in tabs: if ($this->config['renderMode'] == 'tabs') { $this->doc->inDocStylesArray[] = ' .typo3-dyntabmenu-divs { background-color: #fafafa; border: 1px solid #000; width: 680px; } .typo3-dyntabmenu-divs table { margin: 15px; } .typo3-dyntabmenu-divs table td { padding: 3px; } '; $code = $LANG->getLL('sel1', 1) . '<br /><br />' . $this->doc->getDynTabMenu($menuItems, 'new-content-element-wizard', false, false, 100); } else { $code = $LANG->getLL('sel1', 1) . '<br /><br />'; foreach ($menuItems as $section) { $code .= $this->elementWrapper['sectionHeader'][0] . $section['label'] . $this->elementWrapper['sectionHeader'][1] . $section['content']; } } $this->content .= $this->doc->section(!$this->onClickEvent ? $LANG->getLL('1_selectType') : '', $code, 0, 1); } else { // In case of no access: $this->content = $this->doc->header($LANG->getLL('newContentElement')); } $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause); $docHeaderButtons = $this->getDocHeaderButtons(); $docContent = array('CSH' => $docHeaderButtons['csh'], 'CONTENT' => $this->content); $content = $this->doc->startPage($LANG->getLL('newContentElement')); $content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $docContent); $content .= $this->doc->endPage(); // Replace content with templated content $this->content = $content; }
/** * 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; }
/** * 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 $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH']); // SAVE button $buttons['save'] = '<input type="image" class="c-inputButton" name="submit" value="Update"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/savedok.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />'; // Shortcut if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']); } return $buttons; }
/** * Showing the permissions in a tree ($this->edit = false) * (Adding content to internal content variable) * * @return void */ public function notEdit() { global $BE_USER, $LANG, $BACK_PATH; // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of $beGroupKeys = $BE_USER->userGroupsUID; $beUserArray = t3lib_BEfunc::getUserNames(); if (!$GLOBALS['BE_USER']->isAdmin()) { $beUserArray = t3lib_BEfunc::blindUserNames($beUserArray, $beGroupKeys, 0); } $beGroupArray = t3lib_BEfunc::getGroupNames(); if (!$GLOBALS['BE_USER']->isAdmin()) { $beGroupArray = t3lib_BEfunc::blindGroupNames($beGroupArray, $beGroupKeys, 0); } // Length of strings: $tLen = $this->MOD_SETTINGS['mode'] == 'perms' ? 20 : 30; // Selector for depth: $code .= $LANG->getLL('Depth') . ': '; $code .= t3lib_BEfunc::getFuncMenu($this->id, 'SET[depth]', $this->MOD_SETTINGS['depth'], $this->MOD_MENU['depth']); $this->content .= $this->doc->section('', $code); $this->content .= $this->doc->spacer(5); // Initialize tree object: $tree = t3lib_div::makeInstance('t3lib_pageTree'); $tree->init('AND ' . $this->perms_clause); $tree->addField('perms_user', 1); $tree->addField('perms_group', 1); $tree->addField('perms_everybody', 1); $tree->addField('perms_userid', 1); $tree->addField('perms_groupid', 1); $tree->addField('hidden'); $tree->addField('fe_group'); $tree->addField('starttime'); $tree->addField('endtime'); $tree->addField('editlock'); // Creating top icon; the current page $HTML = t3lib_iconWorks::getSpriteIconForRecord('pages', $this->pageinfo); $tree->tree[] = array('row' => $this->pageinfo, 'HTML' => $HTML); // Create the tree from $this->id: $tree->getTree($this->id, $this->MOD_SETTINGS['depth'], ''); // Make header of table: $code = ''; if ($this->MOD_SETTINGS['mode'] == 'perms') { $code .= ' <tr class="t3-row-header"> <td colspan="2"> </td> <td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td>' . $LANG->getLL('Owner', TRUE) . '</td> <td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td align="center">' . $LANG->getLL('Group', TRUE) . '</td> <td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td align="center">' . $LANG->getLL('Everybody', TRUE) . '</td> <td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td align="center">' . $LANG->getLL('EditLock', TRUE) . '</td> </tr> '; } else { $code .= ' <tr class="t3-row-header"> <td colspan="2"> </td> <td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td align="center" nowrap="nowrap">' . $LANG->getLL('User', TRUE) . ': ' . htmlspecialchars($BE_USER->user['username']) . '</td> ' . (!$BE_USER->isAdmin() ? '<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td align="center">' . $LANG->getLL('EditLock', TRUE) . '</td>' : '') . ' </tr>'; } // Traverse tree: foreach ($tree->tree as $data) { $cells = array(); $pageId = $data['row']['uid']; // Background colors: $bgCol = $this->lastEdited == $pageId ? ' class="bgColor-20"' : ''; $lE_bgCol = $bgCol; // User/Group names: $userName = $beUserArray[$data['row']['perms_userid']] ? $beUserArray[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? $data['row']['perms_userid'] : ''); if ($data['row']['perms_userid'] && !$beUserArray[$data['row']['perms_userid']]) { $userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($userName, 20)), false); } else { $userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($userName, 20))); } $groupName = $beGroupArray[$data['row']['perms_groupid']] ? $beGroupArray[$data['row']['perms_groupid']]['title'] : ($data['row']['perms_groupid'] ? $data['row']['perms_groupid'] : ''); if ($data['row']['perms_groupid'] && !$beGroupArray[$data['row']['perms_groupid']]) { $groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($groupName, 20)), false); } else { $groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($groupName, 20))); } // Seeing if editing of permissions are allowed for that page: $editPermsAllowed = $data['row']['perms_userid'] == $BE_USER->user['uid'] || $BE_USER->isAdmin(); // First column: $cellAttrib = $data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : ''; $cells[] = ' <td align="left" nowrap="nowrap"' . ($cellAttrib ? $cellAttrib : $bgCol) . '>' . $data['HTML'] . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'], $tLen)) . ' </td>'; // "Edit permissions" -icon if ($editPermsAllowed && $pageId) { $aHref = 'index.php?mode=' . $this->MOD_SETTINGS['mode'] . '&depth=' . $this->MOD_SETTINGS['depth'] . '&id=' . ($data['row']['_ORIG_uid'] ? $data['row']['_ORIG_uid'] : $pageId) . '&return_id=' . $this->id . '&edit=1'; $cells[] = ' <td' . $bgCol . '><a href="' . htmlspecialchars($aHref) . '" title="' . $LANG->getLL('ch_permissions', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a></td>'; } else { $cells[] = ' <td' . $bgCol . '></td>'; } // Rest of columns (depending on mode) if ($this->MOD_SETTINGS['mode'] == 'perms') { $cells[] = ' <td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td' . $bgCol . ' nowrap="nowrap">' . ($pageId ? SC_mod_web_perm_ajax::renderPermissions($data['row']['perms_user'], $pageId, 'user') . ' ' . $userName : '') . '</td> <td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td' . $bgCol . ' nowrap="nowrap">' . ($pageId ? SC_mod_web_perm_ajax::renderPermissions($data['row']['perms_group'], $pageId, 'group') . ' ' . $groupName : '') . '</td> <td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td' . $bgCol . ' nowrap="nowrap">' . ($pageId ? ' ' . SC_mod_web_perm_ajax::renderPermissions($data['row']['perms_everybody'], $pageId, 'everybody') : '') . '</td> <td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['editlock'] ? '<span id="el_' . $pageId . '" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId . '\', \'1\');" title="' . $LANG->getLL('EditLock_descr', 1) . '">' . t3lib_iconWorks::getSpriteIcon('status-warning-lock') . '</a></span>' : ($pageId === 0 ? '' : '<span id="el_' . $pageId . '" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId . '\', \'0\');" title="Enable the »Admin-only« edit lock for this page">[+]</a></span>')) . '</td> '; } else { $cells[] = ' <td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>'; $bgCol = $BE_USER->user['uid'] == $data['row']['perms_userid'] ? ' class="bgColor-20"' : $lE_bgCol; // FIXME $owner undefined $cells[] = ' <td' . $bgCol . ' nowrap="nowrap" align="center">' . ($pageId ? $owner . SC_mod_web_perm_ajax::renderPermissions($BE_USER->calcPerms($data['row']), $pageId, 'user') : '') . '</td> ' . (!$BE_USER->isAdmin() ? ' <td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['editlock'] ? t3lib_iconWorks::getSpriteIcon('status-warning-lock', array('title' => $LANG->getLL('EditLock_descr', TRUE))) : '') . '</td> ' : ''); $bgCol = $lE_bgCol; } // Compile table row: $code .= ' <tr> ' . implode(' ', $cells) . ' </tr>'; } // Wrap rows in table tags: $code = '<table border="0" cellspacing="0" cellpadding="0" id="typo3-permissionList">' . $code . '</table>'; // Adding the content as a section: $this->content .= $this->doc->section('', $code); // CSH for permissions setting $this->content .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'perm_module', $GLOBALS['BACK_PATH'], '<br />|'); // Creating legend table: $legendText = '<strong>' . $LANG->getLL('1', 1) . '</strong>: ' . $LANG->getLL('1_t', 1); $legendText .= '<br /><strong>' . $LANG->getLL('16', 1) . '</strong>: ' . $LANG->getLL('16_t', 1); $legendText .= '<br /><strong>' . $LANG->getLL('2', 1) . '</strong>: ' . $LANG->getLL('2_t', 1); $legendText .= '<br /><strong>' . $LANG->getLL('4', 1) . '</strong>: ' . $LANG->getLL('4_t', 1); $legendText .= '<br /><strong>' . $LANG->getLL('8', 1) . '</strong>: ' . $LANG->getLL('8_t', 1); $code = '<table border="0" id="typo3-legendTable"> <tr> <td valign="top"> <img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/legend.gif', 'width="86" height="75"') . ' alt="" /> </td> <td valign="top" nowrap="nowrap">' . $legendText . '</td> </tr> </table>'; $code .= '<div id="perm-legend">' . $LANG->getLL('def', 1); $code .= '<br /><br />' . t3lib_iconWorks::getSpriteIcon('status-status-permission-granted') . ': ' . $LANG->getLL('A_Granted', 1); $code .= '<br />' . t3lib_iconWorks::getSpriteIcon('status-status-permission-denied') . ': ' . $LANG->getLL('A_Denied', 1); $code .= '</div>'; // Adding section with legend code: $this->content .= $this->doc->spacer(20); $this->content .= $this->doc->section($LANG->getLL('Legend') . ':', $code, 0, 1); }
/** * renders the div layer containing a "post-it" like note in "edit" mode * * @param integer $uid: The UID of the note record * @param string $title: The note's title * @param string $content: The note's content * @param object &$reference: Reference to parent object * @return string HTML output * @access private */ function internal_renderDivLayerEdit($uid, $title, $content, &$reference) { global $LANG, $BE_USER; $this->internal_doProcessing(array('setRead' => $BE_USER->user[$BE_USER->userid_column]), $reference); return ' <!-- rlmp_tvnotes layer output begin --> <div id="tx_rlmptvnotes_noteslayer"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td> <form name="tx_rlmptvnotes_notedata" action="index.php?' . $reference->linkParams() . '" method="post"> <table cellspacing="0" cellpadding="0"> <tr> <td id="tx_rlmptvnotes_noteslayer_dragbar" onMousedown="initializedrag(event)"> <ilayer width="100%" onSelectStart="return false;"> <layer style="width: 100%;"> <input name="tx_rlmptvnotes_data[title]" type="text" value="' . htmlspecialchars($title) . '" style="margin: 2px 6px 2px 6px; width:95%; font-weight:bold;" /> </layer> </ilayer> </td> <td id="tx_rlmptvnotes_noteslayer_iconbar"> <input type="image" name="tx_rlmptvnotes_saveNote" value="' . $uid . '" ' . t3lib_iconWorks::skinImg($reference->doc->backPath . t3lib_extMgm::extRelPath('rlmp_tvnotes'), 'res/save.gif', '') . ' title="' . $LANG->getLL('action_save', 1) . '" alt="" /> <a href="index.php?' . $reference->linkParams() . '&tx_rlmptvnotes_deleteNote=' . $uid . '" onclick="' . htmlspecialchars('return confirm(' . $LANG->JScharCode($LANG->getLL('action_confirm_delete')) . ');') . '"><img ' . t3lib_iconWorks::skinImg($reference->doc->backPath . t3lib_extMgm::extRelPath('rlmp_tvnotes'), 'res/delete.gif', '') . ' width="18" height="16" border=0 title="' . $LANG->getLL('action_delete', 1) . '" alt=""></a> <a href="index.php?' . $reference->linkParams() . '&SET[tx_rlmptvnotes_show]=0"><img ' . t3lib_iconWorks::skinImg($reference->doc->backPath . t3lib_extMgm::extRelPath('rlmp_tvnotes'), 'res/close.gif', '') . ' width="18" height="16" border=0 title="' . $LANG->getLL('action_close', 1) . '" alt=""></a> </td> </tr> <tr> <td id="tx_rlmptvnotes_noteslayer_displaycontent" colspan="2"> <textarea name="tx_rlmptvnotes_data[note]" style="margin: 2px 6px 2px 6px; width:95%; height:90%;" rows="20">' . htmlspecialchars($content) . '</textarea> </td> </tr> </table> </form> </td> </tr> </table> </div> <!-- rlmp_tvnotes layer output end --> '; }
/** * Main function, rendering the folder tree * * @return void */ function main() { global $LANG, $CLIENT; // Produce browse-tree: $tree = $this->foldertree->getBrowsableTree(); // Outputting page tree: $this->content .= $tree; // Adding javascript for drag & drop activation and highlighting $this->content .= $this->doc->wrapScriptTags(' ' . ($this->doHighlight ? 'Tree.highlightActiveItem("", top.fsMod.navFrameHighlightedID["file"]);' : '') . ' ' . (!$this->doc->isCMlayers() ? 'Tree.activateDragDrop = false;' : 'Tree.registerDragDropHandlers();')); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers = array('IMG_RESET' => '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/close_gray.gif', ' width="16" height="16"') . ' id="treeFilterReset" alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter') . '" ' . 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter') . '" />', 'CONTENT' => $this->content); $subparts = array(); // Possible filter/search like in page tree $subparts['###SECOND_ROW###'] = ''; // Build the <body> for the module $this->content = $this->doc->startPage('TYPO3 Folder Tree'); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers, $subparts); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Display the html of the update option * @param string $k * @param integer $count * @param string $func * @return hteml */ private function displayUpdateOption($k, $count, $func) { $msg = $GLOBALS['LANG']->sL($this->ll . 'msg_' . $k) . ' '; $msg .= '<br/><strong>' . str_replace('###COUNT###', $count, $GLOBALS['LANG']->sL($this->ll . 'foundMsg_' . $k)) . '</strong>'; $msg .= ' <img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/icon_' . ($count == 0 ? 'ok' : 'warning2') . '.gif', 'width="18" height="16"') . '>'; if ($count) { $msg .= '<p style="margin:5px 0;">' . $GLOBALS['LANG']->sL($this->ll . 'question_' . $k) . '<p>'; $msg .= '<p style="margin-bottom:10px;"><em>' . $GLOBALS['LANG']->sL($this->ll . 'questionInfo_' . $k) . '</em><p>'; $msg .= $this->getButton($func); } else { $msg .= '<br/>' . $GLOBALS['LANG']->sL($this->ll . 'nothingtodo'); } $out = $this->wrapForm($msg, $GLOBALS['LANG']->sL($this->ll . 'lbl_' . $k)); $out .= '<br/><br/>'; return $out; }
/** * 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 table header * * @param array array of cells * @return string HTML output for the cells */ function printTableHeader($cells) { global $BACK_PATH; $verticalDivider = '<td class="bgColor2"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>'; $wrappedCells = array(); foreach ($cells as $singleCell) { $wrappedCells[] = '<td class="bgColor2" align="center"><b>' . $singleCell . '</b></td>'; } return implode($verticalDivider, $wrappedCells); }
/** * 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; }
/** * Generate the plus/minus icon for the browsable tree. * In this case, there is no plus-minus icon displayed. * * @param array record for the entry * @param integer The current entry number * @param integer The total number of entries. If equal to $a, a 'bottom' element is returned. * @param integer The number of sub-elements to the current element. * @param boolean The element was expanded to render subelements if this flag is set. * @return string Image tag with the plus/minus icon. * @access private * @see t3lib_treeView::PMicon() */ function PMicon($row, $a, $c, $nextCount, $exp) { $PM = 'join'; $BTM = $a == $c ? 'bottom' : ''; $icon = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/ol/' . $PM . $BTM . '.gif', 'width="18" height="16"') . ' alt="" />'; return $icon; }
/** * 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; }
/** * This method prepares the link for opening the devlog in a new window * * @return string Hyperlink with icon and appropriate JavaScript */ protected function openInNewWindow() { $url = t3lib_div::getIndpEnv('TYPO3_REQUEST_SCRIPT'); $onClick = "devlogWin=window.open('" . $url . "','taskcenter','width=790,status=0,menubar=1,resizable=1,location=0,scrollbars=1,toolbar=0');return false;"; $content = '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/open_in_new_window.gif', 'width="19" height="14"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.openInNewWindow', 1) . '" class="absmiddle" alt="" />' . '</a>'; return $content; }