', $txt[($context['uninstalling'] ? 'un' : '') . 'install_mod'], '

'; if ($context['is_installed']) echo ' ', $txt['package_installed_warning1'], '

', $txt['package_installed_warning2'], '

'; echo $txt['package_installed_warning3'], '
'; // Do errors exist in the install? If so light them up like a christmas tree. if ($context['has_failure']) { echo '
', sprintf($txt['package_will_fail_title'], $txt['package_' . ($context['uninstalling'] ? 'uninstall' : 'install')]), '
', sprintf($txt['package_will_fail_warning'], $txt['package_' . ($context['uninstalling'] ? 'uninstall' : 'install')]), !empty($context['failure_details']) ? '

' . $context['failure_details'] . '' : '', '
'; } // Display the package readme if one exists if (isset($context['package_readme'])) { echo '

', $txt['package_' . ($context['uninstalling'] ? 'un' : '') . 'install_readme'], '

', $context['package_readme'], ' ', $txt['package_available_readme_language'], '

'; } // Did they specify a license to display? if (isset($context['package_license'])) { echo '

', $txt['package_install_license'], '

', $context['package_license'], ' ', $txt['package_available_license_language'], '

'; } echo '

', $context['uninstalling'] ? $txt['package_uninstall_actions'] : $txt['package_install_actions'], ' "', $context['package_name'], '"

'; // Are there data changes to be removed? if ($context['uninstalling'] && !empty($context['database_changes'])) { echo '
[', $txt['package_db_uninstall_details'], ']
', $txt['package_db_uninstall_actions'], ':
    '; foreach ($context['database_changes'] as $change) echo '
  • ', $change, '
  • '; echo '
'; } echo '
'; if (empty($context['actions']) && empty($context['database_changes'])) echo '
', $txt['corrupt_compatible'], '
'; else { echo ' ', $txt['perform_actions'], ' '; $alternate = true; $i = 1; $action_num = 1; $js_operations = array(); foreach ($context['actions'] as $packageaction) { // Did we pass or fail? Need to now for later on. $js_operations[$action_num] = isset($packageaction['failed']) ? $packageaction['failed'] : 0; echo ' '; // Is there water on the knee? Operation! if (isset($packageaction['operations'])) { echo ' '; // Increase it. $action_num++; } $alternate = !$alternate; } echo '
', $txt['package_install_type'], ' ', $txt['package_install_action'], ' ', $txt['package_install_desc'], '
', isset($packageaction['operations']) ? '' : '', ' ', $i++, '. ', $packageaction['type'], ' ', $packageaction['action'], ' ', $packageaction['description'], '
'; // Show the operations. $alternate2 = true; $operation_num = 1; foreach ($packageaction['operations'] as $operation) { // Determine the position text. $operation_text = $operation['position'] == 'replace' ? 'operation_replace' : ($operation['position'] == 'before' ? 'operation_after' : 'operation_before'); echo ' '; $operation_num++; $alternate2 = !$alternate2; } echo '
', $operation_num, '. ', $txt[$operation_text], ' ', $operation['action'], ' ', $operation['description'], !empty($operation['ignore_failure']) ? ' (' . $txt['operation_ignore'] . ')' : '', '
'; // What if we have custom themes we can install into? List them too! if (!empty($context['theme_actions'])) { echo '

', $context['uninstalling'] ? $txt['package_other_themes_uninstall'] : $txt['package_other_themes'], '

', $txt['package_other_themes_desc'], '
'; // Loop through each theme and display it's name, and then it's details. foreach ($context['theme_actions'] as $id => $theme) { // Pass? $js_operations[$action_num] = !empty($theme['has_failure']); echo ' '; foreach ($theme['actions'] as $action) { echo ' '; // Is there water on the knee? Operation! if (isset($action['operations'])) { echo ' '; // Increase it. $action_num++; } } $alternate = !$alternate; } echo '
'; if (!empty($context['themes_locked'])) echo ' '; echo ' ', $theme['name'], '
', isset($packageaction['operations']) ? '' : '', ' ', $action['type'], ' ', $action['action'], ' ', $action['description'], '
'; $alternate2 = true; $operation_num = 1; foreach ($action['operations'] as $operation) { // Determine the possition text. $operation_text = $operation['position'] == 'replace' ? 'operation_replace' : ($operation['position'] == 'before' ? 'operation_after' : 'operation_before'); echo ' '; $operation_num++; $alternate2 = !$alternate2; } echo '
', $operation_num, '. ', $txt[$operation_text], ' ', $operation['action'], ' ', $operation['description'], !empty($operation['ignore_failure']) ? ' (' . $txt['operation_ignore'] . ')' : '', '
'; } } // Are we effectively ready to install? if (!$context['ftp_needed'] && (!empty($context['actions']) || !empty($context['database_changes']))) { echo '
'; } // If we need ftp information then demand it! elseif ($context['ftp_needed']) { echo '

