diff --git a/README.md b/README.md index f06482dc..17875b15 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,6 @@ ### Лицензия LiveStreet - open-source проект под лицензией [GPL-2.0](http://opensource.org/licenses/GPL-2.0). + + + diff --git a/application/classes/actions/ActionBlog.class.php b/application/classes/actions/ActionBlog.class.php index 15171d6c..ee8359bc 100644 --- a/application/classes/actions/ActionBlog.class.php +++ b/application/classes/actions/ActionBlog.class.php @@ -833,11 +833,6 @@ class ActionBlog extends Action if (Config::Get('module.comment.use_nested') and Config::Get('module.comment.nested_per_page')) { $aPaging = $this->Viewer_MakePaging($aReturn['count'], $iPage, Config::Get('module.comment.nested_per_page'), Config::Get('pagination.pages.count'), ''); - if (!Config::Get('module.comment.nested_page_reverse') and $aPaging) { - // переворачиваем страницы в обратном порядке - $aPaging['aPagesLeft'] = array_reverse($aPaging['aPagesLeft']); - $aPaging['aPagesRight'] = array_reverse($aPaging['aPagesRight']); - } $this->Viewer_Assign('pagingComments', $aPaging); } /** diff --git a/application/classes/actions/ActionIndex.class.php b/application/classes/actions/ActionIndex.class.php index c3058ece..be61d379 100644 --- a/application/classes/actions/ActionIndex.class.php +++ b/application/classes/actions/ActionIndex.class.php @@ -156,6 +156,7 @@ class ActionIndex extends Action $this->Viewer_Assign('topics', $aTopics); $this->Viewer_Assign('paging', $aPaging); $this->Viewer_Assign('periodSelectCurrent', $sPeriod); + $this->Viewer_Assign('periodSelectCurrentTitle', $this->Lang_Get('blog.menu.top_period_' . $sPeriod)); $this->Viewer_Assign('periodSelectRoot', Router::GetPath('index') . 'top/'); /** * Устанавливаем шаблон вывода @@ -217,6 +218,7 @@ class ActionIndex extends Action $this->Viewer_Assign('topics', $aTopics); $this->Viewer_Assign('paging', $aPaging); $this->Viewer_Assign('periodSelectCurrent', $sPeriod); + $this->Viewer_Assign('periodSelectCurrentTitle', $this->Lang_Get('blog.menu.top_period_' . $sPeriod)); $this->Viewer_Assign('periodSelectRoot', Router::GetPath('index') . 'discussed/'); /** * Устанавливаем шаблон вывода diff --git a/application/classes/hooks/HookMain.class.php b/application/classes/hooks/HookMain.class.php index 3428c867..fa48f0b8 100644 --- a/application/classes/hooks/HookMain.class.php +++ b/application/classes/hooks/HookMain.class.php @@ -77,6 +77,7 @@ class HookMain extends Hook 'recaptcha.site_key' => Config::Get('module.validate.recaptcha.site_key'), 'comment_max_tree' => Config::Get('module.comment.max_tree'), 'comment_show_form' => Config::Get('module.comment.show_form'), + 'comment_use_paging' => Config::Get('module.comment.use_nested'), 'topic_max_blog_count' => Config::Get('module.topic.max_blog_count'), 'block_stream_show_tip' => Config::Get('block.stream.show_tip'), 'poll_max_answers' => Config::Get('module.poll.max_answers'), diff --git a/application/classes/modules/media/Media.class.php b/application/classes/modules/media/Media.class.php index 13edadd2..0a815ea9 100644 --- a/application/classes/modules/media/Media.class.php +++ b/application/classes/modules/media/Media.class.php @@ -454,28 +454,38 @@ class ModuleMedia extends ModuleORM */ $sFileResult = null; $mOriginalSize = $this->GetConfigParam('image.original', $sTargetType); - if ($mOriginalSize === true) { - if (!$sFileResult = $oImage->saveSmart($sPath, $sFileName, array('skip_watermark' => true))) { - $this->Fs_RemoveFileLocal($sFileTmp); - return $this->Image_GetLastError(); - } - } elseif (is_string($mOriginalSize)) { + if ($mOriginalSize !== false && $oImage->getFormat() == 'gif') { /** - * Ресайзим оригинал + * Если gif, то сохраняем без изменений */ - $aOriginalSize = $this->ParsedImageSize($mOriginalSize); - if ($aOriginalSize['crop']) { - $oImage->cropProportion($aOriginalSize['w'] / $aOriginalSize['h'], 'center'); - } - if (!$sFileResult = $oImage->resize($aOriginalSize['w'], $aOriginalSize['h'], true)->saveSmart($sPath, $sFileName, array('skip_watermark' => true)) - ) { + if (!$sFileResult = $oImage->saveOriginalSmart($sPath, $sFileName)) { $this->Fs_RemoveFileLocal($sFileTmp); return $this->Image_GetLastError(); } - $iFileSize = $this->Fs_GetFileSize($sFileResult); + } else { + if ($mOriginalSize === true) { + if (!$sFileResult = $oImage->saveSmart($sPath, $sFileName, array('skip_watermark' => true))) { + $this->Fs_RemoveFileLocal($sFileTmp); + return $this->Image_GetLastError(); + } + } elseif (is_string($mOriginalSize)) { + /** + * Ресайзим оригинал + */ + $aOriginalSize = $this->ParsedImageSize($mOriginalSize); + if ($aOriginalSize['crop']) { + $oImage->cropProportion($aOriginalSize['w'] / $aOriginalSize['h'], 'center'); + } + if (!$sFileResult = $oImage->resize($aOriginalSize['w'], $aOriginalSize['h'], true)->saveSmart($sPath, $sFileName, + array('skip_watermark' => true)) + ) { + $this->Fs_RemoveFileLocal($sFileTmp); + return $this->Image_GetLastError(); + } + $iFileSize = $this->Fs_GetFileSize($sFileResult); + } } - $aSizes = $this->GetConfigParam('image.sizes', $sTargetType); /** * Перед запуском генерации подчищаем память diff --git a/application/classes/modules/property/Property.class.php b/application/classes/modules/property/Property.class.php index 06a2b573..d1c9bc7a 100644 --- a/application/classes/modules/property/Property.class.php +++ b/application/classes/modules/property/Property.class.php @@ -434,13 +434,6 @@ class ModuleProperty extends ModuleORM if (!$oEntityFirst->property) { return; } - $sTargetType = $oEntityFirst->property->getPropertyTargetType(); - /** - * Проверяем зарегистрирован ли такой тип - */ - if (!$this->IsAllowTargetType($sTargetType)) { - return; - } /** * Проверяем необходимость цеплять свойства */ @@ -448,8 +441,11 @@ class ModuleProperty extends ModuleORM $aEntitiesId = array(); $aTargetTypes = array(); foreach ($aEntitiesWork as $oEntity) { - $aEntitiesId[] = $oEntity->getId(); - $aTargetTypes[] = $oEntity->getPropertyTargetType(); + $sTargetType = $oEntity->property->getPropertyTargetType(); + if ($this->IsAllowTargetType($sTargetType)) { + $aEntitiesId[] = $oEntity->getId(); + $aTargetTypes[] = $sTargetType; + } } $aTargetTypes = array_unique($aTargetTypes); /** @@ -488,6 +484,9 @@ class ModuleProperty extends ModuleORM foreach ($aEntitiesWork as $oEntity) { $aPropertiesClone = array(); foreach ($aProperties as $oProperty) { + if ($oEntity->property->getPropertyTargetType() != $oProperty->getTargetType()) { + continue; + } $oPropertyNew = clone $oProperty; $sKey = $oProperty->getId() . '_' . $oEntity->getId(); if (isset($aValues[$sKey])) { diff --git a/application/classes/modules/topic/entity/Topic.entity.class.php b/application/classes/modules/topic/entity/Topic.entity.class.php index f744d7b9..6066a488 100644 --- a/application/classes/modules/topic/entity/Topic.entity.class.php +++ b/application/classes/modules/topic/entity/Topic.entity.class.php @@ -909,6 +909,9 @@ class ModuleTopic_EntityTopic extends Entity if (is_null($this->aExtra)) { $this->aExtra = @unserialize($this->getExtra()); } + if (!is_array($this->aExtra)) { + $this->aExtra = array(); + } } /** diff --git a/application/classes/modules/user/entity/User.entity.class.php b/application/classes/modules/user/entity/User.entity.class.php index 3304f7cc..95365975 100644 --- a/application/classes/modules/user/entity/User.entity.class.php +++ b/application/classes/modules/user/entity/User.entity.class.php @@ -484,7 +484,7 @@ class ModuleUser_EntityUser extends Entity } if ($this->getProfileAvatar()) { - return $this->Media_GetImageWebPath($this->getProfileAvatar(), $iSize); + return $this->Media_GetImageWebPath($this->getProfileAvatar(), $iSize) . '?' . date('His', strtotime($this->getProfileDate())); } else { return $this->Media_GetImagePathBySize(Router::GetFixPathWeb(Config::Get('path.skin.assets.web')) . '/images/avatars/avatar_' . ($this->getProfileSex() == 'woman' ? 'female' : 'male') . '.png', $iSize); diff --git a/application/frontend/components/activity/blocks/recent-comments.tpl b/application/frontend/components/activity/blocks/recent-comments.tpl index dd1ea462..a21deaa8 100644 --- a/application/frontend/components/activity/blocks/recent-comments.tpl +++ b/application/frontend/components/activity/blocks/recent-comments.tpl @@ -11,8 +11,13 @@ {component 'activity' template='recent-item' user = $comment->getUser() + comment = $comment topic = $topic - date = $comment->getDate()} + date = $comment->getDate() + classes = 'js-title-comment' + attributes = [ + title => {$comment->getText()|strip_tags|trim|truncate:100:'...'|escape} + ]} {foreachelse} {component 'blankslate' text={lang 'common.empty'} mods='no-background'} {/foreach} diff --git a/application/frontend/components/activity/blocks/recent-item.tpl b/application/frontend/components/activity/blocks/recent-item.tpl index 1a173406..0980b5dc 100644 --- a/application/frontend/components/activity/blocks/recent-item.tpl +++ b/application/frontend/components/activity/blocks/recent-item.tpl @@ -23,4 +23,5 @@ image=[ 'path' => $user->getProfileAvatarPath(48), 'url' => $user->getUserWebPath() - ]} \ No newline at end of file + ] + params=$params} \ No newline at end of file diff --git a/application/frontend/components/activity/blocks/recent-topics.tpl b/application/frontend/components/activity/blocks/recent-topics.tpl index 765c7c28..c84b1215 100644 --- a/application/frontend/components/activity/blocks/recent-topics.tpl +++ b/application/frontend/components/activity/blocks/recent-topics.tpl @@ -10,7 +10,11 @@ {component 'activity' template='recent-item' user = $topic->getUser() topic = $topic - date = $topic->getDatePublish()} + date = $topic->getDatePublish() + classes = 'js-title-topic' + attributes = [ + title => {$topic->getText()|strip_tags|trim|truncate:150:'...'|escape} + ]} {foreachelse} {component 'blankslate' text={lang 'common.empty'} mods='no-background'} {/foreach} diff --git a/application/frontend/components/auth/auth.registration.tpl b/application/frontend/components/auth/auth.registration.tpl index 79342e60..da74e8d2 100644 --- a/application/frontend/components/auth/auth.registration.tpl +++ b/application/frontend/components/auth/auth.registration.tpl @@ -26,7 +26,7 @@ {component 'field' template='text' name = 'password' type = 'password' - rules = [ 'required' => true, 'minlength' => '5' ] + rules = [ 'required' => true, 'minlength' => '5', 'trigger' => 'input' ] label = $aLang.auth.labels.password inputClasses = 'js-input-password-reg'} @@ -34,7 +34,7 @@ {component 'field' template='text' name = 'password_confirm' type = 'password' - rules = [ 'required' => true, 'minlength' => '5', 'equalto' => '.js-input-password-reg', 'equalto-message' => {lang 'auth.registration.notices.error_password_equal'} ] + rules = [ 'required' => true, 'minlength' => '5', 'trigger' => 'input', 'equalto' => '.js-input-password-reg', 'equalto-message' => {lang 'auth.registration.notices.error_password_equal'} ] label = $aLang.auth.registration.form.fields.password_confirm.label} {* Каптча *} diff --git a/application/frontend/components/blog/blocks/blogs-top.tpl b/application/frontend/components/blog/blocks/blogs-top.tpl index 59359ef7..23b60a2b 100644 --- a/application/frontend/components/blog/blocks/blogs-top.tpl +++ b/application/frontend/components/blog/blocks/blogs-top.tpl @@ -14,7 +14,7 @@ {$items[] = [ 'title' => $blog->getTitle()|escape, 'titleUrl' => $blog->getUrlFull(), - 'mods' => $blog->getUrlFull(), + 'mods' => 'blog', 'content' => $smarty.capture.item_content, 'image' => [ 'path' => $blog->getAvatarPath(48), @@ -24,4 +24,4 @@ ]} {/foreach} -{component 'item' template='group' items=$items} \ No newline at end of file +{component 'item' template='group' items=$items} diff --git a/application/frontend/components/comment/js/comments.js b/application/frontend/components/comment/js/comments.js index 748b6a97..e4f1aa46 100644 --- a/application/frontend/components/comment/js/comments.js +++ b/application/frontend/components/comment/js/comments.js @@ -57,6 +57,8 @@ folding: true, // Показать/скрыть форму по умолчанию show_form: false, + // Включена или нет пагинация + use_paging: false, // Ajax параметры params: {}, i18n: { @@ -171,7 +173,7 @@ target_type: this._targetType, last_comment_id: this.getLastCommentId(), self_comment_id: commentSelfId || undefined, - use_paging: false + use_paging: this.option( 'use_paging' ) }; this._load( 'load', params, function( response ) { diff --git a/application/frontend/components/talk/js/talk-list.js b/application/frontend/components/talk/js/talk-list.js index fd0b68e7..a9377c6d 100644 --- a/application/frontend/components/talk/js/talk-list.js +++ b/application/frontend/components/talk/js/talk-list.js @@ -37,6 +37,7 @@ */ _create: function () { this._super(); + var _this = this; // Экшнбар $('.js-talk-actionbar-select').lsActionbarItemSelect({ @@ -46,8 +47,8 @@ }); this.elements.buttonMarkAsRead.on('click', function (e) { - this.setAction( $(this).data('action') ); - }.bind(this)); + _this.setAction( $(this).data('action') ); + }); this.elements.buttonRemove.lsConfirm({ message: this._i18n('remove_confirm'), diff --git a/application/frontend/components/topic/topic-add.tpl b/application/frontend/components/topic/topic-add.tpl index 772f9df4..3e3f0993 100644 --- a/application/frontend/components/topic/topic-add.tpl +++ b/application/frontend/components/topic/topic-add.tpl @@ -10,7 +10,7 @@ {component_define_params params=[ 'topic', 'type', 'skipBlogs', 'blogs', 'classes' ]}