mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
related to #1530 Status verification for languages manager
This commit is contained in:
@@ -11,6 +11,11 @@ if( !defined("PHPWG_ROOT_PATH") )
|
||||
die ("Hacking attempt!");
|
||||
}
|
||||
|
||||
if (!is_webmaster())
|
||||
{
|
||||
$page['warnings'][] = l10n('Webmaster status is required.');
|
||||
}
|
||||
|
||||
include_once(PHPWG_ROOT_PATH.'admin/include/languages.class.php');
|
||||
|
||||
$template->set_filenames(array('languages' => 'languages_installed.tpl'));
|
||||
@@ -24,7 +29,7 @@ $languages->get_db_languages();
|
||||
check_input_parameter('action', $_GET, false, '/^(activate|deactivate|set_default|delete)$/');
|
||||
check_input_parameter('language', $_GET, false, '/^('.join('|', array_keys($languages->fs_languages)).')$/');
|
||||
|
||||
if (isset($_GET['action']) and isset($_GET['language']))
|
||||
if (isset($_GET['action']) and isset($_GET['language']) and is_webmaster())
|
||||
{
|
||||
$page['errors'] = $languages->perform_action($_GET['action'], $_GET['language']);
|
||||
|
||||
@@ -110,5 +115,7 @@ DELETE
|
||||
pwg_query($query);
|
||||
}
|
||||
|
||||
$template->assign('isWebmaster', (is_webmaster()) ? 1 : 0);
|
||||
|
||||
$template->assign_var_from_handle('ADMIN_CONTENT', 'languages');
|
||||
?>
|
||||
|
||||
@@ -35,6 +35,7 @@ $(".delete-lang-button").each(function() {
|
||||
{if $language.state == $language_state}
|
||||
<div class="languageBox{if $language.is_default} languageDefault{/if}">
|
||||
<div class="languageName">{$language.name}{if $language.is_default} <em>({'default'|@translate})</em>{/if}</div>
|
||||
{if $isWebmaster == 1}
|
||||
<div class="languageActions">
|
||||
<div>
|
||||
{if $language_state == 'active'}
|
||||
@@ -55,6 +56,7 @@ $(".delete-lang-button").each(function() {
|
||||
{/if}
|
||||
</div>
|
||||
</div> <!-- languageActions -->
|
||||
{/if}
|
||||
</div> <!-- languageBox -->
|
||||
{/if}
|
||||
{/foreach}
|
||||
|
||||
Reference in New Issue
Block a user