Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/db/dbitem.php
Show First 20 Lines • Show All 564 Lines • ▼ Show 20 Line(s) | |||||
* Returns pending actions | * Returns pending actions | ||||
* | * | ||||
* @param mixed $id | * @param mixed $id | ||||
* @return Array | * @return Array | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function getPendingActions($id = null) | public function getPendingActions($id = null) | ||||
{ | { | ||||
if ( !$this->Application->isWebRequest() ) { | |||||
return array(); | |||||
} | |||||
if ( !isset($id) ) { | if ( !isset($id) ) { | ||||
$id = $this->GetID(); | $id = $this->GetID(); | ||||
} | } | ||||
$pending_actions = $this->Application->RecallVar($this->_getPendingActionVariableName()); | $pending_actions = $this->Application->RecallVar($this->_getPendingActionVariableName()); | ||||
$pending_actions = $pending_actions ? unserialize($pending_actions) : Array (); | $pending_actions = $pending_actions ? unserialize($pending_actions) : Array (); | ||||
if ( is_numeric($id) ) { | if ( is_numeric($id) ) { | ||||
Show All 17 Lines | |||||
* | * | ||||
* @param Array|null $new_pending_actions | * @param Array|null $new_pending_actions | ||||
* @param mixed $id | * @param mixed $id | ||||
* @return void | * @return void | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function setPendingActions($new_pending_actions = null, $id = null) | public function setPendingActions($new_pending_actions = null, $id = null) | ||||
{ | { | ||||
if ( !$this->Application->isWebRequest() ) { | |||||
return; | |||||
} | |||||
if ( !isset($new_pending_actions) ) { | if ( !isset($new_pending_actions) ) { | ||||
$new_pending_actions = Array (); | $new_pending_actions = Array (); | ||||
} | } | ||||
if ( !isset($id) ) { | if ( !isset($id) ) { | ||||
$id = $this->GetID(); | $id = $this->GetID(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 571 Lines • ▼ Show 20 Line(s) | |||||
/** | /** | ||||
* Set's modification flag for main prefix of current prefix to true | * Set's modification flag for main prefix of current prefix to true | ||||
* | * | ||||
* @param int $mode | * @param int $mode | ||||
* @access private | * @access private | ||||
*/ | */ | ||||
public function setModifiedFlag($mode = null) | public function setModifiedFlag($mode = null) | ||||
{ | { | ||||
if ( !$this->Application->isWebRequest() ) { | |||||
return; | |||||
} | |||||
$main_prefix = $this->Application->GetTopmostPrefix($this->Prefix); | $main_prefix = $this->Application->GetTopmostPrefix($this->Prefix); | ||||
$this->Application->StoreVar($main_prefix . '_modified', '1', true); // true for optional | $this->Application->StoreVar($main_prefix . '_modified', '1', true); // true for optional | ||||
if ($this->ShouldLogChanges(true)) { | if ($this->ShouldLogChanges(true)) { | ||||
$this->LogChanges($main_prefix, $mode); | $this->LogChanges($main_prefix, $mode); | ||||
if (!$this->IsTempTable()) { | if (!$this->IsTempTable()) { | ||||
$handler = $this->Application->recallObject($this->Prefix . '_EventHandler'); | $handler = $this->Application->recallObject($this->Prefix . '_EventHandler'); | ||||
/* @var $handler kDBEventHandler */ | /* @var $handler kDBEventHandler */ | ||||
$ses_var_name = $main_prefix . '_changes_' . $this->Application->GetTopmostWid($this->Prefix); | $ses_var_name = $main_prefix . '_changes_' . $this->Application->GetTopmostWid($this->Prefix); | ||||
$handler->SaveLoggedChanges($ses_var_name, $this->ShouldLogChanges()); | $handler->SaveLoggedChanges($ses_var_name, $this->ShouldLogChanges()); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Determines, that changes made to this item should be written to change log | * Determines, that changes made to this item should be written to change log | ||||
* | * | ||||
* @param bool $log_changes | * @param bool $log_changes | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function ShouldLogChanges($log_changes = null) | public function ShouldLogChanges($log_changes = null) | ||||
{ | { | ||||
if ( !$this->Application->isWebRequest() ) { | |||||
return false; | |||||
} | |||||
$config = $this->getUnitConfig(); | $config = $this->getUnitConfig(); | ||||
if ( !isset($log_changes) ) { | if ( !isset($log_changes) ) { | ||||
// specific logging mode no forced -> use global logging settings | // specific logging mode no forced -> use global logging settings | ||||
$log_changes = $config->getLogChanges() || $this->Application->ConfigValue('UseChangeLog'); | $log_changes = $config->getLogChanges() || $this->Application->ConfigValue('UseChangeLog'); | ||||
} | } | ||||
return $log_changes && !$config->getForceDontLogChanges(); | return $log_changes && !$config->getForceDontLogChanges(); | ||||
▲ Show 20 Lines • Show All 387 Lines • Show Last 20 Lines |