function displayDepartUser($departID, $userID)
{
    $tpl = new FastTemplate("templates/");
    $tpl->define(array("user" => "index/user.html", "department" => "index/department.html", "depart_user" => "index/depart_user.html", "header" => "index/header.html"));
    $departDAO = new DepartmentDAO();
    $depart = $departDAO->getDepartmentByID($departID);
    if ($departID == "1" || $depart === null) {
        $tpl->assign("INDEX_DEPART_USER_HEADER", "");
    } else {
        $tpl->assign("INDEX_HEADER_NAME", $depart->getDepartmentName());
        $tpl->parse("INDEX_DEPART_USER_HEADER", "header");
    }
    $result = findDepartAndUser($departID, $userID);
    if ($result === false || count($result) === 0) {
        $tpl->assign("INDEX_DEPART_USER", "");
    } else {
        foreach ($result as $node) {
            if ($node["type"] == 1) {
                $tpl->assign("INDEX_DEPARTID", $node["id"]);
                $tpl->assign("INDEX_DEPART_NAME", $node["name"]);
                $tpl->parse("INDEX_DEPART_USER", ".department");
            } elseif ($node["type"] == 2) {
                $tpl->assign("INDEX_USERID", $node["id"]);
                $tpl->assign("INDEX_USER_NAME", $node["name"]);
                $tpl->parse("INDEX_DEPART_USER", ".user");
            }
        }
    }
    $tpl->parse("MAIN", "depart_user");
    $tpl->FastPrint();
}
Esempio n. 2
0
/**
 * Fills template with headers and cells array
 * @param $headers - array of column headers
 * @param $cells - array of cell values
 * @param $caption - caption of table
 * @param $rows - number of rows
 * @param $cols - caption of columns
 */
function fillTable($headers, $cells, $caption, $rows, $cols)
{
    // initializing of fasttemplate
    $ft = new FastTemplate("./templates/");
    $ft->define(array('table' => "flextable.html"));
    $ft->define_dynamic("header", "table");
    $ft->define_dynamic("rows", "table");
    $ft->define_dynamic("cols", "table");
    //handling headers (column names)
    foreach ($headers as $head) {
        $ft->assign(array('header' => $head));
        $ft->parse('HEADERS', ".header");
    }
    // handling cells
    foreach ($cells as $row) {
        foreach ($row as $cell) {
            $ft->assign(array('cellvalue' => $cell));
            $ft->parse('COLS', ".cols");
        }
        $ft->parse('ROWS', ".rows");
        $ft->clear("COLS");
    }
    $ft->assign("caption", $caption);
    $ft->assign("rows", $rows);
    $ft->assign("cols", $cols);
    $ft->parse('MAIN', "table");
    $ft->FastPrint('MAIN');
}
Esempio n. 3
0
 public function check_authentification()
 {
     // begin authenticate part
     if (AUTH_TYPE == 1) {
         if (!$AUTHENTICATE) {
             header("WWW-Authenticate: Basic realm=\"ADMIN " . CONF_SITE_NAME . "\"");
             header("HTTP/1.0 401 Unauthorized");
             $ft = new FastTemplate(ADMIN_TEMPLATE_CONTENT_PATH);
             $ft->define(array("main" => "template_firstpage.html", "content" => "authentication_failed.html"));
             $ft->multiple_assign_define("LANG_");
             $ft->multiple_assign_define("CONF_");
             $ft->parse("BODY", array("content", "main"));
             $ft->showDebugInfo(ERROR_DEBUG);
             $ft->FastPrint();
             exit;
         }
     } else {
         if (AUTH_TYPE == 2) {
             include_once INCLUDE_PATH . 'cls_session.php';
             $sess = new MYSession();
             if (!$sess->get(SESSION_ID)) {
                 $sess->set('session_url_before', $_SERVER['REQUEST_URI']);
                 header("Location: login.php");
                 exit;
             }
         }
     }
     // end authenticate part
 }
