function send_confirmation($user_name, $email) { // Create a new template, and specify that the template files are // in the same directory as the as the php files. $template = new HTML_Template_IT("./templates"); // Load the email template file $template->loadTemplatefile("confirmemail.tpl", true, true); $template->setVariable("USERNAME", $user_name); $template->setVariable("EMAIL", $email); $to = $email; // Setup the headers. $headers["From"] = "*****@*****.**"; $headers["Subject"] = "Fitness Log Confirmation Email"; $headers["X-Sender"] = "*****@*****.**"; $headers["X-Mailer"] = "PHP"; $headers["Return-Path"] = "*****@*****.**"; $headers["To"] = $email; $body = $template->get(); $host = "mail.vanhlebarsoftware.com"; $mail_user = "******"; $password = "******"; $smtp = Mail::factory('smtp', array('host' => $host, 'auth' => true, 'username' => $mail_user, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo "<p>" . $mail->getMessage() . "</p>"; } }
function parseFooter() { global $_PATHS; $objTpl = new HTML_Template_IT($_PATHS['templates']); $objTpl->loadTemplatefile("footer.tpl.htm", false, false); return $objTpl->get(); }
/** * This function creates a HTML-block for a menu item. * * @access public * @author k * @param MenuElement $parameters['menuElement'] * the menu element * @param string $parameters['type'] * the type * @see MenuElement::$type * @uses Error for error handling * @uses ErrorView for error handling * @uses MENU_COMMON for the common menu * @uses MENU_SIDE for the menu in sidebar */ public static function buildMenuElement($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'html'); $tpl->loadTemplatefile('particle-template.html'); switch ($parameters['type']) { case MENU_COMMON: $tpl->setCurrentBlock('item-in-common-menu'); $tpl->setVariable(array('HREF-OF-ITEM-IN-COMMON-MENU' => null === $parameters['menuElement']->getHref() ? $parameters['menuElement']->translate(array('property' => 'href', 'isSlug' => true)) : $parameters['menuElement']->getHref(), 'LABEL-OF-ITEM-IN-COMMON-MENU' => $parameters['menuElement']->translate(array('property' => 'label')))); $tpl->parse('item-in-common-menu'); // echo ' 38: ', $tpl->get('menu-item'); return $tpl->get('item-in-common-menu'); break; case MENU_SIDE: $tpl->setCurrentBlock('item-in-menu-in-sidebar'); $tpl->setVariable(array('HREF-OF-ITEM-IN-MENU-IN-SIDEBAR' => null === $parameters['menuElement']->getHref() ? $parameters['menuElement']->translate(array('property' => 'href', 'isSlug' => true)) : $parameters['menuElement']->getHref(), 'LABEL-OF-ITEM-IN-MENU-IN-SIDEBAR' => $parameters['menuElement']->translate(array('property' => 'label')))); $tpl->parse('item-in-menu-in-sidebar'); return $tpl->get('item-in-menu-in-sidebar'); break; default: require_once dirname(__FILE__) . '/Error.php'; $error = new Error(); $error->setMessage(\pstk\String::translate('errorWhichMenu')); require_once dirname(__FILE__) . '/ErrorView.php'; ErrorView::raiseError($error); } }
function buildPersonView($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT(dirname(__FILE__) . '/'); $tpl->loadTemplatefile('persons.html'); $tpl->parse('persons'); return $tpl->get('persons'); }
function executeUpdateScript(HTML_Template_IT &$objTpl) { if (!verifyVersion($GLOBALS["_CONF"]["app"]["version"])) { $objTpl->setCurrentBlock("update"); $objTpl->setVariable("VERSION", $GLOBALS["_CONF"]["app"]["version"]); $objTpl->parseCurrentBlock(); } }
/** * This function builds the header. * * @access public * @author kalmer * @return string */ public static function buildHeader() { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT(dirname(__FILE__) . '/../html'); $tpl->loadTemplatefile('header.html'); $tpl->touchBlock('header'); $tpl->parse('header'); return $tpl->get('header'); }
function GetLoggedOutPage() { $tpl = new HTML_Template_IT("./"); $tpl->loadTemplatefile("loggedout.tpl.html", true, true); SetCommonLoginStatus($tpl); SetCommonToolbar($tpl); SetCommonFooter($tpl); // return the output return $tpl->get(); }
function GetLoginFailedPage() { $tpl = new HTML_Template_IT("./"); $tpl->loadTemplatefile("loginfailed.tpl.html", true, false); SetCommonLoginStatus($tpl); SetCommonToolbar($tpl); SetCommonFooter($tpl); // print the output return $tpl->get(); }
function GetNotAPowerUserPage() { $tpl = new HTML_Template_IT("./"); $tpl->loadTemplatefile("not_a_power_user.tpl.html", true, false); SetCommonLoginStatus($tpl); SetAdminToolbar($tpl); SetCommonFooter($tpl); // print the output return $tpl->get(); }
function GetNotAllowedPage($reason) { $tpl = new HTML_Template_IT("./"); $tpl->loadTemplatefile("not_allowed.tpl.html", true, false); SetCommonLoginStatus($tpl); SetAdminToolbar($tpl); SetCommonFooter($tpl); $tpl->SetVariable("REASON", $reason); // print the output return $tpl->get(); }
function GetLoginSuccessfulPage($originPage) { $tpl = new HTML_Template_IT("./"); $tpl->loadTemplatefile("loginsuccessful.tpl.html", true, true); SetCommonLoginStatus($tpl); SetCommonToolbar($tpl); SetCommonFooter($tpl); $tpl->setVariable("USERNAME", GetLoggedUserName()); $tpl->setVariable("ORIGIN_PAGE", $originPage); // print the output return $tpl->get(); }
function GetNoAccessToProjectPage($projectId) { $tpl = new HTML_Template_IT("./"); $tpl->loadTemplatefile("no_access_to_project.tpl.html", true, false); SetCommonLoginStatus($tpl); SetAdminToolbar($tpl); SetCommonFooter($tpl); $projectInfos = GetProjectInfos($projectId); $tpl->setVariable("PROJECT_NAME", $projectInfos["Name"]); // print the output return $tpl->get(); }
function GetAskLoginPage() { global $lastLoginResult; $tpl = new HTML_Template_IT("./"); $tpl->loadTemplatefile("ask_login.tpl.html", true, true); $msg = ""; if ($lastLoginResult != LLR_NOT_LOGGED_IN) { $msg = LastLoginResultMessage(); } $tpl->setVariable("MESSAGE", $msg); // print the output return $tpl->get(); }
function showLoginForm($liveUserObj = false) { include_once 'HTML/Template/IT.php'; $tpl = new HTML_Template_IT(); $tpl->loadTemplatefile('loginform.tpl.php'); $tpl->setVariable('form_action', $_SERVER['PHP_SELF']); if (is_object($liveUserObj)) { if ($liveUserObj->status) { switch ($liveUserObj->status) { case LIVEUSER_STATUS_ISINACTIVE: $tpl->touchBlock('inactive'); break; case LIVEUSER_STATUS_IDLED: $tpl->touchBlock('idled'); break; case LIVEUSER_STATUS_EXPIRED: $tpl->touchBlock('expired'); break; default: $tpl->touchBlock('failure'); break; } } } $tpl->show(); exit; }
function showLoginForm(&$liveUserObj) { $tpl = new HTML_Template_IT(); $tpl->loadTemplatefile('loginform.tpl.php'); $tpl->setVariable('form_action', $_SERVER['SCRIPT_NAME']); if (is_object($liveUserObj)) { if ($liveUserObj->getStatus()) { switch ($liveUserObj->getStatus()) { case LIVEUSER_STATUS_ISINACTIVE: $tpl->touchBlock('inactive'); break; case LIVEUSER_STATUS_IDLED: $tpl->touchBlock('idled'); break; case LIVEUSER_STATUS_EXPIRED: $tpl->touchBlock('expired'); break; default: $tpl->touchBlock('failure'); break; } } } $tpl->show(); exit; }
/** * Ehitab ülesse lehe vaate * @param boolean $parameters['build_result'] Kas näitame tulemust? * @param string $parameters['result'] tulemuse text * @param Owner $parameters['owner'] omanik */ public static function buildFormOfValjatostmine($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT(dirname(__FILE__)); $tpl->loadTemplatefile('index.html'); if ($parameters['build_result']) { $tpl->setCurrentBlock('result'); $tpl->setVariable(array('RESULT' => $parameters['result'])); $tpl->parse('result'); } $tpl->setCurrentBlock('form'); $tpl->setVariable(array('ISOWNERBRESENTCHECKT' => $parameters['owner']->getIsPresent() ? ' checked="checked"' : '', 'ISOWNERAGREETCHECKT' => $parameters['owner']->getAgrees() ? 'checked="checked"' : '', 'ISOWNERREACHABLECHECKT' => $parameters['owner']->getIsReachable() ? 'checked="checked"' : '')); $tpl->parse('form'); $tpl->parse('page'); return $tpl->get('page'); }
/** * This function builds the list of shipping * * @access public * @param mixed $parameters['shipTos'] * the list of shipping according to the result of * <code>getListOfType</code>...-method * @return the parsed HTML-file */ public static function buildListOfShipTos($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT("./html"); $tpl->loadTemplatefile('ship-tos.html'); foreach ($parameters['shipTos'] as $idShipTo => $shipTo) { $tpl->setCurrentBlock('ships-to'); $tpl->setVariable(array('NAME' => $shipTo['title'])); $tpl->setVariable(array('ADDRESS' => $shipTo['title2'])); $tpl->parse('ships-to'); } $tpl->setCurrentBlock('html'); $tpl->setVariable(array('TITLE' => 'Toote saatmisinfo')); $tpl->parse('html'); return $tpl->get('html'); }
/** * This function builds the list of order persons. * * @access public * @param mixed $parameters['orderPersons'] * the list of order persons according to the result of * <code>getListOfType</code>...-method * @return the parsed HTML-file */ public static function buildListOfOrderPersons($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT("./html"); $tpl->loadTemplatefile('order-persons.html'); foreach ($parameters['orderPersons'] as $idOrderPerson => $orderPerson) { $tpl->setCurrentBlock('order-person'); $tpl->setVariable(array('NAME' => $orderPerson['title'])); $tpl->parse('order-person'); } $tpl->setCurrentBlock('html'); $tpl->setVariable(array('TITLE' => 'Kliendid')); $tpl->parse('html'); return $tpl->get('html'); }
public function buildListOfItems($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT(ROOT_FOLDER . "html"); $tpl->loadTemplatefile('items.html'); foreach ($parameters['items'] as $id => $item) { $tpl->setCurrentBlock('item'); $tpl->setVariable(array('NAME' => $item['title'])); $tpl->parse('item'); } $tpl->setCurrentBlock('body'); $tpl->setVariable(array('TITLE' => 'Tooted')); $tpl->parse('body'); return $tpl->get('body'); }
/** * This function builds the list of shipping * * @access public * @param mixed $parameters['shipTos'] * the list of shipping according to the result of * <code>getListOfType</code>...-method * @return the parsed HTML-file */ public static function buildListOfShipTos($parameters) { // require_once dirname(__FILE__) . '/../errors/ErrorView.php'; // \PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array ( // new ErrorView(), 'raiseError')); require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT("./html"); $tpl->loadTemplatefile('ship-tos.html'); foreach ($parameters['shipTos'] as $idShipTo => $shipTo) { $tpl->setCurrentBlock('ships-to'); $tpl->setVariable(array('NAME' => $shipTo['title'])); $tpl->setVariable(array('ADDRESS' => $shipTo['title2'])); $tpl->parse('ships-to'); } $tpl->setCurrentBlock('html'); $tpl->setVariable(array('TITLE' => 'Kauba saatmisinfo')); $tpl->parse('html'); return $tpl->get('html'); }
/** * This function builds the list of shipping locations. */ public static function buildListOfShipTo($parameters) { require_once 'HTML/Template/IT.php'; //$tpl = new \HTML_Template_IT(ROOT_FOLDER . 'html'); $tpl = new \HTML_Template_IT("../html"); $tpl->loadTemplatefile('ShipTo.html'); foreach ($parameters['ShipTo'] as $idShipTo => $ShipTo) { $tpl->setCurrentBlock('ship-to'); $tpl->setVariable(array('NAME' => $ShipTo['title'])); $tpl->parse('ship-to'); } $tpl->setCurrentBlock('html'); $tpl->setVariable(array('TITLE' => 'Sihtkoht')); $tpl->parse('html'); return $tpl->get('html'); }
/** * This function builds the main view. * * @access public * @param string $parameters['css'] * the CSS-part * @param string $parameters['js'] * the JS-part * @param string $parameters['name'] * the current name searched * @param string $parameters['target'] * the target in the URL * @return string the parsed block * @uses Configuration for the folder of the template */ public static function buildView($parameters) { require_once 'HTML/Template/IT.php'; $template = new \HTML_Template_IT(Configuration::ROOT_FOLDER); $template->loadTemplateFile('pupils.html'); $template->setCurrentBlock('html'); $template->setVariable(array('NAME' => $parameters['name'], 'STYLE' => $parameters['css'], 'SCRIPT' => $parameters['js'], 'TARGET' => $parameters['target'])); $template->parse('html'); return $template->get('html'); }
public static function buildMenuView($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT("./html"); $tpl->loadTemplatefile('burnstudio-copy.html'); $tpl->setCurrentBlock('menu-item'); $tpl->setVariable(array('HREF' => $parameters[0]['object']->getHref(), 'LABEL' => $parameters[0]['object']->getLabel())); $tpl->parse('menu-item'); return $tpl->get('menu-item'); }
/** * This function creates a HTML-block for a logo. * * @access public * @param Logo $parameters['logo'] * the logo * @uses BEGINNING_OF_URL the beginning of the URL */ public static function buildLogo($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'html'); $tpl->loadTemplatefile('psdtohtml-template.html'); $tpl->setCurrentBlock('logo'); $tpl->setVariable(array('ALT-OF-LOGO' => $parameters['logo']->getAlt(), 'BEGINNING-OF-URL' => BEGINNING_OF_URL, 'SRC-OF-LOGO' => $parameters['logo']->getSrc(), 'SIZES-OF-LOGO' => $parameters['logo']->getSizes())); $tpl->parse('logo'); return $tpl->get('logo'); }
/** * this function builds the page * * @access public * @author tambet * @param string $prameters['title'] * shows-title * @param string $prameters['body'] * shows-body */ public static function buildPage($prameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT(dirname(__FILE__) . '/'); $tpl->loadTemplatefile('page.html'); $tpl->setCurrentBlock('page'); $tpl->setVariable(array('TITLE' => $prameters['title'], 'BODY' => $prameters['body'])); $tpl->parse('page'); return $tpl->get('page'); }
/** * This function builds the main structure in HTML. * * @access public * @param string $parameters['title'] the title * @return string the parsed HTML-structure * @uses ROOT_FOLDER for the path to the HTML-template file */ public static function buildView($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT(ROOT_FOLDER); $tpl->loadTemplatefile('students-template.html'); $tpl->setCurrentBlock('html'); $tpl->setVariable(array('TITLE' => $parameters['title'], 'STUDENT-CLASS' => $parameters['student-class'], 'NO-STUDENT' => $parameters['no-student'], 'STEPS' => $parameters['steps'], 'STYLE' => \students\PupilView::buildCss(), 'JS' => \students\PupilView::buildJs(array($parameters['guess'])))); $tpl->parse('html'); return $tpl->get('html'); }
public static function buildOrderPerson($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT(ROOT_FOLDER . "html"); $tpl->loadTemplatefile('orderpersons.html'); $tpl->setCurrentBlock('order-person'); $tpl->setVariable(array('FIRST-NAME' => $parameters["orderPerson"]->getFirstName(), 'LAST-NAME' => $parameters["orderPerson"]->getLastName(), 'EMAIL' => $parameters["orderPerson"]->getEmail(), 'ADDRESS' => $parameters["orderPerson"]->getAddress())); $tpl->parse('order-person'); return $tpl->get('order-person'); }
/** * This function builds the CSS-part. * * @access public * @author kalmer:piiskop <*****@*****.**> * @param string $parameters['fileName'] the name of the CSS-file * @return string the CSS-part * @uses BEGINNING_OF_URL for image paths * @uses ROOT_FOLDER for the path to the CSS-template folder */ public static function buildCss($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'css'); $tpl->loadTemplatefile($parameters['fileName'] . '.css'); $tpl->setCurrentBlock('css'); $tpl->setVariable(array('BEGINNING-OF-URL' => BEGINNING_OF_URL)); $tpl->parse('css'); return $tpl->get('css'); }
/** * This function builds the main structure in HTML. * * @access public * @author arnold:tserepov <*****@*****.**> * @param string $parameters['body'] * the body * @param string $parameters['title'] * the title * @return string the parsed HTML-structure * @uses BEGINNING_OF_URL for links */ public static function buildView($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'html'); $tpl->loadTemplatefile('objects.html'); $tpl->setCurrentBlock('html'); $tpl->setVariable(array('BEGINNING-OF-URL' => BEGINNING_OF_URL, 'BODY' => $parameters['body'], 'TITLE' => $parameters['title'])); $tpl->parse('html'); return $tpl->get('html'); }
/** * This function creates a HTML-block for a menu item. * * @access public * @author kalmer:piiskop <*****@*****.**> * @param MenuElement $parameters['menuElement'] * the menu element */ public static function buildMenuElement($parameters) { require_once 'HTML/Template/IT.php'; $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'html'); $tpl->loadTemplatefile('from-design-to-web-template.html'); $tpl->setCurrentBlock('menu-item'); $tpl->setVariable(array('HREF' => $parameters['menuElement']->getHref(), 'LABEL' => $parameters['menuElement']->getLabel())); $tpl->parse('menu-item'); return $tpl->get('menu-item'); }