public function redirectUrl($controller, $action = "base") { $baseurl = base::baseUrl(); $url = $baseurl . "/{$controller}/{$action}"; header("location: {$url}"); die; }
public function addAjaxComponent($container, $controller, $action = "base", $extra = "{}") { $basepath = base::baseUrl(); $url = $basepath . "/{$controller}/{$action}"; $data = "<script>\n\t\t\$(document).ready(function(){\n\t\t\t\$('#{$container}').load('{$url}',{$extra});\n\t\t});\n\t\t</script>"; return $data; }
public function addBluePrint($iehack = false) { $basepath = base::baseUrl(); echo "<style type=\"text/css\"> @import \"{$basepath}/core/styles/bp.css\"; </style>"; if ($iehack) { echo "<!--[if IE]><link rel=\"stylesheet\" href=\"{$basepath}/core/styles/ie.css\" type=\"text/css\" media=\"screen, projection\"><![endif]-->"; } }
function dashboard() { $baseurl = base::baseUrl(); $this->use_view = false; $username = $this->session->username; if (!empty($username)) { echo "<h1 style='margin-bottom:25px;'>Welcome to your blog</h1>"; echo "You can now create your blog post or <a href='{$baseurl}/blog/logout'>Logout</a>"; } }
public static function _loadTemplate($controller, $template, $vars, $uselayout = false) { global $debug, $debugparts; if ($debug) { $_vars = $vars; unset($_vars["app"]); unset($_vars["lang"]); $debugparts[] = array("type" => "view", "value" => array("viewfile" => $template, "controller" => $controller, "params" => $_vars, "layout" => $uselayout)); } extract($vars); $baseurl = base::baseUrl(); if ($uselayout) { ob_start(); } $templatefile = "app/views/{$controller}/{$template}.php"; if (file_exists($templatefile)) { include_once $templatefile; } else { throw new Exception("View '{$template}.php' is not found in views/{$controller} directory."); } if ($uselayout) { //die("using layout)"); $layoutdata = ob_get_clean(); $layoutfilelocal = "app/views/{$controller}/{$controller}.php"; $layoutfileglobal = "app/views/layouts/{$controller}.php"; if (file_exists($layoutfilelocal)) { include_once $layoutfilelocal; } else { if (file_exists($layoutfileglobal)) { include_once $layoutfileglobal; } else { echo $layoutdata; } } } }
function addYahooUIFromGoogle() { $base = base::baseUrl(); echo "<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/yui/2.7.0/build/yuiloader/yuiloader-min.js' ></script>\n"; }
function getUrl($filename = "") { $imagepath = base::baseUrl() . "/app/images/{$filename}"; return $imagepath; }
function getCurrentURL() { $router = loader::load("router"); $url = base::baseUrl() . "/" . $router->getRoute(); return $url; }
private static final function url($url) { self::$baseUrl = $url; return self::$baseUrl; }
<?php header("Content-type: text/javascript; charset: UTF-8"); ?> var baseUrl = "<?php echo base::baseUrl(); ?> "; function addFLVPlayer(playerurl,url, width, height, container,preview, allowfullscreen) { var s1 = new SWFObject(playerurl,"single",width,height,"7"); s1.addParam("allowfullscreen",allowfullscreen); s1.addVariable("file",url); if (preview!="") s1.addVariable("image",preview); s1.addVariable("width",width); s1.addVariable("height",height); s1.write(container); function isIE() { if (document.all) return true; return false; } function submitForm(formId) { formId = "#"+formId; //if (!action)