mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-05-07 11:28:21 +03:00
Merge branch 'master' of https://github.com/livestreet/livestreet
This commit is contained in:
commit
8478dc6bd8
|
@ -400,6 +400,19 @@ class ActionContent extends Action
|
||||||
if ($oTopic->getPublishDateRaw()) {
|
if ($oTopic->getPublishDateRaw()) {
|
||||||
$oTopic->setDatePublish(date("Y-m-d H:i:s", $oTopic->getPublishDateRaw()));
|
$oTopic->setDatePublish(date("Y-m-d H:i:s", $oTopic->getPublishDateRaw()));
|
||||||
$bSendNotify = false;
|
$bSendNotify = false;
|
||||||
|
} else {
|
||||||
|
/**
|
||||||
|
* Снятие даты публикации, только при условии, что была установлена дата в будущем
|
||||||
|
*/
|
||||||
|
if ($oTopic->getDatePublish() and strtotime($oTopic->getDatePublish()) > time()) {
|
||||||
|
$oTopic->setDatePublish(date("Y-m-d H:i:s"));
|
||||||
|
/**
|
||||||
|
* Если сохраняем отложенный в черновик, то считаем, что он еще ниразу не публиковался
|
||||||
|
*/
|
||||||
|
if (isset($_REQUEST['is_draft'])) {
|
||||||
|
$oTopic->setPublishDraft(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$oBlog = $oTopic->getBlog();
|
$oBlog = $oTopic->getBlog();
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -145,7 +145,7 @@ class ModuleTopic_EntityTopic extends Entity
|
||||||
$oTopicType = $this->getTypeObject();
|
$oTopicType = $this->getTypeObject();
|
||||||
$oUser = $this->getUserCreator();
|
$oUser = $this->getUserCreator();
|
||||||
if ($oTopicType and $oTopicType->isAllowCreateDeferredTopic($oUser)) {
|
if ($oTopicType and $oTopicType->isAllowCreateDeferredTopic($oUser)) {
|
||||||
if ((!$this->getId() or !$this->getPublishDraft() or ($this->getDatePublish() and strtotime($this->getDatePublish()) > time())) and isset($aValue['date']) and is_string($aValue['date']) and isset($aValue['time']) and is_string($aValue['time'])) {
|
if ((!$this->getId() or !$this->getPublishDraft() or ($this->getDatePublish() and strtotime($this->getDatePublish()) > time())) and isset($aValue['date']) and is_string($aValue['date']) and $aValue['date'] and isset($aValue['time']) and is_string($aValue['time'])) {
|
||||||
$sDateFull = $aValue['date'] . ' ' . $aValue['time'];
|
$sDateFull = $aValue['date'] . ' ' . $aValue['time'];
|
||||||
if ($this->Validate_Validate('date', $sDateFull, array('format' => 'dd.MM.yyyy HH:mm', 'allowEmpty' => true))) {
|
if ($this->Validate_Validate('date', $sDateFull, array('format' => 'dd.MM.yyyy HH:mm', 'allowEmpty' => true))) {
|
||||||
$sDateFull = strtotime($sDateFull); // для охвата всей минуты
|
$sDateFull = strtotime($sDateFull); // для охвата всей минуты
|
||||||
|
|
Loading…
Reference in a new issue