Esempio n. 4
0
function displaySignup()
{
    $tpl = new FastTemplate("templates/");
    $tpl->define(array("web_main" => "web_main.html", "web_header" => "web_header.html", "head_script" => "signup/head_script.html", "body" => "signup/body.html", "web_footer" => "web_footer.html"));
    $tpl->assign("TITLE", "Sign Up");
    $tpl->parse("WEB_HEADER", "web_header");
    $tpl->parse("HEAD_SCRIPT", "head_script");
    $tpl->parse("BODY", ".body");
    $tpl->parse("WEB_FOOTER", "web_footer");
    $tpl->parse("MAIN", "web_main");
    $tpl->FastPrint();
}
Esempio n. 5
0
function displayLogin($message = null)
{
    $tpl = new FastTemplate("templates/");
    $tpl->define(array("web_main" => "web_main.html", "web_header" => "web_header.html", "head_script" => "login/head_script.html", "message" => "login/message.html", "body" => "login/body.html", "web_footer" => "web_footer.html"));
    if ($message != null) {
        $tpl->assign("LOGIN_MESSAGE", $message);
        $tpl->parse("LOGIN_INFO", "message");
    } else {
        $tpl->assign("LOGIN_INFO", "");
    }
    $tpl->assign("TITLE", "Login");
    $tpl->parse("WEB_HEADER", "web_header");
    $tpl->parse("HEAD_SCRIPT", "head_script");
    $tpl->parse("BODY", ".body");
    $tpl->parse("WEB_FOOTER", "web_footer");
    $tpl->parse("MAIN", "web_main");
    $tpl->FastPrint();
}
Esempio n. 6
0
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation; version 2 only.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 */
header('Content-type: text/html; charset=UTF8');
define('PATH_TO_CLASSES', '../administration/classes');
define('EXTENSION', '.php');
require_once PATH_TO_CLASSES . "/cls_db_mysql.php";
require_once PATH_TO_CLASSES . "/cls_fast_template.php";
require_once PATH_TO_CLASSES . "/cls_permissions.php";
$lang = !empty($_POST['lang']) ? $_POST['lang'] : 'pl';
require_once 'i18n/' . $lang . '/i18n.php';
$ft = new FastTemplate("./templates/" . $lang);
$ft_path = $ft->get_root();
$ft->define('main', "main.tpl");
$ft->assign('CSS_HREF', $ft_path . "style/style.css");
$p = empty($_GET['p']) ? '' : $_GET['p'];
switch ($p) {
    default:
        include "modules/main_content.php";
        $ft->parse('MAIN', 'main');
}
$ft->FastPrint();
exit;
Esempio n. 7
0
$lang = get_config('language_set');
$ft = new FastTemplate('./templates/' . $lang . '/main/tpl/');
$ft->define('xml_feed', 'xml_feed.tpl');
$ft->define_dynamic('xml_row', 'xml_feed');
$http_root = get_httproot();
$ft->assign(array('MAINSITE_LINK' => 'http://' . $http_root, 'NEWS_FEED' => false));
if ($db->num_rows() > 0) {
    while ($db->next_record()) {
        $date = $db->f("date");
        $title = $db->f("title");
        $text = $db->f("text");
        $author = $db->f("author");
        $id = $db->f("id");
        $image = $db->f("image");
        $comments_allow = $db->f("comments_allow");
        $comments = $db->f("comments");
        $date = coreRssDateConvert($date);
        $pattern = array("&", "<br />", "<", ">");
        $replacement = array(" &amp; ", "&lt;br /&gt;", "&lt;", "&gt;");
        $text = str_replace($pattern, $replacement, $text);
        $permanent_link = (bool) $rewrite ? $http_root . '1,' . $id . ',1,item.html' : $http_root . 'index.php?p=1&amp;id=' . $id . '';
        $ft->assign(array('DATE' => $date, 'TITLE' => $title, 'AUTHOR' => $author, 'PERMALINK' => $permanent_link, 'TEXT' => $text, 'DISPLAY_XML' => true));
        $ft->parse('XML_ROW', ".xml_row");
    }
} else {
    $ft->assign('DISPLAY_XML', false);
    $ft->parse('XML_ROW', ".xml_row");
}
$ft->parse('CONTENT', "xml_feed");
$ft->FastPrint('CONTENT');
Esempio n. 8
0
<?php

