aboutsummaryrefslogtreecommitdiffstats
path: root/admin/element_set_global.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-09-11 02:24:51 +0000
committerrvelices <rv-github@modusoptimus.com>2007-09-11 02:24:51 +0000
commit92f80e5d799aa7fef5f00cbf5c27e32f92c4b2ea (patch)
treecbde0a4b03ea5733bf71ce1db3c8ec993825c38e /admin/element_set_global.php
parent45fde2cc6b34d3acdfd43b487eb4b7dbeede05a8 (diff)
feature 731: permissions at image level
- this is the first version - I wait for feedback before changing help files git-svn-id: http://piwigo.org/svn/trunk@2084 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/element_set_global.php')
-rw-r--r--admin/element_set_global.php33
1 files changed, 29 insertions, 4 deletions
diff --git a/admin/element_set_global.php b/admin/element_set_global.php
index b3f254b10..6cb0aab39 100644
--- a/admin/element_set_global.php
+++ b/admin/element_set_global.php
@@ -136,7 +136,7 @@ DELETE
$datas = array();
$dbfields = array('primary' => array('id'), 'update' => array());
- $formfields = array('author', 'name', 'date_creation');
+ $formfields = array('author', 'name', 'date_creation', 'level');
foreach ($formfields as $formfield)
{
if ($_POST[$formfield.'_action'] != 'leave')
@@ -163,7 +163,6 @@ SELECT id
if ('set' == $_POST['author_action'])
{
$data['author'] = $_POST['author'];
-
if ('' == $data['author'])
{
unset($data['author']);
@@ -173,7 +172,6 @@ SELECT id
if ('set' == $_POST['name_action'])
{
$data['name'] = $_POST['name'];
-
if ('' == $data['name'])
{
unset($data['name']);
@@ -189,6 +187,11 @@ SELECT id
;
}
+ if ('set' == $_POST['level_action'])
+ {
+ $data['level'] = $_POST['level'];
+ }
+
array_push($datas, $data);
}
// echo '<pre>'; print_r($datas); echo '</pre>';
@@ -345,6 +348,18 @@ else
}
$template->assign_vars(array('DATE_CREATION_YEAR_VALUE'=>$year));
+// image level options
+$blockname = 'level_option';
+foreach ($conf['available_permission_levels'] as $level)
+{
+ $template->assign_block_vars(
+ $blockname,
+ array(
+ 'VALUE' => $level,
+ 'CONTENT' => l10n( sprintf('Level %d', $level) ),
+ ));
+}
+
// +-----------------------------------------------------------------------+
// | global mode thumbnails |
// +-----------------------------------------------------------------------+
@@ -377,7 +392,7 @@ if (count($page['cat_elements_id']) > 0)
$template->assign_vars(array('NAV_BAR' => $nav_bar));
$query = '
-SELECT id,path,tn_ext,file,filesize
+SELECT id,path,tn_ext,file,filesize,level
FROM '.IMAGES_TABLE.'
WHERE id IN ('.implode(',', $page['cat_elements_id']).')
'.$conf['order_by'].'
@@ -405,6 +420,16 @@ SELECT id,path,tn_ext,file,filesize
'TITLE' => get_thumbnail_title($row)
)
);
+
+ if ( $row['level']>0 )
+ {
+ $template->assign_block_vars('thumbnails.thumbnail.level',
+ array(
+ 'LEVEL' => $row['level'],
+ 'TITLE' => l10n( sprintf('Level %d', $row['level']) ),
+ )
+ );
+ }
}
}