/**
  * Get all the PCP types
  *
  * @access public
  *
  * @return array - array reference of all PCP types
  * @static
  */
 public static function &pcpType()
 {
     self::$pcpType = array();
     if (!self::$pcpType) {
         self::$pcpType = array('contribute' => 'Contribution', 'event' => 'Event');
     }
     return self::$pcpType;
 }
Exemplo n.º 2
0
 /**
  * Function to actually build the form
  *
  * @param null
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Delete Campaign'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
     } else {
         $status = array('' => ts('- select -')) + CRM_PCP_PseudoConstant::pcpStatus();
         $types = array('' => ts('- select -')) + CRM_PCP_PseudoConstant::pcpType();
         $contribPages = array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::contributionPage();
         $eventPages = array('' => ts('- select -')) + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
         $this->addElement('select', 'status_id', ts('Status'), $status);
         $this->addElement('select', 'page_type', ts('Source Type'), $types);
         $this->addElement('select', 'page_id', ts('Contribution Page'), $contribPages);
         $this->addElement('select', 'event_id', ts('Event Page'), $eventPages);
         $this->addButtons(array(array('type' => 'refresh', 'name' => ts('Search'), 'spacing' => '         ', 'isDefault' => TRUE)));
         parent::buildQuickForm();
     }
 }