Exemplo n.º 1
0
 public function langs()
 {
     $settingsArray = array();
     $languages = languages::get();
     foreach ($languages as $language) {
         $settingsArray['languages'][$language->id] = $language->languageTitle;
     }
     return $settingsArray;
 }
 public function langs()
 {
     $settingsArray = array();
     $languages = languages::get();
     foreach ($languages as $language) {
         $settingsArray['languages'][$language->id] = $language->languageTitle;
     }
     $settingsArray['languageAllow'] = $this->panelInit->settingsArray['languageAllow'];
     $settingsArray['layoutColorUserChange'] = $this->panelInit->settingsArray['layoutColorUserChange'];
     return $settingsArray;
 }
Exemplo n.º 3
0
 static function getPageUrlById($page_id, $recursi = false)
 {
     if ($page = ormPages::get($page_id)) {
         if ($lang = languages::get($page->lang_id)) {
             if (!$recursi && $page->is_home_page) {
                 return $lang->pre() . '/';
             }
             $url = !$recursi ? $lang->pre() : '';
         } else {
             $url = '';
         }
         if (isset(self::$pages_rel[$page_id])) {
             $url .= self::getPageUrlById(self::$pages_rel[$page_id], true);
             if (isset($pages[$page_id]['pseudo_url'])) {
                 return $url . '/' . self::$pages[$page_id]['pseudo_url'];
             } else {
                 return $url . '/' . self::get($page_id)->pseudo_url;
             }
         } else {
             if ($page->issetParents()) {
                 $url .= self::getPageUrlById($page->getParentId(), true);
             }
             return $url . '/' . $page->pseudo_url;
         }
     }
 }
Exemplo n.º 4
0
 public function listAll()
 {
     return languages::get();
 }
Exemplo n.º 5
0
 public function proc()
 {
     reg::setKey('/core/gzip', system::POST('gzip', isBool));
     reg::setKey('/core/delToTrash', system::POST('delToTrash', isBool));
     reg::setKey('/core/scaleBigJpeg', system::POST('scaleBigJpeg', isBool));
     reg::setKey('/core/sizeBigJpeg', system::POST('sizeBigJpeg', isInt));
     reg::setKey('/core/noIE6', system::POST('noIE6', isBool));
     reg::setKey('/core/noIE7', system::POST('noIE7', isBool));
     reg::setKey('/core/noIE8', system::POST('noIE8', isBool));
     reg::setKey('/core/noDelMiniTexts', system::POST('noDelMiniTexts', isBool));
     // Загрузка ватермарка
     if (isset($_FILES['file_watermark']) && !empty($_FILES['file_watermark']['name'])) {
         if (system::fileExtIs($_FILES['file_watermark']['name'], array('png'))) {
             $watermark = system::copyFile($_FILES['file_watermark']['tmp_name'], $_FILES['file_watermark']['name'], '/upload/image');
         } else {
             ui::MessageBox(lang::get('CONFIG_SAVE_ERROR'), lang::get('CONFIG_WATERMARK_ERROR'));
         }
     }
     if (!isset($watermark) && isset($_POST['watermark'])) {
         if (system::fileExtIs($_POST['watermark'], array('png')) || empty($_POST['watermark'])) {
             $watermark = system::checkVar($_POST['watermark'], isString);
         } else {
             ui::MessageBox(lang::get('CONFIG_SAVE_ERROR'), lang::get('CONFIG_WATERMARK_ERROR') . '123');
         }
     }
     if (isset($watermark) && $watermark != reg::getKey('/core/watermark')) {
         reg::setKey('/core/watermark', $watermark);
         $this->deleteCacheWatermark($watermark);
     }
     // ******************	Сохранение доменов 	***************************
     function changeDomain($id, $data)
     {
         $online = isset($data['d_online']) ? $data['d_online'] : 0;
         $isAdd = empty($id) ? true : false;
         $obj = new domain($id);
         $obj->setName($data['d_name']);
         $obj->setOnline($online);
         $obj->setDefLang($data['d_def_lang']);
         $obj->setEmail($data['d_email']);
         $obj->setSiteName($data['d_sitename']);
         $id = $obj->save();
         if ($id === false) {
             ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), $obj->getErrorListText());
         } else {
             if ($isAdd) {
                 ui::MessageBox(lang::get('CONFIG_DOMAIN_ADD'), lang::get('CONFIG_DOMAIN_TEXT'));
             }
         }
         return true;
     }
     function delDomain($id)
     {
         $obj = new domain($id);
         if ($obj->delete() === false) {
             ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), $obj->getErrorListText());
         }
     }
     $form = new uiMultiForm('domains');
     $form->process('changeDomain', 'delDomain');
     // ******************	Сохранение языков 	***************************
     function changeLang($id, $data)
     {
         $isAdd = empty($id) ? true : false;
         $obj = new language($id);
         $obj->setName($data['l_name']);
         $obj->setPrefix($data['l_prefix']);
         $id = $obj->save();
         if ($id === false) {
             ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), $obj->getErrorListText());
         } else {
             if ($isAdd) {
                 ui::MessageBox(lang::get('CONFIG_LANG_ADD'), lang::get('CONFIG_LANG_TEXT'));
             }
         }
         return true;
     }
     function delLang($id)
     {
         $obj = new language($id);
         if ($obj->delete() === false) {
             ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), $obj->getErrorListText());
         }
     }
     $form = new uiMultiForm('langs');
     $form->process('changeLang', 'delLang');
     // Если в системе только один язык, сохраняем его данные в реестр для быстрой подгрузки
     if (count(languages::getAll(true)) == 1) {
         reg::setKey('/core/cur_lang/id', languages::get(1, true)->id());
         reg::setKey('/core/cur_lang/prefix', languages::get(1, true)->getPrefix());
         reg::setKey('/core/cur_lang/name', languages::get(1, true)->getName());
     } else {
         reg::delKey('/core/cur_lang');
     }
     // Если в системе только один домен, сохраняем его данные в реестр для быстрой подгрузки
     if (count(domains::getAll(true)) == 1) {
         reg::setKey('/core/cur_domain/id', domains::get(1, true)->id());
         reg::setKey('/core/cur_domain/name', domains::get(1, true)->getName());
         reg::setKey('/core/cur_domain/def_lang', domains::get(1, true)->getDefLang());
         reg::setKey('/core/cur_domain/sitename', domains::get(1, true)->getSiteName());
         reg::setKey('/core/cur_domain/email', domains::get(1, true)->getEmail());
         reg::setKey('/core/cur_domain/online', domains::get(1, true)->online());
         reg::setKey('/core/cur_domain/offline_msg', domains::get(1, true)->getOfflineMsg());
         reg::setKey('/core/cur_domain/error_msg', domains::get(1, true)->getErrorMsg());
     } else {
         reg::delKey('/core/cur_domain');
     }
     ui::MessageBox(lang::get('CONFIG_SAVE_OK'), lang::get('CONFIG_SAVE_OK_MSG'));
     reg::clearCache();
     system::log(lang::get('CONFIG_LOG_SAVE'), warning);
     system::redirect('/core/change');
 }