/** * Run the page. * * This method is called after the page is created. It checks for the * type of action and executes that action. * Finally it calls the parent's run method. * * @return void * @access public * */ function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); // assign vars to templates $this->assign('action', $action); $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0); // set breadcrumb to append to 2nd layer pages $breadCrumb = array(array('title' => ts('Manage Items'), 'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1'))); // what action to take ? if ($action & CRM_Core_Action::DISABLE) { require_once 'CRM/Auction/BAO/Item.php'; CRM_Auction_BAO_Item::setIsActive($id, 0); } elseif ($action & CRM_Core_Action::ENABLE) { require_once 'CRM/Auction/BAO/Item.php'; CRM_Auction_BAO_Item::setIsActive($id, 1); } elseif ($action & CRM_Core_Action::DELETE) { $session = CRM_Core_Session::singleton(); $session->pushUserContext(CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1&action=browse')); $controller = new CRM_Core_Controller_Simple('CRM_Auction_Form_Item_Delete', 'Delete Item', $action); $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0); $controller->set('id', $id); $controller->process(); return $controller->run(); } elseif ($action & CRM_Core_Action::COPY) { $this->copy(); } // finally browse the auctions $this->browse(); // parent run parent::run(); }