Beispiel #1
0
 public function formscontactAction()
 {
     $blockParamEmail = Cible_FunctionsBlocks::getBlockParameter($this->_getParam('BlockID'), '1');
     if (isset($blockParamEmail)) {
         $mailTo = $blockParamEmail;
     }
     $form = new FormContact();
     $this->view->assign('form', $form);
     if ($this->_request->isPost()) {
         $formData = $this->_request->getPost();
         if (array_key_exists('submit', $formData)) {
             if ($form->isValid($formData)) {
                 // send the mail
                 $data = array('firstName' => $formData['prenom'], 'lastName' => $formData['name'], 'email' => $formData['email'], 'comments' => $formData['commentaire'], 'language' => 1);
                 $options = array('send' => true, 'isHtml' => true, 'moduleId' => $this->_moduleID, 'event' => 'contact', 'type' => 'email', 'recipient' => 'admin', 'data' => $data);
                 if (!empty($mailTo)) {
                     $options['to'] = $mailTo;
                 }
                 $oNotification = new Cible_Notifications_Email($options);
                 $this->view->assign('inscriptionValidate', true);
             }
         }
     } else {
     }
 }
Beispiel #2
0
 /**
  * Overwrite the function define in the SiteMapInterface implement in Cible_Controller_Action
  *
  * This function return the sitemap specific for this module
  *
  * @access public
  *
  * @return a string containing xml sitemap
  */
 public function homepagelistAction()
 {
     $_blockID = $this->_request->getParam('BlockID');
     $languageID = Zend_Registry::get('languageID');
     $link = Cible_FunctionsBlocks::getBlockParameter($_blockID, $languageID);
     $linkMax = Cible_FunctionsBlocks::getBlockParameter($_blockID, 3);
     $block_info = Cible_FunctionsBlocks::getBlockDetails($_blockID);
     $db = Zend_Registry::get("db");
     $feed = Zend_Feed_Reader::import($link);
     $data = array('block_title' => $block_info["BI_BlockTitle"], 'linkMax' => $linkMax, 'title' => $feed->getTitle(), 'link' => $feed->getLink(), 'dateModified' => $feed->getDateModified(), 'description' => $feed->getDescription(), 'language' => $feed->getLanguage(), 'entries' => array());
     foreach ($feed as $entry) {
         $edata = array('title' => $entry->getTitle(), 'description' => $entry->getDescription(), 'dateModified' => $entry->getDateModified(), 'authors' => $entry->getAuthors(), 'link' => $entry->getLink(), 'content' => $entry->getContent());
         $data['entries'][] = $edata;
     }
     $this->view->data = $data;
 }
Beispiel #3
0
 public function editAction()
 {
     // web page title
     $this->view->title = "Edition de formulaire";
     // Tests if the user has permissions
     if ($this->view->aclIsAllowed($this->_name, 'manage', true)) {
         // set variables needed for the process
         $formID = $this->_getParam('formID');
         $returnAction = $this->_getParam('return');
         $pageID = $this->_getParam('pageID');
         $blockID = $this->_getParam('blockID');
         $baseDir = $this->view->baseUrl();
         if (empty($formID) && !empty($blockID)) {
             $formID = Cible_FunctionsBlocks::getBlockParameter($blockID, '1');
         }
         // Define the url where to return
         if ($returnAction) {
             $returnUrl = "/form/index/{$returnAction}";
         } elseif ($pageID) {
             $returnUrl = "/page/index/index/ID/{$pageID}";
         } else {
             $returnUrl = "/form/index/list/";
         }
         //Add specific js file
         $this->view->headScript()->appendFile($this->view->locateFile('headerFormActions.js'));
         $this->view->headScript()->appendFile($this->view->locateFile('tiny_mce/tiny_mce.js'));
         $oNotifications = new FormNotificationObject();
         $recipients = $oNotifications->getAll(null, true, $formID);
         // Get data for the current form
         $oForm = new FormObject();
         $data = $oForm->populate($formID, $this->getCurrentEditLanguage());
         //Generate the form for the back button
         $formBack = new FormBackButton(array('baseDir' => $baseDir, 'cancelUrl' => "{$baseDir}{$returnUrl}", 'disableAction' => false));
         $formBack->removeElement('submitSave');
         $formBack->getElement('cancel')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'li')), array(array('row' => 'HtmlTag'), array('tag' => 'ul', 'openOnly' => true, 'class' => 'actions-buttons'))))->setOrder(1);
         $this->view->formBack = $formBack;
         //Generate the form
         $form = new FormForm(array('baseDir' => $baseDir, 'cancelUrl' => "{$baseDir}{$returnUrl}", 'formID' => $formID, 'disableAction' => true, 'recipients' => $recipients));
         $this->view->form = $form;
         //Add question type data
         $oQuestion = new FormQuestionTypeObject();
         $questionData = $oQuestion->getAll($this->getCurrentEditLanguage());
         $this->view->questionType = $questionData;
         // action: If not post action (send modification)
         if (!$this->_request->isPost()) {
             //Populate the for with data from db
             $form->populate($data);
         } else {
             // Get data sent
             $formData = $this->_request->getPost();
             if ($form->isValid($formData)) {
                 $languages = Cible_FunctionsGeneral::getAllLanguage();
                 var_dump($languages);
                 exit;
                 // and save value in db
                 $oForm->save($formID, $formData, $this->getCurrentEditLanguage());
                 $oForm->save($formID, $formData, $this->getCurrentEditLanguage());
                 $this->_redirect($returnUrl);
             }
         }
     }
 }
Beispiel #4
0
 protected function getManageDescription($blockID = null)
 {
     $viewName = Cible_FunctionsBlocks::getBlockParameter($blockID, '999');
     $listParams = '';
     if ($viewName == 'index') {
         $identifier = "form_select_option_view_default_index";
         $listParams = '';
     } else {
         $identifier = "form_select_option_view_{$this->getRequest()->getModuleName()}_{$viewName}";
         $listParams = "<div class='block_params_list'><strong>";
         $listParams .= $this->view->getCibleText('label_view');
         $listParams .= "</strong>" . $this->view->getCibleText($identifier) . "</div>";
     }
     return $listParams;
 }
Beispiel #5
0
 public function newsfeedAction()
 {
     $this->view->assign('lang', Zend_Registry::get('languageSuffix'));
     $categoryID = Cible_FunctionsBlocks::getBlockParameter($this->_getParam('BlockID'), 1);
     $this->view->assign('CategoryID', $categoryID);
 }