cvs: pearweb /include html_form.php /public_html add-author.php authors.php index.php

From: Date: Wed, 19 Jul 2000 07:51:09 +0000
Subject: cvs: pearweb /include html_form.php /public_html add-author.php authors.php index.php
Groups: php.pear 
Request: Send a blank email to php-pear+get-149@lists.php.net to get a copy of this message
ssb Wed Jul 19 00:51:09 2000 EDT Modified files: /pearweb/include html_form.php /pearweb/public_html add-author.php authors.php index.php Log: * converted add-author.php to use the HTML_Form class Index: pearweb/include/html_form.php diff -u pearweb/include/html_form.php:1.1 pearweb/include/html_form.php:1.2 --- pearweb/include/html_form.php:1.1 Mon Jul 17 15:54:38 2000 +++ pearweb/include/html_form.php Wed Jul 19 00:51:09 2000 @@ -1,4 +1,4 @@ -<?php +<?php // -*- C++ -*- // {{{ constants @@ -71,7 +71,7 @@ // }}} // {{{ addTextarea() - function addTextarea($name, $title, &$default, + function addTextarea($name, $title, $default, $width = HTML_FORM_TEXTAREA_WT, $height = HTML_FORM_TEXTAREA_HT) { $this->fields[] = array("textarea", $name, $title, &$default, $width, $height); @@ -125,10 +125,10 @@ // {{{ start() - function start($action, $method = 'GET', $name = '') { - print "<FORM ACTION=\"$action\" METHOD=\"$method\""; - if ($name) { - print " NAME=\"$name\""; + function start() { + print "<FORM ACTION=\"$this->action\" METHOD=\"$this->method\""; + if ($this->name) { + print " NAME=\"$this->name\""; } print ">"; } @@ -143,9 +143,9 @@ if ($data[0] == 'reset') { continue; } - $name = $data[1]; + $fields[$data[1]] = true; } - $this->displayHidden("_fields", implode(":", $fields)); + $this->displayHidden("_fields", implode(":", array_keys($fields))); print "</FORM>"; } Index: pearweb/public_html/add-author.php diff -u pearweb/public_html/add-author.php:1.3 pearweb/public_html/add-author.php:1.4 --- pearweb/public_html/add-author.php:1.3 Mon Jul 17 15:54:38 2000 +++ pearweb/public_html/add-author.php Wed Jul 19 00:51:09 2000 @@ -1,8 +1,8 @@ -<?php +<?php // -*- C++ -*- require_once "html_form.php"; -authRequire(); +authRequire(1); $display_form = true; @@ -79,28 +79,27 @@ } $width = 60; - - formInputRow("Handle", "handle", $handle, 12); - formInputRow("Name", "name", $name, $width); - formInputRow("Email", "email", $email, $width); - formInputRow("Homepage", "homepage", $homepage, $width); - formCheckboxRow("Show Email Address?", "showemail", (bool)$showemail); - formCheckboxRow("Administrator?", "admin", (bool)$admin); - formPasswordRow("Password", "password", $password); - formTextareaRow("More info", "info", '', $width, 5); - formSubmitRow("Add Author"); + $form = new HTML_Form($PHP_SELF, "POST"); + $form->addText("handle", "Handle", $handle, 12); + $form->addText("name", "Name", $name, $width); + $form->addText("email", "Email", $email, $width); + $form->addText("homepage", "Homepage", $homepage, $width); + $form->addCheckbox("showemail", "Show Email Address?", (bool)$showemail); + $form->addCheckbox("admin", "Administrator?", (bool)$admin); + $form->addPassword("password", "Password", $password); + $form->addTextarea("info", "More info", '', $width, 5); + $form->addSubmit("submit", "Add Author"); -?></TABLE> -</FORM> -<?php + $form->display(); if ($jumpto) { print "<SCRIPT LANGUAGE=\"JavaScript\">\n<!--\n"; print "document.forms[0].$jumpto.focus();\n"; print "\n// -->\n</SCRIPT>\n"; } - pageFooter(); - } + +pageFooter(); + ?> Index: pearweb/public_html/authors.php diff -u pearweb/public_html/authors.php:1.1 pearweb/public_html/authors.php:1.2 --- pearweb/public_html/authors.php:1.1 Mon Jul 17 15:54:38 2000 +++ pearweb/public_html/authors.php Wed Jul 19 00:51:09 2000 @@ -9,6 +9,11 @@ if (DB::isError($sth)) { die("query failed: ".DB::errorMessage($dbh)."<BR>\n"); } + +print "<A HREF=\"add-author.php\">NEW</A> \n"; + +print "<P>\n"; + print "<TABLE BORDER=1>\n"; print " <TR>\n"; print " <TH>Handle</TH>\n"; Index: pearweb/public_html/index.php diff -u pearweb/public_html/index.php:1.4 pearweb/public_html/index.php:1.5 --- pearweb/public_html/index.php:1.4 Mon Jul 17 15:54:38 2000 +++ pearweb/public_html/index.php Wed Jul 19 00:51:09 2000 @@ -4,17 +4,13 @@ print "<H1>PEAR: PHP Extension and Add-on Repository</H1>\n"; -if ($SERVER_NAME != "pear.php.net") { +if ($SERVER_NAME != "pear.php.net" || $REMOTE_ADDR == '213.188.9.2') { print "<A HREF=\"authors.php\">AUTHORS</A><BR>\n"; print "<A HREF=\"packages.php\">PACKAGES</A><BR>\n"; print "<A HREF=\"domains.php\">DOMAINS</A><BR>\n"; } print "<H2><A HREF=\"doc/\">Documentation</A></H2>\n"; -$dbh = DB::connect("mysql://pear@localhost/pear"); -$ssb = new Author(&$dbh, "SSB"); -print $ssb->toString(); - -pageFooter(); +print "<!-- $REMOTE_ADDR -->\n"; ?>

« previous php.pear (#149) next »