/** * @param $params * @return array */ public function GetCCDDocument($params) { $this->constructor($params); $_SESSION['user']['facility'] = $this->facility; $ccd = new CCDDocument(); $ccd->setPid($params->pid); $ccd->setTemplate('toc'); $ccd->createCCD(); if (!$this->isAuth()) { return array('Success' => false, 'Error' => 'Error: HTTP 403 Access Forbidden'); } return array('Success' => true, 'Document' => $ccd->get()); }
return date('F Y', strtotime($date)); } private function parseDate($date) { $foo = explode(' ', $date); return str_replace('-', '', $foo[0]); } } /** * Handle the request only if pid and action is available */ if (isset($_REQUEST['pid']) && isset($_REQUEST['action'])) { // Check token for security include_once ROOT . '/sites/' . $_REQUEST['site'] . '/conf.php'; include_once ROOT . '/classes/MatchaHelper.php'; $ccd = new CCDDocument(); if (isset($_REQUEST['eid'])) { $ccd->setEid($_REQUEST['eid']); } if (isset($_REQUEST['pid'])) { $ccd->setPid($_REQUEST['pid']); } if (isset($_REQUEST['exclude'])) { $ccd->setExcludes($_REQUEST['exclude']); } $ccd->setTemplate('toc'); $ccd->createCCD(); if ($_REQUEST['action'] == 'view') { $ccd->view(); } elseif ($_REQUEST['action'] == 'export') { $ccd->export();