Beispiel #1
0
 public static function addModule($module_name)
 {
     $current_language = Core_Model_Language::getCurrentLanguage();
     if (file_exists(Core_Model_Directory::getBasePathTo("/languages/{$current_language}/{$module_name}.csv"))) {
         self::$_translator->addTranslation(array('content' => Core_Model_Directory::getBasePathTo("/languages/{$current_language}/{$module_name}.csv"), 'locale' => $current_language));
     }
     if (file_exists(Core_Model_Directory::getBasePathTo("/languages/{$current_language}/emails/{$module_name}.csv"))) {
         self::$_translator->addTranslation(array('content' => Core_Model_Directory::getBasePathTo("/languages/{$current_language}/emails/{$module_name}.csv"), 'locale' => $current_language));
     }
 }
 public function findallAction()
 {
     $data = array();
     if (Core_Model_Language::getCurrentLanguage() != Core_Model_Language::DEFAULT_LANGUAGE) {
         Core_Model_Translator::addModule("mcommerce");
         Core_Model_Translator::addModule("comment");
         $translations = array("OK", "Website", "Phone", "Locate", "Contact successfully added to your address book", "Unable to add the contact to your address book", "You must give the permission to the app to add a contact to your address book", "You already have this user in your contact", "The address you're looking for does not exists.", "An error occurred while loading. Please, try again later.", "An unexpected error occurred while calculating the route.", "Cart", "Proceed", "Next", "Payment", "Delivery", "My information", "Review", "Some mandatory fields are empty.", "Validate", "The payment has been cancelled, something wrong happened? Feel free to contact us.", "Map", "Invalid place", "Unable to calculate the route.", "No address to display on map.", "You must share your location to access this page.", "No place to display on map.", "An error occurred while loading places.", "Load More", "This section is unlocked for mobile users only", "You have gone offline", "Cancel", "Confirm", "View", "Offline content", "Don't close the app while downloading. This may take a while.", "Do you want to download all the contents now to access it when offline? If you do, we recommend you to use a WiFi connection.");
         foreach ($translations as $translation) {
             $data[$translation] = $this->_($translation);
         }
     }
     $this->_sendHtml($data);
 }
 public function findAction()
 {
     $previews = new Preview_Model_Preview();
     $data = array();
     if ($this->getRequest()->getParam("preview_id")) {
         $previews = $previews->findAll(array("aop.preview_id" => $this->getRequest()->getParam("preview_id")));
         $data_tmp = array();
         foreach ($previews as $preview) {
             if ($preview->getlibraryId()) {
                 $images = $preview->findImages();
                 $images_data = array();
                 foreach ($images as $image) {
                     $images_data[] = array("id" => $image->getImageId(), "link" => $image->getlink(), "new" => 0, "to_delete" => 0);
                 }
             }
             if ($preview->getPreviewId()) {
                 $data_tmp[$preview->getLanguageCode()] = array("title" => $preview->getTitle(), "description" => $preview->getDescription(), "language_code" => $preview->getLanguageCode(), "from_database" => 1, "images" => $images_data);
             }
         }
         if (!empty($data_tmp)) {
             $data["previews"] = $data_tmp;
         }
         $data["section_title_one"] = $this->_("Edit the preview");
     } else {
         $data["section_title_one"] = $this->_("Create a new preview");
         $option = new Application_Model_Option();
         $option_list = array();
         $options = $option->findAll(array(), 'position ASC');
         foreach ($options as $option) {
             $option_list[$option->getId()] = $option->getName();
         }
         $data["options"] = $option_list;
     }
     $data["section_title_two"] = $this->_("Preview images");
     $languages = Core_Model_Language::getLanguages();
     $language_list = array();
     foreach ($languages as $language) {
         $language_list[$language->getCode()] = $language->getName();
     }
     $data["languages"] = $language_list;
     $data["current_language"] = Core_Model_Language::getCurrentLanguage();
     $this->_sendHtml($data);
 }
Beispiel #4
0
 public function getPreview()
 {
     if (!$this->_preview) {
         $preview = new Preview_Model_Preview();
         $language = Core_Model_Language::getCurrentLanguage();
         $this->_preview = $preview->find(array("aop.option_id" => $this->getId(), "aopl.language_code" => $language));
     }
     return $this->_preview;
 }
Beispiel #5
0
 protected function _initDesign()
 {
     if (!$this->_request->isInstalling()) {
         $request = $this->_request;
         $this->_prepareBlocks();
     }
     $locale = Zend_Registry::get('Zend_Locale');
     $lang = Core_Model_Language::getCurrentLanguage();
     $detect = new Mobile_Detect();
     $this->getPluginLoader()->addPrefixPath('Siberian_Application_Resource', 'Siberian/Application/Resource');
     if (!$this->_request->isInstalling()) {
         if ($this->_request->isApplication()) {
             $apptype = 'mobile';
         } else {
             $apptype = 'desktop';
         }
         if ($detect->isMobile() || $apptype == 'mobile') {
             $device_type = 'mobile';
         } else {
             $device_type = 'desktop';
         }
         $code = 'siberian';
     } else {
         $apptype = 'desktop';
         $device_type = 'desktop';
         $code = "installer";
     }
     $base_paths = array(APPLICATION_PATH . "/design/email/template/");
     define('APPLICATION_TYPE', $apptype);
     define('DEVICE_TYPE', $device_type);
     define('DEVICE_IS_IPHONE', $detect->isIphone() || $detect->isIpad());
     define('IS_APPLICATION', $detect->isApplication() && $this->_request->isApplication());
     Core_Model_Directory::setDesignPath("/app/design/{$apptype}/{$code}");
     define('DESIGN_CODE', $code);
     $resources = array('resources' => array('layout' => array('layoutPath' => APPLICATION_PATH . "/design/{$apptype}/{$code}/template/page")));
     $base_paths[] = APPLICATION_PATH . "/design/{$apptype}/{$code}/template/";
     $this->setOptions($resources);
     $this->bootstrap('View');
     $view = $this->getResource('View');
     $view->doctype('HTML5');
     foreach ($base_paths as $base_path) {
         $view->addBasePath($base_path);
     }
     Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNeverRender(true);
     Core_View_Default::setDevice($detect);
 }
Beispiel #6
0
 public function getCacheId()
 {
     return 'SOCIAL_FACEBOOK_' . Core_Model_Language::getCurrentLanguage() . sha1($this->getFbUser() . "-" . $this->_page);
 }
Beispiel #7
0
 public function getCacheId()
 {
     return 'AGENDA_OVI_' . sha1($this->getValueId() . Core_Model_Language::getCurrentLanguage());
 }