public function __construct($options = null) { parent::__construct($options); $moduleID = -1; $moduleName = ''; if (!empty($options['moduleID'])) { $moduleID = $options['moduleID']; $moduleName = Cible_FunctionsModules::getModuleNameByID($moduleID); } // input text for the title of the text module $categoryTitle = new Zend_Form_Element_Text('Title'); $categoryTitle->setLabel($this->getView()->getCibleText('form_category_title_label') . '*')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->_view->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput'); $this->addElement($categoryTitle); $categoryDescription = new Zend_Form_Element_Text('WordingShowAllRecords'); $categoryDescription->setLabel($this->_view->getCibleText('form_category_view_all_label')); $this->addElement($categoryDescription); $views = Cible_FunctionsCategories::getCategoryViews($moduleID); foreach ($views as $view) { $pickerName = $view['MV_Name']; $controllerName = new Zend_Form_Element_Text("{$pickerName}_controllerName"); $controllerName->setLabel($this->getView()->getCibleText("form_select_option_view_{$moduleName}_{$pickerName}"))->setAttrib('onfocus', "openPagePicker('page-picker-{$pickerName}');"); $this->addElement($controllerName); $pagePicker = new Cible_Form_Element_PagePicker("{$pickerName}_pageID", array('associatedElement' => "{$pickerName}_controllerName", 'onclick' => "javascript:closePagePicker(\"page-picker-{$pickerName}\")")); $pagePicker->setLabel($this->_view->getCibleText('form_category_associated_page_label')); $pagePicker->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => "page-picker", 'id' => "page-picker-{$pickerName}")))); $this->addElement($pagePicker); } $module = new Zend_Form_Element_Hidden('ModuleID'); $module->setValue($moduleID)->removeDecorator('label')->removeDecorator('DtDdWrapper'); $this->addElement($module); }
public function init() { parent::init(); $this->view->assign('user', $this->view->auth()); $session = new Cible_Sessions(); // Defines the default interface language if ($this->_config->defaultInterfaceLanguage) { $this->_defaultInterfaceLanguage = $this->_config->defaultInterfaceLanguage; } // Check if the current interface language should be different than the default one $this->_currentInterfaceLanguage = !empty($session->languageID) ? $session->languageID : $this->_defaultInterfaceLanguage; if ($this->_getParam('setLang')) { $this->_currentInterfaceLanguage = Cible_FunctionsGeneral::getLanguageID($this->_getParam('setLang')); } // Registers the current interface language for future uses $this->_registry->set('languageID', $this->_currentInterfaceLanguage); $session->languageID = $this->_currentInterfaceLanguage; $suffix = Cible_FunctionsGeneral::getLanguageSuffix($this->_currentInterfaceLanguage); $this->_registry->set('languageSuffix', $suffix); // Defines the default edit language if ($this->_config->defaultEditLanguage) { $this->_currentEditLanguage = $this->_config->defaultEditLanguage; } else { $this->_currentEditLanguage = $this->_defaultEditLanguage; } $this->_currentEditLanguage = !empty($session->currentEditLanguage) ? $session->currentEditLanguage : $this->_currentEditLanguage; // Check if the current edit language should be different than the default one if ($this->_getParam('lang')) { $this->_currentEditLanguage = Cible_FunctionsGeneral::getLanguageID($this->_getParam('lang')); } // Registers the current edit language for future uses $this->_registry->set('currentEditLanguage', $this->_currentEditLanguage); $session->currentEditLanguage = $this->_currentEditLanguage; if (Cible_FunctionsGeneral::extranetLanguageIsAvailable($this->getCurrentInterfaceLanguage()) == 0) { $session = new Cible_Sessions(); $this->_currentInterfaceLanguage = $this->_config->defaultInterfaceLanguage; // Registers the current interface language for future uses $this->_registry->set('languageID', $this->_currentInterfaceLanguage); $session->languageID = $this->_currentInterfaceLanguage; $suffix = Cible_FunctionsGeneral::getLanguageSuffix($this->_currentInterfaceLanguage); $this->_registry->set('languageSuffix', $suffix); } $hasProfile = false; $hasVideos = true; $modProfile = Cible_FunctionsModules::modulesProfile(); if (count($modProfile) > 0) { $hasProfile = true; } $this->view->assign('hasProfile', $hasProfile); $this->view->assign('hasVideos', $hasVideos); }
/** * Set some properties to redirect and process actions. * * @access public * * @return void */ public function init() { parent::init(); // Sets the called action name. This will be dispatched to the method $this->_currentAction = $this->_getParam('action'); // The action (process) to do for the selected object $this->_actionKey = $this->_getParam('actionKey'); $this->_formatName(); $this->view->assign('cleaction', $this->_labelSuffix); $dataImagePath = "../../" . $this->_config->document_root . "/data/images/"; if (isset($this->_objectList[$this->_currentAction])) { $this->_imageFolder = $dataImagePath . $this->_moduleTitle . "/" . $this->_objectList[$this->_currentAction] . "/"; } if (isset($this->_objectList[$this->_currentAction])) { $this->_rootImgPath = Zend_Registry::get("www_root") . "/data/images/" . $this->_moduleTitle . "/" . $this->_objectList[$this->_currentAction] . "/"; } $modules = Cible_FunctionsModules::modulesFilters(); $this->_modules = $this->_getModulesFields($modules); $this->view->headScript()->appendFile($this->view->locateFile('reportsAction.js')); $this->view->headLink()->appendStylesheet($this->view->locateFile('reports.css')); }
/** * Set the module id. * * @return int */ public function setModuleId() { $this->_moduleID = Cible_FunctionsModules::getModuleIDByName($this->_request->getModuleName()); }
function moduleNameAction() { $module = $this->_getParam('name'); $this->disableView(); if (empty($module)) { return; } echo Cible_FunctionsModules::getLocalizedModuleTitle($module); }
protected function _modulesSrc(array $meta = array()) { $modules = Cible_FunctionsModules::getModules(); foreach ($modules as $data) { $this->_srcData[$data['M_ID']] = Cible_Translation::getCibleText($data['M_MVCModuleTitle'] . "_module_name"); } }
public function __construct($options = null) { parent::__construct($options); $this->setAttrib('class', 'form_block'); $baseDir = $options['baseDir']; $pageID = $options['pageID']; // contains the id of the page $id = new Zend_Form_Element_Hidden('id'); $id->removeDecorator('Label'); $id->removeDecorator('HtmlTag'); $this->addElement($id); if (isset($options['moduleName'])) { $this->setName($options['moduleName']); } // input text for the title of the text module $blockTitle = new Zend_Form_Element_Text('BI_BlockTitle'); $blockTitle->setLabel($this->getView()->getCibleText('form_label_title'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput'); $this->addElement($blockTitle); // select box for the position of the module $security = new Zend_Form_Element_Select('B_Secured'); $security->setLabel($this->getView()->getCibleText('manage_block_secured_status'))->setAttrib('class', 'stdSelect')->addMultiOption('0', $this->getView()->getCibleText('manage_block_secured_none'))->addMultiOption('1', $this->getView()->getCibleText('manage_block_secured_logged'))->addMultiOption('2', $this->getView()->getCibleText('manage_block_secured_notlog'))->setRegisterInArrayValidator(false); $this->addElement($security); // checkbox for determine if show block title in frontend $showBlockTitle = new Zend_Form_Element_Hidden('B_ShowHeader'); $showBlockTitle->removeDecorator('Label'); $showBlockTitle->setValue(0); $this->addElement($showBlockTitle); $_request = Zend_Controller_Front::getInstance()->getRequest(); $_action = $_request->getActionName(); if ($_action == 'add-block') { // select box for the zone of the module $zone = new Zend_Form_Element_Select('B_ZoneID'); $zone->setLabel($this->getView()->getCibleText('form_label_zone'))->setAttrib('class', 'largeSelect'); $this->addElement($zone); // select box for the position of the module $position = new Zend_Form_Element_Select('B_Position'); $position->setLabel($this->getView()->getCibleText('form_label_position'))->setAttrib('class', 'largeSelect')->setRegisterInArrayValidator(false); $this->addElement($position); } // submit button (save) $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel($this->getView()->getCibleText('button_add'))->setAttrib('id', 'submitSave')->setAttrib('class', 'stdButton')->removeDecorator('DtDdWrapper')->removeDecorator('Label'); $this->addElement($submit); // cancel button (don't save and return to the main page) $cancel = new Zend_Form_Element_Button('cancel'); $cancel->setLabel($this->getView()->getCibleText('button_cancel'))->setAttrib('class', 'stdButton')->setAttrib('onclick', "document.location.href='{$baseDir}/page/manage/index/ID/{$pageID}'")->removeDecorator('DtDdWrapper')->removeDecorator('Label'); $this->addElement($cancel); // create an action display group with element name previously added to the form $this->addDisplayGroup(array('submit', 'cancel'), 'actions'); // Set the decorators we want for the display group $this->setDisplayGroupDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'dd')))); $viewSelector = new Zend_Form_Element_Select('Param999'); $viewSelector->setLabel($this->getView()->getCibleText('form_select_label_associated_view'))->setAttrib('class', 'stdSelect')->setOrder(1); if ($this->_moduleName) { foreach (Cible_FunctionsModules::getAvailableViews($this->_moduleName) as $view) { $viewSelector->addMultiOption($view['MV_Name'], $this->getView()->getCibleText("form_select_option_view_{$this->_moduleName}_{$view['MV_Name']}")); } } if (count($viewSelector->options) == 0) { $viewSelector->addMultiOption('index', $this->getView()->getCibleText("form_select_option_view_default_index")); } $this->addElement($viewSelector); $this->addDisplayGroup(array('Param999'), 'parameters'); $parameters = $this->getDisplayGroup('parameters'); //$parameters->setLegend($this->_view->getCibleText('form_parameters_fieldset')); }
/** * Set some properties to redirect and process actions. * * @access public * * @return void */ public function init() { parent::init(); // Sets the called action name. This will be dispatched to the method $this->_currentAction = $this->_getParam('action'); // The action (process) to do for the selected object $this->_actionKey = $this->_getParam('actionKey'); $this->_formatName(); $this->view->assign('cleaction', $this->_labelSuffix); $dataImagePath = "../../" . $this->_config->document_root . "/data/images/"; if (isset($this->_objectList[$this->_currentAction])) { $this->_imageFolder = $dataImagePath . $this->_moduleTitle . "/" . $this->_objectList[$this->_currentAction] . "/"; } if (isset($this->_objectList[$this->_currentAction])) { $this->_rootImgPath = Zend_Registry::get("www_root") . "/data/images/" . $this->_moduleTitle . "/" . $this->_objectList[$this->_currentAction] . "/"; } // Set the default objects according to the modules list; $modulesProfiles = Cible_FunctionsModules::modulesProfile(); $this->view->profilesList = $modulesProfiles; foreach ($modulesProfiles as $id => $name) { $value = $name['M_MVCModuleTitle']; if (!in_array($value, $this->_objectList)) { switch ($value) { // case 'newsletter': // $this->_objectList[$value] = 'NewsletterProfilesObject'; // break; case 'order': $this->_objectList[$value] = 'MemberProfilesObject'; break; case 'retailers': $this->_objectList[$value] = 'RetailersObject'; break; // case 'member': // $this->_objectList[$value] = 'MemberProfilesObject'; //// $this->_joinTables[] = $this->_objectList[$value]; // break; // case 'parent': // $this->_objectList[$value] = 'ParentProfilesObject'; //// $this->_joinTables[] = $this->_objectList[$value]; // break; // case 'medical': // $this->_objectList[$value] = 'MedicalProfilesObject'; //// $this->_joinTables[] = $this->_objectList[$value]; // break; // case 'member': // $this->_objectList[$value] = 'MemberProfilesObject'; //// $this->_joinTables[] = $this->_objectList[$value]; // break; // case 'parent': // $this->_objectList[$value] = 'ParentProfilesObject'; //// $this->_joinTables[] = $this->_objectList[$value]; // break; // case 'medical': // $this->_objectList[$value] = 'MedicalProfilesObject'; //// $this->_joinTables[] = $this->_objectList[$value]; // break; default: $this->_objectList[$value] = ucfirst($value) . 'ProfilesObject'; break; } } $this->_objectList = array_unique($this->_objectList); } switch (Zend_Registry::get('languageID')) { case '1': $this->view->jQuery()->addJavascriptFile("{$this->view->baseUrl()}/js/jquery/localizations/ui.datepicker-fr.js"); break; case '2': $this->view->jQuery()->addJavascriptFile("{$this->view->baseUrl()}/js/jquery/localizations/ui.datepicker-en.js"); break; default: $this->view->jQuery()->addJavascriptFile("{$this->view->baseUrl()}/js/jquery/localizations/ui.datepicker-fr.js"); break; } $this->view->headScript()->appendFile($this->view->locateFile('jquery.validate.min.js', 'jquery')); $this->view->headScript()->appendFile($this->view->locateFile('additional-methods.min.js', 'jquery')); $this->view->headLink()->appendStylesheet($this->view->locateFile('profile.css')); }
public function editCategoriesAction() { if ($this->view->aclIsAllowed($this->view->current_module, 'edit')) { $id = $this->_getParam('ID'); $categoriesObject = new CategoriesObject(); $options = array('moduleID' => Cible_FunctionsModules::getModuleIDByName($this->view->current_module), 'cancelUrl' => "{$this->view->baseUrl()}/{$this->view->current_module}/index/list-categories/"); $form = new FormCategory($options); $this->view->assign('form', $form); if ($this->_request->isPost()) { $formData = $this->_request->getPost(); if ($form->isValid($formData)) { // save $categoriesObject->save($id, $formData, $this->_currentEditLanguage); $allViews = Cible_FunctionsCategories::getCategoryViews($this->_moduleID); $views = Cible_FunctionsCategories::getCategoryViews($this->_moduleID, $id); $reference_views = array(); foreach ($views as $view) { $reference_views[$view['MV_ID']] = $view; } $views = $reference_views; $this->view->dump($views); foreach ($allViews as $view) { $this->view->dump($view); $data = array('MCVP_ModuleID' => $this->_moduleID, 'MCVP_CategoryID' => $id, 'MCVP_ViewID' => $view['MV_ID'], 'MCVP_PageID' => $formData["{$view['MV_Name']}_pageID"]); if (!empty($formData["{$view['MV_Name']}_pageID"])) { if (isset($views[$view['MV_ID']]) && isset($views[$view['MV_ID']]['MCVP_ID'])) { $this->_db->update('ModuleCategoryViewPage', $data, "MCVP_ID = '{$views[$view['MV_ID']]['MCVP_ID']}'"); } else { $this->_db->insert('ModuleCategoryViewPage', $data); } } } $this->_redirect("{$this->view->current_module}/index/list-categories/"); } else { $formData = $this->_request->getPost(); $form->populate($formData); } } else { $data = $categoriesObject->populate($id, $this->_currentEditLanguage); $views = Cible_FunctionsCategories::getCategoryViews($this->_moduleID, $id); if ($views) { foreach ($views as $view) { if (!empty($view['MCVP_PageID'])) { $data["{$view['MV_Name']}_pageID"] = $view['MCVP_PageID']; $data["{$view['MV_Name']}_controllerName"] = $view['PI_PageIndex']; } } } $form->populate($data); } } }
public function categoriesToExcelAction() { if ($this->view->aclIsAllowed($this->view->current_module, 'edit')) { $this->filename = 'Categories.xlsx'; $this->tables = array('Categories' => array('C_ID'), 'CategoriesIndex' => array('CI_Title', 'CI_WordingShowAllRecords')); $this->fields = array('CI_Title' => array('label' => $this->view->getCibleText("list_column_{$this->_moduleID}_CI_Title")), 'CI_WordingShowAllRecords' => array()); $this->filters = array(); $this->select = $this->_db->select()->from('Categories', $this->tables['Categories'])->joinInner('CategoriesIndex', 'Categories.C_ID = CategoriesIndex.CI_CategoryID', $this->tables['CategoriesIndex'])->where('Categories.C_ModuleID = ?', Cible_FunctionsModules::getModuleIDByName($this->view->current_module))->where('CategoriesIndex.CI_LanguageID = ?', $this->_currentInterfaceLanguage); parent::toExcelAction(); } }