Index: branches/5.2.x/core/units/phrases/phrase_tp.php =================================================================== diff -u -N -r14244 -r14748 --- branches/5.2.x/core/units/phrases/phrase_tp.php (.../phrase_tp.php) (revision 14244) +++ branches/5.2.x/core/units/phrases/phrase_tp.php (.../phrase_tp.php) (revision 14748) @@ -1,8 +1,8 @@ Application->GetVar('simple_mode') && (int)$this->Application->ConfigValue('UsePopups'); - } +class PhraseTagProcessor extends kDBTagProcessor { - function PhraseCount($params) - { - static $cache = null; + /** + * Determines, that we can close phrase editing form without parent window refreshing + * + * @param Array $params + * @return bool + */ + function UseQuickFormCancel($params) + { + return $this->Application->GetVar('simple_mode') && (int)$this->Application->ConfigValue('UsePopups'); + } - if (!isset($cache)) { - $sql = 'SELECT COUNT(*), Module - FROM ' . $this->Application->getUnitOption($this->Prefix, 'TableName') . ' - GROUP BY Module'; - $cache = $this->Conn->GetCol($sql, 'Module'); - } + function PhraseCount($params) + { + static $cache = null; - $module = $params['module']; - - return array_key_exists($module, $cache) ? $cache[$module] : 0; + if (!isset($cache)) { + $sql = 'SELECT COUNT(*), Module + FROM ' . $this->Application->getUnitOption($this->Prefix, 'TableName') . ' + GROUP BY Module'; + $cache = $this->Conn->GetCol($sql, 'Module'); } - function EventCount($params) - { - static $cache = null; + $module = $params['module']; - if (!isset($cache)) { - $sql = 'SELECT COUNT(*), IF(Module LIKE "Core:%", "Core", Module) AS Module - FROM ' . $this->Application->getUnitOption('emailevents', 'TableName') . ' - GROUP BY Module'; - $cache = $this->Conn->GetCol($sql, 'Module'); - } + return array_key_exists($module, $cache) ? $cache[$module] : 0; + } - $module = $params['module']; + function EventCount($params) + { + static $cache = null; - return array_key_exists($module, $cache) ? $cache[$module] : 0; + if (!isset($cache)) { + $sql = 'SELECT COUNT(*), IF(Module LIKE "Core:%", "Core", Module) AS Module + FROM ' . $this->Application->getUnitOption('emailevents', 'TableName') . ' + GROUP BY Module'; + $cache = $this->Conn->GetCol($sql, 'Module'); } - } \ No newline at end of file + + $module = $params['module']; + + return array_key_exists($module, $cache) ? $cache[$module] : 0; + } +} \ No newline at end of file