//	Example FastTemplate demo #2: Build a linear web page. (top down)
//	Check your error_log when this is done - this demo has unresolved
//	variables defined in footer.tpl. (On purpose of course :)
// Header("Content-type: text/plain");	// If you want to see the
// raw html in your browser,
// uncomment this.
include "class.FastTemplate.php";
$tpl = new FastTemplate("./templates");
$start = $tpl->utime();
// Benchmarking
$tpl->define(array('header' => "header.tpl", 'body' => "middle.tpl", 'footer' => "footer.tpl"));
$tpl->assign(array('TITLE' => "FastTemplate Demo2", 'HEAD1' => "FastTemplate Page Demo", 'TD1' => "Column 1", 'TD2' => "Column 2", 'TD3' => "Cool Stuff", 'TD4' => '<BLINK>Cooler Stuff</BLINK>', 'MAILTO' => '*****@*****.**', 'LINK' => 'www.thewebmasters.net/php/', 'LINKNAME' => 'The WebMasters Net'));
$tpl->parse('HEAD', "header");
$tpl->parse('BODY', "body");
$tpl->parse('FOOT', "footer");
// $tpl->clear(array("HEAD","BODY"));	// Uncomment this to see how
// the class handles errors
$tpl->FastPrint("HEAD");
$tpl->FastPrint("BODY");
$tpl->FastPrint("FOOT");
$end = $tpl->utime();
$runtime = $end - $start;
echo "Completed in {$runtime} seconds<BR>\n";
exit;
Esempio n. 9
0
<?php

session_start();
error_reporting(E_ALL ^ E_WARNING);
include_once '../commons.php';
include 'checkResultOperation.php';
header('Cache-control: private, must-revalidate');
//support page back
$template = new FastTemplate("../../view/html/templates/reciteWord");
$template->define(array("main" => "checkResult.html", "ol" => "ol.html", "li" => "li.html"));
$template->assign("OL", "");
$template->assign("ACCURANCY", "");
$template->assign("USER_NAME", $_SESSION['username']);
$template->assign("USER_IMG", $_SESSION['userimg']);
$template->assign("USER_ID", $_SESSION['userID']);
if (isset($_POST["checkAns"])) {
    $class = $_SESSION['class'];
    //echo "class  = ".$class;
    $userID = $_SESSION['userID'];
    $trueNo = showTrueIDs($userID, $class);
    //echo "<BR> trueNo = ".$trueNo;
    $template->clear("OL");
    $wrongNo = showWrongIDs($userID, $class);
    //echo "<BR> wrongNo = ".$wrongNo;
    $acc = intval($trueNo / ($trueNo + $wrongNo) * 100);
    $template->assign("ACCURANCY", $acc . "%");
    saveAcc($userID, $acc);
}
$template->parse("CONTENT", "main");
$template->FastPrint();
Esempio n. 10
0
}
############################################################
$tree_array = array();
build_au_array($rootAU, "");
#print_r($tree_array);
foreach (array_keys($tree_array) as $au) {
    if ($tree_array[$au]['roles']) {
        $all_roles[$au]['roles'] = $tree_array[$au]['roles'];
        $all_roles[$au]['zone'] = $tree_array[$au]['zone'];
    }
}
$_SESSION['all_roles'] = $all_roles;
#print_r($_SESSION['all_roles']);
$tree = "";
$text = "Um zu den Administrations-Seiten einer AU zu kommen, w&auml;hlen Sie entsprechenden Link.";
if (!$all_roles) {
    $text = "Sie sind in der Benutzerdatenbank des <b>net&lowast;Client Management</b> registriert<br>\n\t\t\t\tIhnen wurden jedoch noch keine administrativen Rechte zugeordnet<br><br>\n\t\t\t\tWenden Sie sich bitte an<br><br>\n\t\t\t\t<b>**DHCP USER EMAIL**</b>";
} else {
    draw_tree($rootAU, "", "");
}
$template->assign(array("TEXT" => $text));
$template->assign(array("TREE" => $tree));
#############################################################
# Daten in die Vorlage parsen
$template->assign(array("PFAD" => $START_PATH));
$template->parse("LOGIN", "Login");
$template->parse("HAUPTFENSTER", "Webseite");
$template->parse("PAGE", "Vorlage");
# Fertige Seite an den Browser senden
$template->FastPrint("PAGE");
Esempio n. 11
0
<?php

