public function weekInfoAction() { if (Application_Model_Preference::GetAllow3rdPartyApi()) { // disable the view and the layout $this->view->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $dow = array("sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"); $result = array(); for ($i = 0; $i < 7; $i++) { $result[$dow[$i]] = Show_DAL::GetShowsByDayOfWeek($i); } header("Content-type: text/javascript"); echo $_GET['callback'] . '(' . json_encode($result) . ')'; } else { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource. '; exit; } }