?> </form> <?php } } else { $header = array('title' => _l('Backups'), 'type' => 'h2', 'main' => true, 'button' => array()); if (module_backup::can_i('create', 'Backups')) { $header['button'] = array('url' => module_backup::link_open('new'), 'title' => _l('Create New Backup'), 'type' => 'add'); } print_heading($header); $backups = module_backup::get_backups(); $table_manager = module_theme::new_table_manager(); $columns = array(); $columns['backup_name'] = array('title' => 'Backup', 'callback' => function ($backup) { echo '<a href="' . module_backup::link_open($backup['backup_id'], false) . '">' . _l('View Backup') . '</a>'; }, 'cell_class' => 'row_action'); $columns['backup_size'] = array('title' => 'Backup Size', 'callback' => function ($backup) { if (strlen($backup['backup_file']) && file_exists(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.zip')) { echo module_file::format_bytes(filesize(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.zip')) . ' ' . _l('files'); echo ' '; } if (strlen($backup['backup_file']) && file_exists(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.sql')) { echo module_file::format_bytes(filesize(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.sql')) . ' ' . _l('database'); echo ' '; } if (strlen($backup['backup_file']) && file_exists(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.sql.gz')) { echo module_file::format_bytes(filesize(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.sql.gz')) . ' ' . _l('database'); echo ' '; } });
" class="submit_button" onclick="window.location.href='?m=setup&step=4';"> <?php } } else { $license_codes = explode('|', module_config::c('_installation_code', '')); foreach ($license_codes as $license_code_id => $license_code) { if (!trim($license_code)) { unset($license_codes[$license_code_id]); } } if (!count($license_codes)) { $license_codes[] = ''; } hook_handle_callback('layout_column_half', 1); if (class_exists('module_backup', false) && module_config::c('backup_time', 0) < time() - 43300 && module_backup::can_i('create', 'Backups')) { $form_actions = array('class' => 'action_bar action_bar_center action_bar_single', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_create_backup', 'value' => _l('Create a Backup'), 'onclick' => "window.location.href='" . module_backup::link_open(false) . "'; return false;"))); $fieldset_data = array('heading' => array('title' => 'Backup', 'type' => 'h3'), 'elements' => array(array('message' => _l('The last backup was made: %s', !module_config::c('backup_time', 0) ? _l('Never') : print_date(module_config::c('backup_time', 0), true))), array('message' => _l('Would you like to create a Backup before Upgrading?'))), 'elements_after' => module_form::generate_form_actions($form_actions)); echo module_form::generate_fieldset($fieldset_data); unset($fieldset_data); } ?> <form action="" method="post"> <?php module_form::print_form_auth(); $form_actions = array('class' => 'action_bar action_bar_center action_bar_single', 'elements' => array(array('type' => 'save_button', 'name' => 'check_upgrade', 'value' => _l('Check for Upgrades')), array('type' => 'submit', 'name' => 'run_upgrade', 'value' => _l('Run Manual Upgrades')))); $fieldset_data = array('heading' => array('title' => 'Upgrade', 'type' => 'h3'), 'elements' => array(array('message' => _l('Please insert your license code(s) below to receive upgrades and new features.') . ' ' . _hr('Your license code can be found from your CodeCanyon downloads page. <a href="%s">Click here</a> for help.', 'http://dtbaker.net/admin/includes/plugin_envato/images/envato-license-code.gif')), array('field' => array('type' => 'hidden', 'name' => 'save_license_codes', 'value' => 'yes')), array('title' => _l('License Codes'), 'fields' => array(function () use($license_codes) { ?> <div id="license_codes_holder"> <?php foreach ($license_codes as $license_code) {
public function process() { if ('save_backup' == $_REQUEST['_process']) { if (!module_backup::can_i('edit', 'Backups')) { die('No perms to save backup.'); } if (!module_form::check_secure_key()) { die('Invalid auth'); } if (_DEMO_MODE) { die('Sorry, cannot make backups in demo mode.cd '); } $backup_id = update_insert('backup_id', $_REQUEST['backup_id'], 'backup', $_POST); if (isset($_REQUEST['butt_del']) && self::can_i('delete', 'Backups')) { // and the file. $backup = $this->get_backup($backup_id); if ($backup && $backup['backup_id'] == $backup_id && module_form::confirm_delete('backup_id', _l('Really delete this backup?'), self::link_open($backup_id))) { if (isset($backup['backup_file']) && strlen($backup['backup_file'])) { if (file_exists(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.sql')) { @unlink(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.sql'); } if (file_exists(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.sql.gz')) { @unlink(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.sql.gz'); } if (file_exists(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.zip')) { @unlink(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.zip'); } } delete_from_db('backup', 'backup_id', $backup['backup_id']); set_message('Backup deleted successfully.'); redirect_browser($this->link_open(false)); } } set_message('Backup saved successfully'); redirect_browser($this->link_open($backup_id)); } }