diff --git a/application/classes/actions/ActionAjax.class.php b/application/classes/actions/ActionAjax.class.php
index 59fc67a3..301cc3fa 100644
--- a/application/classes/actions/ActionAjax.class.php
+++ b/application/classes/actions/ActionAjax.class.php
@@ -84,8 +84,6 @@ class ActionAjax extends Action
$this->AddEventPreg('/^geo$/i', '/^get/', '/^regions$/', 'EventGeoGetRegions');
$this->AddEventPreg('/^geo$/i', '/^get/', '/^cities$/', 'EventGeoGetCities');
- $this->AddEventPreg('/^infobox$/i', '/^info$/', '/^blog$/', 'EventInfoboxInfoBlog');
-
$this->AddEventPreg('/^media$/i', '/^upload$/', '/^$/', 'EventMediaUpload');
$this->AddEventPreg('/^media$/i', '/^upload-link$/', '/^$/', 'EventMediaUploadLink');
$this->AddEventPreg('/^media$/i', '/^generate-target-tmp$/', '/^$/', 'EventMediaGenerateTargetTmp');
@@ -192,14 +190,14 @@ class ActionAjax extends Action
* Истекло время голосования?
*/
if (!$oPoll->isAllowVote()) {
- $this->Message_AddErrorSingle('В этом опросе уже нельзя голосовать');
+ $this->Message_AddErrorSingle($this->Lang_Get('poll.notices.error_not_allow_vote'));
return;
}
/**
* Пользователь уже голосовал?
*/
if ($this->Poll_CheckUserAlreadyVote($oPoll, $this->oUserCurrent)) {
- $this->Message_AddErrorSingle('Вы уже голосовали');
+ $this->Message_AddErrorSingle($this->Lang_Get('poll.notices.error_already_vote'));
return;
}
@@ -210,7 +208,7 @@ class ActionAjax extends Action
* Проверяем варианты ответов
*/
if (!$aAnswer = (array)getRequest('answers')) {
- $this->Message_AddErrorSingle('Необходимо выбрать вариант');
+ $this->Message_AddErrorSingle($this->Lang_Get('poll.notices.error_no_answers'));
return;
}
@@ -234,7 +232,7 @@ class ActionAjax extends Action
* Ограничение на максимальное число ответов
*/
if (count($aAnswerIds) > $oPoll->getCountAnswerMax()) {
- $this->Message_AddErrorSingle('Максимум можно выбрать вариантов: ' . $oPoll->getCountAnswerMax());
+ $this->Message_AddErrorSingle($this->Lang_Get('poll.notices.error_answers_max', array('count' => $oPoll->getCountAnswerMax())));
return;
}
}
@@ -362,7 +360,7 @@ class ActionAjax extends Action
}
if (!$oPoll->isAllowRemove()) {
- $this->Message_AddError('Этот опрос уже нельзя удалить');
+ $this->Message_AddError($this->Lang_Get('poll.notices.error_not_allow_remove'));
return;
}
@@ -847,7 +845,7 @@ class ActionAjax extends Action
}
if (!($aMediaItems = $this->Media_GetAllowMediaItemsById($aIds))) {
- $this->Message_AddError('Необходимо выбрать элементы');
+ $this->Message_AddError($this->Lang_Get('media.error.need_choose_items'));
return false;
}
@@ -874,7 +872,7 @@ class ActionAjax extends Action
{
$aMediaItems = $this->Media_GetAllowMediaItemsById(getRequest('ids'));
if (!$aMediaItems) {
- $this->Message_AddError('Необходимо выбрать элементы');
+ $this->Message_AddError($this->Lang_Get('media.error.need_choose_items'));
return false;
}
@@ -978,40 +976,6 @@ class ActionAjax extends Action
}
}
- /**
- * Вывод информации о блоге
- */
- protected function EventInfoboxInfoBlog()
- {
- /**
- * Если блог существует и он не персональный
- */
- if (!is_string(getRequest('iBlogId'))) {
- return $this->EventErrorDebug();
- }
- if (!($oBlog = $this->Blog_GetBlogById(getRequest('iBlogId'))) or $oBlog->getType() == 'personal') {
- return $this->EventErrorDebug();
- }
- /**
- * Получаем локальный вьюер для рендеринга шаблона
- */
- $oViewer = $this->Viewer_GetLocalViewer();
-
- $oViewer->Assign('oBlog', $oBlog);
- if ($oBlog->getType() != 'close' or $oBlog->getUserIsJoin()) {
- /**
- * Получаем последний топик
- */
- $aResult = $this->Topic_GetTopicsByFilter(array('blog_id' => $oBlog->getId(), 'topic_publish' => 1), 1, 1);
- $oViewer->Assign('oTopicLast', reset($aResult['collection']));
- }
- $oViewer->Assign('oUserCurrent', $this->oUserCurrent);
- /**
- * Устанавливаем переменные для ajax ответа
- */
- $this->Viewer_AssignAjax('sText', $oViewer->Fetch("actions/ActionBlogs/popover.blog.info.tpl"));
- }
-
/**
* Получение информации о голосовании за топик
*/
@@ -1797,7 +1761,7 @@ class ActionAjax extends Action
if ($bReturnExtended) {
$aItems[] = array(
'value' => $oUser->getId(),
- 'label' => $oUser->getDisplayName(),
+ 'label' => $oUser->getDisplayName(),
);
} else {
$aItems[] = $oUser->getDisplayName();
diff --git a/application/classes/actions/ActionBlogs.class.php b/application/classes/actions/ActionBlogs.class.php
index d03575b6..2b9178b3 100644
--- a/application/classes/actions/ActionBlogs.class.php
+++ b/application/classes/actions/ActionBlogs.class.php
@@ -133,7 +133,7 @@ class ActionBlogs extends Action
if (getRequestStr('relation') == 'my') {
$aFilter['user_owner_id'] = $this->oUserCurrent->getId();
} elseif (getRequestStr('relation') == 'join') {
- $aFilter['roles']=array(ModuleBlog::BLOG_USER_ROLE_USER,ModuleBlog::BLOG_USER_ROLE_ADMINISTRATOR,ModuleBlog::BLOG_USER_ROLE_MODERATOR);
+ $aFilter['roles'] = array(ModuleBlog::BLOG_USER_ROLE_USER, ModuleBlog::BLOG_USER_ROLE_ADMINISTRATOR, ModuleBlog::BLOG_USER_ROLE_MODERATOR);
}
}
/**
diff --git a/application/classes/actions/ActionContent.class.php b/application/classes/actions/ActionContent.class.php
index 3ff948ea..8fae32d0 100644
--- a/application/classes/actions/ActionContent.class.php
+++ b/application/classes/actions/ActionContent.class.php
@@ -447,7 +447,7 @@ class ActionContent extends Action
}
$this->Viewer_AssignAjax('sUrlRedirect', $sUrlRedirect);
- $this->Message_AddNotice('Обновление прошло успешно', $this->Lang_Get('common.attention'));
+ $this->Message_AddNotice($this->Lang_Get('topic.add.notices.update_complete'), $this->Lang_Get('common.attention'));
} else {
$this->Message_AddErrorSingle($this->Lang_Get('common.error.system.base'));
}
@@ -589,9 +589,9 @@ class ActionContent extends Action
$this->Viewer_AssignAjax('sUrlRedirect', $oTopic->getUrl());
- $this->Message_AddNotice('Добавление прошло успешно', $this->Lang_Get('common.attention'));
+ $this->Message_AddNotice($this->Lang_Get('topic.add.notices.create_complete'), $this->Lang_Get('common.attention'));
} else {
- $this->Message_AddError('Возникла ошибка при добавлении', $this->Lang_Get('common.error.error'));
+ $this->Message_AddError($this->Lang_Get('common.error.error'));
}
} else {
$this->Message_AddError($oTopic->_getValidateError(), $this->Lang_Get('common.error.error'));
diff --git a/application/classes/hooks/HookCopyright.class.php b/application/classes/hooks/HookCopyright.class.php
index 3d84e271..21f77171 100644
--- a/application/classes/hooks/HookCopyright.class.php
+++ b/application/classes/hooks/HookCopyright.class.php
@@ -45,6 +45,6 @@ class HookCopyright extends Hook
/**
* Выводим везде, кроме страницы списка блогов и списка всех комментов
*/
- return '© Powered by LiveStreet CMS';
+ return '© Powered by LiveStreet CMS';
}
}
\ No newline at end of file
diff --git a/application/classes/modules/category/behavior/Entity.behavior.class.php b/application/classes/modules/category/behavior/Entity.behavior.class.php
index 6c61cedb..6b1f6ad5 100644
--- a/application/classes/modules/category/behavior/Entity.behavior.class.php
+++ b/application/classes/modules/category/behavior/Entity.behavior.class.php
@@ -160,18 +160,19 @@ class ModuleCategory_BehaviorEntity extends Behavior
}
if ($this->getParam('validate_require') and !$aCategories) {
- return 'Необходимо выбрать категорию';
+ return $this->Lang_Get('category.notices.validate_require');
}
if (!$this->getParam('multiple') and count($aCategories) > 1) {
$aCategories = array_slice($aCategories, 0, 1);
}
if ($this->getParam('multiple') and $aCategories and (count($aCategories) < $this->getParam('validate_min') or count($aCategories) > $this->getParam('validate_max'))) {
- return 'Количество категорий должно быть от ' . $this->getParam('validate_min') . ' до ' . $this->getParam('validate_max');
+ return $this->Lang_Get('category.notices.validate_count',
+ array('min' => $this->getParam('validate_min'), 'max' => $this->getParam('validate_max')));
}
if ($this->getParam('validate_only_without_children')) {
foreach ($aCategories as $oCategory) {
if ($oCategory->getChildren()) {
- return 'Для выбора доступны только конечные категории';
+ return $this->Lang_Get('category.notices.validate_children');
}
}
}
diff --git a/application/classes/modules/category/entity/Category.entity.class.php b/application/classes/modules/category/entity/Category.entity.class.php
index a39891ce..fb549488 100644
--- a/application/classes/modules/category/entity/Category.entity.class.php
+++ b/application/classes/modules/category/entity/Category.entity.class.php
@@ -59,14 +59,14 @@ class ModuleCategory_EntityCategory extends EntityORM
if ($this->getPid()) {
if ($oCategory = $this->Category_GetCategoryById($this->getPid())) {
if ($oCategory->getId() == $this->getId()) {
- return 'Попытка вложить категорию в саму себя';
+ return $this->Lang_Get('category.notices.validate_recursion');
}
if ($oCategory->getTypeId() != $this->getTypeId()) {
- return 'Неверная родительская категория';
+ return $this->Lang_Get('category.notices.validate_parent');
}
$this->setUrlFull($oCategory->getUrlFull() . '/' . $this->getUrl());
} else {
- return 'Неверная категория';
+ return $this->Lang_Get('category.notices.validate_wrong');
}
} else {
$this->setPid(null);
diff --git a/application/classes/modules/poll/entity/Poll.entity.class.php b/application/classes/modules/poll/entity/Poll.entity.class.php
index efc20262..25b49ed5 100644
--- a/application/classes/modules/poll/entity/Poll.entity.class.php
+++ b/application/classes/modules/poll/entity/Poll.entity.class.php
@@ -135,7 +135,7 @@ class ModulePoll_EntityPoll extends EntityORM
return true;
} else {
if ($iCount < 2) {
- return 'Максимальное количество вариантов ответа должно быть больше одного';
+ return $this->Lang_Get('poll.notices.error_answers_max_wrong');
}
}
return true;
@@ -148,11 +148,8 @@ class ModulePoll_EntityPoll extends EntityORM
}
$aAnswersRaw = $this->getAnswersRaw();
- if (!is_array($aAnswersRaw)) {
- return 'Необходимо заполнить варианты ответов';
- }
- if (count($aAnswersRaw) < 2) {
- return 'Необходимо заполнить больше одного варианта ответов';
+ if (!is_array($aAnswersRaw) or count($aAnswersRaw) < 2) {
+ return $this->Lang_Get('poll.notices.error_answers_count');
}
/**
* Здесь может быть два варианта - создание опроса или редактирование, при редактирование могут передаваться ID ответов
@@ -186,7 +183,7 @@ class ModulePoll_EntityPoll extends EntityORM
foreach ($aAnswersOld as $oAnswer) {
if ($oAnswer->getCountVote()) {
- return 'Нельзя удалить вариант ответа, за который уже голосовали';
+ return $this->Lang_Get('poll.notices.error_answer_remove');
}
}
@@ -205,15 +202,15 @@ class ModulePoll_EntityPoll extends EntityORM
if ($sTargetId) {
$sTargetTmp = null;
if (!$this->Poll_CheckTarget($sTargetType, $sTargetId)) {
- return 'Неверный тип объекта';
+ return $this->Lang_Get('poll.notices.error_target_type');
}
} else {
$sTargetId = null;
if (!$sTargetTmp or !$this->Poll_IsAllowTargetType($sTargetType)) {
- return 'Неверный тип объекта';
+ return $this->Lang_Get('poll.notices.error_target_type');
}
if ($this->Poll_GetPollByFilter(array('target_tmp' => $sTargetTmp, 'target_type <>' => $sTargetType))) {
- return 'Временный идентификатор уже занят';
+ return $this->Lang_Get('poll.notices.error_target_tmp');
}
}
diff --git a/application/classes/modules/property/Property.class.php b/application/classes/modules/property/Property.class.php
index 0d4a0b58..06a2b573 100644
--- a/application/classes/modules/property/Property.class.php
+++ b/application/classes/modules/property/Property.class.php
@@ -282,7 +282,8 @@ class ModuleProperty extends ModuleORM
$oValueType->setValue($oValueType->getValueForValidate());
$aPropertiesResult[$oProperty->getId()] = $oProperty;
} else {
- return 'Поле "' . $oProperty->getTitle() . '": ' . ($sRes ? $sRes : 'неверное значение');
+ return $this->Lang_Get('property.notices.validate_value_wrong',
+ array('field' => $oProperty->getTitle())) . ($sRes ? $sRes : $this->Lang_Get('property.notices.validate_value_wrong_base'));
}
}
$oTarget->setPropertiesObject($aPropertiesResult);
@@ -871,7 +872,7 @@ class ModuleProperty extends ModuleORM
if ($oProperty->Add()) {
return $oProperty;
} else {
- return 'Возникла ошибка при добавлении поля';
+ return $this->Lang_Get('property.notices.create_error');
}
} else {
return $oProperty->_getValidateError();
diff --git a/application/classes/modules/property/entity/Property.entity.class.php b/application/classes/modules/property/entity/Property.entity.class.php
index 5c87a70c..4a5a9655 100644
--- a/application/classes/modules/property/entity/Property.entity.class.php
+++ b/application/classes/modules/property/entity/Property.entity.class.php
@@ -68,14 +68,14 @@ class ModuleProperty_EntityProperty extends EntityORM
if ($this->Property_IsAllowPropertyType($this->getType())) {
return true;
}
- return 'Неверный тип поля';
+ return $this->Lang_Get('property.notices.validate_type');
}
public function ValidateCheckCode()
{
if ($oProperty = $this->Property_GetPropertyByTargetTypeAndCode($this->getTargetType(), $this->getCode())) {
if ($this->getId() != $oProperty->getId()) {
- return 'Код поля должен быть уникальным';
+ return $this->Lang_Get('property.notices.validate_code');
}
}
return true;
diff --git a/application/classes/modules/property/entity/ValueTypeDate.entity.class.php b/application/classes/modules/property/entity/ValueTypeDate.entity.class.php
index d6d9dd02..824b5b69 100644
--- a/application/classes/modules/property/entity/ValueTypeDate.entity.class.php
+++ b/application/classes/modules/property/entity/ValueTypeDate.entity.class.php
@@ -94,7 +94,7 @@ class ModuleProperty_EntityValueTypeDate extends ModuleProperty_EntityValueType
*/
if ($oProperty->getValidateRuleOne('disallowFuture')) {
if ($sTimeFull > time()) {
- return "{$oProperty->getTitle()}: дата не может быть в будущем";
+ return "{$oProperty->getTitle()}: " . $this->Lang_Get('property.notices.validate_value_date_future');
}
}
/**
@@ -103,7 +103,7 @@ class ModuleProperty_EntityValueTypeDate extends ModuleProperty_EntityValueType
if ($oValueObject->_isNew() or strtotime($oValueObject->getValueDate()) != $sTimeFull) {
if ($oProperty->getValidateRuleOne('disallowPast')) {
if ($sTimeFull < time()) {
- return "{$oProperty->getTitle()}: дата не может быть в прошлом";
+ return "{$oProperty->getTitle()}: " . $this->Lang_Get('property.notices.validate_value_date_past');
}
}
}
diff --git a/application/classes/modules/property/entity/ValueTypeFile.entity.class.php b/application/classes/modules/property/entity/ValueTypeFile.entity.class.php
index 58ed78d2..f9006878 100644
--- a/application/classes/modules/property/entity/ValueTypeFile.entity.class.php
+++ b/application/classes/modules/property/entity/ValueTypeFile.entity.class.php
@@ -44,10 +44,10 @@ class ModuleProperty_EntityValueTypeFile extends ModuleProperty_EntityValueType
$oProperty = $oValue->getProperty();
$iPropertyId = $oProperty->getId();
- $bNeedRemove=false;
+ $bNeedRemove = false;
$mValue = $this->getValueForValidate();
if (isset($mValue['remove']) and $mValue['remove']) {
- $bNeedRemove=true;
+ $bNeedRemove = true;
$this->setValueForValidate(array('remove' => true));
}
@@ -62,14 +62,14 @@ class ModuleProperty_EntityValueTypeFile extends ModuleProperty_EntityValueType
} elseif ($aFilePrev = $oValue->getDataOne('file') and isset($aFilePrev['path']) and !$bNeedRemove) {
return true;
} else {
- return 'Необходимо выбрать файл';
+ return $this->Lang_Get('property.notices.validate_value_file_empty');
}
}
/**
* Проверяем на ошибки
*/
if ($sFileError and $sFileError != UPLOAD_ERR_NO_FILE) {
- return "При загрузке файла возникла ошибка - {$sFileError}";
+ return $this->Lang_Get('property.notices.validate_value_file_upload') . " - {$sFileError}";
}
/**
* На корректность загрузки
@@ -81,7 +81,7 @@ class ModuleProperty_EntityValueTypeFile extends ModuleProperty_EntityValueType
* На ограничение по размеру файла
*/
if ($iSizeKb = $oProperty->getValidateRuleOne('size_max') and $iSizeKb * 1024 < $sFileSize) {
- return "Превышен размер файла, максимальный {$iSizeKb}Kb";
+ return $this->Lang_Get('property.notices.validate_value_file_size_max', array('size' => $iSizeKb));
}
/**
* На допустимые типы файлов
@@ -91,7 +91,7 @@ class ModuleProperty_EntityValueTypeFile extends ModuleProperty_EntityValueType
return false;
}
if ($aTypes = $oProperty->getParam('types') and !in_array($aPath['extension'], $aTypes)) {
- return 'Неверный тип файла, допустимы ' . join(', ', $aTypes);
+ return $this->Lang_Get('property.notices.validate_value_file_type', array('types' => join(', ', $aTypes)));
}
/**
* Пробрасываем данные по файлу
@@ -257,7 +257,7 @@ class ModuleProperty_EntityValueTypeFile extends ModuleProperty_EntityValueType
public function getCountDownloads()
{
- $aStats=$this->oValue->getDataOne('stats');
+ $aStats = $this->oValue->getDataOne('stats');
return isset($aStats['count_download']) ? $aStats['count_download'] : 0;
}
diff --git a/application/classes/modules/property/entity/ValueTypeImage.entity.class.php b/application/classes/modules/property/entity/ValueTypeImage.entity.class.php
index 28aa6176..4b2191cc 100644
--- a/application/classes/modules/property/entity/ValueTypeImage.entity.class.php
+++ b/application/classes/modules/property/entity/ValueTypeImage.entity.class.php
@@ -34,7 +34,7 @@ class ModuleProperty_EntityValueTypeImage extends ModuleProperty_EntityValueType
* Показываем превью, в качестве изображения берем первый ресайз из списка размеров
*/
if ($aFile = $this->oValue->getDataOne('file') and isset($aFile['path'])) {
- return '';
+ return '';
}
return $this->getFileFullName();
}
@@ -73,19 +73,19 @@ class ModuleProperty_EntityValueTypeImage extends ModuleProperty_EntityValueType
$aValue = $this->getValueForValidate();
if (isset($aValue['tmp_name'])) {
if (!$aImageInfo = (@getimagesize($aValue['tmp_name']))) {
- return 'Файл не является изображением';
+ return $this->Lang_Get('property.notices.validate_value_image_wrong');
}
/**
* Проверяем на максимальную ширину
*/
if ($iWMax = $oProperty->getValidateRuleOne('width_max') and $iWMax < $aImageInfo[0]) {
- return 'Максимальная допустимая ширина изображения ' . $iWMax . 'px';
+ return $this->Lang_Get('property.notices.validate_value_image_width_max', array('size' => $iWMax));
}
/**
* Проверяем на максимальную высоту
*/
if ($iHMax = $oProperty->getValidateRuleOne('height_max') and $iHMax < $aImageInfo[1]) {
- return 'Максимальная допустимая высота изображения ' . $iHMax . 'px';
+ return $this->Lang_Get('property.notices.validate_value_image_height_max', array('size' => $iHMax));
}
}
diff --git a/application/classes/modules/property/entity/ValueTypeSelect.entity.class.php b/application/classes/modules/property/entity/ValueTypeSelect.entity.class.php
index 9e1e4b94..515d373a 100644
--- a/application/classes/modules/property/entity/ValueTypeSelect.entity.class.php
+++ b/application/classes/modules/property/entity/ValueTypeSelect.entity.class.php
@@ -63,10 +63,10 @@ class ModuleProperty_EntityValueTypeSelect extends ModuleProperty_EntityValueTyp
if (is_array($iValue)) {
if ($oProperty->getValidateRuleOne('allowMany')) {
if ($oProperty->getValidateRuleOne('max') and count($iValue) > $oProperty->getValidateRuleOne('max')) {
- return 'Максимально можно выбрать только ' . $oProperty->getValidateRuleOne('max') . ' элемента';
+ return $this->Lang_Get('property.notices.validate_value_select_max', array('count' => $oProperty->getValidateRuleOne('max')));
}
if ($oProperty->getValidateRuleOne('min') and count($iValue) < $oProperty->getValidateRuleOne('min')) {
- return 'Минимально можно выбрать только ' . $oProperty->getValidateRuleOne('min') . ' элемента';
+ return $this->Lang_Get('property.notices.validate_value_select_min', array('count' => $oProperty->getValidateRuleOne('min')));
}
/**
* Для безопасности
@@ -76,19 +76,19 @@ class ModuleProperty_EntityValueTypeSelect extends ModuleProperty_EntityValueTyp
$aValues[] = (int)$iV;
}
if (count($aValues) == count($this->Property_GetSelectItemsByFilter(array(
- 'property_id' => $oProperty->getId(),
- 'id in' => $aValues
- )))
+ 'property_id' => $oProperty->getId(),
+ 'id in' => $aValues
+ )))
) {
$this->setValueForValidate($aValues);
return true;
} else {
- return 'Проверьте корректность выбранных элементов';
+ return $this->Lang_Get('property.notices.validate_value_select_wrong');
}
} elseif (count($iValue) == 1) {
$iValue = (int)reset($iValue);
} else {
- return 'Можно выбрать только один элемент';
+ return $this->Lang_Get('property.notices.validate_value_select_only_one');
}
}
/**
@@ -113,9 +113,9 @@ class ModuleProperty_EntityValueTypeSelect extends ModuleProperty_EntityValueTyp
if ($mValue) {
if (is_array($mValue)) {
$aSelectItems = $this->Property_GetSelectItemsByFilter(array(
- 'property_id' => $oProperty->getId(),
- 'id in' => $mValue
- ));
+ 'property_id' => $oProperty->getId(),
+ 'id in' => $mValue
+ ));
foreach ($aSelectItems as $oSelect) {
$aValues[$oSelect->getId()] = $oSelect->getValue();
}
@@ -168,9 +168,9 @@ class ModuleProperty_EntityValueTypeSelect extends ModuleProperty_EntityValueTyp
* Удаляем значения select'а из дополнительной таблицы
*/
if ($aSelects = $this->Property_GetValueSelectItemsByFilter(array(
- 'property_id' => $oValue->getPropertyId(),
- 'target_id' => $oValue->getTargetId()
- ))
+ 'property_id' => $oValue->getPropertyId(),
+ 'target_id' => $oValue->getTargetId()
+ ))
) {
foreach ($aSelects as $oSelect) {
$oSelect->Delete();
diff --git a/application/classes/modules/property/entity/ValueTypeVideoLink.entity.class.php b/application/classes/modules/property/entity/ValueTypeVideoLink.entity.class.php
index 73074d32..150133e3 100644
--- a/application/classes/modules/property/entity/ValueTypeVideoLink.entity.class.php
+++ b/application/classes/modules/property/entity/ValueTypeVideoLink.entity.class.php
@@ -45,7 +45,7 @@ class ModuleProperty_EntityValueTypeVideoLink extends ModuleProperty_EntityValue
* Теперь проверяем на принадлежность к разным видео-хостингам
*/
if ($this->getValueForValidate() and !$this->checkVideo($this->getValueForValidate())) {
- return 'Необходимо указать корректную ссылку на видео: YouTube, Vimeo';
+ return $this->Lang_Get('property.notices.validate_value_video_wrong');
}
return true;
} else {
diff --git a/application/classes/modules/rbac/Rbac.class.php b/application/classes/modules/rbac/Rbac.class.php
index 503c099e..a7dfbb75 100644
--- a/application/classes/modules/rbac/Rbac.class.php
+++ b/application/classes/modules/rbac/Rbac.class.php
@@ -215,7 +215,7 @@ class ModuleRbac extends ModuleORM
/**
* Дефолтное сообщение об ошибке
*/
- $sMsg = 'У вас нет прав на "' . $sPermissionCode . '"';
+ $sMsg = $this->Lang_Get('rbac.notices.error_not_allow', array('permission' => $sPermissionCode));
/**
* Проверяем результат кастомной обработки
*/
@@ -235,7 +235,7 @@ class ModuleRbac extends ModuleORM
if ($aPerm['msg_error']) {
$sMsg = $this->Lang_Get($aPerm['msg_error']);
} else {
- $sMsg = 'У вас нет прав на "' . ($aPerm['title'] ? $aPerm['title'] : $aPerm['code']) . '"';
+ $sMsg = $this->Lang_Get('rbac.notices.error_not_allow', array('permission' => $aPerm['title'] ? $aPerm['title'] : $aPerm['code']));
}
}
}
diff --git a/application/classes/modules/rbac/entity/Group.entity.class.php b/application/classes/modules/rbac/entity/Group.entity.class.php
index 320775ba..6c05268d 100644
--- a/application/classes/modules/rbac/entity/Group.entity.class.php
+++ b/application/classes/modules/rbac/entity/Group.entity.class.php
@@ -55,7 +55,7 @@ class ModuleRbac_EntityGroup extends EntityORM
{
if ($oObject = $this->Rbac_GetGroupByCode($this->getCode())) {
if ($this->getId() != $oObject->getId()) {
- return 'Код должен быть уникальным';
+ return $this->Lang_Get('rbac.notices.validate_group_code');
}
}
return true;
diff --git a/application/classes/modules/rbac/entity/Permission.entity.class.php b/application/classes/modules/rbac/entity/Permission.entity.class.php
index 3163a049..05206c8d 100644
--- a/application/classes/modules/rbac/entity/Permission.entity.class.php
+++ b/application/classes/modules/rbac/entity/Permission.entity.class.php
@@ -67,7 +67,7 @@ class ModuleRbac_EntityPermission extends EntityORM
if ($oObject = $this->Rbac_GetGroupById($this->getGroupId())) {
$this->setGroupId($oObject->getId());
} else {
- return 'Неверная группа';
+ return $this->Lang_Get('rbac.notices.validate_group_wrong');
}
} else {
$this->setGroupId(null);
@@ -85,7 +85,7 @@ class ModuleRbac_EntityPermission extends EntityORM
$sPlugin = $this->getPlugin() ? $this->getPlugin() : '';
if ($oObject = $this->Rbac_GetPermissionByCodeAndPlugin($this->getCode(), $sPlugin)) {
if ($this->getId() != $oObject->getId()) {
- return 'Код должен быть уникальным';
+ return $this->Lang_Get('rbac.notices.validate_permission_code');
}
}
return true;
diff --git a/application/classes/modules/rbac/entity/Role.entity.class.php b/application/classes/modules/rbac/entity/Role.entity.class.php
index 48509665..2c7f6ba1 100644
--- a/application/classes/modules/rbac/entity/Role.entity.class.php
+++ b/application/classes/modules/rbac/entity/Role.entity.class.php
@@ -110,7 +110,7 @@ class ModuleRbac_EntityRole extends EntityORM
{
if ($oObject = $this->Rbac_GetRoleByCode($this->getCode())) {
if ($this->getId() != $oObject->getId()) {
- return 'Код должен быть уникальным';
+ return $this->Lang_Get('rbac.notices.validate_role_code');
}
}
return true;
@@ -128,10 +128,10 @@ class ModuleRbac_EntityRole extends EntityORM
if ($this->getPid()) {
if ($oRole = $this->Rbac_GetRoleById($this->getPid())) {
if ($oRole->getId() == $this->getId()) {
- return 'Попытка вложить роль в саму себя';
+ return $this->Lang_Get('rbac.notices.validate_role_recursive');
}
} else {
- return 'Неверная роль';
+ return $this->Lang_Get('rbac.notices.validate_role_wrong');
}
} else {
$this->setPid(null);
diff --git a/application/classes/modules/topic/entity/TopicType.entity.class.php b/application/classes/modules/topic/entity/TopicType.entity.class.php
index a53e1941..eb224f24 100644
--- a/application/classes/modules/topic/entity/TopicType.entity.class.php
+++ b/application/classes/modules/topic/entity/TopicType.entity.class.php
@@ -68,7 +68,7 @@ class ModuleTopic_EntityTopicType extends Entity
{
if ($oType = $this->Topic_GetTopicTypeByCode($this->getCode())) {
if ($oType->getId() != $this->getId()) {
- return 'Тип с таким кодом уже существует';
+ return $this->Lang_Get('topic.content_type.notices.error_code');
}
}
return true;
@@ -114,12 +114,12 @@ class ModuleTopic_EntityTopicType extends Entity
public function getStateText()
{
if ($this->getState() == ModuleTopic::TOPIC_TYPE_STATE_ACTIVE) {
- return 'активен';
+ return $this->Lang_Get('topic.content_type.states.active');
}
if ($this->getState() == ModuleTopic::TOPIC_TYPE_STATE_NOT_ACTIVE) {
- return 'не активен';
+ return $this->Lang_Get('topic.content_type.states.not_active');
}
- return 'неизвестный статус';
+ return $this->Lang_Get('topic.content_type.states.wrong');
}
public function getUrlForAdd()
diff --git a/application/frontend/i18n/ru.php b/application/frontend/i18n/ru.php
index 18ce1493..bf3a7c30 100644
--- a/application/frontend/i18n/ru.php
+++ b/application/frontend/i18n/ru.php
@@ -24,7 +24,7 @@ return array(
/**
* Голосование
*/
- 'vote' => array(
+ 'vote' => array(
'up' => 'Нравится',
'down' => 'Не нравится',
'abstain' => 'Воздержаться от голосования и посмотреть рейтинг',
@@ -44,7 +44,7 @@ return array(
/**
* Избранное
*/
- 'favourite' => array(
+ 'favourite' => array(
'favourite' => 'Избранное',
'add' => 'Добавить в избранное',
'remove' => 'Удалить из избранного',
@@ -59,7 +59,7 @@ return array(
/**
* Поиск
*/
- 'search' => array(
+ 'search' => array(
'search' => 'Поиск',
'find' => 'Найти',
'result' => array(
@@ -75,7 +75,7 @@ return array(
/**
* Сортировка
*/
- 'sort' => array(
+ 'sort' => array(
'label' => 'Сортировать',
'by_login' => 'по логину',
'by_name' => 'по имени',
@@ -87,7 +87,7 @@ return array(
/**
* Заметка пользователя
*/
- 'user_note' => array(
+ 'user_note' => array(
'add' => 'Написать заметку',
// Всплывающие сообщения
'notices' => array(
@@ -97,7 +97,7 @@ return array(
/**
* Блог
*/
- 'blog' => array(
+ 'blog' => array(
'blog' => 'Блог',
'blogs' => 'Блоги',
'readers_declension' => 'читатель;читателя;читателей',
@@ -135,15 +135,15 @@ return array(
'search' => array(
'placeholder' => 'Поиск по названию',
'result_title' => 'Найден %%count%% блог;Найдено %%count%% блога;Найдено %%count%% блогов',
- 'form' => array(
- 'type' => array(
- 'any' => 'Любой',
- 'public' => 'Открытый',
+ 'form' => array(
+ 'type' => array(
+ 'any' => 'Любой',
+ 'public' => 'Открытый',
'private' => 'Закрытый'
),
'relation' => array(
- 'all' => 'Все',
- 'my' => 'Мои',
+ 'all' => 'Все',
+ 'my' => 'Мои',
'joined' => 'Читаю'
)
)
@@ -223,7 +223,7 @@ return array(
'label' => 'Аватар',
'error' => 'Не удалось загрузить аватар',
),
- 'skip_index' => array(
+ 'skip_index' => array(
'label' => 'Не выводить топики на главную',
'note' => 'Все топики из этого блога не смогут попадать на главную страницу',
),
@@ -381,7 +381,7 @@ return array(
/**
* Личные сообщения
*/
- 'talk' => array(
+ 'talk' => array(
'title' => 'Сообщения',
'participants' => '%%count%% участник;%%count%% участника;%%count%% участников',
'new_messages' => 'У вас есть новые сообщения',
@@ -485,7 +485,7 @@ return array(
'title' => 'Участники разговора',
'inactive' => 'Пользователь не участвует в разговоре',
// Сообщения
- 'notices' => array(
+ 'notices' => array(
'user_not_found' => 'Пользователь %%login%% не участвует в разговоре',
'deleted' => 'Участник %%login%% удалил этот разговор',
)
@@ -501,7 +501,7 @@ return array(
/**
* Опросы
*/
- 'poll' => array(
+ 'poll' => array(
'polls' => 'Опросы',
'vote' => 'Голосовать',
'abstain' => 'Воздержаться',
@@ -533,13 +533,22 @@ return array(
),
// Всплывающие сообщения
'notices' => array(
- 'error_answers_max' => 'Максимально возможное число вариантов ответа %%count%%',
+ 'error_answers_max' => 'Максимально возможное число вариантов ответа %%count%%',
+ 'error_not_allow_vote' => 'В этом опросе уже нельзя голосовать',
+ 'error_not_allow_remove' => 'Этот опрос уже нельзя удалить',
+ 'error_already_vote' => 'Вы уже голосовали',
+ 'error_no_answers' => 'Необходимо выбрать вариант',
+ 'error_answers_max_wrong' => 'Максимальное количество вариантов ответа должно быть больше одного',
+ 'error_answers_count' => 'Необходимо заполнить больше одного варианта ответов',
+ 'error_answer_remove' => 'Нельзя удалить вариант ответа, за который уже голосовали',
+ 'error_target_type' => 'Неверный тип объекта',
+ 'error_target_tmp' => 'Временный идентификатор уже занят',
),
),
/**
* Комментарии
*/
- 'comments' => array(
+ 'comments' => array(
'comments_declension' => '%%count%% комментарий;%%count%% комментария;%%count%% комментариев',
'no_comments' => 'Нет комментариев',
'count_new' => 'Число новых комментариев',
@@ -581,7 +590,7 @@ return array(
/**
* Пополняемый список пользователей
*/
- 'user_list_add' => array(
+ 'user_list_add' => array(
// Форма добавления
'form' => array(
// Поля
@@ -601,7 +610,7 @@ return array(
/**
* Мэйлы
*/
- 'emails' => array(
+ 'emails' => array(
'common' => array(
'comment_text' => 'Текст комментария',
'regards' => 'С уважением, администрация сайта',
@@ -789,7 +798,7 @@ return array(
/**
* Стена
*/
- 'wall' => array(
+ 'wall' => array(
'title' => 'Стена',
// Форма
'form' => array(
@@ -814,7 +823,7 @@ return array(
/**
* Авторизация
*/
- 'auth' => array(
+ 'auth' => array(
'authorization' => 'Авторизация',
'logout' => 'Выйти',
// Вход
@@ -947,7 +956,7 @@ return array(
/**
* Активность
*/
- 'activity' => array(
+ 'activity' => array(
'title' => 'Активность',
// Навигация
'nav' => array(
@@ -1017,7 +1026,7 @@ return array(
/**
* Лента
*/
- 'feed' => array(
+ 'feed' => array(
'title' => 'Лента',
// Блоги
'blogs' => array(
@@ -1034,7 +1043,7 @@ return array(
/**
* Топик
*/
- 'topic' => array(
+ 'topic' => array(
'topics' => 'Топики',
'topic_plural' => 'топик;топика;топиков',
'drafts' => 'Черновики',
@@ -1048,6 +1057,16 @@ return array(
'drafts' => 'Черновики', // TODO: Remove duplication
'published' => 'Опубликованные'
),
+ 'content_type' => array(
+ 'states' => array(
+ 'active' => 'активен',
+ 'not_active' => 'не активен',
+ 'wrong' => 'неизвестный статус',
+ ),
+ 'notices' => array(
+ 'error_code' => 'Тип с таким кодом уже существует',
+ ),
+ ),
// Форма добавления
'add' => array(
'title' => array(
@@ -1106,6 +1125,8 @@ return array(
'error_favourite_draft' => 'Топик из черновиков нельзя добавить в избранное',
'time_limit' => 'Вам нельзя создавать топики слишком часто',
'rating_limit' => 'Вам не хватает рейтинга для создания топика',
+ 'update_complete' => 'Обновление прошло успешно',
+ 'create_complete' => 'Добавление прошло успешно',
)
),
// Комментарии
@@ -1131,7 +1152,7 @@ return array(
* Пользователь
* !user
*/
- 'user' => array(
+ 'user' => array(
'user' => 'Пользователь',
'users' => 'Пользователи',
'rating' => '___vote.rating___',
@@ -1145,7 +1166,7 @@ return array(
'report' => '___report.report___',
),
// Действия
- 'choose' => array(
+ 'choose' => array(
'label' => '___user.users___',
'choose' => 'Выбрать из списка друзей',
),
@@ -1236,11 +1257,11 @@ return array(
'title' => 'Поиск по пользователям',
'placeholder' => 'Поиск по логину',
'result_title' => 'Найден %%count%% пользователь;Найдено %%count%% пользователя;Найдено %%count%% пользователей',
- 'form' => array(
+ 'form' => array(
'is_online' => 'Сейчас на сайте',
- 'gender' => array(
- 'any' => 'Любой',
- 'male' => 'Мужской',
+ 'gender' => array(
+ 'any' => 'Любой',
+ 'male' => 'Мужской',
'female' => 'Женский'
)
)
@@ -1455,7 +1476,7 @@ return array(
/**
* Поля
*/
- 'field' => array(
+ 'field' => array(
'email' => array(
'label' => 'E-mail',
'notices' => array(
@@ -1474,27 +1495,61 @@ return array(
'label' => 'Категория'
),
),
+ /**
+ * Категории
+ */
+ 'category' => array(
+ 'notices' => array(
+ 'validate_require' => 'Необходимо выбрать категорию',
+ 'validate_count' => 'Количество категорий должно быть от %%min%% до %%max%%',
+ 'validate_children' => 'Для выбора доступны только конечные категории',
+ 'validate_recursion' => 'Попытка вложить категорию в саму себя',
+ 'validate_parent' => 'Неверная родительская категория',
+ 'validate_wrong' => 'Неверная категория',
+ ),
+ ),
/**
* Кастомные поля
*/
- 'property' => array(
- 'video' => array(
+ 'property' => array(
+ 'video' => array(
'preview' => 'Предпросмотр видео',
- 'watch' => 'Смотреть'
+ 'watch' => 'Смотреть'
),
- 'image' => array(
+ 'image' => array(
'empty' => 'Изображения нет'
),
- 'file' => array(
+ 'file' => array(
'forbidden' => 'Для доступа к файлу необходимо авторизоваться',
'downloads' => 'Загрузок',
- 'empty' => 'Файла нет'
- )
+ 'empty' => 'Файла нет'
+ ),
+ 'notices' => array(
+ 'validate_type' => 'Неверный тип поля',
+ 'validate_code' => 'Код поля должен быть уникальным',
+ 'validate_value_date_future' => 'дата не может быть в будущем',
+ 'validate_value_date_past' => 'дата не может быть в прошлом',
+ 'validate_value_file_empty' => 'Необходимо выбрать файл',
+ 'validate_value_file_upload' => 'При загрузке файла возникла ошибка',
+ 'validate_value_file_size_max' => 'Превышен размер файла, максимальный %%size%% Kb',
+ 'validate_value_file_type' => 'Неверный тип файла, допустимы %%types%%',
+ 'validate_value_image_wrong' => 'Файл не является изображением',
+ 'validate_value_image_width_max' => 'Максимальная допустимая ширина изображения %%size%%px',
+ 'validate_value_image_height_max' => 'Максимальная допустимая высота изображения %%size%%px',
+ 'validate_value_select_max' => 'Максимально можно выбрать только %%count%% элемента',
+ 'validate_value_select_min' => 'Минимально можно выбрать только %%count%% элемента',
+ 'validate_value_select_wrong' => 'Проверьте корректность выбранных элементов',
+ 'validate_value_select_only_one' => 'Можно выбрать только один элемент',
+ 'validate_value_video_wrong' => 'Необходимо указать корректную ссылку на видео: YouTube, Vimeo',
+ 'validate_value_wrong' => 'Поле "%%field%%": ',
+ 'validate_value_wrong_base' => 'неверное значение',
+ 'create_error' => 'Возникла ошибка при добавлении поля',
+ ),
),
/**
* Админка
*/
- 'admin' => array(
+ 'admin' => array(
'title' => 'Админка',
'items' => array(
'plugins' => '___admin.plugins.title___',
@@ -1532,7 +1587,7 @@ return array(
/**
* Жалобы
*/
- 'report' => array(
+ 'report' => array(
'report' => 'Пожаловаться',
'form' => array(
'title' => '___report.report___',
@@ -1555,13 +1610,13 @@ return array(
/**
* Загрузкчик файлов
*/
- 'uploader' => array(
+ 'uploader' => array(
'actions' => array(
'remove' => '___common.remove___'
),
- 'filter' => array(
+ 'filter' => array(
'uploaded' => 'Загруженные',
- 'all' => 'Все'
+ 'all' => 'Все'
),
'info' => array(
'empty' => 'Выберите файл',
@@ -1572,24 +1627,25 @@ return array(
)
)
),
- 'attach' => array(
- 'title' => 'Прикрепить файлы',
+ 'attach' => array(
+ 'title' => 'Прикрепить файлы',
'upload' => 'Загрузить',
- 'count' => '%%count%% файл загружен;%%count%% файла загружено;%%count%% файлов загружено',
- 'empty' => 'Нет загруженных файлов'
+ 'count' => '%%count%% файл загружен;%%count%% файла загружено;%%count%% файлов загружено',
+ 'empty' => 'Нет загруженных файлов'
)
),
/**
* Загрузка изображений
*/
- 'media' => array(
+ 'media' => array(
'title' => 'Загрузка медиа-файлов',
'error' => array(
- 'upload' => 'Не удалось загрузить файл',
- 'not_image' => 'Файл не является изображением',
- 'too_large' => 'Превышен максимальный размер файла: %%size%%Кб',
- 'incorrect_type' => 'Неверный тип файла',
- 'max_count_files' => 'Превышено максимальное число файлов',
+ 'upload' => 'Не удалось загрузить файл',
+ 'not_image' => 'Файл не является изображением',
+ 'too_large' => 'Превышен максимальный размер файла: %%size%%Кб',
+ 'incorrect_type' => 'Неверный тип файла',
+ 'max_count_files' => 'Превышено максимальное число файлов',
+ 'need_choose_items' => 'Необходимо выбрать элементы',
),
'nav' => array(
'insert' => 'Вставить',
@@ -1646,7 +1702,7 @@ return array(
/**
* Теги
*/
- 'tags' => array(
+ 'tags' => array(
'tags' => 'Теги',
'tag' => 'Тег',
'search' => array(
@@ -1673,7 +1729,7 @@ return array(
/**
* Toolbar
*/
- 'toolbar' => array(
+ 'toolbar' => array(
'scrollup' => array(
'title' => 'Вверх',
),
@@ -1685,7 +1741,7 @@ return array(
/**
* Создание
*/
- 'modal_create' => array(
+ 'modal_create' => array(
'title' => 'Создать',
'items' => array(
'blog' => 'Блог',
@@ -1695,13 +1751,13 @@ return array(
/**
* Обрезка изображения
*/
- 'crop' => array(
+ 'crop' => array(
'title' => 'Обрезка изображения'
),
/**
* Экшнбар
*/
- 'actionbar' => array(
+ 'actionbar' => array(
'select' => array(
'title' => 'Выбрать',
'menu' => array(
@@ -1714,7 +1770,7 @@ return array(
/**
* Управление правами (RBAC)
*/
- 'rbac' => array(
+ 'rbac' => array(
'permission' => array(
'create_blog' => array(
'title' => 'Создание блога',
@@ -1765,5 +1821,14 @@ return array(
'error' => 'У вас нет прав на голосования за топики',
),
),
+ 'notices' => array(
+ 'validate_group_code' => 'Код должен быть уникальным',
+ 'validate_group_wrong' => 'Неверная группа',
+ 'validate_permission_code' => 'Код должен быть уникальным',
+ 'validate_role_code' => 'Код должен быть уникальным',
+ 'validate_role_recursive' => 'Попытка вложить роль в саму себя',
+ 'validate_role_wrong' => 'Неверная роль',
+ 'error_not_allow' => 'У вас нет прав на "%%permission%%"',
+ ),
),
);
\ No newline at end of file