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

Удаление алфавитного указателя в поиске пользователей и блоков со странами/городами

This commit is contained in:
Mzhelskiy Maxim 2014-11-25 19:02:49 +07:00
parent 99cfb8a811
commit 44dd692a3f
15 changed files with 14 additions and 421 deletions

View file

@ -60,9 +60,6 @@ class ActionPeople extends Action
{
$this->AddEventPreg('/^(index)?$/i', '/^(page([1-9]\d{0,5}))?$/i', '/^$/i', 'EventIndex');
$this->AddEventPreg('/^ajax-search$/i', 'EventAjaxSearch');
$this->AddEventPreg('/^country$/i', '/^\d+$/i', '/^(page([1-9]\d{0,5}))?$/i', 'EventCountry');
$this->AddEventPreg('/^city$/i', '/^\d+$/i', '/^(page([1-9]\d{0,5}))?$/i', 'EventCity');
}
@ -160,100 +157,6 @@ class ActionPeople extends Action
$this->Viewer_AssignAjax('bHideMore', $bHideMore);
}
/**
* Показывает юзеров по стране
*
*/
protected function EventCountry()
{
$this->sMenuItemSelect = 'country';
/**
* Страна существует?
*/
if (!($oCountry = $this->Geo_GetCountryById($this->getParam(0)))) {
return parent::EventNotFound();
}
/**
* Получаем статистику
*/
$this->GetStats();
/**
* Передан ли номер страницы
*/
$iPage = $this->GetParamEventMatch(1, 2) ? $this->GetParamEventMatch(1, 2) : 1;
/**
* Получаем список связей пользователей со страной
*/
$aResult = $this->Geo_GetTargets(array('country_id' => $oCountry->getId(), 'target_type' => 'user'), $iPage,
Config::Get('module.user.per_page'));
$aUsersId = array();
foreach ($aResult['collection'] as $oTarget) {
$aUsersId[] = $oTarget->getTargetId();
}
$aUsersCountry = $this->User_GetUsersAdditionalData($aUsersId);
/**
* Формируем постраничность
*/
$aPaging = $this->Viewer_MakePaging($aResult['count'], $iPage, Config::Get('module.user.per_page'),
Config::Get('pagination.pages.count'),
Router::GetPath('people') . $this->sCurrentEvent . '/' . $oCountry->getId());
/**
* Загружаем переменные в шаблон
*/
if ($aUsersCountry) {
$this->Viewer_Assign('aPaging', $aPaging);
}
$this->Viewer_Assign('oCountry', $oCountry);
$this->Viewer_Assign('aUsersCountry', $aUsersCountry);
}
/**
* Показывает юзеров по городу
*
*/
protected function EventCity()
{
$this->sMenuItemSelect = 'city';
/**
* Город существует?
*/
if (!($oCity = $this->Geo_GetCityById($this->getParam(0)))) {
return parent::EventNotFound();
}
/**
* Получаем статистику
*/
$this->GetStats();
/**
* Передан ли номер страницы
*/
$iPage = $this->GetParamEventMatch(1, 2) ? $this->GetParamEventMatch(1, 2) : 1;
/**
* Получаем список юзеров
*/
$aResult = $this->Geo_GetTargets(array('city_id' => $oCity->getId(), 'target_type' => 'user'), $iPage,
Config::Get('module.user.per_page'));
$aUsersId = array();
foreach ($aResult['collection'] as $oTarget) {
$aUsersId[] = $oTarget->getTargetId();
}
$aUsersCity = $this->User_GetUsersAdditionalData($aUsersId);
/**
* Формируем постраничность
*/
$aPaging = $this->Viewer_MakePaging($aResult['count'], $iPage, Config::Get('module.user.per_page'),
Config::Get('pagination.pages.count'),
Router::GetPath('people') . $this->sCurrentEvent . '/' . $oCity->getId());
/**
* Загружаем переменные в шаблон
*/
if ($aUsersCity) {
$this->Viewer_Assign('aPaging', $aPaging);
}
$this->Viewer_Assign('oCity', $oCity);
$this->Viewer_Assign('aUsersCity', $aUsersCity);
}
/**
* Показываем юзеров
*

View file

@ -1,49 +0,0 @@
<?php
/*
* LiveStreet CMS
* Copyright © 2013 OOO "ЛС-СОФТ"
*
* ------------------------------------------------------
*
* Official site: www.livestreetcms.com
* Contact e-mail: office@livestreetcms.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* ------------------------------------------------------
*
* @link http://www.livestreetcms.com
* @copyright 2013 OOO "ЛС-СОФТ"
* @author Maxim Mzhelskiy <rus.engine@gmail.com>
*
*/
/**
* Обрабатывает блок облака тегов городов юзеров
*
* @package application.blocks
* @since 1.0
*/
class BlockUsersCities extends Block
{
/**
* Запуск обработки
*/
public function Exec()
{
/**
* Получаем города
*/
$aCities = $this->Geo_GetGroupCitiesByTargetType('user', 20);
/**
* Формируем облако тегов
*/
$this->Tools_MakeCloud($aCities);
/**
* Выводим в шаблон
*/
$this->Viewer_Assign("cities", $aCities, true);
$this->SetTemplate('components/user/blocks/block.users-cities.tpl');
}
}

