Commit 8b8bd2ec authored by Georg Ringer's avatar Georg Ringer Committed by Benni Mack
Browse files

[TASK] Simplify rendering in EXT:scheduler

Don't use the DocumentTemplate class to render a simple table.

Changes are:
 * Simplify the rendering of the available classes
 * Change existing form to a proper markup using forms instead of tables.

Resolves: #62330
Releases: master
Change-Id: Id7d37e323dea1ce4e0dad7ef61efafaa04ac960f
Reviewed-on: http://review.typo3.org/33394


Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack's avatarBenjamin Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenjamin Mack <benni@typo3.org>
parent c5af4994
<?php
namespace TYPO3\CMS\Scheduler\ViewHelpers;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Create internal link within backend app
* @TODO: Later I want to be an AbstractTagBasedViewHelper
*/
class ModuleLinkViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
/**
* Generate module link
*
* @param string $function
* @param string $cms
* @param array $arguments
* @return string
*/
public function render($function = '', $cmd = '', array $arguments = array()) {
$link = $GLOBALS['MCONF']['_'] . '&SET[function]=' . $function . '&CMD=' . $cmd;
if (!empty($arguments)) {
foreach ($arguments as $key => $value) {
$link .= '&tx_scheduler[' . $key . ']=' . $value;
}
}
return htmlspecialchars($link);
}
}
\ No newline at end of file
<?php
namespace TYPO3\CMS\Scheduler\ViewHelpers;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Displays sprite icon identified by iconName key
*/
class SpriteIconViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper {
/**
* Prints sprite icon html for $iconName key
*
* @param string $iconName
* @return string
*/
public function render($iconName) {
return \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon($iconName);
}
}
\ No newline at end of file
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/* - - - - - - - - - - - - - - - - - - - - -
Scheduler
- - - - - - - - - - - - - - - - - - - - - */
.tx_scheduler_mod1 {
a {
text-decoration: underline;
}
a.icon,
a.typo3-csh-link {
text-decoration: none;
}
#typo3-docheader {
a {
text-decoration: none;
}
}
#typo3-inner-docbody {
padding-right: 10px;
}
.late {
color: #f00;
font-weight: bold;
}
.status-legend {
padding-top: 10px;
padding-bottom: 5px;
font-weight: bold;
}
.progress {
overflow: hidden;
height: 14px;
background-color: #DADADA;
border-radius: 2px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
margin: 3px 0px;
.bar {
width: 0%;
height: 14px;
background-color: #5b5b5b;
background-image: linear-gradient(top, #7f7f7f 10%,#5b5b5b 100%);
background-repeat: repeat-x;
text-align: left;
color: #fff;
font-size: 8px;
vertical-align: top;
padding-left: 3px;
padding-top: -1px;
}
}
}
/* Definition for BE function "Setup check" */
.info-block {
margin: 25px 0px 0px 0px;
p {
margin: 8px 5px 8px 5px;
}
}
\ No newline at end of file
<p class="lead">
<f:translate key="msg.schedulerSetupCheck" />
</p>
<div class="info-block">
<h2><f:translate key="hdg.lastRun" /></h2>
<f:format.raw>{lastRun}</f:format.raw>
</div>
<div class="info-block">
<h2><f:translate key="hdg.schedulerUser" /></h2>
<p><f:translate key="msg.schedulerUser" /></p>
<f:format.raw>{cliUser}</f:format.raw>
</div>
<div class="info-block">
<h2><f:translate key="hdg.cliScript" /></h2>
<p><f:translate key="msg.cliScript" arguments="{0: script}" /></p>
<f:format.raw>{isExecutable}</f:format.raw>
</div>
\ No newline at end of file
<input type="hidden" name="tx_scheduler[uid]" value="{uid}" />
<input type="hidden" name="previousCMD" value="{cmd}" />
<f:format.raw>{table}</f:format.raw>
<h3><f:translate key="label.serverTime" /></h3>
<p><f:translate key="msg.serverTimeHelp" /></p>
<p><f:translate key="msg.serverTime" arguments="{0: now}" /></p>
\ No newline at end of file
{namespace s = TYPO3\CMS\Scheduler\ViewHelpers}
<p class="lead">
<f:translate key="msg.infoScreenIntro" />
</p>
<table class="t3-table">
<thead>
<tr>
<th>
<f:translate key="label.name" />
</th>
<th>
<f:translate key="label.extension" />
</th>
<th colspan="2">
<f:translate key="label.description" />
</th>
</tr>
</thead>
<tbody>
<f:for each="{registeredClasses}" key="class" as="classInfo">
<tr>
<td>{classInfo.title}</td>
<td>{classInfo.extension}</td>
<td>{classInfo.description}</td>
<td>
<a
href="{s:moduleLink(function:'list',cmd:'add',arguments:'{class: class}')}"
title="{f:translate(key:'LLL:EXT:lang/locallang_common.xlf:new')}"
class="icon">
<s:spriteIcon iconName="actions-document-new" />
</a>
</td>
</tr>
</f:for>
</tbody>
</table>
\ No newline at end of file
<f:translate key="msg.noTasksDefined" />
\ No newline at end of file
{namespace s = TYPO3\CMS\Scheduler\ViewHelpers}
<f:format.raw>{table}</f:format.raw>
<button name="go" id="scheduler_executeselected">
<s:spriteIcon iconName="extensions-scheduler-run-task" />
<f:translate key="label.executeSelected" />
</button>
<h3><f:translate key="status.legend" /></h3>
<ul class="list-unstyled">
<li>
<f:image src="EXT:scheduler/Resources/Public/Images/status_failure.png" alt="{f:translate(extensionName:'scheduler',key:'status.failure')}" />
<f:translate key="status.legend.failure" />
</li>
<li>
<f:image src="EXT:scheduler/Resources/Public/Images/status_late.png" alt="{f:translate(extensionName:'scheduler',key:'status.legend.late')}" />
<f:translate key="status.legend.late" />
</li>
<li>
<f:image src="EXT:scheduler/Resources/Public/Images/status_running.png" alt="{f:translate(extensionName:'scheduler',key:'status.running')}" />
<f:translate key="status.legend.running" />
</li>
<li>
<f:image src="EXT:scheduler/Resources/Public/Images/status_scheduled.png" alt="{f:translate(extensionName:'scheduler',key:'status.scheduled')}" />
<f:translate key="status.legend.scheduled" />
</li>
<li>
<f:image src="EXT:scheduler/Resources/Public/Images/status_disabled.png" alt="{f:translate(extensionName:'scheduler',key:'status.disabled')}" />
<f:translate key="status.legend.disabled" />
</li>
</ul>
<h3><f:translate key="label.serverTime" /></h3>
<p><f:translate key="msg.serverTimeHelp" /></p>
<p><f:translate key="msg.serverTime" arguments="{0: now}" /></p>
\ No newline at end of file
<f:format.raw>{message}</f:format.raw>
\ No newline at end of file
......@@ -51,7 +51,7 @@ define('TYPO3/CMS/Scheduler/Scheduler', ['jquery'], function($) {
var $numberOfDays = $('#task_tableGarbageCollection_numberOfDays');
if (theCheckbox.prop('checked')) {
$('#task_tableGarbageCollection_table').prop('disabled', true);
$numberOfDays.prop('disabled', true);
$numberOfDays.prop('disabled', true);
} else {
// Get number of days for selected table
var numberOfDays = parseInt($numberOfDays.val());
......@@ -135,11 +135,11 @@ define('TYPO3/CMS/Scheduler/Scheduler', ['jquery'], function($) {
Scheduler.executeSelected();
});
$('.tx_scheduler_mod1 tr.db_list_normal').on('click', function(event) {
$('.tx_scheduler_mod1 tbody tr').on('click', function(event) {
Scheduler.handleTableRowClick($(this), event);
});
$('.t3-icon-scheduler-run-task').on('click', function() {
$('.fa-play-circle').on('click', function() {
Scheduler.runSingleTask($(this));
});
......
/* Scheduler BE-Styles */
.tx_scheduler_mod1 a {
text-decoration: underline;
}
.tx_scheduler_mod1 #typo3-inner-docbody {
padding-right: 10px;
}
.tx_scheduler_mod1 a.icon,
.tx_scheduler_mod1 a.typo3-csh-link,
.tx_scheduler_mod1 #typo3-docheader a {
text-decoration: none;
}
.tx_scheduler_mod1 td.right {
text-align: right;
}
.tx_scheduler_mod1 tr.disabled td {
color: #666;
}
.tx_scheduler_mod1 .late {
color: #f00;
font-weight: bold;
}
.tx_scheduler_mod1 label {
width: 200px;
}
.tx_scheduler_mod1 table.typo3-usersettings td {
padding-top: 2px;
padding-bottom: 2px;
}
.tx_scheduler_mod1 table.typo3-usersettings td.td-input {
width: 400px;
}
.tx_scheduler_mod1 select {
margin-bottom: 1.2em;
width: 200px;
}
.tx_scheduler_mod1 input.wide,
.tx_scheduler_mod1 select.wide {
width: 350px;
}
.tx_scheduler_mod1 input.checkboxes {
width: auto;
}
.tx_scheduler_mod1 .status-legend {
padding-top: 10px;
padding-bottom: 5px;
font-weight: bold;
}
.tx_scheduler_mod1 .progress {
overflow: hidden;
height: 14px;
background-color: #DADADA;
border-radius: 2px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
margin: 3px 0px;
}
.tx_scheduler_mod1 .progress .bar {
width: 0%;
height: 14px;
background-color: #5b5b5b;
background-image: linear-gradient(top, #7f7f7f 10%,#5b5b5b 100%);
background-repeat: repeat-x;
text-align: left;
color: #fff;
font-size: 8px;
vertical-align: top;
padding-left: 3px;
padding-top: -1px;
}
/* Definition for BE function "Setup check" */
.info-block {
margin: 25px 0px 0px 0px;
}
.info-block p {
margin: 8px 5px 8px 5px;
}
#edit_form tr td {
padding-bottom: 0.5em;
}
#edit_form tr td.td-label {
padding-right: 1em;
}
\ No newline at end of file
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/* - - - - - - - - - - - - - - - - - - - - -
Scheduler
- - - - - - - - - - - - - - - - - - - - - */
.tx_scheduler_mod1 a {
text-decoration: underline;
}
.tx_scheduler_mod1 a.icon,
.tx_scheduler_mod1 a.typo3-csh-link {
text-decoration: none;
}
.tx_scheduler_mod1 #typo3-docheader a {
text-decoration: none;
}
.tx_scheduler_mod1 #typo3-inner-docbody {
padding-right: 10px;
}
.tx_scheduler_mod1 .late {
color: #f00;
font-weight: bold;
}
.tx_scheduler_mod1 .status-legend {
padding-top: 10px;
padding-bottom: 5px;
font-weight: bold;
}
.tx_scheduler_mod1 .progress {
overflow: hidden;
height: 14px;
background-color: #DADADA;
border-radius: 2px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
margin: 3px 0px;
}
.tx_scheduler_mod1 .progress .bar {
width: 0%;
height: 14px;
background-color: #5b5b5b;
background-image: linear-gradient(top, #7f7f7f 10%, #5b5b5b 100%);
background-repeat: repeat-x;
text-align: left;
color: #fff;
font-size: 8px;
vertical-align: top;
padding-left: 3px;
padding-top: -1px;
}
/* Definition for BE function "Setup check" */
.info-block {
margin: 25px 0px 0px 0px;
}
.info-block p {
margin: 8px 5px 8px 5px;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment