public function send($message = null) { if (is_null($message) && !is_null($this->template)) { call_user_func(rx_function("rx_set_smarty_paths"), $this->model); $this->message = $this->model->fetch($this->template . ".tpl"); } return $this->sendEmail(); }
function rx_interceptor_page($user, $info, $handlerName) { $user->validate(); include_once RUDRA . "/core/handler/AbstractHandler.php"; $handlerInfo = ClassUtil::getHandler($handlerName); if ($handlerInfo != NULL) { global $temp; include_once $handlerInfo["filePath"]; $className = $handlerInfo["className"]; $tempClass = new ReflectionClass($className); if ($tempClass->isInstantiable()) { $temp = $tempClass->newInstance(); } if ($temp != NULL) { if ($tempClass->hasMethod("invokeHandler")) { $tpl = new Smarty(); call_user_func(rx_function("rx_set_smarty_paths"), $tpl); $tpl->debugging = RX_SMARTY_DEBUG; $header = new Header($tpl); $page = new Page(); $view = call_method_by_class($tempClass, $temp, 'invokeHandler', array('tpl' => $tpl, 'viewModel' => $tpl, 'user' => $user, 'header' => $header, 'page' => $page, 'dataModel' => $page->data, 'data' => new RequestData(get_request_param("data"))), $handlerInfo["requestParams"]); if (!isset($view)) { $view = $handlerName; } $tpl->assign('user', $user); $tpl->assign('page', $page); $tpl->assign('header', $header); $tpl->assign('CONTEXT_PATH', CONTEXT_PATH); $tpl->assign('RESOURCE_PATH', RESOURCE_PATH); $tpl->assign('METAS', $header->metas); $tpl->assign('TITLE', $header->title); $view_path = $view . TEMP_EXT; if (!file_exists($view_path)) { $tpl->setTemplateDir(RUDRA . "/core/view"); //$view_path = get_include_path () . RUDRA . "/core/view/".$view.TEMP_EXT; //$view_path = get_include_path () . RUDRA . "../view/".$view.TEMP_EXT; } $tpl->assign('BODY_FILES', $view_path); $tpl->assign('page_json', json_encode($page->data->data)); $tpl->display(RUDRA . "/core/view/full.tpl"); Browser::log("header", $header->css, $header->scripts); Browser::printlogs(); } } } }
function rx_interceptor_template($user, $info, $handlerName) { $user->validate(); include_once RUDRA . "/core/handler/AbstractHandler.php"; $handlerInfo = ClassUtil::getHandler($handlerName); if ($handlerInfo != NULL) { global $temp; include_once $handlerInfo["filePath"]; $className = $handlerInfo["className"]; $tempClass = new ReflectionClass($className); if ($tempClass->isInstantiable()) { $temp = $tempClass->newInstance(); } if ($temp != NULL) { if ($tempClass->hasMethod("invokeHandler")) { $tpl = new Smarty(); call_user_func(rx_function("rx_set_smarty_paths"), $tpl); $tpl->debugging = RX_SMARTY_DEBUG; $page = new Page(); $view = call_method_by_class($tempClass, $temp, 'invokeHandler', array('tpl' => $tpl, 'viewModel' => $tpl, 'user' => $user, 'page' => $page, 'dataModel' => $page->data, 'data' => new RequestData(get_request_param("data"))), $handlerInfo["requestParams"]); if (!isset($view)) { $view = $handlerName; } $tpl->assign('user', $user); $tpl->assign('CONTEXT_PATH', CONTEXT_PATH); $tpl->assign('RESOURCE_PATH', RESOURCE_PATH); if (isset($tpl->repeatData)) { foreach ($tpl->repeatData as $key => $value) { $tpl->assign($value['key'], $value['value']); $tpl->display($this->getViewPath() . $view . Config::get('TEMP_EXT')); } } else { $tpl->display($this->getViewPath() . $view . Config::get('TEMP_EXT')); } echo TEMP_DELIMITER; Browser::printlogs(); echo TEMP_DELIMITER . json_encode($page->data->data); Browser::printlogs(); } } } }
function rx_interceptor_template($user, $controllerInfo, $params, $controllerExecute) { $tpl = new Smarty(); $params["model"] = $tpl; $view = $controllerExecute($params); call_user_func(rx_function("rx_set_smarty_paths"), $tpl); $tpl->debugging = RX_SMARTY_DEBUG; $tpl->assign('user', $user); $tpl->assign('CONTEXT_PATH', CONTEXT_PATH); $tpl->assign('RESOURCE_PATH', RESOURCE_PATH); if (empty($view)) { echo "!!Empty Template!!"; return; } if (isset($tpl->repeatData)) { foreach ($tpl->repeatData as $key => $value) { $tpl->assign($value['key'], $value['value']); $tpl->display($view . Config::get('TEMP_EXT')); } } else { $tpl->display($view . Config::get('TEMP_EXT')); } }
function rx_interceptor_page($user, $controllerInfo, $params, $controllerExecute) { ?> <html> <? $tpl = new Smarty (); $params["model"] = $tpl; $header = new \app\model\Header ($tpl); call_user_func(rx_function("rx_set_smarty_paths"), ($tpl)); $view = $controllerExecute($params); $tpl->debugging = RX_SMARTY_DEBUG; $tpl->assign('user', $user); $tpl->assign('header', $header); $tpl->assign('CONTEXT_PATH', CONTEXT_PATH); $tpl->assign('METAS', $header->metas); $tpl->assign('TITLE', $header->title); ?> <head></head> <body> <? $tpl->display($view_path = $view . TEMP_EXT); ?></body><? Browser::log("header", $header->css, $header->scripts); Browser::printlogs(); ?></html><? }
/** Default RudraX Plug * * @RequestMapping(url="cache.manifest",type=data,cache = false) * */ function manifest($mdfile) { header('Content-type: text/cache-manifest'); header('Cache-Control: no-cache'); include_once RUDRA . "/smarty/Smarty.class.php"; $tpl = new Smarty(); call_user_func(rx_function("rx_set_smarty_paths"), $tpl); $tpl->display(get_include_path() . RUDRA . "/core/view/manifest.tpl"); //readfile("../".RUDRA."/core/offline/cache.manifest"); }
public function invoke(User $user, $handlerName) { return call_user_func(rx_function("rx_page_interceptor"), $user, $handler); }
public function _dataInterceptor_($info, $controllerOutput) { return call_user_func(rx_function("rx_interceptor_data"), $this->user, $info, $controllerOutput); }
public static function scan() { self::init(true); call_user_func(rx_function("rx_scan_classes")); }
public static function read($glob_config, $file, $file2 = null) { $debug = isset($glob_config["RX_MODE_DEBUG"]) && $glob_config["RX_MODE_DEBUG"] == TRUE; $debug_build = isset($_REQUEST["RX_MODE_BUILD"]) && $_REQUEST["RX_MODE_BUILD"] == TRUE; self::$cache = new RxCache("config", true); $reloadCache = FALSE; header("FLAGS:" . self::$cache->isEmpty() . "-" . $glob_config["RX_MODE_DEBUG"] . "-" . $debug); if (self::$cache->isEmpty()) { $reloadCache = TRUE; } else { $_glob_config = self::$cache->get("GLOBAL"); if ($_glob_config["RX_MODE_DEBUG"] != $debug || isset($_GET['ModPagespeed'])) { $reloadCache = TRUE; } } $RELOAD_VERSION = self::$cache->get("RELOAD_VERSION"); if ($debug_build || $debug || $reloadCache) { FileUtil::build_check(); define("FIRST_RELOAD", TRUE); $RELOAD_VERSION = microtime(true); RxCache::clean(); self::$cache->set("RELOAD_VERSION", $RELOAD_VERSION); $DEFAULT_CONFIG = parse_ini_file("_project.properties", TRUE); $localConfig = array(); if (file_exists($file)) { $localConfig = parse_ini_file($file, TRUE); } $localConfig = array_replace_recursive($DEFAULT_CONFIG, $localConfig); if ($file2 != null && file_exists($file2)) { $localConfig = array_replace_recursive($localConfig, parse_ini_file($file2, TRUE)); } self::$cache->merge($localConfig); self::$cache->set('GLOBAL', array_merge($DEFAULT_CONFIG['GLOBAL'], $localConfig['GLOBAL'], $glob_config)); $reloadMode = isset($_GET['ModPagespeed']) ? $_GET['ModPagespeed'] : NULL; call_user_func(rx_function("rx_reload_cache"), $reloadMode); self::$cache->save(); Browser::header("RX_MODE_BUILD"); } else { define("FIRST_RELOAD", FALSE); } define("RELOAD_VERSION", $RELOAD_VERSION); return self::$cache->getArray(); }
public function _interceptor_($info, $params) { if (!isset($info["type"])) { $info["type"] = "data"; } if (isset($info["type"])) { $controller = $this; return call_user_func(rx_function("rx_interceptor_" . $info["type"]), $this->user, $info, $params, function ($newParams) use($controller, $info, $params) { try { $dontPrevent = true; if (method_exists($controller, "_before_controller_")) { $dontPrevent = !!call_method_by_object($controller, "_before_controller_", $newParams, $info["requestParams"]); } $returned = null; if ($dontPrevent) { $returned = call_method_by_object($controller, $info["method"], $newParams, $info["requestParams"]); if (method_exists($controller, "_post_controller_")) { $returned = call_method_by_object($controller, "_post_controller_", $newParams, $info["requestParams"]); } return $returned; } } catch (\Exception $e) { if (function_exists("controller_exception_handler")) { controller_exception_handler($e); } else { print_line("<div style='display:none'>**============**"); print_line("Controller Exception:" . $e->getMessage()); print_line("**--------------**"); print_line($e->getTraceAsString()); print_line("**============**</div>"); } } return "empty"; }); } }