Esempio n. 1
0
    /**
     * Main function of the module. Write the content to $this->content
     * If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree
     *
     * @return	[type]		...
     */
    function main()
    {
        global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
        $PATH_TYPO3 = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'typo3/';
        if ($BE_USER->user["admin"]) {
            // Draw the header.
            $this->doc = t3lib_div::makeInstance("template");
            $this->doc->backPath = $BACK_PATH;
            $this->pageRenderer = $this->doc->getPageRenderer();
            // Include Ext JS
            $this->pageRenderer->loadExtJS(true, true);
            $this->pageRenderer->enableExtJSQuickTips();
            $this->pageRenderer->enableExtJsDebug();
            $this->pageRenderer->addJsFile($BACK_PATH . t3lib_extMgm::extRelPath('caretaker') . 'res/js/tx.caretaker.js', 'text/javascript', FALSE, FALSE);
            $this->pageRenderer->addJsFile($BACK_PATH . t3lib_extMgm::extRelPath('caretaker') . 'res/js/tx.caretaker.NodeTree.js', 'text/javascript', FALSE, FALSE);
            //Add caretaker css
            $this->pageRenderer->addCssFile('../res/css/tx.caretaker.nodetree.css', 'stylesheet', 'all', '', FALSE);
            // storage Pid
            $confArray = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['caretaker']);
            $storagePid = (int) $confArray['storagePid'];
            $this->pageRenderer->addJsInlineCode('Caretaker_Nodetree', '
			Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
			Ext.ns("tx.caretaker");
			Ext.onReady(function() {
				tx.caretaker.view = new Ext.Viewport({
					layout: "fit",
					items: {
						id: "cartaker-tree",
						xtype: "caretaker-nodetree",
                        autoScroll: true,
						dataUrl: "' . $this->doc->backPath . 'ajax.php?ajaxID=tx_caretaker::treeloader",
						addUrl: "' . $PATH_TYPO3 . 'alt_doc.php?edit[###NODE_TYPE###][' . $storagePid . ']=new",
						editUrl: "' . $PATH_TYPO3 . 'alt_doc.php?edit[tx_caretaker_###NODE_TYPE###][###NODE_UID###]=edit",
						hideUrl: "' . $PATH_TYPO3 . 'tce_db.php?&data[tx_caretaker_###NODE_TYPE###][###NODE_UID###][hidden]=1",
						unhideUrl: "' . $PATH_TYPO3 . 'tce_db.php?&data[tx_caretaker_###NODE_TYPE###][###NODE_UID###][hidden]=0"
					}
				});

				tx_caretaker_updateTreeById = function( id ){
					tx_caretaker_tree = Ext.getCmp("cartaker-tree");
					tx_caretaker_tree.reloadTreePartial( id );
				}
			});
			');
            $this->content .= $this->doc->startPage($LANG->getLL("title"));
            $this->doc->form = '';
        } else {
            // If no access or if not admin
            $this->doc = t3lib_div::makeInstance("mediumDoc");
            $this->doc->backPath = $BACK_PATH;
            $this->content .= $this->doc->startPage($LANG->getLL("title"));
            $this->content .= $this->doc->header($LANG->getLL("title"));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->spacer(10);
        }
    }
 /**
  * Initializes the controller before invoking an action method.
  *
  * @return void
  */
 protected function initializeAction()
 {
     $this->pageRenderer->addCssFile(t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/StyleSheet/module.css');
     $this->pageRenderer->addInlineLanguageLabelFile('EXT:smoothmigration/Resources/Private/Language/locallang.xml');
     $this->pageRenderer->addJsLibrary('jquery', t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/jquery-1.10.1.min.js');
     $this->pageRenderer->addJsLibrary('sprintf', t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/sprintf.min.js');
     $this->pageRenderer->addJsFile(t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/General.js');
     if (t3lib_div::int_from_ver(TYPO3_version) > 6001000) {
         $this->moduleToken = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get()->generateToken('moduleCall', 'tools_SmoothmigrationSmoothmigration');
     }
 }
Esempio n. 3
0
 /**
  * Include a single file with optional concat, compress and cache
  *
  * @param array $filenames Filenames to include
  * @param boolean $cache If true, the file is cached (makes sens if $concat or one of the other options is specified)
  * @param boolean $concata If true and wildcard filename used, concats all files
  * @param boolean $compress If true, files are compressed
  * @param int $index Position to take in additionalHeaderData; pushes current resident DOWN
  * @param array $attributes Attributes of tag
  * @return void
  * @deprecated
  */
 public function includeFile($filename, $cache = FALSE, $concat = FALSE, $compress = FALSE, $index = -1, $attributes = NULL)
 {
     $pathinfo = pathinfo($filename);
     $type = $pathinfo['extension'];
     if ($pathinfo['filename'] === '*') {
         $files = $this->getFilenamesOfType($pathinfo['dirname'], $pathinfo['extension']);
         if ($files) {
             $this->includeFiles($files, $cache, $concat, $compress, $index, $attributes);
         }
         return;
     }
     if ($type !== 'css' && $type !== 'js') {
         $type = 'js';
         // assume Javascript for unknown files - this may change later on...
     }
     if ($type == 'js') {
         if ($this->isCached()) {
             $this->pageRenderer->addJsFile($filename, 'text/javascript', $compress, $index == 0);
         } else {
             $GLOBALS['TSFE']->additionalHeaderData[md5($filename)] = '<script type="text/javascript" src="' . $filename . '"></script>';
         }
     } elseif ($type == 'css') {
         if ($this->isCached()) {
             $this->pageRenderer->addCssFile($filename, 'stylesheet', $attributes['media'] ? $attributes['media'] : 'all', '', $compress, $index == 0);
         } else {
             $GLOBALS['TSFE']->additionalHeaderData[md5($filename)] = '<link rel="stylesheet" type="text/css" media="' . ($attributes['media'] ? $attributes['media'] : 'all') . '" href="' . $filename . '" />';
         }
     }
 }
Esempio n. 4
0
 /**
  * Loads the css and javascript files of all registered navigation widgets
  *
  * @return void
  */
 protected function loadResourcesForRegisteredNavigationComponents()
 {
     if (!is_array($GLOBALS['TBE_MODULES']['_navigationComponents'])) {
         return;
     }
     $loadedComponents = array();
     foreach ($GLOBALS['TBE_MODULES']['_navigationComponents'] as $module => $info) {
         if (in_array($info['componentId'], $loadedComponents)) {
             continue;
         }
         $loadedComponents[] = $info['componentId'];
         $component = strtolower(substr($info['componentId'], strrpos($info['componentId'], '-') + 1));
         $componentDirectory = 'components/' . $component . '/';
         if ($info['isCoreComponent']) {
             $absoluteComponentPath = PATH_t3lib . 'js/extjs/' . $componentDirectory;
             $relativeComponentPath = '../' . str_replace(PATH_site, '', $absoluteComponentPath);
         } else {
             $absoluteComponentPath = t3lib_extMgm::extPath($info['extKey']) . $componentDirectory;
             $relativeComponentPath = t3lib_extMgm::extRelPath($info['extKey']) . $componentDirectory;
         }
         $cssFiles = t3lib_div::getFilesInDir($absoluteComponentPath . 'css/', 'css');
         if (file_exists($absoluteComponentPath . 'css/loadorder.txt')) {
             //don't allow inclusion outside directory
             $loadOrder = str_replace('../', '', t3lib_div::getURL($absoluteComponentPath . 'css/loadorder.txt'));
             $cssFilesOrdered = t3lib_div::trimExplode(LF, $loadOrder, TRUE);
             $cssFiles = array_merge($cssFilesOrdered, $cssFiles);
         }
         foreach ($cssFiles as $cssFile) {
             $this->pageRenderer->addCssFile($relativeComponentPath . 'css/' . $cssFile);
         }
         $jsFiles = t3lib_div::getFilesInDir($absoluteComponentPath . 'javascript/', 'js');
         if (file_exists($absoluteComponentPath . 'javascript/loadorder.txt')) {
             //don't allow inclusion outside directory
             $loadOrder = str_replace('../', '', t3lib_div::getURL($absoluteComponentPath . 'javascript/loadorder.txt'));
             $jsFilesOrdered = t3lib_div::trimExplode(LF, $loadOrder, TRUE);
             $jsFiles = array_merge($jsFilesOrdered, $jsFiles);
         }
         foreach ($jsFiles as $jsFile) {
             $this->pageRenderer->addJsFile($relativeComponentPath . 'javascript/' . $jsFile);
         }
     }
 }
Esempio n. 5
0
 /**
  * Includes a javascript library that exists in the core /typo3/ directory. The
  * backpath is automatically applied
  *
  * @param	string		$lib: Library name. Call it with the full path
  * 				like "contrib/prototype/prototype.js" to load it
  * @return	void
  */
 function loadJavascriptLib($lib)
 {
     $this->pageRenderer->addJsFile($this->backPath . $lib);
 }
Esempio n. 6
0
 /**
  * This loads everything needed for the Context Sensitive Help (CSH)
  *
  * @return void
  */
 protected function loadCshJavascript()
 {
     $this->pageRenderer->loadExtJS();
     $this->pageRenderer->addJsFile($this->backPath . '../t3lib/js/extjs/contexthelp.js');
     $this->pageRenderer->addExtDirectCode();
 }
Esempio n. 7
0
    /**
     * Main function of the module. Write the content to $this->content
     * If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree
     *
     * @return void
     */
    function main()
    {
        global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
        $PATH_TYPO3 = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'typo3/';
        if ($BE_USER->user["admin"]) {
            // find node
            $node_repository = tx_caretaker_NodeRepository::getInstance();
            $node = $node_repository->id2node($this->node_id, true);
            if (!$node) {
                $node = $node_repository->getRootNode();
            }
            // Draw the header.
            $this->doc = t3lib_div::makeInstance("template");
            $this->doc->backPath = $BACK_PATH;
            $this->pageRenderer = $this->doc->getPageRenderer();
            // Include Ext JS
            $this->pageRenderer->loadExtJS();
            $this->pageRenderer->enableExtJSQuickTips();
            $this->pageRenderer->addJsFile($BACK_PATH . t3lib_extMgm::extRelPath('caretaker') . 'res/js/tx.caretaker.js');
            $panels = array();
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['caretaker']['extJsBackendPanels'] as $extJsBackendPanel) {
                // register JS
                foreach ($extJsBackendPanel['jsIncludes'] as $jsInclude) {
                    $filename = $BACK_PATH . '../' . str_replace(PATH_site, '', t3lib_div::getFileAbsFileName($jsInclude));
                    $this->pageRenderer->addJsFile($filename);
                }
                // register CSS
                foreach ($extJsBackendPanel['cssIncludes'] as $cssInclude) {
                    $filename = $BACK_PATH . '../' . str_replace(PATH_site, '', t3lib_div::getFileAbsFileName($cssInclude));
                    $this->pageRenderer->addCssFile($filename);
                }
                // add ExtJs Panel
                $panels[$extJsBackendPanel['id']] = $extJsBackendPanel['xtype'];
            }
            $this->pageRenderer->addJsFile($BACK_PATH . t3lib_extMgm::extRelPath('caretaker') . 'res/js/tx.caretaker.NodeToolbar.js');
            // Enable debug mode for Ext JS
            $this->pageRenderer->enableExtJsDebug();
            // storage Pid
            $confArray = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['caretaker']);
            $storagePid = (int) $confArray['storagePid'];
            //Add caretaker css
            $this->pageRenderer->addCssFile($BACK_PATH . t3lib_extMgm::extRelPath('caretaker') . 'res/css/tx.caretaker.overview.css');
            $pluginItems = array();
            foreach ($panels as $id => $xtype) {
                $pluginItems[] = '{ id: "' . $id . '", xtype: "' . $xtype . '" , back_path: back_path , node_id: node_id }';
            }
            $this->pageRenderer->addJsInlineCode('Caretaker_Overview', '
				Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
				Ext.namespace("tx","tx.caretaker");

				Ext.QuickTips.init();

				Ext.onReady( function() {

					var back_path   = "' . $this->doc->backPath . '";
					var back_url    = "' . urlencode(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL')) . '";
					var path_typo3  = "' . t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'typo3/";
					var	add_url     = "' . $PATH_TYPO3 . 'alt_doc.php?edit[###NODE_TYPE###][' . $storagePid . ']=new";
					var node_id     = "' . $node->getCaretakerNodeId() . '";
					var node_type   = "' . strtolower($node->getType()) . '";
					var node_hidden = "' . $node->getHidden() . '";
					var node_uid    = "' . $node->getUid() . '";
					var node_title  = "' . htmlspecialchars($node->getTitle() ? $node->getTitle() : '[no title]') . '( ' . ($node->getTypeDescription() ? htmlspecialchars($node->getTypeDescription()) : $node->getType()) . ' )" ;
					var node_state  = "' . $node->getTestResult()->getState() . '" ;
					var node_state_info  = "' . $node->getTestResult()->getStateInfo() . '" ;

					tx.caretaker.view = new Ext.Viewport({
						layout: "fit",
						items: {
								xtype    : "panel",
								id       : "node",
								autoScroll: true,
								title    : node_title,
								iconCls  : "icon-caretaker-type-" + node_type,
								tbar     : {
									xtype: "caretaker-nodetoolbar",
									back_path: back_path,
									path_typo3: path_typo3,
									back_url: back_url,
									add_url :add_url,
									node_id: node_id,
									node_type: node_type,
									node_uid: node_uid,
									node_hidden: node_hidden,
									node_state: node_state,
									node_state_info: node_state_info
								},
								items    : [
									{
										xtype    : "panel",
										padding  : "10",
										layout   : "fit",
										id       : "caretaker-panels",
										items    : [
											' . implode(chr(10) . ',', $pluginItems) . chr(10) . '
										]
									}
								],

						}
					 });

				});
			');
            $this->content .= $this->doc->startPage($LANG->getLL("title"));
            $this->doc->form = '';
        } else {
            // If no access or if not admin
            $this->doc = t3lib_div::makeInstance("mediumDoc");
            $this->doc->backPath = $BACK_PATH;
            $this->content .= $this->doc->startPage($LANG->getLL("title"));
            $this->content .= $this->doc->header($LANG->getLL("title"));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->spacer(10);
        }
    }
    /**
     * Render module content
     *
     * @return string $content
     */
    public function render()
    {
        /* Add CSS */
        $this->pageRenderer->addCssFile($this->resPath . 'js/ux/css/GridFilters.css');
        $this->pageRenderer->addCssFile($this->resPath . 'js/ux/css/RangeMenu.css');
        $this->pageRenderer->addCssFile($this->resPath . 'css/t3_em.css');
        $iconsGfxPath = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['relDir'] . 'gfx/';
        $this->pageRenderer->addCssInlineBlock('em-t3skin-icons', '
			.x-tree-node-leaf img.tree-edit { background-image:url(' . $iconsGfxPath . 'edit_file.gif);}
			.x-btn-edit { background-image:url(' . $iconsGfxPath . 'edit2.gif) !important;}
			.x-btn-new { background-image:url(' . $iconsGfxPath . 'new_el.gif) !important;}
			.x-btn-delete { background-image:url(' . $iconsGfxPath . 'garbage.gif) !important;}
			.x-tree-node-leaf img.tree-unknown { background-image:url(' . $iconsGfxPath . 'default.gif); }
			.x-btn-save { background-image:url(' . $iconsGfxPath . 'savedok.gif) !important;}
			.x-btn-upload { background-image:url(' . $iconsGfxPath . 'upload.gif) !important;}
			.x-btn-download { background-image:url(' . $iconsGfxPath . 'down.gif) !important;}
			.x-btn-undo { background-image:url(' . $this->resPath . 'icons/arrow_undo.png) !important;}
			.x-btn-redo { background-image:url(' . $this->resPath . 'icons/arrow_redo.png) !important;}
			.x-btn-jslint { background-image:url(' . $this->resPath . 'icons/jslint.gif) !important;}
			.x-btn-indent { background-image:url(' . $this->resPath . 'icons/text_indent.png) !important;}
		');
        /* load ExtJS */
        $this->pageRenderer->loadExtJS();
        $this->pageRenderer->enableExtJSQuickTips();
        // Load  JavaScript:
        $this->pageRenderer->addJsFile($this->parentObject->doc->backPath . 'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.EM', NULL, FALSE);
        $this->pageRenderer->addJsFile($this->parentObject->doc->backPath . 'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.EMSOAP', NULL, FALSE);
        $this->pageRenderer->addExtDirectCode();
        // Localization
        $labels = array();
        $this->pageRenderer->addInlineLanguageLabelFile(t3lib_extMgm::extPath('em', 'language/locallang.xml'));
        $labels['yes'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes');
        $labels['no'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:no');
        $this->pageRenderer->addInlineLanguageLabelArray($labels);
        $globalSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['em']);
        if (!is_array($globalSettings)) {
            $globalSettings = array('displayMyExtensions' => 0, 'selectedLanguages' => array(), 'inlineToWindow' => 1);
        }
        $settings = $this->parentObject->MOD_SETTINGS;
        $mirrors = unserialize($settings['extMirrors']);
        $settings['extMirrors'] = array(array('Random (recommended)', '', '', '', '', '', ''));
        if (is_array($mirrors)) {
            foreach ($mirrors as $mirror) {
                $settings['extMirrors'][] = array($mirror['title'], $mirror['country'], $mirror['host'], $mirror['path'], $mirror['sponsor']['name'], $mirror['sponsor']['link'], $mirror['sponsor']['logo']);
            }
        }
        $allowRepositoryUpdate = !intval($GLOBALS['BE_USER']->getTSConfigVal('mod.tools_em.hideRepositoryUpdate'));
        /* file operations */
        $fileAllowMove = intval($GLOBALS['BE_USER']->getTSConfigVal('mod.tools_em.fileAllowMove'));
        $fileAllowDelete = intval($GLOBALS['BE_USER']->getTSConfigVal('mod.tools_em.fileAllowDelete'));
        $fileAllowRename = intval($GLOBALS['BE_USER']->getTSConfigVal('mod.tools_em.fileAllowRename'));
        $fileAllowUpload = intval($GLOBALS['BE_USER']->getTSConfigVal('mod.tools_em.fileAllowUpload'));
        $fileAllowCreate = intval($GLOBALS['BE_USER']->getTSConfigVal('mod.tools_em.fileAllowCreate'));
        $fileAllowDownload = intval($GLOBALS['BE_USER']->getTSConfigVal('mod.tools_em.fileAllowDownload'));
        // add the settings
        $additionalSettings = array('siteUrl' => t3lib_div::getIndpEnv('TYPO3_SITE_URL'), 'backPath' => $this->parentObject->doc->backPath, 'hasCredentials' => isset($settings['fe_u']) && isset($settings['fe_p']) && $settings['fe_u'] !== '' && $settings['fe_p'] !== '', 'scriptLink' => $this->parentObject->script, 'editorCss' => $this->resPath . 'css/editor.css', 'codemirrorCssPath' => $this->parentObject->doc->backPath . 'contrib/codemirror/css/', 'codemirrorJsPath' => $this->parentObject->doc->backPath . 'contrib/codemirror/js/', 'codemirrorContribPath' => $this->parentObject->doc->backPath . 'contrib/codemirror/contrib/', 'selectedLanguages' => t3lib_div::trimExplode(',', $globalSettings['selectedLanguages'], TRUE), 'state' => $GLOBALS['BE_USER']->uc['moduleData']['tools_em']['States'], 'inlineToWindow' => $globalSettings['inlineToWindow'], 'allowRepositoryUpdate' => $allowRepositoryUpdate, 'displayMyExtensions' => $globalSettings['displayMyExtensions'], 'debug' => $GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] > 0, 'fileAllowSave' => $GLOBALS['TYPO3_CONF_VARS']['EXT']['noEdit'] == 0, 'fileAllowMove' => 0, 'fileAllowDelete' => 0, 'fileAllowRename' => 0, 'fileAllowUpload' => 0, 'fileAllowCreate' => 0, 'fileAllowDownload' => $fileAllowDownload);
        $settings = array_merge($settings, $additionalSettings);
        // Add JS
        $this->pageRenderer->addJsFile($this->parentObject->doc->backPath . '../t3lib/js/extjs/ux/flashmessages.js');
        $this->pageRenderer->addJsFile($this->parentObject->doc->backPath . 'js/extjs/iframepanel.js');
        $this->pageRenderer->addJsFile($this->parentObject->doc->backPath . 'contrib/codemirror/js/codemirror.js');
        //Plugins
        $this->pageRenderer->addJsFile($this->resPath . 'js/overrides/ext_overrides.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/custom_plugins.js');
        $this->pageRenderer->addJsFile($this->parentObject->doc->backPath . '../t3lib/js/extjs/ux/Ext.ux.FitToParent.js');
        $this->pageRenderer->addJsFile($this->parentObject->doc->backPath . '../t3lib/js/extjs/notifications.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/TreeState.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/RowPanelExpander.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/searchfield.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/fileuploadfield.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/menu/RangeMenu.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/menu/ListMenu.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/GridFilters.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/filter/Filter.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/filter/BooleanFilter.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/filter/DateFilter.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/filter/ListFilter.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/filter/NumericFilter.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/filter/StringFilter.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/ux/jslint.js');
        //Scripts
        $this->pageRenderer->addJsFile($this->resPath . 'js/em_layouts.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/em_components.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/em_files.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/em_ter.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/em_tools.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/em_locallist.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/em_repositorylist.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/em_usertools.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/em_languages.js');
        $this->pageRenderer->addJsFile($this->resPath . 'js/em_settings.js');
        //Application
        $this->pageRenderer->addJsFile($this->resPath . 'js/em_app.js');
        // clear flashmessages from php
        t3lib_FlashMessageQueue::getAllMessagesAndFlush();
        $content = '
			<div id="em-message-area"></div><div id="em-app"></div>
			<!-- dummy form to make configuration js happy -->
			<form name="tsStyleConfigForm" action="" method="post"></form>
		';
        //hook for the extension manager gui
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['em/classes/class.tx_em_extensionamager.php']['renderHook'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['em/classes/class.tx_em_extensionamager.php']['renderHook'] as $classRef) {
                $hookObject = t3lib_div::getUserObj($classRef);
                if (!$hookObject instanceof tx_em_renderHook) {
                    throw new UnexpectedValueException('$hookObject must implement interface tx_em_renderHook', 1298121373);
                }
                $hookObject->render($this->pageRenderer, $settings, $content);
            }
        }
        // render settings and labels
        $this->pageRenderer->addInlineSettingArray('EM', $settings);
        $this->pageRenderer->addInlineLanguageLabelArray($labels);
        return $content;
    }
 public function render()
 {
     $doc = $this->getDocInstance();
     $doc->bodyTagAdditions .= 'class="yui-skin-sam"';
     $baseUrl = '../' . t3lib_extMgm::siteRelPath('extension_builder');
     $this->pageRenderer->disableCompressJavascript();
     $this->pageRenderer->loadExtJS(FALSE, FALSE);
     // SECTION: JAVASCRIPT FILES
     // YUI Basis Files
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/yui/utilities/utilities.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/yui/resize/resize-min.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/yui/layout/layout-min.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/yui/container/container-min.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/yui/json/json-min.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/yui/button/button-min.js');
     // YUI-RPC
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/yui-rpc.js');
     // InputEx with wirable options
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/js/inputex.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/js/Field.js');
     // extended fields for enabling unique ids
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/extended/ListField.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/extended/Group.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/util/inputex/WirableField-beta.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/js/Visus.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/js/fields/StringField.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/js/fields/Textarea.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/js/fields/SelectField.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/js/fields/EmailField.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/js/fields/UrlField.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/js/fields/CheckBox.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/js/fields/InPlaceEdit.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/js/fields/MenuField.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/js/fields/TypeField.js');
     // WireIt
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/excanvas.js', 'text/javascript', TRUE, FALSE, '<!--[if IE]>|<![endif]-->');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/WireIt.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/CanvasElement.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/Wire.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/Terminal.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/util/DD.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/util/DDResize.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/Container.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/ImageContainer.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/Layer.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/util/inputex/FormContainer-beta.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/LayerMap.js');
     $this->pageRenderer->addInlineSettingArray('extensionBuilder', array('baseUrl' => $baseUrl));
     $this->setLocallangSettings();
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/js/WiringEditor.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/roundtrip.js');
     // Extbase Modelling definition
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/extbaseModeling.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/layout.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/extensionProperties.js');
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/modules/modelObject.js');
     // collapsible forms in relations
     $this->pageRenderer->addJsFile($baseUrl . 'Resources/Public/jsDomainModeling/modules/extendedModelObject.js');
     // SECTION: CSS Files
     // YUI CSS
     $this->pageRenderer->addCssFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/yui/reset-fonts-grids/reset-fonts-grids.css');
     $this->pageRenderer->addCssFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/yui/assets/skins/sam/skin.css');
     // InputEx CSS
     $this->pageRenderer->addCssFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/lib/inputex/css/inputEx.css');
     // WireIt CSS
     $this->pageRenderer->addCssFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/css/WireIt.css');
     $this->pageRenderer->addCssFile($baseUrl . 'Resources/Public/jsDomainModeling/wireit/css/WireItEditor.css');
     // Custom CSS
     $this->pageRenderer->addCssFile($baseUrl . 'Resources/Public/jsDomainModeling/extbaseModeling.css');
 }
Esempio n. 10
0
    /**
     * main function generating the BE scaffolding
     *
     * @return	void
     */
    public function render()
    {
        $this->executeHook('renderPreProcess');
        if (t3lib_div::makeInstance('DonateWindow')->isDonateWindowAllowed()) {
            $this->pageRenderer->addJsFile('js/donate.js');
        }
        // prepare the scaffolding, at this point extension may still add javascript and css
        $logo = t3lib_div::makeInstance('TYPO3Logo');
        $logo->setLogo('gfx/typo3logo_mini.png');
        $menu = $this->moduleMenu->render();
        if ($this->menuWidth != $this->menuWidthDefault) {
            $this->css .= '
				#typo3-top {
					margin-left: ' . $this->menuWidth . 'px;
				}
			';
        }
        // create backend scaffolding
        $backendScaffolding = '
	<div id="typo3-backend">
		<div id="typo3-top-container" class="x-hide-display">
			<div id="typo3-logo">' . $logo->render() . '</div>
			<div id="typo3-top" class="typo3-top-toolbar">' . $this->renderToolbar() . '</div>
		</div>
		<div id="typo3-main-container">
			<div id="typo3-side-menu" class="x-hide-display">' . $menu . '</div>
			<div id="typo3-content" class="x-hide-display">
				<iframe src="alt_intro.php" name="content" id="content" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto"></iframe>
			</div>
		</div>
	</div>
';
        /******************************************************
         * now put the complete backend document together
         ******************************************************/
        foreach ($this->cssFiles as $cssFileName => $cssFile) {
            $this->pageRenderer->addCssFile($cssFile);
            // load addditional css files to overwrite existing core styles
            if (!empty($GLOBALS['TBE_STYLES']['stylesheets'][$cssFileName])) {
                $this->pageRenderer->addCssFile($GLOBALS['TBE_STYLES']['stylesheets'][$cssFileName]);
            }
        }
        if (!empty($this->css)) {
            $this->pageRenderer->addCssInlineBlock('BackendInlineCSS', $this->css);
        }
        foreach ($this->jsFiles as $jsFile) {
            $this->pageRenderer->addJsFile($jsFile);
        }
        // Those lines can be removed once we have at least one official ExtDirect router within the backend.
        $hasExtDirectRouter = FALSE;
        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'] as $key => $value) {
                if (strpos($key, 'TYPO3.Ajax.ExtDirect') !== FALSE) {
                    $hasExtDirectRouter = TRUE;
                    break;
                }
            }
        }
        if ($hasExtDirectRouter) {
            $this->pageRenderer->addJsFile('ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.Ajax.ExtDirect', NULL, FALSE);
        }
        $this->generateJavascript();
        $this->pageRenderer->addJsInlineCode('BackendInlineJavascript', $this->js);
        // set document title:
        $title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] ? $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . ' [TYPO3 ' . TYPO3_version . ']' : 'TYPO3 ' . TYPO3_version;
        // start page header:
        $this->content .= $GLOBALS['TBE_TEMPLATE']->startPage($title);
        $this->content .= $backendScaffolding;
        $this->content .= $GLOBALS['TBE_TEMPLATE']->endPage();
        $hookConfiguration = array('content' => &$this->content);
        $this->executeHook('renderPostProcess', $hookConfiguration);
        echo $this->content;
    }