Skip to content

Commit

Permalink
fix : Be sure to include jquery when viewing package operations (#6530)
Browse files Browse the repository at this point in the history
  • Loading branch information
live627 committed Feb 25, 2021
1 parent 356972f commit 8cc9caa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 13 additions & 1 deletion Sources/Packages.php
Expand Up @@ -1816,7 +1816,7 @@ function PackageOptions()
*/
function ViewOperations()
{
global $context, $txt, $sourcedir, $packagesdir, $smcFunc, $modSettings;
global $context, $txt, $sourcedir, $packagesdir, $smcFunc, $modSettings, $settings;

// Can't be in here buddy.
isAllowedTo('admin_forum');
Expand Down Expand Up @@ -1926,6 +1926,18 @@ function ViewOperations()
// No layers
$context['template_layers'] = array();
$context['sub_template'] = 'view_operations';

// We only want to load these three JavaScript files.
$context['javascript_files'] = array_intersect_key(
$context['javascript_files'],
[
'smf_script' => true,
'smf_jquery' => true
]
);

// Since the alerts code is loaded very late in the process, it must be disabled seperately.
$settings['disable_files'] = ['smf_alerts'];
}

/**
Expand Down
8 changes: 5 additions & 3 deletions Themes/default/Packages.template.php
Expand Up @@ -1317,9 +1317,11 @@ function template_view_operations()
<meta charset="', $context['character_set'], '">
<title>', $txt['operation_title'], '</title>
<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $context['browser_cache'], '">
<link rel="stylesheet" href="', $settings['theme_url'], '/css/admin.css', $context['browser_cache'], '">
<script src="', $settings['default_theme_url'], '/scripts/script.js', $context['browser_cache'], '"></script>
<script src="', $settings['default_theme_url'], '/scripts/theme.js', $context['browser_cache'], '"></script>
<link rel="stylesheet" href="', $settings['theme_url'], '/css/admin.css', $context['browser_cache'], '">';

template_javascript();

echo '
</head>
<body>
<div class="padding windowbg">
Expand Down

0 comments on commit 8cc9caa

Please sign in to comment.