当前位置: 首页>>代码示例>>PHP>>正文


PHP t3lib_div::resolveBackPath方法代码示例

本文整理汇总了PHP中t3lib_div::resolveBackPath方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_div::resolveBackPath方法的具体用法?PHP t3lib_div::resolveBackPath怎么用?PHP t3lib_div::resolveBackPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在t3lib_div的用法示例。


在下文中一共展示了t3lib_div::resolveBackPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: internalSanitizeLocalUrl

 /**
  * Checks if a given string is a valid frame URL to be loaded in the
  * backend.
  *
  * @param string $url potential URL to check
  *
  * @return string either $url if $url is considered to be harmless, or an
  *                empty string otherwise
  */
 private static function internalSanitizeLocalUrl($url = '')
 {
     $sanitizedUrl = '';
     $decodedUrl = rawurldecode($url);
     if ($decodedUrl !== t3lib_div::removeXSS($decodedUrl)) {
         $decodedUrl = '';
     }
     if (!empty($url) && $decodedUrl !== '') {
         $testAbsoluteUrl = t3lib_div::resolveBackPath($decodedUrl);
         $testRelativeUrl = t3lib_div::resolveBackPath(t3lib_div::dirname(t3lib_div::getIndpEnv('SCRIPT_NAME')) . '/' . $decodedUrl);
         // That's what's usually carried in TYPO3_SITE_PATH
         $typo3_site_path = substr(t3lib_div::getIndpEnv('TYPO3_SITE_URL'), strlen(t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST')));
         // Pass if URL is on the current host:
         if (self::isValidUrl($decodedUrl)) {
             if (self::isOnCurrentHost($decodedUrl) && strpos($decodedUrl, t3lib_div::getIndpEnv('TYPO3_SITE_URL')) === 0) {
                 $sanitizedUrl = $url;
             }
             // Pass if URL is an absolute file path:
         } elseif (t3lib_div::isAbsPath($decodedUrl) && t3lib_div::isAllowedAbsPath($decodedUrl)) {
             $sanitizedUrl = $url;
             // Pass if URL is absolute and below TYPO3 base directory:
         } elseif (strpos($testAbsoluteUrl, $typo3_site_path) === 0 && substr($decodedUrl, 0, 1) === '/') {
             $sanitizedUrl = $url;
             // Pass if URL is relative and below TYPO3 base directory:
         } elseif (strpos($testRelativeUrl, $typo3_site_path) === 0 && substr($decodedUrl, 0, 1) !== '/') {
             $sanitizedUrl = $url;
         }
     }
     if (!empty($url) && empty($sanitizedUrl)) {
         t3lib_div::sysLog('The URL "' . $url . '" is not considered to be local and was denied.', 'Core', t3lib_div::SYSLOG_SEVERITY_NOTICE);
     }
     return $sanitizedUrl;
 }
开发者ID:rod86,项目名称:t3sandbox,代码行数:42,代码来源:class.tx_templavoila_div.php

示例2: clearTempDir

 public static function clearTempDir()
 {
     // Delete all files in typo3temp/rtehtmlarea
     $tempPath = t3lib_div::resolveBackPath(PATH_typo3 . '../typo3temp/rtehtmlarea/');
     $handle = @opendir($tempPath);
     if ($handle !== FALSE) {
         while (($file = readdir($handle)) !== FALSE) {
             if ($file != '.' && $file != '..') {
                 $tempFile = $tempPath . $file;
                 if (is_file($tempFile)) {
                     unlink($tempFile);
                 }
             }
         }
         closedir($handle);
     }
     // Delete all files in typo3temp/compressor with names that start with "htmlarea"
     $tempPath = t3lib_div::resolveBackPath(PATH_typo3 . '../typo3temp/compressor/');
     $handle = @opendir($tempPath);
     if ($handle !== FALSE) {
         while (($file = readdir($handle)) !== FALSE) {
             if (substr($file, 0, 8) === 'htmlarea') {
                 $tempFile = $tempPath . $file;
                 if (is_file($tempFile)) {
                     unlink($tempFile);
                 }
             }
         }
         closedir($handle);
     }
     // Log the action
     $GLOBALS['BE_USER']->writelog(3, 1, 0, 0, 'htmlArea RTE: User %s has cleared the RTE cache', array($GLOBALS['BE_USER']->user['username']));
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:33,代码来源:class.tx_rtehtmlarea_clearrtecache.php

示例3: clearTempDir

 function clearTempDir()
 {
     $tempPath = t3lib_div::resolveBackPath(PATH_typo3 . '../typo3temp/rtehtmlarea/');
     $handle = opendir($tempPath);
     while ($data = readdir($handle)) {
         if (!is_dir($data) && $data != "." && $data != "..") {
             unlink($tempPath . $data);
         }
     }
     closedir($handle);
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:11,代码来源:class.tx_rtehtmlarea_clearrtecache.php

示例4: render

 /**
  * renders the actual logo code
  *
  * @return	string	logo html code snippet to use in the backend
  */
 public function render()
 {
     $logoFile = 'gfx/alt_backend_logo.gif';
     // default
     if (is_string($this->logo)) {
         // overwrite
         $logoFile = $this->logo;
     }
     $imgInfo = getimagesize(PATH_site . TYPO3_mainDir . $logoFile);
     $logo = '<a href="http://www.typo3.com/" target="_blank">' . '<img' . t3lib_iconWorks::skinImg('', $logoFile, $imgInfo[3]) . ' title="TYPO3 Content Management System" alt="" />' . '</a>';
     // overwrite with custom logo
     if ($GLOBALS['TBE_STYLES']['logo']) {
         $imgInfo = @getimagesize(t3lib_div::resolveBackPath(PATH_typo3 . $GLOBALS['TBE_STYLES']['logo'], 3));
         $logo = '<a href="http://www.typo3.com/" target="_blank">' . '<img src="' . $GLOBALS['TBE_STYLES']['logo'] . '" ' . $imgInfo[3] . ' title="TYPO3 Content Management System" alt="" />' . '</a>';
     }
     return $logo;
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:22,代码来源:class.typo3logo.php

示例5: generate

 /**
  * Interface function. This will be called from the sprite manager to
  * refresh all caches.
  *
  * @return void
  */
 public function generate()
 {
     $this->generatorInstance = t3lib_div::makeInstance('t3lib_spritemanager_SpriteGenerator', 'GeneratorHandler');
     $this->generatorInstance->setOmmitSpriteNameInIconName(TRUE)->setIncludeTimestampInCSS(TRUE)->setSpriteFolder(t3lib_SpriteManager::$tempPath)->setCSSFolder(t3lib_SpriteManager::$tempPath);
     $iconsToProcess = array_merge((array) $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons'], $this->collectTcaSpriteIcons());
     foreach ($iconsToProcess as $iconName => $iconFile) {
         $iconsToProcess[$iconName] = t3lib_div::resolveBackPath('typo3/' . $iconFile);
     }
     $generatorResponse = $this->generatorInstance->generateSpriteFromArray($iconsToProcess);
     if (!is_dir(PATH_site . t3lib_SpriteManager::$tempPath . 'ie6')) {
         t3lib_div::mkdir(PATH_site . t3lib_SpriteManager::$tempPath . 'ie6');
     }
     t3lib_div::upload_copy_move($generatorResponse['spriteGifImage'], t3lib_div::dirname($generatorResponse['spriteGifImage']) . '/ie6/' . basename($generatorResponse['spriteGifImage']));
     unlink($generatorResponse['spriteGifImage']);
     t3lib_div::upload_copy_move($generatorResponse['cssGif'], t3lib_div::dirname($generatorResponse['cssGif']) . '/ie6/' . basename($generatorResponse['cssGif']));
     unlink($generatorResponse['cssGif']);
     $this->iconNames = array_merge($this->iconNames, $generatorResponse['iconNames']);
     parent::generate();
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:25,代码来源:class.t3lib_spritemanager_spritebuildinghandler.php

示例6: getCorrectUrl

 /**
  * If it is an URL, nothing to do, if it is a file, check if path is allowed and prepend current url
  *
  * @param string $url
  * @return string
  * @throws UnexpectedValueException
  */
 public static function getCorrectUrl($url)
 {
     if (empty($url)) {
         throw new UnexpectedValueException('An empty url is given');
     }
     $url = self::getFalFilename($url);
     // check URL
     $urlInfo = parse_url($url);
     // means: it is no external url
     if (!isset($urlInfo['scheme'])) {
         // resolve paths like ../
         $url = t3lib_div::resolveBackPath($url);
         // absolute path is used to check path
         $absoluteUrl = t3lib_div::getFileAbsFileName($url);
         if (!t3lib_div::isAllowedAbsPath($absoluteUrl)) {
             throw new UnexpectedValueException('The path "' . $url . '" is not allowed.');
         }
         // append current domain
         $url = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . $url;
     }
     return $url;
 }
开发者ID:rafu1987,项目名称:t3bootstrap-project,代码行数:29,代码来源:FileService.php

示例7: catXMLExportImportAction

    function catXMLExportImportAction($l10ncfgObj)
    {
        global $LANG, $BACK_PATH, $BE_USER;
        $allowedSettingFiles = array('across' => 'acrossL10nmgrConfig.dst', 'dejaVu' => 'dejaVuL10nmgrConfig.dvflt', 'memoq' => 'memoQ.mqres', 'transit' => 'StarTransit_XML_UTF_TYPO3.FFD', 'sdltrados2007' => 'SDLTradosTagEditor.ini', 'sdltrados2009' => 'TYPO3_l10nmgr.sdlfiletype', 'sdlpassolo' => 'SDLPassolo.xfg');
        /** @var $service tx_l10nmgr_l10nBaseService */
        $service = t3lib_div::makeInstance('tx_l10nmgr_l10nBaseService');
        $info = '<br/>';
        $info .= '<input type="submit" value="' . $LANG->getLL('general.action.refresh.button.title') . '" name="_" /><br /><br/>';
        $info .= '<div id="ddtabs" class="basictab" style="border:0px solid gray;margin:0px;">
                                <ul style="border:0px solid #999999; ">
                                <li><a onClick="expandcontent(\'sc1\', this)" style="margin:0px;">' . $LANG->getLL('export.xml.headline.title') . '</a></li>
                                <li><a onClick="expandcontent(\'sc2\', this)" style="margin:0px;">' . $LANG->getLL('import.xml.headline.title') . '</a></li>
                                <li><a onClick="expandcontent(\'sc3\', this)" style="margin:0px;">' . $LANG->getLL('file.settings.downloads.title') . '</a></li>
                                <li><a onClick="expandcontent(\'sc4\', this)" style="margin:0px;">' . $LANG->getLL('l10nmgr.documentation.title') . '</a></li>
				</ul></div>';
        $info .= '<div id="tabcontentcontainer" style="height:150px;border:1px solid gray;padding-right:5px;width:100%;">';
        $info .= '<div id="sc1" class="tabcontent">';
        //$info .= '<div id="sc1" class="tabcontent">';
        $_selectOptions = array('0' => '-default-');
        $_selectOptions = $_selectOptions + $this->MOD_MENU["lang"];
        $info .= '<input type="checkbox" value="1" name="check_exports" /> ' . $LANG->getLL('export.xml.check_exports.title') . '<br />';
        $info .= '<input type="checkbox" value="1" name="no_check_xml" /> ' . $LANG->getLL('export.xml.no_check_xml.title') . '<br />';
        $info .= '<input type="checkbox" value="1" name="check_utf8" /> ' . $LANG->getLL('export.xml.checkUtf8.title') . '<br />';
        $info .= $LANG->getLL('export.xml.source-language.title') . $this->_getSelectField("export_xml_forcepreviewlanguage", '0', $_selectOptions) . '<br />';
        // Add the option to send to FTP server, if FTP information is defined
        if (!empty($this->lConf['ftp_server']) && !empty($this->lConf['ftp_server_username']) && !empty($this->lConf['ftp_server_password'])) {
            $info .= '<input type="checkbox" value="1" name="ftp_upload" id="tx_l10nmgr_ftp_upload" /> <label for="tx_l10nmgr_ftp_upload">' . $GLOBALS['LANG']->getLL('export.xml.ftp.title') . '</label>';
        }
        $info .= '<br /><br/>';
        $info .= '<input type="submit" value="Export" name="export_xml" /><br /><br /><br/>';
        $info .= '</div>';
        $info .= '<div id="sc2" class="tabcontent">';
        $info .= '<input type="checkbox" value="1" name="make_preview_link" /> ' . $LANG->getLL('import.xml.make_preview_link.title') . '<br />';
        $info .= '<input type="checkbox" value="1" name="import_delL10N" /> ' . $LANG->getLL('import.xml.delL10N.title') . '<br />';
        $info .= '<input type="checkbox" value="1" name="import_oldformat" /> ' . $LANG->getLL('import.xml.old-format.title') . '<br /><br />';
        $info .= '<input type="file" size="60" name="uploaded_import_file" /><br /><br /><input type="submit" value="Import" name="import_xml" /><br /><br /> ';
        $info .= '</div>';
        $info .= '<div id="sc3" class="tabcontent">';
        $info .= $this->doc->icons(1) . $LANG->getLL('file.settings.available.title');
        for (reset($allowedSettingFiles); list($settingId, $settingFileName) = each($allowedSettingFiles);) {
            $currentFile = t3lib_div::resolveBackPath($BACK_PATH . t3lib_extMgm::extRelPath('l10nmgr') . 'settings/' . $settingFileName);
            if (is_file($currentFile) && is_readable($currentFile)) {
                $size = t3lib_div::formatSize((int) filesize($currentFile), ' Bytes| KB| MB| GB');
                $info .= '<br/><a href="' . t3lib_div::rawUrlEncodeFP($currentFile) . '" title="' . $LANG->getLL('file.settings.download.title') . '" target="_blank">' . $LANG->getLL('file.settings.' . $settingId . '.title') . ' (' . $size . ')' . '</a> ';
            }
        }
        $info .= '</div>';
        $info .= '<div id="sc4" class="tabcontent">';
        $info .= '<a href="' . t3lib_extMgm::extRelPath('l10nmgr') . 'doc/manual.sxw" target="_new">Download</a>';
        $info .= '</div>';
        $info .= '</div>';
        $actionInfo = '';
        // Read uploaded file:
        if (t3lib_div::_POST('import_xml') && $_FILES['uploaded_import_file']['tmp_name'] && is_uploaded_file($_FILES['uploaded_import_file']['tmp_name'])) {
            $uploadedTempFile = t3lib_div::upload_to_tempfile($_FILES['uploaded_import_file']['tmp_name']);
            /** @var $factory tx_l10nmgr_translationDataFactory */
            $factory = t3lib_div::makeInstance('tx_l10nmgr_translationDataFactory');
            //print "<pre>";
            //var_dump($GLOBALS['BE_USER']->user);
            //print "</pre>";
            if (t3lib_div::_POST('import_oldformat') == '1') {
                //Support for the old Format of XML Import (without pageGrp element)
                $actionInfo .= $LANG->getLL('import.xml.old-format.message');
                $translationData = $factory->getTranslationDataFromOldFormatCATXMLFile($uploadedTempFile);
                $translationData->setLanguage($this->sysLanguage);
                $service->saveTranslation($l10ncfgObj, $translationData);
                $actionInfo .= '<br/><br/>' . $this->doc->icons(1) . 'Import done<br/><br/>(Command count:' . $service->lastTCEMAINCommandsCount . ')';
            } else {
                // Relevant processing of XML Import with the help of the Importmanager
                /** @var $importManager tx_l10nmgr_CATXMLImportManager */
                $importManager = t3lib_div::makeInstance('tx_l10nmgr_CATXMLImportManager', $uploadedTempFile, $this->sysLanguage, $xmlString = "");
                if ($importManager->parseAndCheckXMLFile() === false) {
                    $actionInfo .= '<br/><br/>' . $this->doc->header($LANG->getLL('import.error.title')) . $importManager->getErrorMessages();
                } else {
                    if (t3lib_div::_POST('import_delL10N') == '1') {
                        $actionInfo .= $LANG->getLL('import.xml.delL10N.message') . '<br/>';
                        $delCount = $importManager->delL10N($importManager->getDelL10NDataFromCATXMLNodes($importManager->xmlNodes));
                        $actionInfo .= sprintf($LANG->getLL('import.xml.delL10N.count.message'), $delCount) . '<br/><br/>';
                    }
                    if (t3lib_div::_POST('make_preview_link') == '1') {
                        $pageIds = $importManager->getPidsFromCATXMLNodes($importManager->xmlNodes);
                        $actionInfo .= '<b>' . $LANG->getLL('import.xml.preview_links.title') . '</b><br/>';
                        /** @var $mkPreviewLinks tx_l10nmgr_mkPreviewLinkService */
                        $mkPreviewLinks = t3lib_div::makeInstance('tx_l10nmgr_mkPreviewLinkService', $t3_workspaceId = $importManager->headerData['t3_workspaceId'], $t3_sysLang = $importManager->headerData['t3_sysLang'], $pageIds);
                        $actionInfo .= $mkPreviewLinks->renderPreviewLinks($mkPreviewLinks->mkPreviewLinks());
                    }
                    $translationData = $factory->getTranslationDataFromCATXMLNodes($importManager->getXMLNodes());
                    $translationData->setLanguage($this->sysLanguage);
                    //$actionInfo.="<pre>".var_export($GLOBALS['BE_USER'],true)."</pre>";
                    unset($importManager);
                    $service->saveTranslation($l10ncfgObj, $translationData);
                    $actionInfo .= '<br/>' . $this->doc->icons(-1) . $LANG->getLL('import.xml.done.message') . '<br/><br/>(Command count:' . $service->lastTCEMAINCommandsCount . ')';
                }
            }
            t3lib_div::unlink_tempfile($uploadedTempFile);
        }
        // If export of XML is asked for, do that (this will exit and push a file for download, or upload to FTP is option is checked)
        if (t3lib_div::_POST('export_xml')) {
            // Save user prefs
            $BE_USER->pushModuleData('l10nmgr/cm1/checkUTF8', t3lib_div::_POST('check_utf8'));
//.........这里部分代码省略.........
开发者ID:rafu1987,项目名称:t3bootstrap-project,代码行数:101,代码来源:index.php

示例8: icon_getFileTypeImgTag

 /**
  * Returns a file or folder icon for a given (file)path as HTML img tag.
  *
  * @param	array		$infoArr info array: eg. $pathInfo = tx_dam::path_getInfo($path)
  * @param	boolean		$addAttrib Additional attributes for the image tag..
  * @param	string		$mode TYPO3_MODE to be used: 'FE', 'BE'. Constant TYPO3_MODE is default.
  * @return	string		Icon img tag
  * @see tx_dam::path_getInfo()
  */
 function icon_getFileTypeImgTag($infoArr, $addAttrib = '', $mode = TYPO3_MODE)
 {
     global $TYPO3_CONF_VARS, $TCA;
     static $iconCacheSize = array();
     require_once PATH_t3lib . 'class.t3lib_iconworks.php';
     if (isset($infoArr['dir_name'])) {
         $iconfile = tx_dam::icon_getFolder($infoArr);
     } elseif (isset($infoArr['file_name']) or isset($infoArr['file_type']) or isset($infoArr['media_type'])) {
         $iconfile = tx_dam::icon_getFileType($infoArr);
         if ($mode === 'BE') {
             $tca_temp_typeicons = $TCA['tx_dam']['ctrl']['typeicons'];
             $tca_temp_iconfile = $TCA['tx_dam']['ctrl']['iconfile'];
             unset($TCA['tx_dam']['ctrl']['typeicons']);
             $TCA['tx_dam']['ctrl']['iconfile'] = $iconfile;
             $iconfile = t3lib_iconWorks::getIcon('tx_dam', $infoArr, $shaded = false);
             $TCA['tx_dam']['ctrl']['iconfile'] = $tca_temp_iconfile;
             $TCA['tx_dam']['ctrl']['typeicons'] = $tca_temp_typeicons;
         }
     }
     if (!$iconCacheSize[$iconfile]) {
         // Get width/height:
         $iInfo = @getimagesize(t3lib_div::resolveBackPath(PATH_site . TYPO3_mainDir . $iconfile));
         $iconCacheSize[$iconfile] = $iInfo[3];
     }
     $icon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], $iconfile, $iconCacheSize[$iconfile]) . ' class="typo3-icon"  alt="" ' . trim($addAttrib) . ' />';
     return $icon;
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:36,代码来源:class.tx_dam.php

示例9: indexExtUrl

 /**
  * Indexing External URL
  *
  * @param	string		URL, http://....
  * @param	integer		Page id to relate indexing to.
  * @param	array		Rootline array to relate indexing to
  * @param	integer		Configuration UID
  * @param	integer		Set ID value
  * @return	array		URLs found on this page
  */
 function indexExtUrl($url, $pageId, $rl, $cfgUid, $setId)
 {
     // Load indexer if not yet.
     $this->loadIndexerClass();
     // Index external URL:
     $indexerObj = t3lib_div::makeInstance('tx_indexedsearch_indexer');
     $indexerObj->backend_initIndexer($pageId, 0, 0, '', $rl);
     $indexerObj->backend_setFreeIndexUid($cfgUid, $setId);
     $indexerObj->hash['phash'] = -1;
     // To avoid phash_t3 being written to file sections (otherwise they are removed when page is reindexed!!!)
     $indexerObj->indexExternalUrl($url);
     $url_qParts = parse_url($url);
     $baseAbsoluteHref = $url_qParts['scheme'] . '://' . $url_qParts['host'];
     $baseHref = $indexerObj->extractBaseHref($indexerObj->indexExternalUrl_content);
     if (!$baseHref) {
         // Extract base href from current URL
         $baseHref = $baseAbsoluteHref;
         $baseHref .= substr($url_qParts['path'], 0, strrpos($url_qParts['path'], '/'));
     }
     $baseHref = rtrim($baseHref, '/');
     // Get URLs on this page:
     $subUrls = array();
     $list = $indexerObj->extractHyperLinks($indexerObj->indexExternalUrl_content);
     // Traverse links:
     foreach ($list as $count => $linkInfo) {
         // Decode entities:
         $subUrl = t3lib_div::htmlspecialchars_decode($linkInfo['href']);
         $qParts = parse_url($subUrl);
         if (!$qParts['scheme']) {
             $relativeUrl = t3lib_div::resolveBackPath($subUrl);
             if ($relativeUrl[0] === '/') {
                 $subUrl = $baseAbsoluteHref . $relativeUrl;
             } else {
                 $subUrl = $baseHref . '/' . $relativeUrl;
             }
         }
         $subUrls[] = $subUrl;
     }
     return $subUrls;
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:50,代码来源:class.crawler.php

示例10: wizard_step5

	/**
	 * Step 5: Create dynamic menu
	 *
	 * @param	string		Type of menu (main or sub), values: "field_menu" or "field_submenu"
	 * @return	void
	 */
	function wizard_step5($menuField)	{

		$menuPart = $this->getMenuDefaultCode($menuField);
		$menuType = $menuField === 'field_menu' ? 'mainMenu' : 'subMenu';
		$menuTypeText = $menuField === 'field_menu' ? 'main menu' : 'sub menu';
		$menuTypeLetter = $menuField === 'field_menu' ? 'a' : 'b';
		$menuTypeNextStep = $menuField === 'field_menu' ? 5.1 : 6;
		$menuTypeEntryLevel = $menuField === 'field_menu' ? 0 : 1;

		$this->saveMenuCode();

		if (strlen($menuPart))	{

				// Main message:
			$outputString.=  sprintf($GLOBALS['LANG']->getLL('newsitewizard_basicsshouldwork', 1), $menuTypeText, $menuType, $menuTypeText);

				// Start up HTML parser:
			require_once(PATH_t3lib.'class.t3lib_parsehtml.php');
			$htmlParser = t3lib_div::makeinstance('t3lib_parsehtml');

				// Parse into blocks
			$parts = $htmlParser->splitIntoBlock('td,tr,table,a,div,span,ol,ul,li,p,h1,h2,h3,h4,h5',$menuPart,1);

				// If it turns out to be only a single large block we expect it to be a container for the menu item. Therefore we will parse the next level and expect that to be menu items:
			if (count($parts)==3)	{
				$totalWrap = array();
				$totalWrap['before'] = $parts[0].$htmlParser->getFirstTag($parts[1]);
				$totalWrap['after'] = '</'.strtolower($htmlParser->getFirstTagName($parts[1])).'>'.$parts[2];

				$parts = $htmlParser->splitIntoBlock('td,tr,table,a,div,span,ol,ul,li,p,h1,h2,h3,h4,h5',$htmlParser->removeFirstAndLastTag($parts[1]),1);
			} else {
				$totalWrap = array();
			}

			$menuPart_HTML = trim($totalWrap['before']).chr(10).implode(chr(10),$parts).chr(10).trim($totalWrap['after']);

				// Traverse expected menu items:
			$menuWraps = array();
			$GMENU = FALSE;
			$mouseOver = FALSE;
			$key = '';

			foreach($parts as $k => $value)	{
				if ($k%2)	{	// Only expecting inner elements to be of use:

					$linkTag = $htmlParser->splitIntoBlock('a',$value,1);
					if ($linkTag[1])	{
						$newValue = array();
						$attribs = $htmlParser->get_tag_attributes($htmlParser->getFirstTag($linkTag[1]),1);
						$newValue['A-class'] = $attribs[0]['class'];
						if ($attribs[0]['onmouseover'] && $attribs[0]['onmouseout'])	$mouseOver = TRUE;

							// Check if the complete content is an image - then make GMENU!
						$linkContent = trim($htmlParser->removeFirstAndLastTag($linkTag[1]));
						if (preg_match('/^<img[^>]*>$/i',$linkContent))	{
							$GMENU = TRUE;
							$attribs = $htmlParser->get_tag_attributes($linkContent,1);
							$newValue['I-class'] = $attribs[0]['class'];
							$newValue['I-width'] = $attribs[0]['width'];
							$newValue['I-height'] = $attribs[0]['height'];

							$filePath = t3lib_div::getFileAbsFileName(t3lib_div::resolveBackPath(PATH_site.$attribs[0]['src']));
							if (@is_file($filePath))	{
								$newValue['backColorGuess'] = $this->getBackgroundColor($filePath);
							} else $newValue['backColorGuess'] = '';

							if ($attribs[0]['onmouseover'] && $attribs[0]['onmouseout'])	$mouseOver = TRUE;
						}

						$linkTag[1] = '|';
						$newValue['wrap'] = preg_replace('/['.chr(10).chr(13).']*/','',implode('',$linkTag));

						$md5Base = $newValue;
						unset($md5Base['I-width']);
						unset($md5Base['I-height']);
						$md5Base = serialize($md5Base);
						$md5Base = preg_replace('/name=["\'][^"\']*["\']/','',$md5Base);
						$md5Base = preg_replace('/id=["\'][^"\']*["\']/','',$md5Base);
						$md5Base = preg_replace('/\s/','',$md5Base);
						$key = md5($md5Base);

						if (!isset($menuWraps[$key]))	{	// Only if not yet set, set it (so it only gets set once and the first time!)
							$menuWraps[$key] = $newValue;
						} else {	// To prevent from writing values in the "} elseif ($key) {" below, we clear the key:
							$key = '';
						}
					} elseif ($key) {

							// Add this to the previous wrap:
						$menuWraps[$key]['bulletwrap'].= str_replace('|','&#'.ord('|').';',preg_replace('/['.chr(10).chr(13).']*/','',$value));
					}
				}
			}

//.........这里部分代码省略.........
开发者ID:rafu1987,项目名称:t3bootstrap-project,代码行数:101,代码来源:index.php

示例11: getGotoModuleJavascript

    /**
     * generates javascript code to switch between modules
     *
     * @return	string		javascript code snippet to switch modules
     */
    public function getGotoModuleJavascript()
    {
        $moduleJavascriptCommands = array();
        $rawModuleData = $this->getRawModuleData();
        $navFrameScripts = array();
        foreach ($rawModuleData as $mainModuleKey => $mainModuleData) {
            if ($mainModuleData['subitems']) {
                foreach ($mainModuleData['subitems'] as $subModuleKey => $subModuleData) {
                    $parentModuleName = substr($subModuleData['name'], 0, strpos($subModuleData['name'], '_'));
                    $javascriptCommand = '';
                    // Setting additional JavaScript if frameset script:
                    $additionalJavascript = '';
                    if ($subModuleData['parentNavigationFrameScript']) {
                        $additionalJavascript = "+'&id='+top.rawurlencodeAndRemoveSiteUrl(top.fsMod.recentIds['" . $parentModuleName . "'])";
                    }
                    if ($subModuleData['link'] && $this->linkModules) {
                        // For condensed mode, send &cMR parameter to frameset script.
                        if ($additionalJavascript && $GLOBALS['BE_USER']->uc['condensedMode']) {
                            $additionalJavascript .= "+(cMR ? '&cMR=1' : '')";
                        }
                        $javascriptCommand = '
				modScriptURL = "' . $this->appendQuestionmarkToLink($subModuleData['link']) . '"' . $additionalJavascript . ';';
                        if ($subModuleData['navFrameScript']) {
                            $javascriptCommand .= '
				top.currentSubScript="' . $subModuleData['originalLink'] . '";';
                        }
                        if (!$GLOBALS['BE_USER']->uc['condensedMode'] && $subModuleData['parentNavigationFrameScript']) {
                            $additionalJavascript = "+'&id='+top.rawurlencodeAndRemoveSiteUrl(top.fsMod.recentIds['" . $parentModuleName . "'])";
                            $submoduleNavigationFrameScript = $subModuleData['navigationFrameScript'] ? $subModuleData['navigationFrameScript'] : $subModuleData['parentNavigationFrameScript'];
                            $submoduleNavigationFrameScript = t3lib_div::resolveBackPath($submoduleNavigationFrameScript);
                            // Add navigation script parameters if module requires them
                            if ($subModuleData['navigationFrameScriptParam']) {
                                $submoduleNavigationFrameScript = $this->appendQuestionmarkToLink($submoduleNavigationFrameScript) . $subModuleData['navigationFrameScriptParam'];
                            }
                            $navFrameScripts[$parentModuleName] = $submoduleNavigationFrameScript;
                            $javascriptCommand = '
				top.currentSubScript = "' . $subModuleData['originalLink'] . '";
				if (top.content.list_frame && top.fsMod.currentMainLoaded == mainModName) {
					modScriptURL = "' . $this->appendQuestionmarkToLink($subModuleData['originalLink']) . '"' . $additionalJavascript . ';
					';
                            // Change link to navigation frame if submodule has it's own navigation
                            if ($submoduleNavigationFrameScript) {
                                $javascriptCommand .= 'navFrames["' . $parentModuleName . '"] = "' . $submoduleNavigationFrameScript . '";';
                            }
                            $javascriptCommand .= '
				} else if (top.nextLoadModuleUrl) {
					modScriptURL = "' . ($subModuleData['prefix'] ? $this->appendQuestionmarkToLink($subModuleData['link']) . '&exScript=' : '') . 'listframe_loader.php";
				} else {
					modScriptURL = "' . $this->appendQuestionmarkToLink($subModuleData['link']) . '"' . $additionalJavascript . ' + additionalGetVariables;
				}';
                        }
                    }
                    $moduleJavascriptCommands[] = "\n\t\t\tcase '" . $subModuleData['name'] . "':" . $javascriptCommand . "\n\t\t\tbreak;";
                }
            } elseif (!$mainModuleData['subitems'] && !empty($mainModuleData['link'])) {
                // main module has no sub modules but instead is linked itself (doc module f.e.)
                $javascriptCommand = '
				modScriptURL = "' . $this->appendQuestionmarkToLink($mainModuleData['link']) . '";';
                $moduleJavascriptCommands[] = "\n\t\t\tcase '" . $mainModuleData['name'] . "':" . $javascriptCommand . "\n\t\t\tbreak;";
            }
        }
        $javascriptCode = 'function(modName, cMR_flag, addGetVars) {
		var useCondensedMode = ' . ($GLOBALS['BE_USER']->uc['condensedMode'] ? 'true' : 'false') . ';
		var mainModName = (modName.slice(0, modName.indexOf("_")) || modName);

		var additionalGetVariables = "";
		if (addGetVars)	{
			additionalGetVariables = addGetVars;
		}';
        $javascriptCode .= '
		var navFrames = {};';
        foreach ($navFrameScripts as $mainMod => $frameScript) {
            $javascriptCode .= '
				navFrames["' . $mainMod . '"] = "' . $frameScript . '";';
        }
        $javascriptCode .= '

		var cMR = (cMR_flag ? 1 : 0);
		var modScriptURL = "";

		switch(modName)	{' . LF . implode(LF, $moduleJavascriptCommands) . LF . '
		}
		';
        $javascriptCode .= '

		if (!useCondensedMode && navFrames[mainModName]) {
			if (top.content.list_frame && top.fsMod.currentMainLoaded == mainModName) {
				top.content.list_frame.location = top.getModuleUrl(top.TS.PATH_typo3 + modScriptURL + additionalGetVariables);
				if (top.currentSubNavScript != navFrames[mainModName]) {
					top.currentSubNavScript = navFrames[mainModName];
					top.content.nav_frame.location = top.getModuleUrl(top.TS.PATH_typo3 + navFrames[mainModName]);
				}
			} else {
				TYPO3.Backend.loadModule(mainModName, modName, modScriptURL + additionalGetVariables);
			}
//.........这里部分代码省略.........
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:101,代码来源:class.modulemenu.php

示例12: substEtypeWithRealStuff_contentInfo

 /**
  * Analyzes the input content for various stuff which can be used to generate the DS.
  * Basically this tries to intelligently guess some settings.
  *
  * @param	string		HTML Content string
  * @return	array		Configuration
  * @see substEtypeWithRealStuff()
  */
 function substEtypeWithRealStuff_contentInfo($content)
 {
     if ($content) {
         if (substr($content, 0, 4) == '<img') {
             $attrib = t3lib_div::get_tag_attributes($content);
             if ((!$attrib['width'] || !$attrib['height']) && $attrib['src']) {
                 $pathWithNoDots = t3lib_div::resolveBackPath($attrib['src']);
                 $filePath = t3lib_div::getFileAbsFileName($pathWithNoDots);
                 if ($filePath && @is_file($filePath)) {
                     $imgInfo = @getimagesize($filePath);
                     if (!$attrib['width']) {
                         $attrib['width'] = $imgInfo[0];
                     }
                     if (!$attrib['height']) {
                         $attrib['height'] = $imgInfo[1];
                     }
                 }
             }
             return array('img' => $attrib);
         }
     }
     return false;
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:31,代码来源:index.php

示例13: checkMod

 /**
  * Here we check for the module.
  * Return values:
  * 	'notFound':	If the module was not found in the path (no "conf.php" file)
  * 	false:		If no access to the module (access check failed)
  * 	array():	Configuration array, in case a valid module where access IS granted exists.
  *
  * @param	string		Module name
  * @param	string		Absolute path to module
  * @return	mixed		See description of function
  */
 function checkMod($name, $fullpath)
 {
     if ($name == 'user_ws' && !t3lib_extMgm::isLoaded('version')) {
         return FALSE;
     }
     // Check for own way of configuring module
     if (is_array($GLOBALS['TBE_MODULES']['_configuration'][$name]['configureModuleFunction'])) {
         $obj = $GLOBALS['TBE_MODULES']['_configuration'][$name]['configureModuleFunction'];
         if (is_callable($obj)) {
             return call_user_func($obj, $name, $fullpath);
         }
     }
     $modconf = array();
     $path = preg_replace('/\\/[^\\/.]+\\/\\.\\.\\//', '/', $fullpath);
     // because 'path/../path' does not work
     if (@is_dir($path) && file_exists($path . '/conf.php')) {
         $MCONF = array();
         $MLANG = array();
         include $path . '/conf.php';
         // The conf-file is included. This must be valid PHP.
         if (!$MCONF['shy'] && $this->checkModAccess($name, $MCONF) && $this->checkModWorkspace($name, $MCONF)) {
             $modconf['name'] = $name;
             // language processing. This will add module labels and image reference to the internal ->moduleLabels array of the LANG object.
             if (is_object($GLOBALS['LANG'])) {
                 // $MLANG['default']['tabs_images']['tab'] is for modules the reference to the module icon.
                 // Here the path is transformed to an absolute reference.
                 if ($MLANG['default']['tabs_images']['tab']) {
                     // Initializing search for alternative icon:
                     $altIconKey = 'MOD:' . $name . '/' . $MLANG['default']['tabs_images']['tab'];
                     // Alternative icon key (might have an alternative set in $TBE_STYLES['skinImg']
                     $altIconAbsPath = is_array($GLOBALS['TBE_STYLES']['skinImg'][$altIconKey]) ? t3lib_div::resolveBackPath(PATH_typo3 . $GLOBALS['TBE_STYLES']['skinImg'][$altIconKey][0]) : '';
                     // Setting icon, either default or alternative:
                     if ($altIconAbsPath && @is_file($altIconAbsPath)) {
                         $MLANG['default']['tabs_images']['tab'] = $this->getRelativePath(PATH_typo3, $altIconAbsPath);
                     } else {
                         // Setting default icon:
                         $MLANG['default']['tabs_images']['tab'] = $this->getRelativePath(PATH_typo3, $fullpath . '/' . $MLANG['default']['tabs_images']['tab']);
                     }
                     // Finally, setting the icon with correct path:
                     if (substr($MLANG['default']['tabs_images']['tab'], 0, 3) == '../') {
                         $MLANG['default']['tabs_images']['tab'] = PATH_site . substr($MLANG['default']['tabs_images']['tab'], 3);
                     } else {
                         $MLANG['default']['tabs_images']['tab'] = PATH_typo3 . $MLANG['default']['tabs_images']['tab'];
                     }
                 }
                 // If LOCAL_LANG references are used for labels of the module:
                 if ($MLANG['default']['ll_ref']) {
                     // Now the 'default' key is loaded with the CURRENT language - not the english translation...
                     $MLANG['default']['labels']['tablabel'] = $GLOBALS['LANG']->sL($MLANG['default']['ll_ref'] . ':mlang_labels_tablabel');
                     $MLANG['default']['labels']['tabdescr'] = $GLOBALS['LANG']->sL($MLANG['default']['ll_ref'] . ':mlang_labels_tabdescr');
                     $MLANG['default']['tabs']['tab'] = $GLOBALS['LANG']->sL($MLANG['default']['ll_ref'] . ':mlang_tabs_tab');
                     $GLOBALS['LANG']->addModuleLabels($MLANG['default'], $name . '_');
                 } else {
                     // ... otherwise use the old way:
                     $GLOBALS['LANG']->addModuleLabels($MLANG['default'], $name . '_');
                     $GLOBALS['LANG']->addModuleLabels($MLANG[$GLOBALS['LANG']->lang], $name . '_');
                 }
             }
             // Default script setup
             if ($MCONF['script'] === '_DISPATCH') {
                 if ($MCONF['extbase']) {
                     $modconf['script'] = 'mod.php?M=Tx_' . rawurlencode($name);
                 } else {
                     $modconf['script'] = 'mod.php?M=' . rawurlencode($name);
                 }
             } elseif ($MCONF['script'] && file_exists($path . '/' . $MCONF['script'])) {
                 $modconf['script'] = $this->getRelativePath(PATH_typo3, $fullpath . '/' . $MCONF['script']);
             } else {
                 $modconf['script'] = 'dummy.php';
             }
             // Default tab setting
             if ($MCONF['defaultMod']) {
                 $modconf['defaultMod'] = $MCONF['defaultMod'];
             }
             // Navigation Frame Script (GET params could be added)
             if ($MCONF['navFrameScript']) {
                 $navFrameScript = explode('?', $MCONF['navFrameScript']);
                 $navFrameScript = $navFrameScript[0];
                 if (file_exists($path . '/' . $navFrameScript)) {
                     $modconf['navFrameScript'] = $this->getRelativePath(PATH_typo3, $fullpath . '/' . $MCONF['navFrameScript']);
                 }
             }
             // additional params for Navigation Frame Script: "&anyParam=value&moreParam=1"
             if ($MCONF['navFrameScriptParam']) {
                 $modconf['navFrameScriptParam'] = $MCONF['navFrameScriptParam'];
             }
         } else {
             return false;
         }
//.........这里部分代码省略.........
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:101,代码来源:class.t3lib_loadmodules.php

示例14: extensionListRow

    /**
     * Prints a row with data for the various extension listings
     *
     * @param	string		Extension key
     * @param	array		Extension information array
     * @param	array		Preset table cells, eg. install/uninstall icons.
     * @param	string		<tr> tag class
     * @param	array		Array with installed extension keys (as keys)
     * @param	boolean		If set, the list is coming from remote server.
     * @param	string		Alternative link URL
     * @return	string		HTML <tr> content
     */
    function extensionListRow($extKey, $extInfo, $cells, $bgColorClass = '', $inst_list = array(), $import = 0, $altLinkUrl = '')
    {
        $stateColors = tx_em_Tools::getStateColors();
        // Icon:
        $imgInfo = @getImageSize(tx_em_Tools::getExtPath($extKey, $extInfo['type']) . '/ext_icon.gif');
        if (is_array($imgInfo)) {
            $cells[] = '<td><img src="' . $GLOBALS['BACK_PATH'] . tx_em_Tools::typeRelPath($extInfo['type']) . $extKey . '/ext_icon.gif' . '" ' . $imgInfo[3] . ' alt="" /></td>';
        } elseif ($extInfo['_ICON']) {
            $cells[] = '<td>' . $extInfo['_ICON'] . '</td>';
        } else {
            $cells[] = '<td><img src="clear.gif" width="1" height="1" alt="" /></td>';
        }
        // Extension title:
        $cells[] = '<td nowrap="nowrap"><a href="' . htmlspecialchars($altLinkUrl ? $altLinkUrl : t3lib_div::linkThisScript(array('CMD[showExt]' => $extKey, 'SET[singleDetails]' => 'info'))) . '" title="' . htmlspecialchars($extInfo['EM_CONF']['description']) . '">' . t3lib_div::fixed_lgd_cs($extInfo['EM_CONF']['title'] ? htmlspecialchars($extInfo['EM_CONF']['title']) : '<em>' . $extKey . '</em>', 40) . '</a></td>';
        // Based on the display mode you will see more or less details:
        if (!$this->parentObject->MOD_SETTINGS['display_details']) {
            $cells[] = '<td>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($extInfo['EM_CONF']['description'], 400)) . '<br /><img src="clear.gif" width="300" height="1" alt="" /></td>';
            $cells[] = '<td nowrap="nowrap">' . ($extInfo['EM_CONF']['author_email'] ? '<a href="mailto:' . htmlspecialchars($extInfo['EM_CONF']['author_email']) . '">' : '') . htmlspecialchars($extInfo['EM_CONF']['author']) . (htmlspecialchars($extInfo['EM_CONF']['author_email']) ? '</a>' : '') . ($extInfo['EM_CONF']['author_company'] ? '<br />' . htmlspecialchars($extInfo['EM_CONF']['author_company']) : '') . '</td>';
        } elseif ($this->parentObject->MOD_SETTINGS['display_details'] == 2) {
            $cells[] = '<td nowrap="nowrap">' . $extInfo['EM_CONF']['priority'] . '</td>';
            $cells[] = '<td nowrap="nowrap">' . implode('<br />', t3lib_div::trimExplode(',', $extInfo['EM_CONF']['modify_tables'], 1)) . '</td>';
            $cells[] = '<td nowrap="nowrap">' . $extInfo['EM_CONF']['module'] . '</td>';
            $cells[] = '<td nowrap="nowrap">' . ($extInfo['EM_CONF']['clearCacheOnLoad'] ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes') : '') . '</td>';
            $cells[] = '<td nowrap="nowrap">' . ($extInfo['EM_CONF']['internal'] ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes') : '') . '</td>';
            $cells[] = '<td nowrap="nowrap">' . ($extInfo['EM_CONF']['shy'] ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes') : '') . '</td>';
        } elseif ($this->parentObject->MOD_SETTINGS['display_details'] == 3) {
            $techInfo = $this->install->makeDetailedExtensionAnalysis($extKey, $extInfo);
            $cells[] = '<td>' . $this->parentObject->extensionDetails->extInformationArray_dbReq($techInfo) . '</td>';
            $cells[] = '<td nowrap="nowrap">' . (is_array($techInfo['TSfiles']) ? implode('<br />', $techInfo['TSfiles']) : '') . '</td>';
            $cells[] = '<td nowrap="nowrap">' . (is_array($techInfo['flags']) ? implode('<br />', $techInfo['flags']) : '') . '</td>';
            $cells[] = '<td nowrap="nowrap">' . (is_array($techInfo['moduleNames']) ? implode('<br />', $techInfo['moduleNames']) : '') . '</td>';
            $cells[] = '<td nowrap="nowrap">' . ($techInfo['conf'] ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes') : '') . '</td>';
            $cells[] = '<td>' . tx_em_Tools::rfw((t3lib_extMgm::isLoaded($extKey) && $techInfo['tables_error'] ? '<strong>' . $GLOBALS['LANG']->getLL('extInfoArray_table_error') . '</strong><br />' . $GLOBALS['LANG']->getLL('extInfoArray_missing_fields') : '') . (t3lib_extMgm::isLoaded($extKey) && $techInfo['static_error'] ? '<strong>' . $GLOBALS['LANG']->getLL('extInfoArray_static_table_error') . '</strong><br />' . $GLOBALS['LANG']->getLL('extInfoArray_static_tables_missing_empty') : '')) . '</td>';
        } elseif ($this->parentObject->MOD_SETTINGS['display_details'] == 4) {
            $techInfo = $this->install->makeDetailedExtensionAnalysis($extKey, $extInfo, 1);
            $cells[] = '<td>' . (is_array($techInfo['locallang']) ? implode('<br />', $techInfo['locallang']) : '') . '</td>';
            $cells[] = '<td>' . (is_array($techInfo['classes']) ? implode('<br />', $techInfo['classes']) : '') . '</td>';
            $cells[] = '<td>' . (is_array($techInfo['errors']) ? tx_em_Tools::rfw(implode('<hr />', $techInfo['errors'])) : '') . '</td>';
            $cells[] = '<td>' . (is_array($techInfo['NSerrors']) ? !t3lib_div::inList($this->parentObject->nameSpaceExceptions, $extKey) ? t3lib_utility_Debug::viewarray($techInfo['NSerrors']) : tx_em_Tools::dfw($GLOBALS['LANG']->getLL('extInfoArray_exception')) : '') . '</td>';
        } elseif ($this->parentObject->MOD_SETTINGS['display_details'] == 5) {
            $currentMd5Array = $this->parentObject->extensionDetails->serverExtensionMD5array($extKey, $extInfo);
            $affectedFiles = '';
            $msgLines = array();
            $msgLines[] = $GLOBALS['LANG']->getLL('listRow_files') . ' ' . count($currentMd5Array);
            if (strcmp($extInfo['EM_CONF']['_md5_values_when_last_written'], serialize($currentMd5Array))) {
                $msgLines[] = tx_em_Tools::rfw('<br /><strong>' . $GLOBALS['LANG']->getLL('extInfoArray_difference_detected') . '</strong>');
                $affectedFiles = tx_em_Tools::findMD5ArrayDiff($currentMd5Array, unserialize($extInfo['EM_CONF']['_md5_values_when_last_written']));
                if (count($affectedFiles)) {
                    $msgLines[] = '<br /><strong>' . $GLOBALS['LANG']->getLL('extInfoArray_modified_files') . '</strong><br />' . tx_em_Tools::rfw(implode('<br />', $affectedFiles));
                }
            }
            $cells[] = '<td>' . implode('<br />', $msgLines) . '</td>';
        } else {
            // Default view:
            $verDiff = $inst_list[$extKey] && tx_em_Tools::versionDifference($extInfo['EM_CONF']['version'], $inst_list[$extKey]['EM_CONF']['version'], $this->parentObject->versionDiffFactor);
            $cells[] = '<td nowrap="nowrap"><em>' . $extKey . '</em></td>';
            $cells[] = '<td nowrap="nowrap">' . ($verDiff ? '<strong>' . tx_em_Tools::rfw(htmlspecialchars($extInfo['EM_CONF']['version'])) . '</strong>' : $extInfo['EM_CONF']['version']) . '</td>';
            if (!$import) {
                // Listing extension on LOCAL server:
                // Extension Download:
                $cells[] = '<td nowrap="nowrap"><a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('CMD[doBackup]' => 1, 'SET[singleDetails]' => 'backup', 'CMD[showExt]' => $extKey))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:download') . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-extension-download') . '</a></td>';
                // Manual download
                $manual = tx_em_Tools::typePath($extInfo['type']) . $extKey . '/doc/manual.sxw';
                $manualRelPath = t3lib_div::resolveBackPath($this->parentObject->doc->backPath . tx_em_Tools::typeRelPath($extInfo['type'])) . $extKey . '/doc/manual.sxw';
                if ($extInfo['EM_CONF']['docPath']) {
                    $manual = tx_em_Tools::typePath($extInfo['type']) . $extKey . '/' . $extInfo['EM_CONF']['docPath'] . '/manual.sxw';
                    $manualRelPath = t3lib_div::resolveBackPath($this->parentObject->doc->backPath . tx_em_Tools::typeRelPath($extInfo['type'])) . $extKey . '/' . $extInfo['EM_CONF']['docPath'] . '/manual.sxw';
                }
                $cells[] = '<td nowrap="nowrap">' . (tx_em_Tools::typePath($extInfo['type']) && @is_file($manual) ? '<a href="' . htmlspecialchars($manualRelPath) . '" target="_blank" title="' . $GLOBALS['LANG']->getLL('listRow_local_manual') . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-extension-documentation') . '</a>' : '') . '</td>';
                // Double installation (inclusion of an extension in more than one of system, global or local scopes)
                $doubleInstall = '';
                if (strlen($extInfo['doubleInstall']) > 1) {
                    // Separate the "SL" et al. string into an array and replace L by Local, G by Global etc.
                    $doubleInstallations = str_replace(array('S', 'G', 'L'), array($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:sysext'), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:globalext'), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:localext')), str_split($extInfo['doubleInstall']));
                    // Last extension is the one actually used
                    $usedExtension = array_pop($doubleInstallations);
                    // Next extension is overridden
                    $overriddenExtensions = array_pop($doubleInstallations);
                    // If the array is not yet empty, the extension is actually installed 3 times (SGL)
                    if (count($doubleInstallations) > 0) {
                        $lastExtension = array_pop($doubleInstallations);
                        $overriddenExtensions .= ' ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:and') . ' ' . $lastExtension;
                    }
                    $doubleInstallTitle = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:double_inclusion'), $usedExtension, $overriddenExtensions);
                    $doubleInstall = ' <strong><abbr title="' . $doubleInstallTitle . '">' . tx_em_Tools::rfw($extInfo['doubleInstall']) . '</abbr></strong>';
                }
                $cells[] = '<td nowrap="nowrap">' . $this->types[$extInfo['type']] . $doubleInstall . '</td>';
            } else {
//.........这里部分代码省略.........
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:101,代码来源:class.tx_em_extensions_list.php

示例15: languageRows

    function languageRows($languageList, $elementList)
    {
        // Initialization:
        $elements = $this->explodeElement($elementList);
        $firstEl = current($elements);
        $hookObj = t3lib_div::makeInstance('tx_l10nmgr_tcemain_hook');
        $this->l10nMgrTools = t3lib_div::makeInstance('tx_l10nmgr_tools');
        $this->l10nMgrTools->verbose = FALSE;
        // Otherwise it will show records which has fields but none editable.
        $inputRecord = t3lib_BEfunc::getRecord($firstEl[0], $firstEl[1], 'pid');
        $this->sysLanguages = $this->l10nMgrTools->t8Tools->getSystemLanguages($firstEl[0] == 'pages' ? $firstEl[1] : $inputRecord['pid']);
        $languages = $this->getLanguages($languageList, $this->sysLanguages);
        if (count($languages)) {
            $tRows = array();
            // Header:
            $cells = '<td class="bgColor2 tableheader">Element:</td>';
            foreach ($languages as $l) {
                if ($l >= 1) {
                    $baseRecordFlag = '<img src="' . htmlspecialchars($GLOBALS['BACK_PATH'] . $this->sysLanguages[$l]['flagIcon']) . '" alt="' . htmlspecialchars($this->sysLanguages[$l]['title']) . '" title="' . htmlspecialchars($this->sysLanguages[$l]['title']) . '" />';
                    $cells .= '<td class="bgColor2 tableheader">' . $baseRecordFlag . '</td>';
                }
            }
            $tRows[] = $cells;
            foreach ($elements as $el) {
                $cells = '';
                // Get CURRENT online record and icon based on "t3ver_oid":
                $rec_on = t3lib_BEfunc::getRecord($el[0], $el[1]);
                $icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord($el[0], $rec_on);
                $icon = $this->doc->wrapClickMenuOnIcon($icon, $el[0], $rec_on['uid'], 2);
                $linkToIt = '<a href="#" onclick="' . htmlspecialchars('parent.list_frame.location.href="' . $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('l10nmgr') . 'cm2/index.php?table=' . $el[0] . '&uid=' . $el[1] . '"; return false;') . '" target="listframe">
					' . t3lib_BEfunc::getRecordTitle($el[0], $rec_on, TRUE) . '
						</a>';
                if ($el[0] == 'pages') {
                    // If another page module was specified, replace the default Page module with the new one
                    $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
                    $pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
                    $path_module_path = t3lib_div::resolveBackPath($GLOBALS['BACK_PATH'] . '../' . substr($GLOBALS['TBE_MODULES']['_PATHS'][$pageModule], strlen(PATH_site)));
                    $onclick = 'parent.list_frame.location.href="' . $path_module_path . '?id=' . $el[1] . '"; return false;';
                    $pmLink = '<a href="#" onclick="' . htmlspecialchars($onclick) . '" target="listframe"><i>[Edit page]</i></a>';
                } else {
                    $pmLink = '';
                }
                $cells = '<td>' . $icon . $linkToIt . $pmLink . '</td>';
                foreach ($languages as $l) {
                    if ($l >= 1) {
                        $cells .= '<td align="center">' . $hookObj->calcStat(array($el[0], $el[1]), $l) . '</td>';
                    }
                }
                $tRows[] = $cells;
            }
            return '<table border="0" cellpadding="0" cellspacing="0"><tr>' . implode('</tr><tr>', $tRows) . '</tr></table>';
        }
    }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:53,代码来源:list.php


注:本文中的t3lib_div::resolveBackPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。