Example #1
0
 /**
  * Build page from database
  * @param array $data
  */
 public static function build(array $data)
 {
     if (!isset($data['title'], $data['body'])) {
         return;
     }
     $content = new Page($data['title'], $data['body']);
     if (isset($data['stylesheets'])) {
         foreach ($data['stylesheets'] as $source) {
             $content->addStylesheet($source);
         }
     }
     if (isset($data['javascripts'])) {
         foreach ($data['javascripts'] as $source) {
             $content->addJavascript($source);
         }
     }
     $content->render('system.header');
     if (isset($data['header'])) {
         $content->setHeader($data['header']);
     }
     $content->render('system.footer');
     if (isset($data['footer'])) {
         $content->setFooter($data['footer']);
     }
     return $content->publish();
 }
 public function paging($user_id, $page, $limit, $current_url)
 {
     require_once 'Page.php';
     $obj_page = new Page();
     $numrows = $this->obj_leg->getUserLegPage($user_id);
     $arr['first'] = $obj_page->paging($page, $limit, $numrows);
     $arr['page_footer'] = $obj_page->setFooter($page, $limit, $current_url);
     return $arr;
 }
        $Page->setTemplateVar('languages', $languages);
    }
    function failure(&$Page, &$Contents)
    {
        $Contents->appendChild(new XMLElement('h2', __('Installation Failure')));
        $Contents->appendChild(new XMLElement('p', __('An error occurred during installation. You can view you log <a href="install-log.txt">here</a> for more details.')));
        $Page->setTemplateVar('title', __('Installation Failure'));
        $Page->setTemplateVar('tagline', __('Version %s', array(kVERSION)));
        global $languages;
        $Page->setTemplateVar('languages', $languages);
    }
}
$Log = new SymphonyLog('install-log.txt');
$Page = new Page($Log);
$Page->setHeader(kHEADER);
$Page->setFooter(kFOOTER);
$Contents = new XMLElement('body');
$Contents->appendChild(new XMLElement('h1', '<!-- TITLE --> <em><!-- TAGLINE --></em> <em><!-- LANGUAGES --></em>'));
if (defined('__IS_UPDATE__') && __IS_UPDATE__ == true) {
    $Page->setPage('update');
} elseif (defined('__ALREADY_UP_TO_DATE__') && __ALREADY_UP_TO_DATE__ == true) {
    $Page->setPage('uptodate');
} else {
    $Page->setPage('index');
    Action::requirements($Page);
}
if (is_array($Page->missing) && !empty($Page->missing)) {
    $Page->setPage('requirements');
} elseif (isset($_POST['action'])) {
    $action = array_keys($_POST['action']);
    $action = $action[0];
Example #4
0
$title = null;
function __autoload($name)
{
    include "methods/{$name}.class.php";
}
include_once "methods/functions.php";
$data = new Page();
if (isset($_GET['page']) && $_GET['page']) {
    $getPage = $_GET['page'];
} else {
    $getPage = "home";
}
$data->setNavigation(include_once "controllers/admin/navigation.php");
if ($getPage == "home") {
    $data->setHeader("<div id='header_home'><div><h1>Biatlon v srdci České Kanady</h1></div></div><div id='headerbox'>\n                      <h1>Klub biatlonu<br>Staré Město pod Landštejnem</h1>\n                      <h2>klub ze srdce České Kanady</h2>\n                      <div id='photoBoxAll'></div>\n                      </div>");
} else {
    $data->setHeader("<div id='header_all'>Staré Město pod Landštejnem</div>");
}
if (!isset($_SESSION['StMpL']) || $_SESSION['StMpL'] !== md5('StMpL2015')) {
    $data->setContent(include_once "controllers/admin/login.php");
} else {
    if (!file_exists("controllers/admin/{$getPage}.php")) {
        $data->setContent(include_once "controllers/noPage.php");
    } else {
        $data->setContent(include_once "controllers/admin/{$getPage}.php");
    }
}
$data->setTitle($title);
$data->setFooter(include_once "views/footer.php");
$page = (include_once "views/admin/page.php");
print $page;
Example #5
0
echo '<hr>';
$obj->createHeading('h1', 'This is a heading - h1');
$obj->createHeading('h2', 'This is a heading - h2');
$obj->createHeading('h3', 'This is a heading - h3');
echo '<hr>';
$obj->createForm($inputFields, 'index2.php');
echo '<hr>';
// Create table
echo '<h3>createTable($people) function</h3>';
createTable($people);
echo '<h3>createTable_v2($people) function</h3>';
createTable_v2($people);
echo '<h3>createTable_v2($cars) function</h3>';
createTable_v2($cars);
echo '<hr>';
$obj->setFooter("Footer - Tomasz Goralczyk");
$obj->createFooter();
// Function to create a table
function createTable($array)
{
    $firstObject = $array[0];
    $properties = $firstObject->getObjectVars();
    ?>
	<table class="table table-striped">
		<tr>
			<?php 
    foreach ($properties as $property => $value) {
        ?>
				<th><?php 
        echo $property;
        ?>