Exemplo n.º 1
0
 /**
  *
  * @return BOL_Language
  */
 public function getCurrent()
 {
     if ($this->currentLanguage === null) {
         $this->currentLanguage = $this->languageDao->getCurrent();
     }
     return $this->currentLanguage;
 }
Exemplo n.º 2
0
 /**
  * Returns class instance
  *
  * @return BOL_LanguageDao
  */
 public static function getInstance()
 {
     if (!isset(self::$classInstance)) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Exemplo n.º 3
0
 private function __construct($includeCache = true)
 {
     $this->languageDao = BOL_LanguageDao::getInstance();
     $this->prefixDao = BOL_LanguagePrefixDao::getInstance();
     $this->keyDao = BOL_LanguageKeyDao::getInstance();
     $this->valueDao = BOL_LanguageValueDao::getInstance();
     $this->languageCacheDir = OW::getPluginManager()->getPlugin('base')->getPluginFilesDir();
     if ($includeCache) {
         $this->loadFromCahce();
     }
 }
Exemplo n.º 4
0
 public function ajaxOrder()
 {
     $languageService = BOL_LanguageService::getInstance();
     $inactiveOrder = 1;
     if (!empty($_POST['active']) && is_array($_POST['active'])) {
         foreach ($_POST['active'] as $index => $id) {
             $dto = $languageService->findById($id);
             /* @var $dto BOL_Language */
             if (!empty($dto)) {
                 $dto->setStatus('active');
                 $dto->setOrder($index + 1);
                 $languageService->save($dto);
                 $inactiveOrder++;
             }
         }
     }
     if (!empty($_POST['inactive']) && is_array($_POST['inactive'])) {
         foreach ($_POST['inactive'] as $index => $id) {
             $dto = $languageService->findById($id);
             $dto->setStatus('inactive');
             $dto->setOrder($index + $inactiveOrder);
             $languageService->save($dto);
         }
     }
     unset($_COOKIE[BOL_LanguageService::LANG_ID_VAR_NAME]);
     OW::getSession()->delete(BOL_LanguageService::LANG_ID_VAR_NAME);
     $this->service->setCurrentLanguage(BOL_LanguageDao::getInstance()->getCurrent());
     exit;
 }