skinname = 'monobook'; $this->stylename = 'monobook'; $this->template = 'MonoBook'; } /** * If using PHPTAL 0.7 on PHP 4.x, return a PHPTAL template object. * If using PHPTAL 1.0 on PHP 5.x, return a bridge object. * @return object * @access private */ function &setupTemplate( $file, $repository=false, $cache_dir=false ) { if( defined( 'NEW_PHPTAL' ) ) { return new PHPTAL_version_bridge( $file . '.pt', $repository, $cache_dir ); } else { return new PHPTAL( $file . '.pt', $repository, $cache_dir ); } } /** * Output the string, or print error message if it's * an error object of the appropriate type. * * @param mixed $str * @access private */ function printOrError( &$str ) { if( PEAR::isError( $str ) ) { echo $str->toString(), "\n"; } else { echo $str; } } } /** * @todo document * @package MediaWiki * @subpackage Skins */ class PHPTAL_version_bridge { function PHPTAL_version_bridge( $file, $repository=false, $cache_dir=false ) { $this->tpl =& new PHPTAL( $file ); if( $repository ) { $this->tpl->setTemplateRepository( $repository ); } } function set( $name, $value ) { $this->tpl->$name = $value; } function setRef($name, &$value) { $this->set( $name, $value ); } function setTranslator( &$t ) { $this->tpl->setTranslator( $t ); } function execute() { /* try { */ return $this->tpl->execute(); /* } catch (Exception $e) { echo "
We caught an exception...\n "; echo $e; echo "
"; } */ } } } // end of if( class_exists( 'PHPTAL' ) ) } // end of if( class_exists( 'PEAR' ) ) } // end of if( defined( 'MEDIAWIKI' ) ) ?>