/** * no unit test, has to be tested manually * /kwf/test/kwf_eye-candy_tabs_test * * Important points to check: * 1. fast switching between tabs. * 2. Openening hidden region and check if tabs are resizing correctly, * moving content down */ public function indexAction() { $view = new Kwf_View(); $view->settings = array('selector' => '> div', 'scrollDelay' => 50, 'scrollAmount' => 1, 'scrollDirection' => 'up'); $this->getResponse()->setBody($view->render(dirname(__FILE__) . '/Test.tpl')); $this->_helper->viewRenderer->setNoRender(true); }
public function subAction() { $view = new Kwf_View(); $view->result = 'sub'; $this->getResponse()->setBody($view->render(dirname(__FILE__) . '/Test.tpl')); $this->_helper->viewRenderer->setNoRender(true); }
public function lazyLoadAction() { $view = new Kwf_View(); $view->dep = new Kwf_Assets_Package(new Kwf_Assets_LazyLoad_TestProviderList(), 'Bar'); $this->getResponse()->setBody($view->render(dirname(__FILE__) . '/Test.tpl')); $this->_helper->viewRenderer->setNoRender(true); }
public function render($name) { if (isset($this->xtype) && !isset($this->ext)) { $this->ext(null); } return parent::render($name); }
public function getHelper($name) { $ret = parent::getHelper($name); if ($ret instanceof Kwf_Component_View_Helper_Abstract && $this->_renderer) { $ret->setRenderer($this->_renderer); } return $ret; }
public function render($name) { if (isset($this->xtype) && !isset($this->ext)) { $this->ext(null); } $ret = parent::render($name); $ret = self::_replaceKwfUp($ret); return $ret; }
public function getEnquiryAction() { $id = $this->_getParam('id'); $row = $this->_getModel()->getRow($id); $view = new Kwf_View(); $mc = $row->getMailContent(Kwf_Model_Mail_Row::MAIL_CONTENT_HTML); if (!$mc) { $mc = nl2br($row->getMailContent(Kwf_Model_Mail_Row::MAIL_CONTENT_TEXT)); } $view->mailContent = $mc; $view->subject = $row->subject; $view->send_date = $row->save_date; $view->cc = $row->getCc(); $view->header = $row->getHeader(); $view->bcc = $row->getBcc(); $view->to = $row->getTo(); $view->from = $row->getFrom(); $this->getResponse()->setBody($view->render('enquiry.tpl')); $this->_helper->viewRenderer->setNoRender(); }
public static function writeMaintenanceBootstrapSelf($output = true) { if (!is_writable('.') || !is_writable('bootstrap.php')) { return; } if (file_exists('bootstrap.php.backup')) { throw new Kwf_Exception("maintenance bootstrap already written"); } $offlineBootstrap = "<?php\n"; $offlineBootstrap .= "\$requestUri = isset(\$_SERVER['REQUEST_URI']) ? \$_SERVER['REQUEST_URI'] : null;\n"; if (Kwf_Setup::getBaseUrl()) { $offlineBootstrap .= "if (\$requestUri !== null) {\n"; $offlineBootstrap .= " if (substr(\$requestUri, 0, " . strlen(Kwf_Setup::getBaseUrl()) . ") != '" . Kwf_Setup::getBaseUrl() . "') {\n"; $offlineBootstrap .= " throw new Exception('Invalid baseUrl');\n"; $offlineBootstrap .= " }\n"; $offlineBootstrap .= " \$requestUri = substr(\$requestUri, " . strlen(Kwf_Setup::getBaseUrl()) . ");\n"; $offlineBootstrap .= "}\n"; } $offlineBootstrap .= "if (PHP_SAPI == 'cli' || (\n substr(\$requestUri, 0, 14) == '/kwf/util/apc/' ||\n \$requestUri == '/kwf/json-progress-status' ||\n substr(\$requestUri, 0, 8) == '/assets/' ||\n substr(\$requestUri, 0, 10) == '/check.php'\n )) {\n"; $offlineBootstrap .= " require('bootstrap.php.backup');\n"; $offlineBootstrap .= "} else {\n"; $offlineBootstrap .= " header(\"HTTP/1.0 503 Service Unavailable\");\n"; $offlineBootstrap .= " header(\"Content-Type: text/html; charset=utf-8\");\n"; if (file_exists('views/maintenance.php')) { //dynamic maintenance page $offlineBootstrap .= " include('views/maintenance.php');\n"; } else { $view = new Kwf_View(); $html = $view->render('maintenance.tpl'); $html = str_replace("\\", "\\\\", $html); $html = str_replace("\"", "\\\"", $html); $offlineBootstrap .= " echo \"" . $html . "\";\n"; } $offlineBootstrap .= "}\n"; rename('bootstrap.php', 'bootstrap.php.backup'); file_put_contents('bootstrap.php', $offlineBootstrap); if ($output) { echo "\nwrote offline bootstrap.php\n\n"; } Kwf_Util_ClearCache::clearOptcode(getcwd() . '/bootstrap.php'); }
public function page2Action() { $view = new Kwf_View(); $this->getResponse()->setBody($view->render(dirname(__FILE__) . '/Page2.tpl')); $this->_helper->viewRenderer->setNoRender(true); }