';
// Show the "restore permissions" screen?
if (function_exists('template_show_list') && !empty($context['restore_file_permissions']['rows']))
{
echo ' ';
template_show_list('restore_file_permissions');
}
}
/**
* List files in a package
*/
function template_list()
{
global $context, $txt, $scripturl;
echo '
';
// Now go through and turn off all the sections.
if (!empty($context['package_list']))
{
$section_count = count($context['package_list']);
echo '
';
}
}
/**
* Confirmation page showing a package was uploaded/downloaded successfully.
*/
function template_downloaded()
{
global $context, $txt, $scripturl;
echo '
';
}
/**
* Installation options - FTP info and backup settings
*/
function template_install_options()
{
global $context, $txt, $scripturl;
if (!empty($context['saved_successful']))
echo '
', $txt['settings_saved'], '
';
echo '
', $txt['package_install_options'], '
', $txt['package_install_options_ftp_why'], '
';
}
/**
* CHMOD control form
*
* @return bool False if nothing to do.
*/
function template_control_chmod()
{
global $context, $txt;
// 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 '
';
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'] .= '
';
}
/**
* Wrapper for the above template function showing that FTP is required
*/
function template_ftp_required()
{
global $txt;
echo '
';
}
/**
* View operation details.
*/
function template_view_operations()
{
global $context, $txt, $settings, $modSettings;
echo '
', $txt['operation_title'], '
';
template_javascript();
echo '
', $context['operations']['search'], '
', $context['operations']['replace'], '
';
}
/**
* The file permissions page.
*/
function template_file_permissions()
{
global $txt, $scripturl, $context;
// This will handle expanding the selection.
echo '
';
echo '
', $txt['package_file_perms_warning'], ':
', $txt['package_file_perms_warning_desc'], '
';
}
/**
* Shows permissions for items within a directory (called from template_file_permissions)
*
* @param string $ident A unique ID - typically the directory name
* @param array $contents An array of items within the directory
* @param int $level How far to go inside the directory
* @param bool $has_more Whether there are more files to display besides what's in $contents
*/
function template_permission_show_contents($ident, $contents, $level, $has_more = false)
{
global $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 '
';
}
}
/**
* A progress page showing what permissions changes are being applied
*/
function template_action_permissions()
{
global $txt, $scripturl, $context;
$countDown = 3;
echo '
';
// Just the countdown stuff
echo '
';
}
?>