Beispiel #1
0
 public function indexAction()
 {
     //get landing page text
     $mptext = new Application_Model_Mpr();
     $this->view->row_text = $mptext->getText();
     // for banner
     $banner = new Application_Model_Banner();
     $this->view->banner = $banner->getMainBanner();
     //for social links
     $links = new Application_Model_SocialLinks();
     $this->view->links = $links->getSocialLinks();
     //for strip banner
     $strip = new Application_Model_StripBanner();
     $this->view->strip = $strip->getMainStripBanner();
     //for videos
     $results = $this->video->getFeaturedVideos();
     if (count($results) > 0) {
         $this->Paginator($results);
     } else {
         $this->view->empty_rec = true;
     }
     //for testimonial is featured
     $result = $this->testimonial->getFeaturedTestimonial();
     $this->view->i = 1;
     $this->view->list = $result;
 }
Beispiel #2
0
 public function homePageTextAction()
 {
     if ($this->user_session->msg != null) {
         $this->view->msg = $this->user_session->msg;
         $this->user_session->msg = null;
     }
     $form = new Application_Form_MpTextForm();
     $mptext = new Application_Model_Mpr();
     $form->row_text->setValue($mptext->getText());
     $this->view->form = $form;
     if ($this->user_session->msg != null) {
         $this->view->msg = $this->user_session->msg;
         $this->user_session->msg = null;
     }
     if (!$this->_request->isPost()) {
         return;
     }
     $formData = $this->_request->getPost();
     if (!$form->isValid($formData)) {
         return;
     }
     $mptext->updateText($formData['row_text']);
     $this->user_session->msg = "<div class='alert alert-success'> Text Updated </div>";
     $this->_redirect('/admin/index/home-page-text');
 }