mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
replace plain html with formField(), add help to task params
This commit is contained in:
parent
ceeedcdd92
commit
397081bdeb
|
@ -117,32 +117,51 @@ $(document).ready( function() {
|
|||
<span class="input uneditable-input"><?= $extname ?>::<?= $taskname ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="name"><?php printMLText("task_name");?>:</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="name" name="name" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="description"><?php printMLText("task_description");?>:</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="description" name="description" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="frequency"><?php printMLText("task_frequency");?>:</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="frequency" name="frequency" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="disabled" value="1" checked> <?= getMLText('task_disabled'); ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$this->formField(
|
||||
getMLText('task_name'),
|
||||
array(
|
||||
'element'=>'input',
|
||||
'type'=>'text',
|
||||
'id'=>'name',
|
||||
'name'=>'name',
|
||||
'value'=>'',
|
||||
'required'=>true,
|
||||
)
|
||||
);
|
||||
$this->formField(
|
||||
getMLText('task_description'),
|
||||
array(
|
||||
'element'=>'input',
|
||||
'type'=>'text',
|
||||
'id'=>'description',
|
||||
'name'=>'description',
|
||||
'value'=>'',
|
||||
'required'=>false,
|
||||
)
|
||||
);
|
||||
$this->formField(
|
||||
getMLText('task_frequency'),
|
||||
array(
|
||||
'element'=>'input',
|
||||
'type'=>'text',
|
||||
'id'=>'frequency',
|
||||
'name'=>'frequency',
|
||||
'value'=>'',
|
||||
'required'=>true,
|
||||
)
|
||||
);
|
||||
$this->formField(
|
||||
getMLText('task_disabled'),
|
||||
array(
|
||||
'element'=>'input',
|
||||
'type'=>'checkbox',
|
||||
'id'=>'disabled',
|
||||
'name'=>'disabled',
|
||||
'value'=>'1',
|
||||
'checked'=>true,
|
||||
)
|
||||
);
|
||||
if($additionalparams) {
|
||||
foreach($additionalparams as $param) {
|
||||
switch($param['type']) {
|
||||
|
@ -156,7 +175,10 @@ $(document).ready( function() {
|
|||
'name'=>'params['.$param['name'].']',
|
||||
'value'=>'1',
|
||||
'checked'=>false,
|
||||
)
|
||||
),
|
||||
array(
|
||||
'help'=>$param['description']
|
||||
),
|
||||
);
|
||||
break;
|
||||
case 'password':
|
||||
|
@ -168,6 +190,9 @@ $(document).ready( function() {
|
|||
'id'=>'params_'.$param['name'],
|
||||
'name'=>'params['.$param['name'].']',
|
||||
'required'=>false
|
||||
),
|
||||
array(
|
||||
'help'=>$param['description']
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
@ -181,6 +206,9 @@ $(document).ready( function() {
|
|||
'multiple'=>false,
|
||||
'attributes'=>array(array('data-placeholder', getMLText('select_value'), array('data-no_results_text', getMLText('unknown_value')))),
|
||||
'options'=>$param['options'],
|
||||
),
|
||||
array(
|
||||
'help'=>$param['description']
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
@ -193,6 +221,9 @@ $(document).ready( function() {
|
|||
'id'=>'params_'.$param['name'],
|
||||
'name'=>'params['.$param['name'].']',
|
||||
'required'=>false
|
||||
),
|
||||
array(
|
||||
'help'=>$param['description']
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
@ -300,6 +331,9 @@ $(document).ready( function() {
|
|||
'name'=>'params['.$param['name'].']',
|
||||
'value'=>'1',
|
||||
'checked'=>$task->getParameter($param['name']) == 1,
|
||||
),
|
||||
array(
|
||||
'help'=>$param['description']
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
@ -313,6 +347,25 @@ $(document).ready( function() {
|
|||
'name'=>'params['.$param['name'].']',
|
||||
'value'=>$task->getParameter()[$param['name']],
|
||||
'required'=>false
|
||||
),
|
||||
array(
|
||||
'help'=>$param['description']
|
||||
)
|
||||
);
|
||||
break;
|
||||
case 'select':
|
||||
$this->formField(
|
||||
getMLText('task_'.$extname."_".$taskname."_".$param['name']),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'class'=>'chzn-select',
|
||||
'name'=>'params['.$param['name'].']',
|
||||
'multiple'=>false,
|
||||
'attributes'=>array(array('data-placeholder', getMLText('select_value'), array('data-no_results_text', getMLText('unknown_value')))),
|
||||
'options'=>$task->getParameter()[$param['options']],
|
||||
),
|
||||
array(
|
||||
'help'=>$param['description']
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
@ -326,6 +379,9 @@ $(document).ready( function() {
|
|||
'name'=>'params['.$param['name'].']',
|
||||
'value'=>$task->getParameter()[$param['name']],
|
||||
'required'=>false
|
||||
),
|
||||
array(
|
||||
'help'=>$param['description']
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue
Block a user