예제 #1
0
 public function redirectUrl($controller, $action = "base")
 {
     $baseurl = base::baseUrl();
     $url = $baseurl . "/{$controller}/{$action}";
     header("location: {$url}");
     die;
 }
예제 #2
0
 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;
 }
예제 #3
0
 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]-->";
     }
 }
예제 #4
0
 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>";
     }
 }
예제 #5
0
 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;
             }
         }
     }
 }
예제 #6
0
 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";
 }
예제 #7
0
 function getUrl($filename = "")
 {
     $imagepath = base::baseUrl() . "/app/images/{$filename}";
     return $imagepath;
 }
예제 #8
0
function getCurrentURL()
{
    $router = loader::load("router");
    $url = base::baseUrl() . "/" . $router->getRoute();
    return $url;
}
예제 #9
0
파일: base.php 프로젝트: suconghou/sprite
 private static final function url($url)
 {
     self::$baseUrl = $url;
     return self::$baseUrl;
 }
예제 #10
0
<?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)