From b7e9c4abb45eb4e0984b8bd811776674c3f71b68 Mon Sep 17 00:00:00 2001 From: Mzhelskiy Maxim Date: Mon, 4 Aug 2014 11:58:22 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D1=81=D1=82=D0=B0=D1=80=D0=BE=D0=B3=D0=BE=20=D1=84?= =?UTF-8?q?=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=BE=D0=BD=D0=B0=D0=BB=D0=B0=20?= =?UTF-8?q?=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classes/actions/ActionAdmin.class.php | 197 +----------------- application/frontend/i18n/ru.php | 29 +-- .../developer/actions/ActionAdmin/index.tpl | 9 +- .../actions/ActionAdmin/modal.userfields.tpl | 39 ---- .../developer/actions/ActionAdmin/plugins.tpl | 2 +- .../actions/ActionAdmin/user_fields.tpl | 31 --- application/install/backend/step/updateDb.php | 5 +- framework | 2 +- 8 files changed, 19 insertions(+), 295 deletions(-) delete mode 100644 application/frontend/skin/developer/actions/ActionAdmin/modal.userfields.tpl delete mode 100644 application/frontend/skin/developer/actions/ActionAdmin/user_fields.tpl diff --git a/application/classes/actions/ActionAdmin.class.php b/application/classes/actions/ActionAdmin.class.php index 008ebd74..7de22efd 100644 --- a/application/classes/actions/ActionAdmin.class.php +++ b/application/classes/actions/ActionAdmin.class.php @@ -57,11 +57,6 @@ class ActionAdmin extends Action { protected function RegisterEvent() { $this->AddEvent('index','EventIndex'); $this->AddEvent('plugins','EventPlugins'); - $this->AddEvent('restorecomment','EventRestoreComment'); - $this->AddEvent('userfields','EventUserfields'); - $this->AddEvent('recalcfavourite','EventRecalculateFavourite'); - $this->AddEvent('recalcvote','EventRecalculateVote'); - $this->AddEvent('recalctopic','EventRecalculateTopic'); } @@ -72,61 +67,15 @@ class ActionAdmin extends Action { /** * Отображение главной страницы админки - * Нет никакой логики, просто отображение дефолтного шаблона евента index.tpl */ protected function EventIndex() { - - } - /** - * Перестроение дерева комментариев, актуально при $config['module']['comment']['use_nested'] = true; - * - */ - protected function EventRestoreComment() { - $this->Security_ValidateSendForm(); - set_time_limit(0); - $this->Comment_RestoreTree(); - $this->Cache_Clean(); - - $this->Message_AddNotice($this->Lang_Get('admin_comment_restore_tree'),$this->Lang_Get('attention')); - $this->SetTemplateAction('index'); - } - /** - * Пересчет счетчика избранных - * - */ - protected function EventRecalculateFavourite() { - $this->Security_ValidateSendForm(); - set_time_limit(0); - $this->Comment_RecalculateFavourite(); - $this->Topic_RecalculateFavourite(); - $this->Cache_Clean(); - - $this->Message_AddNotice($this->Lang_Get('admin_favourites_recalculated'),$this->Lang_Get('attention')); - $this->SetTemplateAction('index'); - } - /** - * Пересчет счетчика голосований - */ - protected function EventRecalculateVote() { - $this->Security_ValidateSendForm(); - set_time_limit(0); - $this->Topic_RecalculateVote(); - $this->Cache_Clean(); - - $this->Message_AddNotice($this->Lang_Get('admin_votes_recalculated'),$this->Lang_Get('attention')); - $this->SetTemplateAction('index'); - } - /** - * Пересчет количества топиков в блогах - */ - protected function EventRecalculateTopic() { - $this->Security_ValidateSendForm(); - set_time_limit(0); - $this->Blog_RecalculateCountTopic(); - $this->Cache_Clean(); - - $this->Message_AddNotice($this->Lang_Get('admin_topics_recalculated'),$this->Lang_Get('attention')); - $this->SetTemplateAction('index'); + /** + * Определяем доступность установки расширенной админ-панели + */ + $aPluginsAll=func_list_plugins(true); + if (in_array('admin',$aPluginsAll)) { + $this->Viewer_Assign('bAvailableAdminPlugin',true); + } } /** * Страница со списком плагинов @@ -165,138 +114,6 @@ class ActionAdmin extends Action { */ $this->SetTemplateAction('plugins'); } - /** - * Управление полями пользователя - * - */ - protected function EventUserFields() - { - switch(getRequestStr('action')) { - /** - * Создание нового поля - */ - case 'add': - /** - * Обрабатываем как ajax запрос (json) - */ - $this->Viewer_SetResponseAjax('json'); - if (!$this->checkUserField()) { - return; - } - $oField = Engine::GetEntity('User_Field'); - $oField->setName(getRequestStr('name')); - $oField->setTitle(getRequestStr('title')); - $oField->setPattern(getRequestStr('pattern')); - if (in_array(getRequestStr('type'),$this->User_GetUserFieldTypes())) { - $oField->setType(getRequestStr('type')); - } else { - $oField->setType(''); - } - - $iId = $this->User_addUserField($oField); - if(!$iId) { - $this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error')); - return; - } - /** - * Прогружаем переменные в ajax ответ - */ - $this->Viewer_AssignAjax('id', $iId); - $this->Viewer_AssignAjax('lang_delete', $this->Lang_Get('user_field_delete')); - $this->Viewer_AssignAjax('lang_edit', $this->Lang_Get('user_field_update')); - $this->Message_AddNotice($this->Lang_Get('user_field_added'),$this->Lang_Get('attention')); - break; - /** - * Удаление поля - */ - case 'delete': - /** - * Обрабатываем как ajax запрос (json) - */ - $this->Viewer_SetResponseAjax('json'); - if (!getRequestStr('id')) { - $this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error')); - return; - } - $this->User_deleteUserField(getRequestStr('id')); - $this->Message_AddNotice($this->Lang_Get('user_field_deleted'),$this->Lang_Get('attention')); - break; - /** - * Изменение поля - */ - case 'update': - /** - * Обрабатываем как ajax запрос (json) - */ - $this->Viewer_SetResponseAjax('json'); - if (!getRequestStr('id')) { - $this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error')); - return; - } - if (!$this->User_userFieldExistsById(getRequestStr('id'))) { - $this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error')); - return false; - } - if (!$this->checkUserField()) { - return; - } - $oField = Engine::GetEntity('User_Field'); - $oField->setId(getRequestStr('id')); - $oField->setName(getRequestStr('name')); - $oField->setTitle(getRequestStr('title')); - $oField->setPattern(getRequestStr('pattern')); - if (in_array(getRequestStr('type'),$this->User_GetUserFieldTypes())) { - $oField->setType(getRequestStr('type')); - } else { - $oField->setType(''); - } - - if (!$this->User_updateUserField($oField)) { - $this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error')); - return; - } - $this->Message_AddNotice($this->Lang_Get('user_field_updated'),$this->Lang_Get('attention')); - break; - /** - * Показываем страницу со списком полей - */ - default: - /** - * Загружаем в шаблон JS текстовки - */ - $this->Lang_AddLangJs(array('user_field_delete_confirm')); - /** - * Получаем список всех полей - */ - $this->Viewer_Assign('aUserFields',$this->User_getUserFields()); - $this->Viewer_Assign('aUserFieldTypes',$this->User_GetUserFieldTypes()); - $this->SetTemplateAction('user_fields'); - } - } - /** - * Проверка поля пользователя на корректность из реквеста - * - * @return bool - */ - public function checkUserField() - { - if (!getRequestStr('title')) { - $this->Message_AddError($this->Lang_Get('user_field_error_add_no_title'),$this->Lang_Get('error')); - return false; - } - if (!getRequestStr('name')) { - $this->Message_AddError($this->Lang_Get('user_field_error_add_no_name'),$this->Lang_Get('error')); - return false; - } - /** - * Не допускаем дубликатов по имени - */ - if ($this->User_userFieldExistsByName(getRequestStr('name'), getRequestStr('id'))) { - $this->Message_AddError($this->Lang_Get('user_field_error_name_exists'),$this->Lang_Get('error')); - return false; - } - return true; - } /** * Активация\деактивация плагина * diff --git a/application/frontend/i18n/ru.php b/application/frontend/i18n/ru.php index 7de03665..2a681539 100644 --- a/application/frontend/i18n/ru.php +++ b/application/frontend/i18n/ru.php @@ -1328,23 +1328,9 @@ return array( /** * UserFields */ - 'user_field_admin_title' => 'Поля контактов пользователей', - 'user_field_admin_title_add' => 'Добавить поле', 'user_field_add' => 'Добавить', - 'user_field_cancel' => 'Отмена', - 'user_field_added' => 'Поле успешно добавлено', - 'user_field_update' => 'Изменить', - 'user_field_updated' => 'Поле успешно изменено', 'user_field_delete' => 'Удалить', 'user_field_delete_confirm' => 'Удалить поле?', - 'user_field_deleted' => 'Поле удалено', - 'userfield_form_name' => 'Имя', - 'userfield_form_type' => 'Тип', - 'userfield_form_title' => 'Заголовок', - 'userfield_form_pattern' => 'Шаблон (значение подставляется в токен {*})', - 'user_field_error_add_no_name' => 'Необходимо указать название поля', - 'user_field_error_add_no_title' => 'Необходимо указать заголовок поля', - 'user_field_error_name_exists' => 'Поле с таким именем уже существует', /** * Жалобы на пользователя */ @@ -1507,14 +1493,13 @@ return array( /** * Админка */ - 'admin_header' => 'Админка', - 'admin_list_plugins' => 'Управление плагинами', - 'admin_list_userfields' => 'Настройка пользовательских полей', - 'admin_list_blogcategory' => 'Настройка категорий блогов', - 'admin_list_restorecomment' => 'Перестроение дерева комментариев', - 'admin_list_recalcfavourite' => 'Пересчитать счетчики избранных', - 'admin_list_recalcvote' => 'Пересчитать счетчики голосований', - 'admin_list_recalctopic' => 'Пересчитать количество топиков в блогах', + 'admin' => array( + 'title' => 'Админка', + 'items' => array( + 'plugins' => 'Управление плагинами', + ), + 'install_plugin_admin' => 'Установить расширенную админ-панель' + ), /** * Управление категориями блогов */ diff --git a/application/frontend/skin/developer/actions/ActionAdmin/index.tpl b/application/frontend/skin/developer/actions/ActionAdmin/index.tpl index ce96cdf3..03f30e4d 100644 --- a/application/frontend/skin/developer/actions/ActionAdmin/index.tpl +++ b/application/frontend/skin/developer/actions/ActionAdmin/index.tpl @@ -4,16 +4,11 @@ {$bNoSidebar = true} {/block} -{block name='layout_page_title'}{$aLang.admin_header}{/block} +{block name='layout_page_title'}{lang name='admin.title'} {if $bAvailableAdminPlugin} - {lang name='admin.install_plugin_admin'}{/if}{/block} {block name='layout_content'} diff --git a/application/frontend/skin/developer/actions/ActionAdmin/modal.userfields.tpl b/application/frontend/skin/developer/actions/ActionAdmin/modal.userfields.tpl deleted file mode 100644 index 23f53c2e..00000000 --- a/application/frontend/skin/developer/actions/ActionAdmin/modal.userfields.tpl +++ /dev/null @@ -1,39 +0,0 @@ -{** - * Настройка пользовательских полей в админке - * - * @styles css/modals.css - *} - -{extends 'components/modal/modal.tpl'} - -{block name='modal_id'}userfield_form{/block} -{block name='modal_class'}modal-userfield js-modal-default{/block} -{block name='modal_title'}{$aLang.user_field_admin_title_add}{/block} - -{block name='modal_content'} -
-

-

- -

-

- -

-

- -

-

- - - -
-{/block} - -{block name='modal_footer_begin'} - -{/block} \ No newline at end of file diff --git a/application/frontend/skin/developer/actions/ActionAdmin/plugins.tpl b/application/frontend/skin/developer/actions/ActionAdmin/plugins.tpl index 6b2d1c6d..3021f4bc 100644 --- a/application/frontend/skin/developer/actions/ActionAdmin/plugins.tpl +++ b/application/frontend/skin/developer/actions/ActionAdmin/plugins.tpl @@ -4,7 +4,7 @@ {$bNoSidebar = true} {/block} -{block name='layout_page_title'}{$aLang.admin_header} » {$aLang.admin_list_plugins}{/block} +{block name='layout_page_title'}{lang name='admin.title'} » {lang name='admin.items.plugins'}{/block} {block name='layout_content'}
diff --git a/application/frontend/skin/developer/actions/ActionAdmin/user_fields.tpl b/application/frontend/skin/developer/actions/ActionAdmin/user_fields.tpl deleted file mode 100644 index 16848ec9..00000000 --- a/application/frontend/skin/developer/actions/ActionAdmin/user_fields.tpl +++ /dev/null @@ -1,31 +0,0 @@ -{extends file='layouts/layout.base.tpl'} - -{block name='layout_options'} - {$bNoSidebar = true} -{/block} - -{block name='layout_page_title'}{$aLang.admin_header} » {$aLang.user_field_admin_title}{/block} - -{block name='layout_content'} - {include file='actions/ActionAdmin/modal.userfields.tpl'} - - -

- - -{/block} \ No newline at end of file diff --git a/application/install/backend/step/updateDb.php b/application/install/backend/step/updateDb.php index 7a9cf580..feed5868 100644 --- a/application/install/backend/step/updateDb.php +++ b/application/install/backend/step/updateDb.php @@ -22,10 +22,7 @@ class InstallStepUpdateDb extends InstallStepInstallDb { if (!$aRes=$this->processDbCheck()) { return $aRes; } - list($oDb,$sEngineDB)=$aRes; - /** - * Запускаем импорт дампов, сначала GEO DB - */ + return true; } } \ No newline at end of file diff --git a/framework b/framework index 69cb2e0c..7912b5a2 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit 69cb2e0c3bd94b138746ad7611685e07d6ad24d9 +Subproject commit 7912b5a2b2e087cafd9d8792653cbb5692eede76