// Example FastTemplate Dynamic Demo
// The dynamic example from the man page
Header("Content-type: text/plain; charset=utf-8");
include "class.FastTemplate.php";
$tpl = new FastTemplate("./templates");
$start = $tpl->utime();
$tpl->define(array('main' => "main.tpl", 'table' => "dynamic.tpl"));
$tpl->assign(array('TITLE' => "FastTemplate Dynamic Test"));
$tpl->define_dynamic("row", "table");
for ($n = 1; $n <= 3; $n++) {
    $Number = $n;
    $BigNum = $n * 10;
    $tpl->assign(array('NUMBER' => $Number, 'BIG_NUMBER' => $BigNum));
    $tpl->parse('{ROWS}', ".row");
}
$tpl->parse('MAIN', array("table", "main"));
$tpl->FastPrint();
$end = $tpl->utime();
$run = $end - $start;
echo "Runtime [{$run}] seconds<BR>\n";
exit;
Esempio n. 12
0
function displayIndex($userID)
{
    $tpl = new FastTemplate("templates/");
    $tpl->define(array("web_main" => "web_main.html", "web_header" => "web_header.html", "head_script" => "index/head_script.html", "user" => "index/user.html", "department" => "index/department.html", "list_item" => "index/list_item.html", "group" => "index/group.html", "comment" => "index/comment.html", "link" => "index/link.html", "image" => "index/image.html", "invitation" => "index/invitation.html", "group_option" => "index/group_option.html", "body" => "index/body.html", "web_nav" => "web_nav.html", "web_footer" => "web_footer.html"));
    $userDAO = new UserDAO();
    $user = $userDAO->getUserByID($userID);
    //initial owner group
    $groupDAO = new GroupDAO();
    $groups = $groupDAO->getGroupsByOwner($user);
    if ($groups === null) {
        $tpl->assign("INDEX_GROUP_OPTION", "");
    } else {
        foreach ($groups as $ownerGroup) {
            $tpl->assign("INDEX_GROUP_OPTIONID", $ownerGroup->getGroupID());
            $tpl->assign("INDEX_GROUP_OPTIONNAME", $ownerGroup->getGroupName());
            $tpl->parse("INDEX_GROUP_OPTION", ".group_option");
        }
    }
    //initial list item
    $gmDAO = new GroupMemberDAO();
    $gms = $gmDAO->getGroupMembersByUser($user);
    if ($gms !== null) {
        $i = 1;
        $hasoneaccept = false;
        foreach ($gms as $gm) {
            if ($gm->getAcceptStatus() == "2") {
                continue;
            }
            $group = $gm->getGroup();
            $tpl->assign("INDEX_LIST_ITEM_GROUPID", $group->getGroupID());
            if ($i == 1) {
                $tpl->assign("INDEX_GROUP_HEADER", $group->getGroupName());
                $tpl->assign("INDEX_LIST_ITEM_ACTIVE", "active");
            } else {
                $tpl->assign("INDEX_LIST_ITEM_ACTIVE", "");
            }
            $tpl->assign("INDEX_LIST_ITEM_SEQ", $i);
            $tpl->assign("INDEX_LIST_ITEM_GROUPNAME", $group->getGroupName());
            $tpl->parse("INDEX_LIST_ITEM_LI", ".list_item");
            $hasoneaccept = true;
            $i++;
        }
        if ($hasoneaccept == false) {
            $tpl->assign("INDEX_LIST_ITEM_LI", "");
            $tpl->assign("INDEX_GROUP_HEADER", "");
        }
    } else {
        $tpl->assign("INDEX_LIST_ITEM_LI", "");
        $tpl->assign("INDEX_GROUP_HEADER", "");
    }
    //initial comments
    $recordDAO = new RecordDAO();
    if ($gms !== null) {
        $hasGMSflag = false;
        $i = 1;
        foreach ($gms as $gm) {
            if ($gm->getAcceptStatus() == "2") {
                continue;
            }
            $group = $gm->getGroup();
            if ($i == 1) {
                $tpl->assign("INDEX_GROUP_HIDE", "");
            } else {
                $tpl->assign("INDEX_GROUP_HIDE", "hide");
            }
            $tpl->assign("INDEX_GROUP_SEQ", $i);
            $records = $recordDAO->getRecordsByGroup($group);
            if ($records === null) {
                $tpl->assign("INDEX_GROUP_COMMENT", "");
            } else {
                $hasOneFlag = false;
                $tpl->clear("INDEX_GROUP_COMMENT");
                foreach ($records as $rec) {
                    if ($rec->getDisplayStatus() === "2") {
                        continue;
                    }
                    $commentUser = $rec->getUser();
                    $tpl->assign("INDEX_GROUP_COMMENT_USERPHOTO", $commentUser->getPhotoURL());
                    $tpl->assign("INDEX_GROUP_COMMENT_USERNAME", $commentUser->getFirstName() . " " . $commentUser->getLastName());
                    $tpl->assign("INDEX_GROUP_COMMENT_TIME", $rec->getTime());
                    $type = $rec->getMessageType();
                    $con = $rec->getContent();
                    if ($type == "1") {
                        $tpl->assign("INDEX_GROUP_COMMENT_CONTENT", htmlentities($con));
                    } else {
                        if ($type == "2") {
                            $tpl->assign("INDEX_CONTENT_IMGURL", $con);
                            $tpl->parse("INDEX_GROUP_COMMENT_CONTENT", "image");
                        } else {
                            if ($type == "3") {
                                $tpl->assign("INDEX_GROUP_CONTENT_LINKURL", $con);
                                $baseName = pathinfo($con, PATHINFO_BASENAME);
                                $pos = strpos($baseName, "_");
                                $oriName = substr($baseName, $pos + 1);
                                $tpl->assign("INDEX_GROUP_CONTENT_LINKNAME", htmlentities($oriName));
                                $tpl->parse("INDEX_GROUP_COMMENT_CONTENT", "link");
                            } else {
                                if ($type == "4") {
                                    $tpl->assign("INDEX_GROUP_CONTENT_LINKURL", "http://" . rawurlencode($con));
                                    $tpl->assign("INDEX_GROUP_CONTENT_LINKNAME", htmlentities($con));
                                    $tpl->parse("INDEX_GROUP_COMMENT_CONTENT", "link");
                                }
                            }
                        }
                    }
                    $tpl->parse("INDEX_GROUP_COMMENT", ".comment");
                    $hasOneFlag = true;
                }
                if ($hasOneFlag == false) {
                    $tpl->assign("INDEX_GROUP_COMMENT", "");
                }
            }
            $tpl->parse("INDEX_GROUP", ".group");
            $hasGMSflag = true;
            $i++;
        }
        if ($hasGMSflag == false) {
            $tpl->assign("INDEX_GROUP_COMMENT", "");
            $tpl->parse("INDEX_GROUP", "group");
        }
    } else {
        $tpl->assign("INDEX_GROUP_COMMENT", "");
        $tpl->parse("INDEX_GROUP", "group");
    }
    //initial department and user
    $result = findDepartAndUser(1, $userID);
    if (count($result) === 0) {
        $tpl->assign("INDEX_DEPART_USER", "");
    } else {
        foreach ($result as $node) {
            if ($node["type"] == 1) {
                $tpl->assign("INDEX_DEPARTID", $node["id"]);
                $tpl->assign("INDEX_DEPART_NAME", $node["name"]);
                $tpl->parse("INDEX_DEPART_USER", ".department");
            } elseif ($node["type"] == 2) {
                $tpl->assign("INDEX_USERID", $node["id"]);
                $tpl->assign("INDEX_USER_NAME", $node["name"]);
                $tpl->parse("INDEX_DEPART_USER", ".user");
            }
        }
    }
    //initial annocement
    $flag = false;
    $gmArr = $gmDAO->getGroupMembersByUser($user);
    if ($gmArr !== null) {
        foreach ($gmArr as $gmPend) {
            if ($gmPend->getAcceptStatus() == "2") {
                $gmGroup = $gmPend->getGroup();
                $gmOwner = $gmGroup->getOwner();
                $tpl->assign("INDEX_INVITATION_OWNER", $gmOwner->getFirstName() . " " . $gmOwner->getLastName());
                $tpl->assign("INDEX_INVITATION_GROUPNAME", $gmGroup->getGroupName());
                $tpl->assign("INDEX_INVITATION_GROUPID", $gmGroup->getGroupID());
                $tpl->parse("INDEX_INVITATION", ".invitation");
                $flag = true;
            }
        }
    }
    if ($flag === false) {
        $tpl->assign("INDEX_INVITATION", "");
    }
    $tpl->assign("TITLE", "Home");
    $tpl->parse("WEB_HEADER", "web_header");
    $tpl->parse("HEAD_SCRIPT", "head_script");
    $tpl->parse("WEB_NAV", "web_nav");
    $tpl->parse("BODY", ".body");
    $tpl->parse("WEB_FOOTER", "web_footer");
    $tpl->parse("MAIN", "web_main");
    $tpl->FastPrint();
}
Esempio n. 13
0
<?php

