/** * draw the submit button. */ function draw_buttons() { global $lang; echo "<tr><td colspan=\"2\" align=\"center\">"; $submitbutton = new Button("goon", $lang->get('login', 'Sign In'), "", "button", "document.loginform.passwd.value=hex_md5(document.loginform.passwd0.value);document.loginform.passwd0.value='';document.loginform.submit();"); $submitbutton->draw(); echo "</td></tr>"; }
/** * Draw HTML output */ function draw() { global $c, $sid, $lang; echo '<td colspan="3"><table width="100%" border="0" cellpadding="3" cellspacing="0"><tr>'; $widget = new Cell("clc", "", 2, $this->width, 20); $widget->draw(); echo "</tr><tr>\n"; echo '<td colspan="2"align="right"> </td>'; echo '<td align="right">'; $lbi = new Button("action", $lang->get("print", "print"), "navelement", "button", "window.open('" . $_SERVER['REQUEST_URI'] . "&print=1');"); $lbi->draw(); echo " "; $lbi = new Button("action", $lang->get("refresh", "refresh"), "navelement", "button", "document.location.href = document.location.href;"); $lbi->draw(); retain("action", ""); retain("sid", $sid); echo "</td></tr></table></td>"; return $this->cells; }
/** * internal. Draws the buttons of your form. */ function draw_buttons() { global $lang; echo "<tr><td valign=\"middle\" align=\"right\" colspan=\"2\">"; $value = "Update"; $resetbutton = new Button("reset", $lang->get("reset_form", "Reset Form"), "", "reset"); $resetbutton->draw(); echo " "; retain("goon"); $submitbutton = new Button("goon", $value, "", "submit", $this->submitButtonAction.$this->getWaitupScreen()); $submitbutton->draw(); echo "</td></tr>"; }
/** * internal. Draw filter input. */ function draw_form() { global $lang; echo '<table width="170"><tr>'; echo "<td>" . $lang->get("filter_rule", "Search for..."). "</td>"; echo "<td>" . $lang->get("filter_column", "...in"). "</td></tr><tr>"; $txtb = new Input("filter_rule", $this->filter_rule, "embedded", "16", "", $width = "90", "TEXT", "", 1); $txtb->draw(); $select = new Dropdown("filter_column", $this->columns, "embedded", $this->filter_column, 80); $select->draw(); echo "</tr><tr>"; echo '<td colspan="2">'; echo '<table width="100%" cellpadding="0" cellspacing="0" border="0">'; echo '<tr><td>'; echo '<input type="hidden" name="filter" value="">'; echo '<input type="hidden" name="clearsearch" value="">'; $submitbutton = new Button("filter", $lang->get("search", "Search"), "navelement", "submit", "", "filter"); $submitbutton->draw(); echo " "; $clearbutton = new LinkButton("clearsearch", $lang->get("search_clear", "Reset Filter"), "navelement", "submit", "document.filter.filter_rule.value='';", "filter"); $clearbutton->draw(); br(); br(); echo "</td><tr></table></td></tr></table>"; }
/** * draw the form for creating new items. * May be overwritten if standard Display should not be used! */ function draw_new() { global $db, $lang, $go, $oid, $newitem, $errors, $page_action; $newitem = value("newitem"); $oid = value("oid", "NUMERIC"); $go = value("go", "NOSPACES"); //needed for uniqueness checks. $page_action = "INSERT"; $go = "UPDATE"; $container = new Container(4); $container->add(new Label("lbl", $lang->get("selectobject"), "informationheader", 3)); $container->add(new Cell("clc", "cwhite", 1, 20,10)); $container->add(new Cell("clc", "cwhite", 1, 150,10)); $container->add(new Cell("clc", "cwhite", 1, 350,10)); // what data should be displayed // check if item is selected. $stdStyle = "standardlight"; if ($this->state == creating && $newitem == "0") { $errors .= "-MANDATORY"; $stdStyle = "error"; $container->add(new Label("lbl", $lang->get("selectone"), "error", 3)); } $sql = "SELECT " . $this->new_pkname . ", " . $this->new_name . ", " . $this->new_description . " FROM " . $this->new_table . " ORDER BY " . $this->new_name; $query = new query($db, $sql); while ($query->getrow()) { $pk = $query->field($this->new_pkname); $checked = false; if (value("newitem", "NUMERIC") == $pk) $checked = true; $container->add(new Radio("newitem", $pk, $stdStyle, $checked)); $container->add(new Label("name", $query->field($this->new_name), "standard", 2)); $container->add(new Cell("clc", "standard", 1)); $container->add(new Label("desc", $query->field($this->new_description), "description", 2)); } $nameinput = new TextInput($lang->get("name"), $this->item_table, $this->item_name, "1", "type:text,size:32,width:200", "UNIQUE&MANDATORY"); $nameinput->setFilter($this->item_parentKeyName . " = $oid"); $positioninput = new TextInput($lang->get("position"), $this->item_table, "POSITION", "1", "type:text,size:3,width:30", "MANDATORY", "NUMBER"); if ($this->state == "creating") { $nameinput->check(); $positioninput->check(); } $container->add(new Cell("cll", "standard", 3, 10, 10)); $container->add(new Cell("cll", $nameinput->std_style, 1, 10, 1)); $container->add($nameinput); $container->add(new Cell("cll", $positioninput->std_style, 1, 10, 1)); $container->add($positioninput); // drawing. echo drawSpacer(1,1)."</td><td>".drawSpacer(1,1)."</td></tr>"; // cleanup the shit. echo "<tr><td colspan=\"2\"><br>"; echo '<table width="100%" cellpadding="0" cellspacing="0" border="0">'; $container->draw(); echo '</table>'; echo '</td></tr>'; echo '<tr><td colspan="2" align="right">'; echo '<br/>'; $resetbutton = new Button("reset", $lang->get("reset"), "navelement", "reset"); $resetbutton->draw(); echo drawSpacer(50,1); $backbutton = new Button("back", $lang->get("back"), "navelement", "submit"); $backbutton->draw(); echo ' '; $submitbutton = new Button("neu", $lang->get("create"), "navelement", "submit"); $submitbutton->draw(); retain("oid", $oid); retain("action", "editobject"); }