/** * Displays the HTML for this page, directly outputting it to the browser (due to the use of tabs) */ function echoHTML() { // Load the translations // Make the Control Panel HTML $cpanel = new JoomlapackCPanelHTML(); $cpanel->addItem(JoomlapackAbstraction::JPLink('config'), 'config', JoomlapackLangManager::_('CPANEL_CONFIG')); $cpanel->addItem(JoomlapackAbstraction::JPLink('configmigrate'), 'configmigrate', JoomlapackLangManager::_('CPANEL_CONFIGMIGRATE')); $cpanel->addItem(JoomlapackAbstraction::JPLink('def'), 'def', JoomlapackLangManager::_('CPANEL_DEF')); $cpanel->addItem(JoomlapackAbstraction::JPLink('sff'), 'sff', JoomlapackLangManager::_('CPANEL_SFF')); $cpanel->addItem(JoomlapackAbstraction::JPLink('dbef'), 'dbef', JoomlapackLangManager::_('CPANEL_DBEF')); $cpanel->addItem(JoomlapackAbstraction::JPLink('multidb'), 'multidb', JoomlapackLangManager::_('CPANEL_MULTIDB')); $cpanel->addItem(JoomlapackAbstraction::JPLink('pack'), 'backup', JoomlapackLangManager::_('CPANEL_PACK')); $cpanel->addItem(JoomlapackAbstraction::JPLink('backupadmin'), 'bufa', JoomlapackLangManager::_('CPANEL_BUADMIN')); $cpanel->addItem(JoomlapackAbstraction::JPLink('log'), 'log', JoomlapackLangManager::_('CPANEL_LOG')); $cpanel->addItem(JoomlapackAbstraction::JPLink('unlock'), 'reset', JoomlapackLangManager::_('CPANEL_UNLOCK')); $cpanelHTML = $cpanel->getHTML(); // Create the admin form echo JoomlapackCommonHTML::getAdminHeadingHTML(JoomlapackLangManager::_('CPANEL_HOME')); echo <<<ENDSNIPPET \t\t<table class="adminform"> \t\t\t<tr> \t\t\t\t<td width="55%" valign="top"> \t\t\t\t\t{$cpanelHTML} \t\t\t\t</td> \t\t\t\t<td width="45%" valign="top"> ENDSNIPPET; $this->_getTabsHTML(); echo <<<ENDSNIPPET \t\t\t\t</td> \t\t\t</tr> \t\t</table>\t\t ENDSNIPPET; }
/** * Returns an administration page header * * @param string $pageTitle The title of the page * @return string */ function getAdminHeadingHTML($pageTitle = null) { $myTitle = JoomlapackLangManager::_('COMMON_JPTITLE'); if (is_null($pageTitle)) { $pageTitle = $myTitle; } $homeButton = JoomlapackCommonHTML::getImageURI('home'); $componentURI = JoomlapackAbstraction::JPLink('main'); $homeAlt = JoomlapackLangManager::_('CPANEL_HOME'); if (!defined('_JEXEC')) { // Joomla! 1.0.x-style headings $out = <<<ENDMARK \t\t\t\t<table class="adminheading"> \t\t\t\t\t<thead> \t\t\t\t\t\t<tr> \t\t\t\t\t\t\t<th class="info" nowrap rowspan="2"> \t\t\t\t\t\t\t\t{$pageTitle} \t\t\t\t\t\t\t</th> \t\t\t\t\t\t\t<th nowrap align="right" width="40" style="background: none;"> \t\t\t\t\t\t\t\t<a href="{$componentURI}"><img src="{$homeButton}" border="0" width="32" height="32" alt="{$homeAlt}" title="{$homeAlt}" /></a> \t\t\t\t\t\t\t</th> \t\t\t\t\t\t\t</tr> \t\t\t\t\t</thead> \t\t\t\t</table> \t ENDMARK; } else { // Joomla! 1.5.x-style headings $out = <<<ENDMARK \t\t\t\t<table class="adminheading" style="width:100%"> \t\t\t\t\t<tr> \t\t\t\t\t\t<td nowrap><h2>{$pageTitle}</h2> \t\t\t\t\t\t<td nowrap align="right" width="40" style="text-align: right;"> \t\t\t\t\t\t\t<a href="{$componentURI}"><img src="{$homeButton}" border="0" width="32" height="32" alt="{$homeAlt}" title="{$homeAlt}" /></a> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t</table> ENDMARK; } return $out; }
/** * Outputs an error condition. Used by the JavaScript Redirects backup method. * It displays all errors found in the class' _errorStack array. * * @access private * @since 1.2.b1 */ function _echoHTML_Redirects_Error() { ?> <div id="Main"> <div id="Timeout" style="display:none; margin-top: 10px;" class="sitePack"> <table border="0" width="100%"> <tr> <td valign="top"> <img src="<?php echo JoomlapackCommonHTML::getImageURI('error_big'); ?> " border="0" /> </td> </tr> <?php foreach ($this->_errorStack as $errorString) { ?> <tr> <td> <p><?php echo $errorString; ?> </p> </td> </tr> <?php } ?> <tr> <td> </td> <td> <a href="<?php echo JoomlapackAbstraction::JPLink('log'); ?> "> <div class="jpbutton"> <img src="<?php echo JoomlapackCommonHTML::getImageURI('log'); ?> " border="0" /> <p><?php echo JoomlapackLangManager::_('CPANEL_LOG'); ?> </p> </div> </a> </td> </tr> </table> </div> </div> <?php }
function _echoImport() { echo JoomlapackCommonHTML::getAdminHeadingHTML(JoomlapackLangManager::_('CPANEL_CONFIGMIGRATE')); $url = JoomlapackAbstraction::JPLink('configmigrate', 'upload'); $introduction = "<p>" . JoomlapackLangManager::_('CONFIGMIGRATE_IMPORTINTRO') . "<br/>" . JoomlapackLangManager::_('CONFIGMIGRATE_IMPORTWARNING') . "</p>"; $prompt = JoomlapackLangManager::_('CONFIGMIGRATE_FILEPROMPT'); $send = JoomlapackLangManager::_('CONFIGMIGRATE_SEND'); echo <<<ENDSNIPPET \t\t<form enctype="multipart/form-data" action="{$url}" method="POST"> \t\t\t<table class="adminform"> \t\t\t<tr> \t\t\t\t<td> \t\t\t\t\t{$introduction} \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td> \t\t\t\t\t{$prompt}<input name="userfile" type="file" /> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td> \t\t\t\t\t<input type="submit" value="{$send}" /> \t\t\t\t</td> \t\t\t</tr> \t\t </table> \t\t</form> ENDSNIPPET; }
/** * Sends the page's HTML to the standard output * */ function echoHTML() { $act = JoomlapackAbstraction::getParam('act'); $task = JoomlapackAbstraction::getParam('task', 'default'); // Handle downloads if ($task == 'downloadfile') { $this->downloadFile(); return; } $this->_getBackupFileList(); // Populate backup file list $this->_echoJavaScript(); // Get JavaScript for AJAX calls // Show top header echo JoomlapackCommonHTML::getAdminHeadingHTML(JoomlapackLangManager::_('CPANEL_BUADMIN')); echo JoomlapackLangManager::_('BUADMIN_FILECOUNT') . ': ' . count($this->backupFiles); ?> <table class="adminlist"> <tr> <th width="5"> # </th> <th class="title"> <?php echo JoomlapackLangManager::_('BUADMIN_FILENAME'); ?> </th> <th align="left" width="100"> <?php echo JoomlapackLangManager::_('BUADMIN_SIZE'); ?> </th> <th width="80" align="right"> </th> <th width="80" align="right"> </th> <th align="center" width="120"> <?php echo JoomlapackLangManager::_('BUADMIN_DATE'); ?> </th> </tr> <?php $count = 0; foreach ($this->backupFiles as $fileName) { $fileName = realpath($fileName); $count++; $createdTime = date("Y-m-d H:i:s", filemtime($fileName)); $fileSizeKb = round(filesize($fileName) / 1024, 2); $onlyName = basename($fileName); $linkDownload = JoomlapackAbstraction::JPLink($act, 'downloadfile', true, 'filename=' . addslashes($onlyName)); $linkDelete = "javascript:if (confirm('" . JoomlapackLangManager::_('BUADMIN_CONFIRMTITLE') . "')){ do_deletebackup('" . addslashes($onlyName) . "'); }"; ?> <tr class="<?php echo "row{$count}"; ?> "> <td><?php echo $count; ?> </td> <td align="left"><?php echo $onlyName; ?> </td> <td align="left"><?php echo $fileSizeKb; ?> Kb</td> <td align="center"> <a href="<?php echo $linkDownload; ?> "> <img src="images/downarrow.png" border=0> <?php echo JoomlapackLangManager::_('BUADMIN_DOWNLOAD'); ?> </a> </td> <td align="center"> <a href="<?php echo $linkDelete; ?> "> <img src="images/publish_x.png" border=0> <?php echo JoomlapackLangManager::_('BUADMIN_DELETE'); ?> </a> </td> <td><?php echo $createdTime; ?> </td> </tr> <?php } ?> </table> <?php }