', $txt['package_ftp_necessary'], '

', template_control_chmod(), '
'; } echo ' ', (isset($context['form_sequence_number']) && !$context['ftp_needed']) ? ' ' : '', '
'; // Toggle options. echo ' '; // Get the currently selected item from a select list echo ' '; // And a bit more for database changes. if (!empty($context['database_changes'])) echo ' '; } function template_extract_package() { global $context, $settings, $options, $txt, $scripturl; if (!empty($context['redirect_url'])) { echo ' '; } echo '
'; if (empty($context['redirect_url'])) { echo '

', $context['uninstalling'] ? $txt['uninstall'] : $txt['extracting'], '

', $txt['package_installed_extract'], '
'; } else echo '

', $txt['package_installed_redirecting'], '

'; echo '
'; // If we are going to redirect we have a slightly different agenda. if (!empty($context['redirect_url'])) { echo ' ', $context['redirect_text'], '

', $txt['package_installed_redirect_go_now'], ' | ', $txt['package_installed_redirect_cancel'], ''; } elseif ($context['uninstalling']) echo ' ', $txt['package_uninstall_done']; elseif ($context['install_finished']) { if ($context['extract_type'] == 'avatar') echo ' ', $txt['avatars_extracted']; elseif ($context['extract_type'] == 'language') echo ' ', $txt['language_extracted']; else echo ' ', $txt['package_installed_done']; } else echo ' ', $txt['corrupt_compatible']; echo '
'; // Show the "restore permissions" screen? if (function_exists('template_show_list') && !empty($context['restore_file_permissions']['rows'])) { echo '
'; template_show_list('restore_file_permissions'); } echo '
'; } function template_list() { global $context, $settings, $options, $txt, $scripturl; echo '

', $txt['list_file'], '

', $txt['files_archive'], ' ', $context['filename'], ':

    '; foreach ($context['files'] as $fileinfo) echo '
  1. ', $fileinfo['filename'], ' (', $fileinfo['size'], ' ', $txt['package_bytes'], ')
  2. '; echo '

[ ', $txt['back'], ' ]
'; } function template_examine() { global $context, $settings, $options, $txt, $scripturl; echo '

', $txt['package_examine_file'], '

', $txt['package_file_contents'], ' ', $context['filename'], ':

', $context['filedata'], '
[ ', $txt['list_files'], ' ]
'; } function template_browse() { global $context, $settings, $options, $txt, $scripturl, $modSettings, $forum_version; echo '
'; if ($context['sub_action'] == 'browse') { echo '

', $txt['packages_adding_title'], '

', $txt['packages_adding'], '
'; if (empty($modSettings['disable_smf_js'])) echo ' '; // This sets the announcements and current versions themselves ;). echo ' '; echo '
'; } $mods_available = false; foreach ($context['modification_types'] as $type) { if (!empty($context['available_' . $type])) { template_show_list('packages_lists_' . $type); $mods_available = true; } } if (!$mods_available) echo '
', $context['sub_action'] == 'browse' ? $txt['no_packages'] : $txt['no_mods_installed'], '
'; else echo '
'; // the advanced (emulation) box, collapsed by default echo '

', $txt['package_emulate_desc'], '

', $txt['package_emulate'], ':
', $txt['package_emulate_revert'], '
'; echo '
'; } function template_servers() { global $context, $settings, $options, $txt, $scripturl; if (!empty($context['package_ftp']['error'])) echo '
', $context['package_ftp']['error'], '
'; echo '

', $txt['download_new_package'], '

'; if ($context['package_download_broken']) { echo '

', $txt['package_ftp_necessary'], '

', $txt['package_ftp_why_download'], '

'; } echo '
' . $txt['package_servers'] . '
' . $txt['add_server'] . '
' . $txt['server_name'] . ':
' . $txt['serverurl'] . ':
', $txt['package_download_by_url'], '
' . $txt['serverurl'] . ':
', $txt['package_download_filename'], ':

', $txt['package_download_filename_info'], '

' . $txt['package_upload_title'] . '

' . $txt['package_upload_select'] . ':

'; } function template_package_confirm() { global $context, $settings, $options, $txt, $scripturl; echo '

', $context['page_title'], '

'; } function template_package_list() { global $context, $settings, $options, $txt, $scripturl, $smcFunc; echo '

' . $context['page_title'] . '

'; // No packages, as yet. if (empty($context['package_list'])) echo '
  • ', $txt['no_packages'], '
