mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-08 01:14:24 +03:00
Blog types
This commit is contained in:
parent
d241d54367
commit
42ab43d99f
|
@ -600,7 +600,7 @@ class ActionBlog extends Action {
|
||||||
/**
|
/**
|
||||||
* Проверяем доступные типы блога для создания
|
* Проверяем доступные типы блога для создания
|
||||||
*/
|
*/
|
||||||
if (!in_array(getRequestStr('blog_type'),array('open','close'))) {
|
if (!$this->Blog_IsAllowBlogType(getRequestStr('blog_type'))) {
|
||||||
$this->Message_AddError($this->Lang_Get('blog_create_type_error'),$this->Lang_Get('error'));
|
$this->Message_AddError($this->Lang_Get('blog_create_type_error'),$this->Lang_Get('error'));
|
||||||
$bOk=false;
|
$bOk=false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,14 @@ class ModuleBlog extends Module {
|
||||||
* Забаненный в блоге пользователь
|
* Забаненный в блоге пользователь
|
||||||
*/
|
*/
|
||||||
const BLOG_USER_ROLE_BAN = -4;
|
const BLOG_USER_ROLE_BAN = -4;
|
||||||
|
/**
|
||||||
|
* Список типов блога
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $aBlogTypes=array(
|
||||||
|
'open','close'
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Объект маппера
|
* Объект маппера
|
||||||
|
@ -63,6 +71,36 @@ class ModuleBlog extends Module {
|
||||||
$this->oMapperBlog=Engine::GetMapper(__CLASS__);
|
$this->oMapperBlog=Engine::GetMapper(__CLASS__);
|
||||||
$this->oUserCurrent=$this->User_GetUserCurrent();
|
$this->oUserCurrent=$this->User_GetUserCurrent();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Возвращает список типов блога
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function GetBlogTypes() {
|
||||||
|
return $this->aBlogTypes;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Добавляет в новый тип блога
|
||||||
|
*
|
||||||
|
* @param string $sType Новый тип
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function AddBlogType($sType) {
|
||||||
|
if (!in_array($sType,$this->aBlogTypes)) {
|
||||||
|
$this->aBlogTypes[]=$sType;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Проверяет разрешен ли данный тип блога
|
||||||
|
*
|
||||||
|
* @param string $sType Тип
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function IsAllowBlogType($sType) {
|
||||||
|
return in_array($sType,$this->aBlogTypes);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Получает дополнительные данные(объекты) для блогов по их ID
|
* Получает дополнительные данные(объекты) для блогов по их ID
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue