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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

■ Note Checks to ensure that this button is only displayed to authorized users will be added Chapter 6.<br />

Next, modify the buildCalendar() method to call your new _adminGeneralOptions() method <strong>by</strong><br />

inserting the following bold code:<br />

public function buildCalendar()<br />

{<br />

// To save space, the bulk of this method has been omitted<br />

}<br />

/*<br />

* Close the final unordered list<br />

*/<br />

$html .= "\n\t\n\n";<br />

/*<br />

* If logged in, display the admin options<br />

*/<br />

$admin = $this->_adminGeneralOptions();<br />

/*<br />

* Return the markup for output<br />

*/<br />

return $html . $admin;<br />

Finally, add the admin stylesheet (admin.css) to index.php using the following code in bold to make<br />

sure the link displays correctly:<br />

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

Saved successfully!

Ooh no, something went wrong!