function get() { global $REX; if ($this->checkPermission()) { $callable = array($this, '_get'); $cachekey = $this->funcCache->computeCacheKey($callable, array($REX['USER']->getUserLogin())); $cacheBackend = $this->funcCache->getCache(); $configForm = ''; if ($this->config) { $configForm = $this->config ? $this->config->get() : ''; // config changed -> remove cache to reflect changes if ($this->config->changed()) { $cacheBackend->remove($cachekey); } } // refresh clicked in actionbar if (rex_get('refresh', 'string') == $this->getId()) { $cacheBackend->remove($cachekey); } // prueft ob inhalte des callables gecacht vorliegen $content = $this->funcCache->call($callable, array($REX['USER']->getUserLogin())); // wenn gecachter inhalt leer ist, vom cache entfernen und nochmals checken // damit leere komponenten sofort angezeigt werden, wenn neue inhalte verfuegbar sind if ($content == '') { $cacheBackend->remove($cachekey); $content = $this->funcCache->call($callable, array($REX['USER']->getUserLogin())); } $cachestamp = $cacheBackend->getLastModified($cachekey); if (!$cachestamp) { $cachestamp = time(); } // falls kein gueltiger cache vorhanden $cachetime = rex_formatter::format($cachestamp, 'strftime', 'datetime'); $content = strtr($content, array('%%actionbar%%' => $this->getActionBar())); $content = strtr($content, array('%%cachetime%%' => $cachetime)); $content = strtr($content, array('%%config%%' => $configForm)); // refresh clicked in actionbar if (rex_get('ajax-get', 'string') == $this->getId()) { // clear output-buffer while (@ob_end_clean()) { } rex_send_resource($content); exit; } return $content; } return ''; }
function send($lastModified = null) { ob_start(); $res = $this->_sendImage(null, $lastModified); $content = ob_get_clean(); if (!$res) { return false; } $this->sendHeader(); rex_send_resource($content, false, $lastModified); }