本文整理汇总了PHP中TemplatePower类的典型用法代码示例。如果您正苦于以下问题:PHP TemplatePower类的具体用法?PHP TemplatePower怎么用?PHP TemplatePower使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TemplatePower类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Main
function Main()
{
global $TPLV, $bottom, $urls, $db, $migalha;
$TPLV = new TemplatePower(TEMPLATE_PATH . "modulos/categoria.tpl");
$TPLV->assignGlobal("uploadPath", UPLOAD_PATH);
$TPLV->assignGlobal("uploadPath", UPLOAD_PATH_SITE);
$TPLV->assignGlobal("imagePath", IMAGE_PATH);
$TPLV->assignGlobal("swfPath", SWF_PATH);
$TPLV->assignGlobal("localPath", LOCAL_PATH);
$TPLV->assignGlobal("localPath", LOCAL_PATH_SITE);
$TPLV->assignGlobal('navBottom', $bottom);
$TPLV->assignGlobal($urls->var);
$TPLV->prepare();
$in = $_GET['in'];
switch ($in) {
default:
case 'lista':
lista();
break;
case 'novo':
novo();
break;
case 'editar':
editar();
break;
case 'salvar':
salvar();
break;
case 'deletar':
deletar();
break;
}
}
示例2: Main
function Main()
{
global $TPLV, $urls, $usuario, $imovel;
$TPLV = new TemplatePower(TEMPLATE_PATH . "login.tpl");
$TPLV->assignGlobal("uploadPath", UPLOAD_PATH);
$TPLV->assignGlobal("imagePath", IMAGE_PATH);
$TPLV->assignGlobal("swfPath", SWF_PATH);
$TPLV->assignGlobal("localPath", LOCAL_PATH);
$TPLV->assignGlobal('navBottom', $bottom);
$TPLV->assignGlobal($urls->var);
$TPLV->prepare();
$in = $_GET['in'];
switch ($in) {
//FILTROS DE BUSCAS
default:
case 'deletaUsuario':
deletaUsuario();
break;
case 'deletaMidia':
deletaMidia();
break;
//LOGIN E RECUPERA SENHA
//LOGIN E RECUPERA SENHA
case 'getLogin':
getLogin();
break;
case 'login':
login();
break;
case 'getSenha':
getSenha();
break;
case 'recuperaSenha':
recuperaSenha();
break;
case 'isLogado':
if ($usuario->isLogado()) {
echo 'logado';
} else {
echo 'erro';
}
break;
//CADASTRO
//CADASTRO
case 'validaEmailCadastro':
validaEmailCadastro();
break;
//LEADS DETALHES
//LEADS DETALHES
case 'getCadastro':
getCadastro();
break;
case 'salvarCadastro':
salvarCadastro();
break;
case 'verificaCPF':
verificaCPF();
break;
}
}
示例3: Main
function Main()
{
global $TPLV, $bottom, $db, $migalha, $usuario;
$TPLV = new TemplatePower(TEMPLATE_PATH . "login.tpl");
$TPLV->assignGlobal("uploadPath", UPLOAD_PATH);
$TPLV->assignGlobal("imagePath", IMAGE_PATH);
$TPLV->assignGlobal("swfPath", SWF_PATH);
$TPLV->assignGlobal("localPath", LOCAL_PATH);
$TPLV->assignGlobal('navBottom', $bottom);
$TPLV->prepare();
$in = $_GET['in'];
switch ($in) {
default:
case 'restrito':
if ($usuario->isLogado()) {
inicio();
} else {
restrito();
}
break;
case 'inicio':
inicio();
break;
case 'logout':
logout();
break;
}
}
示例4: registrar
public function registrar()
{
$proteccion = new Proteccion();
$nombre = $proteccion->html($_POST['nombre']);
$apellido = $proteccion->html($_POST['apellido']);
$sexo = $proteccion->html($_POST['sexo']);
$fecha_nacimiento = $proteccion->html($_POST['fecha_nacimiento']);
$direccion = $proteccion->html($_POST['direccion']);
$email = $proteccion->html($_POST['email']);
$dni = $proteccion->html($_POST['dni']);
$pass = $proteccion->html($_POST['password']);
$persona = new Usuario($email, $pass);
$existe = $persona->existe();
if ($existe) {
$tp = new TemplatePower("templates/registro.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$tp->newblock("no_registro");
$tp->assign("usuario", $email);
$webapp = $tp->getOutputContent();
} else {
$persona->setDatosUsuario($nombre, $apellido, $sexo, $fecha_nacimiento, $direccion, $dni);
$persona->insertar();
$_SESSION['user'] = $email;
$tp = new TemplatePower("templates/index.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$tp->newBlock("sesion");
$tp->assign("usuario", $_SESSION['user']);
$webapp = $tp->getOutputContent();
}
echo $webapp;
}
示例5: savePluginFile
function savePluginFile($tplName, $fileName, $fields)
{
$pluginTpl = PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'tasks' . PATH_SEP . 'templates' . PATH_SEP . $tplName . '.tpl';
$template = new TemplatePower($pluginTpl);
$template->prepare();
if (is_array($fields)) {
foreach ($fields as $block => $data) {
$template->gotoBlock("_ROOT");
if (is_array($data)) {
foreach ($data as $rowId => $row) {
$template->newBlock($block);
foreach ($row as $key => $val) {
$template->assign($key, $val);
}
}
} else {
$template->assign($block, $data);
}
}
}
$content = $template->getOutputContent();
$iSize = file_put_contents($fileName, $content);
return $iSize;
}
示例6: _extjs
private function _extjs()
{
G::LoadClass('serverConfiguration');
$oServerConf =& serverConf::getSingleton();
$oHeadPublisher =& headPublisher::getSingleton();
if ($oHeadPublisher->extJsInit === true) {
$header = $oHeadPublisher->getExtJsVariablesScript();
$styles = $oHeadPublisher->getExtJsStylesheets($this->cssFileName);
$body = $oHeadPublisher->getExtJsScripts();
//default
$templateFile = G::ExpandPath("skinEngine") . 'base' . PATH_SEP . 'extJsInitLoad.html';
//Custom skins
if (defined('PATH_CUSTOM_SKINS') && is_dir(PATH_CUSTOM_SKINS . $this->mainSkin)) {
$templateFile = PATH_CUSTOM_SKINS . $this->mainSkin . PATH_SEP . 'extJsInitLoad.html';
}
//Skin uxs - simplified
if (!isset($_SESSION['user_experience'])) {
$_SESSION['user_experience'] = 'NORMAL';
}
if ($_SESSION['user_experience'] != 'NORMAL') {
$templateFile = is_dir(PATH_CUSTOM_SKINS . 'uxs') ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'extJsInitLoad.html' : $templateFile;
}
} else {
$styles = "";
$header = $oHeadPublisher->getExtJsStylesheets($this->cssFileName);
$header .= $oHeadPublisher->includeExtJs();
$body = $oHeadPublisher->renderExtJs();
$templateFile = $this->layoutFile['dirname'] . PATH_SEP . $this->layoutFileExtjs['basename'];
}
$template = new TemplatePower($templateFile);
$template->prepare();
$template->assign('header', $header);
$template->assign('styles', $styles);
$template->assign('bodyTemplate', $body);
$doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
$meta = null;
$dirBody = null;
if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match("/^.*\\(.*MSIE (\\d+)\\..+\\).*\$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)) {
$ie = intval($arrayMatch[1]);
$swTrident = preg_match("/^.*Trident.*\$/", $_SERVER["HTTP_USER_AGENT"]) ? 1 : 0;
//Trident only in IE8+
$sw = 1;
if (($ie == 7 && $swTrident == 1 || $ie == 8) && !preg_match("/^ux.+\$/", SYS_SKIN)) {
//IE8
$sw = 0;
}
if ($sw == 1) {
if ($ie == 10) {
$ie = 8;
}
$doctype = null;
$meta = "<meta http-equiv=\"X-UA-Compatible\" content=\"IE={$ie}\" />";
}
}
$serverConf =& serverConf::getSingleton();
if ($serverConf->isRtl(SYS_LANG)) {
$dirBody = "dir=\"RTL\"";
}
$template->assign("doctype", $doctype);
$template->assign("meta", $meta);
$template->assign("dirBody", $dirBody);
echo $template->getOutputContent();
}
示例7: unset
G::LoadClass('derivation');
/* GET , POST & $_SESSION Vars */
if (isset($_GET['POSITION'])) {
$_SESSION['STEP_POSITION'] = (int) $_GET['POSITION'];
}
if (isset($_SESSION['CASES_REFRESH'])) {
unset($_SESSION['CASES_REFRESH']);
G::evalJScript("if(typeof parent != 'undefined' && parent.refreshCountFolders) parent.refreshCountFolders();");
}
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'CASES';
$G_SUB_MENU = 'caseOptions';
$G_ID_SUB_MENU_SELECTED = '_';
/* Prepare page before to show */
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html');
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher();
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptCode('
var Cse = {};
Cse.panels = {};
var leimnud = new maborak();
leimnud.make();
leimnud.Package.Load("rpc,drag,drop,panel,app,validator,fx,dom,abbr",{Instance:leimnud,Type:"module"});
leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){
' . (isset($_SESSION['showCasesWindow']) ? 'try{' . $_SESSION['showCasesWindow'] . '}catch(e){}' : '') . '
});
');
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
示例8: session_start
<?php
session_start();
include "inc.includes.php";
$db = new BaseDatos($config['dbhost'], $config['dbuser'], $config['dbpass'], $config['db']);
$tpl = new TemplatePower("templates/index.html");
$tpl->prepare();
$tpl->gotoBlock("_ROOT");
//isset determina si una variable esta definida o es null
//$_REQUEST tiene el contenido de get y post
if (!isset($_REQUEST["action"]) || $_REQUEST["action"] == "") {
$tpl->newBlock("contenido");
$mhotels = new MHotels();
$result = $mhotels->allhoteles();
if ($result['found']) {
foreach ($result['result'] as $r) {
$tpl->newblock("hotels");
$tpl->assign("idHotel", $r['id_hotel']);
$tpl->assign("name", $r['nom_hotel']);
$tpl->assign("prov", $r['provincia']);
$tpl->assign("local", $r['localidad']);
$tpl->assign("calle", $r['calle']);
$tpl->assign("ncalle", $r['nro_calle']);
$tpl->assign("tel", $r['telefono']);
$tpl->assign("precio", $r['precio_persona']);
}
} else {
$tpl->newblock("no_hotels");
}
$webapp = $tpl->getOutputContent();
} else {
示例9: TemplatePower
<?php
//llamamos al constructor de la plantilla y la preparamos para ser mostrada
$tplCitaRealizar = new TemplatePower("plantilla/cita_realizar.html");
$tplCitaRealizar->prepare();
$citaId = addslashes($_GET['id']);
$query = "SELECT pacientes.nombre_pac, pacientes.historia, citas.fecha, citas.hora, usuarios.nombre \r\n FROM pacientes, citas\r\n LEFT JOIN usuarios\r\n ON citas.responsable=usuarios.usuario\r\n WHERE citas.id_cita='{$citaId}'\r\n AND citas.mascota=pacientes.id_pac";
$rec = mysql_query($query);
$datosCita = mysql_fetch_assoc($rec);
//si no hay datos de la cita indicada lo envio a index
if (!$datosCita) {
echo "NO EXISTEN CITAS";
exit;
header("Location: /gicorec/index.php");
exit;
}
$tplCitaRealizar->assign("nombre_mascota", $datosCita['nombre_pac']);
$tplCitaRealizar->assign("historia", $datosCita['historia']);
$tplCitaRealizar->assign("fecha", $datosCita['fecha']);
$tplCitaRealizar->assign("hora", $datosCita['hora']);
$tplCitaRealizar->assign("vet_responsable", $datosCita['nombre']);
$tplCitaRealizar->assign("id_cita", $citaId);
//imprimimos por pantalla
$tplIndex->assign("contenido", $tplCitaRealizar->getOutputContent());
示例10: Form
$aDataEvent['EVN_CONDITIONS'] = $sWS_USER;
$output = $oEvent->update($aDataEvent);
//Show link
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
print $link;
//print "\n<a href='$link' target='_new' > $link </a>";
} else {
$G_FORM = new Form($sPRO_UID . '/' . $sDYNAFORM, PATH_DYNAFORM, SYS_LANG, false);
$G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
$scriptCode = '';
$scriptCode = $G_FORM->render(PATH_CORE . 'templates/' . 'xmlform' . '.html', $scriptCode);
$scriptCode = str_replace('/controls/', $http . $_SERVER['HTTP_HOST'] . '/controls/', $scriptCode);
$scriptCode = str_replace('/js/maborak/core/images/', $http . $_SERVER['HTTP_HOST'] . '/js/maborak/core/images/', $scriptCode);
//render the template
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentry.tpl';
$template = new TemplatePower($pluginTpl);
$template->prepare();
require_once 'classes/model/Step.php';
$oStep = new Step();
$sUidGrids = $oStep->lookingforUidGrids($sPRO_UID, $sDYNAFORM);
$template->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
$template->assign("URL_TRANSLATION_ENV_JS", G::browserCacheFilesUrl("/jscore/labels/" . SYS_LANG . ".js"));
$template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]);
$template->assign("sysSys", SYS_SYS);
$template->assign("sysLang", SYS_LANG);
$template->assign("sysSkin", SYS_SKIN);
$template->assign("processUid", $sPRO_UID);
$template->assign("dynaformUid", $sDYNAFORM);
$template->assign("taskUid", $sTASKS);
$template->assign("dynFileName", $sPRO_UID . "/" . $sDYNAFORM);
$template->assign("formId", $G_FORM->id);
示例11: session_start
<?php
session_start();
include "inc/header.php";
include_once "inc/class.TemplatePower.inc.php";
$tpl = new TemplatePower("tpl/projecten.tpl");
$tpl->prepare();
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "grid_imo";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM projects WHERE enabled = 1";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while ($row = $result->fetch_assoc()) {
$tpl->newBlock("project");
$title = $row["title"];
$content = $row["summary"];
$id = $row["id"];
$tpl->assign("title", "{$title}");
$tpl->assign("content", "{$content}");
$tpl->assign("id", "{$id}");
$tpl->gotoBlock("_ROOT");
}
示例12: TemplatePower
<?php
// Hier laad ik de header.html in
$header = new TemplatePower("template/files/header.tpl");
$header->prepare();
if (!empty($_SESSION['accountid'])) {
$header->newBlock("LOGGEDIN");
$header->assign("USERNAME", $_SESSION['username']);
// if($_SESSION['roleid'] == 2){
// $header->newBlock("ADMINMENU");
// }
} else {
$header->newBlock("LOGINTOP");
}
示例13: switch
if ($_GET) {
switch ($_GET[action]) {
case "deleteall":
$MessCat = intval($_GET[messcat]);
if ($MessCat != "100") {
$sql = "`message_type` = " . $MessCat . " AND ";
}
doquery("DELETE FROM {{table}} WHERE {$sql} message_owner = " . $user[id], 'messages');
header("Location: " . $_SERVER['PHP_SELF'] . "?messcat=" . $MessCat);
exit;
break;
}
}
// ADD SMILIES ARRAY
makeSmiliesArray();
$tp = new TemplatePower($ugamela_root_path . TEMPLATE_DIR . TEMPLATE_NAME . "/messages.tpl");
$tp->prepare();
$OwnerID = $_GET['id'];
$MessCategory = isset($_GET['messcat']) ? $_GET['messcat'] : '100';
$MessPageMode = isset($_GET['mode']) ? $_GET['mode'] : 'show';
$UsrMess = doquery("SELECT SQL_CACHE * FROM {{table}} WHERE `message_owner` = " . $user['id'] . " ORDER BY `message_time` DESC;", 'messages');
$UnRead = $user;
$MessageType = array(100, 0, 1, 2, 3, 4, 5, 15, 99);
$TitleColor = array(0 => '#FFFF00', 1 => '#FFFF00', 2 => '#FFFF00', 3 => '#FFFF00', 4 => '#FFFF00', 5 => '#FFFF00', 15 => '#FFFF00', 99 => '#FFFF00', 100 => '#FFFF00');
$BackGndColor = array(0 => '#663366', 1 => '#663366', 2 => '#663366', 3 => '#663366', 4 => '#663366', 5 => '#663366', 15 => '#663366', 99 => '#663366', 100 => '#663366');
for ($MessType = 0; $MessType < 101; $MessType++) {
if (in_array($MessType, $MessageType)) {
$WaitingMess[$MessType] = $UnRead[$messfields[$MessType]];
$TotalMess[$MessType] = 0;
}
}
示例14: TemplatePower
<?php
$tpl = new TemplatePower('template/eventos/consultaEventos.tpl');
$tpl->prepare();
foreach ($_POST as $nombre_campo => $valor) {
$asignacion = '$' . $nombre_campo . '=\'' . $valor . '\';';
if (!is_numeric($nombre_campo)) {
eval($asignacion);
}
}
$eventos = new Eventos($conn);
$lista_eventos = $eventos->listaEventos();
foreach ($lista_eventos as $evento) {
$tpl->newBlock("eventos");
$tpl->assign("nombre", $evento['nombre']);
$tpl->assign("f_inicio", $evento['f_inicio']);
$tpl->assign("f_fin", $evento['f_fin']);
$tpl->assign("logotipo", $evento['logotipo']);
$tpl->assign("descripcion", $evento['descripcion']);
$tpl->assign("id", $evento['id']);
$tpl->gotoBlock("_ROOT");
}
//$tpl->assign('anterior', $anterior);
//$tpl->assign('siguiente', $siguiente);
$tpl->printToScreen();
?>
示例15: session_start
<?php
session_start();
include "inc/header.php";
include_once "inc/class.TemplatePower.inc.php";
$tpl = new TemplatePower("tpl/index.tpl");
$tpl->prepare();
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "grid_imo";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM news";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while ($row = $result->fetch_assoc()) {
$tpl->newBlock("News");
$title = $row["title"];
$news_content = $row["text"];
$tpl->assign("news_title", "{$title}");
$tpl->assign("news_content", "{$news_content}");
$tpl->gotoBlock("_ROOT");
}
} else {
$tpl->newBlock("News");