/** * Edit/Create entry page * * @since 0.1 * * @param int $id */ function was_edit($id) { $ad = new Advertisment($id); ?> <div class="wrap edit-entry"> <div id="icon-edit" class="icon32"><br /></div> <h2><?php _e('Wordpress Ad Server'); ?> </h2> <h3><?php _e('Edit Entry'); ?> </h3> <form method="post" action="admin.php?page=was-manage"> <?php if (function_exists('wp_nonce_field')) { wp_nonce_field('was-list-form'); } ?> <input type="hidden" name="advertisment_id" value="<?php echo $ad->id; ?> " /> <table class="form-table"> <tr valign="top"> <th scope="row">Name</th> <td><input type="text" id="advertisment_name" name="advertisment_name" value="<?php echo $ad->getName(); ?> " /></td> </tr> <tr valing="top"> <th scope="row">Vendor</th> <td><input type="text" id="advertisment_vendor" name="advertisment_vendor" value="<?php echo $ad->getVendor(); ?> " /></td> </tr> <tr valing="top"> <th scope="row">Code</th> <td><textarea id="advertisment_code" name="advertisment_code"><?php echo stripslashes($ad->getHtml()); ?> </textarea></td> </tr> <tr valing="top"> <th scope="row">Active</th> <td><input type="checkbox" id="advertisment_active" name="advertisment_active" <?php echo $ad->isActive() ? 'checked="checked" ' : ''; ?> /></td> </tr> <tr valing="top"> <th scope="row">Weight</th> <td><input type="text" id="advertisment_weight" name="advertisment_weight" value="<?php echo $ad->getWeight(); ?> " /></td> </tr> <tr valing="top"> <th scope="row">Size</th> <td><input type="text" id="advertisment_size" name="advertisment_size" value="<?php echo $ad->getSize(); ?> " /></td> </tr> </table> <p class="submit"> <input type="submit" class="button-primary" value="<?php _e('Save Changes'); ?> " /> </p> <p>Using Labels (need to research on the effect of <th scope="row"> versus <label> on accessibility, ie. screen readers):</p> <label for="advertisment_name">Name</label> <input disabled="disabled" type="text" id="advertisment_name" name="advertisment_name" value="<?php echo $ad->getName(); ?> " /> <button disabled="disabled" class="button-primary" type="submit">Update</button> </form> </div> <?php }