本文整理汇总了PHP中TYPO3\CMS\Backend\Template\DocumentTemplate::loadJavascriptLib方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentTemplate::loadJavascriptLib方法的具体用法?PHP DocumentTemplate::loadJavascriptLib怎么用?PHP DocumentTemplate::loadJavascriptLib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Template\DocumentTemplate
的用法示例。
在下文中一共展示了DocumentTemplate::loadJavascriptLib方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initDocumentTemplate
/**
* Initialize document template object
*
* @return void
*/
protected function initDocumentTemplate()
{
// Creating backend template object:
$this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->bodyTagId = 'typo3-browse-links-php';
$this->doc->backPath = $GLOBALS['BACK_PATH'];
// Load the Prototype library and browse_links.js
$this->doc->getPageRenderer()->loadPrototype();
$this->doc->loadJavascriptLib('js/browse_links.js');
$this->doc->loadJavascriptLib('js/tree.js');
}
示例2: init
/**
* Initialization of the class
*
* @return void
*/
public function init()
{
// Setting GPvars:
$this->id = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'));
$this->edit = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('edit');
$this->return_id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('return_id');
$this->lastEdited = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('lastEdited');
// Module name;
$this->MCONF = $GLOBALS['MCONF'];
// Page select clause:
$this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
// Initializing document template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/perm.html');
$this->doc->form = '<form action="' . $GLOBALS['BACK_PATH'] . 'tce_db.php" method="post" name="editform">';
$this->doc->loadJavascriptLib('../t3lib/jsfunc.updateform.js');
$this->doc->getPageRenderer()->loadPrototype();
$this->doc->loadJavascriptLib(\TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath('perm') . 'mod1/perm.js');
// Setting up the context sensitive menu:
$this->doc->getContextMenuCode();
// Set up menus:
$this->menuConfig();
}
示例3: main
/**
* Generate the main settings formular:
*
* @return void
* @todo Define visibility
*/
public function main()
{
global $LANG;
if ($this->languageUpdate) {
$this->doc->JScodeArray['languageUpdate'] .= '
if (top.refreshMenu) {
top.refreshMenu();
} else {
top.TYPO3ModuleMenu.refreshMenu();
}
';
}
if ($this->pagetreeNeedsRefresh) {
BackendUtility::setUpdateSignal('updatePageTree');
}
// Start page:
$this->doc->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/md5.js');
// Use a wrapper div
$this->content .= '<div id="user-setup-wrapper">';
// Load available backend modules
$this->loadModules = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Module\\ModuleLoader');
$this->loadModules->observeWorkspaces = TRUE;
$this->loadModules->load($GLOBALS['TBE_MODULES']);
$this->content .= $this->doc->header($LANG->getLL('UserSettings'));
// Show if setup was saved
if ($this->setupIsUpdated && !$this->tempDataIsCleared && !$this->settingsAreResetToDefault) {
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $LANG->getLL('setupWasUpdated'), $LANG->getLL('UserSettings'));
$this->content .= $flashMessage->render();
}
// Show if temporary data was cleared
if ($this->tempDataIsCleared) {
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $LANG->getLL('tempDataClearedFlashMessage'), $LANG->getLL('tempDataCleared'));
$this->content .= $flashMessage->render();
}
// Show if temporary data was cleared
if ($this->settingsAreResetToDefault) {
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $LANG->getLL('settingsAreReset'), $LANG->getLL('resetConfiguration'));
$this->content .= $flashMessage->render();
}
// Notice
if ($this->setupIsUpdated || $this->settingsAreResetToDefault) {
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $LANG->getLL('activateChanges'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
$this->content .= $flashMessage->render();
}
// If password is updated, output whether it failed or was OK.
if ($this->passwordIsSubmitted) {
if ($this->passwordIsUpdated) {
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $LANG->getLL('newPassword_ok'), $LANG->getLL('newPassword'));
} else {
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $LANG->getLL('newPassword_failed'), $LANG->getLL('newPassword'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
}
$this->content .= $flashMessage->render();
}
// Render the menu items
$menuItems = $this->renderUserSetup();
$this->content .= $this->doc->getDynTabMenu($menuItems, 'user-setup', FALSE, FALSE, 1, FALSE, 1, $this->dividers2tabs);
$formToken = $this->formProtection->generateToken('BE user setup', 'edit');
$this->content .= $this->doc->section('', '<input type="hidden" name="simUser" value="' . $this->simUser . '" />
<input type="hidden" name="formToken" value="' . $formToken . '" />
<input type="hidden" value="1" name="data[save]" />
<input type="hidden" name="data[setValuesToDefault]" value="0" id="setValuesToDefault" />
<input type="hidden" name="data[clearSessionVars]" value="0" id="clearSessionVars" />');
// End of wrapper div
$this->content .= '</div>';
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markers['CSH'] = $docHeaderButtons['csh'];
$markers['CONTENT'] = $this->content;
// Build the <body> for the module
$this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
// Renders the module page
$this->content = $this->doc->render($LANG->getLL('UserSettings'), $this->content);
}
示例4: getJavascriptCode
/**
* Retrieves JavaScript code (header part) for editor
*
* @param \TYPO3\CMS\Backend\Template\DocumentTemplate $doc
* @return string JavaScript code
*/
public function getJavascriptCode($doc)
{
$content = '';
if ($this->isEnabled()) {
$path_t3e = \t3lib_extmgm::extRelPath('t3editor');
$path_codemirror = 'contrib/codemirror/js/';
// Include needed javascript-frameworks
$pageRenderer = $doc->getPageRenderer();
/** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
$pageRenderer->loadPrototype();
$pageRenderer->loadScriptaculous();
// Include editor-css
$content .= '<link href="' . \TYPO3\CMS\Core\Utility\GeneralUtility::createVersionNumberedFilename($GLOBALS['BACK_PATH'] . \t3lib_extmgm::extRelPath('t3editor') . 'res/css/t3editor.css') . '" type="text/css" rel="stylesheet" />';
// Include editor-js-lib
$doc->loadJavascriptLib($path_codemirror . 'codemirror.js');
$doc->loadJavascriptLib($path_t3e . 'res/jslib/t3editor.js');
$content .= \TYPO3\CMS\Core\Utility\GeneralUtility::wrapJS('T3editor = T3editor || {};' . 'T3editor.lang = ' . json_encode($this->getJavaScriptLabels()) . ';' . LF . 'T3editor.PATH_t3e = "' . $GLOBALS['BACK_PATH'] . $path_t3e . '"; ' . LF . 'T3editor.PATH_codemirror = "' . $GLOBALS['BACK_PATH'] . $path_codemirror . '"; ' . LF . 'T3editor.URL_typo3 = "' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir) . '"; ' . LF . 'T3editor.template = ' . $this->getPreparedTemplate() . ';' . LF . 'T3editor.ajaxSavetype = "' . $this->ajaxSaveType . '";' . LF);
$content .= $this->getModeSpecificJavascriptCode();
}
return $content;
}
示例5: getJavascriptCode
/**
* Retrieves JavaScript code (header part) for editor
*
* @param \TYPO3\CMS\Backend\Template\DocumentTemplate $doc
* @return string JavaScript code
*/
public function getJavascriptCode($doc)
{
$content = '';
$path_t3e = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3editor');
$path_codemirror = 'contrib/codemirror/js/';
// Include needed javascript-frameworks
$pageRenderer = $doc->getPageRenderer();
/** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
$pageRenderer->loadPrototype();
$pageRenderer->loadScriptaculous();
// Include editor-css
$content .= '<link href="' . GeneralUtility::createVersionNumberedFilename($GLOBALS['BACK_PATH'] . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3editor') . 'res/css/t3editor.css') . '" type="text/css" rel="stylesheet" />';
// Include editor-js-lib
$doc->loadJavascriptLib($path_codemirror . 'codemirror.js');
$doc->loadJavascriptLib($path_t3e . 'res/jslib/t3editor.js');
$pageRenderer->loadRequireJsModule('TYPO3/CMS/T3editor/T3editor');
$content .= GeneralUtility::wrapJS('T3editor = T3editor || {};' . 'T3editor.lang = ' . json_encode($GLOBALS['LANG']->getLabelsWithPrefix('js.', 'label_')) . ';' . LF . 'T3editor.PATH_t3e = "' . $GLOBALS['BACK_PATH'] . $path_t3e . '"; ' . LF . 'T3editor.PATH_codemirror = "' . $GLOBALS['BACK_PATH'] . $path_codemirror . '"; ' . LF . 'T3editor.template = ' . $this->getPreparedTemplate() . ';' . LF . 'T3editor.ajaxSavetype = "' . $this->ajaxSaveType . '";' . LF);
$content .= $this->getModeSpecificJavascriptCode();
return $content;
}
示例6: init
/**
* Initialization of the class
*
* @return void
*/
public function init()
{
// GPvars:
$this->id = (int) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
$this->redirect = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('redirect');
$this->prErr = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('prErr');
$this->CB = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('CB');
$this->vC = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('vC');
$this->uPT = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('uPT');
$this->sorting = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('sorting');
$this->locales = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('locale');
$this->cmd = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cmd');
$this->clipObj = NULL;
$this->content = '';
$cbString = isset($this->CB['overwrite']) ? 'CB[overwrite]=' . rawurlencode($this->CB['overwrite']) . '&CB[pad]=' . $this->CB['pad'] : 'CB[paste]=' . rawurlencode($this->CB['paste']) . '&CB[pad]=' . $this->CB['pad'];
// Initializing document template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->docType = 'xhtml_trans';
$this->doc->setModuleTemplate(PATH_TXCOMMERCE . 'Resources/Private/Backend/mod_index.html');
$this->doc->loadJavascriptLib('contrib/prototype/prototype.js');
$this->doc->loadJavascriptLib($this->doc->backPath . PATH_TXCOMMERCE_REL . 'Resources/Public/Javascript/copyPaste.js');
$this->doc->form = '<form action="DataHandlerUtility.php?' . $cbString . '&vC=' . $this->vC . '&uPT=' . $this->uPT . '&redirect=' . rawurlencode($this->redirect) . '&prErr=' . $this->prErr . '&cmd=commit" method="post" name="localeform" id="localeform">';
}