readTemplatesFromFile( 'page.html' ); $tmpl->applyInputFilter('ShortModifiers'); // load the stock templates if (is_array( $files )) { foreach ($files as $file) { $tmpl->readTemplatesFromInput( $file ); } } // TODO: Do the protocol better $tmpl->addVar( 'form', 'formAction', basename($_SERVER['PHP_SELF']) ); $tmpl->addVar( 'form', 'formName', 'adminForm' ); $tmpl->setRoot( dirname( __FILE__ ) . '/tmpl'); $tmpl->setNamespace( 'mos' ); if ($bodyHtml) { $tmpl->setAttribute( 'body', 'src', $bodyHtml ); } return $tmpl; } }