Exemple #1
0
<?php

/* make sure no-one can run anything here if they didn't arrive through 'proper channels' */
if (!defined("COMPACTCMS_CODE")) {
    die('Illegal entry point!');
}
// global $cfg, $ccms; // also available: $template_instance;
// make sure these are generated before anything else:
tmpl_set_autoprio($ccms['CSS.required_files'], $cfg['rootdir'] . 'lib/templates/sweatbee/style.css');
tmpl_set_autoprio($ccms['CSS.required_files'], $cfg['rootdir'] . 'lib/templates/sweatbee/layout.css');
tmpl_set_autoprio($ccms['CSS.required_files'], $cfg['rootdir'] . 'lib/templates/sweatbee/sprite.css');
$pagename = getGETparam4Filename('page');
$is_printing = $ccms['printing'] == 'Y';
$pagerow = $db->SelectSingleRow($cfg['db_prefix'] . 'pages', array('urlpage' => MySQL::SQLValue($pagename, MySQL::SQLVALUE_TEXT)));
if ($db->ErrorNumber() != 0) {
    $db->Kill();
}
$page_id = $pagerow->page_id;
if (empty($page_id) || empty($pagename)) {
    die($ccms['lang']['system']['error_forged'] . ' (' . __FILE__ . ', ' . __LINE__ . ')');
}
// code requires mootools: make sure we load it!
tmpl_set_autoprio($ccms['JS.required_files'], $cfg['rootdir'] . 'lib/includes/js/mootools-core.js');
tmpl_set_autoprio($ccms['JS.required_files'], $cfg['rootdir'] . 'lib/includes/js/mootools-more.js');
// now register our own JS and make sure it ends up AFTER the mootools stuff has been loaded:
tmpl_set_autoprio($ccms['JS.required_files'], $cfg['rootdir'] . 'lib/modules/comment/resources/script.js');
tmpl_set_autoprio($ccms['CSS.required_files'], $cfg['rootdir'] . 'lib/modules/comment/resources/style.css > media="screen" title="comments"');
// window.addEvent("domready", function() {
$cmtdir = $cfg['rootdir'] . 'lib/modules/comment';
$ccms['JS.done'][] = <<<EOT42
window.addEvent(
\t'domready',
\tfunction()
\t{
\t\tvar req=new Request.HTML(
\t\t\t{
\t\t\t\tuseSpinner:true,
\t\t\t\tmethod:'get',
\t\t\t\turl:'{$cmtdir}/comment.Process.php?action=show-comments&page_id={$page_id}',
\t\t\t\tupdate:\$('comments'),
\t\t\t\tonRequest:function(){},
\t\t\t\tonFailure:function(){},
Exemple #3
0
/* make sure no-one can run anything here if they didn't arrive through 'proper channels' */
if (!defined("COMPACTCMS_CODE")) {
    die('Illegal entry point!');
}
// global $cfg, $ccms; // also available: $template_instance;
// make sure these are generated before anything else:
tmpl_set_autoprio($ccms['CSS.required_files'], $cfg['rootdir'] . 'lib/templates/ccms/base.css');
tmpl_set_autoprio($ccms['CSS.required_files'], $cfg['rootdir'] . 'lib/templates/ccms/layout.css');
if ($ccms['printing'] == 'Y') {
    tmpl_set_autoprio($ccms['CSS.required_files'], $cfg['rootdir'] . 'lib/templates/ccms/printing.css');
}
tmpl_set_autoprio($ccms['CSS.required_files'], $cfg['rootdir'] . 'lib/templates/ccms/sprite.css');
tmpl_set_autoprio($ccms['CSS.required_files'], $cfg['rootdir'] . 'lib/templates/ccms/last_minute_fixes.css');
// IE only:
tmpl_set_autoprio($ccms['CSS.required_files'], $cfg['rootdir'] . 'lib/templates/ccms/ie.css?only-when=%3d%3d+IE');
/*
When we arrive here, the page content has not yet been produced, but the menu structure does exist.

Hence we may opt to manipulate the menu(s) for custom output formats / rendering...

The code below is an example.
*/
for ($i = 1; $i <= MENU_TARGET_COUNT; $i++) {
    if (!isset($ccms['structure' . $i])) {
        continue;
    }
    // parse menu structure into XML struct:
    $menu_xml = simplexml_load_string($ccms['structure' . $i]);
    echo '<h1>raw</h1><pre>';
    print_r(htmlentities($ccms['structure' . $i]));
Exemple #4
0
{
\twidth: 25%;
}

#contactForm input#email
{
\t/* both are needed to hide the field from disability-assisting screen readers. */
\tdisplay: none;
\tvisibility: hidden;
}

EOT42;
    // TODO: JS and regular header and footer handling for pages (template engine)
    //<script type="text/javascript" charset="utf-8">
    tmpl_set_autoprio($ccms['JS.required_files'], $cfg['rootdir'] . 'lib/includes/js/mootools-core.js');
    tmpl_set_autoprio($ccms['JS.required_files'], $cfg['rootdir'] . 'lib/includes/js/mootools-more.js');
    //TODO
    //window.addEvent('domready', function(){
    $ccms['JS.done'][] = <<<EOT42

\t// Do: set-up form send functionality
\tfunction sendForm() {
\t\tvar myFx \t= new Fx.Tween(\$('status'), { duration:500 });
\t\tvar scroll\t= new Fx.Scroll(window, { 
\t\t\t\t\t\t\twait: false, 
\t\t\t\t\t\t\tduration: 500, 
\t\t\t\t\t\t\ttransition: Fx.Transitions.Quad.easeInOut 
\t\t\t\t\t\t});
\t\tvar contactForm = new Request.HTML({
\t\t\turl: './content/contact.php?do=send',
\t\t\tmethod: 'post',