/** * Outputs the current page * * If no page information is given then the start page is used. * * @author Schmalls / Joshua Thompson <*****@*****.**> * @version 0.0.0 * @since 0.0.0 * @access public * @global class the whomp storage url */ public function loadPage() { global $_whomp_storage_url; // format the head information $head = whomp_get_head_data_string(); // check for page information $page = isset($_GET['page']) ? self::getPage($_GET['page']) : self::getPage('page1'); // check for page navigation information $nav = isset($_GET['page']) ? self::getNav($_GET['page']) : self::getNav('page1'); // output the page echo <<<HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> \t<head> \t<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \t<link rel="stylesheet" href="style.css" type="text/css" /> {$head} \t<script language="javascript" type="text/javascript"> \t/* <![CDATA[ */ \tvar global_pagename; \tfunction getPageTwo() { \t\tif (!document.getElementById('agree').checked) { \t\t\talert('Please agree to the license to continue!'); \t\t\treturn; \t\t} \t\tvar keys = 'agree'; \t\tvar values = 0 + document.getElementById('agree').checked; \t\tglobal_pagename = 'page2'; \t\tWhomp_Installer_Html_getPageText(global_pagename, keys, values); \t} \tfunction getPageThree() { \t\tif (document.getElementById('site_name').value == '' || \t\t\tdocument.getElementById('site_url').value == '' || \t\t\tdocument.getElementById('site_path').value == '' || \t\t\tdocument.getElementById('database_host').value == '' || \t\t\tdocument.getElementById('database_name').value == '' || \t\t\tdocument.getElementById('database_user').value == '' || \t\t\tdocument.getElementById('database_password').value == '') { \t\t\talert('Missing information!'); \t\t\treturn; \t\t} \t\tvar keys = 'site_name,site_url,site_path,database_type,database_host,database_name,database_user,database_password,database_prefix'; \t\tvar values = document.getElementById('site_name').value + ',' \t\t\t\t\t\t+ document.getElementById('site_url').value + ',' \t\t\t\t\t\t+ document.getElementById('site_path').value + ',' \t\t\t\t\t\t+ document.getElementById('database_type').value + ',' \t\t\t\t\t\t+ document.getElementById('database_host').value + ',' \t\t\t\t\t\t+ document.getElementById('database_name').value + ',' \t\t\t\t\t\t+ document.getElementById('database_user').value + ',' \t\t\t\t\t\t+ document.getElementById('database_password').value + ',' \t\t\t\t\t\t+ document.getElementById('database_prefix').value; \t\tglobal_pagename = 'page3'; \t\tWhomp_Installer_Html_getPageText(global_pagename, keys, values); \t} \tfunction getPageFour() { \t\tif (document.getElementById('admin_user').value == '' || \t\t\tdocument.getElementById('admin_name').value == '' || \t\t\tdocument.getElementById('admin_email').value == '' || \t\t\tdocument.getElementById('admin_password').value == '' || \t\t\tdocument.getElementById('admin_password_confirm').value == '') { \t\t\talert('Missing information!'); \t\t\treturn; \t\t} \t\tif (document.getElementById('admin_password').value != document.getElementById('admin_password_confirm').value) { \t\t\talert('Passwords do not match!'); \t\t\treturn; \t\t} \t\tvar keys = 'database_type,database_host,database_name,database_user,database_password,database_prefix,admin_user,admin_name,admin_email,admin_password'; \t\tvar values = document.getElementById('database_type').value + ',' \t\t\t\t\t\t+ document.getElementById('database_host').value + ',' \t\t\t\t\t\t+ document.getElementById('database_name').value + ',' \t\t\t\t\t\t+ document.getElementById('database_user').value + ',' \t\t\t\t\t\t+ document.getElementById('database_password').value + ',' \t\t\t\t\t\t+ document.getElementById('database_prefix').value + ',' \t\t\t\t\t\t+ document.getElementById('admin_user').value + ',' \t\t\t\t\t\t+ document.getElementById('admin_name').value + ',' \t\t\t\t\t\t+ document.getElementById('admin_email').value + ',' \t\t\t\t\t\t+ document.getElementById('admin_password').value; \t\tglobal_pagename = 'page4'; \t\tWhomp_Installer_Html_getPageText(global_pagename, keys, values); \t} \tfunction Whomp_Installer_Html_getPageText_callback(result) { \t\tdocument.getElementById('main_area').innerHTML = result; \t\tWhomp_Installer_Html_getNavText(global_pagename); \t} \tfunction Whomp_Installer_Html_getNavText_callback(result) { \t\tdocument.getElementById('navcontainer').innerHTML = result; \t} \t/* ]]> */ \t</script> \t</head> \t<body> \t\t<div class="header" style="height:76px;">Whomp CMS Installer</div> \t\t<div style="float:left;" id="main_area"> {$page} \t\t</div> \t\t<div id="navcontainer"> {$nav} \t\t</div> \t</body> </html> HTML; }
/** * Inserts XSL import into the xsl file * * @author Schmalls / Joshua Thompson <*****@*****.**> * @version 0.0.0 * @since 0.0.0 * @access public * @param string $xsl_path the path to the XSL file * @global string the whomp storage url */ public function insertXsl($xsl_path) { global $_whomp_storage_url; $whomp_head = whomp_get_head_data_string(); $xsl = <<<XSL <?xml version="1.0" encoding="utf-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> \t<xsl:import href="{$xsl_path}" /> \t<xsl:import href="{$_whomp_storage_url}/templates/{$this->_template}/{$this->_format}.xsl" /> \t<xsl:variable name="_whomp_storage_url">{$_whomp_storage_url}</xsl:variable> \t<xsl:variable name="whomp_edit" select="boolean({$this->_edit})" /> \t<xsl:variable name="whomp_head">{$whomp_head}</xsl:variable> \t<xsl:variable name="whomp_onload">{$this->_onload}</xsl:variable> \t<xsl:variable name="whomp_editid">{$this->_editid}</xsl:variable> </xsl:stylesheet> XSL; $this->_template_xsl->loadXML($xsl); }