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();
 }
        global $languages;
        $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']);
Example #3
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");
Example #4
0
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/navigation.php");
if ($getPage == "home") {
    switch ($lang) {
        case "en":
            $data->setHeader("<div id='header_home'><div><h1>Biathlon at the heart of the Czech Canada</h1></div></div><div id='headerbox'>\n                      <h1>Staré Město pod Landštejnem<br>biathlon club</h1>\n                      <h2>club from the heart of the Czech Canada</h2>\n                      <div id='photoBoxAll'></div>\n                      </div>");
            break;
        default:
            $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>");
            break;
    }
} else {
    $data->setHeader("<div id='header_all'>Staré Město pod Landštejnem</div>");
}
if (!file_exists("controllers/{$getPage}.php")) {
    $data->setContent(include_once "controllers/noPage.php");
} else {
    $data->setContent(include_once "controllers/{$getPage}.php");
}
$data->setTitle($title);
$data->setFooter(include_once "views/footer.php");