/** * test load prototype */ public function testLoadPrototype() { $expectedRegExp = '#<script src="contrib/prototype/prototype\\.(js|\\d+\\.js|js\\?\\d+)" type="text/javascript"></script>#'; $this->fixture->loadPrototype(); $out = $this->fixture->render(); $this->assertRegExp($expectedRegExp, $out); }
/** * @param string $table * @param array|string $data * @return string */ public function render($table = NULL, $data = NULL) { if (!$data) { $data = array(); } if ($table) { if (!$data['uid']) { $data['uid'] = "none"; } if (!$data['pid']) { $data['pid'] = "0"; } $this->pageRenderer->loadPrototype(); $this->pageRenderer->loadExtJS(); $this->tceforms = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\FormEngine'); $this->tceforms->initDefaultBEMode(); // EXTBASE FORMS $this->tceforms->prependFormFieldNames = $this->getFieldNamePrefix(); $this->tceforms->formName = $table; $this->tceforms->totalWrap = '<div class="typo3-TCEforms"> | </div>'; $this->tceforms->doSaveFieldName = 'doSave'; $this->tceforms->localizationMode = GeneralUtility::inList('text,media', $this->localizationMode) ? $this->localizationMode : ''; $this->tceforms->returnUrl = $this->R_URI; $this->tceforms->palettesCollapsed = !$this->MOD_SETTINGS['showPalettes']; $this->tceforms->disableRTE = !$GLOBALS['BE_USER']->isRTE(); $this->tceforms->enableClickMenu = TRUE; $this->tceforms->enableTabMenu = TRUE; $panel = $this->tceforms->getMainFields($table, $data); $body = $this->tceforms->printNeededJSFunctions_top(); $body .= $this->tceforms->wrapTotal($panel, $data, $table); $body .= $this->tceforms->printNeededJSFunctions(); if (count($this->tceforms->commentMessages)) { $body .= ' <!-- TCEFORM messages ' . htmlspecialchars(implode(LF, $this->tceforms->commentMessages)) . ' --> '; } } else { return "Tabelle wurde nicht angegeben."; } return $body; }
/** * Load the necessarry javascript * * This will only be done when the referenced record is available * * @return void */ protected function loadJavascript() { $compress = TRUE; $javascriptFiles = array('Initialize.js', 'Ux/Ext.ux.merge.js', 'Ux/Ext.ux.isemptyobject.js', 'Ux/Ext.ux.spinner.js', 'Ux/Ext.ux.form.spinnerfield.js', 'Ux/Ext.ux.form.textfieldsubmit.js', 'Ux/Ext.ux.grid.CheckColumn.js', 'Ux/Ext.ux.grid.SingleSelectCheckColumn.js', 'Ux/Ext.ux.grid.ItemDeleter.js', 'Helpers/History.js', 'Helpers/Element.js', 'Elements/ButtonGroup.js', 'Elements/Container.js', 'Elements/Elements.js', 'Elements/Dummy.js', 'Elements/Basic/Button.js', 'Elements/Basic/Checkbox.js', 'Elements/Basic/Fieldset.js', 'Elements/Basic/Fileupload.js', 'Elements/Basic/Form.js', 'Elements/Basic/Hidden.js', 'Elements/Basic/Password.js', 'Elements/Basic/Radio.js', 'Elements/Basic/Reset.js', 'Elements/Basic/Select.js', 'Elements/Basic/Submit.js', 'Elements/Basic/Textarea.js', 'Elements/Basic/Textline.js', 'Elements/Predefined/Email.js', 'Elements/Predefined/CheckboxGroup.js', 'Elements/Predefined/Name.js', 'Elements/Predefined/RadioGroup.js', 'Elements/Content/Header.js', 'Elements/Content/Textblock.js', 'Viewport.js', 'Viewport/Left.js', 'Viewport/Right.js', 'Viewport/Left/Elements.js', 'Viewport/Left/Elements/ButtonGroup.js', 'Viewport/Left/Elements/Basic.js', 'Viewport/Left/Elements/Predefined.js', 'Viewport/Left/Elements/Content.js', 'Viewport/Left/Options.js', 'Viewport/Left/Options/Dummy.js', 'Viewport/Left/Options/Panel.js', 'Viewport/Left/Options/Forms/Attributes.js', 'Viewport/Left/Options/Forms/Label.js', 'Viewport/Left/Options/Forms/Legend.js', 'Viewport/Left/Options/Forms/Options.js', 'Viewport/Left/Options/Forms/Various.js', 'Viewport/Left/Options/Forms/Filters.js', 'Viewport/Left/Options/Forms/Filters/Filter.js', 'Viewport/Left/Options/Forms/Filters/Dummy.js', 'Viewport/Left/Options/Forms/Filters/Alphabetic.js', 'Viewport/Left/Options/Forms/Filters/Alphanumeric.js', 'Viewport/Left/Options/Forms/Filters/Currency.js', 'Viewport/Left/Options/Forms/Filters/Digit.js', 'Viewport/Left/Options/Forms/Filters/Integer.js', 'Viewport/Left/Options/Forms/Filters/LowerCase.js', 'Viewport/Left/Options/Forms/Filters/RegExp.js', 'Viewport/Left/Options/Forms/Filters/RemoveXSS.js', 'Viewport/Left/Options/Forms/Filters/StripNewLines.js', 'Viewport/Left/Options/Forms/Filters/TitleCase.js', 'Viewport/Left/Options/Forms/Filters/Trim.js', 'Viewport/Left/Options/Forms/Filters/UpperCase.js', 'Viewport/Left/Options/Forms/Validation.js', 'Viewport/Left/Options/Forms/Validation/Rule.js', 'Viewport/Left/Options/Forms/Validation/Dummy.js', 'Viewport/Left/Options/Forms/Validation/Alphabetic.js', 'Viewport/Left/Options/Forms/Validation/Alphanumeric.js', 'Viewport/Left/Options/Forms/Validation/Between.js', 'Viewport/Left/Options/Forms/Validation/Date.js', 'Viewport/Left/Options/Forms/Validation/Digit.js', 'Viewport/Left/Options/Forms/Validation/Email.js', 'Viewport/Left/Options/Forms/Validation/Equals.js', 'Viewport/Left/Options/Forms/Validation/FileAllowedTypes.js', 'Viewport/Left/Options/Forms/Validation/FileMaximumSize.js', 'Viewport/Left/Options/Forms/Validation/FileMinimumSize.js', 'Viewport/Left/Options/Forms/Validation/Float.js', 'Viewport/Left/Options/Forms/Validation/GreaterThan.js', 'Viewport/Left/Options/Forms/Validation/InArray.js', 'Viewport/Left/Options/Forms/Validation/Integer.js', 'Viewport/Left/Options/Forms/Validation/Ip.js', 'Viewport/Left/Options/Forms/Validation/Length.js', 'Viewport/Left/Options/Forms/Validation/LessThan.js', 'Viewport/Left/Options/Forms/Validation/RegExp.js', 'Viewport/Left/Options/Forms/Validation/Required.js', 'Viewport/Left/Options/Forms/Validation/Uri.js', 'Viewport/Left/Form.js', 'Viewport/Left/Form/Behaviour.js', 'Viewport/Left/Form/Attributes.js', 'Viewport/Left/Form/Prefix.js', 'Viewport/Left/Form/PostProcessor.js', 'Viewport/Left/Form/PostProcessors/PostProcessor.js', 'Viewport/Left/Form/PostProcessors/Dummy.js', 'Viewport/Left/Form/PostProcessors/Mail.js', 'Viewport/Left/Form/PostProcessors/Redirect.js'); // Load ExtJS and prototype $this->pageRenderer->loadPrototype(); $this->pageRenderer->loadExtJS(); // Load the wizards javascript $baseUrl = ExtensionManagementUtility::extRelPath('form') . 'Resources/Public/JavaScript/Wizard/'; foreach ($javascriptFiles as $javascriptFile) { $this->pageRenderer->addJsFile($baseUrl . $javascriptFile, 'text/javascript', $compress, FALSE); } }
/** * Define the template for the module * * @param string $filename filename * @return void */ public function setModuleTemplate($filename) { // Load Prototype lib for IE event $this->pageRenderer->loadPrototype(); $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/iecompatibility.js'); $this->moduleTemplate = $this->getHtmlTemplate($filename); }
/** * Define the template for the module * * @param string $filename filename * @return void */ public function setModuleTemplate($filename) { // Load Prototype lib for IE event $this->pageRenderer->loadPrototype(); $this->loadJavascriptLib('js/iecompatibility.js'); $this->moduleTemplate = $this->getHtmlTemplate($filename); }
/** * Includes the necessary javascript file (tree.js) for use on pages which have the * drag and drop functionality (usually pages and folder display trees) * * @param string $table indicator of which table the drag and drop function should work on (pages or folders) * @return void * @todo Define visibility */ public function getDragDropCode($table) { $this->pageRenderer->loadPrototype(); $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/common.js'); $this->loadJavascriptLib('js/tree.js'); // Setting prefs for drag & drop $this->JScodeArray['dragdrop'] = ' DragDrop.changeURL = "' . $this->backPath . 'alt_clickmenu.php"; DragDrop.backPath = "' . GeneralUtility::shortMD5('' . '|' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']) . '"; DragDrop.table = "' . $table . '"; '; }