function draw(&$form) { parent::draw($form); global $_CAMILA; $tDate = ''; $tFormat = ''; $fmt = ''; $fmt2 = ''; $f = array(); $m = camila_get_translation('camila.dateformat.monthpos'); $d = camila_get_translation('camila.dateformat.daypos'); $y = camila_get_translation('camila.dateformat.yearpos'); $f[$m] = 'm'; $f[$d] = 'd'; $f[$y] = 'Y'; ksort($f); reset($f); $count = 0; while (list($k, $v) = each($f)) { $fmt .= $v; $fmt2 .= '%' . $v; $tFormat .= camila_get_translation('camila.dateformat.placeholder.' . $v); if ($count < 2) { $fmt .= camila_get_translation('camila.dateformat.separator'); $fmt2 .= camila_get_translation('camila.dateformat.separator'); $tFormat .= camila_get_translation('camila.date.separator'); } $count++; } if ($this->value != '' && $this->value != '0000-00-00') { $tDate = $_CAMILA['db']->UserDate($this->value, $fmt); } else { $this->value = ''; } if ($this->updatable) { $myInput = new CHAW_input($this->key, $tDate, $this->title . ' (' . $tFormat . ')' . $this->labelseparator); if ($this->maxlength > 0) { $myInput->set_maxlength($this->maxlength); } if ($this->size > 0) { $myInput->set_size($this->size); } $myInput->set_br(1); $form->add_input($myInput); global $_CAMILA; $code = '<link rel="stylesheet" type="text/css" media="all" href="' . CAMILA_LIB_DIR . 'jscalendar/' . $this->calendar_theme_file . '" />'; $code .= '<script src=\'' . CAMILA_LIB_DIR . 'jscalendar/calendar.js\'></script>'; $code .= '<script src=\'' . CAMILA_LIB_DIR . 'jscalendar/' . $this->calendar_lang_file . '\'></script>'; $code .= '<script src=\'' . CAMILA_LIB_DIR . 'jscalendar/' . $this->calendar_setup_file . '\'></script>'; $_CAMILA['page']->camila_add_js($code, 'jscalendar'); $code = '<script>xParent(\'' . $this->key . '\',true).removeChild(xNextSib(\'' . $this->key . '\',\'br\'))</script>'; $js = new CHAW_js($code); $form->add_userdefined($js); $popup = new CHAW_js("<a href=\"#\" id=\"f-calendar-trigger-" . $this->key . "\"><img src=\"" . CAMILA_LIB_DIR . "jscalendar/img.gif\" alt=\"\" align=\"middle\" border=\"0\"></a><script type=\"text/javascript\">Calendar.setup({\"ifFormat\":\"" . $fmt2 . "\",\"daFormat\":\"" . $fmt2 . "\",\"firstDay\":1,\"showsTime\":false,\"showOthers\":false,\"timeFormat\":12,\"inputField\":\"" . $this->key . "\",\"button\":\"f-calendar-trigger-" . $this->key . "\"});</script>"); $form->add_userdefined($popup); } else { $myText = new CHAW_text($this->title . $this->labelseparator . ' ' . $tDate); $form->add_text($myText); } }
function draw(&$form) { parent::draw($form); $value = str_replace('.', camila_get_translation('camila.decimal.separator'), $this->value); if ($this->updatable) { $myInput = new CHAW_input($this->key, $value, $this->title . $this->labelseparator); if ($this->precision + $this->scale > 0) { $myInput->set_maxlength($this->precision + $this->scale + 1); } $form->add_input($myInput); } else { $myText = new CHAW_text($this->title . $this->labelseparator . ' ' . $value); $form->add_text($myText); } }
function draw(&$form) { parent::draw($form); if ($this->updatable) { $myInput = new CHAW_input($this->key, $this->value, $this->title . $this->labelseparator); if ($this->maxlength > 0) { $myInput->set_maxlength($this->maxlength); } if ($this->size > 0) { $myInput->set_size($this->size); } $form->add_input($myInput); } else { $myHidden = new CHAW_hidden($this->key, $this->value); $form->add_hidden($myHidden); $myText = new CHAW_text($this->title . $this->labelseparator . ' ' . $this->value); $form->add_text($myText); } }
function draw(&$form) { parent::base_draw($form); if ($this->updatable) { $myInput = new CHAW_input($this->key, $this->value, $this->title . $this->labelseparator); if ($this->maxlength > 0) { $myInput->set_maxlength($this->maxlength); } if ($this->size > 0) { $myInput->set_size($this->size); } $myInput->set_type(HAW_INPUT_PASSWORD); $form->add_input($myInput); } else { //$myHidden = new CHAW_hidden($this->key, $this->value); //$form->add_input($myHidden); $myText = new CHAW_text($this->title . $this->labelseparator . ' **********'); $form->add_text($myText); } }
function draw(&$form) { parent::draw($form); if ($this->updatable) { $myOldInput = new CHAW_input($this->key . '_old', '', camila_get_translation('camila.form.oldpassword') . $this->labelseparator); if ($this->maxlength > 0) { $myOldInput->set_maxlength($this->maxlength); } if ($this->size > 0) { $myOldInput->set_size($this->size); } $myOldInput->set_type(HAW_INPUT_PASSWORD); $form->add_input($myOldInput); $myInput = new CHAW_input($this->key, '', $this->title . $this->labelseparator); if ($this->maxlength > 0) { $myInput->set_maxlength($this->maxlength); } if ($this->size > 0) { $myInput->set_size($this->size); } $myInput->set_type(HAW_INPUT_PASSWORD); $form->add_input($myInput); $myConfirmInput = new CHAW_input($this->key . '_confirm', '', camila_get_translation('camila.form.confirmpassword') . $this->labelseparator); if ($this->maxlength > 0) { $myConfirmInput->set_maxlength($this->maxlength); } if ($this->size > 0) { $myConfirmInput->set_size($this->size); } $myConfirmInput->set_type(HAW_INPUT_PASSWORD); $form->add_input($myConfirmInput); } else { $myText = new CHAW_text($this->title . $this->labelseparator . ' *******'); $form->add_text($myText); } }
if (isset($_REQUEST['name'])) { $nome = new CHAW_input('name', $_REQUEST['name'], camila_get_translation('camila.login.name') . ': '); } else { $nome = new CHAW_input('name', '', camila_get_translation('camila.login.name') . ': '); } $nome->set_size(20); $nome->set_maxlength(20); $myForm->add_input($nome); $myParClose = new HAW_raw(HAW_HTML, '</p>'); $myForm->add_raw($myParClose); } $myParOpen = new HAW_raw(HAW_HTML, '<p>'); $myForm->add_raw($myParOpen); $thePW1 = new CHAW_input('pwd', '', camila_get_translation('camila.login.password') . ': '); $thePW1->set_size(20); $thePW1->set_maxlength(CAMILA_PASSWORD_LENGTH); $thePW1->set_type(HAW_INPUT_PASSWORD); $myForm->add_input($thePW1); $myParClose = new HAW_raw(HAW_HTML, '</p>'); $myForm->add_raw($myParClose); if (CAMILA_USERNAME_LOGIN) { $myParOpen = new HAW_raw(HAW_HTML, '<p>'); $myForm->add_raw($myParOpen); $myCheckbox = new CHAW_checkbox('remembersession', 'yes', camila_get_translation('camila.login.remembersession')); //$myCheckbox->set_br(0); $myForm->add_checkbox($myCheckbox); $myForm->add_raw($myParClose); if ($dh2 = opendir('./lang/')) { $myForm->add_raw($myParOpen); $mySelect = new CHAW_select('lang'); while (($file2 = readdir($dh2)) !== false) {
function draw(&$form) { parent::draw($form); global $_CAMILA; $this->tDate = ''; $this->tFormat = ''; $fmt = ''; $fmt2 = ''; $f = array(); $m = camila_get_translation('camila.dateformat.monthpos'); $d = camila_get_translation('camila.dateformat.daypos'); $y = camila_get_translation('camila.dateformat.yearpos'); $f[$m] = 'm'; $f[$d] = 'd'; $f[$y] = 'Y'; ksort($f); reset($f); $count = 0; while (list($k, $v) = each($f)) { $fmt .= $v; $fmt2 .= '%' . $v; $this->tFormat .= camila_get_translation('camila.dateformat.placeholder.' . $v); if ($count < 2) { $fmt .= camila_get_translation('camila.dateformat.separator'); $fmt2 .= camila_get_translation('camila.dateformat.separator'); $this->tFormat .= camila_get_translation('camila.date.separator'); } $count++; } if ($this->value != '') { $this->tDate = $_CAMILA['db']->UserTimeStamp($this->value, $fmt); $this->value_hour = $_CAMILA['db']->UserTimeStamp($this->value, 'H'); $this->value_minute = $_CAMILA['db']->UserTimeStamp($this->value, 'i'); } if ($this->updatable && !isset($_REQUEST['camila_inline_field'])) { $myInput = new CHAW_input($this->key, $this->tDate, $this->title . ' - Data (' . $this->tFormat . ')' . $this->labelseparator); if ($this->maxlength > 0) { $myInput->set_maxlength($this->maxlength); } if ($this->size > 0) { $myInput->set_size($this->size); } $myInput->set_br(1); $form->add_input($myInput); $code = '<link rel="stylesheet" type="text/css" media="all" href="' . CAMILA_LIB_DIR . 'jscalendar/' . $this->calendar_theme_file . '" />'; $code .= '<script src=\'' . CAMILA_LIB_DIR . 'jscalendar/calendar.js\' type=\'text/javascript\'></script>'; $code .= '<script src=\'' . CAMILA_LIB_DIR . 'jscalendar/' . $this->calendar_lang_file . '\' type=\'text/javascript\'></script>'; $code .= '<script src=\'' . CAMILA_LIB_DIR . 'jscalendar/' . $this->calendar_setup_file . '\' type=\'text/javascript\'></script>'; $_CAMILA['page']->camila_add_js($code, 'jscalendar'); $code = '<script type=\'text/javascript\'>xParent(\'' . $this->key . '\',true).removeChild(xNextSib(\'' . $this->key . '\',\'br\'))</script>'; $js = new CHAW_js($code); $form->add_userdefined($js); $popup = new CHAW_js("<a href=\"#\" id=\"f-calendar-trigger-" . $this->key . "\"><img src=\"" . CAMILA_LIB_DIR . "jscalendar/img.gif\" alt=\"\" align=\"middle\" border=\"0\"></a><script type=\"text/javascript\">Calendar.setup({\"ifFormat\":\"" . $fmt2 . "\",\"daFormat\":\"" . $fmt2 . "\",\"firstDay\":1,\"showsTime\":false,\"showOthers\":false,\"timeFormat\":12,\"inputField\":\"" . $this->key . "\",\"button\":\"f-calendar-trigger-" . $this->key . "\"});</script>"); $form->add_userdefined($popup); $myText = new CHAW_text(' Ora' . $this->labelseparator); $myText->set_br(0); $form->add_text($myText); $tok = strtok('00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23', ','); while ($tok) { $pos = strpos($tok, ';'); if ($pos === false) { $this->hour_options[] = array($tok, $tok); } else { $this->hour_options[] = array(substr($tok, 0, $pos), substr($tok, $pos + 1)); } $tok = strtok(','); } $mySelect = new CHAW_select($this->key . '_hour'); while ($tok = each($this->hour_options)) { $selected = $tok[1][0] == $this->value_hour ? HAW_SELECTED : HAW_NOTSELECTED; $mySelect->add_option($tok[1][1], $tok[1][0], $selected); } $form->add_select($mySelect); $text = new CHAW_text(':'); $text->set_br(0); $form->add_text($text); $this->minute_options = array(); for ($i = 0; $i < 60; $i += 60 / $this->hslots) { $this->minute_options[] = array(str_pad($i, 2, '0', STR_PAD_LEFT), str_pad($i, 2, '0', STR_PAD_LEFT)); } $mySelect = new CHAW_select($this->key . '_minute'); while ($tok = each($this->minute_options)) { $selected = $tok[1][0] == $this->value_minute ? HAW_SELECTED : HAW_NOTSELECTED; $mySelect->add_option($tok[1][1], $tok[1][0], $selected); } $form->add_select($mySelect); $text = new CHAW_text(''); $form->add_text($text); } elseif (isset($_REQUEST['camila_inline_field'])) { $fVal = $this->tDate . ' ' . $this->value_hour . camila_get_translation('camila.time.separator') . $this->value_minute . camila_get_translation('camila.time.separator') . '00'; $mySelect = new CHAW_select($this->key); if ($this->value == '-' || $this->value == '') { $mySelect->add_option('-', '-', HAW_SELECTED); } else { $mySelect->add_option($fVal, $fVal, HAW_SELECTED); $mySelect->add_option('-', '-', HAW_NOTSELECTED); } $now = $_CAMILA['db']->UserTimeStamp(date('Y-m-d H:i:s'), $fmt) . ' ' . date('H') . camila_get_translation('camila.time.separator') . date('i') . camila_get_translation('camila.time.separator') . '00'; $fVal = $this->tDate . ' ' . $this->value_hour . camila_get_translation('camila.time.separator') . $this->value_minute . camila_get_translation('camila.time.separator') . '00'; if ($fVal == $now) { $mySelect->add_option($now, $now, HAW_SELECTED); } else { $mySelect->add_option($now, $now, HAW_NOTSELECTED); } $form->add_select($mySelect); } else { if ($this->value_hour != '00' || $this->value_minute != '00') { $myText = new CHAW_text($this->title . $this->labelseparator . ' ' . $this->tDate . ' - Ore ' . $this->value_hour . camila_get_translation('camila.time.separator') . $this->value_minute); } else { $myText = new CHAW_text($this->title . $this->labelseparator . ' ' . $this->tDate); } $form->add_text($myText); } }