Ticket #1474 (new task)

Opened 5 years ago

Last modified 4 years ago

create a SGL API call to load blocks from remote site

Reported by: demian Assigned to: sablake
Priority: normal Milestone: 1.0
Component: SGL - BlockLoader Severity: open
Keywords: Cc:

Description

// get_seagull_blocks.php
<?php
/**
 * Returns systime in ms.
 *
 * @return string   Execution time in milliseconds
 */
function getSystemTime()
{
    $time = gettimeofday();
    $resultTime = $time['sec'] * 1000;
    $resultTime += floor($time['usec'] / 1000);
    return $resultTime;
}
//  start timer
define('SGL_START_TIME', getSystemTime());
$rootDir = dirname(__FILE__) . '/..';
$varDir = dirname(__FILE__) . '/../var';
if (is_file($rootDir .'/lib/SGL/FrontController.php')) {
    require_once $rootDir .'/lib/SGL/FrontController.php';
}
SGL_FrontController::init();
//  main
$output = new SGL_Output();
$blockLoader = & new SGL_BlockLoader(0);
$aBlocks = $blockLoader->render($output);
foreach ($aBlocks as $key => $value) {
    $blocksName = 'blocks'.$key;
    $output->$blocksName = $value;
}
?>
  • deps on Output need to be removed
  • load blocks with section id 0 (all blocks)
  • load left/rightBlocks templates and parse with SGL_HtmlSimpleView
$templ = & new SGL_HtmlSimpleView($output);
$html = $tmpl->render();

Change History

06/06/07 06:57:05 changed by demian

  • owner changed from somebody to sablake.
  • milestone set to 0.6.3.

11/07/07 10:38:41 changed by demian

  • milestone changed from 0.6.3 to 0.9.0 - polishing.