mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-16 23:00:51 +03:00
Обновление фреймворка и фиксы под него
This commit is contained in:
parent
b495b755b4
commit
d5cc4b1e7d
|
@ -29,7 +29,7 @@ class BlockTags extends Block {
|
|||
/**
|
||||
* Получаем список тегов
|
||||
*/
|
||||
$aTags=$this->oEngine->Topic_GetOpenTopicTags(Config::Get('block.tags.tags_count'));
|
||||
$aTags=$this->Topic_GetOpenTopicTags(Config::Get('block.tags.tags_count'));
|
||||
/**
|
||||
* Расчитываем логарифмическое облако тегов
|
||||
*/
|
||||
|
@ -44,7 +44,7 @@ class BlockTags extends Block {
|
|||
* Теги пользователя
|
||||
*/
|
||||
if ($oUserCurrent=$this->User_getUserCurrent()) {
|
||||
$aTags=$this->oEngine->Topic_GetOpenTopicTags(Config::Get('block.tags.personal_tags_count'), $oUserCurrent->getId());
|
||||
$aTags=$this->Topic_GetOpenTopicTags(Config::Get('block.tags.personal_tags_count'), $oUserCurrent->getId());
|
||||
/**
|
||||
* Расчитываем логарифмическое облако тегов
|
||||
*/
|
||||
|
|
|
@ -36,7 +36,7 @@ class BlockTagsFavouriteTopic extends Block {
|
|||
/**
|
||||
* Получаем список тегов
|
||||
*/
|
||||
$aTags=$this->oEngine->Favourite_GetGroupTags($oUser->getId(),'topic',null,70);
|
||||
$aTags=$this->Favourite_GetGroupTags($oUser->getId(),'topic',null,70);
|
||||
/**
|
||||
* Расчитываем логарифмическое облако тегов
|
||||
*/
|
||||
|
@ -48,7 +48,7 @@ class BlockTagsFavouriteTopic extends Block {
|
|||
/**
|
||||
* Получаем список тегов пользователя
|
||||
*/
|
||||
$aTags=$this->oEngine->Favourite_GetGroupTags($oUser->getId(),'topic',true,70);
|
||||
$aTags=$this->Favourite_GetGroupTags($oUser->getId(),'topic',true,70);
|
||||
/**
|
||||
* Расчитываем логарифмическое облако тегов
|
||||
*/
|
||||
|
|
|
@ -30,25 +30,29 @@ class ModuleMedia_EntityMedia extends EntityORM {
|
|||
);
|
||||
|
||||
protected function beforeSave() {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateAdd(date("Y-m-d H:i:s"));
|
||||
if ($bResult=parent::beforeSave()) {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateAdd(date("Y-m-d H:i:s"));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return $bResult;
|
||||
}
|
||||
|
||||
protected function beforeDelete() {
|
||||
/**
|
||||
* Удаляем все связи
|
||||
*/
|
||||
$aTargets=$this->getTargets();
|
||||
foreach($aTargets as $oTarget) {
|
||||
$oTarget->Delete();
|
||||
if ($bResult=parent::beforeDelete()) {
|
||||
/**
|
||||
* Удаляем все связи
|
||||
*/
|
||||
$aTargets=$this->getTargets();
|
||||
foreach($aTargets as $oTarget) {
|
||||
$oTarget->Delete();
|
||||
}
|
||||
/**
|
||||
* Удаляем все файлы медиа
|
||||
*/
|
||||
$this->Media_DeleteFiles($this);
|
||||
}
|
||||
/**
|
||||
* Удаляем все файлы медиа
|
||||
*/
|
||||
$this->Media_DeleteFiles($this);
|
||||
return true;
|
||||
return $bResult;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,10 +30,12 @@ class ModuleMedia_EntityTarget extends EntityORM {
|
|||
);
|
||||
|
||||
protected function beforeSave() {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateAdd(date("Y-m-d H:i:s"));
|
||||
if ($bResult=parent::beforeSave()) {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateAdd(date("Y-m-d H:i:s"));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return $bResult;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,10 +31,12 @@ class ModulePoll_EntityAnswer extends EntityORM {
|
|||
);
|
||||
|
||||
protected function beforeSave() {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateCreate(date("Y-m-d H:i:s"));
|
||||
if ($bResult=parent::beforeSave()) {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateCreate(date("Y-m-d H:i:s"));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return $bResult;
|
||||
}
|
||||
|
||||
public function ValidateCheckTitle() {
|
||||
|
|
|
@ -36,13 +36,16 @@ class ModulePoll_EntityPoll extends EntityORM {
|
|||
);
|
||||
|
||||
protected function beforeSave() {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateCreate(date("Y-m-d H:i:s"));
|
||||
if ($bResult=parent::beforeSave()) {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateCreate(date("Y-m-d H:i:s"));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return $bResult;
|
||||
}
|
||||
|
||||
protected function afterSave() {
|
||||
parent::afterSave();
|
||||
/**
|
||||
* Сохраняем варианты
|
||||
*/
|
||||
|
@ -63,6 +66,7 @@ class ModulePoll_EntityPoll extends EntityORM {
|
|||
}
|
||||
|
||||
protected function afterDelete() {
|
||||
parent::afterDelete();
|
||||
/**
|
||||
* Удаляем варианты ответов
|
||||
*/
|
||||
|
|
|
@ -30,13 +30,16 @@ class ModulePoll_EntityVote extends EntityORM {
|
|||
);
|
||||
|
||||
protected function beforeSave() {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateCreate(date("Y-m-d H:i:s"));
|
||||
if ($bResult=parent::beforeSave()) {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateCreate(date("Y-m-d H:i:s"));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return $bResult;
|
||||
}
|
||||
|
||||
protected function afterSave() {
|
||||
parent::afterSave();
|
||||
if ($this->_isNew()) {
|
||||
/**
|
||||
* Отмечаем факт голосования в опросе и вариантах
|
||||
|
|
|
@ -94,21 +94,23 @@ class ModuleProperty_EntityProperty extends EntityORM {
|
|||
* @return bool
|
||||
*/
|
||||
protected function beforeSave() {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateCreate(date("Y-m-d H:i:s"));
|
||||
if ($bResult=parent::beforeSave()) {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateCreate(date("Y-m-d H:i:s"));
|
||||
|
||||
$oValue=Engine::GetEntity('ModuleProperty_EntityValue',array('property_type'=>$this->getType(),'property_id'=>$this->getId(),'target_type'=>$this->getTargetType(),'target_id'=>$this->getId()));
|
||||
$oValueType=$oValue->getValueTypeObject();
|
||||
/**
|
||||
* Выставляем дефолтные значения параметров
|
||||
*/
|
||||
$this->setParams($oValueType->getParamsDefault());
|
||||
/**
|
||||
* Выставляем дефолтные значения параметров валидации
|
||||
*/
|
||||
$this->setValidateRules($oValueType->getValidateRulesDefault());
|
||||
$oValue=Engine::GetEntity('ModuleProperty_EntityValue',array('property_type'=>$this->getType(),'property_id'=>$this->getId(),'target_type'=>$this->getTargetType(),'target_id'=>$this->getId()));
|
||||
$oValueType=$oValue->getValueTypeObject();
|
||||
/**
|
||||
* Выставляем дефолтные значения параметров
|
||||
*/
|
||||
$this->setParams($oValueType->getParamsDefault());
|
||||
/**
|
||||
* Выставляем дефолтные значения параметров валидации
|
||||
*/
|
||||
$this->setValidateRules($oValueType->getValidateRulesDefault());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return $bResult;
|
||||
}
|
||||
/**
|
||||
* Выполняется перед удалением сущности
|
||||
|
@ -116,23 +118,25 @@ class ModuleProperty_EntityProperty extends EntityORM {
|
|||
* @return bool
|
||||
*/
|
||||
protected function beforeDelete() {
|
||||
/**
|
||||
* Сначала удаляем стандартные значения
|
||||
*/
|
||||
$this->Property_RemoveValueByPropertyId($this->getId());
|
||||
/**
|
||||
* Удаляем значения тегов
|
||||
*/
|
||||
$this->Property_RemoveValueTagByPropertyId($this->getId());
|
||||
/**
|
||||
* Удаляем значения селектов
|
||||
*/
|
||||
$this->Property_RemoveValueSelectByPropertyId($this->getId());
|
||||
/**
|
||||
* Удаляем сами варианты селектов
|
||||
*/
|
||||
$this->Property_RemoveSelectByPropertyId($this->getId());
|
||||
return true;
|
||||
if ($bResult=parent::beforeDelete()) {
|
||||
/**
|
||||
* Сначала удаляем стандартные значения
|
||||
*/
|
||||
$this->Property_RemoveValueByPropertyId($this->getId());
|
||||
/**
|
||||
* Удаляем значения тегов
|
||||
*/
|
||||
$this->Property_RemoveValueTagByPropertyId($this->getId());
|
||||
/**
|
||||
* Удаляем значения селектов
|
||||
*/
|
||||
$this->Property_RemoveValueSelectByPropertyId($this->getId());
|
||||
/**
|
||||
* Удаляем сами варианты селектов
|
||||
*/
|
||||
$this->Property_RemoveSelectByPropertyId($this->getId());
|
||||
}
|
||||
return $bResult;
|
||||
}
|
||||
/**
|
||||
* Возвращает правила валидации поля
|
||||
|
|
|
@ -30,12 +30,14 @@ class ModuleProperty_EntityTarget extends EntityORM {
|
|||
);
|
||||
|
||||
protected function beforeSave() {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateCreate(date("Y-m-d H:i:s"));
|
||||
} else {
|
||||
$this->setDateUpdate(date("Y-m-d H:i:s"));
|
||||
if ($bResult=parent::beforeSave()) {
|
||||
if ($this->_isNew()) {
|
||||
$this->setDateCreate(date("Y-m-d H:i:s"));
|
||||
} else {
|
||||
$this->setDateUpdate(date("Y-m-d H:i:s"));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return $bResult;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 222c0f4c224fa7805f6d68594852d18d6edcc9d7
|
||||
Subproject commit 2de709e183af5a12065efbf8128407ec68785e20
|
Loading…
Reference in a new issue