/** * Displays the HTML for this page * */ function echoHTML() { $nohtml = JoomlapackAbstraction::getParam('no_html', 0); if ($nohtml == 1) { JoomlapackLogger::VisualizeLogDirect(); } else { $configuration =& JoomlapackConfiguration::getInstance(); $option = JoomlapackAbstraction::getParam('option', 'com_joomlapack'); // Show top header echo JoomlapackCommonHTML::getAdminHeadingHTML(JoomlapackLangManager::_('LOG_LOGBANNER')); echo "<p><a href=\"index2.php?option={$option}&act=dllog&no_html=1\">" . JoomlapackLangManager::_('LOG_DOWNLOADTEXT') . "</a></p>"; echo '<iframe src="index2.php?option=' . $option . '&act=log&no_html=1" width="90%" height="400px">'; echo '</iframe>'; } }
function echoHTML() { $task = JoomlapackAbstraction::getParam('task', 'panel'); switch ($task) { case 'export': $this->_echoExport(); break; case 'import': $this->_echoImport(); break; case 'upload': $this->_echoUpload(); break; case 'fix': $this->_echoFix(); break; default: case 'panel': $this->_echoPanel(); break; } }
function getImageURI($imageName) { return JoomlapackAbstraction::SiteURI() . '/administrator/components/' . JoomlapackAbstraction::getParam('option', 'com_joomlapack') . '/assets/images/' . $imageName . '.png'; }
function echoHTML() { jpimport('helpers.lang'); // Get URL for JavaScript $jsURI_pb = JoomlapackAbstraction::SiteURI() . '/administrator/components/' . JoomlapackAbstraction::getParam('option', 'com_joomlapack') . '/assets/js/xp_progress.js'; // Get some more HTML fragments $headingHTML = JoomlapackCommonHTML::getAdminHeadingHTML(JoomlapackLangManager::_('CPANEL_DBEF')); $this->commonSAJAX(); echo <<<ENDFRAGMENT \t\t\t<script language="javascript" src="{$jsURI_pb}"> \t\t\t\t// WinXP Progress Bar- By Brian Gosselin- http://www.scriptasylum.com/ \t\t\t</script> \t\t\t<script language="JavaScript" type="text/javascript"> \t\t\t\t/* \t\t\t\t * (S)AJAX Library code \t\t\t\t */ ENDFRAGMENT; sajax_show_javascript(); echo <<<ENDFRAGMENT \t\t \t\tsajax_fail_handle = SAJAXTrap; \t\t \t\t\t\tfunction SAJAXTrap( myData ) { \t\t\t\t\talert('Invalid AJAX reponse: ' + myData); \t\t\t\t} \t\t\t\t\t \t\t\t\tfunction ToggleFilter( myTable, myID ) { \t\t\t\t\tvar sCheckStatus = (document.getElementById(myID).checked == true) ? "on" : "off"; \t\t\t \t\t\t\t\tdocument.getElementById("DBEFScreen").style.display = "none"; \t\t\t\t\tdocument.getElementById("DBEFProgressBar").style.display = "block"; \t\t\t \t\t\t\t\tx_toggleDBFilter( myTable, sCheckStatus, ToggleFilter_cb ); \t\t\t\t} \t\t\t \t\t\t\tfunction ToggleFilter_cb( myRet ) { \t\t\t\t\tTablesHTML(); \t\t\t\t\tdocument.getElementById("DBEFScreen").style.display = "block"; \t\t\t\t\tdocument.getElementById("DBEFProgressBar").style.display = "none"; \t\t\t\t} \t\t\t \t\t\t\tfunction TablesHTML() { \t\t\t\t\tx_DBSelectionHTML( cb_TablesHTML ); \t\t\t\t} \t\t\t \t\t\t\tfunction cb_TablesHTML( myRet ) { \t\t\t\t\tdocument.getElementById("DBEFScreen").style.display = "block"; \t\t\t\t\tdocument.getElementById("DBEFProgressBar").style.display = "none"; \t\t\t\t\tdocument.getElementById("DBEFOperationList").innerHTML = myRet; \t\t\t\t} \t\t\t\t \t\t\t\tfunction Reset() { \t\t\t\t\tdocument.getElementById("DBEFScreen").style.display = "none"; \t\t\t\t\tdocument.getElementById("DBEFProgressBar").style.display = "block"; \t\t\t\t\tx_ResetDBEF( ToggleFilter_cb ); \t\t\t\t} \t\t\t\t \t\t\t\tfunction FilterNonJ() \t\t\t\t{ \t\t\t\t\tdocument.getElementById("DBEFScreen").style.display = "none"; \t\t\t\t\tdocument.getElementById("DBEFProgressBar").style.display = "block"; \t\t\t\t\tx_FilterNonJoomlaTables( ToggleFilter_cb ); \t\t\t\t} \t\t\t</script> \t\t\t \t\t\t<div id="DBEFProgressBar" style="display:none;" class="sitePack"> \t\t\t\t<h4>Please wait...</h4> \t\t\t\t<script type="text/javascript"> \t\t\t\t\tvar bar0 = createBar(320,15,'white',1,'black','blue',85,7,3,""); \t\t\t\t</script> \t\t\t</div> \t\t\t \t\t\t<div id="DBEFScreen"> \t\t\t\t{$headingHTML} \t\t\t\t<div id="DBEFOperationList"> \t\t\t\t\t<script type="text/javascript"> \t\t\t\t\t\tTablesHTML(); \t\t\t\t\t</script> \t\t\t\t</div> \t\t\t</div>\t\t ENDFRAGMENT; }
/** * Displays the page * */ function echoHTML() { jpimport('helpers.lang'); // Default to site's root folder $myRoot = JPATH_SITE; $rootArray = explode('\\', $myRoot); $myRoot = implode('//', $rootArray); // Get URL for JavaScript $jsURI_pb = JoomlapackAbstraction::SiteURI() . '/administrator/components/' . JoomlapackAbstraction::getParam('option', 'com_joomlapack') . '/assets/js/xp_progress.js'; // Get some more HTML fragments $headingHTML = JoomlapackCommonHTML::getAdminHeadingHTML(JoomlapackLangManager::_('CPANEL_SFF')); $this->commonSAJAX(); ?> <script language="javascript" src="<?php echo $jsURI_pb; ?> "> // WinXP Progress Bar- By Brian Gosselin- http://www.scriptasylum.com/ </script> <script language="JavaScript" type="text/javascript"> /* * (S)AJAX Library code */ <?php sajax_show_javascript(); ?> sajax_fail_handle = SAJAXTrap; function SAJAXTrap( myData ) { alert('Invalid AJAX reponse: ' + myData); } var globRoot; function ToggleFilter( myRoot, myFile, myID ) { var sCheckStatus = (document.getElementById(myID).checked == true) ? "on" : "off"; globRoot = myRoot; document.getElementById("DEFScreen").style.display = "none"; document.getElementById("DEFProgressBar").style.display = "block"; x_toggleFileFilter( myRoot, myFile, sCheckStatus, ToggleFilter_cb ); } function ToggleFilter_cb( myRet ) { dirSelectionHTML( globRoot ); document.getElementById("DEFScreen").style.display = "block"; document.getElementById("DEFProgressBar").style.display = "none"; } function dirSelectionHTML( myRoot ) { globRoot = myRoot; x_sffSelectionHTML( myRoot, cb_dirSelectionHTML ); } function cb_dirSelectionHTML( myRet ) { document.getElementById("DEFScreen").style.display = "block"; document.getElementById("DEFProgressBar").style.display = "none"; document.getElementById("DEFOperationList").innerHTML = myRet; } </script> <div id="DEFProgressBar" style="display:none;" class="sitePack"> <h4>Please wait...</h4> <script type="text/javascript"> var bar0 = createBar(320,15,'white',1,'black','blue',85,7,3,""); </script> </div> <div id="DEFScreen"> <?php echo $headingHTML; ?> <div id="DEFOperationList"> <script type="text/javascript"> dirSelectionHTML('<?php echo $myRoot; ?> '); </script> </div> </div> <?php }
/** * Displays the HTML for this page, directly outputting it to the browser */ function echoHTML() { $configuration =& JoomlapackConfiguration::getInstance(); // Show top header echo JoomlapackCommonHTML::getAdminHeadingHTML(JoomlapackLangManager::_('CPANEL_CONFIG')); echo "<p align=\"center\">" . JoomlapackLangManager::_('CONFIG_FILESTATUS') . ' ' . JoomlapackCommonHTML::colorizeWriteStatus($configuration->isConfigurationWriteable(), true) . "</p>"; $this->echoAJAXJS(); ?> <form action="index2.php" method="post" name="adminForm"> <input type="hidden" name="option" value="<?php echo JoomlapackAbstraction::getParam('option', 'com_joomlapack'); ?> " /> <input type="hidden" name="act" value="config" /> <input type="hidden" name="task" value="" /> <table border="0" cellpadding="0" cellspacing="0" width="95%" class="adminform"> <tr><td> <?php if (!defined('_JEXEC')) { $tabs = new mosTabs(1); $tabs->startPane(1); $tabs->startTab(JoomlapackLangManager::_('CONFIG_BASIC_OPTIONS'), 'jpconfigbasic'); } else { jimport('joomla.html.pane'); $tabs =& JPane::getInstance('sliders'); echo $tabs->startPane('jpconfig'); echo $tabs->startPanel(JoomlapackLangManager::_('CONFIG_BASIC_OPTIONS'), 'jpconfigbasic'); } ?> <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform"> <tr align="center" valign="middle"> <th width="20%"> </th> <th width="20%"><?php echo JoomlapackLangManager::_('CONFIG_OPTION'); ?> </th> <th width="60%"><?php echo JoomlapackLangManager::_('CONFIG_CURSETTINGS'); ?> </th> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('COMMON_OUTDIR'); ?> </td> <td><input type="text" name="outdir" id="outdir" size="40" value="<?php echo $configuration->OutputDirectory; ?> " /> <input type="button" value="<?php echo JoomlapackLangManager::_('CONFIG_DEFAULTDIR'); ?> " onclick="getDefaultOutputDirectory();" /> </td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('COMMON_TEMPDIR'); ?> </td> <td><input type="text" name="tempdir" id="tempdir" size="40" value="<?php echo $configuration->get('TempDirectory'); ?> " /> <input type="button" value="<?php echo JoomlapackLangManager::_('CONFIG_DEFAULTDIR'); ?> " onclick="getDefaultTempDirectory();" /> </td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_TARNAME'); ?> </td> <td><input type="text" name="tarname" size="40" value="<?php echo $configuration->TarNameTemplate; ?> " /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_LOGLEVEL'); ?> </td> <td><?php $this->outputLogLevel($configuration->logLevel); // @todo Use common function ?> </td> </tr> </table> <?php if (!defined('_JEXEC')) { $tabs->endTab(); $tabs->startTab(JoomlapackLangManager::_('CONFIG_ADVANCED'), 'jpconfigadvanced'); } else { echo $tabs->endPanel(); echo $tabs->startPanel(JoomlapackLangManager::_('CONFIG_ADVANCED'), 'jpconfigadvanced'); } ?> <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform"> <tr align="center" valign="middle"> <th width="20%"> </th> <th width="20%"><?php echo JoomlapackLangManager::_('CONFIG_OPTION'); ?> </th> <th width="60%"><?php echo JoomlapackLangManager::_('CONFIG_CURSETTINGS'); ?> </th> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_SQLCOMPAT'); ?> </td> <td><?php $this->outputSQLCompat($configuration->MySQLCompat); ?> </td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_DBA_LABEL'); ?> </td> <td><?php $this->AlgorithmChooser($configuration->dbAlgorithm, "dbAlgorithm"); ?> </td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_PA_LABEL'); ?> </td> <td><?php $this->AlgorithmChooser($configuration->packAlgorithm, "packAlgorithm"); ?> </td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_LISTERENGINE'); ?> </td> <td><?php $this->outputEngineSelector('listerengine', 'lister', $configuration->get('listerengine')); ?> </td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_DBDUMPENGINE'); ?> </td> <td><?php $this->outputEngineSelector('dbdumpengine', 'dumper', $configuration->get('dbdumpengine')); ?> </td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_PACKERENGINE'); ?> </td> <td><?php $this->outputEngineSelector('packerengine', 'packer', $configuration->get('packerengine')); ?> </td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_ALTINSTALLER'); ?> </td> <td><?php $this->AltInstallerChooser($configuration->InstallerPackage); ?> </td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_BACKUPMETHOD'); ?> </td> <td><?php $this->backupMethodChooser($configuration->backupMethod); ?> </tr> </table> <?php if (!defined('_JEXEC')) { $tabs->endTab(); $tabs->startTab(JoomlapackLangManager::_('CONFIG_FRONTEND'), 'jpconfigfrontend'); } else { echo $tabs->endPanel(); echo $tabs->startPanel(JoomlapackLangManager::_('CONFIG_FRONTEND'), 'jpconfigfrontend'); } ?> <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform"> <tr align="center" valign="middle"> <th width="20%"> </th> <th width="20%"><?php echo JoomlapackLangManager::_('CONFIG_OPTION'); ?> </th> <th width="60%"><?php echo JoomlapackLangManager::_('CONFIG_CURSETTINGS'); ?> </th> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_ENABLEFEB'); ?> </td> <td><input name="enableFrontend" type="checkbox" <?php echo $configuration->enableFrontend ? 'checked' : ''; ?> /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_SECRETPROMPT'); ?> </td> <td><input name="secretWord" type="text" size="30" maxlength="30" value="<?php echo $configuration->secretWord; ?> " /></td> </tr> <tr> <td> </td> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_SECRETINFO1'); ?> <br /> <?php echo $this->makeFEBURL(); ?> </td> </tr> </table> <?php if (!defined('_JEXEC')) { $tabs->endTab(); $tabs->startTab(JoomlapackLangManager::_('CONFIG_MAGIC'), 'jpconfigmagic'); } else { echo $tabs->endPanel(); echo $tabs->startPanel(JoomlapackLangManager::_('CONFIG_MAGIC'), 'jpconfigmagic'); } ?> <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform"> <tr align="center" valign="middle"> <th width="20%"> </th> <th width="20%"><?php echo JoomlapackLangManager::_('CONFIG_OPTION'); ?> </th> <th width="60%"><?php echo JoomlapackLangManager::_('CONFIG_CURSETTINGS'); ?> </th> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MNROWSPERSTEP'); ?> </td> <td><input name="mnRowsPerStep" type="text" value="<?php echo $configuration->mnRowsPerStep; ?> " /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MNMAXFRAGMENTSIZE'); ?> </td> <td><input name="mnMaxFragmentSize" type="text" value="<?php echo $configuration->mnMaxFragmentSize; ?> " /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MNMAXFRAGMENTFILES'); ?> </td> <td><input name="mnMaxFragmentFiles" type="text" value="<?php echo $configuration->mnMaxFragmentFiles; ?> " /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MNZIPFORCEOPEN'); ?> </td> <td><input name="mnZIPForceOpen" type="checkbox" <?php echo $configuration->mnZIPForceOpen ? 'checked' : ''; ?> /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MNZIPCOMPRESSIONTHRESHOLD'); ?> </td> <td><input name="mnZIPCompressionThreshold" type="text" value="<?php echo $configuration->mnZIPCompressionThreshold; ?> " /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MNZIPDIRREADCHUNK'); ?> </td> <td><input name="mnZIPDirReadChunk" type="text" value="<?php echo $configuration->mnZIPDirReadChunk; ?> " /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MNMAXEXECTIMEALLOWED'); ?> </td> <td><input name="mnMaxExecTimeAllowed" type="text" value="<?php echo $configuration->get('mnMaxExecTimeAllowed'); ?> " /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MNMINIMUMEXECTIME'); ?> </td> <td><input name="mnMinimumExectime" type="text" value="<?php echo $configuration->get('mnMinimumExectime'); ?> " /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MNEXECTIMEBIASPERCENT'); ?> </td> <td><input name="mnExectimeBiasPercent" type="text" value="<?php echo $configuration->get('mnExectimeBiasPercent'); ?> " /></td> </tr> </table> <?php if (!defined('_JEXEC')) { $tabs->endTab(); $tabs->startTab(JoomlapackLangManager::_('CONFIG_MYSQLDUMP'), 'jpconfigmysqldump'); } else { echo $tabs->endPanel(); echo $tabs->startPanel(JoomlapackLangManager::_('CONFIG_MYSQLDUMP'), 'jpconfigmysqldump'); } ?> <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform"> <tr align="center" valign="middle"> <th width="20%"> </th> <th width="20%"><?php echo JoomlapackLangManager::_('CONFIG_OPTION'); ?> </th> <th width="60%"><?php echo JoomlapackLangManager::_('CONFIG_CURSETTINGS'); ?> </th> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MYSQLDUMP_PATH'); ?> </td> <td><input name="mysqldumpPath" type="text" value="<?php echo $configuration->get('mysqldumpPath'); ?> " /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MYSQLDUMP_DATACHUNK'); ?> </td> <td><input name="mnMSDDataChunk" type="text" value="<?php echo $configuration->get('mnMSDDataChunk'); ?> " /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MYSQLDUMP_MAXQUERYLINES'); ?> </td> <td><input name="mnMSDMaxQueryLines" type="text" value="<?php echo $configuration->get('mnMSDMaxQueryLines'); ?> " /></td> </tr> <tr> <td> </td> <td><?php echo JoomlapackLangManager::_('CONFIG_MYSQLDUMP_LINESPERSESSION'); ?> </td> <td><input name="mnMSDLinesPerSession" type="text" value="<?php echo $configuration->get('mnMSDLinesPerSession'); ?> " /></td> </tr> </table> <?php if (!defined('_JEXEC')) { $tabs->endTab(); $tabs->endPane(); } else { echo $tabs->endPanel(); echo $tabs->endPane(); } ?> </td></tr></table> </form> <?php }
function CommonFooter() { // Skip footer for AJAX calls if (JoomlapackAbstraction::isSAJAX()) { return; } $option = JoomlapackAbstraction::getParam('option', 'com_joomlapack'); ?> <p> [ <a href="index2.php?option=<?php echo $option; ?> "><?php echo JoomlapackLangManager::_('CPANEL_HOME'); ?> </a> ] <br /> <span style="font-size:x-small;"> JoomlaPack <?php echo _JP_VERSION; ?> . Copyright © 2006-2008 <a href="http://www.joomlapack.net">JoomlaPack Developers</a>.<br/> <a href="http://www.joomlapack.net">JoomlaPack</a> is Free Software released under the GNU/GPL License. </span> </p> <?php }
/** * Returns a URI to a JoomlaPack function, defined by act and task * * @param string $act The JP action to perform * @param string $task The JP task (if any) associated to the action to perform * @param bool $nohtml Set to true in order to suppress Joomla!'s regular HTML output * @param string $miscOptions Any options to append to the URI * * @return string */ function JPLink($act, $task = "", $nohtml = false, $miscOptions = "") { $link = JoomlapackAbstraction::SiteURI() . '/administrator/index2.php?'; $link .= "option=" . JoomlapackAbstraction::getParam('option', 'com_joomlapack'); $link .= $act == "" ? "" : "&act={$act}"; $link .= $task == "" ? "" : "&task={$task}"; $link .= $nohtml ? "&no_html=1" : ""; $link .= $miscOptions == "" ? "" : "&{$miscOptions}"; return $link; }
function _getNewURI($finished = false, $error = false) { $option = JoomlapackAbstraction::getParam('option'); $key = JoomlapackAbstraction::getParam('key'); $dummy = JoomlapackAbstraction::getParam('dummy', 0); $tweak = JoomlapackAbstraction::getParam('tweak', 'http'); $dummy++; if ($finished) { if ($error) { return JoomlapackAbstraction::SiteURI() . "/index2.php?option={$option}&act=fullbackup&task=finished&error=1&key={$key}&no_html=1"; } else { return JoomlapackAbstraction::SiteURI() . "/index2.php?option={$option}&act=fullbackup&task=finished&key={$key}&no_html=1"; } } else { return JoomlapackAbstraction::SiteURI() . "/index2.php?option={$option}&act=fullbackup&task=continue&key={$key}&no_html=1&dummy={$dummy}&tweak={$tweak}"; } }
/** * Deletes a selected row * */ function _deleteFromPOST() { $id = JoomlapackAbstraction::getParam('id', ''); JoomlapackHelperFiltertable::deleteInclusionFilter($this->_filterClass, $id); }
$myBase = realpath($myBase) == '' ? $myBase : realpath($myBase); // 1.2a3 -- Rare case when $myBase == '/' define('DS', DIRECTORY_SEPARATOR); define('JPATH_SITE', realpath($myBase)); define('JPATH_COMPONENT_ADMINISTRATOR', $myBase . DS . 'administrator' . DS . 'components' . DS . $option); define('JPATH_COMPONENT', $myBase . DS . 'components' . DS . $option); } // Include Joomla! Version Abstraction Layer require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'frameworkabstraction.php'; // Include abstract classes definitions jpimport('classes.abstract.object'); jpimport('classes.abstract.filter'); jpimport('classes.abstract.enginearchiver'); jpimport('classes.abstract.engineparts'); // Always populate basic Joomla! page parameters and make them global global $act, $task; // Get the parameters from the request $act = JoomlapackAbstraction::getParam('act', 'default'); $task = JoomlapackAbstraction::getParam('task', ''); // Load language definitions require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'lang.php'; switch ($act) { case "fullbackup": require_once JPATH_COMPONENT . '/includes/CFullBackup.php'; $tickableObject =& CFullBackup::getInstance(); $tickableObject->tick(); break; default: echo JoomlapackLangManager::_('FRONTEND_ACCESSDENIED'); break; }
/** * Performs a backup step and displays the outcome. This is used by the * JavaScript Redirects backup method * * @return bool|null Returns false if the backup step failed * @since 1.2.b1 * @access private */ function _echoHTML_Redirects_Backup() { // Decide how to proceed based on the existence and contents of the 'type' parameter in the URL $type = JoomlapackAbstraction::getParam('type', 'INVALID'); if ($type == 'INVALID') { $action = 'continue'; } else { switch ($type) { case 'full': $action = 'new'; $dbonly = 0; break; case 'dbonly': $action = 'new'; $dbonly = 1; break; default: $action = 'error'; break; } } // Quit on invalid page parameters if ($action == 'error') { $this->_errorStack[] = JoomlapackLangManager::_('PACK_ERRORINVALIDPARAMETERS'); $this->_echoHTML_Redirects_Error(); return false; } /** * Please note that we display the progress BEFORE running the next backup step. * If we did otherwise, the progress would never get to be displayed to our user. * This is due to the partial page (backend header, menu and component header) * being sent to the browser before the lengthy backup process takes place. */ // Get a CUBE Return Array from the database jpimport('classes.core.cube'); $cube =& JoomlapackCUBE::getInstance(); $ret = $cube->getCUBEArray(); // Parse $ret array if ($action == 'new') { $domain = 'init'; $step = ''; $substep = ''; } else { if (count($ret) <= 0) { $domain = 'finale'; } else { $domain = $ret['Domain']; $step = $ret['Step']; $substep = $ret['Substep']; } } // Find current domain's index switch ($domain) { case 'init': $currentDomainIndex = 0; break; case 'PackDB': $currentDomainIndex = 3; break; case 'Packing': $currentDomainIndex = 4; break; case 'finale': default: $currentDomainIndex = 6; break; } // Now, make an array indicating in what state each domain is $domainDisplayArray = array(); $domainDisplayArray[] = $this->_makeStepArrayEntry(JoomlapackLangManager::_('PACK_DOMPACKDB'), 3, $currentDomainIndex, false); $domainDisplayArray[] = $this->_makeStepArrayEntry(JoomlapackLangManager::_('PACK_DOMPACKING'), 4, $currentDomainIndex, false); $domainDisplayArray[] = $this->_makeStepArrayEntry(JoomlapackLangManager::_('PACK_FINISHED'), 5, $currentDomainIndex, false); $gridHTML = ''; foreach ($domainDisplayArray as $dispArray) { $class = $dispArray['class'] == '' ? '' : 'class="' . $dispArray['class'] . '"'; $imageLink = $dispArray['pic'] == '' ? '' : '<img src="components/com_joomlapack/images/' . $dispArray['pic'] . '" />'; $gridHTML .= "\t\t\t<tr {$class}>\n"; $gridHTML .= "\t\t\t\t<td>{$imageLink}</td>\n"; $gridHTML .= "\t\t\t\t<td>" . $dispArray['label'] . "</td>\n"; $gridHTML .= "\t\t\t</tr>\n"; } echo <<<ENDXXX1 <div id="Main"> \t<div id="Init" class="sitePack"> \t\t<table class="stepstable" align="center"> \t\t\t<thead> \t\t\t\t<tr> \t\t\t\t\t<th width="16"></th> \t\t\t\t\t<th></th> \t\t\t\t</tr> \t\t\t</thead> \t\t\t<tbody> {$gridHTML} \t\t\t</tbody> \t\t</table> \t\t \t\t<div id="Status" style="display: block;"> \t\t\t<p id="JPStep">{$step}</p> \t\t\t<p id="JPSubstep">{$substep}</p> \t\t</div> ENDXXX1; // Force display of progress (Joomla! does not like that... but I can't do any better than that :p) if ($domain != 'finale') { @ob_flush(); } // Perform the backup step, if required switch ($action) { case 'continue': error_reporting(E_ALL & ~E_NOTICE); $ret = $this->tick(0, 0); JoomlapackLogger::WriteLog(_JP_LOG_DEBUG, "<-- Finished JSRedirect Call (Continue) -->"); break; case 'new': error_reporting(E_ALL & ~E_NOTICE); $ret = $this->tick(1, $dbonly); JoomlapackLogger::WriteLog(_JP_LOG_DEBUG, "<-- Finished JSRedirect Call (New) -->"); break; } // Output page redirection JavaScript if we haven't finished already if ($domain != 'finale') { $step = JoomlapackAbstraction::getParam('step', 0); $step++; $link = JoomlapackAbstraction::JPLink('pack', 'backup', false, '&step=' . $step); ?> <script type="text/javascript"> window.location = "<?php echo $link; ?> "; </script> <?php } else { ?> <div id="AllDone"> <p> </p> <table border="0" cellspacing="4px;" cellpadding="0"> <tr> <td width="32"> <img src="<?php echo JoomlapackCommonHTML::getImageURI('ok_big'); ?> " border="0" /> </td> <td> <h4><?php echo JoomlapackLangManager::_('PACK_FINISHED'); ?> </h4> <p><?php echo JoomlapackLangManager::_('PACK_FINISHEDTEXT'); ?> </p> </td> </tr> </table> <a href="<?php echo JoomlapackAbstraction::JPLink('backupadmin'); ?> "> <div class="jpbutton"> <img src="<?php echo JoomlapackCommonHTML::getImageURI('bufa'); ?> " border="0" /> <p><?php echo JoomlapackLangManager::_('CPANEL_BUADMIN'); ?> </p> </div> </a> </div> <?php } echo "</div>"; }
/** * Returns the contents of the files in the 'filename' parameter of * the request. It returns a 404 if the file is not found. */ function downloadFile() { $configuration =& JoomlapackConfiguration::getInstance(); $filename = JoomlapackAbstraction::getParam('filename', null); // Check for blank filename if (is_null($filename)) { header("HTTP/1.0 404 Not Found"); return; } // Make sure the filename is OK and get absolute path to file $filename = stripslashes($filename); $filename = realpath($configuration->OutputDirectory . DIRECTORY_SEPARATOR . $filename); // Test for nonexistent file if ($filename === FALSE) { header("HTTP/1.0 404 Not Found"); return; } // OK, all check pass. Now, get me the file! ob_end_clean(); // In case some braindead mambot spits its own HTML despite no_html=1 // Since we're not outputting text/html, we need to send the correct headers! // Tell the browser we'll be outputting a gzip file header('Content-type: application/zip'); // TODO Find the correct MIME type for binary archives! // It will be called... whatever the filename is header('Content-Disposition: attachment; filename="' . basename($filename) . '"'); readfile($filename); }
/** * Displays the HTML for this page, directly outputting it to the browser */ function echoHTML() { jpimport('helpers.lang'); // 1.1.1b2 - Oops! This page wouldn't work on at least 1 windows system $myRoot = JPATH_SITE; $rootArray = explode('\\', $myRoot); $myRoot = implode('//', $rootArray); // Get URL for JavaScript $jsURI_pb = JoomlapackAbstraction::SiteURI() . '/administrator/components/' . JoomlapackAbstraction::getParam('option', 'com_joomlapack') . '/assets/js/xp_progress.js'; // Get some more HTML fragments $headingHTML = JoomlapackCommonHTML::getAdminHeadingHTML(JoomlapackLangManager::_('CPANEL_DEF')); $this->commonSAJAX(); echo <<<ENDFRAGMENT \t\t\t<script language="javascript" src="{$jsURI_pb}"> \t\t\t\t// WinXP Progress Bar- By Brian Gosselin- http://www.scriptasylum.com/ \t\t\t</script> \t\t\t<script language="JavaScript" type="text/javascript"> \t\t\t\t/* \t\t\t\t * (S)AJAX Library code \t\t\t\t */ ENDFRAGMENT; sajax_show_javascript(); echo <<<ENDFRAGMENT \t\t \t\tsajax_fail_handle = SAJAXTrap; \t\t \t\t\t\tfunction SAJAXTrap( myData ) { \t\t\t\t\talert('Invalid AJAX reponse: ' + myData); \t\t\t\t} \t\t\t\t\t\t \t\t\t\tvar globRoot; \t\t\t \t\t\t\tfunction ToggleFilter( myRoot, myDir, myID ) { \t\t\t\t\tvar sCheckStatus = (document.getElementById(myID).checked == true) ? "on" : "off"; \t\t\t \t\t\t\t\tglobRoot = myRoot; \t\t\t \t\t\t\t\tdocument.getElementById("DEFScreen").style.display = "none"; \t\t\t\t\tdocument.getElementById("DEFProgressBar").style.display = "block"; \t\t\t \t\t\t\t\tx_toggleDirFilter( myRoot, myDir, sCheckStatus, ToggleFilter_cb ); \t\t\t\t} \t\t\t \t\t\t\tfunction ToggleFilter_cb( myRet ) { \t\t\t\t\tdirSelectionHTML( globRoot ); \t\t\t\t\tdocument.getElementById("DEFScreen").style.display = "block"; \t\t\t\t\tdocument.getElementById("DEFProgressBar").style.display = "none"; \t\t\t\t} \t\t\t \t\t\t\tfunction dirSelectionHTML( myRoot ) { \t\t\t\t\tglobRoot = myRoot; \t\t\t\t\tx_dirSelectionHTML( myRoot, cb_dirSelectionHTML ); \t\t\t\t} \t\t\t \t\t\t\tfunction cb_dirSelectionHTML( myRet ) { \t\t\t\t\tdocument.getElementById("DEFScreen").style.display = "block"; \t\t\t\t\tdocument.getElementById("DEFProgressBar").style.display = "none"; \t\t\t\t\tdocument.getElementById("DEFOperationList").innerHTML = myRet; \t\t\t\t} \t\t\t</script> \t\t\t \t\t\t<div id="DEFProgressBar" style="display:none;" class="sitePack"> \t\t\t\t<h4>Please wait...</h4> \t\t\t\t<script type="text/javascript"> \t\t\t\t\tvar bar0 = createBar(320,15,'white',1,'black','blue',85,7,3,""); \t\t\t\t</script> \t\t\t</div> \t\t\t \t\t\t<div id="DEFScreen"> \t\t\t\t{$headingHTML} \t\t\t\t<div id="DEFOperationList"> \t\t\t\t\t<script type="text/javascript"> \t\t\t\t\t\tdirSelectionHTML('{$myRoot}'); \t\t\t\t\t</script> \t\t\t\t</div> \t\t\t</div>\t\t ENDFRAGMENT; }
jpackScreens::fDirExclusion(); break; case "dbef": // Database tables exclusion filters jpimport('classes.filter.dbef'); jpackScreens::fDBExclusion(); break; case "ajax": jpimport('helpers.ajaxtool'); break; case "test": jpackScreens::fDebug(); break; case "log": jpackScreens::fLog(); if (JoomlapackAbstraction::getParam('no_html', 0) == 1) { $skipFooter = true; } break; case "dllog": // Option to download raw log $JPConfiguration = JoomlapackConfiguration::getInstance(); @ob_end_clean(); // In case some braindead mambot spits its own HTML despite no_html=1 header('Content-type: text/plain'); header('Content-Disposition: attachment; filename="joomlapacklog.txt"'); @readfile(JoomlapackAbstraction::TranslateWinPath($JPConfiguration->get('OutputDirectory') . DS . 'joomlapack.log')); $skipFooter = true; break; case "unlock": jpackScreens::fUnlock();
/** * Forces SAJAX to user per-page AJAX proxy URLs. Call it to make AJAX calls be processed by the * page class processAJAX() method. * */ function sajax_force_page_ajax() { global $sajax_remote_uri_params; $option = JoomlapackAbstraction::getParam('option', 'com_joomlapack'); $act = JoomlapackAbstraction::getParam('act', 'ajax'); $sajax_remote_uri_params = "option={$option}&act={$act}&no_html=1"; }