本文整理汇总了PHP中ValidatingForm::addSummary方法的典型用法代码示例。如果您正苦于以下问题:PHP ValidatingForm::addSummary方法的具体用法?PHP ValidatingForm::addSummary怎么用?PHP ValidatingForm::addSummary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ValidatingForm
的用法示例。
在下文中一共展示了ValidatingForm::addSummary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: stripslashes
*
* You should have received a copy of the GNU General Public License
* along with MMC; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require "modules/samba/includes/machines.inc.php";
require "modules/samba/includes/samba.inc.php";
require "modules/samba/mainSidebar.php";
require "graph/navbar.inc.php";
if (isset($_POST["baddmach"])) {
$machine = $_POST["machine"];
$comment = stripslashes($_POST["comment"]);
add_machine($machine, $comment);
if (!isXMLRPCError()) {
new NotifyWidgetSuccess(sprintf(_T("Computer %s successfully added"), $machine));
header("Location: " . urlStrRedirect("samba/machines/index"));
exit;
}
}
$p = new PageGenerator(_T("Add a computer"));
$p->setSideMenu($sidemenu);
$p->display();
$f = new ValidatingForm();
$f->addSummary(_T("The computer name can only contains letters lowercase and numbers, and must begin with a letter."));
$f->push(new Table());
$f->add(new TrFormElement(_T("Computer name"), new NetbiosInputTpl("machine")), array("value" => $machine, "required" => True));
$f->add(new TrFormElement(_T("Comment"), new InputTpl("comment")), array("value" => $comment));
$f->pop();
$f->pop();
$f->addValidateButton("baddmach");
$f->display();