/** * Common lib a collection of useful functions * * Nne : Ninety Nine Enemies Project (http://thnet.komunikando.org) * * Copyright (c) Ninety Nine Enemies Project, (http://thnet.komunikando.org) * Licensed under The MIT License * For license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * * Based on: * SlimStarter, https://github.com/xsanisty/SlimStarter * slim-facades, https://github.com/itsgoingd/slim-facades * * @copyright Copyright (c) Ninety Nine Enemies, (http://thnet.komunikando.org) * @link http://thnet.komunikando.org Ninety Nine Enemies Project * @package Nne\Controllers * @since Nne (tm) v 1 * @license http://www.opensource.org/licenses/mit-license.php MIT License * @project Ninety Nine Enemies Project * @encoding utf-8 * @author Giorgio Tonelli <*****@*****.**>, <http://thnet.komunikando.org> * @creation 08/nov/2015 */ function sendInfoForm($type, $maildata, $to) { $mailMessage = new mailMessage($maildata, $type, explode(",", $to), $maildata['email'], Config::getConf('__CONFIG_SITE_NAME')); //$mailMessage->testMode=true; $validation['status'] = $mailMessage->sendMEssage(); if (!$validation['mailsended']) { $validation['message'] = Msg::getText('error mailgenericnotsended', $maildata['email']); } else { $validation['message'] = Msg::getText('gnrl contacts sended message'); } return $validation; }
public function __construct($file = 'tpl/template.tpl') { $this->conf = Config::getConf(); $this->file = $this->conf['template']['base'] . $file; // Import tempalte specific class file called template.php for custom // functionality that only applies for that active template. // Examples could be custom sidebar constructs $templateSpecificClasses = $this->conf['template']['base'] . 'template.php'; if (file_exists($templateSpecificClasses)) { include_once $templateSpecificClasses; //Prevent recursive including of death } }
function printnavigation($selected = "") { include_once 'gagawa-1.2-beta.php'; $conf = Config::getConf(); $navigation = $conf['site']['navigation']; $ul = new Ul(); foreach ($navigation as $i => $value) { $li = new Li(); $link = new A(); $link->setHref($value); $link->appendChild(new Text($i)); $li->appendChild($link); if ($selected === $i) { $link->setCSSClass('selected'); } $ul->appendChild($li); } return $ul->write(); }
if($_GET['file']) { // Add a template suffix $file = $_GET['file'] . '.html'; if(preg_match('/^\w+$/', $_GET['file'])==false || file_exists($file)==false) { header("HTTP/1.0 404 Not Found"); exit; } } */ include_once './php/config.class.php'; // Config loader Class include_once './php/bonestemplate.php'; // Template Class include_once './php/navigation.php'; // Site level include //new Config('config2.php'); // Load a custom config with chained config files! $conf = Config::getConf(); // Local copy of config for ease of use $page = new BonesTemplate(); $page->set("title", "Template Demo"); $page->set("content", file_get_contents('content.html')); $page->set("date", ""); // These are site level includes. They will always be available and included // no matter what template is used // As noted with the append, it will append to the end of the stack $includes[] = new PIJavascript($conf['site']['baseurl'] . 'js/site.js'); $page->append("includes", BonesTemplate::merge($includes)); echo $page->output();