aboutsummaryrefslogtreecommitdiffstats
path: root/admin/element_set_global.php
diff options
context:
space:
mode:
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']) ),
+ )
+ );
+ }
}
}