public function actionIndex() { $this->checkCookieEnabled(); $this->htmlPageId = 'index'; $page = Menu::model()->findByPk(InfoPages::MAIN_PAGE_ID); if (issetModule('seo')) { $seo = SeoFriendlyUrl::model()->findByAttributes(array('model_name' => 'InfoPages', 'model_id' => InfoPages::MAIN_PAGE_ID)); if ($seo) { $this->setSeo($seo); } } $langs = Lang::getActiveLangs(); $countLangs = count($langs); if (!isFree() && !isset($_GET['lang']) && ($countLangs > 1 || $countLangs == 1 && param('useLangPrefixIfOneLang'))) { $canonicalUrl = Yii::app()->getBaseUrl(true); $canonicalUrl .= '/' . Yii::app()->language; Yii::app()->clientScript->registerLinkTag('canonical', null, $canonicalUrl); } Yii::app()->user->setState('searchUrl', NULL); $lastNews = News::getLastNews(); if (Yii::app()->request->isAjaxRequest) { // $modeListShow = User::getModeListShow(); // if ($modeListShow == 'table') { // # нужны скрипты и стили, поэтому processOutput установлен в true только для table // $this->renderPartial('index', array('page' => $page, 'newsIndex' => $lastNews), false, true); // } // else { $this->renderPartial('index', array('page' => $page, 'newsIndex' => $lastNews)); // } } else { $this->render('index', array('page' => $page, 'newsIndex' => $lastNews)); } }
public function actionIndex() { $page = Menu::model()->findByPk(InfoPages::MAIN_PAGE_ID); $langs = Lang::getActiveLangs(); $countLangs = count($langs); if (!isFree() && !isset($_GET['lang']) && ($countLangs > 1 || $countLangs == 1 && param('useLangPrefixIfOneLang'))) { $canonicalUrl = Yii::app()->getBaseUrl(true); $canonicalUrl .= '/' . Yii::app()->language; Yii::app()->clientScript->registerLinkTag('canonical', null, $canonicalUrl); } Yii::app()->user->setState('searchUrl', NULL); $criteriaNews = new CDbCriteria(); $criteriaNews->limit = 10; $criteriaNews->order = 'date_created DESC'; $newsIndex = News::model()->findAll($criteriaNews); if (isset($_GET['is_ajax'])) { // $modeListShow = User::getModeListShow(); // if ($modeListShow == 'table') { // # нужны скрипты и стили, поэтому processOutput установлен в true только для table // $this->renderPartial('index', array('page' => $page, 'newsIndex' => $newsIndex), false, true); // } // else { $this->renderPartial('index', array('page' => $page, 'newsIndex' => $newsIndex)); // } } else { $this->render('index', array('page' => $page, 'newsIndex' => $newsIndex)); } }
public function attributeLabels() { if (isFree()) { $lang = tFile::getT('module_install', 'Site language'); } else { $lang = tFile::getT('module_install', 'Preferred site language'); } return array('agreeLicense' => tFile::getT('module_install', 'I agree with') . ' ' . CHtml::link(tFile::getT('module_install', 'License agreement'), '#', array('onclick' => '$("#licensewidget").dialog("open"); return false;')) . ($this->language == 'de' ? ' zu' : ''), 'dbHost' => tFile::getT('module_install', 'Database server'), 'dbPort' => tFile::getT('module_install', 'Database port'), 'dbUser' => tFile::getT('module_install', 'Database user name'), 'dbPass' => tFile::getT('module_install', 'Database user password'), 'dbName' => tFile::getT('module_install', 'Database name'), 'dbPrefix' => tFile::getT('module_install', 'Prefix for tables'), 'adminName' => tFile::getT('module_install', 'Administrator name'), 'adminPass' => tFile::getT('module_install', 'Administrator password'), 'adminEmail' => tFile::getT('module_install', 'Administrator email'), 'language' => $lang, 'siteName' => tFile::getT('module_install', 'siteName'), 'siteKeywords' => tFile::getT('module_install', 'siteKeywords'), 'siteDescription' => tFile::getT('module_install', 'siteDescription')); }
public function createUrl($route, $params = array(), $ampersand = '&') { if ($route != 'min/serve' && $route != 'site/uploadimage') { $langs = Lang::getActiveLangs(); $countLangs = count($langs); if (!isFree() && empty($params['lang']) && ($countLangs > 1 || $countLangs == 1 && param('useLangPrefixIfOneLang'))) { $params['lang'] = Yii::app()->language; } } return parent::createUrl($route, $params, $ampersand); }
public function init() { $this->app = Yii::app(); $this->showSearchForm = false; $this->defaultLang = Yii::app()->language; $this->activeLangs = array($this->defaultLang => $this->defaultLang); if (!isFree()) { $this->defaultLang = Lang::getDefaultLang(); $this->activeLangs = Lang::getActiveLangs(); } parent::init(); }
public function getI18nFieldSafe() { $i18nFields = array_keys($this->i18nFields()); if (isFree()) { $activeLangs = array(Yii::app()->language); } else { $activeLangs = Lang::getActiveLangs(); } $i18nSafeArr = array(); foreach ($activeLangs as $lang) { foreach ($i18nFields as $field) { $i18nSafeArr[] = $field . '_' . $lang; } } return implode(', ', $i18nSafeArr); }
public function init() { # php.ini - date.timezone $this->generationDate = date('c', time()); # если нет модуля "Страна->регион->город" задаём строго $this->country = 'Россия'; $this->region = 'Москва и московская область'; # валюта $this->currency = 'RUR'; # param('siteCurrency', 'RUR'); if (!isFree()) { $activeCurrencyId = Currency::getDefaultValuteId(); $activeCurrency = Currency::model()->findByPk($activeCurrencyId); $this->currency = $activeCurrency && isset($activeCurrency->char_code) ? $activeCurrency->char_code : $this->currency; } }
function setLang($lang = null) { if (isFree()) { return; } $app = Yii::app(); $lang = $lang ? $lang : Lang::getDefaultLang(); $app->setLanguage($lang); $activeLangs = Lang::getActiveLangs(); if (isset($_GET['lang'])) { $tmplang = $_GET['lang']; //deb($tmplang); if (isset($activeLangs[$tmplang])) { $lang = $tmplang; $app->setLanguage($lang); } setLangCookie($lang); /* * другой код, например обновление кеша некоторых компонентов, которые изменяются при смене языка */ } else { $user = $app->user; if ($user->hasState('_lang')) { $tmplang = $user->getState('_lang'); if (isset($activeLangs[$tmplang])) { $lang = $tmplang; $app->setLanguage($lang); } else { setLangCookie($lang); } } else { if (isset($app->request->cookies['_lang'])) { $tmplang = $app->request->cookies['_lang']->value; if (isset($activeLangs[$tmplang])) { $lang = $tmplang; $app->setLanguage($lang); } else { setLangCookie($lang); } } } } Lang::getActiveLangs(false, true); }
public static function getLangForMap() { # язык в RFC 3066 switch (Yii::app()->language) { case 'ru': $langCode = 'ru-RU'; break; case 'uk': $langCode = 'uk-UA'; break; case 'tr': $langCode = 'tr-TR'; break; default: $langCode = 'en-US'; } if (issetModule('lang') && !isFree()) { $langInfo = Lang::model()->find('name_iso = :name_iso', array('name_iso' => Yii::app()->language)); if ($langInfo && isset($langInfo->name_rfc3066)) { $langCode = $langInfo->name_rfc3066; } } return $langCode; }
<?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'licensewidget', 'cssFile' => 'jquery-ui-1.8.16.custom.css', 'theme' => 'redmond', 'themeUrl' => Yii::app()->theme->baseUrl . '/css/ui', 'options' => array('title' => tFile::getT('module_install', 'License_agreement_s'), 'autoOpen' => $this->autoOpen ? true : false, 'modal' => 'true', 'show' => 'puff', 'hide' => 'slide', 'width' => '920px', 'height' => 'auto', 'resizable' => false, 'buttons' => array(tFile::getT('module_install', 'Accept') => 'js:function() { $("#InstallForm_agreeLicense").attr("checked", "checked"); $(this).dialog("close"); }')))); ?> <h2><?php echo tFile::getT('module_install', 'License_agreement_s'); ?> </h2> <?php if (isFree()) { echo tFile::getT('module_install', 'freeLicenseText'); } else { echo tFile::getT('module_install', 'licenseText'); } $this->endWidget('zii.widgets.jui.CJuiDialog');
function init() { if (!oreInstall::isInstalled() && !(Yii::app()->controller->module && Yii::app()->controller->module->id == 'install')) { $this->redirect(array('/install')); } setLang(); $modulesToCheck = ConfigurationModel::getModulesList(); foreach ($modulesToCheck as $module) { if (param('module_enabled_' . $module) === null) { ConfigurationModel::createValue('module_enabled_' . $module, 0); Yii::app()->params['module_enabled_' . $module] = 0; } } unset($modulesToCheck); $this->assetsGenPath = Yii::getPathOfAlias('webroot.assets'); $this->assetsGenUrl = Yii::app()->getBaseUrl(true) . '/assets/'; Yii::app()->user->setState('menu_active', ''); if (isFree()) { $this->pageTitle = param('siteTitle'); $this->pageKeywords = param('siteKeywords'); $this->pageDescription = param('siteDescription'); } else { if (issetModule('seo')) { $this->pageTitle = Seo::getSeoValue('siteName'); $this->pageKeywords = Seo::getSeoValue('siteKeywords'); $this->pageDescription = Seo::getSeoValue('siteDescription'); } else { $this->pageTitle = tt('siteName', 'seo'); $this->pageKeywords = tt('siteKeywords', 'seo'); $this->pageDescription = tt('siteDescription', 'seo'); } } Yii::app()->name = $this->pageTitle; if (Yii::app()->getModule('menumanager')) { if (!(Yii::app()->controller->module && Yii::app()->controller->module->id == 'install')) { $this->infoPages = Menu::getMenuItems(0); } } if (!Yii::app()->user->isGuest && !Yii::app()->user->getState('isAdmin')) { $subItems = HUser::getMenu(); } else { $subItems = array(); } $urlAddAd = Yii::app()->user->isGuest && issetModule('guestad') ? array('/guestad/main/create') : array('/userads/main/create'); $this->aData['userCpanelItems'] = array(array('label' => tt('Add ad', 'common'), 'url' => $urlAddAd, 'visible' => Yii::app()->user->isGuest == false), array('label' => '|', 'visible' => param('useUserads', 0) == 1), array('label' => tt('Special offers', 'common'), 'url' => array('/specialoffers/main/index')), array('label' => tt('Search for listings on the map', 'common'), 'url' => array('/page/2')), array('label' => tt('Contact us', 'common'), 'url' => array('/contactform/main/index')), array('label' => '|', 'visible' => Yii::app()->user->getState('isAdmin') === null), array('label' => tt('Reserve apartment', 'common'), 'url' => array('/booking/main/mainform'), 'visible' => Yii::app()->user->getState('isAdmin') === null, 'linkOptions' => array('class' => 'fancy')), array('label' => '|', 'visible' => Yii::app()->user->getState('isAdmin') === null), array('label' => Yii::t('common', 'Control panel'), 'url' => array('/usercpanel/main/index'), 'visible' => Yii::app()->user->getState('isAdmin') === null, 'items' => $subItems, 'submenuOptions' => array('class' => 'sub_menu_dropdown'))); if (!Yii::app()->user->isGuest) { $user = HUser::getModel(); $this->aData['userCpanelItems'][] = array('label' => '|'); $this->aData['userCpanelItems'][] = array('label' => '(' . $user->username . ') ' . tt('Logout', 'common'), 'url' => array('/site/logout')); } $this->aData['topMenuItems'] = $this->infoPages; // comparison list if (issetModule('comparisonList')) { if (!Yii::app()->user->isGuest) { $resultCompare = ComparisonList::model()->findAllByAttributes(array('user_id' => Yii::app()->user->id)); } else { $resultCompare = ComparisonList::model()->findAllByAttributes(array('session_id' => Yii::app()->session->sessionId)); } if ($resultCompare) { foreach ($resultCompare as $item) { $this->apInComparison[] = $item->apartment_id; } } } parent::init(); }
/* If you want to use a MySQL-Database: Comment out 'include "file.php"' and uncomment 'include "database.php"' If you want to use a txt-File: Comment out 'include "database.php"'and uncomment 'include "file.php"' Do not forget to edit the configuration in 'file.php' or 'database.php'. */ #include "file.php"; include "database.php"; function generateRandomString($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; } $filehash = $_GET["f"]; if (empty($filehash)) { die("File hash is not given!"); } do { $publickey = generateRandomString(10); } while (!isFree($publickey)); do { $privatekey = generateRandomString(20); } while (!isFree($privatekey)); $timestamp = time(); save($timestamp, $publickey, $privatekey, $filehash); echo "public key: " . $publickey . "<br>" . "private key: " . $privatekey . "<br>" . "timestamp: " . $timestamp;
public function createUrl($route, $params = array(), $ampersand = '&') { if ($route != 'min/serve' && $route != 'site/uploadimage') { $langs = Lang::getActiveLangs(); $countLangs = count($langs); $defaultLang = Lang::getDefaultLang(); if (isset($params['lang']) && $params['lang'] == $defaultLang && $this->isInstalled) { if (!param('useBootstrap')) { unset($params['lang']); } } else { if (Yii::app()->language != $defaultLang && !isFree() && empty($params['lang']) && $countLangs > 1) { $params['lang'] = Yii::app()->language; } } if (!$this->isInstalled && $countLangs == 1 && $route != 'install') { $params['lang'] = Yii::app()->language; } if (!$this->isInstalled && $countLangs > 1 && !isset($params['lang']) && $route != 'install') { $params['lang'] = Yii::app()->language; } } return parent::createUrl($route, $params, $ampersand); }
" href="<?php echo Yii::app()->request->baseUrl; ?> /"> <img width="259" height="50" alt="<?php echo tFile::getT('module_install', 'Open Real Estate'); ?> " src="<?php echo Yii::app()->theme->baseUrl; ?> /images/pages/logo-open-ore.png" id="logo" /> </a> </div> <?php if (!isFree() && Yii::app()->controller->action->id != 'index') { $this->widget('application.modules.lang.components.langSelectorWidget', array('type' => 'links', 'languages' => array('en' => array('name_iso' => 'en', 'name' => 'English', 'flag_img' => 'us.png'), 'ru' => array('name_iso' => 'ru', 'name' => 'Русский', 'flag_img' => 'ru.png'), 'de' => array('name_iso' => 'de', 'name' => 'Deutsch', 'flag_img' => 'de.png')))); } ?> <div class="content"> <?php echo $content; ?> <div class="clear"></div> </div> <div class="footer"> <p class="slogan">© <?php echo tFile::getT('module_install', 'Open Real Estate') . ', ' . date('Y'); ?> </p>
/** * This method is invoked after the specified view is rendered by calling {@link render()}. * Note that this method is invoked BEFORE {@link processOutput()}. * You may override this method to do some postprocessing for the view rendering. * @param string $view the view that has been rendered * @param string $output the rendering result of the view. Note that this parameter is passed * as a reference. That means you can modify it within this method. * @since 1.1.5 */ protected function afterRender($view, &$output) { if (isFree()) { $url = 'http://monoray.net/products/6-open-real-estate'; $text = 'Powered by'; if (Yii::app()->language == 'ru' || Yii::app()->language == 'uk') { $url = 'http://monoray.ru/products/6-open-real-estate'; $text = 'Работает на'; } preg_match_all('#<p class="slogan">(.*)</p>#isU', $output, $matches); if (isset($matches[1][0]) && !empty($matches[1][0])) { $insert = '<p style="text-align: center; margin: 0; padding: 0;">' . $text . ' <a href="' . $url . '" target="_blank">Open Real Estate</a></p>'; $output = str_replace($matches[0][0], $matches[0][0] . $insert, $output); } else { $insert = '<div class="footer"><p style="text-align: center; margin: 0; padding: 0;">' . $text . ' <a href="' . $url . '" target="_blank">Open Real Estate</a></p></p></div>'; $output = str_replace('<div id="loading"', $insert . '<div id="loading"', $output); } unset($url); unset($text); unset($matches); unset($insert); } }
$bageBooking = $countNewPending > 0 ? " <span class=\"badge\">{$countNewPending}</span>" : ''; } $bageMessages = ''; if (issetModule('messages')) { $countMessagesUnread = Messages::getCountUnread(Yii::app()->user->id); $bageMessages = $countMessagesUnread > 0 ? " <span class=\"badge\">{$countMessagesUnread}</span>" : ''; } ?> <div class="bootnavbar-delimiter"></div> <div class="container-fluid"> <div class="row-fluid"> <div class="span3"> <div class="well sidebar-nav"> <?php $this->widget('bootstrap.widgets.TbMenu', array('type' => 'list', 'encodeLabel' => false, 'items' => array(array('label' => tc('Listings'), 'visible' => Yii::app()->user->checkAccess('apartments_admin') || Yii::app()->user->checkAccess('comments_admin') || Yii::app()->user->checkAccess('apartmentsComplain_admin')), array('label' => tc('Listings') . $bageListings, 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/apartments/backend/main/admin', 'active' => isActive('apartments'), 'visible' => Yii::app()->user->checkAccess('apartments_admin')), array('label' => tc('List your property'), 'icon' => 'icon-plus-sign', 'url' => $baseUrl . '/apartments/backend/main/create', 'active' => isActive('apartments.create'), 'visible' => Yii::app()->user->checkAccess('apartments_admin')), array('label' => tc('Comments') . $bageComments, 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/comments/backend/main/admin', 'active' => isActive('comments'), 'visible' => Yii::app()->user->checkAccess('comments_admin')), array('label' => tc('Complains') . $bageComplain, 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/apartmentsComplain/backend/main/admin', 'active' => isActive('apartmentsComplain'), 'visible' => issetModule('apartmentsComplain') && Yii::app()->user->checkAccess('apartmentsComplain_admin')), array('label' => tt('Booking apartment', 'booking') . $bageBooking, 'icon' => 'icon-file', 'url' => $baseUrl . '/bookingtable/backend/main/admin', 'active' => isActive('bookingtable'), 'visible' => issetModule('bookingtable') && Yii::app()->user->checkAccess('bookingtable_admin')), array('label' => tc('Users'), 'visible' => Yii::app()->user->checkAccess('users_admin')), array('label' => tc('Users'), 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/users/backend/main/admin', 'active' => isActive('users'), 'visible' => Yii::app()->user->checkAccess('users_admin')), array('label' => tt('Reviews', 'reviews'), 'visible' => Yii::app()->user->checkAccess('reviews_admin')), array('label' => tt('Reviews_management', 'reviews') . $bageReviews, 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/reviews/backend/main/admin', 'active' => isActive('reviews'), 'visible' => Yii::app()->user->checkAccess('reviews_admin')), array('label' => tt('Add_feedback', 'reviews'), 'icon' => 'icon-plus-sign', 'url' => $baseUrl . '/reviews/backend/main/create', 'active' => isActive('reviews.create'), 'visible' => Yii::app()->user->checkAccess('reviews_admin')), array('label' => tt('Vacancy', 'vacancy'), 'visible' => Yii::app()->user->checkAccess('vacancy_admin')), array('label' => tt('Vacancy_management', 'vacancy') . $bageVacancy, 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/vacancy/backend/main/admin', 'active' => isActive('vacancy'), 'visible' => Yii::app()->user->checkAccess('vacancy_admin')), array('label' => tt('Add_feedback', 'vacancy'), 'icon' => 'icon-plus-sign', 'url' => $baseUrl . '/vacancy/backend/main/create', 'active' => isActive('vacancy.create'), 'visible' => Yii::app()->user->checkAccess('vacancy_admin')), array('label' => tt('Clients', 'clients'), 'visible' => Yii::app()->user->checkAccess('clients_admin')), array('label' => tt('Clients', 'clients'), 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/clients/backend/main/admin', 'active' => isActive('clients'), 'visible' => Yii::app()->user->checkAccess('clients_admin')), array('label' => tc('Content'), 'visible' => Yii::app()->user->checkAccess('news_admin') || Yii::app()->user->checkAccess('articles_admin') || Yii::app()->user->checkAccess('menumanager_admin')), array('label' => tc('News'), 'icon' => 'icon-file', 'url' => $baseUrl . '/news/backend/main/admin', 'active' => isActive('news'), 'visible' => Yii::app()->user->checkAccess('news_admin')), array('label' => tc('Blog'), 'icon' => 'icon-file', 'url' => $baseUrl . '/blog/backend/main/admin', 'active' => isActive('blog'), 'visible' => Yii::app()->user->checkAccess('blog_admin')), array('label' => tc('Q&As'), 'icon' => 'icon-file', 'url' => $baseUrl . '/articles/backend/main/admin', 'active' => isActive('articles'), 'visible' => Yii::app()->user->checkAccess('articles_admin')), array('label' => tc('Top menu items'), 'icon' => 'icon-file', 'url' => $baseUrl . '/menumanager/backend/main/admin', 'active' => isActive('menumanager'), 'visible' => Yii::app()->user->checkAccess('menumanager_admin')), array('label' => tc('Info pages'), 'icon' => 'icon-file', 'url' => $baseUrl . '/infopages/backend/main/admin', 'active' => isActive('infopages'), 'visible' => Yii::app()->user->checkAccess('infopages_admin')), array('label' => tt('Messages', 'messages'), 'visible' => issetModule('messages') && Yii::app()->user->checkAccess('messages_admin')), array('label' => tt('Messages', 'messages') . $bageMessages, 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/messages/backend/main/admin', 'active' => isActive('messages') || isActive('messages.read'), 'visible' => issetModule('messages') && Yii::app()->user->checkAccess('messages_admin')), array('label' => tt('Mailing messages', 'messages'), 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/messages/backend/mailing/admin', 'active' => isActive('messages.mailing'), 'visible' => issetModule('messages') && Yii::app()->user->checkAccess('messages_admin')), array('label' => tc('Payments'), 'visible' => issetModule('payment') && (Yii::app()->user->checkAccess('payment_admin') || Yii::app()->user->checkAccess('paidservices_admin'))), array('label' => tc('Tariff Plans'), 'icon' => 'icon-shopping-cart', 'url' => $baseUrl . '/tariffPlans/backend/main/admin', 'active' => isActive('tariffPlans'), 'visible' => issetModule('tariffPlans') && issetModule('paidservices') && Yii::app()->user->checkAccess('tariff_plans_admin')), array('label' => tc('Paid services'), 'icon' => 'icon-shopping-cart', 'url' => $baseUrl . '/paidservices/backend/main/admin', 'active' => isActive('paidservices'), 'visible' => issetModule('payment') && Yii::app()->user->checkAccess('paidservices_admin')), array('label' => tc('Manage payments') . $bagePayments, 'icon' => 'icon-shopping-cart', 'url' => $baseUrl . '/payment/backend/main/admin', 'active' => isActive('payment'), 'visible' => issetModule('payment') && Yii::app()->user->checkAccess('payment_admin')), array('label' => tc('Payment systems'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/payment/backend/paysystem/admin', 'active' => isActive('payment.paysystem'), 'visible' => issetModule('payment') && Yii::app()->user->checkAccess('payment_admin')), array('label' => tc('References'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Categories of references'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/referencecategories/backend/main/admin', 'active' => isActive('referencecategories'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Values of references'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/referencevalues/backend/main/admin', 'active' => isActive('referencevalues'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Reference "View:"'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/windowto/backend/main/admin', 'active' => isActive('windowto'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Reference "Check-in"'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/timesin/backend/main/admin', 'active' => isActive('timesin'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Reference "Check-out"'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/timesout/backend/main/admin', 'active' => isActive('timesout'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Reference "Property types"'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/apartmentObjType/backend/main/admin', 'active' => isActive('apartmentObjType'), 'visible' => Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Reference "City/Cities"'), 'icon' => 'icon-asterisk', 'url' => $baseUrl . '/apartmentCity/backend/main/admin', 'active' => isActive('apartmentCity'), 'visible' => !issetModule('location') && Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Blockip'), 'visible' => Yii::app()->user->checkAccess('blockip_admin')), array('label' => tc('Blockip'), 'icon' => 'icon-list-alt', 'url' => $baseUrl . '/blockIp/backend/main/admin', 'active' => isActive('blockIp'), 'visible' => Yii::app()->user->checkAccess('blockip_admin')), array('label' => tc('Settings'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Settings'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/configuration/backend/main/admin', 'active' => isActive('configuration'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Manage modules'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/modules/backend/main/admin', 'active' => isActive('modules'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Images'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/images/backend/main/index', 'active' => isActive('images'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Change admin password'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/adminpass/backend/main/index', 'active' => isActive('adminpass'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Site service '), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/service/backend/main/admin', 'active' => isActive('service'), 'visible' => issetModule('service'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Authentication services'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/socialauth/backend/main/admin', 'active' => isActive('socialauth'), 'visible' => issetModule('socialauth'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Manage themes'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/themes/backend/main/admin', 'active' => isActive('themes'), 'visible' => issetModule('themes'), 'visible' => Yii::app()->user->checkAccess('all_settings_admin')), array('label' => tc('Languages and currency'), 'visible' => Yii::app()->user->checkAccess('all_lang_and_currency_admin')), array('label' => tc('Languages'), 'icon' => 'icon-globe', 'url' => $baseUrl . '/lang/backend/main/admin', 'active' => isActive('lang'), 'visible' => !isFree() && Yii::app()->user->checkAccess('all_lang_and_currency_admin')), array('label' => tc('Translations'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/translateMessage/backend/main/admin', 'active' => isActive('translateMessage'), 'visible' => Yii::app()->user->checkAccess('all_lang_and_currency_admin')), array('label' => tc('Currencies'), 'icon' => 'icon-wrench', 'url' => $baseUrl . '/currency/backend/main/admin', 'active' => isActive('currency'), 'visible' => issetModule('currency') && Yii::app()->user->checkAccess('all_lang_and_currency_admin')), array('label' => tc('Modules'), 'visible' => Yii::app()->user->checkAccess('all_modules_admin') && (issetModule('notifier') || issetModule('slider') || issetModule('advertising') || issetModule('iecsv') || issetModule('formdesigner') || issetModule('socialposting'))), array('label' => tc('Mail editor'), 'icon' => 'icon-circle-arrow-right', 'url' => $baseUrl . '/notifier/backend/main/admin', 'active' => isActive('notifier'), 'visible' => issetModule('notifier') && Yii::app()->user->checkAccess('all_modules_admin')), array('label' => tc('Slide-show on the Home page'), 'icon' => 'icon-circle-arrow-right', 'url' => $baseUrl . '/slider/backend/main/admin', 'active' => isActive('slider'), 'visible' => issetModule('slider') && Yii::app()->user->checkAccess('all_modules_admin')), array('label' => tc('Import / Export'), 'icon' => 'icon-circle-arrow-right', 'url' => $baseUrl . '/iecsv/backend/main/admin', 'active' => isActive('iecsv'), 'visible' => issetModule('iecsv') && Yii::app()->user->checkAccess('all_modules_admin')), array('label' => tc('Advertising banners'), 'icon' => 'icon-circle-arrow-right', 'url' => $baseUrl . '/advertising/backend/advert/admin', 'active' => isActive('advertising'), 'visible' => issetModule('advertising') && Yii::app()->user->checkAccess('all_modules_admin')), array('label' => tc('The forms designer'), 'icon' => 'icon-circle-arrow-right', 'url' => $baseUrl . '/formdesigner/backend/main/admin', 'active' => isActive('formdesigner') || isActive('formeditor'), 'visible' => issetModule('formdesigner') && Yii::app()->user->checkAccess('all_modules_admin')), array('label' => tt('Services of automatic posting', 'socialposting'), 'icon' => 'icon-circle-arrow-right', 'url' => $baseUrl . '/socialposting/backend/main/admin', 'active' => isActive('socialposting'), 'visible' => issetModule('socialposting') && Yii::app()->user->checkAccess('all_modules_admin')), array('label' => tc('Location module'), 'visible' => issetModule('location') && Yii::app()->user->checkAccess('all_reference_admin')), array('label' => tc('Countries'), 'icon' => 'icon-globe', 'url' => $baseUrl . '/location/backend/country/admin', 'visible' => issetModule('location') && Yii::app()->user->checkAccess('all_reference_admin'), 'active' => isActive('location.country')), array('label' => tc('Regions'), 'icon' => 'icon-globe', 'url' => $baseUrl . '/location/backend/region/admin', 'visible' => issetModule('location') && Yii::app()->user->checkAccess('all_reference_admin'), 'active' => isActive('location.region')), array('label' => tc('Cities'), 'icon' => 'icon-globe', 'url' => $baseUrl . '/location/backend/city/admin', 'visible' => issetModule('location') && Yii::app()->user->checkAccess('all_reference_admin'), 'active' => isActive('location.city'))))); ?> </div> <!--/.well --> </div> <!--/span--> <div class="span9"> <?php echo $content; ?> </div> <!--/span--> </div> <!--/row--> <hr>
private function getReferenceInfo($pk = '') { $comfort = $bathroom = $kitchen = $employment = $safety = $entertainment = $terms = $services = ''; if (!isFree()) { Yii::app()->setLanguage($this->defLang); $apartmentInfo = Apartment::model()->getFullInformation($pk); Yii::app()->setLanguage($this->currLang); } else { $apartmentInfo = Apartment::model()->getFullInformation($pk); } if (is_array($apartmentInfo)) { foreach ($apartmentInfo as $key => $value) { switch ($key) { case 1: $comfort = implode($this->separatorElem, $value['values']); break; case 2: $bathroom = implode($this->separatorElem, $value['values']); break; case 3: $kitchen = implode($this->separatorElem, $value['values']); break; case 4: $employment = implode($this->separatorElem, $value['values']); break; case 5: $safety = implode($this->separatorElem, $value['values']); break; case 7: $entertainment = implode($this->separatorElem, $value['values']); break; case 9: $terms = implode($this->separatorElem, $value['values']); break; case 10: $services = implode($this->separatorElem, $value['values']); break; default: break; } } } return array('comfort' => $comfort, 'bathroom' => $bathroom, 'kitchen' => $kitchen, 'employment' => $employment, 'safety' => $safety, 'entertainment' => $entertainment, 'terms' => $terms, 'services' => $services); }
public static function getModelByLang($lang) { if (isFree()) { $sql = 'SELECT currency_id FROM {{lang}} WHERE name_iso=:lang'; $currency_id = Yii::app()->db->createCommand($sql)->queryScalar(array(':lang' => $lang)); } else { $currency_id = Lang::getCurrencyIdForLang($lang); } return $currency_id ? Currency::model()->findByPk($currency_id) : NULL; }
public function beforeSave() { if (!$this->square) { $this->square = 0; } /***изменено - вставляем пустые значения */ if (!$this->title_ru) { $this->title_ru = ''; } if (!$this->description_ru) { $this->description_ru = ''; } if (!$this->description_near_ru) { $this->description_near_ru = ''; } if (!$this->address_ru) { $this->address_ru = ''; } if (!$this->date_up_search) { $timestamp = '01/01/2100 00:00:00'; $timestamp = DateTime::createFromFormat('d/m/Y H:i:s', $timestamp); $this->date_up_search = $timestamp->format('Y-m-d H:i:s'); } if (!$this->is_special_offer) { $this->is_special_offer = ''; } if (!$this->is_free_from) { $timestamp = '01/01/2000 00:00:00'; $timestamp = DateTime::createFromFormat('d/m/Y H:i:s', $timestamp); $this->is_free_from = $timestamp->format('Y-m-d H:i:s'); } if (!$this->is_free_to) { $timestamp = '01/01/2100 00:00:00'; $timestamp = DateTime::createFromFormat('d/m/Y H:i:s', $timestamp); $this->is_free_to = $timestamp->format('Y-m-d H:i:s'); } if (!$this->exchange_to_ru) { $this->exchange_to_ru = ''; } if (!$this->note) { $this->note = ''; } if (!$this->phone) { $this->phone = ''; } if (!$this->sublocation_id) { $this->sublocation_id = 0; } if (!$this->location_id) { $this->location_id = ''; } if (!$this->price_old) { $this->price_old = 0; } /*************************/ if (!$this->land_square) { $this->land_square = 0; } if ($this->isNewRecord) { $this->owner_id = $this->owner_id ? $this->owner_id : Yii::app()->user->id; $userInfo = User::model()->findByPk($this->owner_id, array('select' => 'isAdmin')); if ($userInfo && $userInfo->isAdmin == 1) { $this->owner_active = self::STATUS_ACTIVE; } if ($this->active != Apartment::STATUS_DRAFT) { // if admin if ($userInfo && $userInfo->isAdmin == 1) { $this->active = Apartment::STATUS_ACTIVE; } else { if (param('useUseradsModeration')) { $this->active = self::STATUS_MODERATION; } } } $maxSorter = Yii::app()->db->createCommand()->select('MAX(sorter) as maxSorter')->from($this->tableName())->queryScalar(); $this->sorter = $maxSorter + 1; if ($this->obj_type_id == 0) { $this->obj_type_id = Yii::app()->db->createCommand('SELECT MIN(id) FROM {{apartment_obj_type}}')->queryScalar(); } } if (!isFree()) { $defaultCurrencyCharCode = Currency::getDefaultCurrencyModel()->char_code; if ($defaultCurrencyCharCode != $this->in_currency) { $this->price = (int) Currency::convert($this->price, $this->in_currency, $defaultCurrencyCharCode); if (isset($this->price_to) && $this->price_to) { $this->price_to = (int) Currency::convert($this->price_to, $this->in_currency, $defaultCurrencyCharCode); } } } switch ($this->type) { case self::TYPE_SALE: $this->price_type = self::PRICE_SALE; break; case self::TYPE_BUY: $this->price_type = self::PRICE_BUY; break; case self::TYPE_RENTING: $this->price_type = self::PRICE_RENTING; break; case self::TYPE_CHANGE: $this->price_type = self::PRICE_CHANGE; break; case self::TYPE_MORTGAGE: $this->price_type = self::PRICE_MORTGAGE; break; case self::TYPE_PRIVATISATION: $this->price_type = self::PRICE_PRIVATISATION; break; } if (isset($_POST['set_period_activity']) && $_POST['set_period_activity'] == 1 && $this->period_activity) { $list = self::getPeriodActivityList(); if (isset($list[$this->period_activity])) { if ($this->period_activity == 'always') { $this->activity_always = 1; } else { $this->date_end_activity = date('Y-m-d', strtotime($this->period_activity, time())); $this->activity_always = 0; } } } return parent::beforeSave(); }
public static function getActiveLangs($full = false, $requery = false) { if (!oreInstall::isInstalled()) { if (isFree()) { return array(Yii::app()->language); } else { return array('ru', 'en', 'de'); } } if (!isset(self::$_activeLangs) || $requery) { $sql = "SELECT id, name_iso, flag_img, main, name_" . Yii::app()->language . " AS name, name_rfc3066, currency_id, price_tpl_default, price_tpl_from, price_tpl_to\n FROM {{lang}}\n WHERE active=1\n ORDER BY sorter ASC"; $activeLangs = Yii::app()->db->createCommand($sql)->queryAll(); // Загружаем данные актвных языков и определяем главный ( дефолтный ) foreach ($activeLangs as $lang) { self::$_activeLangs[$lang['name_iso']] = $lang['name_iso']; self::$_activeLangsFull[$lang['name_iso']] = $lang; self::$_activeLangsTranslated[$lang['name_iso']] = $lang['name']; self::$_activeLangsTranslated[$lang['name_iso']] = $lang['name_rfc3066']; if ($lang['main']) { self::$_mainLang = $lang['name_iso']; } } } return $full ? self::$_activeLangsFull : self::$_activeLangs; }
function checkRightFile() { $ds = DIRECTORY_SEPARATOR; if (!isFree()) { $aCheckDir = array(ROOT_PATH . $ds . 'assets', ROOT_PATH . $ds . 'protected' . $ds . 'config' . $ds . 'db.php', ROOT_PATH . $ds . 'protected' . $ds . 'runtime', ROOT_PATH . $ds . 'uploads', ROOT_PATH . $ds . 'uploads' . $ds . 'ava', ROOT_PATH . $ds . 'uploads' . $ds . 'editor', ROOT_PATH . $ds . 'uploads' . $ds . 'iconsmap', ROOT_PATH . $ds . 'uploads' . $ds . 'iecsv', ROOT_PATH . $ds . 'uploads' . $ds . 'messages', ROOT_PATH . $ds . 'uploads' . $ds . 'news', ROOT_PATH . $ds . 'uploads' . $ds . 'blog', ROOT_PATH . $ds . 'uploads' . $ds . 'objects', ROOT_PATH . $ds . 'uploads' . $ds . 'qrcodes', ROOT_PATH . $ds . 'uploads' . $ds . 'rkl', ROOT_PATH . $ds . 'uploads' . $ds . 'slider', ROOT_PATH . $ds . 'uploads' . $ds . 'slider' . $ds . 'thumb', ROOT_PATH . $ds . 'uploads' . $ds . 'video'); } else { $aCheckDir = array(ROOT_PATH . $ds . 'assets', ROOT_PATH . $ds . 'protected' . $ds . 'config' . $ds . 'db.php', ROOT_PATH . $ds . 'protected' . $ds . 'runtime', ROOT_PATH . $ds . 'uploads', ROOT_PATH . $ds . 'uploads' . $ds . 'ava', ROOT_PATH . $ds . 'uploads' . $ds . 'editor', ROOT_PATH . $ds . 'uploads' . $ds . 'iconsmap', ROOT_PATH . $ds . 'uploads' . $ds . 'news', ROOT_PATH . $ds . 'uploads' . $ds . 'blog', ROOT_PATH . $ds . 'uploads' . $ds . 'objects', ROOT_PATH . $ds . 'uploads' . $ds . 'qrcodes', ROOT_PATH . $ds . 'uploads' . $ds . 'video'); } $aCheckDirErr = array('err' => 0); foreach ($aCheckDir as $sDirPath) { if (is_writable($sDirPath)) { $aCheckDirErr['dirs'][$sDirPath] = 'ok'; } else { $aCheckDirErr['err']++; if (is_file($sDirPath)) { $aCheckDirErr['dirs'][$sDirPath] = tFile::getT('module_install', 'It is necessary to establish the rights') . ' 666'; } else { $aCheckDirErr['dirs'][$sDirPath] = tFile::getT('module_install', 'It is necessary to establish the rights') . ' 777'; } } } if ($aCheckDirErr['err'] > 0) { $this->render('right_file', array('aCheckDirErr' => $aCheckDirErr)); Yii::app()->end(); } else { return $aCheckDirErr; } }
$verlegtdatum = $parts[4]; $zusatzinfo = ""; $schiri = ""; } elseif ($parts[0] != "" && $parts[1] == "") { if (strpos($parts[0], "//") === false) { // schiri $schiri = $parts[0]; $printOne = true; } else { // zusatzinfos $zusatzinfo = $parts[0]; $printOne = true; } } } echo "VALUES ('{$spielnummer}', '{$heim_team}', '{$gast_team}', '{$zusatzinfo}', '{$schiri}', '" . dateToTimestamp($spieldatum_plan, $anfiff_plan) . "', '" . getSpieltag($spielnummer) . "', '0', '0', '0', NULL, NULL, '" . isFree($gast_team) . "', '" . datetimeToTimestamp($verlegtdatum) . "');\n"; fclose($hfile); function isFree($gast) { if ($gast === "SPIELFREI") { return 1; } else { return 0; } } function dateToTimestamp($date, $time) { if ($time === "") { $time = "00:00"; } $datePart = explode(" ", $date);
?> /images/narezka/logo1.png" id="logo" /> </a> </div> <div class="kontakts"> <div class="telefon"> 8 495 212 93 92 </div> <div class="adres"> Москва, ул Строителей 25, оф. 408 </div> </div> </div> <?php if (!isFree()) { if (count(Lang::getActiveLangs()) > 1) { $this->widget('application.modules.lang.components.langSelectorWidget', array('type' => 'links')); } if (count(Currency::getActiveCurrency()) > 1) { $this->widget('application.modules.currency.components.currencySelectorWidget'); } } ?> <?php if (!isset($adminView)) { ?> <div id="search" class="menu_item menu_gorizont">
public static function create($attributes) { $item = new Menu(); //$item->attributes = $attributes; $item->parentId = array_key_exists('parentId', $attributes) ? $attributes['parentId'] : null; $item->number = array_key_exists('number', $attributes) ? $attributes['number'] : null; $item->active = 0; $item->type = self::LINK_NONE; if (isFree()) { $activeLangs = array(Yii::app()->language); } else { $activeLangs = Lang::getActiveLangs(); } foreach ($activeLangs as $lang) { //$tmp = 'title_'.Yii::app()->language; $item->{'title_' . $lang} = array_key_exists('title', $attributes) ? $attributes['title'] : null; } /*// подставляем урл, если не задан вручную if (!$item->seo_link && $item->title) { if (isset($item->parent) && $item->parent) { # есть родитель if (isset($item->parent->seo_link) && $item->parent->seo_link) { $item->seo_link = $item->parent->seo_link.'/'.translit(mb_strtolower($item->title, 'utf8')); } elseif (isset($item->parent->title) && $item->parent->title) { $item->seo_link = translit(mb_strtolower($item->parent->title, 'utf8')).'/'.translit(mb_strtolower($item->title, 'utf8')); } } }*/ if (!$item->save()) { throw new CHttpException(400, $item->plainErrors()); } $item->normalize(); return $item; }