//  Example FastTemplate Demo #3 - build something other than a web page?
include "cls_fast_template.php";
$ft = new FastTemplate("./templates");
$start = $ft->utime();
// Benchmarking
// Note: test.html will generate (deliberate) errors so check your error_log
$ft->define(array('main' => 'htaccess.html', 'test' => 'test.html'));
$ft->assign(array('AUTH_USER_FILE' => "/home/users/cdi/.htpasswd", 'AUTH_GROUP_FILE' => "/dev/null", 'AUTH_NAME' => '"CDI Was Here"', 'AUTH_TYPE' => "Basic", 'OPTIONS' => "All", 'METHODS' => "GET POST PUT", 'USER_LIMITS' => "require valid-user", 'ERROR_401' => "/cgi-bin/guardian.cgi?401", 'ERROR_402' => "/cgi-bin/guardian.cgi?402", 'ERROR_403' => "/cgi-bin/guardian.cgi?403", 'ERROR_404' => "/cgi-bin/guardian.cgi?404", 'ERROR_500' => "/cgi-bin/guardian.cgi?500"));
//  $ft->no_strict();      // Uncomment this to remove the warnings.
$ft->parse('HTACCESS', array("main", "test"));
$ft->showDebugInfo(1);
$ft->FastPrint("HTACCESS");
$end = $ft->utime();
$runtime = ($end - $start) * 1000;
echo "\nCompleted in {$runtime} seconds \n";
exit;
Esempio n. 14
0
<?php

