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' ]}
- {hook run="form_add_topic_begin"} + {hook run="form_add_topic_begin" topic=$topic} {block 'add_topic_form_begin'}{/block} {* Выбор блога *} @@ -49,7 +49,7 @@ label = $aLang.topic.add.fields.blog.label name = '' placeholder = $aLang.topic.add.fields.blog.placeholder - inputClasses = 'js-topic-add-blogs' + inputClasses = 'js-topic-add-blogs ls-hidden' isMultiple = true selectedValue = $blogsSelectedId inputAttributes = [ 'data-chosen-order' => {$chosenOrder} ] @@ -158,7 +158,7 @@ {block 'add_topic_form_end'}{/block} - {hook run="form_add_topic_end"} + {hook run="form_add_topic_end" topic=$topic} {* Скрытые поля *} diff --git a/application/frontend/components/user/user-field-choose.tpl b/application/frontend/components/user/user-field-choose.tpl index 60c4bc7d..15966631 100644 --- a/application/frontend/components/user/user-field-choose.tpl +++ b/application/frontend/components/user/user-field-choose.tpl @@ -20,7 +20,7 @@ {component 'field.autocomplete' label = $label name = $name - inputClasses = 'js-user-field-choose-users' + inputClasses = 'js-user-field-choose-users ls-hidden' isMultiple = true placeholder = " " note = $smarty.capture.user_field_choose diff --git a/application/frontend/skin/developer/assets/js/init.js b/application/frontend/skin/developer/assets/js/init.js index 3195cdf8..c846ab58 100644 --- a/application/frontend/skin/developer/assets/js/init.js +++ b/application/frontend/skin/developer/assets/js/init.js @@ -155,7 +155,7 @@ jQuery(document).ready(function($){ $('.js-popover-default').lsTooltip({ useAttrTitle: false, trigger: 'click', - classes: 'tooltip-light' + classes: 'ls-tooltip-light' }); if (ls.registry.get('block_stream_show_tip')) { @@ -163,7 +163,7 @@ jQuery(document).ready(function($){ $(this).lsTooltip({ position: { my: "right center", - at: "left left" + at: "left center" }, show: { delay: 1500 @@ -392,7 +392,7 @@ jQuery(document).ready(function($){ }, changeavatar: function ( event, _this, avatars ) { $( '.js-user-profile-avatar, .js-wall-entry[data-user-id=' + _this.option( 'params.target_id' ) + '] .ls-comment-avatar img' ).attr( 'src', avatars[ '64crop' ] + '?' + Math.random() ); - $( '.nav-item--userbar-username img' ).attr( 'src', avatars[ '24crop' ] + '?' + Math.random() ); + $( '.ls-nav-item--userbar-username img' ).attr( 'src', avatars[ '24crop' ] + '?' + Math.random() ); } }); @@ -596,7 +596,8 @@ jQuery(document).ready(function($){ add: aRouter['blog'] + 'ajaxaddcomment/', load: aRouter['blog'] + 'ajaxresponsecomment/' }, - show_form: ls.registry.get('comment_show_form') + show_form: ls.registry.get('comment_show_form'), + use_paging: ls.registry.get('comment_use_paging') }); // Кнопка обновления комментариев diff --git a/application/frontend/skin/developer/layouts/layout.base.tpl b/application/frontend/skin/developer/layouts/layout.base.tpl index 63dde54f..ffcdec69 100644 --- a/application/frontend/skin/developer/layouts/layout.base.tpl +++ b/application/frontend/skin/developer/layouts/layout.base.tpl @@ -76,12 +76,14 @@ * Основная навигация *} diff --git a/application/frontend/skin/developer/layouts/layout.topics.tpl b/application/frontend/skin/developer/layouts/layout.topics.tpl index eba3da46..aae48e8c 100644 --- a/application/frontend/skin/developer/layouts/layout.topics.tpl +++ b/application/frontend/skin/developer/layouts/layout.topics.tpl @@ -29,8 +29,7 @@ activeItem => $periodSelectCurrent, items => [ [ - 'name' => 'good', - 'text' => {lang name='blog.menu.all_good'}, + 'text' => $periodSelectCurrentTitle|escape, 'menu' => [ activeItem => $periodSelectCurrent, items => [ diff --git a/application/frontend/skin/synio/assets/js/init.js b/application/frontend/skin/synio/assets/js/init.js index c172ac4c..bc620c65 100644 --- a/application/frontend/skin/synio/assets/js/init.js +++ b/application/frontend/skin/synio/assets/js/init.js @@ -141,15 +141,15 @@ jQuery(document).ready(function($){ $('.js-popover-default').lsTooltip({ useAttrTitle: false, trigger: 'click', - classes: 'tooltip-light' + classes: 'ls-tooltip-light' }); if (ls.registry.get('block_stream_show_tip')) { $('.js-title-comment, .js-title-topic').livequery(function () { $(this).lsTooltip({ position: { - my: "right center", - at: "left left" + my: "right-15 center", + at: "left center" }, show: { delay: 1500 @@ -589,6 +589,7 @@ jQuery(document).ready(function($){ load: aRouter['blog'] + 'ajaxresponsecomment/' }, show_form: ls.registry.get('comment_show_form'), + use_paging: ls.registry.get('comment_use_paging'), loaded: function () { if (activityBlockRecent.length) { activityBlockRecent.lsBlock('getElement', 'tabs').lsTabs('getActiveTab').lsTab('activate'); diff --git a/application/frontend/skin/synio/components/activity/blocks/recent-comments.tpl b/application/frontend/skin/synio/components/activity/blocks/recent-comments.tpl index 1cdef46f..541a65da 100644 --- a/application/frontend/skin/synio/components/activity/blocks/recent-comments.tpl +++ b/application/frontend/skin/synio/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/skin/synio/components/activity/blocks/recent-item.tpl b/application/frontend/skin/synio/components/activity/blocks/recent-item.tpl index fe08c549..fad9a1ea 100644 --- a/application/frontend/skin/synio/components/activity/blocks/recent-item.tpl +++ b/application/frontend/skin/synio/components/activity/blocks/recent-item.tpl @@ -1,6 +1,6 @@ -{component_define_params params=[ 'user', 'topic', 'date' ]} +{component_define_params params=[ 'user', 'topic', 'date', 'classes', 'attributes' ]} -
+
{$user->getDisplayName()}