本文整理汇总了PHP中TYPO3\CMS\Core\Page\PageRenderer::loadJquery方法的典型用法代码示例。如果您正苦于以下问题:PHP PageRenderer::loadJquery方法的具体用法?PHP PageRenderer::loadJquery怎么用?PHP PageRenderer::loadJquery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Page\PageRenderer
的用法示例。
在下文中一共展示了PageRenderer::loadJquery方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*/
public function __construct()
{
// Set debug flag for BE development only
$this->debug = (int) $GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] === 1;
// Initializes the backend modules structure for use later.
$this->moduleLoader = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Module\\ModuleLoader');
$this->moduleLoader->load($GLOBALS['TBE_MODULES']);
$this->pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
$this->pageRenderer->loadScriptaculous('builder,effects,controls,dragdrop');
$this->pageRenderer->loadExtJS();
$this->pageRenderer->loadJquery(NULL, NULL, \TYPO3\CMS\Core\Page\PageRenderer::JQUERY_NAMESPACE_DEFAULT_NOCONFLICT);
$this->pageRenderer->enableExtJSQuickTips();
$this->pageRenderer->addJsInlineCode('consoleOverrideWithDebugPanel', '//already done', FALSE);
$this->pageRenderer->addExtDirectCode();
// Add default BE javascript
$this->js = '';
$this->jsFiles = array('common' => 'sysext/backend/Resources/Public/JavaScript/common.js', 'locallang' => $this->getLocalLangFileName(), 'modernizr' => 'contrib/modernizr/modernizr.min.js', 'md5' => 'sysext/backend/Resources/Public/JavaScript/md5.js', 'toolbarmanager' => 'sysext/backend/Resources/Public/JavaScript/toolbarmanager.js', 'modulemenu' => 'sysext/backend/Resources/Public/JavaScript/modulemenu.js', 'evalfield' => 'sysext/backend/Resources/Public/JavaScript/jsfunc.evalfield.js', 'flashmessages' => 'sysext/backend/Resources/Public/JavaScript/flashmessages.js', 'tabclosemenu' => 'js/extjs/ux/ext.ux.tabclosemenu.js', 'notifications' => 'sysext/backend/Resources/Public/JavaScript/notifications.js', 'backend' => 'sysext/backend/Resources/Public/JavaScript/backend.js', 'loginrefresh' => 'sysext/backend/Resources/Public/JavaScript/loginrefresh.js', 'debugPanel' => 'js/extjs/debugPanel.js', 'viewport' => 'js/extjs/viewport.js', 'iframepanel' => 'sysext/backend/Resources/Public/JavaScript/iframepanel.js', 'backendcontentiframe' => 'js/extjs/backendcontentiframe.js', 'modulepanel' => 'js/extjs/modulepanel.js', 'viewportConfiguration' => 'js/extjs/viewportConfiguration.js', 'util' => 'sysext/backend/Resources/Public/JavaScript/util.js');
if ($this->debug) {
unset($this->jsFiles['loginrefresh']);
}
// Add default BE css
$this->pageRenderer->addCssLibrary('contrib/normalize/normalize.css', 'stylesheet', 'all', '', TRUE, TRUE);
$this->css = '';
$this->cssFiles = array();
$this->toolbarItems = array();
$this->initializeCoreToolbarItems();
$this->menuWidth = $this->menuWidthDefault;
if (isset($GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW']) && (int) $GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'] != (int) $this->menuWidth) {
$this->menuWidth = (int) $GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'];
}
$this->executeHook('constructPostProcess');
}
示例2: __construct
/**
* Construct
*/
public function __construct()
{
$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$this->pageRenderer->loadJquery();
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Recordlist/ElementBrowser');
$this->initialize();
}
示例3: loadJavaScripts
/**
* Loads all necessary Javascript Files
*
* @return void
*/
protected function loadJavaScripts()
{
$this->pageRenderer->loadJquery();
$this->pageRenderer->loadRequireJsModule('bootstrap');
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ContextHelp');
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DocumentHeader');
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/SplitButtons');
}
示例4: render
/**
* Render start page with \TYPO3\CMS\Backend\Template\DocumentTemplate and pageTitle
*
* @param string $pageTitle title tag of the module. Not required by default, as BE modules are shown in a frame
* @param bool $loadExtJs specifies whether to load ExtJS library. Defaults to FALSE
* @param bool $loadExtJsTheme whether to load ExtJS "grey" theme. Defaults to FALSE
* @param bool $enableExtJsDebug if TRUE, debug version of ExtJS is loaded. Use this for development only
* @param bool $loadJQuery whether to load jQuery library. Defaults to FALSE
* @param array $includeCssFiles List of custom CSS file to be loaded
* @param array $includeJsFiles List of custom JavaScript file to be loaded
* @param array $addJsInlineLabels Custom labels to add to JavaScript inline labels
* @param array $includeRequireJsModules List of RequireJS modules to be loaded
* @param string $jQueryNamespace Store the jQuery object in a specific namespace
* @return void
*/
public function render($pageTitle = '', $loadExtJs = false, $loadExtJsTheme = true, $enableExtJsDebug = false, $loadJQuery = false, $includeCssFiles = null, $includeJsFiles = null, $addJsInlineLabels = null, $includeRequireJsModules = null, $jQueryNamespace = null)
{
if ($pageTitle) {
$this->pageRenderer->setTitle($pageTitle);
}
if ($loadExtJs) {
$this->pageRenderer->loadExtJS(true, $loadExtJsTheme);
if ($enableExtJsDebug) {
$this->pageRenderer->enableExtJsDebug();
}
}
if ($loadJQuery) {
$jQueryNamespace = $jQueryNamespace ?: PageRenderer::JQUERY_NAMESPACE_DEFAULT;
$this->pageRenderer->loadJquery(null, null, $jQueryNamespace);
}
// Include custom CSS and JS files
if (is_array($includeCssFiles) && count($includeCssFiles) > 0) {
foreach ($includeCssFiles as $addCssFile) {
$this->pageRenderer->addCssFile($addCssFile);
}
}
if (is_array($includeJsFiles) && count($includeJsFiles) > 0) {
foreach ($includeJsFiles as $addJsFile) {
$this->pageRenderer->addJsFile($addJsFile);
}
}
if (is_array($includeRequireJsModules) && count($includeRequireJsModules) > 0) {
foreach ($includeRequireJsModules as $addRequireJsFile) {
$this->pageRenderer->loadRequireJsModule($addRequireJsFile);
}
}
// Add inline language labels
if (is_array($addJsInlineLabels) && count($addJsInlineLabels) > 0) {
$extensionKey = $this->controllerContext->getRequest()->getControllerExtensionKey();
foreach ($addJsInlineLabels as $key) {
$label = LocalizationUtility::translate($key, $extensionKey);
$this->pageRenderer->addInlineLanguageLabel($key, $label);
}
}
}
示例5: __construct
/**
* Constructor
*/
public function __construct()
{
$this->getLanguageService()->includeLLFile('EXT:lang/locallang_misc.xlf');
$this->backendModuleRepository = GeneralUtility::makeInstance(BackendModuleRepository::class);
// Set debug flag for BE development only
$this->debug = (int) $GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] === 1;
// Initializes the backend modules structure for use later.
$this->moduleLoader = GeneralUtility::makeInstance(ModuleLoader::class);
$this->moduleLoader->load($GLOBALS['TBE_MODULES']);
$this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$this->pageRenderer->loadExtJS();
// included for the module menu JavaScript, please note that this is subject to change
$this->pageRenderer->loadJquery();
$this->pageRenderer->addJsInlineCode('consoleOverrideWithDebugPanel', '//already done', false);
$this->pageRenderer->addExtDirectCode();
// Add default BE javascript
$backendRelPath = ExtensionManagementUtility::extRelPath('backend');
$this->jsFiles = array('locallang' => $this->getLocalLangFileName(), 'md5' => $backendRelPath . 'Resources/Public/JavaScript/md5.js', 'modulemenu' => $backendRelPath . 'Resources/Public/JavaScript/modulemenu.js', 'evalfield' => $backendRelPath . 'Resources/Public/JavaScript/jsfunc.evalfield.js', 'notifications' => $backendRelPath . 'Resources/Public/JavaScript/notifications.js', 'backend' => $backendRelPath . 'Resources/Public/JavaScript/backend.js', 'viewport' => $backendRelPath . 'Resources/Public/JavaScript/extjs/viewport.js', 'iframepanel' => $backendRelPath . 'Resources/Public/JavaScript/iframepanel.js', 'backendcontentiframe' => $backendRelPath . 'Resources/Public/JavaScript/extjs/backendcontentiframe.js', 'viewportConfiguration' => $backendRelPath . 'Resources/Public/JavaScript/extjs/viewportConfiguration.js');
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LoginRefresh', 'function(LoginRefresh) {
LoginRefresh.setLoginFramesetUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('login_frameset')) . ');
LoginRefresh.setLogoutUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('logout')) . ');
}');
// load Utility class
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Utility');
// load Notification functionality
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Notification');
// load Modals
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Modal');
// load Legacy CSS Support
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LegacyCssClasses');
// load the storage API and fill the UC into the PersistentStorage, so no additional AJAX call is needed
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Storage', 'function(Storage) {
Storage.Persistent.load(' . json_encode($this->getBackendUser()->uc) . ');
}');
// load debug console
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DebugConsole');
// Load RSA encryption
$rsaEncryptionEncoder = GeneralUtility::makeInstance(RsaEncryptionEncoder::class);
$rsaEncryptionEncoder->enableRsaEncryption(true);
$this->pageRenderer->addInlineSetting('ShowItem', 'moduleUrl', BackendUtility::getModuleUrl('show_item'));
$this->css = '';
$this->initializeToolbarItems();
if (isset($GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'])) {
$this->menuWidth = (int) $GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'];
}
$this->executeHook('constructPostProcess');
$this->includeLegacyBackendItems();
}
示例6: listTasksAction
/**
* Assemble display of list of scheduled tasks
*
* @return string Table of pending tasks
*/
protected function listTasksAction()
{
$this->view->setTemplatePathAndFilename($this->backendTemplatePath . 'ListTasks.html');
// Define display format for dates
$dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
// Get list of registered classes
$registeredClasses = $this->getRegisteredClasses();
// Get list of registered task groups
$registeredTaskGroups = $this->getRegisteredTaskGroups();
// add an empty entry for non-grouped tasks
// add in front of list
array_unshift($registeredTaskGroups, array('uid' => 0, 'groupName' => ''));
// Get all registered tasks
// Just to get the number of entries
$query = array('SELECT' => '
tx_scheduler_task.*,
tx_scheduler_task_group.groupName as taskGroupName,
tx_scheduler_task_group.description as taskGroupDescription,
tx_scheduler_task_group.deleted as isTaskGroupDeleted
', 'FROM' => '
tx_scheduler_task
LEFT JOIN tx_scheduler_task_group ON tx_scheduler_task_group.uid = tx_scheduler_task.task_group
', 'WHERE' => '1=1', 'ORDERBY' => 'tx_scheduler_task_group.sorting');
$res = $this->getDatabaseConnection()->exec_SELECT_queryArray($query);
$numRows = $this->getDatabaseConnection()->sql_num_rows($res);
// No tasks defined, display information message
if ($numRows == 0) {
$this->view->setTemplatePathAndFilename($this->backendTemplatePath . 'ListTasksNoTasks.html');
return $this->view->render();
} else {
$this->pageRenderer->loadJquery();
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Scheduler/Scheduler');
$table = array();
// Header row
$table[] = '<thead><tr>' . '<th><a href="#" id="checkall" title="' . $this->getLanguageService()->getLL('label.checkAll', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-document-select') . '</a></th>' . '<th>' . $this->getLanguageService()->getLL('label.id', TRUE) . '</th>' . '<th>' . $this->getLanguageService()->getLL('task', TRUE) . '</th>' . '<th>' . $this->getLanguageService()->getLL('label.type', TRUE) . '</th>' . '<th>' . $this->getLanguageService()->getLL('label.frequency', TRUE) . '</th>' . '<th>' . $this->getLanguageService()->getLL('label.parallel', TRUE) . '</th>' . '<th>' . $this->getLanguageService()->getLL('label.lastExecution', TRUE) . '</th>' . '<th>' . $this->getLanguageService()->getLL('label.nextExecution', TRUE) . '</th>' . '<th></th>' . '</tr></thead>';
// Loop on all tasks
$temporaryResult = array();
while ($row = $this->getDatabaseConnection()->sql_fetch_assoc($res)) {
if ($row['taskGroupName'] === NULL || $row['isTaskGroupDeleted'] === '1') {
$row['taskGroupName'] = '';
$row['taskGroupDescription'] = '';
$row['task_group'] = 0;
}
$temporaryResult[$row['task_group']]['groupName'] = $row['taskGroupName'];
$temporaryResult[$row['task_group']]['groupDescription'] = $row['taskGroupDescription'];
$temporaryResult[$row['task_group']]['tasks'][] = $row;
}
foreach ($temporaryResult as $taskGroup) {
if (!empty($taskGroup['groupName'])) {
$groupText = '<strong>' . htmlspecialchars($taskGroup['groupName']) . '</strong>';
if (!empty($taskGroup['groupDescription'])) {
$groupText .= '<br>' . nl2br(htmlspecialchars($taskGroup['groupDescription']));
}
$table[] = '<tr><td colspan="9">' . $groupText . '</td></tr>';
}
foreach ($taskGroup['tasks'] as $schedulerRecord) {
// Define action icons
$editAction = '<a class="btn btn-default" href="' . htmlspecialchars($this->moduleUri . '&CMD=edit&tx_scheduler[uid]=' . $schedulerRecord['uid']) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:edit', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-document-open') . '</a>';
if ((int) $schedulerRecord['disable'] === 1) {
$translationKey = 'enable';
$spriteIcon = 'actions-edit-unhide';
} else {
$translationKey = 'disable';
$spriteIcon = 'actions-edit-hide';
}
$toggleHiddenAction = '<a class="btn btn-default" href="' . htmlspecialchars($this->moduleUri . '&CMD=toggleHidden&tx_scheduler[uid]=' . $schedulerRecord['uid']) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:' . $translationKey, TRUE) . '" class="icon">' . IconUtility::getSpriteIcon($spriteIcon) . '</a>';
$deleteAction = '<a class="btn btn-default" href="' . htmlspecialchars($this->moduleUri . '&CMD=delete&tx_scheduler[uid]=' . $schedulerRecord['uid']) . '" onclick="return confirm(' . GeneralUtility::quoteJSvalue($this->getLanguageService()->getLL('msg.delete')) . ');" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:delete', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-edit-delete') . '</a>';
$stopAction = '<a class="btn btn-default" href="' . htmlspecialchars($this->moduleUri . '&CMD=stop&tx_scheduler[uid]=' . $schedulerRecord['uid']) . '" onclick="return confirm(' . GeneralUtility::quoteJSvalue($this->getLanguageService()->getLL('msg.stop')) . ');" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:stop', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-document-close') . '</a>';
$runAction = '<a class="btn btn-default" href="' . htmlspecialchars($this->moduleUri . '&tx_scheduler[execute][]=' . $schedulerRecord['uid']) . '" title="' . $this->getLanguageService()->getLL('action.run_task', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('extensions-scheduler-run-task') . '</a>';
// Define some default values
$lastExecution = '-';
$isRunning = FALSE;
$showAsDisabled = FALSE;
$startExecutionElement = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
// Restore the serialized task and pass it a reference to the scheduler object
/** @var $task \TYPO3\CMS\Scheduler\Task\AbstractTask|\TYPO3\CMS\Scheduler\ProgressProviderInterface */
$task = unserialize($schedulerRecord['serialized_task_object']);
$class = get_class($task);
if ($class === '__PHP_Incomplete_Class' && preg_match('/^O:[0-9]+:"(?P<classname>.+?)"/', $schedulerRecord['serialized_task_object'], $matches) === 1) {
$class = $matches['classname'];
}
// Assemble information about last execution
if (!empty($schedulerRecord['lastexecution_time'])) {
$lastExecution = date($dateFormat, $schedulerRecord['lastexecution_time']);
if ($schedulerRecord['lastexecution_context'] == 'CLI') {
$context = $this->getLanguageService()->getLL('label.cron');
} else {
$context = $this->getLanguageService()->getLL('label.manual');
}
$lastExecution .= ' (' . $context . ')';
}
if ($this->scheduler->isValidTaskObject($task)) {
// The task object is valid
$labels = array();
$name = htmlspecialchars($registeredClasses[$class]['title'] . ' (' . $registeredClasses[$class]['extension'] . ')');
//.........这里部分代码省略.........
示例7: getContextMenuCode
/**
* Includes the necessary Javascript function for the clickmenu (context sensitive menus) in the document
*
* @return void
*/
public function getContextMenuCode()
{
$this->pageRenderer->loadJquery();
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu');
}
示例8: isJqueryLoadedMinifiedFromSourceByDefault
/**
* Tests whether jQuery is correctly loaded, from the respective CDNs
*
* @dataProvider loadJqueryMinifiedFromSourceDataProvider
* @test
*/
public function isJqueryLoadedMinifiedFromSourceByDefault($version, $cdn, $regex)
{
$this->fixture->loadJquery($version, $cdn);
$out = $this->fixture->render();
$this->assertRegExp($regex, $out);
}
示例9: listTasks
/**
* Assemble display of list of scheduled tasks
*
* @return string Table of pending tasks
*/
protected function listTasks()
{
// Define display format for dates
$dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
$content = '';
// Get list of registered classes
$registeredClasses = self::getRegisteredClasses();
// Get list of registered task groups
$registeredTaskGroups = self::getRegisteredTaskGroups();
// add an empty entry for non-grouped tasks
// add in front of list
array_unshift($registeredTaskGroups, array('uid' => 0, 'groupName' => ''));
// Get all registered tasks
// Just to get the number of entries
$query = array('SELECT' => '*', 'FROM' => 'tx_scheduler_task', 'WHERE' => '1=1', 'ORDERBY' => '');
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($query);
$numRows = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
$GLOBALS['TYPO3_DB']->sql_free_result($res);
// No tasks defined, display information message
if ($numRows == 0) {
/** @var $flashMessage FlashMessage */
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('msg.noTasks'), '', FlashMessage::INFO);
$content .= $flashMessage->render();
} else {
$this->pageRenderer->loadJquery();
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Scheduler/Scheduler');
// Initialise table layout
$tableLayout = array('table' => array('<table class="t3-table">', '</table>'), '0' => array('tr' => array('<thead><tr>', '</tr></thead>'), 'defCol' => array('<td>', '</td>'), '1' => array('<td style="width: 56px;">', '</td>'), '3' => array('<td colspan="2">', '</td>')), 'defRow' => array('tr' => array('<tr class="db_list_normal">', '</tr>'), 'defCol' => array('<td>', '</td>'), '1' => array('<td class="right">', '</td>'), '2' => array('<td class="right">', '</td>')));
$disabledTaskRow = array('tr' => array('<tr class="db_list_normal disabled">', '</tr>'), 'defCol' => array('<td>', '</td>'), '1' => array('<td class="right">', '</td>'), '2' => array('<td class="right">', '</td>'));
$rowWithSpan = array('tr' => array('<tr class="db_list_normal">', '</tr>'), 'defCol' => array('<td>', '</td>'), '1' => array('<td class="right">', '</td>'), '2' => array('<td class="right">', '</td>'), '3' => array('<td colspan="6">', '</td>'));
$taskGroupRow = array('tr' => array('<tr class="db_list_normal">', '</tr>'), 'defCol' => array('<td>', '</td>'), '0' => array('<td colspan="10">', '</td>'));
$table = array();
$tr = 0;
// Header row
$table[$tr][] = '<a href="#" id="checkall" title="' . $GLOBALS['LANG']->getLL('label.checkAll', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-document-select') . '</a>';
$table[$tr][] = ' ';
$table[$tr][] = $GLOBALS['LANG']->getLL('label.id');
$table[$tr][] = $GLOBALS['LANG']->getLL('task');
$table[$tr][] = $GLOBALS['LANG']->getLL('label.type');
$table[$tr][] = $GLOBALS['LANG']->getLL('label.frequency');
$table[$tr][] = $GLOBALS['LANG']->getLL('label.parallel');
$table[$tr][] = $GLOBALS['LANG']->getLL('label.lastExecution');
$table[$tr][] = $GLOBALS['LANG']->getLL('label.nextExecution');
$tr++;
foreach ($registeredTaskGroups as $taskGroup) {
$query = array('SELECT' => '*', 'FROM' => 'tx_scheduler_task', 'WHERE' => 'task_group=' . $taskGroup['uid'], 'ORDERBY' => 'nextexecution');
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($query);
$numRows = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
if ($numRows === 0) {
continue;
}
if ($taskGroup['groupName'] !== '') {
$tableLayout[$tr] = $taskGroupRow;
$groupText = '<strong>' . htmlspecialchars($taskGroup['groupName']) . '</strong>';
if (!empty($taskGroup['description'])) {
$groupText .= '<br />' . nl2br(htmlspecialchars($taskGroup['description']));
}
$table[$tr][] = $groupText;
$tr++;
}
// Loop on all tasks
while ($schedulerRecord = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
// Define action icons
$editAction = '<a href="' . $GLOBALS['MCONF']['_'] . '&CMD=edit&tx_scheduler[uid]=' . $schedulerRecord['uid'] . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:edit', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-document-open') . '</a>';
$deleteAction = '<a href="' . $GLOBALS['MCONF']['_'] . '&CMD=delete&tx_scheduler[uid]=' . $schedulerRecord['uid'] . '" onclick="return confirm(\'' . $GLOBALS['LANG']->getLL('msg.delete') . '\');" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:delete', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-edit-delete') . '</a>';
$stopAction = '<a href="' . $GLOBALS['MCONF']['_'] . '&CMD=stop&tx_scheduler[uid]=' . $schedulerRecord['uid'] . '" onclick="return confirm(\'' . $GLOBALS['LANG']->getLL('msg.stop') . '\');" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:stop', TRUE) . '" class="icon">' . '<img ' . IconUtility::skinImg($this->backPath, ExtensionManagementUtility::extRelPath('scheduler') . '/Resources/Public/Images/stop.png') . ' alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:stop') . '" /></a>';
$runAction = '<a href="' . $GLOBALS['MCONF']['_'] . '&tx_scheduler[execute][]=' . $schedulerRecord['uid'] . '" title="' . $GLOBALS['LANG']->getLL('action.run_task') . '" class="icon">' . IconUtility::getSpriteIcon('extensions-scheduler-run-task') . '</a>';
// Define some default values
$lastExecution = '-';
$isRunning = FALSE;
$executionStatus = 'scheduled';
$executionStatusOutput = '';
$name = '';
$nextDate = '-';
$execType = '-';
$frequency = '-';
$multiple = '-';
$startExecutionElement = ' ';
// Restore the serialized task and pass it a reference to the scheduler object
/** @var $task \TYPO3\CMS\Scheduler\Task\AbstractTask|\TYPO3\CMS\Scheduler\ProgressProviderInterface */
$task = unserialize($schedulerRecord['serialized_task_object']);
$class = get_class($task);
if ($class === '__PHP_Incomplete_Class' && preg_match('/^O:[0-9]+:"(?P<classname>.+?)"/', $schedulerRecord['serialized_task_object'], $matches) === 1) {
$class = $matches['classname'];
}
// Assemble information about last execution
$context = '';
if (!empty($schedulerRecord['lastexecution_time'])) {
$lastExecution = date($dateFormat, $schedulerRecord['lastexecution_time']);
if ($schedulerRecord['lastexecution_context'] == 'CLI') {
$context = $GLOBALS['LANG']->getLL('label.cron');
} else {
$context = $GLOBALS['LANG']->getLL('label.manual');
}
$lastExecution .= ' (' . $context . ')';
//.........这里部分代码省略.........
示例10: __construct
/**
* Construct
*/
public function __construct()
{
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$this->fileRepository = GeneralUtility::makeInstance(FileRepository::class);
$this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$this->pageRenderer->loadJquery();
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Recordlist/FieldSelectBox');
}