', $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 '
', $txt['package_will_fail_title'], '
', $txt['package_will_fail_warning'], '
';
}
if (isset($context['package_readme']))
{
echo '
', $txt['package_' . ($context['uninstalling'] ? 'un' : '') . 'install_readme'], '
', $context['package_readme'], '
', $txt['package_available_readme_language'], '
';
foreach ($context['readmes'] as $a => $b)
echo '', $b == 'default' ? $txt['package_readme_default'] : ucfirst($b), ' ';
echo '
';
}
echo '
';
// Toggle options.
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'], ':
';
}
function template_examine()
{
global $context, $settings, $options, $txt, $scripturl;
echo '
', $txt['package_examine_file'], '
', $txt['package_file_contents'], ' ', $context['filename'], ':
';
}
function template_view_installed()
{
global $context, $settings, $options, $txt, $scripturl;
echo '
' . $txt['view_and_remove'] . '
';
if (empty($context['installed_mods']))
{
echo '
', $txt['no_mods_installed'], '
';
}
else
{
echo '
', $txt['mod_name'], '
', $txt['mod_version'], '
';
$alt = false;
foreach ($context['installed_mods'] as $i => $file)
{
echo '
', ++$i, '.
', $file['name'], '
', $file['version'], '
[ ', $txt['uninstall'], ' ]
';
$alt = !$alt;
}
echo '
[ ', $txt['delete_list'], ' ] ';
}
echo '
';
}
function template_browse()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings, $forum_version;
echo '
', $txt['packages_latest_fetch'], '
';
if (empty($modSettings['disable_smf_js']))
echo '
';
echo '
';
echo '
';
echo '
', $txt['browse_packages'], '
';
if (!empty($context['available_mods']))
{
echo '
', $txt['modification_package'], '
', $txt['mod_name'], '
', $txt['mod_version'], '
';
$alt = false;
foreach ($context['available_mods'] as $i => $package)
{
echo '
', ++$i, '.
', $package['name'], '
', $package['version'];
if ($package['is_installed'] && !$package['is_newer'])
echo '
';
echo '
';
if ($package['can_uninstall'])
echo '
[ ', $txt['uninstall'], ' ] ';
elseif ($package['can_upgrade'])
echo '
[ ', $txt['package_upgrade'], ' ] ';
elseif ($package['can_install'])
echo '
[ ', $txt['install_mod'], ' ] ';
echo '
[ ', $txt['list_files'], ' ]
[ ', $txt['package_delete'], ' ]
';
$alt = !$alt;
}
echo '
';
}
if (!empty($context['available_avatars']))
{
echo '
', $txt['avatar_package'], '
', $txt['mod_name'], '
', $txt['mod_version'], '
';
foreach ($context['available_avatars'] as $i => $package)
{
echo '
', ++$i, '.
', $package['name'], '
', $package['version'];
if ($package['is_installed'] && !$package['is_newer'])
echo '
';
echo '
';
if ($package['can_uninstall'])
echo '
[ ', $txt['uninstall'], ' ] ';
elseif ($package['can_upgrade'])
echo '
[ ', $txt['package_upgrade'], ' ] ';
elseif ($package['can_install'])
echo '
[ ', $txt['install_mod'], ' ] ';
echo '
[ ', $txt['list_files'], ' ]
[ ', $txt['package_delete'], ' ]
';
}
echo '
';
}
if (!empty($context['available_languages']))
{
echo '
' . $txt['language_package'] . '
', $txt['mod_name'], '
', $txt['mod_version'], '
';
foreach ($context['available_languages'] as $i => $package)
{
echo '
' . ++$i . '.
' . $package['name'] . '
' . $package['version'];
if ($package['is_installed'] && !$package['is_newer'])
echo '
';
echo '
';
if ($package['can_uninstall'])
echo '
[ ', $txt['uninstall'], ' ] ';
elseif ($package['can_upgrade'])
echo '
[ ', $txt['package_upgrade'], ' ] ';
elseif ($package['can_install'])
echo '
[ ', $txt['install_mod'], ' ] ';
echo '
[ ', $txt['list_files'], ' ]
[ ', $txt['package_delete'], ' ]
';
}
echo '
';
}
if (!empty($context['available_other']))
{
echo '
' . $txt['unknown_package'] . '
', $txt['mod_name'], '
', $txt['mod_version'], '
';
foreach ($context['available_other'] as $i => $package)
{
echo '
' . ++$i . '.
' . $package['name'] . '
' . $package['version'];
if ($package['is_installed'] && !$package['is_newer'])
echo '
';
echo '
';
if ($package['can_uninstall'])
echo '
[ ', $txt['uninstall'], ' ] ';
elseif ($package['can_upgrade'])
echo '
[ ', $txt['package_upgrade'], ' ] ';
elseif ($package['can_install'])
echo '
[ ', $txt['install_mod'], ' ] ';
echo '
[ ', $txt['list_files'], ' ]
[ ', $txt['package_delete'], ' ]
';
}
echo '
';
}
if (empty($context['available_mods']) && empty($context['available_avatars']) && empty($context['available_languages']) && empty($context['available_other']))
echo '
', $txt['no_packages'], '
';
echo '
', $txt['package_installed_key'], '
', $txt['package_installed_current'], '
', $txt['package_installed_old'], '
';
}
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['package_download_by_url'], '
' . $txt['package_upload_title'] . '
';
}
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 '
';
}
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;
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'], '
';
if (!empty($context['notwritable_files']))
foreach ($context['notwritable_files'] as $file)
echo '
', $file, ' ';
echo '
';
}
echo '
', !empty($context['package_ftp']['error']) ? $context['package_ftp']['error'] : '', '
';
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 '
';
}
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 '
' . 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) . ')' : ''), '
';
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 '
' . str_repeat(' ', $level * 5), '
« ', $txt['package_file_perms_more_files'], ' »
';
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 '
';
}
}
function template_action_permissions()
{
global $txt, $scripturl, $context, $settings;
$countDown = 3;
echo '
';
// Just the countdown stuff
echo '
';
}
?>