1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00

Переименование папки language -> i18n

* Языковые файлы переименованы по стандарту ISO 639-1
This commit is contained in:
Denis Shakhov 2013-07-31 13:33:59 +07:00
parent a9fdb93386
commit e3fe15e197
28 changed files with 342 additions and 339 deletions

View file

@ -17,7 +17,7 @@
/**
* !!!!! ВНИМАНИЕ !!!!!
*
*
* Ничего не изменяйте в этом файле!
* Все изменения нужно вносить в файл config/config.local.php
*/
@ -160,10 +160,12 @@ $config['general']['reg']['activation'] = false; // использовать а
/**
* Языковые настройки
*/
$config['lang']['current'] = 'russian'; // текущий язык текстовок
$config['lang']['default'] = 'russian'; // язык, который будет использовать на сайте по умолчанию
$config['lang']['path'] = '___path.root.server___/templates/language'; // полный путь до языковых файлов
$config['lang']['load_to_js'] = array(); // Массив текстовок, которые необходимо прогружать на страницу в виде JS хеша, позволяет использовать текстовки внутри js
$config['lang']['current'] = 'ru'; // текущий язык текстовок
$config['lang']['default'] = 'ru'; // язык, который будет использовать на сайте по умолчанию
$config['lang']['dir'] = 'i18n'; // название директории с языковыми файлами
$config['lang']['path'] = '___path.root.server___/templates/___lang.dir___'; // полный путь до языковых файлов
$config['lang']['load_to_js'] = array(); // Массив текстовок, которые необходимо прогружать на страницу в виде JS хеша, позволяет использовать текстовки внутри js
/**
* Настройки ACL(Access Control List список контроля доступа)
*/
@ -458,11 +460,11 @@ $config['block']['rule_tag'] = array(
);
$config['block']['rule_blogs'] = array(
'action' => array( 'blogs' ),
'blocks' => array(
'blocks' => array(
'right' => array(
'blocks/block.blogAdd.tpl' => array('priority' => 100),
'blogCategories' => array('priority' => 50)
)
)
),
);
@ -504,13 +506,13 @@ $config['block']['rule_users'] = array(
);
$config['block']['rule_profile'] = array(
'action' => array( 'profile', 'talk', 'settings' ),
'blocks' => array(
'blocks' => array(
'right' => array(
'blocks/block.userPhoto.tpl' =>array('priority' => 100),
'blocks/block.userActions.tpl' =>array('priority' => 50),
'blocks/block.userNote.tpl' =>array('priority' => 25),
'blocks/block.userNav.tpl' =>array('priority' => 1),
)
)
)
);

View file