'; // List out the packages... else { echo '
    '; foreach ($context['package_list'] as $i => $packageSection) { echo '
  • ', $packageSection['title'], ''; if (!empty($packageSection['text'])) echo '
    ', $packageSection['text'], '
    '; echo ' <', $context['list_type'], ' id="package_section_', $i, '" class="packages">'; $alt = false; foreach ($packageSection['items'] as $id => $package) { echo '
  • '; // Textual message. Could be empty just for a blank line... if ($package['is_text']) echo ' ', empty($package['name']) ? ' ' : $package['name']; // This is supposed to be a rule.. elseif ($package['is_line']) echo '
    '; // A remote link. elseif ($package['is_remote']) { echo ' ', $package['link'], ''; } // A title? elseif ($package['is_heading'] || $package['is_title']) { echo ' ', $package['name'], ''; } // Otherwise, it's a package. else { // 1. Some mod [ Download ]. echo ' ', $package['can_install'] ? '' . $package['name'] . ' [ ' . $txt['download'] . ' ]': $package['name']; // Mark as installed and current? if ($package['is_installed'] && !$package['is_newer']) echo '', $package['is_current'] ? $txt['package_installed_current'] : $txt['package_installed_old'], ''; echo '
      '; // Show the mod type? if ($package['type'] != '') echo '
    • ', $txt['package_type'], ':  ', $smcFunc['ucwords']($smcFunc['strtolower']($package['type'])), '
    • '; // Show the version number? if ($package['version'] != '') echo '
    • ', $txt['mod_version'], ':  ', $package['version'], '
    • '; // How 'bout the author? if (!empty($package['author']) && $package['author']['name'] != '' && isset($package['author']['link'])) echo '
    • ', $txt['mod_author'], ':  ', $package['author']['link'], '
    • '; // The homepage.... if ($package['author']['website']['link'] != '') echo '
    • ', $txt['author_website'], ':  ', $package['author']['website']['link'], '
    • '; // Desciption: bleh bleh! // Location of file: http://someplace/. echo '
    • ', $txt['file_location'], ':  ', $package['href'], '
    • ', $txt['package_description'], ':  ', $package['description'], '
    '; } $alt = !$alt; echo '
  • '; } echo ' '; } echo '
'; } echo '
', $txt['package_installed_key'], ' ', $txt['package_installed_current'], ' ', $txt['package_installed_old'], '
'; // Now go through and turn off all the sections. if (!empty($context['package_list'])) { $section_count = count($context['package_list']); echo ' '; } } function template_downloaded() { global $context, $settings, $options, $txt, $scripturl; echo '

', $context['page_title'], '

', (empty($context['package_server']) ? $txt['package_uploaded_successfully'] : $txt['package_downloaded_successfully']), '

  • ', $context['package']['name'], ' ', $context['package']['list_files']['link'], ' ', $context['package']['install']['link'], '


[ ', $txt['back'], ' ]

'; } function template_install_options() { global $context, $settings, $options, $txt, $scripturl; if (!empty($context['saved_successful'])) echo '
', $txt['settings_saved'], '
'; echo '

', $txt['package_install_options'], '

', $txt['package_install_options_ftp_why'], '
'; } function template_control_chmod() { global $context, $settings, $options, $txt, $scripturl; // Nothing to do? Brilliant! if (empty($context['package_ftp'])) return false; if (empty($context['package_ftp']['form_elements_only'])) { echo ' ', sprintf($txt['package_ftp_why'], 'document.getElementById(\'need_writable_list\').style.display = \'\'; return false;'), '
', $txt['package_ftp_why_file_list'], '
'; } echo '
', !empty($context['package_ftp']['error']) ? $context['package_ftp']['error'] : '', '
'; if (!empty($context['package_ftp']['destination'])) echo '
'; echo '
'; if (empty($context['package_ftp']['form_elements_only'])) echo '
'; if (!empty($context['package_ftp']['destination'])) echo '
'; // Hide the details of the list. if (empty($context['package_ftp']['form_elements_only'])) echo ' '; // Quick generate the test button. echo ' '; // Make sure the button gets generated last. $context['insert_after_template'] .= ' '; } function template_ftp_required() { global $context, $settings, $options, $txt, $scripturl; echo '
', $txt['package_ftp_necessary'], '
', template_control_chmod(), '
'; } function template_view_operations() { global $context, $txt, $settings; echo ' ', $txt['operation_title'], '
', $context['operations']['search'], '
', $context['operations']['replace'], '
'; } function template_file_permissions() { global $txt, $scripturl, $context, $settings; // This will handle expanding the selection. echo ' '; echo '
', $txt['package_file_perms_warning'], ':
    ', $txt['package_file_perms_warning_desc'], '

', $txt['package_file_perms'], '', $txt['package_file_perms_new_status'], '

'; foreach ($context['file_tree'] as $name => $dir) { echo ' '; if (!empty($dir['contents'])) template_permission_show_contents($name, $dir['contents'], 1); } echo '
 ', $txt['package_file_perms_name'], '  ', $txt['package_file_perms_status'], ' ', $txt['package_file_perms_status_read'], ' ', $txt['package_file_perms_status_write'], ' ', $txt['package_file_perms_status_execute'], ' ', $txt['package_file_perms_status_custom'], ' ', $txt['package_file_perms_status_no_change'], '
'; if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) echo ' *'; echo ' ', $name, ' ', ($dir['perms']['chmod'] ? $txt['package_file_perms_writable'] : $txt['package_file_perms_not_writable']), ' ', ($dir['perms']['perms'] ? ' (' . $txt['package_file_perms_chmod'] . ': ' . substr(sprintf('%o', $dir['perms']['perms']), -4) . ')' : ''), '

', $txt['package_file_perms_change'], '

', $txt['package_file_perms_custom'], ':  (?)
', $txt['package_file_perms_predefined_note'], '
'; // Likely to need FTP? if (empty($context['ftp_connected'])) echo '

', $txt['package_file_perms_ftp_details'], ':

', template_control_chmod(), '
', $txt['package_file_perms_ftp_retain'], '
'; echo '
'; // Any looks fors we've already done? foreach ($context['look_for'] as $path) echo ' '; echo '

'; } function template_permission_show_contents($ident, $contents, $level, $has_more = false) { global $settings, $txt, $scripturl, $context; $js_ident = preg_replace('~[^A-Za-z0-9_\-=:]~', ':-:', $ident); // Have we actually done something? $drawn_div = false; foreach ($contents as $name => $dir) { if (isset($dir['perms'])) { if (!$drawn_div) { $drawn_div = true; echo ' '; } $cur_ident = preg_replace('~[^A-Za-z0-9_\-=:]~', ':-:', $ident . '/' . $name); echo ' '; if (!empty($dir['contents'])) { template_permission_show_contents($ident . '/' . $name, $dir['contents'], $level + 1, !empty($dir['more_files'])); } } } // We have more files to show? if ($has_more) echo ' '; if ($drawn_div) { // Hide anything too far down the tree. $isFound = false; foreach ($context['look_for'] as $tree) { if (substr($tree, 0, strlen($ident)) == $ident) $isFound = true; } if ($level > 1 && !$isFound) echo '
' . str_repeat(' ', $level * 5), ' ', (!empty($dir['type']) && $dir['type'] == 'dir_recursive') || !empty($dir['list_contents']) ? '' : ''; if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) echo ' *'; echo ' ', $name, ' ', (!empty($dir['type']) && $dir['type'] == 'dir_recursive') || !empty($dir['list_contents']) ? '' : '', ' ', ($dir['perms']['chmod'] ? $txt['package_file_perms_writable'] : $txt['package_file_perms_not_writable']), ' ', ($dir['perms']['perms'] ? ' (' . $txt['package_file_perms_chmod'] . ': ' . substr(sprintf('%o', $dir['perms']['perms']), -4) . ')' : ''), '
' . str_repeat(' ', $level * 5), ' « ', $txt['package_file_perms_more_files'], ' »
'; } } function template_action_permissions() { global $txt, $scripturl, $context, $settings; $countDown = 3; echo '

', $txt['package_file_perms_applying'], '

'; if (!empty($context['skip_ftp'])) echo '
', $txt['package_file_perms_skipping_ftp'], '
'; // How many have we done? $remaining_items = count($context['method'] == 'individual' ? $context['to_process'] : $context['directory_list']); $progress_message = sprintf($context['method'] == 'individual' ? $txt['package_file_perms_items_done'] : $txt['package_file_perms_dirs_done'], $context['total_items'] - $remaining_items, $context['total_items']); $progress_percent = round(($context['total_items'] - $remaining_items) / $context['total_items'] * 100, 1); echo '
', $progress_message, '

', $progress_percent, '%
 
'; // Second progress bar for a specific directory? if ($context['method'] != 'individual' && !empty($context['total_files'])) { $file_progress_message = sprintf($txt['package_file_perms_files_done'], $context['file_offset'], $context['total_files']); $file_progress_percent = round($context['file_offset'] / $context['total_files'] * 100, 1); echo '
', $file_progress_message, '

', $file_progress_percent, '%
 
'; } echo '
'; // Put out the right hidden data. if ($context['method'] == 'individual') echo ' '; else echo ' '; // Are we not using FTP for whatever reason. if (!empty($context['skip_ftp'])) echo ' '; // Retain state. foreach ($context['back_look_data'] as $path) echo ' '; echo '
'; // Just the countdown stuff echo ' '; } ?>