<?php

class Index extends View {



	protected $package = 'core-views';
	protected $isRootView = true;

	public static $pageTitle = '';



	public function __construct() {
		parent::__construct(null);
		$dir = 'view';
		$css = array();
		$js = array();
		foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)) as $entry) {
			if (!$entry->isDir()) {
				$filename = $entry->getPathname();
				if (preg_match('/.*\.css$/', $filename)) {
					$css[] = $filename;
				} elseif (preg_match('/.*\.js$/', $filename)) {
					$js[] = $filename;
				}
			}
		}
		$this->css = $css;
		$this->js = $js;
	}



	public function __toString() {
		if (!$this->title and self::$pageTitle) {
			$this->title = self::$pageTitle;
		}
		$this->tigermouse = array_key_exists('SCRIPT_NAME', $_SERVER) ? $_SERVER['SCRIPT_NAME'] : $_SERVER['PHP_SELF'];
		return parent::__toString();
	}



} // class Index

?>