public function __construct($options = null) { parent::__construct($options); $this->setName('ServiceForm'); // SortNumber, int $sort = new Zend_Form_Element_Text('SortNumber'); $sort->setLabel('Sort number:'); // ServiceTitle, string $title = new Zend_Form_Element_Text('ServiceTitle'); $title->setLabel('Service title:')->setRequired(); // service categories, string (composed from MultiCheckbox) $vals = array(); $categories = array(); $_serviceCategories = new Admin_Model_ServiceCategory(); foreach ($_serviceCategories->getAllServiceCategories() as $category) { $vals[] = $category->ServiceCategoryID; $categories[$category->ServiceCategoryID] = $category->CategoryTitle; } $serviceCategories = new Zend_Form_Element_MultiCheckbox('ServiceCategories'); $serviceCategories->setLabel('Applicable service categories:')->setRequired()->addMultiOptions($categories)->setValue($vals); // ServiceText, string $text = new Zend_Form_Element_Textarea('ServiceText'); $text->setLabel('Service text:')->setRequired(); // Submit button $submit = new Zend_Form_Element_Submit('Submit'); $submit->setLabel('Submit'); $this->addElements(array($sort, $title, $serviceCategories, $text, $submit)); }
public function homeAction() { $this->view->aboutMe = $this->_contacts->getAboutMeByID(); $this->view->whatIDo = $this->_contacts->getWhatIDoByID(); $this->view->articles = $this->_articles->getAllArticles(); $this->view->contacts = $this->_contacts->getContactsByID(); $this->view->serviceCategories = $this->_serviceCategories->getAllServiceCategories(); $this->view->services = $this->_services->getAllServices(); $this->view->testimonials = $this->_testimonials->getAllTestimonials(); $this->view->footer = $this->_contacts->getFooterByID(); }
public function deleteServiceCategoryAction() { $categoryID = $this->_getParam('categoryID', 0); $this->_serviceCategories->deleteServiceCategory($categoryID); $this->_redirect('/enlighten/panel/service-categories'); }