Example #1
0
 /**
  * public static function getLineListbox( $css_line, $css_label, $label_name, $css_listbox, $id, $name, $all_value, $selected, $multiple, $other_param, $other_after, $other_before )
  *
  * @param string $css_line 		css for the line
  * @param string $css_label 	css for the label
  * @param string $label_name 	text contained into the label
  * @param string $css_listbox 	the css class for the select element
  * @param string $id 			the id of the element
  * @param string $name 			the name of the element
  * @param string $all_value 	all the possible value of the select element
  * @param array  $selected 		the elements selected
  * @param bool   $multiple		is a multi select listbox
  * @param string $other_param 	other element for the tag
  * @param string $other_after 	html code added after the select element
  * @param string $other_before 	html code added before the label element
  *
  * @return string with the html code for a line with the select element
  */
 public static function getLineListbox($css_line, $css_label, $label_name, $css_listbox, $id, $name, $all_value, $selected, $multiple, $other_param, $other_after, $other_before)
 {
     return '<div class="' . $css_line . '">' . $other_before . '<p><label class="' . $css_label . '" for="' . $id . '">' . $label_name . '</label></p>' . Form::getInputListbox($css_listbox, $id, $name, $all_value, $selected, $multiple, $other_param) . $other_after . '</div>';
 }
Example #2
0
/**
 * The UI for create a new task
 * @param Module $module the caller module
 **/
function ioTask_UITaskNew_step2(&$module, &$params)
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.form.php';
    $connMgr =& $module->get_connMgr();
    $lang =& $module->get_lang();
    $out =& $module->get_out();
    $form = new Form();
    $out->add($form->getLineBox($lang->def('_NAME'), $params[CONNMGR_TASK_NAME]));
    $out->add($form->getRadioSet($lang->def('_IMPORT_TYPE'), 'task_import_type', 'task_params[' . CONNMGR_TASK_IMPORT_TYPE . ']', array($lang->def('_IMPORT_TYPE_INSERTONLY') => TASK_IMPORT_TYPE_INSERTONLY, $lang->def('_IMPORT_TYPE_INSERTREMOVE') => TASK_IMPORT_TYPE_INSERTREMOVE), $params[CONNMGR_TASK_IMPORT_TYPE]));
    $out->add($form->getRadioSet($lang->def('_SCHEDULE'), 'task_schedule_type', 'task_params[' . CONNMGR_TASK_SCHEDTYPE . ']', array($lang->def('_SCHEDULE_TYPE_AT') => 'at', $lang->def('_SCHEDULE_TYPE_INTERVAL') => 'interval'), $params[CONNMGR_TASK_SCHEDTYPE]));
    $tmp_um = $form->getInputListbox('', 'task_schedule_um', 'task_params[' . CONNMGR_TASK_SCHEDULE . '][um]', array('hour' => $lang->def('_HOUR'), 'day' => $lang->def('_DAY')), array($params[CONNMGR_TASK_SCHEDULE]['um']), FALSE, '');
    $out->add($form->getTextfield($lang->def('_SCHEDULE'), 'task_schedule_qt', 'task_params[' . CONNMGR_TASK_SCHEDULE . '][qt]', 10, $params[CONNMGR_TASK_SCHEDULE]['qt'], '', $tmp_um, ''));
    $out->add("\n<script type='text/javascript'>\n" . "var field_um = document.getElementById('task_schedule_um');\n" . "var field = document.getElementById('task_schedule_type_0');\n" . "field.onclick = function() {\n" . "\tfield_um.style.display = 'none';\n" . "}\n" . "field = document.getElementById('task_schedule_type_1');\n" . "field.onclick = function() {\n" . "\tfield_um.style.display = 'inline';\n" . "}\n" . "</script>\n");
}