aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-04-30 22:38:17 +0000
committerplegall <plg@piwigo.org>2010-04-30 22:38:17 +0000
commit10dac9de37eee9b73964e8370eb39333b7760c0c (patch)
treee09eb98cd0e582064453c1c0091224c6bb6ac698 /admin
parent7e82d545d50bcdc23eb260e5402a39e04c3ab348 (diff)
bug 1637: make the privacy level the same everywher, use "who can see this photo?"
instead of "minimum privacy level". git-svn-id: http://piwigo.org/svn/trunk@6025 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r--admin/element_set_global.php8
-rw-r--r--admin/element_set_unit.php10
-rw-r--r--admin/photos_add_direct.php36
-rw-r--r--admin/picture_modify.php7
-rw-r--r--admin/site_update.php6
-rw-r--r--admin/themes/default/template/configuration.tpl2
-rw-r--r--admin/themes/default/template/element_set_global.tpl4
-rw-r--r--admin/themes/default/template/element_set_unit.tpl2
-rw-r--r--admin/themes/default/template/picture_modify.tpl2
-rw-r--r--admin/themes/default/template/site_update.tpl2
10 files changed, 13 insertions, 66 deletions
diff --git a/admin/element_set_global.php b/admin/element_set_global.php
index 14d8f8a3e..f2c708022 100644
--- a/admin/element_set_global.php
+++ b/admin/element_set_global.php
@@ -409,14 +409,10 @@ $template->assign( array(
);
// image level options
-$tpl_options = array();
-foreach ($conf['available_permission_levels'] as $level)
-{
- $tpl_options[$level] = l10n( sprintf('Level %d', $level) );
-}
$template->assign(
array(
- 'level_options'=> $tpl_options,
+ 'level_options'=> get_privacy_level_options(),
+ 'level_options_selected' => 0,
)
);
diff --git a/admin/element_set_unit.php b/admin/element_set_unit.php
index 77a1d51fc..5dbeb4f68 100644
--- a/admin/element_set_unit.php
+++ b/admin/element_set_unit.php
@@ -138,12 +138,6 @@ $month_list = $lang['month'];
$month_list[0]='------------';
ksort($month_list);
-$tpl_options = array();
-foreach ($conf['available_permission_levels'] as $level)
-{
- $tpl_options[$level] = l10n( sprintf('Level %d', $level) );
-}
-
$template->assign(
array(
'CATEGORIES_NAV'=>$page['title'],
@@ -156,7 +150,7 @@ $template->assign(
.'&amp;mode=global',
'F_ACTION'=>$base_url.get_query_string_diff(array()),
'month_list' => $month_list,
- 'level_options' => $tpl_options
+ 'level_options' => get_privacy_level_options(),
)
);
@@ -245,7 +239,7 @@ SELECT
'&amp;image_id='.$row['id'],
'NAME' => !empty($row['name'])?$row['name']:'',
'AUTHOR' => !empty($row['author'])?$row['author']:'',
- 'LEVEL' => !empty($row['level'])?$row['level']:'',
+ 'LEVEL' => !empty($row['level'])?$row['level']:'0',
'DESCRIPTION' => !empty($row['comment'])?$row['comment']:'',
'DATE_CREATION_YEAR' => $year,
'DATE_CREATION_MONTH' => (int)$month,
diff --git a/admin/photos_add_direct.php b/admin/photos_add_direct.php
index 0f11a5970..31cfd1e4f 100644
--- a/admin/photos_add_direct.php
+++ b/admin/photos_add_direct.php
@@ -430,44 +430,10 @@ display_select_cat_wrapper(
// image level options
-$tpl_options = array();
-foreach (array_reverse($conf['available_permission_levels']) as $level)
-{
- $label = null;
-
- if (0 == $level)
- {
- $label = l10n('Everybody');
- }
- else
- {
- $labels = array();
- $sub_levels = array_reverse($conf['available_permission_levels']);
- foreach ($sub_levels as $sub_level)
- {
- if ($sub_level == 0 or $sub_level < $level)
- {
- break;
- }
- array_push(
- $labels,
- l10n(
- sprintf(
- 'Level %d',
- $sub_level
- )
- )
- );
- }
-
- $label = implode(', ', $labels);
- }
- $tpl_options[$level] = $label;
-}
$selected_level = isset($_POST['level']) ? $_POST['level'] : 0;
$template->assign(
array(
- 'level_options'=> $tpl_options,
+ 'level_options'=> get_privacy_level_options(),
'level_options_selected' => array($selected_level)
)
);
diff --git a/admin/picture_modify.php b/admin/picture_modify.php
index 557f97dad..a764f0bdb 100644
--- a/admin/picture_modify.php
+++ b/admin/picture_modify.php
@@ -259,15 +259,10 @@ if ($row['has_high'] == 'true')
}
// image level options
-$tpl_options = array();
-foreach ($conf['available_permission_levels'] as $level)
-{
- $tpl_options[$level] = l10n( sprintf('Level %d', $level) ).' ('.$level.')';
-}
$selected_level = isset($_POST['level']) ? $_POST['level'] : $row['level'];
$template->assign(
array(
- 'level_options'=> $tpl_options,
+ 'level_options'=> get_privacy_level_options(),
'level_options_selected' => array($selected_level)
)
);
diff --git a/admin/site_update.php b/admin/site_update.php
index a42139e92..c6cc69f03 100644
--- a/admin/site_update.php
+++ b/admin/site_update.php
@@ -890,11 +890,7 @@ else
$cat_selected = array();
}
-$tpl_introduction['privacy_level_options']=array();
-foreach ($conf['available_permission_levels'] as $level)
-{
- $tpl_introduction['privacy_level_options'][$level] = l10n( sprintf('Level %d', $level) );
-}
+$tpl_introduction['privacy_level_options'] = get_privacy_level_options();
$template->assign('introduction', $tpl_introduction);
diff --git a/admin/themes/default/template/configuration.tpl b/admin/themes/default/template/configuration.tpl
index 4db63e05c..95fe21388 100644
--- a/admin/themes/default/template/configuration.tpl
+++ b/admin/themes/default/template/configuration.tpl
@@ -377,7 +377,7 @@
<li>
<label>
- <span class="property">{'Privacy level'|@translate} ({'available for administrators only'|@translate})</span>
+ <span class="property">{'Who can see this photo?'|@translate} ({'available for administrators only'|@translate})</span>
<input type="checkbox" name="picture_informations[privacy_level]" {if ($display.picture_informations.privacy_level)}checked="checked"{/if}>
</label>
</li>
diff --git a/admin/themes/default/template/element_set_global.tpl b/admin/themes/default/template/element_set_global.tpl
index f226bff84..857512c5b 100644
--- a/admin/themes/default/template/element_set_global.tpl
+++ b/admin/themes/default/template/element_set_global.tpl
@@ -185,12 +185,12 @@
</tr>
<tr>
- <td>{'Minimum privacy level'|@translate}</td>
+ <td>{'Who can see these photos?'|@translate}</td>
<td>
<label><input type="radio" name="level_action" value="leave" checked="checked">{'leave'|@translate}</label>
<label><input type="radio" name="level_action" value="set" id="level_action_set">{'set to'|@translate}</label>
<select onchange="document.getElementById('level_action_set').checked = true;" name="level" size="1">
- {html_options options=$level_options}
+ {html_options options=$level_options selected=$level_options_selected}
</select>
</td>
</tr>
diff --git a/admin/themes/default/template/element_set_unit.tpl b/admin/themes/default/template/element_set_unit.tpl
index 5b295d1e8..a70d9075e 100644
--- a/admin/themes/default/template/element_set_unit.tpl
+++ b/admin/themes/default/template/element_set_unit.tpl
@@ -102,7 +102,7 @@
</td>
</tr>
<tr>
- <td><strong>{'Minimum privacy level'|@translate}</strong></td>
+ <td><strong>{'Who can see this photo?'|@translate}</strong></td>
<td>
<select name="level-{$element.ID}">
{html_options options=$level_options selected=$element.LEVEL}
diff --git a/admin/themes/default/template/picture_modify.tpl b/admin/themes/default/template/picture_modify.tpl
index f771a673b..d299fa718 100644
--- a/admin/themes/default/template/picture_modify.tpl
+++ b/admin/themes/default/template/picture_modify.tpl
@@ -152,7 +152,7 @@
</tr>
<tr>
- <td><strong>{'Minimum privacy level'|@translate}</strong></td>
+ <td><strong>{'Who can see this photo?'|@translate}</strong></td>
<td>
<select name="level" size="1">
{html_options options=$level_options selected=$level_options_selected}
diff --git a/admin/themes/default/template/site_update.tpl b/admin/themes/default/template/site_update.tpl
index 90a2562cf..b13c1ffc8 100644
--- a/admin/themes/default/template/site_update.tpl
+++ b/admin/themes/default/template/site_update.tpl
@@ -69,7 +69,7 @@
<ul style="padding-left:3em">
<li><label><input type="checkbox" name="display_info" value="1" {if $introduction.display_info}checked="checked"{/if}> {'display maximum informations (added categories and elements, deleted categories and elements)'|@translate}</label></li>
<li><label><input type="checkbox" name="add_to_caddie" value="1" {if $introduction.add_to_caddie}checked="checked"{/if}> {'add new elements to caddie'|@translate}</label></li>
- <li><label>{'Minimum privacy level'|@translate} <select name="privacy_level">{html_options options=$introduction.privacy_level_options selected=$introduction.privacy_level_selected}</select></label></li>
+ <li><label>{'Who can see these photos?'|@translate} <select name="privacy_level">{html_options options=$introduction.privacy_level_options selected=$introduction.privacy_level_selected}</select></label></li>
</ul>
</li>
</ul>