//	Example FastTemplate Demo #3 - build something other than a web page?
Header("Content-type: text/plain");
include "class.FastTemplate.php";
$tpl = new FastTemplate("./templates");
$start = $tpl->utime();
// Benchmarking
// Note: test.tpl will generate (deliberate) errors so check your error_log
$tpl->define(array('main' => 'htaccess.tpl', 'test' => 'test.tpl'));
$tpl->assign(array('AUTH_USER_FILE' => "/home/users/cdi/.htpasswd", 'AUTH_GROUP_FILE' => "/dev/null", 'AUTH_NAME' => '"CDI Was Here"', 'AUTH_TYPE' => "Basic", 'OPTIONS' => "All", 'METHODS' => "GET POST PUT", 'USER_LIMITS' => "require valid-user", 'ERROR_401' => "/cgi-bin/guardian.cgi?401", 'ERROR_402' => "/cgi-bin/guardian.cgi?402", 'ERROR_403' => "/cgi-bin/guardian.cgi?403", 'ERROR_404' => "/cgi-bin/guardian.cgi?404", 'ERROR_500' => "/cgi-bin/guardian.cgi?500"));
//	$tpl->no_strict();		// Uncomment this to remove the warnings.
$tpl->parse('HTACCESS', array("main", "test"));
$tpl->FastPrint("HTACCESS");
$end = $tpl->utime();
$runtime = $end - $start;
echo "\nCompleted in {$runtime} seconds \n";
exit;
Esempio n. 15
0
$util->check_authentification();
$stringutil = new String("");
$all_url_vars = array();
$stringutil->setIntVars("configid");
$all_url_vars = $stringutil->parse_all();
$SQL = "SELECT `name`,`image`,`help_description`,`url`,`template` FROM `" . DB_PREFIX . "config` WHERE id = '" . $all_url_vars['configid'] . "'";
$retid = mysql_query($SQL) or die(mysql_error());
if ($row = mysql_fetch_array($retid)) {
    $name = $row["name"];
    $help_description = $row["help_description"];
    $image = $row["image"];
    $url = $row["url"];
    $template = $row["template"];
}
$ft = new FastTemplate(ADMIN_TEMPLATE_CONTENT_PATH);
$ft->define(array("main" => "config_example.html"));
$ft->assign("VARIABLE", $name);
if ($image != "") {
    $ft->assign("CONFIMAGE", CONFIG_IMAGE_URL . $image);
} else {
    $ft->assign("CONFIMAGE", IMG_CONTENT_URL . "spacer.gif");
}
$ft->assign("CONFDESCRIPTION", $help_description);
$ft->assign("CONFURL", $url);
$ft->assign("CONFTEMPLATE", $template);
$ft->multiple_assign_define("CONF_");
$ft->multiple_assign_define("LANG_");
$ft->parse("mainContent", "main");
$ft->showDebugInfo(ERROR_DEBUG);
$ft->FastPrint("mainContent");
Esempio n. 16
0
<?php