@ -155,7 +155,7 @@ class ModuleLang extends Module {
$sDir=Config::Get('path.root.server').'/plugins/';
foreach ($aPluginList as $sPluginName) {
$aFiles=glob($sDir.$sPluginName.'/templates/language/'.$sLangName.'.php');
$aFiles=glob($sDir.$sPluginName.'/templates/'.Config::Get('lang.dir').'/'.$sLangName.'.php');
if($aFiles and count($aFiles)) {
foreach ($aFiles as $sFile) {
if (file_exists($sFile)) {
@ -177,7 +177,7 @@ class ModuleLang extends Module {
* @param string $sLangName Язык для загрузки
*/
public function LoadLangFileTemplate($sLangName) {
$sFile=Config::Get('path.smarty.template').'/settings/language/'.$sLangName.'.php';
$sFile=Config::Get('path.smarty.template').'/settings/'.Config::Get('lang.dir').'/'.$sLangName.'.php';
if (file_exists($sFile)) {
$this->AddMessages(include($sFile));
}

View file

@ -12,7 +12,7 @@
* @param int $count
* @return string
*/
function smarty_modifier_declension_english($forms, $count)
function smarty_modifier_declension_en($forms, $count)
{
if ($count==1)
return $forms[0];
@ -27,7 +27,7 @@ function smarty_modifier_declension_english($forms, $count)
* @param int $count
* @return string
*/
function smarty_modifier_declension_russian($forms, $count)
function smarty_modifier_declension_ru($forms, $count)
{
$mod100 = $count % 100;
switch ($count%10) {
@ -63,7 +63,7 @@ function smarty_modifier_declension_russian($forms, $count)
* @return string
*/
function smarty_modifier_declension($count, $forms, $language='')
{
{
if (!$language)
$language = Engine::getInstance()->Lang_GetLang();
@ -79,7 +79,7 @@ function smarty_modifier_declension($count, $forms, $language='')
return $fn($forms, $count);
} else {
// Действуем по образу и подобию английского языка
return smarty_modifier_declension_english($forms, $count);
return smarty_modifier_declension_en($forms, $count);
}
}
?>

View file

@ -34,15 +34,15 @@ class Install {
const SESSSION_KEY_STEP_NAME = 'livestreet_install_step';
/**
* Название файла локальной конфигурации
*
*
* @var string
*/
const LOCAL_CONFIG_FILE_NAME = 'config.local.php';
/**
* Передача этого ключа как параметра, указавает функции извлечения параметра
* запросить значение переменной сначала из сессии, в случае не нахождения нужного
* ключа - установить значение по умолчанию.
*
* ключа - установить значение по умолчанию.
*
* Используется в фукнциях Assign(), GetRequest().
*
* @see $this->Assign()
@ -53,13 +53,13 @@ class Install {
/**
* Передача этого ключа как параметра, указавает функции предварительно сохранить
* переменную в сессию с одноименным ключем.
*
*
* Используется в фукнциях Assign(), GetRequest().
*
* @see $this->Assign()
* @see $this->GetRequest()
* @var string
*/
*/
const SET_VAR_IN_SESSION = 'set';
/**
* Массив разрешенных шагов инсталяции
@ -75,7 +75,7 @@ class Install {
protected $aSimpleModeSteps = array('Start','Db','Admin','End');
/**
* Количество шагов, которые необходимо указывать в инсталляционных параметрах
*
*
* @var int
*/
protected $iStepCount = null;
@ -96,7 +96,7 @@ class Install {
*
* @var string
*/
protected $sLangInstallDir = 'language';
protected $sLangInstallDir = 'i18n';
/**
* Массив с переменными шаблонизатора
*
@ -118,13 +118,13 @@ class Install {
* @var array
*/
protected $aValidEnv = array(
'safe_mode' => array ('0','off',''),
'register_globals' => array ('0','off',''),
'allow_url_fopen' => array ('1','on'),
'UTF8_support' => '1',
'http_input' => array ('','pass'),
'http_output' => array ('0','pass'),
'func_overload' => array ('0','4', 'no overload'),
'safe_mode' => array ('0','off',''),
'register_globals' => array ('0','off',''),
'allow_url_fopen' => array ('1','on'),
'UTF8_support' => '1',
'http_input' => array ('','pass'),
'http_output' => array ('0','pass'),
'func_overload' => array ('0','4', 'no overload'),
);
/**
* Директория, в которой хранятся конфиг-файлы
@ -133,7 +133,7 @@ class Install {
*/
protected $sConfigDir="";
/**
* Директория хранения скинов сайта
* Директория хранения скинов сайта
*
* @var string
*/
@ -155,13 +155,13 @@ class Install {
*
* @var string
*/
protected $sLangDefault = 'russian';
protected $sLangDefault = 'ru';
/**
* Языковые текстовки
*
* @var array
*/
protected $aLang = array();
protected $aLang = array();
/**
* Инициализация основных настроек
*
@ -169,7 +169,7 @@ class Install {
public function __construct() {
$this->sConfigDir = dirname(__FILE__).'/../config';
$this->sSkinDir = dirname(__FILE__).'/../templates/skin';
$this->sLangDir = dirname(__FILE__).'/../templates/language';
$this->sLangDir = dirname(__FILE__).'/../templates/i18n';
/**
* Загружаем языковые файлы
*/
@ -193,8 +193,9 @@ class Install {
*/
protected function LoadLanguageFile($sLang) {
$sFilePath=$this->sLangInstallDir.'/'.$sLang.'.php';
if(!file_exists($sFilePath)) return false;
$aLang = include($sFilePath);
$this->aLang = array_merge($this->aLang,$aLang);
}
@ -208,10 +209,10 @@ class Install {
protected function Lang($sKey,$aParams=array()) {
if(!array_key_exists($sKey,$this->aLang))
return 'Unknown language key';
$sValue=$this->aLang[$sKey];
if(count($aParams)==0) return $sValue;
foreach ($aParams as $k=>$v) {
$sValue=str_replace("%%{$k}%%",$v,$sValue);
}
@ -245,11 +246,11 @@ class Install {
*/
protected function DestroySessionVar($sKey) {
if(!array_key_exists($sKey,$_SESSION)) return false;
unset($_SESSION[$sKey]);
return true;
}
/**
* Выполняет рендеринг указанного шаблона
*
@ -258,7 +259,7 @@ class Install {
*/
protected function Fetch($sTemplateName) {
if(!file_exists($this->sTemplatesDir.'/'.$sTemplateName)) return false;
$sTemplate = file_get_contents($this->sTemplatesDir.'/'.$sTemplateName);
return $this->FetchString($sTemplate);
}
@ -269,15 +270,15 @@ class Install {
* @return string
*/
protected function FetchString($sTempString) {
return str_replace(array_keys($this->aTemplateVars),array_values($this->aTemplateVars),$sTempString);
return str_replace(array_keys($this->aTemplateVars),array_values($this->aTemplateVars),$sTempString);
}
/**
* Добавляет переменную для отображение в шаблоне.
*
* Если параметр $sFromSession установлен в значение GET,
*
* Если параметр $sFromSession установлен в значение GET,
* то переменная сначала будет запрошена из сессии.
*
* Если параметр $sFromSession установлен в значение SET,
*
* Если параметр $sFromSession установлен в значение SET,
* то переменная сначала вложена в сессию с одноименным ключем.
*
* @param string $sName
@ -287,7 +288,7 @@ class Install {
protected function Assign($sName,$sValue,$sFromSession=null) {
if($sFromSession==self::GET_VAR_FROM_SESSION) $sValue=$this->GetSessionVar($sName,$sValue);
if($sFromSession==self::SET_VAR_IN_SESSION) $this->SetSessionVar($sName,$sValue);
$this->aTemplateVars['___'.strtoupper($sName).'___'] = $sValue;
}
/**
@ -310,12 +311,12 @@ class Install {
$aMessages = array();
foreach ($this->aMessages as &$sMessage) {
if(array_key_exists('type',$sMessage) and array_key_exists('text',$sMessage)) {
$aMessages[$sMessage['type']][md5(serialize($sMessage))] = "<b>".ucfirst($sMessage['type'])."</b>: ".$sMessage['text'];
$aMessages[$sMessage['type']][md5(serialize($sMessage))] = "<b>".ucfirst($sMessage['type'])."</b>: ".$sMessage['text'];
}
unset($sMessage);
}
$this->aMessages = $aMessages;
$sMessageContent = "";
foreach ($this->aMessages as $sType => $aMessageTexts) {
$this->Assign('message_style_class', $sType);
@ -324,11 +325,11 @@ class Install {
}
$this->Assign('system_messages',$sMessageContent);
}
$this->Assign('content', $sLayoutContent);
print $this->Fetch('layout.tpl');
}
/**
* Сохранить данные в конфиг-файл
*
@ -339,20 +340,20 @@ class Install {
*/
protected function SaveConfig($sName,$sVar,$sPath) {
if(!file_exists($sPath)) {
$this->aMessages[] = array('type'=>'error', 'text'=>$this->Lang('config_file_not_exists',array('path'=>$sPath)));
$this->aMessages[] = array('type'=>'error', 'text'=>$this->Lang('config_file_not_exists',array('path'=>$sPath)));
return false;
}
if(!is_writeable($sPath)) {
if(!is_writeable($sPath)) {
$this->aMessages[] = array('type'=>'error', 'text'=>$this->Lang('config_file_not_writable',array('path'=>$sPath)));
return false;
return false;
}
$sConfig = file_get_contents($sPath);
$sName = '$config[\''.implode('\'][\'', explode('.',$sName)).'\']';
$sVar = $this->ConvertToString($sVar);
/**
* Если переменная уже определена в конфиге,
* Если переменная уже определена в конфиге,
* то меняем значение.
*/
if(substr_count($sConfig, $sName)) {
@ -373,23 +374,23 @@ class Install {
switch(true) {
case is_string($mVar):
return "'".addslashes($mVar)."'";
case is_bool($mVar):
return ($mVar)?"true":"false";
case is_array($mVar):
$sArrayString="";
foreach($mVar as $sKey=>$sValue) {
$sArrayString .= "'{$sKey}'=>".$this->ConvertToString($sValue).",";
}
return "array(".$sArrayString.")";
default:
default:
case is_numeric($mVar):
return "'".(string)$mVar."'";
}
}
/**
* Получает значение переданных параметров
*
@ -397,9 +398,9 @@ class Install {
* @param mixed $default
* @return mixed
*/
protected function GetRequest($sName,$default=null,$bSession=null) {
protected function GetRequest($sName,$default=null,$bSession=null) {
if (array_key_exists($sName,$_REQUEST)) {
$sResult = (is_string($_REQUEST[$sName]))
$sResult = (is_string($_REQUEST[$sName]))
? trim(stripslashes($_REQUEST[$sName]))
: $_REQUEST[$sName];
} else {
@ -411,25 +412,25 @@ class Install {
* При необходимости сохраняем в сессию
*/
if($bSession==self::SET_VAR_IN_SESSION) $this->SetSessionVar($sName,$sResult);
return $sResult;
}
}
/**
* Функция отвечающая за проверку входных параметров
* и передающая управление на фукнцию текущего шага
*
* @call $this->Step{__Name__}
* @call $this->Step{__Name__}
*/
public function Run($sStepName=null) {
if(is_null($sStepName)){
if(is_null($sStepName)){
$sStepName = $this->GetSessionVar(self::SESSSION_KEY_STEP_NAME, self::INSTALL_DEFAULT_STEP);
} else {
$this->SetSessionVar(self::SESSSION_KEY_STEP_NAME,$sStepName);
}
if(!in_array($sStepName,$this->aSteps)) die('Unknown step');
$iKey = array_search($sStepName,$this->aSteps);
/**
* Если была нажата кнопка "Назад", перемещаемся на шаг назад
@ -441,11 +442,11 @@ class Install {
$this->Assign('next_step_display', ($iKey == count($this->aSteps)-1)?'none':'inline-block');
$this->Assign('prev_step_display', ($iKey == 0) ? 'none' : 'inline-block');
/**
* Если шаг отновиться к simple mode, то корректируем количество шагов
*/
if(in_array($sStepName,$this->aSimpleModeSteps))
if(in_array($sStepName,$this->aSimpleModeSteps))
$this->SetStepCount(count($this->aSimpleModeSteps));
/**
* Передаем во вьевер данные для формирование таймлайна шагов
@ -456,7 +457,7 @@ class Install {
* Пердаем управление на метод текущего шага
*/
$sFunctionName = 'Step'.$sStepName;
if(@method_exists($this,$sFunctionName)) {
if(@method_exists($this,$sFunctionName)) {
$this->$sFunctionName();
} else {
$sFunctionName = 'Step'.self::INSTALL_DEFAULT_STEP;
@ -472,7 +473,7 @@ class Install {
*/
protected function SetStep($sStepName) {
if(!$sStepName or !in_array($sStepName,$this->aSteps)) return null;
$this->Assign('install_step_number',array_search($sStepName,$this->aSteps)+1);
$this->Assign('install_step_number',array_search($sStepName,$this->aSteps)+1);
}
/**
* Устанавливает количество шагов для отображения в шаблонах
@ -482,7 +483,7 @@ class Install {
protected function SetStepCount($iStepCount) {
$this->iStepCount = $iStepCount;
}
/**
* Первый шаг инсталяции.
* Валидация окружения.
@ -506,7 +507,7 @@ class Install {
/**
* Запрос данных соединения с базой данных.
* Запись полученных данных в лог.
*/
*/
protected function StepDb() {
if(!$this->GetRequest('install_db_params')) {
/**
@ -522,7 +523,7 @@ class Install {
$this->Assign('install_db_engine', 'InnoDB', self::GET_VAR_FROM_SESSION);
$this->Assign('install_db_engine_innodb', '', self::GET_VAR_FROM_SESSION);
$this->Assign('install_db_engine_myisam', '', self::GET_VAR_FROM_SESSION);
$this->Layout('steps/db.tpl');
return true;
}
@ -555,7 +556,7 @@ class Install {
*/
$this->Assign('install_db_engine_innodb', ($aParams['engine']=='InnoDB')?'selected="selected"':'', self::SET_VAR_IN_SESSION);
$this->Assign('install_db_engine_myisam', ($aParams['engine']=='MyISAM')?'selected="selected"':'', self::SET_VAR_IN_SESSION);
if($oDb=$this->ValidateDBConnection($aParams)) {
$bSelect = $this->SelectDatabase($aParams['name'],$aParams['create']);
/**
@ -566,7 +567,7 @@ class Install {
$this->Layout('steps/db.tpl');
return false;
}
/**
* Сохраняем в config.local.php настройки соединения
*/
@ -577,25 +578,25 @@ class Install {
return false;
}
@chmod($sLocalConfigFile, 0777);
$this->SaveConfig('db.params.host', $aParams['server'], $sLocalConfigFile);
$this->SaveConfig('db.params.port', $aParams['port'], $sLocalConfigFile);
$this->SaveConfig('db.params.user', $aParams['user'], $sLocalConfigFile);
$this->SaveConfig('db.params.pass', $aParams['password'], $sLocalConfigFile);
$this->SaveConfig('db.params.dbname',$aParams['name'], $sLocalConfigFile);
$this->SaveConfig('db.table.prefix', $aParams['prefix'], $sLocalConfigFile);
if($aParams['engine']=='InnoDB') {
/**
* Проверяем поддержку InnoDB в MySQL
*/
$aParams['engine']='MyISAM';
$aParams['engine']='MyISAM';
if($aRes = @mysql_query('SHOW ENGINES')) {
while ($aRow = mysql_fetch_assoc($aRes)) {
if ($aRow['Engine']=='InnoDB' and in_array($aRow['Support'],array('DEFAULT','YES'))) {
while ($aRow = mysql_fetch_assoc($aRes)) {
if ($aRow['Engine']=='InnoDB' and in_array($aRow['Support'],array('DEFAULT','YES'))) {
$aParams['engine']='InnoDB';
}
}
}
}
}
$this->SaveConfig('db.tables.engine',$aParams['engine'], $sLocalConfigFile);
@ -673,7 +674,7 @@ class Install {
}
/**
* Запрос данных администратора и сохранение их в базе данных
*
*
*/
protected function StepAdmin() {
$this->SetSessionVar(self::SESSSION_KEY_STEP_NAME,'Admin');
@ -696,7 +697,7 @@ class Install {
if(!$bResult) {
foreach($aErrors as $sError) $this->aMessages[] = array('type'=>'error','text'=>$sError);
$this->Layout('steps/admin.tpl');
return false;
return false;
}
/**
* Подключаемся к базе данных и сохраняем новые данные администратора
@ -708,7 +709,7 @@ class Install {
return false;
}
$this->SelectDatabase($aParams['name']);
$bUpdated = $this->UpdateDBUser(
$this->GetRequest('install_admin_login'),
$this->GetRequest('install_admin_pass'),
@ -718,13 +719,13 @@ class Install {
if(!$bUpdated) {
$this->aMessages[] = array('type'=>'error','text'=>$this->Lang('error_db_saved').'<br />'.mysql_error());
$this->Layout('steps/admin.tpl');
return false;
return false;
}
/**
* Обновляем данные о пользовательском блоге
*/
$this->UpdateUserBlog("Blog by ".$this->GetRequest('install_admin_login'),$aParams['prefix']);
/**
* Передаем управление на следующий шаг
*/
@ -740,8 +741,8 @@ class Install {
/**
* Если пользователь выбрал расширенный режим, переводим на новый шаг
*/
return ($this->GetRequest('install_step_extend'))
? $this->StepExtend()
return ($this->GetRequest('install_step_extend'))
? $this->StepExtend()
: $this->Layout('steps/end.tpl');
}
/**
@ -764,17 +765,17 @@ class Install {
$aParams['install_view_description']= $this->GetRequest('install_view_description','Description your site',self::GET_VAR_FROM_SESSION);
$aParams['install_view_keywords'] = $this->GetRequest('install_view_keywords','site, google, internet',self::GET_VAR_FROM_SESSION);
$aParams['install_view_skin'] = $this->GetRequest('install_view_skin','synio',self::GET_VAR_FROM_SESSION);
$aParams['install_mail_sender'] = $this->GetRequest('install_mail_sender',$this->GetSessionVar('install_admin_mail','rus.engine@gmail.com'),self::GET_VAR_FROM_SESSION);
$aParams['install_mail_name'] = $this->GetRequest('install_mail_name','Почтовик Your Site',self::GET_VAR_FROM_SESSION);
$aParams['install_general_close'] = (bool)$this->GetRequest('install_general_close',false,self::GET_VAR_FROM_SESSION);
$aParams['install_general_invite'] = (bool)$this->GetRequest('install_general_invite',false,self::GET_VAR_FROM_SESSION);
$aParams['install_general_active'] = (bool)$this->GetRequest('install_general_active',false,self::GET_VAR_FROM_SESSION);
$aParams['install_lang_current'] = $this->GetRequest('install_lang_current','russian',self::GET_VAR_FROM_SESSION);
$aParams['install_lang_default'] = $this->GetRequest('install_lang_default','russian',self::GET_VAR_FROM_SESSION);
$aParams['install_lang_current'] = $this->GetRequest('install_lang_current','ru',self::GET_VAR_FROM_SESSION);
$aParams['install_lang_default'] = $this->GetRequest('install_lang_default','ru',self::GET_VAR_FROM_SESSION);
/**
* Передаем параметры во Viewer
*/
@ -795,7 +796,7 @@ class Install {
$sLangOptions = "";
foreach ($aLangs as $sLang) {
$this->Assign('language_array_item',$sLang);
$this->Assign('language_array_item_selected', ($aParams['install_lang_current']==$sLang)?'selected="selected"':'');
$this->Assign('language_array_item_selected', ($aParams['install_lang_current']==$sLang)?'selected="selected"':'');
$sLangOptions.=$this->FetchString("<option value='___LANGUAGE_ARRAY_ITEM___' ___LANGUAGE_ARRAY_ITEM_SELECTED___>___LANGUAGE_ARRAY_ITEM___</option>");
}
$this->Assign('install_lang_options',$sLangOptions);
@ -805,7 +806,7 @@ class Install {
$sLangOptions = "";
foreach ($aLangs as $sLang) {
$this->Assign('language_array_item',$sLang);
$this->Assign('language_array_item_selected', ($aParams['install_lang_default']==$sLang)?'selected="selected"':'');
$this->Assign('language_array_item_selected', ($aParams['install_lang_default']==$sLang)?'selected="selected"':'');
$sLangOptions.=$this->FetchString("<option value='___LANGUAGE_ARRAY_ITEM___' ___LANGUAGE_ARRAY_ITEM_SELECTED___>___LANGUAGE_ARRAY_ITEM___</option>");
}
$this->Assign('install_lang_default_options',$sLangOptions);
@ -816,18 +817,18 @@ class Install {
$sSkinOptions = "";
foreach ($aSkins as $sSkin) {
$this->Assign('skin_array_item',$sSkin);
$this->Assign('skin_array_item_selected', ($aParams['install_view_skin']==$sSkin)?'selected="selected"':'');
$this->Assign('skin_array_item_selected', ($aParams['install_view_skin']==$sSkin)?'selected="selected"':'');
$sSkinOptions.=$this->FetchString("<option value='___SKIN_ARRAY_ITEM___' ___SKIN_ARRAY_ITEM_SELECTED___>___SKIN_ARRAY_ITEM___</option>");
}
$this->Assign('install_view_skin_options',$sSkinOptions);
$this->Assign('install_view_skin_options',$sSkinOptions);
/**
* Если были переданные данные формы, то обрабатываем добавление
*/
if($this->GetRequest('install_extend_params')) {
$bOk = true;
$sLocalConfigFile = $this->sConfigDir.'/'.self::LOCAL_CONFIG_FILE_NAME;
/**
* Название сайта
*/
@ -840,7 +841,7 @@ class Install {
}
/**
* Описание сайта
*/
*/
if($aParams['install_view_description']){
if($this->SaveConfig('view.description',$aParams['install_view_description'],$sLocalConfigFile))
$this->SetSessionVar('install_view_description',$aParams['install_view_description']);
@ -853,7 +854,7 @@ class Install {
*/
if($aParams['install_view_keywords'] && strlen($aParams['install_view_keywords'])>2){
if($this->SaveConfig('view.keywords',$aParams['install_view_keywords'],$sLocalConfigFile))
$this->SetSessionVar('install_view_keywords',$aParams['install_view_keywords']);
$this->SetSessionVar('install_view_keywords',$aParams['install_view_keywords']);
} else {
$bOk = false;
$this->aMessages[] = array('type'=>'error','text'=>$this->Lang('site_keywords_invalid'));
@ -868,7 +869,7 @@ class Install {
$bOk = false;
$this->aMessages[] = array('type'=>'error','text'=>'skin_name_invalid');
}
/**
* E-mail, с которого отправляются уведомления
*/
@ -905,7 +906,7 @@ class Install {
*/
if($this->SaveConfig('general.reg.invite',$aParams['install_general_invite'],$sLocalConfigFile))
$this->SetSessionVar('install_general_invite',$aParams['install_general_invite']);
/**
* Текущий язык
*/
@ -915,10 +916,10 @@ class Install {
/**
* Если выбран русский язык, то перезаписываем название блога
*/
if($aParams['install_lang_current']=='russian'){
if($aParams['install_lang_current']=='ru'){
$aDbParams = $this->GetSessionVar('INSTALL_DATABASE_PARAMS');
$oDb = $this->ValidateDBConnection($aDbParams);
if($oDb and $this->SelectDatabase($aDbParams['name'])) $this->UpdateUserBlog("Блог им. ".$this->GetSessionVar('install_admin_login'),$aDbParams['prefix']);
}
}
@ -935,11 +936,11 @@ class Install {
} else {
$bOk = false;
$this->aMessages[] = array('type'=>'error','text'=>$this->Lang('lang_default_invalid'));
}
}
}
return ($this->GetRequest('install_step_next'))
? $this->StepFinish()
return ($this->GetRequest('install_step_next'))
? $this->StepFinish()
: $this->Layout('steps/extend.tpl');
}
/**
@ -953,24 +954,24 @@ class Install {
}
/**
* Проверяем возможность инсталяции
*
*
* @return bool
*/
protected function ValidateEnviroment() {
$bOk = true;
if(!version_compare(PHP_VERSION, '5.2.0', '>=')) {
$bOk = false;
$this->Assign('validate_php_version', '<span style="color:red;">'.$this->Lang('no').'</span>');
$this->Assign('validate_php_version', '<span style="color:red;">'.$this->Lang('no').'</span>');
} else {
$this->Assign('validate_php_version', '<span style="color:green;">'.$this->Lang('yes').'</span>');
$this->Assign('validate_php_version', '<span style="color:green;">'.$this->Lang('yes').'</span>');
}
if(!in_array(strtolower(@ini_get('safe_mode')), $this->aValidEnv['safe_mode'])) {
$bOk = false;
$this->Assign('validate_safe_mode', '<span style="color:red;">'.$this->Lang('no').'</span>');
} else {
$this->Assign('validate_safe_mode', '<span style="color:green;">'.$this->Lang('yes').'</span>');
$this->Assign('validate_safe_mode', '<span style="color:green;">'.$this->Lang('yes').'</span>');
}
if(@preg_match('//u', '')!=$this->aValidEnv['UTF8_support']) {
@ -984,16 +985,16 @@ class Install {
$this->Assign('validate_mbstring', '<span style="color:green;">'.$this->Lang('yes').'</span>');
} else {
$bOk = false;
$this->Assign('validate_mbstring', '<span style="color:red;">'.$this->Lang('no').'</span>');
$this->Assign('validate_mbstring', '<span style="color:red;">'.$this->Lang('no').'</span>');
}
if (@extension_loaded('SimpleXML')){
$this->Assign('validate_simplexml', '<span style="color:green;">'.$this->Lang('yes').'</span>');
$this->Assign('validate_simplexml', '<span style="color:green;">'.$this->Lang('yes').'</span>');
} else {
$bOk = false;
$this->Assign('validate_simplexml', '<span style="color:red;">'.$this->Lang('no').'</span>');
$this->Assign('validate_simplexml', '<span style="color:red;">'.$this->Lang('no').'</span>');
}
$sLocalConfigPath = $this->sConfigDir.'/config.local.php';
if(!file_exists($sLocalConfigPath) or !is_writeable($sLocalConfigPath)) {
// пытаемся создать файл локального конфига
@ -1003,9 +1004,9 @@ class Install {
$bOk = false;
$this->Assign('validate_local_config', '<span style="color:red;">'.$this->Lang('no').'</span>');
} else {
$this->Assign('validate_local_config', '<span style="color:green;">'.$this->Lang('yes').'</span>');
$this->Assign('validate_local_config', '<span style="color:green;">'.$this->Lang('yes').'</span>');
}
/**
* Проверяем доступность и достаточность прав у директории
* для сохранения файлового кеша, /logs, /uploads, /templates/compiled, /plugins
@ -1013,54 +1014,54 @@ class Install {
$sTempDir = dirname(dirname(__FILE__)).'/tmp';
if(!is_dir($sTempDir) or !is_writable($sTempDir)) {
$bOk = false;
$this->Assign('validate_local_temp', '<span style="color:red;">'.$this->Lang('no').'</span>');
$this->Assign('validate_local_temp', '<span style="color:red;">'.$this->Lang('no').'</span>');
} else {
$this->Assign('validate_local_temp', '<span style="color:green;">'.$this->Lang('yes').'</span>');
$this->Assign('validate_local_temp', '<span style="color:green;">'.$this->Lang('yes').'</span>');
}
$sLogsDir = dirname(dirname(__FILE__)).'/logs';
if(!is_dir($sLogsDir) or !is_writable($sLogsDir)) {
$bOk = false;
$this->Assign('validate_local_logs', '<span style="color:red;">'.$this->Lang('no').'</span>');
$this->Assign('validate_local_logs', '<span style="color:red;">'.$this->Lang('no').'</span>');
} else {
$this->Assign('validate_local_logs', '<span style="color:green;">'.$this->Lang('yes').'</span>');
$this->Assign('validate_local_logs', '<span style="color:green;">'.$this->Lang('yes').'</span>');
}
$sUploadsDir = dirname(dirname(__FILE__)).'/uploads';
if(!is_dir($sUploadsDir) or !is_writable($sUploadsDir)) {
$bOk = false;
$this->Assign('validate_local_uploads', '<span style="color:red;">'.$this->Lang('no').'</span>');
$this->Assign('validate_local_uploads', '<span style="color:red;">'.$this->Lang('no').'</span>');
} else {
$this->Assign('validate_local_uploads', '<span style="color:green;">'.$this->Lang('yes').'</span>');
$this->Assign('validate_local_uploads', '<span style="color:green;">'.$this->Lang('yes').'</span>');
}
$sTemplatesDir = dirname(dirname(__FILE__)).'/templates/compiled';
if(!is_dir($sTemplatesDir) or !is_writable($sTemplatesDir)) {
$bOk = false;
$this->Assign('validate_local_templates', '<span style="color:red;">'.$this->Lang('no').'</span>');
$this->Assign('validate_local_templates', '<span style="color:red;">'.$this->Lang('no').'</span>');
} else {
$this->Assign('validate_local_templates', '<span style="color:green;">'.$this->Lang('yes').'</span>');
}
$this->Assign('validate_local_templates', '<span style="color:green;">'.$this->Lang('yes').'</span>');
}
$sTemplatesCacheDir = dirname(dirname(__FILE__)).'/templates/cache';
if(!is_dir($sTemplatesCacheDir) or !is_writable($sTemplatesCacheDir)) {
$bOk = false;
$this->Assign('validate_local_templates_cache', '<span style="color:red;">'.$this->Lang('no').'</span>');
$this->Assign('validate_local_templates_cache', '<span style="color:red;">'.$this->Lang('no').'</span>');
} else {
$this->Assign('validate_local_templates_cache', '<span style="color:green;">'.$this->Lang('yes').'</span>');
$this->Assign('validate_local_templates_cache', '<span style="color:green;">'.$this->Lang('yes').'</span>');
}
$sPluginsDir = dirname(dirname(__FILE__)).'/plugins';
if(!is_dir($sPluginsDir) or !is_writable($sPluginsDir)) {
$bOk = false;
$this->Assign('validate_local_plugins', '<span style="color:red;">'.$this->Lang('no').'</span>');
$this->Assign('validate_local_plugins', '<span style="color:red;">'.$this->Lang('no').'</span>');
} else {
$this->Assign('validate_local_plugins', '<span style="color:green;">'.$this->Lang('yes').'</span>');
$this->Assign('validate_local_plugins', '<span style="color:green;">'.$this->Lang('yes').'</span>');
}
return $bOk;
}
}
/**
* Проверяет соединение с базой данных
*
@ -1077,11 +1078,11 @@ class Install {
$this->aMessages[] = array('type'=>'error','text'=>$this->Lang('valid_mysql_server'));
return false;
}
mysql_query('set names utf8');
return $oDb;
}
$this->aMessages[] = array('type'=>'error','text'=>$this->Lang('error_db_connection_invalid'));
return null;
}
@ -1095,10 +1096,10 @@ class Install {
protected function SelectDatabase($sName,$bCreate=false) {
if(@mysql_select_db($sName)) return true;
if($bCreate){
if($bCreate){
@mysql_query("CREATE DATABASE $sName");
return @mysql_select_db($sName);
}
}
return false;
}
/**
@ -1110,7 +1111,7 @@ class Install {
protected function CreateTables($sFilePath,$aParams) {
$sFileQuery = @file_get_contents($sFilePath);
if(!$sFileQuery) return array('result'=>false,'errors'=>array($this->Lang("config_file_not_exists", array('path'=>$sFilePath))));
if(isset($aParams['prefix'])) $sFileQuery = str_replace('prefix_', $aParams['prefix'], $sFileQuery);
$aQuery=explode(';',$sFileQuery);
/**
@ -1119,10 +1120,10 @@ class Install {
$aErrors = array();
/**
* Смотрим, какие таблицы существуют в базе данных
*/
*/
$aDbTables = array();
$aResult = @mysql_query("SHOW TABLES");
if(!$aResult){
if(!$aResult){
return array('result'=>false,'errors'=>array($this->Lang('error_db_no_data')));
}
while($aRow = mysql_fetch_array($aResult, MYSQL_NUM)){
@ -1133,7 +1134,7 @@ class Install {
*/
if (in_array($aParams['prefix'].$aParams['check_table'],$aDbTables)) {
return false;
}
}
/**
* Выполняем запросы по очереди
*/
@ -1143,19 +1144,19 @@ class Install {
* Заменяем движек, если таковой указан в запросе
*/
if(isset($aParams['engine'])) $sQuery=str_ireplace('ENGINE=InnoDB', "ENGINE={$aParams['engine']}",$sQuery);
if($sQuery!='' and !$this->IsUseDbTable($sQuery,$aDbTables)) {
$bResult=mysql_query($sQuery);
if(!$bResult) $aErrors[] = mysql_error();
}
}
if(count($aErrors)==0) {
return array('result'=>true,'errors'=>null);
}
return array('result'=>false,'errors'=>$aErrors);
}
/**
* Проверяем, нуждается ли база в конвертации или нет
*
@ -1166,10 +1167,10 @@ class Install {
/**
* Проверяем, нуждается ли база в конвертации или нет
* Смотрим, какие таблицы существуют в базе данных
*/
*/
$aDbTables = array();
$aResult = @mysql_query("SHOW TABLES");
if(!$aResult){
if(!$aResult){
return array('result'=>false,'errors'=>array($this->Lang('error_db_no_data')));
}
while($aRow = mysql_fetch_array($aResult, MYSQL_NUM)){
@ -1185,20 +1186,20 @@ class Install {
*
* @return bool
*/
protected function ConvertDatabase($sFilePath,$aParams) {
protected function ConvertDatabase($sFilePath,$aParams) {
if(!$this->ValidateConvertDatabase($aParams)) {
return array('result'=>true,'errors'=>array($this->Lang("error_database_converted_already")));
}
$sFileQuery = @file_get_contents($sFilePath);
if(!$sFileQuery) return array('result'=>false,'errors'=>array($this->Lang("config_file_not_exists", array('path'=>$sFilePath))));
if(isset($aParams['prefix'])) $sFileQuery = str_replace('prefix_', $aParams['prefix'], $sFileQuery);
$aQuery=explode(';',$sFileQuery);
/**
* Массив для сбора ошибок
*/
$aErrors = array();
$aErrors = array();
/**
* Выполняем запросы по очереди
@ -1209,7 +1210,7 @@ class Install {
* Заменяем движек, если таковой указан в запросе
*/
if(isset($aParams['engine'])) $sQuery=str_ireplace('ENGINE=InnoDB', "ENGINE={$aParams['engine']}",$sQuery);
if($sQuery!='') {
$bResult=mysql_query($sQuery);
if(!$bResult) $aErrors[] = mysql_error();
@ -1673,7 +1674,7 @@ class Install {
if(count($aErrors)==0) {
return array('result'=>true,'errors'=>null);
}
return array('result'=>false,'errors'=>$aErrors);
return array('result'=>false,'errors'=>$aErrors);
}
/**
* Проверяем, нуждается ли база в конвертации или нет
@ -1791,7 +1792,7 @@ class Install {
protected function ValidateAdminFields() {
$bOk = true;
$aErrors = array();
if(!$sLogin=$this->GetRequest('install_admin_login',false) or !preg_match("/^[\da-z\_\-]{3,30}$/i",$sLogin)) {
$bOk = false;
$aErrors[] = $this->Lang('admin_login_invalid');
@ -1809,9 +1810,9 @@ class Install {
$bOk = false;
$aErrors[] = $this->Lang('admin_repassword_invalid');
}
return array($bOk, $aErrors);
}
}
/**
* Сохраняет данные об администраторе в базу данных
*
@ -1824,13 +1825,13 @@ class Install {
protected function UpdateDBUser($sLogin,$sPassword,$sMail,$sPrefix="prefix_") {
$sQuery = "
UPDATE `{$sPrefix}user`
SET
SET
`user_login` = '{$sLogin}',
`user_mail` = '{$sMail}',
`user_password` = md5('{$sPassword}')
WHERE `user_id` = 1";
return mysql_query($sQuery);
return mysql_query($sQuery);
}
/**
* Перезаписывает название блога в базе данных
@ -1842,7 +1843,7 @@ class Install {
protected function UpdateUserBlog($sBlogName,$sPrefix="prefix_") {
$sQuery = "
UPDATE `{$sPrefix}blog`
SET
SET
`blog_title` = '".mysql_real_escape_string($sBlogName)."'
WHERE `blog_id` = 1";
@ -1860,7 +1861,7 @@ class Install {
if(substr_count($sQuery, "`{$sTable}`")) return true;
}
return false;
}
}
/**
* Отдает список доступных шаблонов
*
@ -1871,7 +1872,7 @@ class Install {
* Получаем список каталогов
*/
$aDir=glob($this->sSkinDir.'/*', GLOB_ONLYDIR);
if(!is_array($aDir)) return array();
return array_map(create_function('$sDir', 'return basename($sDir);'),$aDir);
}
@ -1885,33 +1886,33 @@ class Install {
* Получаем список каталогов
*/
$aDir=glob($this->sLangDir.'/*.php');
if(!is_array($aDir)) return array();
return array_map(create_function('$sDir', 'return basename($sDir,".php");'),$aDir);
}
}
/**
* Сохраняет в конфигурации абсолютные пути
* Сохраняет в конфигурации абсолютные пути
*
* @access protected
* @return null
*/
protected function SavePath() {
$sLocalConfigFile = $this->sConfigDir.'/'.self::LOCAL_CONFIG_FILE_NAME;
$this->SaveConfig('path.root.web',$this->GetPathRootWeb(), $sLocalConfigFile);
$this->SaveConfig('path.root.server', $this->GetPathRootServer(), $sLocalConfigFile);
$this->SaveConfig('path.root.web',$this->GetPathRootWeb(), $sLocalConfigFile);
$this->SaveConfig('path.root.server', $this->GetPathRootServer(), $sLocalConfigFile);
$aDirs=array();
$sDirs=trim(str_replace('http://'.$_SERVER['HTTP_HOST'],'',$this->GetPathRootWeb()),'/');
if ($sDirs!='') {
$aDirs=explode('/',$sDirs);
}
}
$this->SaveConfig('path.offset_request_url', count($aDirs), $sLocalConfigFile);
}
protected function GetPathRootWeb() {
return rtrim('http://'.$_SERVER['HTTP_HOST'],'/').str_replace('/install/index.php','',$_SERVER['PHP_SELF']);
}
protected function GetPathRootServer() {
return rtrim(dirname(dirname(__FILE__)),'/');
}

View file

@ -11,7 +11,7 @@
<a href="{$oWallUser->getUserWebPath()}">
<img src="{$oWallUser->getProfileAvatarPath(48)}" alt="avatar" class="comment-avatar" />
</a>
<ul class="comment-info">
<li class="comment-author"><a href="{$oWallUser->getUserWebPath()}">{$oWallUser->getLogin()}</a></li>
<li class="comment-date">
@ -28,20 +28,20 @@
<div class="comment-content text">
{$oWall->getText()}
</div>
{if $oUserCurrent and ! $aReplyWall}
<ul class="comment-actions">
<li><a href="#" class="link-dotted" onclick="return ls.wall.toggleReply({$oWall->getId()});">{$aLang.wall_action_reply}</a></li>
</ul>
{/if}
</div>
{if count($aReplyWall) < $oWall->getCountReply()}
<a href="#" onclick="return ls.wall.loadReplyNext({$oWall->getId()});" id="wall-reply-button-next-{$oWall->getId()}" class="get-more get-more-wall-comments">
<span class="wall-more-inner">
{$aLang.wall_load_reply_more}
<span id="wall-reply-count-next-{$oWall->getId()}">{$oWall->getCountReply()}</span>
{$oWall->getCountReply()|declension:$aLang.comment_declension:'russian'}
{$aLang.wall_load_reply_more}
<span id="wall-reply-count-next-{$oWall->getId()}">{$oWall->getCountReply()}</span>
{$oWall->getCountReply()|declension:$aLang.comment_declension}
</span>
</a>
{/if}
@ -54,10 +54,10 @@
{if $oUserCurrent}
<form class="wall-submit wall-submit-reply" {if !$aReplyWall}style="display: none"{/if}>
<textarea rows="4"
id="wall-reply-text-{$oWall->getId()}"
class="input-text input-width-full js-wall-reply-text"
placeholder="{$aLang.wall_reply_placeholder}"
<textarea rows="4"
id="wall-reply-text-{$oWall->getId()}"
class="input-text input-width-full js-wall-reply-text"
placeholder="{$aLang.wall_reply_placeholder}"
onclick="return ls.wall.expandReply({$oWall->getId()});"></textarea>
<button type="button" onclick="ls.wall.addReply(jQuery('#wall-reply-text-{$oWall->getId()}').val(), {$oWall->getId()});" class="button button-primary js-button-wall-submit">{$aLang.wall_reply_submit}</button>
</form>

View file

@ -15,18 +15,18 @@
{block name='block_class'}block-type-blog{/block}
{block name='block_content'}
<span id="blog_user_count_{$oBlog->getId()}">{$oBlog->getCountUser()}</span>
{$oBlog->getCountUser()|declension:$aLang.reader_declension:'russian'}<br />
{$oBlog->getCountTopic()} {$oBlog->getCountTopic()|declension:$aLang.topic_declension:'russian'}
<span id="blog_user_count_{$oBlog->getId()}">{$oBlog->getCountUser()}</span>
{$oBlog->getCountUser()|declension:$aLang.reader_declension}<br />
{$oBlog->getCountTopic()} {$oBlog->getCountTopic()|declension:$aLang.topic_declension}
<br />
<br />
{if $oUserCurrent and $oUserCurrent->getId() != $oBlog->getOwnerId()}
<button type="submit"
class="button button-primary {if $oBlog->getUserIsJoin()}active{/if}"
id="blog-join"
data-only-text="1"
<button type="submit"
class="button button-primary {if $oBlog->getUserIsJoin()}active{/if}"
id="blog-join"
data-only-text="1"
onclick="ls.blog.toggleJoin(this,{$oBlog->getId()}); return false;">{if $oBlog->getUserIsJoin()}{$aLang.blog_leave}{else}{$aLang.blog_join}{/if}</button>&nbsp;&nbsp;
{/if}

View file

@ -11,17 +11,17 @@
{$oUser = $oComment->getUser()}
{$oTopic = $oComment->getTarget()}
{$oBlog = $oTopic->getBlog()}
<li class="js-title-comment" title="{$oComment->getText()|strip_tags|trim|truncate:100:'...'|escape:'html'}">
<a href="{$oUser->getUserWebPath()}"><img src="{$oUser->getProfileAvatarPath(48)}" alt="avatar" class="avatar" /></a>
<a href="{$oUser->getUserWebPath()}" class="author">{$oUser->getLogin()}</a> &rarr;
<a href="{$oBlog->getUrlFull()}" class="blog-name">{$oBlog->getTitle()|escape:'html'}</a> &rarr;
<a href="{if $oConfig->GetValue('module.comment.nested_per_page')}{router page='comments'}{else}{$oTopic->getUrl()}#comment{/if}{$oComment->getId()}">{$oTopic->getTitle()|escape:'html'}</a>
<p>
<time datetime="{date_format date=$oComment->getDate() format='c'}">{date_format date=$oComment->getDate() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"}</time> |
{$oTopic->getCountComment()}&nbsp;{$oTopic->getCountComment()|declension:$aLang.comment_declension:'russian'}
{$oTopic->getCountComment()}&nbsp;{$oTopic->getCountComment()|declension:$aLang.comment_declension}
</p>
</li>
{/foreach}

View file

@ -8,22 +8,22 @@
<div class="block-content">
<ul class="item-list">
{foreach $oTopics as $oTopic}
{$oUser = $oTopic->getUser()}
{$oUser = $oTopic->getUser()}
{$oBlog = $oTopic->getBlog()}
<li class="js-title-topic" title="{$oTopic->getText()|strip_tags|trim|truncate:150:'...'|escape:'html'}">
<a href="{$oUser->getUserWebPath()}"><img src="{$oUser->getProfileAvatarPath(48)}" alt="avatar" class="avatar" /></a>
<a href="{$oUser->getUserWebPath()}" class="author">{$oUser->getLogin()}</a> &rarr;
<a href="{$oBlog->getUrlFull()}" class="blog-name">{$oBlog->getTitle()|escape:'html'}</a> &rarr;
<a href="{$oTopic->getUrl()}">{$oTopic->getTitle()|escape:'html'}</a>
<p>
<time datetime="{date_format date=$oTopic->getDate() format='c'}">{date_format date=$oTopic->getDateAdd() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"}</time> |
{$oTopic->getCountComment()} {$oTopic->getCountComment()|declension:$aLang.comment_declension:'russian'}
{$oTopic->getCountComment()} {$oTopic->getCountComment()|declension:$aLang.comment_declension}
</p>
</li>
{/foreach}
</li>
{/foreach}
</ul>
</div>

View file

@ -19,23 +19,23 @@
<div class="comments" id="comments">
<header class="comments-header">
<h3>
<span id="count-comments">{$iCountComment}</span>
{$iCountComment|declension:$aLang.comment_declension:'russian'}
<span id="count-comments">{$iCountComment}</span>
{$iCountComment|declension:$aLang.comment_declension}
</h3>
{* Подписка на комментарии *}
{if $bAllowSubscribe and $oUserCurrent}
<label class="comments-subscribe">
<input
type="checkbox"
id="comment_subscribe"
class="input-checkbox"
<input
type="checkbox"
id="comment_subscribe"
class="input-checkbox"
onchange="ls.subscribe.toggle('{$sTargetType}_new_comment','{$iTargetId}','',this.checked);"
{if $oSubscribeComment and $oSubscribeComment->getStatus()}checked{/if}>
{$aLang.comment_subscribe}
</label>
{/if}
<a name="comments"></a>
</header>
@ -47,29 +47,29 @@
{foreach $aComments as $oComment}
{$iCommentLevel = $oComment->getLevel()}
{if $iCommentLevel > $iMaxLevel}
{$iCommentLevel = $iMaxLevel}
{/if}
{if $iCurrentLevel > $iCommentLevel}
{if $iCurrentLevel > $iCommentLevel}
{section name=closelist1 loop=$iCurrentLevel - $iCommentLevel + 1}</div>{/section}
{elseif $iCurrentLevel == $iCommentLevel && ! $oComment@first}
</div>
{/if}
<div class="comment-wrapper" id="comment_wrapper_id_{$oComment->getId()}">
{include file='comments/comment.tpl'}
{$iCurrentLevel = $iCommentLevel}
{if $oComment@last}
{section name=closelist2 loop=$iCurrentLevel + 1}</div>{/section}
{section name=closelist2 loop=$iCurrentLevel + 1}</div>{/section}
{/if}
{/foreach}
</div>
{**
* Страницы
@ -93,22 +93,22 @@
<h4 class="comment-reply-header" id="comment_id_0">
<a href="#" class="link-dotted" onclick="ls.comments.toggleCommentForm(0); return false;">{$sNoticeCommentAdd}</a>
</h4>
{* Форма *}
<div id="reply" class="comment-reply">
<div id="reply" class="comment-reply">
<form method="post" id="form_comment" onsubmit="return false;" enctype="multipart/form-data">
{hook run='form_add_comment_begin'}
<textarea name="comment_text" id="form_comment_text" class="js-editor input-width-full"></textarea>
{hook run='form_add_comment_end'}
<input type="hidden" name="reply" value="0" id="form_comment_reply" />
<input type="hidden" name="cmt_target_id" value="{$iTargetId}" />
<button type="submit" name="submit_comment"
id="comment-button-submit"
onclick="ls.comments.add('form_comment',{$iTargetId},'{$sTargetType}'); return false;"
<button type="submit" name="submit_comment"
id="comment-button-submit"
onclick="ls.comments.add('form_comment',{$iTargetId},'{$sTargetType}'); return false;"
class="button button-primary">{$aLang.comment_add}</button>
<button type="button" onclick="ls.comments.preview();" class="button">{$aLang.comment_preview}</button>
</form>

View file

@ -29,7 +29,7 @@
{$sSettings = 'ls.settings.get("tinymceComment")'}
{else}
{hook run='editor_init_wysiwyg_settings' sEditorType=$sEditorType assign='sSettings'}
{if ! $sSettings}
{$sSettings = 'ls.settings.get("tinymce")'}
{/if}
@ -39,9 +39,9 @@
<script>
jQuery(function($) {
tinyMCE.init($.extend({ }, {$sSettings}, {
tinyMCE.init($.extend({ }, {$sSettings}, {
editor_selector : '{$sEditorSelector}',
language : {if $oConfig->GetValue('lang.current') == 'russian'}'ru'{else}'en'{/if}
language : {$oConfig->GetValue('lang.current')}
}));
});
</script>
@ -56,18 +56,18 @@
{$sSettings = 'ls.settings.get("markitupComment")'}
{else}
{hook run='editor_init_markup_settings' sEditorType=$sEditorType assign='sSettings'}
{if ! $sSettings}
{$sSettings = 'ls.settings.get("markitup")'}
{/if}
{/if}
<script src="{cfg name='path.static.framework'}/js/vendor/markitup/jquery.markitup.js"></script>
<script>
jQuery(function($) {
ls.lang.load({lang_load name="panel_b,panel_i,panel_u,panel_s,panel_url,panel_url_promt,panel_code,panel_video,panel_image,panel_cut,panel_quote,panel_list,panel_list_ul,panel_list_ol,panel_title,panel_clear_tags,panel_video_promt,panel_list_li,panel_image_promt,panel_user,panel_user_promt"});
$('.{$sEditorSelector}').markItUp({$sSettings});
});
</script>

View file

@ -20,23 +20,23 @@
<header class="topic-header">
{* Заголовок *}
<h1 class="topic-title word-wrap">
{if $oTopic->getPublish() == 0}
{if $oTopic->getPublish() == 0}
<i class="icon-file" title="{$aLang.topic_unpublish}"></i>
{/if}
{block name='topic_icon'}{/block}
{if $bTopicList}
<a href="{$oTopic->getUrl()}">{$oTopic->getTitle()|escape:'html'}</a>
{else}
{$oTopic->getTitle()|escape:'html'}
{/if}
</h1>
{* Информация *}
<div class="topic-info">
<a href="{$oBlog->getUrlFull()}" class="topic-blog">{$oBlog->getTitle()|escape:'html'}</a>
<time datetime="{date_format date=$oTopic->getDateAdd() format='c'}" title="{date_format date=$oTopic->getDateAdd() format='j F Y, H:i'}">
{date_format date=$oTopic->getDateAdd() format="j F Y, H:i"}
</time>
@ -50,9 +50,9 @@
{if $oTopic->getIsAllowDelete()}
<li>
<a href="{router page='topic'}delete/{$oTopic->getId()}/?security_ls_key={$LIVESTREET_SECURITY_KEY}"
title="{$aLang.topic_delete}"
onclick="return confirm('{$aLang.topic_delete_confirm}');"
<a href="{router page='topic'}delete/{$oTopic->getId()}/?security_ls_key={$LIVESTREET_SECURITY_KEY}"
title="{$aLang.topic_delete}"
onclick="return confirm('{$aLang.topic_delete_confirm}');"
class="actions-delete">{$aLang.topic_delete}</a>
</li>
{/if}
@ -77,7 +77,7 @@
{hook run='topic_content_end' topic=$oTopic bTopicList=$bTopicList}
</div>
{/block}
{block name='topic_content_after'}{/block}
@ -91,21 +91,21 @@
{* Теги *}
<ul class="topic-tags js-favourite-insert-after-form js-favourite-tags-topic-{$oTopic->getId()}">
<li>{$aLang.topic_tags}:</li>
{strip}
{foreach $oTopic->getTagsArray() as $sTag}
<li>{if ! $sTag@first}, {/if}<a rel="tag" href="{router page='tag'}{$sTag|escape:'url'}/">{$sTag|escape}</a></li>
{foreachelse}
<li>{$aLang.topic_tags_empty}</li>
{/foreach}
{if $oUserCurrent}
{if $oFavourite}
{foreach $oFavourite->getTagsArray() as $sTag}
<li class="topic-tags-user js-favourite-tag-user">, <a rel="tag" href="{$oUserCurrent->getUserWebPath()}favourites/topics/tag/{$sTag|escape:'url'}/">{$sTag|escape}</a></li>
{/foreach}
{/if}
<li class="topic-tags-edit js-favourite-tag-edit" {if !$oFavourite}style="display:none;"{/if}>
<a href="#" onclick="return ls.favourite.showEditTags({$oTopic->getId()},'topic',this);" class="link-dotted">{$aLang.favourite_form_tags_button_show}</a>
</li>
@ -126,7 +126,7 @@
data-option-url="{router page='ajax'}vote/get/info/"
data-vote-type="topic"
data-vote-id="{$oTopic->getId()}"
class="vote js-vote
class="vote js-vote
{if $oVote || ($oUserCurrent && $oTopic->getUserId() == $oUserCurrent->getId()) || strtotime($oTopic->getDateAdd()) < $smarty.now-$oConfig->GetValue('acl.vote.topic.limit_time')}
{if $oTopic->getRating() > 0}
vote-count-positive
@ -134,10 +134,10 @@
vote-count-negative
{/if}
{/if}
{if $oVote}
{if $oVote}
voted
{if $oVote->getDirection() > 0}
voted-up
{elseif $oVote->getDirection() < 0}
@ -150,8 +150,8 @@
<div class="vote-count js-vote-rating">
{if $bShowVoteInfo}
{if $oTopic->getRating() > 0}+{/if}{$oTopic->getRating()}
{else}
<a href="#" class="js-vote-abstain">?</a>
{else}
<a href="#" class="js-vote-abstain">?</a>
{/if}
</div>
<div class="vote-down js-vote-down"></div>
@ -162,19 +162,19 @@
{* Избранное *}
<li class="topic-info-favourite">
<div onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');"
class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"
<div onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');"
class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"
title="{if $oTopic->getIsFavourite()}{$aLang.talk_favourite_del}{else}{$aLang.talk_favourite_add}{/if}"></div>
<span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}" {if ! $oTopic->getCountFavourite()}style="display: none"{/if}>{$oTopic->getCountFavourite()}</span>
</li>
{* Поделиться *}
<li class="topic-info-share"><a href="#" class="icon-share js-popover-default" title="{$aLang.topic_share}" data-type="popover-toggle" data-option-target="topic_share_{$oTopic->getId()}"></a></li>
{* Ссылка на комментарии *}
{if $bTopicList}
<li class="topic-info-comments">
<a href="{$oTopic->getUrl()}#comments" title="{$aLang.topic_comment_read}">{$oTopic->getCountComment()} {$oTopic->getCountComment()|declension:$aLang.comment_declension:'russian'}</a>
<a href="{$oTopic->getUrl()}#comments" title="{$aLang.topic_comment_read}">{$oTopic->getCountComment()} {$oTopic->getCountComment()|declension:$aLang.comment_declension}</a>
{if $oTopic->getCountCommentNew()}<span>+{$oTopic->getCountCommentNew()}</span>{/if}
</li>
{/if}
@ -183,7 +183,7 @@
{hook run='topic_show_info' topic=$oTopic}
</ul>
{* Всплывающий блок появляющийся при нажатии на кнопку Поделиться *}
<div class="popover" data-type="popover-target" id="topic_share_{$oTopic->getId()}">
<div class="popover-arrow"></div><div class="popover-arrow-inner"></div>
@ -201,7 +201,7 @@
{block name='topic_footer_end'}{/block}
</footer>
{/block}
{block name='topic_footer_after'}{/block}
</article>

View file

@ -33,7 +33,7 @@
<img src="{$oBlog->getAvatarPath(48)}" alt="avatar" class="blog-avatar" />
<h2 class="page-header blog-title">
{$oBlog->getTitle()|escape:'html'}
{$oBlog->getTitle()|escape:'html'}
{if $oBlog->getType() == 'close'}
<i title="{$aLang.blog_closed}" class="icon-synio-topic-private"></i>
@ -50,10 +50,10 @@
{elseif $oBlog->getRating() == 0}
vote-count-zero
{/if}
{if $oVote}
voted
{if $oVote}
voted
{if $oVote->getDirection() > 0}
voted-up
{elseif $oVote->getDirection() < 0}
@ -62,7 +62,7 @@
{else}
not-voted
{/if}
{if ($oUserCurrent && $oUserOwner->getId() == $oUserCurrent->getId())}
vote-nobuttons
{/if}">
@ -81,20 +81,20 @@
<a href="#" class="link-dotted" id="js-blog-toggle" onclick="ls.blog.toggleInfo(); return false;">{$aLang.blog_expand_info}</a>
{if $oUserCurrent and $oUserCurrent->getId() != $oBlog->getOwnerId()}
<button type="submit"
class="button button-small"
id="button-blog-join-first-{$oBlog->getId()}"
data-button-additional="button-blog-join-second-{$oBlog->getId()}"
data-only-text="1"
<button type="submit"
class="button button-small"
id="button-blog-join-first-{$oBlog->getId()}"
data-button-additional="button-blog-join-second-{$oBlog->getId()}"
data-only-text="1"
onclick="ls.blog.toggleJoin(this, {$oBlog->getId()}); return false;">
{if $oBlog->getUserIsJoin()}{$aLang.blog_leave}{else}{$aLang.blog_join}{/if}
</button>
{/if}
</div>
<span id="blog_user_count_{$oBlog->getId()}">{$iCountBlogUsers}</span>
{$iCountBlogUsers|declension:$aLang.reader_declension:'russian'},
{$oBlog->getCountTopic()} {$oBlog->getCountTopic()|declension:$aLang.topic_declension:'russian'}
<span id="blog_user_count_{$oBlog->getId()}">{$iCountBlogUsers}</span>
{$iCountBlogUsers|declension:$aLang.reader_declension},
{$oBlog->getCountTopic()} {$oBlog->getCountTopic()|declension:$aLang.topic_declension}
</div>
@ -104,8 +104,8 @@
<div class="blog-full-info" id="js-blog-full-info">
<div class="blog-content">
<div class="blog-description text">{$oBlog->getDescription()}</div>
<ul class="dotted-list blog-info">
<li class="dotted-list-item">
<span class="dotted-list-item-label">{$aLang.infobox_blog_create}</span>
@ -124,50 +124,50 @@
<span class="dotted-list-item-value">{$oBlog->getRating()}</span>
</li>
</ul>
{hook run='blog_info_begin' oBlog=$oBlog}
<h4>{$aLang.blog_user_administrators} ({$iCountBlogAdministrators})</h4>
{* Создатель блога *}
<span class="user-avatar">
<a href="{$oUserOwner->getUserWebPath()}"><img src="{$oUserOwner->getProfileAvatarPath(24)}" alt="avatar" /></a>
<a href="{$oUserOwner->getUserWebPath()}"><img src="{$oUserOwner->getProfileAvatarPath(24)}" alt="avatar" /></a>
<a href="{$oUserOwner->getUserWebPath()}">{$oUserOwner->getLogin()}</a>
</span>
{* Список администраторов блога *}
{if $aBlogAdministrators}
{if $aBlogAdministrators}
{foreach $aBlogAdministrators as $oBlogUser}
{$oUser = $oBlogUser->getUser()}
<span class="user-avatar">
<a href="{$oUser->getUserWebPath()}"><img src="{$oUser->getProfileAvatarPath(24)}" alt="avatar" /></a>
<a href="{$oUser->getUserWebPath()}"><img src="{$oUser->getProfileAvatarPath(24)}" alt="avatar" /></a>
<a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a>
</span>
{/foreach}
{/if}<br /><br />
{/foreach}
{/if}<br /><br />
{* Список модераторов блога *}
<h4>{$aLang.blog_user_moderators} ({$iCountBlogModerators})</h4>
{if $aBlogModerators}
{foreach $aBlogModerators as $oBlogUser}
{if $aBlogModerators}
{foreach $aBlogModerators as $oBlogUser}
{$oUser = $oBlogUser->getUser()}
<span class="user-avatar">
<a href="{$oUser->getUserWebPath()}"><img src="{$oUser->getProfileAvatarPath(24)}" alt="avatar" /></a>
<a href="{$oUser->getUserWebPath()}"><img src="{$oUser->getProfileAvatarPath(24)}" alt="avatar" /></a>
<a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a>
</span>
{/foreach}
{/foreach}
{else}
<span class="notice-empty">{$aLang.blog_user_moderators_empty}</span>
{/if}
{hook run='blog_info_end' oBlog=$oBlog}
{if $oUserCurrent and ($oUserCurrent->getId()==$oBlog->getOwnerId() or $oUserCurrent->isAdministrator() or $oBlog->getUserIsAdministrator() )}
<br /><br />
<ul class="actions">
@ -182,11 +182,11 @@
</ul>
{/if}
</div>
<footer class="blog-footer">
<a href="{router page='rss'}blog/{$oBlog->getUrl()}/" class="blog-rss">RSS</a>
<div class="blog-admin">
{$aLang.blogs_owner}
<span class="user-avatar">

View file

@ -9,7 +9,7 @@
<div id="wall-item-{$oWall->getId()}" class="js-wall-item wall-item-wrapper">
<div class="wall-item">
<a href="{$oWallUser->getUserWebPath()}"><img src="{$oWallUser->getProfileAvatarPath(48)}" alt="avatar" class="avatar" /></a>
<p class="info">
<a href="{$oWallUser->getUserWebPath()}">{$oWallUser->getLogin()}</a> ·
<time class="date" datetime="{date_format date=$oWall->getDateAdd() format='c'}">{date_format date=$oWall->getDateAdd() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"}</time>
@ -18,7 +18,7 @@
<div class="wall-item-content text">
{$oWall->getText()}
</div>
{if $oUserCurrent}
<ul class="actions wall-item-actions">
{if $oUserCurrent and !$aReplyWall}
@ -30,15 +30,15 @@
</ul>
{/if}
</div>
{if $aReplyWall}
<div class="wall-item-replies" id="wall-item-replies-{$oWall->getId()}">
{if count($aReplyWall) < $oWall->getCountReply()}
<a href="#" onclick="return ls.wall.loadReplyNext({$oWall->getId()});" id="wall-reply-button-next-{$oWall->getId()}" class="get-more get-more-wall-comments">
<span class="wall-more-inner">{$aLang.wall_load_reply_more} <span id="wall-reply-count-next-{$oWall->getId()}">{$oWall->getCountReply()}</span> {$oWall->getCountReply()|declension:$aLang.comment_declension:'russian'}</span>
<span class="wall-more-inner">{$aLang.wall_load_reply_more} <span id="wall-reply-count-next-{$oWall->getId()}">{$oWall->getCountReply()}</span> {$oWall->getCountReply()|declension:$aLang.comment_declension}</span>
</a>
{/if}
{if $aReplyWall}
<div class="wall-item-container" id="wall-reply-container-{$oWall->getId()}">
{include file='actions/ActionProfile/wall.comments.tpl'}
@ -46,7 +46,7 @@
{/if}
</div>
{/if}
{if $oUserCurrent}
<form class="wall-submit wall-submit-reply" {if !$aReplyWall}style="display: none"{/if}>
<textarea rows="4" id="wall-reply-text-{$oWall->getId()}" class="width-full js-wall-reply-text" placeholder="{$aLang.wall_reply_placeholder}" onclick="return ls.wall.expandReply({$oWall->getId()});"></textarea>

View file

@ -15,16 +15,16 @@
{block name='block_class'}block-type-blog{/block}
{block name='block_content'}
<span id="blog_user_count_{$oBlog->getId()}">{$oBlog->getCountUser()}</span> {$oBlog->getCountUser()|declension:$aLang.reader_declension:'russian'}<br />
{$oBlog->getCountTopic()} {$oBlog->getCountTopic()|declension:$aLang.topic_declension:'russian'}
<span id="blog_user_count_{$oBlog->getId()}">{$oBlog->getCountUser()}</span> {$oBlog->getCountUser()|declension:$aLang.reader_declension}<br />
{$oBlog->getCountTopic()} {$oBlog->getCountTopic()|declension:$aLang.topic_declension}
{/block}
{block name='block_footer'}
{if $oUserCurrent and $oUserCurrent->getId() != $oBlog->getOwnerId()}
<button type="submit"
class="button button-small"
id="blog-join"
data-only-text="1"
<button type="submit"
class="button button-small"
id="blog-join"
data-only-text="1"
onclick="ls.blog.toggleJoin(this,{$oBlog->getId()}); return false;">{if $oBlog->getUserIsJoin()}{$aLang.blog_leave}{else}{$aLang.blog_join}{/if}</button>
{/if}

View file

@ -19,23 +19,23 @@
<div class="comments" id="comments">
<header class="comments-header">
<h3>
<span id="count-comments">{$iCountComment}</span>
{$iCountComment|declension:$aLang.comment_declension:'russian'}
<span id="count-comments">{$iCountComment}</span>
{$iCountComment|declension:$aLang.comment_declension}
</h3>
{* Подписка на комментарии *}
{if $bAllowSubscribe and $oUserCurrent}
<label class="comments-subscribe">
<input
type="checkbox"
id="comment_subscribe"
class="input-checkbox"
<input
type="checkbox"
id="comment_subscribe"
class="input-checkbox"
onchange="ls.subscribe.toggle('{$sTargetType}_new_comment','{$iTargetId}','',this.checked);"
{if $oSubscribeComment and $oSubscribeComment->getStatus()}checked{/if}>
{$aLang.comment_subscribe}
</label>
{/if}
<a name="comments"></a>
</header>
@ -47,29 +47,29 @@
{foreach $aComments as $oComment}
{$iCommentLevel = $oComment->getLevel()}
{if $iCommentLevel > $iMaxLevel}
{$iCommentLevel = $iMaxLevel}
{/if}
{if $iCurrentLevel > $iCommentLevel}
{if $iCurrentLevel > $iCommentLevel}
{section name=closelist1 loop=$iCurrentLevel - $iCommentLevel + 1}</div>{/section}
{elseif $iCurrentLevel == $iCommentLevel && ! $oComment@first}
</div>
{/if}
<div class="comment-wrapper" id="comment_wrapper_id_{$oComment->getId()}">
{include file='comments/comment.tpl'}
{$iCurrentLevel = $iCommentLevel}
{if $oComment@last}
{section name=closelist2 loop=$iCurrentLevel + 1}</div>{/section}
{section name=closelist2 loop=$iCurrentLevel + 1}</div>{/section}
{/if}
{/foreach}
</div>
{**
* Страницы
@ -93,22 +93,22 @@
<h4 class="comment-reply-header" id="comment_id_0">
<a href="#" class="link-dotted" onclick="ls.comments.toggleCommentForm(0); return false;">{$sNoticeCommentAdd}</a>
</h4>
{* Форма *}
<div id="reply" class="comment-reply">
<div id="reply" class="comment-reply">
<form method="post" id="form_comment" onsubmit="return false;" enctype="multipart/form-data">
{hook run='form_add_comment_begin'}
<textarea name="comment_text" id="form_comment_text" class="js-editor input-width-full"></textarea>
{hook run='form_add_comment_end'}
<input type="hidden" name="reply" value="0" id="form_comment_reply" />
<input type="hidden" name="cmt_target_id" value="{$iTargetId}" />
<button type="submit" name="submit_comment"
id="comment-button-submit"
onclick="ls.comments.add('form_comment',{$iTargetId},'{$sTargetType}'); return false;"
<button type="submit" name="submit_comment"
id="comment-button-submit"
onclick="ls.comments.add('form_comment',{$iTargetId},'{$sTargetType}'); return false;"
class="button button-primary">{$aLang.comment_add}</button>
<button type="button" onclick="ls.comments.preview();" class="button">{$aLang.comment_preview}</button>
</form>

View file

@ -29,7 +29,7 @@
{$sSettings = 'ls.settings.get("tinymceComment")'}
{else}
{hook run='editor_init_wysiwyg_settings' sEditorType=$sEditorType assign='sSettings'}
{if ! $sSettings}
{$sSettings = 'ls.settings.get("tinymce")'}
{/if}
@ -39,9 +39,9 @@
<script>
jQuery(function($) {
tinyMCE.init($.extend({ }, {$sSettings}, {
tinyMCE.init($.extend({ }, {$sSettings}, {
editor_selector : '{$sEditorSelector}',
language : {if $oConfig->GetValue('lang.current') == 'russian'}'ru'{else}'en'{/if}
language : {$oConfig->GetValue('lang.current')}
}));
});
</script>
@ -56,18 +56,18 @@
{$sSettings = 'ls.settings.get("markitupComment")'}
{else}
{hook run='editor_init_markup_settings' sEditorType=$sEditorType assign='sSettings'}
{if ! $sSettings}
{$sSettings = 'ls.settings.get("markitup")'}
{/if}
{/if}
<script src="{cfg name='path.static.framework'}/js/vendor/markitup/jquery.markitup.js"></script>
<script>
jQuery(function($) {
ls.lang.load({lang_load name="panel_b,panel_i,panel_u,panel_s,panel_url,panel_url_promt,panel_code,panel_video,panel_image,panel_cut,panel_quote,panel_list,panel_list_ul,panel_list_ol,panel_title,panel_clear_tags,panel_video_promt,panel_list_li,panel_image_promt,panel_user,panel_user_promt"});
$('.{$sEditorSelector}').markItUp({$sSettings});
});
</script>

View file

@ -14,14 +14,14 @@
<a href="#" class="modal-close" data-type="modal-close"></a>
</header>
{/block}
{block name='modal_content'}
{strip}
<ul class="write-list">
{if $iUserCurrentCountTopicDraft}
<li class="write-item-type-draft">
<a href="{router page='topic'}drafts/" class="write-item-image"></a>
<a href="{router page='topic'}drafts/" class="write-item-link">{$iUserCurrentCountTopicDraft} {$iUserCurrentCountTopicDraft|declension:$aLang.draft_declension:'russian'}</a>
<a href="{router page='topic'}drafts/" class="write-item-link">{$iUserCurrentCountTopicDraft} {$iUserCurrentCountTopicDraft|declension:$aLang.draft_declension}</a>
</li>
{/if}
<li class="write-item-type-topic">