if (isset($arguments['aspassword'])) $el->setAsPassword($arguments['aspassword']);
break;
+ case 'password':
+ import('form.PasswordField');
+ $el = new PasswordField($arguments['name']);
+ $el->setMaxLength(@$arguments['maxlength']);
+ break;
+
// TODO: refactoring ongoing down from here.
// aspassword - change this name to something better? Perhaps.
// Change $arguments to something better too (maybe). $args or $params?
--- /dev/null
+<?php
+// +----------------------------------------------------------------------+
+// | Anuko Time Tracker
+// +----------------------------------------------------------------------+
+// | Copyright (c) Anuko International Ltd. (https://www.anuko.com)
+// +----------------------------------------------------------------------+
+// | LIBERAL FREEWARE LICENSE: This source code document may be used
+// | by anyone for any purpose, and freely redistributed alone or in
+// | combination with other software, provided that the license is obeyed.
+// |
+// | There are only two ways to violate the license:
+// |
+// | 1. To redistribute this code in source form, with the copyright
+// | notice or license removed or altered. (Distributing in compiled
+// | forms without embedded copyright notices is permitted).
+// |
+// | 2. To redistribute modified versions of this code in *any* form
+// | that bears insufficient indications that the modifications are
+// | not the work of the original author(s).
+// |
+// | This license applies to this document only, not any other software
+// | that it may be combined with.
+// |
+// +----------------------------------------------------------------------+
+// | Contributors:
+// | https://www.anuko.com/time_tracker/credits.htm
+// +----------------------------------------------------------------------+
+
+import('form.FormElement');
+
+class PasswordField extends FormElement {
+
+ function __construct($name, $value='')
+ {
+ $this->class = 'PasswordField';
+ $this->name = $name;
+ $this->value = $value;
+ }
+
+ function getHtml() {
+ if ($this->id == '') $this->id = $this->name;
+
+ $html = "\n\t<input type=\"password\"";
+ $html.= ' id="'.$this->id.'"';
+ $html.= ' name="'.$this->name.'"';
+
+ if ($this->size != '')
+ $html.= ' size="'.$this->size.'"';
+
+ if ($this->style != '')
+ $html.= ' style="'.$this->style.'"';
+
+ if ($this->max_length != '')
+ $html.= ' maxlength="'.$this->max_length.'"';
+
+ if ($this->on_change != '')
+ $html.= ' onchange="'.$this->on_change.'"';
+
+ $html.= ' value="'.htmlspecialchars($this->getValue()).'"';
+ $html.= '>';
+ return $html;
+ }
+}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.10.38.3613 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.10.38.3614 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
$form = new Form('loginForm');
$form->addInput(array('type'=>'text','size'=>'25','maxlength'=>'100','name'=>'login','style'=>'width: 220px;','value'=>$cl_login));
-$form->addInput(array('type'=>'text','size'=>'25','maxlength'=>'50','name'=>'password','style'=>'width: 220px;','aspassword'=>true,'value'=>$cl_password));
+$form->addInput(array('type'=>'password','size'=>'25','maxlength'=>'50','name'=>'password','style'=>'width: 220px;','value'=>$cl_password));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_login click.
$form->addInput(array('type'=>'submit','name'=>'btn_login','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.login')));