// $ID$
//  Example FastTemplate demo #2: Build a linear web page. (top down)
//  Check your error_log when this is done - this demo has unresolved
//  variables defined in footer.html. (On purpose of course :)
// Header("Content-type: text/plain");  // If you want to see the
// raw html in your browser,
// uncomment this.
include "cls_fast_template.php";
$ft = new FastTemplate("./templates");
$start = $ft->utime();
// Benchmarking
$ft->define(array('header' => "header.html", 'body' => "middle.html", 'footer' => "footer.html"));
$ft->assign(array('TITLE' => "FastTemplate Demo2", 'HEAD1' => "FastTemplate Page Demo", 'TD1' => "Column 1", 'TD2' => "Column 2", 'TD3' => "Cool Stuff", 'TD4' => '<BLINK>Cooler Stuff</BLINK>', 'MAILTO' => '*****@*****.**', 'LINK' => 'www.thewebmasters.net/php/', 'LINKNAME' => 'The WebMasters Net'));
$ft->parse('HEAD', "header");
$ft->parse('BODY', "body");
$ft->parse('FOOT', "footer");
// $ft->clear(array("HEAD","BODY"));   // Uncomment this to see how
// the class handles errors
$ft->showDebugInfo(2);
$ft->FastPrint("HEAD");
$ft->FastPrint("BODY");
$ft->FastPrint("FOOT");
$end = $ft->utime();
$runtime = ($end - $start) * 1000;
echo "Completed in {$runtime} seconds<BR>\n";
exit;