02.06.2013 Views

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 5-4. The Admin button appears in the bottom left of the calendar<br />

Adding Edit Controls to the Full Event View<br />

CHAPTER 5 ■ ADD CONTROLS TO CREATE, EDIT, AND DELETE EVENTS<br />

Next, you need to make it possible for authorized users to edit events. You will do this <strong>by</strong> adding a button<br />

to the full view of an event in view.php.<br />

However, unlike the simple link used to create a new option, an Edit button will require an actual<br />

form submission. To keep this code manageable, you’ll create a new private method called<br />

_adminEntryOptions() in the Calendar class that will generate the markup for the form.<br />

For now, this form will simply return the form markup to display the Edit button. More will be<br />

added to the form as you continue on through the exercises in this book.<br />

You create this method <strong>by</strong> adding the following bold code to the Calendar class:<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!