Location: PHPKode > projects > YaCM Portal System > yacm-0.2/portal.xsl.php
<?php 
/* File: $Id: portal.xsl.php 103 2005-09-23 18:05:25Z l_a_toth $ */

/**
 * This file generates XSL content
 *
 * @package YaCM Portal System
 * @copyright (C) 2004,2005 László Attila Tóth <hide@address.com>
 * @license GPL {@link http://www.gnu.org/licenses/gpl.html}
 * @link http://panther.web.elte.hu/yacm/
 *
 * @subpackage Core
 * @author László Attila Tóth <hide@address.com>
 */

require_once 'var/config.php';
require_once 'functions.php';

ob_start();
//ini_set('display_errors', Config::display_errors);
ini_set('display_errors', 1);
header('Content-Type: application/xml; charset=UTF-8');

cache_novalidate(7200);

// should be used the own PEAR, etc classes
$incpath = explode(':',ini_get('include_path'));
$k = array_search('.', $incpath);

if ($k !== false) unset($incpath[$k]);
array_unshift($incpath, Config::root_directory . '/ext-lib');
array_unshift($incpath,'.');
ini_set('include_path', implode(':',$incpath));

setlocale(LC_ALL, 'hu_HU.UTF-8');
echo '<?xml version="1.0" encoding="UTF-8" ?>';
Config::init();
if (array_key_exists('theme', $_GET) && preg_match('/^[[:alnum]_]+$/',$_GET['theme'])) {
  Config::$others['theme'] = $_GET['theme'];
}
$xsl = Site_XSL::getInstance();

TraverseDir( Config::root_directory .'/themes/' .  $xsl->get_theme() . '/templates' );

$xsl->display();

//########################################################

function TraverseDir($dir, $loadfiles = false) {
  global $xsl;
  //  echo $dir,";";
  if (is_dir($dir)) {
    if ($dh = opendir($dir)) {
      while (($file = readdir($dh)) !== false) {
	if ($file == '.' or $file == '..' ) continue;
	$file = $dir . '/' . $file;
	if (is_file( $file ) && preg_match( '/.tpl$/', $file ) ) {
	  if ($loadfiles)  $xsl->load_file( $file);
	} else if ( is_dir( $file) && ! is_link( $file ) ) {
	  TraverseDir( $file, true );
	}	    	
      }
      closedir($dh);
    }
  }
}

?>
Return current item: YaCM Portal System