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.

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

Save this file, <strong>and</strong> then navigate to http://localhost/admin.php <strong>and</strong> create a new event with the<br />

following information:<br />

• Event Title: Dinner Party<br />

• Start Time: 2010-01-22 17:00:00<br />

• End Time: 2010-01-22 19:00:00<br />

• Description: Five-course meal with wine pairings at John’s house<br />

After clicking the Create new event button, the calendar is updated with the new event (see<br />

Figure 5-3).<br />

Figure 5-3. The new event as it appears when hovered over<br />

Adding a Button to the Main View to Create New Events<br />

To make it easier for your authorized users to create new events, add a button to the calendar that takes<br />

the user to the form in admin.php. Do this <strong>by</strong> creating a new private method called<br />

_adminGeneralOptions() in the Calendar class:<br />

181

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

Saved successfully!

Ooh no, something went wrong!