1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-21 18:28:17 +03:00

Наведен порядок в блоках.

This commit is contained in:
Alexey Kachayev 2009-11-23 14:01:48 +00:00
parent f279a45a18
commit 236d245929
11 changed files with 96 additions and 67 deletions

View file

@ -133,14 +133,10 @@ class ActionLink extends Action {
if (!$this->ACL_IsAllowEditTopic($oTopic,$this->oUserCurrent)) {
return parent::EventNotFound();
}
/**
* Добавляем блок вывода информации о блоге
*/
$this->Viewer_AddBlocks('right',array('block.blogInfo.tpl'));
/**
* Вызов хуков
*/
$this->Hook_Run('topic_edit_show',array('oTopic'=>$oTopic));
$this->Hook_Run('topic_edit_show',array('oTopic'=>$oTopic));
/**
* Загружаем переменные в шаблон
*/
@ -190,10 +186,6 @@ class ActionLink extends Action {
* Меню
*/
$this->sMenuSubItemSelect='add';
/**
* Добавляем блок вывода информации о блоге
*/
$this->Viewer_AddBlocks('right',array('block.blogInfo.tpl'));
/**
* Загружаем переменные в шаблон
*/

View file

@ -62,7 +62,6 @@ class ActionNew extends Action {
*
*/
public function Init() {
$this->Viewer_AddBlocks('right',array('stream','tags','blogs'));
/**
* Подсчитываем новые топики
*/

View file

@ -33,9 +33,7 @@ class ActionPeople extends Action {
*/
public function Init() {
$this->SetDefaultEvent('good');
$this->Viewer_AddHtmlTitle($this->Lang_Get('people'));
$this->Viewer_AddBlocks('right',array('actions/ActionPeople/sidebar.tpl'));
$this->Viewer_AddHtmlTitle($this->Lang_Get('people'));
}
/**
* Регистрируем евенты

View file

@ -45,10 +45,6 @@ class ActionPersonalBlog extends Action {
*/
public function Init() {
$this->SetDefaultEvent('good');
/**
* Добавляем блоки для отображения
*/
$this->Viewer_AddBlocks('right',array('stream','tags'));
}
/**

View file

@ -34,7 +34,6 @@ class ActionProfile extends Action {
protected $oUserProfile;
public function Init() {
$this->Viewer_AddBlocks('right',array('actions/ActionProfile/sidebar.tpl'));
}
protected function RegisterEvent() {

View file

@ -101,10 +101,6 @@ class ActionQuestion extends Action {
if (!$this->ACL_IsAllowEditTopic($oTopic,$this->oUserCurrent)) {
return parent::EventNotFound();
}
/**
* Добавляем блок вывода информации о блоге
*/
$this->Viewer_AddBlocks('right',array('block.blogInfo.tpl'));
/**
* Вызов хуков
*/
@ -157,10 +153,6 @@ class ActionQuestion extends Action {
* Меню
*/
$this->sMenuSubItemSelect='add';
/**
* Добавляем блок вывода информации о блоге
*/
$this->Viewer_AddBlocks('right',array('block.blogInfo.tpl'));
/**
* Загружаем переменные в шаблон
*/

View file

@ -31,10 +31,6 @@ class ActionTag extends Action {
*
*/
public function Init() {
/**
* Определяем какие блоки выводить
*/
$this->Viewer_AddBlocks('right',array('tags','stream'));
}
protected function RegisterEvent() {

View file

@ -149,16 +149,9 @@ class ActionTalk extends Action {
* Загружаем переменные в шаблон
*/
$this->Viewer_Assign('aUsersBlacklist',$aUsersBlacklist);
$this->Viewer_AddBlocks(
'right',
array(
'actions/ActionTalk/filter.tpl',
'actions/ActionTalk/blacklist.tpl'
)
);
$this->Viewer_Assign('aPaging',$aPaging);
$this->Viewer_Assign('aTalks',$aTalks);
}
}
/**
* Формирует из REQUEST массива фильтр для отбора писем
@ -332,7 +325,6 @@ class ActionTalk extends Action {
$this->Viewer_Assign('oTalk',$oTalk);
$this->Viewer_Assign('aComments',$aComments);
$this->Viewer_Assign('iMaxIdComment',$iMaxIdComment);
$this->Viewer_AddBlocks('right',array('actions/ActionTalk/speakers.tpl'));
/**
* Подсчитываем нужно ли отображать комментарии.
* Комментарии не отображаются, если у вестки только один читатель

View file

@ -102,11 +102,7 @@ class ActionTopic extends Action {
*/
if (!$this->ACL_IsAllowEditTopic($oTopic,$this->oUserCurrent)) {
return parent::EventNotFound();
}
/**
* Добавляем блок вывода информации о блоге
*/
$this->Viewer_AddBlocks('right',array('block.blogInfo.tpl'));
}
/**
* Вызов хуков
*/
@ -180,11 +176,7 @@ class ActionTopic extends Action {
/**
* Меню
*/
$this->sMenuSubItemSelect='add';
/**
* Добавляем блок вывода информации о блоге
*/
$this->Viewer_AddBlocks('right',array('block.blogInfo.tpl'));
$this->sMenuSubItemSelect='add';
/**
* Вызов хуков
*/

View file

@ -293,17 +293,58 @@ $config['router']['config']['action_not_found'] = 'error';
*/
$config['block']['rule_index_blog'] = array(
'path' => array(
$config['path']['root']['web'].'/blog$',
$config['path']['root']['web'].'/blog/*$',
$config['path']['root']['web'].'/blog/*/*\.html$',
$config['path']['root']['web'].'/blog/*\.html$',
),
'action' => array(
'index' => array('index'),
'index' => array('index'), 'new'
),
'blocks' => array(
'right' => array('stream','tags','blogs'=>array('params'=>array(),'priority'=>1))
)
),
'clear' => true,
);
$config['block']['rule_topic_type'] = array(
'action' => array(
'link' => array('add','edit'),
'question' => array('add','edit'),
'topic' => array('add','edit')
),
'blocks' => array( 'right' => array('block.blogInfo.tpl') ),
);
$config['block']['rule_people'] = array(
'action' => array( 'people' ),
'blocks' => array( 'right' => array('actions/ActionPeople/sidebar.tpl') ),
);
$config['block']['rule_personal_blog'] = array(
'action' => array( 'personal_blog' ),
'blocks' => array( 'right' => array('stream','tags') ),
);
$config['block']['rule_profile'] = array(
'action' => array( 'profile' ),
'blocks' => array( 'right' => array('actions/ActionProfile/sidebar.tpl') ),
);
$config['block']['rule_tag'] = array(
'action' => array( 'tag' ),
'blocks' => array( 'right' => array('tags','stream') ),
);
$config['block']['rule_talk_inbox'] = array(
'action' => array( 'talk' => array('inbox') ),
'blocks' => array( 'right' => array('actions/ActionTalk/filter.tpl', 'actions/ActionTalk/blacklist.tpl') ),
);
$config['block']['rule_talk_add'] = array(
'action' => array( 'talk' => array('add') ),
'blocks' => array( 'right' => array('actions/ActionTalk/friends.tpl') ),
);
$config['block']['rule_talk_read'] = array(
'action' => array( 'talk' => array('read') ),
'blocks' => array( 'right' => array('actions/ActionTalk/speakers.tpl') ),
);
/**
* Настройки вывода js и css файлов
*/

View file

@ -153,6 +153,7 @@ class LsViewer extends Module {
*
*/
public function Init() {
$this->Hook_Run('viewer_init_start');
/**
* Заголовок HTML страницы
*/
@ -355,9 +356,11 @@ class LsViewer extends Module {
}
/**
* Инициализируем параметры отображения блоков
*/
*/
protected function InitBlockParams() {
$this->aBlockRules = Config::Get('block');
if($aRules=Config::Get('block')) {
$this->aBlockRules=$aRules;
}
}
/**
* Добавляет блок для отображения
@ -493,7 +496,7 @@ class LsViewer extends Module {
* Если не найдено совпадение по паре Action/Event,
* переходим к поиску по regexp путей.
*/
if(!$bUse && $aRule['path']) {
if(!$bUse && isset($aRule['path'])) {
$sPath = rtrim(Router::GetPathWebCurrent(),"/");
/**
* Проверяем последовательно каждый regexp
@ -509,6 +512,29 @@ class LsViewer extends Module {
}
if($bUse){
/**
* Если задан режим очистки блоков, сначала чистим старые блоки
*/
if(isset($aRule['clear'])) {
switch (true) {
/**
* Если установлен в true, значит очищаем все
*/
case ($aRule['clear']===true):
$this->ClearBlocksAll();
break;
case is_string($aRule['clear']):
$this->ClearBlocks($aRule['clear']);
break;
case is_array($aRule['clear']):
foreach ($aRule['clear'] as $sGroup) {
$this->ClearBlocks($sGroup);
}
break;
}
}
/**
* Добавляем все блоки, указанные в параметре blocks
*/
@ -555,19 +581,25 @@ class LsViewer extends Module {
*/
protected function InitFileParams() {
foreach (array('js','css') as $sType) {
foreach (Config::Get('head.default.'.$sType) as $sFile=>$aParams) {
if(!is_array($aParams)) {
/**
* Параметры не определены
*/
$this->aFilesDefault[$sType][] = $aParams;
} else {
/**
* Добавляем файл и параметры
*/
$this->aFilesDefault[$sType][] = $sFile;
$this->aFilesParams[$sType][$sFile] = $aParams;
}
/**
* Проверяем наличие списка файлов данного типа
*/
$aFiles = Config::Get('head.default.'.$sType);
if(is_array($aFiles) and count($aFiles)) {
foreach ($aFiles as $sFile=>$aParams) {
if(!is_array($aParams)) {
/**
* Параметры не определены
*/
$this->aFilesDefault[$sType][] = $aParams;
} else {
/**
* Добавляем файл и параметры
*/
$this->aFilesDefault[$sType][] = $sFile;
$this->aFilesParams[$sType][$sFile] = $aParams;
}
}
}
}