/** * @covers Form::hasErrors */ public function testHasErrors() { $this->assertFalse($this->myForm->hasErrors()); $textBox = $this->myForm->textbox('text_input'); $this->myForm->addFieldError('text_input', 'Required input'); $this->assertTrue($this->myForm->hasErrors()); }
// Send information to the control for easy link addition $oFCKeditor->Config['siteURL'] = Config::siteConfig("SITE_URL"); $oFCKeditor->Config['cwd'] = $this->session['cwd']; $oFCKeditor->Config['pageList'] = implode("|", $this->pageList); // Create the control on the page $oFCKeditor->Create(); // Show meta fields if the user is in advanced mode if ($this->session['editorMode'] != 'BASIC') { ?> <br/> Page Description: <?php Form::textbox('pageDescription', $this->pageState, 40, 400); ?> (a brief summary of the page)<br/><br/> Page Keywords: <?php Form::textbox('pageKeywords', $this->pageState, 42, 400); ?> (keywords for search engines to associate with this page)<br/><br/> <?php } ?> <div class="centered"> <br/> <a href="/manage/welcome">Cancel</a> <input type="submit" value="I'm Done With My Editing" /> </div> <input name="fileName" type="hidden" value="<?php echo $this->pageState['page']; ?>
<td align="left"><?php Form::textbox('fullname', $this->pageState, 20, 50); ?> </td> </tr> <tr> <td><label for="email">Email:</label></td> <td align="left"><?php Form::textbox('email', $this->pageState, 20, 50); ?> </td> </tr> <tr> <td><label for="homefolder">Home Folder:</label></td> <td align="left"><?php Form::textbox('homefolder', $this->pageState, 20, 50); ?> </td> </tr> <tr> <td><label for="foldermgr">Folder Manager:</label></td> <td align="left"><?php Form::checkbox('foldermgr', $this->pageState, 'foldermgr'); ?> </td> </tr> <tr> <td><label for="adveditor">Advanced Editor:</label></td> <td align="left"><?php Form::checkbox('adveditor', $this->pageState, 'adveditor'); ?>
<div class="error">- <?php print $err; ?> </div> <?php } } ?> </div> <table name="newPageTable" width="90%"> <tr> <td><img src="/manage/application/static/images/one.png" /></td> <td class="right">New Page Name:</td> <td class="left"><?php print Form::textbox('newFilename', $this->pageState, 20, 20); ?> </td> </tr> <tr> <td class="centered"><img src="/manage/application/static/images/two.png" /></td> <td class="right">Select a Page Type:</td> <td class="left"><?php print Form::listbox_html('templateName', $this->pageTypes, $this->pageState); ?> </td> </tr> <tr> <td class="centered"><img src="/manage/application/static/images/three.png" /></td> <td class="centered" colspan="2"> <a href="welcome">Cancel</a>
} ?> </div> <table width="100%" class="tableForm"> <tr> <td><label for="username">Delete this User?</label></td> <td><?php print $this->pageState['userToDelete']; ?> </td> </tr> <tr> <td><label for="confirm">Enter "yes" to confirm deletion.</label></td> <td><?php Form::textbox('confirm', $this->pageState, 20, 20); ?> </td> </tr> <tr> <td class="centered" colspan="2"><a href="/manage/userMgmt">Cancel</a> <input name="btnDelete" type="submit" value="Delete" /></td> </tr> </table> <input type="hidden" name="userToDelete" value="<?php print $this->pageState['userToDelete']; ?> "> </form> <br/><br/> </div>
</td> <td> <table id="templateTable" width="100%"> <?php foreach ($this->templateFields as $field) { ?> <tr style="text-align:right; width=40%;"> <td><?php echo $field['Question']; ?> </td> <td style="text-align:left; padding-left:3px;"> <?php switch ($field['Type']) { case "string": echo Form::textbox($field['Name'], $this->pageState[$field['Name']], 20, $field['Data']); break; case "text": echo Form::textarea($field['Name'], $this->pageState[$field['Name']], 5, 20); break; case "list": echo Form::listbox($field['Name'], explode(";", $field['Data']), $this->pageState[$field['Name']], false); break; case "hidden": echo Form::hidden($field['Name'], $this->pageState[$field['Name']]); break; } ?> </td> </tr> <?php
?> "><?php echo $fname; ?> </option> <?php } ?> </select> </td> </tr> <tr> <td><img src="/manage/application/static/images/two.png" /></td> <td class="right">Your Email:</td> <td class="left"><?php Form::textbox('email', $pageState, 20, 20); ?> </td> </tr> <tr> <td class="centered"><img src="/manage/application/static/images/three.png" /></td> <td class="centered" colspan="2"><input name="btnReset" type="submit" value="Get My Password" /></td> </tr> </table> </form> <br/><br/> </div> <?php if ($this->errors) {
<div class="error">- <?php print $err; ?> </div> <?php } } ?> </div> <table name="newPageTable" width="90%" class="tableForm"> <tr> <td><img src="/manage/application/static/images/one.png" /></td> <td class="right">New Folder Name:</td> <td class="left"><?php Form::textbox('newFolderName', $pageState, 20, 20); ?> </td> </tr> <tr> <td class="centered"><img src="/manage/application/static/images/two.png" /></td> <td class="centered" colspan="2"><a href="/manage/welcome">Cancel</a> <input name="btnCreate" type="submit" value="Create Folder" /></td> </tr> </table> </form> <br/><br/> </div> <?php if ($this->errors) {
<td align="left"><?php Form::textbox('fullname', $pageState, 25, 50); ?> </td> </tr> <tr> <td><label for="email">Email:</label></td> <td align="left"><?php Form::textbox('email', $pageState, 25, 50); ?> </td> </tr> <tr> <td><label for="homefolder">Home Folder:</label></td> <td align="left"><?php Form::textbox('homefolder', $pageState, 30, 50); ?> <br/> <span class="small">Be sure to start with a leading slash, and leave off a trailing slash. (e.g. /maindir/subdir) For site admins, enter a single slash: /</span> </td> </tr> <tr> <td><label for="foldermgr">Folder Manager:</label></td> <td align="left"><?php Form::checkbox('foldermgr', $pageState, 'foldermgr'); ?> </td> </tr> <tr> <td><label for="adveditor">Advanced Editor:</label></td> <td align="left"><?php