/** * Initializes the Module * * @return void */ protected function initialize() { if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $classRef) { $this->hookObjectsArr[$linkType] = GeneralUtility::getUserObj($classRef); } } $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('EXT:linkvalidator/Resources/Private/Templates/mod_template.html'); $this->pageRecord = BackendUtility::readPageAccess($this->pObj->id, $this->getBackendUser()->getPagePermsClause(1)); if ($this->pObj->id && is_array($this->pageRecord) || !$this->pObj->id && $this->isCurrentUserAdmin()) { $this->isAccessibleForCurrentUser = TRUE; } $this->doc->addStyleSheet('module', 'sysext/linkvalidator/Resources/Public/Styles/styles.css'); $this->doc->getPageRenderer()->loadJquery(); $this->doc->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Linkvalidator/Linkvalidator'); // Don't access in workspace if ($this->getBackendUser()->workspace !== 0) { $this->isAccessibleForCurrentUser = FALSE; } }
/** * Initializes the module for display of the settings form. * * @return void */ public function init() { $this->getLanguageService()->includeLLFile('EXT:setup/mod/locallang.xlf'); // Returns the script user - that is the REAL logged in user! ($GLOBALS[BE_USER] might be another user due to simulation!) $scriptUser = $this->getRealScriptUserObj(); $this->isAdmin = $scriptUser->isAdmin(); // Getting the 'override' values as set might be set in User TSconfig $this->overrideConf = $this->getBackendUser()->getTSConfigProp('setup.override'); // Getting the disabled fields might be set in User TSconfig (eg setup.fields.password.disabled=1) $this->tsFieldConf = $this->getBackendUser()->getTSConfigProp('setup.fields'); // id password is disabled, disable repeat of password too (password2) if (isset($this->tsFieldConf['password.']) && $this->tsFieldConf['password.']['disabled']) { $this->tsFieldConf['password2.']['disabled'] = 1; $this->tsFieldConf['passwordCurrent.']['disabled'] = 1; } // Create instance of object for output of data $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('EXT:setup/Resources/Private/Templates/setup.html'); $this->doc->form = '<form action="' . BackendUtility::getModuleUrl('user_setup') . '" method="post" name="usersetup" enctype="application/x-www-form-urlencoded">'; $this->doc->addStyleSheet('module', 'sysext/setup/Resources/Public/Styles/styles.css'); $this->doc->JScode .= $this->getJavaScript(); }
/** * Loads data in the HTML head section (e.g. JavaScript or stylesheet information) * * @return void */ protected function loadHeaderData() { $this->doc->addStyleSheet('linkvalidator', $this->relativePath . 'Resources/Public/Css/linkvalidator.css', 'linkvalidator'); $this->pageRenderer->addJsFile($this->doc->backPath . 'js/extjs/ux/Ext.ux.FitToParent.js'); }