View file

@ -1,49 +0,0 @@
<?php
/*
* LiveStreet CMS
* Copyright © 2013 OOO "ЛС-СОФТ"
*
* ------------------------------------------------------
*
* Official site: www.livestreetcms.com
* Contact e-mail: office@livestreetcms.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* ------------------------------------------------------
*
* @link http://www.livestreetcms.com
* @copyright 2013 OOO "ЛС-СОФТ"
* @author Maxim Mzhelskiy <rus.engine@gmail.com>
*
*/
/**
* Обрабатывает блок облака тегов стран юзеров
*
* @package application.blocks
* @since 1.0
*/
class BlockUsersCountries extends Block
{
/**
* Запуск обработки
*/
public function Exec()
{
/**
* Получаем страны
*/
$aCountries = $this->Geo_GetGroupCountriesByTargetType('user', 20);
/**
* Формируем облако тегов
*/
$this->Tools_MakeCloud($aCountries);
/**
* Выводим в шаблон
*/
$this->Viewer_Assign("countries", $aCountries, true);
$this->SetTemplate('components/user/blocks/block.users-countries.tpl');
}
}

View file

@ -448,8 +448,6 @@ $config['block']['rule_users'] = array(
'right' => array(
'components/user/blocks/block.users-statistics.tpl',
'components/user/blocks/block.users-search.tpl',
'usersCountries',
'usersCities',
)
)
);
@ -552,7 +550,6 @@ $config['head']['default']['js'] = array(
"___path.skin.web___/components/vote/js/vote.js",
"___path.skin.web___/components/pagination/js/pagination.js",
"___path.skin.web___/components/note/js/note.js",
"___path.skin.web___/components/feed/js/feed.js",
"___path.skin.web___/components/feed/js/feed-blogs.js",
"___path.skin.web___/components/talk/js/talk.js",
"___path.skin.web___/components/talk/js/message-users.js",
@ -627,7 +624,6 @@ $config['head']['default']['css'] = array(
"___path.skin.web___/components/poll/css/poll.css",
"___path.skin.web___/components/more/css/more.css",
"___path.skin.web___/components/sort/css/sort.css",
"___path.skin.web___/components/alphanumeric/css/alphanumeric.css",
"___path.skin.web___/components/media/css/media.css",
"___path.skin.web___/components/pagination/css/pagination.css",
"___path.skin.web___/components/field/css/field.css",

View file

@ -1781,12 +1781,6 @@ return array(
'crop' => array(
'title' => 'Обрезка изображения'
),
/**
* Алфавитный указатель
*/
'alphanumeric' => array(
'all' => 'Все'
),
/**
* Экшнбар
*/

View file

@ -1,21 +0,0 @@
{**
* Список пользователей из определенного города
*}
{extends 'layouts/layout.base.tpl'}
{block 'layout_page_title'}
{$aLang.user.users}:
<span>
{$oCity->getName()|escape}
{if $aPaging}
({$aPaging.iCount})
{/if}
</span>
{/block}
{block 'layout_content'}
{include 'components/user/user-list.tpl' users=$aUsersCity pagination=$aPaging}
{/block}

View file

@ -1,21 +0,0 @@
{**
* Список пользователей из определенной страны
*}
{extends 'layouts/layout.base.tpl'}
{block 'layout_page_title'}
{$aLang.user.users}:
<span>
{$oCountry->getName()|escape}
{if $aPaging}
({$aPaging.iCount})
{/if}
</span>
{/block}
{block 'layout_content'}
{include 'components/user/user-list.tpl' users=$aUsersCountry pagination=$aPaging}
{/block}

View file

@ -10,7 +10,6 @@
{block 'layout_content'}
{include 'components/user/search-form.users.tpl'}
{include 'components/alphanumeric/alphanumeric.tpl' letters=$aPrefixUser}
{* Сортировка *}
{include 'components/sort/sort.ajax.tpl'

View file

@ -190,28 +190,21 @@ jQuery(document).ready(function($){
/**
* Лента
*/
$('.js-feed').lsFeed({
urls: {
more: aRouter.feed + 'get_more'
},
create: function() {
// Блоги
$('.js-feed-blogs').lsFeedBlogs({
urls: {
subscribe: aRouter.feed + 'subscribe',
unsubscribe: aRouter.feed + 'unsubscribe'
}
});
// Блоги
$('.js-feed-blogs').lsFeedBlogs({
urls: {
subscribe: aRouter.feed + 'subscribe',
unsubscribe: aRouter.feed + 'unsubscribe'
}
});
// Добавление пользователей в свою ленту
$('.js-feed-users').user_list_add({
urls: {
add: aRouter.feed + 'ajaxadduser',
remove: aRouter.feed + 'unsubscribe'
}
});
}
});
// Добавление пользователей в свою ленту
$('.js-feed-users').user_list_add({
urls: {
add: aRouter.feed + 'ajaxadduser',
remove: aRouter.feed + 'unsubscribe'
}
});
/**
@ -231,12 +224,6 @@ jQuery(document).ready(function($){
selector: '.js-search-text-main',
alphanumericFilterSelector: '.js-search-alphabet'
},
{
type: 'alphanumeric',
name: 'sText',
selector: '.js-search-alphabet .js-search-alphabet-item',
textFilterSelector: '.js-search-text-main'
},
{
type: 'radio',
name: 'sex',

View file

@ -1,3 +0,0 @@
# Компонент alhpanumberic
Алфавитный указатель

View file

@ -1,25 +0,0 @@
{**
* Алфавитный указатель
*
* @param array $letters
* @param array $type
*
* @param string $mods
* @param string $classes
* @param string $attributes
*}
{* Название компонента *}
{$component = 'alphanumeric'}
<ul class="{$component} {cmods name=$component mods=$smarty.local.mods} js-search-alphabet {$smarty.local.classes}" {if $smarty.local.type}data-type="{$smarty.local.type}"{/if}>
<li class="{$component}-item active js-search-alphabet-item" data-letter="">
<a href="#">{lang 'alphanumeric.all'}</a>
</li>
{foreach $smarty.local.letters as $letter}
<li class="{$component}-item js-search-alphabet-item" data-letter="{$letter}">
<a href="#">{$letter}</a>
</li>
{/foreach}
</ul>

View file

@ -1,26 +0,0 @@
/**
* Алфавитный указатель
*/
.alphanumeric {
overflow: hidden;
background: #f7f7f7;
margin-bottom: 20px;
padding: 15px;
}
.alphanumeric-item {
float: left;
margin-right: 1px;
}
.alphanumeric-item a {
float: left;
padding: 5px 10px;
color: #333;
}
.alphanumeric-item.active {
background: #333;
border-radius: 3px;
}
.alphanumeric-item.active a {
color: #fff;
}

View file

@ -1,56 +0,0 @@
/**
* Лента
*
* @module ls/feed
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
(function($) {
"use strict";
$.widget( "livestreet.lsFeed", {
/**
* Дефолтные опции
*/
options: {
// Ссылки
urls: {
// Подгрузка топиков
more: null
},
// Селекторы
selectors: {
// Список топиков
list: '.js-feed-topic-list',
// Кнопка подгрузки
more: '.js-feed-more'
}
},
/**
* Конструктор
*
* @constructor
* @private
*/
_create: function () {
var _this = this;
this.elements = {
list: this.element.find( this.option( 'selectors.list' ) ),
more: this.element.find( this.option( 'selectors.more' ) )
};
// Подгрузка топиков
this.elements.more.more({
url: this.option( 'urls.more' ),
target: this.elements.list,
});
},
});
})(jQuery);

View file

@ -1,18 +0,0 @@
{**
* Список городов в которых проживают пользователи
*
* @styles css/blocks.css
*}
{extends 'components/block/block.tpl'}
{block 'block_title'}
{lang 'user.blocks.cities.title'}
{/block}
{block 'block_content'}
{include 'components/tags/tag-cloud.tpl'
tags = $smarty.local.cities
url = '{router page=\'people\'}city/{$tag->getId()}/'
text = '{$tag->getName()|escape}'}
{/block}

View file

@ -1,18 +0,0 @@
{**
* Список стран в которых проживают пользователи
*
* @styles css/blocks.css
*}
{extends 'components/block/block.tpl'}
{block 'block_title'}
{lang 'user.blocks.countries.title'}
{/block}
{block 'block_content'}
{include 'components/tags/tag-cloud.tpl'
tags = $smarty.local.countries
url = '{router page=\'people\'}country/{$tag->getId()}/'
text = '{$tag->getName()|escape}'}
{/block}