예제 #1
0
 /**
  * Load block content
  * @param  string  $block  Block name - the real block is tpls/blocks/[block].php
  * @param  array   $vars   information of block (used in template layout)
  *
  * @return string Block content
  */
 function loadBlock($block, $vars = array())
 {
     $path = CANVASPath::getPath('tpls/blocks/' . $block . '.php');
     if ($path) {
         if ($block == 'footer') {
             ob_start();
             include $path;
             $buffer = ob_get_contents();
             ob_end_clean();
             $buffer = CANVAS::fixCANVASLink($buffer);
             echo $buffer;
         } else {
             include $path;
         }
     } else {
         echo "<div class=\"error\">Block [{$block}] not found!</div>";
     }
 }