本文整理汇总了PHP中TemplatePower::getOutputContent方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplatePower::getOutputContent方法的具体用法?PHP TemplatePower::getOutputContent怎么用?PHP TemplatePower::getOutputContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplatePower
的用法示例。
在下文中一共展示了TemplatePower::getOutputContent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: consultarReserva
public function consultarReserva()
{
$proteccion = new Proteccion();
$cod_reserva = $proteccion->html($_POST['cod_reserva']);
$reserva = new Reserva();
$result = $reserva->BuscarReserva($cod_reserva);
foreach ($result['result'] as $r) {
$cod_reserva = $r['cod_reserva'];
}
$nom_hotel = $r['nom_hotel'];
$nombre = $r['nombre'];
$apellido = $r['apellido'];
$email = $r['email'];
$fec_llegada = $r['fec_llegada'];
$fec_salida = $r['fec_salida'];
$fec_reserva = $r['fec_reserva'];
$piso = $r['piso'];
$ubicacion = $r['ubicacion'];
$tp = new TemplatePower("templates/reserva.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$tp->newBlock("generarreserva");
$tp->assign("cod_reserva", $cod_reserva);
$tp->assign("nom_hotel", $nom_hotel);
$tp->assign("nombre", $nombre);
$tp->assign("apellido", $apellido);
$tp->assign("email", $email);
$tp->assign("fec_llegada", $fec_llegada);
$tp->assign("fec_salida", $fec_salida);
$tp->assign("fec_reserva", $fec_reserva);
$tp->assign("piso", $piso);
$tp->assign("ubicacion", $ubicacion);
echo $tp->getOutputContent();
}
示例3: makePlanetTooltip
function makePlanetTooltip($options, $actions, $actionName = 'missiontype')
{
global $lang;
if (!$options or !is_array($options)) {
return false;
}
$tp = new TemplatePower(PATH . TEMPLATE_DIR . TEMPLATE_NAME . "/planet_actions.tpl");
$tp->prepare();
switch ($options[type]) {
case "planet":
$tp->newBlock("planet");
break;
case "moon":
$tp->newBlock("moon");
break;
case "debris":
$tp->newBlock("debris");
break;
case "ally":
$tp->newBlock("ally");
break;
default:
return false;
break;
}
$actionName = $lang[$actionName];
foreach ($options as $k => $v) {
$tp->assign($k, $v);
}
if ($actions and is_array($actions)) {
foreach ($actions[id] as $k => $actionId) {
//echo $actionId . "<-- <br>";
$tp->newBlock($options[type] . "_actions");
$tp->assign("action_name", $actionName[$actionId]);
$tp->assign("action_link", $actions[alink][$k]);
}
}
$tool = $tp->getOutputContent();
$find = array('"', "'", "\n", "\r");
$rep = array('\\"', "\\'", "", "");
$tool = str_replace($find, $rep, $tool);
return $tool;
}
示例4: hotel
function hotel($idHotel)
{
$mhotels = new MHotels();
$result = $mhotels->buscar_id($idHotel);
foreach ($result['result'] as $r) {
$nombreHotel = $r['nom_hotel'];
$prov = $r['provincia'];
$local = $r['localidad'];
$calle = $r['calle'];
$ncalle = $r['nro_calle'];
$tel = $r['telefono'];
$precio = $r['precio_persona'];
$cant_imagenes = $r['cant_imagenes'];
$descripcion = $r['descripcion'];
}
$tp = new TemplatePower("templates/hotel.html");
$tp->prepare();
$tp->gotoBlock("_ROOT");
$tp->assign("nombre", $nombreHotel);
for ($i = 1; $i <= $cant_imagenes; $i++) {
$tp->newBlock("imagenes");
$tp->assign("nombre", $nombreHotel);
$tp->assign("numero", $i);
}
$tp->gotoBlock("_ROOT");
$tp->assign("descripcion", $descripcion);
$tp->assign("prov", $prov);
$tp->assign("local", $local);
$tp->assign("calle", $calle);
$tp->assign("ncalle", $ncalle);
$tp->assign("tel", $tel);
$tp->assign("precio", $precio);
if (isset($_SESSION['user'])) {
$tp->newBlock("reservar");
$tp->assign("idHotel", $idHotel);
}
if (!isset($_SESSION['user'])) {
$tp->newBlock("iniciarSesion");
}
echo $tp->getOutputContent();
}
示例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: foreach
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 {
if (!strpos($_REQUEST["action"], "::")) {
$_REQUEST["action"] .= "::main";
}
$array = explode('::', $_REQUEST["action"]);
$tam = count($array);
if ($tam == 2) {
list($classParam, $method) = $array;
}
if ($tam == 3) {
list($classParam, $method, $param1) = $array;
}
if ($tam == 4) {
list($classParam, $method, $param1, $param2) = $array;
}
示例7: Step
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);
$template->assign("scriptCode", $scriptCode);
if (sizeof($sUidGrids) > 0) {
foreach ($sUidGrids as $k => $v) {
$template->newBlock('grid_uids');
$template->assign('siteUrl', $http . $_SERVER['HTTP_HOST']);
$template->assign('gridFileName', $sPRO_UID . '/' . $v);
}
}
print_r('<textarea cols="77" rows="26" style="width:100%; height:99%">' . htmlentities(str_replace('</body>', '</form></body>', str_replace('</form>', '', $template->getOutputContent()))) . '</textarea>');
G::auditLog('WebEntry', 'Generate web entry with single HTML (dynaform uid: ' . $sDYNAFORM . ') in process "' . $resultProcess['PRO_TITLE'] . '"');
}
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
G::RenderPage('publish', 'raw');
}
示例8: update
function update($aData)
{
$oConnection = Propel::getConnection(EventPeer::DATABASE_NAME);
try {
$oEvent = EventPeer::retrieveByPK($aData['EVN_UID']);
if (!is_null($oEvent)) {
//$oEvent->setProUid( $aData['PRO_UID'] );
if (isset($aData['EVN_RELATED_TO'])) {
$oEvent->setEvnRelatedTo($aData['EVN_RELATED_TO']);
if ($aData['EVN_RELATED_TO'] == 'SINGLE') {
if (isset($aData['TAS_UID']) && $aData['TAS_UID'] != '') {
$oEvent->setTasUid($aData['TAS_UID']);
}
$oEvent->setEvnTasUidTo('');
$oEvent->setEvnTasUidFrom('');
} else {
$oEvent->setTasUid('');
if (isset($aData['EVN_TAS_UID_TO'])) {
$oEvent->setEvnTasUidTo($aData['EVN_TAS_UID_TO']);
}
if (isset($aData['EVN_TAS_UID_FROM'])) {
$oEvent->setEvnTasUidFrom($aData['EVN_TAS_UID_FROM']);
}
}
}
if (isset($aData['EVN_POSX'])) {
$oEvent->setEvnPosx($aData['EVN_POSX']);
}
if (isset($aData['EVN_POSY'])) {
$oEvent->setEvnPosy($aData['EVN_POSY']);
}
if (isset($aData['EVN_TAS_ESTIMATED_DURATION'])) {
$oEvent->setEvnTasEstimatedDuration($aData['EVN_TAS_ESTIMATED_DURATION']);
}
if (isset($aData['EVN_WHEN_OCCURS'])) {
$oEvent->setEvnWhenOccurs($aData['EVN_WHEN_OCCURS']);
}
if (isset($aData['EVN_STATUS'])) {
$oEvent->setEvnStatus($aData['EVN_STATUS']);
}
if (isset($aData['EVN_WHEN'])) {
$oEvent->setEvnWhen($aData['EVN_WHEN']);
}
if (isset($aData['TRI_UID'])) {
$oEvent->setTriUid($aData['TRI_UID']);
}
if (isset($aData['EVN_TYPE'])) {
$oEvent->setEvnType($aData['EVN_TYPE']);
}
if (isset($aData['EVN_CONDITIONS'])) {
$oEvent->setEvnConditions($aData['EVN_CONDITIONS']);
}
if (isset($aData['EVN_ACTION'])) {
$oEvent->setEvnAction($aData['EVN_ACTION']);
}
//if ( isset ($aData['ENV_MAX_ATTEMPTS'] )) $oEvent->setEvnMaxAttempts( 3 );
if (isset($aData['EVN_ACTION_PARAMETERS']) && $aData['EVN_ACTION_PARAMETERS'] != 0) {
$oTP = new TemplatePower(PATH_TPL . 'events' . PATH_SEP . 'sendMessage.tpl');
$oTP->prepare();
$oTP->assign('from', 'info@processmaker.com');
$oTP->assign('subject', addslashes($aData['EVN_ACTION_PARAMETERS']['SUBJECT']));
$oTP->assign('template', $aData['EVN_ACTION_PARAMETERS']['TEMPLATE']);
$oTP->assign('timestamp', date("l jS \\of F Y h:i:s A"));
$recipientTO = implode(',', $aData['EVN_ACTION_PARAMETERS']['TO']);
$recipientCC = implode(',', $aData['EVN_ACTION_PARAMETERS']['CC']);
$recipientBCC = implode(',', $aData['EVN_ACTION_PARAMETERS']['BCC']);
$oTP->assign('TO', addslashes($recipientTO));
$oTP->assign('CC', addslashes($recipientCC));
$oTP->assign('BCC', addslashes($recipientBCC));
$sTrigger = $oTP->getOutputContent();
$oTrigger = new Triggers();
$aTrigger = $oTrigger->load($oEvent->getTriUid());
$aTrigger['TRI_WEBBOT'] = $sTrigger;
$oTrigger->update($aTrigger);
$oParameters = new StdClass();
$oParameters->hash = md5($sTrigger);
$oParameters->SUBJECT = $aData['EVN_ACTION_PARAMETERS']['SUBJECT'];
$oParameters->TO = $aData['EVN_ACTION_PARAMETERS']['TO'];
$oParameters->CC = $aData['EVN_ACTION_PARAMETERS']['CC'];
$oParameters->BCC = $aData['EVN_ACTION_PARAMETERS']['BCC'];
$oParameters->TEMPLATE = $aData['EVN_ACTION_PARAMETERS']['TEMPLATE'];
//$oParameters->TRI_UID = $sTrigger->getTriUid();
$oEvent->setEvnActionParameters(serialize($oParameters));
}
if ($oEvent->validate()) {
//start the transaction
$oConnection->begin();
if (array_key_exists('EVN_DESCRIPTION', $aData)) {
$oEvent->setEvnDescription($aData['EVN_DESCRIPTION']);
}
$iResult = $oEvent->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oEvent->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw new Exception('The registry cannot be updated!<br />' . $sMessage);
//.........这里部分代码省略.........
示例9: foreach
// ACTIONS
$actions = _TooltipActions($planetsrow[$i], $g, $s, $i, 0);
$tp->assign("actions", $actions);
} else {
// ADD BLANK TDS ?
}
}
$replace[fleet_count] = $MaxFleetCount;
$replace[fleet_max] = $FleetMax;
$replace[Recyclers] = pretty_number($CurrentRC);
$replace[SpyProbes] = pretty_number($CurrentSP);
$replace[CurrentMIP] = pretty_number($CurrentMIP);
$replace[this_galaxy] = $planetrow['galaxy'];
$replace[this_system] = $planetrow['system'];
$replace[this_planet] = $planetrow['planet'];
$replace[this_planet_type] = $planetrow['planet_type'];
$replace[PHP_SELF] = $_SERVER['PHP_SELF'];
$tp->gotoBlock("_ROOT");
if (is_array($replace)) {
foreach ($replace as $k => $v) {
$tp->assign($k, $v);
}
}
// GLOBAL VARIABLES
$lang[dpath] = $dpath;
foreach ($lang as $name => $trans) {
$tp->assignGlobal($name, $trans);
}
$galaxy = $tp->getOutputContent();
display($galaxy, 'Galaxy', false);
}
示例10: while
//para el caso de que queramos añadir una mascota desde el perfil de un propietario
if ($_GET['dni']) {
$tplPacientes->assign('dni', $_GET['dni']);
} else {
$tplPacientes->assign('disp_class', 'hidden');
}
//creamos el bloque que nos mostrará la lista de todos los pacientes ordenados por especie y mostramos
$tplPacientes->newBlock('lista');
$query = 'SELECT *
FROM pacientes
ORDER BY especie';
$result = mysql_query($query);
if (mysql_error()) {
echo mysql_error();
} else {
while ($row = mysql_fetch_assoc($result)) {
$tplPacientes->newBlock('fila');
$tplPacientes->assign('historia', $row['historia']);
$tplPacientes->assign('nombre', $row['nombre_pac']);
$tplPacientes->assign('especie', $row['especie']);
$tplPacientes->assign('edad', $row['edad']);
$tplPacientes->assign('sexo', $row['sexo']);
$tplPacientes->assign('raza', $row['raza']);
$tplPacientes->assign('dni_propietario', $row['dni_propietario']);
$tplPacientes->assign('remitente', $row['remitente']);
$tplPacientes->assign('id_pac', $row['id_pac']);
}
}
}
$tplIndex->assign("contenido", $tplPacientes->getOutputContent());
示例11: setWeData
/**
* Set value in WE_DATA
*
* @param string $webEntryUid Unique id of Web Entry
*
* return void
*/
public function setWeData($webEntryUid)
{
try {
//Verify data
$this->throwExceptionIfNotExistsWebEntry($webEntryUid, $this->arrayFieldNameForException["webEntryUid"]);
//Set variables
$arrayWebEntryData = $this->getWebEntry($webEntryUid, true);
$processUid = $arrayWebEntryData["PRO_UID"];
$taskUid = $arrayWebEntryData["TAS_UID"];
$dynaFormUid = $arrayWebEntryData["DYN_UID"];
$webEntryMethod = $arrayWebEntryData["WE_METHOD"];
$webEntryInputDocumentAccess = $arrayWebEntryData["WE_INPUT_DOCUMENT_ACCESS"];
$webEntryData = "";
$wsRoundRobin = 0;
//0, 1 //0 - Cyclical Assignment
$pathDataPublicProcess = PATH_DATA_PUBLIC . $processUid;
//Delete previous files
if (trim($arrayWebEntryData["WE_DATA"]) != "") {
$fileName = str_replace(".php", "", trim($arrayWebEntryData["WE_DATA"]));
$file = $pathDataPublicProcess . PATH_SEP . $fileName . ".php";
if (is_file($file) && file_exists($file)) {
unlink($file);
unlink($pathDataPublicProcess . PATH_SEP . $fileName . "Post.php");
}
}
//Create files
\G::mk_dir($pathDataPublicProcess, 0777);
$http = \G::is_https() ? "https://" : "http://";
switch ($webEntryMethod) {
case "WS":
require_once PATH_RBAC . "model" . PATH_SEP . "RbacUsers.php";
$user = new \RbacUsers();
$arrayUserData = $user->load($arrayWebEntryData["USR_UID"]);
$usrUsername = $arrayUserData["USR_USERNAME"];
$usrPassword = $arrayUserData["USR_PASSWORD"];
$dynaForm = new \Dynaform();
$arrayDynaFormData = $dynaForm->Load($arrayWebEntryData["DYN_UID"]);
//Creating sys.info;
$sitePublicPath = "";
if (file_exists($sitePublicPath . "")) {
}
//Creating the first file
$weTitle = $this->sanitizeFilename($arrayWebEntryData["WE_TITLE"]);
$fileName = $weTitle;
$fileContent = "<?php\n";
$fileContent .= "global \$_DBArray;\n";
$fileContent .= "if (!isset(\$_DBArray)) {\n";
$fileContent .= " \$_DBArray = array();\n";
$fileContent .= "}\n";
$fileContent .= "\$_SESSION[\"PROCESS\"] = \"" . $processUid . "\";\n";
$fileContent .= "\$_SESSION[\"CURRENT_DYN_UID\"] = \"" . $dynaFormUid . "\";\n";
$fileContent .= "\$G_PUBLISH = new Publisher();\n";
$fileContent .= "G::LoadClass(\"pmDynaform\");\n";
$fileContent .= "\$a = new pmDynaform(array(\"CURRENT_DYNAFORM\" => \"" . $arrayWebEntryData["DYN_UID"] . "\"));\n";
$fileContent .= "if (\$a->isResponsive()) {";
$fileContent .= " \$a->printWebEntry(\"" . $fileName . "Post.php\");";
$fileContent .= "} else {";
$fileContent .= " \$G_PUBLISH->AddContent(\"dynaform\", \"xmlform\", \"" . $processUid . PATH_SEP . $dynaFormUid . "\", \"\", array(), \"" . $fileName . "Post.php\");\n";
$fileContent .= " G::RenderPage(\"publish\", \"blank\");";
$fileContent .= "}";
file_put_contents($pathDataPublicProcess . PATH_SEP . $fileName . ".php", $fileContent);
//Creating the second file, the post file who receive the post form.
$pluginTpl = PATH_TPL . "processes" . PATH_SEP . "webentryPost.tpl";
$template = new \TemplatePower($pluginTpl);
$template->prepare();
$template->assign("wsdlUrl", $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/services/wsdl2");
$template->assign("wsUploadUrl", $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/services/upload");
$template->assign("processUid", $processUid);
$template->assign("dynaformUid", $dynaFormUid);
$template->assign("taskUid", $taskUid);
$template->assign("wsUser", $usrUsername);
$template->assign("wsPass", \Bootstrap::getPasswordHashType() . ':' . $usrPassword);
$template->assign("wsRoundRobin", $wsRoundRobin);
if ($webEntryInputDocumentAccess == 0) {
//Restricted to process permissions
$template->assign("USR_VAR", "\$cInfo = ws_getCaseInfo(\$caseId);\n\t \$USR_UID = \$cInfo->currentUsers->userId;");
} else {
//No Restriction
$template->assign("USR_VAR", "\$USR_UID = -1;");
}
$template->assign("dynaform", $arrayDynaFormData["DYN_TITLE"]);
$template->assign("timestamp", date("l jS \\of F Y h:i:s A"));
$template->assign("ws", SYS_SYS);
$template->assign("version", \System::getVersion());
$fileName = $pathDataPublicProcess . PATH_SEP . $weTitle . "Post.php";
file_put_contents($fileName, $template->getOutputContent());
//Creating the third file, only if this wsClient.php file doesn't exist.
$fileName = $pathDataPublicProcess . PATH_SEP . "wsClient.php";
$pluginTpl = PATH_CORE . "templates" . PATH_SEP . "processes" . PATH_SEP . "wsClient.php";
if (file_exists($fileName)) {
if (filesize($fileName) != filesize($pluginTpl)) {
copy($fileName, $pathDataPublicProcess . PATH_SEP . "wsClient.php.bak");
unlink($fileName);
//.........这里部分代码省略.........
示例12: generateJrxmlFromDynaform
/**
* generateJrxmlFromDynaform
*
* @param string $outDocUid
* @param string $dynaformUid
* @param object $template
* @return void
*/
function generateJrxmlFromDynaform($outDocUid, $dynaformUid, $template)
{
require_once 'classes/model/Dynaform.php';
$dyn = new Dynaform();
$aFields = $dyn->load($dynaformUid);
$xmlFields = $dyn->getDynaformFields($dynaformUid);
$reportTpl = PATH_TPL . 'javaBridgePM/classic.xml';
$reportFilename = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $outDocUid . '.jrxml';
foreach ($xmlFields as $key => $val) {
if ($val->type == 'submit' || $val->type == 'button' || $val->type == 'title' || $val->type == 'subtitle') {
unset($xmlFields[$key]);
}
}
//$sqlSentence = 'SELECT * from ' . $tableName;
$sqlSentence = 'dynaform/';
$template = new TemplatePower($reportTpl);
$template->prepare();
$template->assign('sqlSentence', $sqlSentence);
$template->assign('tableName', $aFields['DYN_TITLE']);
$template->assign('heightDetail', count($xmlFields) * 15 + 20);
$template->assign('PAGE_NUMBER', '{PAGE_NUMBER}');
$logoReporte = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/images/processmaker.logo.jpg';
$template->assign('logoReporte', $logoReporte);
foreach ($xmlFields as $key => $val) {
$template->newBlock('fields');
$template->assign('fieldName', $key);
}
$posX = 140;
$posLabelX = 5;
$posY = 10;
foreach ($xmlFields as $key => $val) {
$template->newBlock('detailFields');
$template->assign('fieldName', '{' . $key . '}');
$template->assign('fieldLabel', $key);
$template->assign('labelPosX', $posLabelX);
$template->assign('fieldPosX', $posX);
$template->assign('fieldPosY', $posY);
$posY += 15;
}
$content = $template->getOutputContent();
$iSize = file_put_contents($reportFilename, $content);
printf("saved %s bytes in file %s \n", $iSize, $reportFilename);
}
示例13: formataEmail
/**
* Formata a news padrão da linklar
* @params string $titulo
* @params string $texto
* @returns html formatada.
*/
public function formataEmail($titulo, $texto)
{
global $geral;
$MAIL = new TemplatePower(TEMPLATE_PATH . "includes/mail.tpl");
$MAIL->assignGlobal("uploadPath", UPLOAD_PATH);
$MAIL->assignGlobal("imagePath", IMAGE_PATH);
$MAIL->prepare();
$MAIL->newBlock('mail');
$MAIL->assign('titulo', $titulo);
$MAIL->assign('texto', $texto);
return $MAIL->getOutputContent();
}
示例14: sendTestMail
/**
* Send a test email
*
* @param array $arrayData Data
*
* return array Return array with result of send test mail
*/
public function sendTestMail(array $arrayData)
{
try {
\G::LoadClass("system");
\G::LoadClass("spool");
$aConfiguration = array("MESS_ENGINE" => $arrayData["MESS_ENGINE"], "MESS_SERVER" => $arrayData["MESS_SERVER"], "MESS_PORT" => (int) $arrayData["MESS_PORT"], "MESS_ACCOUNT" => $arrayData["MESS_ACCOUNT"], "MESS_PASSWORD" => $arrayData["MESS_PASSWORD"], "MESS_FROM_NAME" => $arrayData["FROM_NAME"], "MESS_FROM_MAIL" => $arrayData["FROM_EMAIL"], "MESS_RAUTH" => (int) $arrayData["MESS_RAUTH"], "SMTPSecure" => isset($arrayData["SMTPSecure"]) ? $arrayData["SMTPSecure"] : "none");
$sFrom = \G::buildFrom($aConfiguration);
$sSubject = \G::LoadTranslation("ID_MESS_TEST_SUBJECT");
$msg = \G::LoadTranslation("ID_MESS_TEST_BODY");
switch ($arrayData["MESS_ENGINE"]) {
case "MAIL":
$engine = \G::LoadTranslation("ID_MESS_ENGINE_TYPE_1");
break;
case "PHPMAILER":
$engine = \G::LoadTranslation("ID_MESS_ENGINE_TYPE_2");
break;
case "OPENMAIL":
$engine = \G::LoadTranslation("ID_MESS_ENGINE_TYPE_3");
break;
}
$sBodyPre = new \TemplatePower(PATH_TPL . "admin" . PATH_SEP . "email.tpl");
$sBodyPre->prepare();
$sBodyPre->assign("server", $_SERVER["SERVER_NAME"]);
$sBodyPre->assign("date", date("H:i:s"));
$sBodyPre->assign("ver", \System::getVersion());
$sBodyPre->assign("engine", $engine);
$sBodyPre->assign("msg", $msg);
$sBody = $sBodyPre->getOutputContent();
$oSpool = new \spoolRun();
$oSpool->setConfig($aConfiguration);
$oSpool->create(array("msg_uid" => "", "app_uid" => "", "del_index" => 0, "app_msg_type" => "TEST", "app_msg_subject" => $sSubject, "app_msg_from" => $sFrom, "app_msg_to" => $arrayData["TO"], "app_msg_body" => $sBody, "app_msg_cc" => "", "app_msg_bcc" => "", "app_msg_attach" => "", "app_msg_template" => "", "app_msg_status" => "pending", "app_msg_attach" => ""));
$oSpool->sendMail();
//Return
$arrayTestMailResult = array();
if ($oSpool->status == "sent") {
$arrayTestMailResult["status"] = true;
$arrayTestMailResult["success"] = true;
$arrayTestMailResult["msg"] = \G::LoadTranslation("ID_MAIL_TEST_SUCCESS");
} else {
$arrayTestMailResult["status"] = false;
$arrayTestMailResult["success"] = false;
$arrayTestMailResult["msg"] = $oSpool->error;
}
return $arrayTestMailResult;
} catch (\Exception $e) {
throw $e;
}
}
示例15: _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);
// verify is RTL
$oServerConf =& serverConf::getSingleton();
if ($oServerConf->isRtl(SYS_LANG)) {
$template->assign('dirBody', 'dir="RTL"');
}
// end verify
// verify is IE
$doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
$meta = '';
$iexplores = array('IE=10' => '(MSIE 10\\.[0-9]+)', 'IE=9' => '(MSIE 9\\.[0-9]+)', 'IE=8' => '(MSIE 8\\.[0-9]+)', 'IE=7' => '(MSIE 7\\.[0-9]+)', 'IE=6' => '(MSIE 6\\.[0-9]+)');
foreach ($iexplores as $browser => $pattern) {
if (preg_match('/' . $pattern . '/', $_SERVER['HTTP_USER_AGENT'])) {
$doctype = '';
$meta = '<meta http-equiv="X-UA-Compatible" content="' . $browser . '"/>';
}
}
// end verify
$template->assign('meta', $meta);
$template->assign('doctype', $doctype);
echo $template->getOutputContent();
}