aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-08-14 11:55:35 +0000
committerplegall <plg@piwigo.org>2005-08-14 11:55:35 +0000
commitc501facfa5447443be872c56377cb9141c939196 (patch)
tree98398fcb58b01c5e49a470ead3cbd75d86b6a5fa
parent194bf3ca48dc0a8ac5fb6bcd1c777367dfa2dbcc (diff)
- new : ability to set an element as representant of its category directly
from picture.php screen. - improvement : dedicated icon to add elements into caddie. Ths icon is displayed in the category title bar. git-svn-id: http://piwigo.org/svn/trunk@811 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--doc/ChangeLog8
-rw-r--r--picture.php29
-rw-r--r--template/default/category.tpl13
-rw-r--r--template/default/default.css5
-rw-r--r--template/default/picture.tpl9
-rw-r--r--template/default/theme/caddie_add.pngbin0 -> 1185 bytes
-rw-r--r--template/default/theme/representative.pngbin0 -> 592 bytes
7 files changed, 59 insertions, 5 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index b1fcdc06c..eea7a2d71 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,5 +1,13 @@
2005-08-14 Pierrick LE GALL
+ * new : ability to set an element as representant of its category
+ directly from picture.php screen.
+
+ * improvement : dedicated icon to add elements into caddie. Ths
+ icon is displayed in the category title bar.
+
+2005-08-14 Pierrick LE GALL
+
* new : maintenance screen in administration. There you can update
categories informations (number of images, date of the last added
element), update images informations (path, average rate), purge
diff --git a/picture.php b/picture.php
index 479fcf63d..b05414cf5 100644
--- a/picture.php
+++ b/picture.php
@@ -74,6 +74,22 @@ if (!$belongs)
echo $lang['thumbnails'].'</a></div>';
exit();
}
+//-------------------------------------------------------------- representative
+if ('admin' == $user['status'] and isset($_GET['representative']))
+{
+ $query = '
+UPDATE '.CATEGORIES_TABLE.'
+ SET representative_picture_id = '.$_GET['image_id'].'
+ WHERE id = '.$page['cat'].'
+;';
+ pwg_query($query);
+
+ $url =
+ PHPWG_ROOT_PATH
+ .'picture.php'
+ .get_query_string_diff(array('representative'));
+ redirect($url);
+}
//---------------------------------------------------------- related categories
$query = '
SELECT category_id,uppercats,commentable,global_rank
@@ -620,6 +636,19 @@ if (isset($picture['current']['high']))
'HEIGHT_IMG'=>($full_height + 16)
));
}
+// button to set the current picture as representative
+if ('admin' == $user['status'] and is_numeric($page['cat']))
+{
+ $template->assign_block_vars(
+ 'representative',
+ array(
+ 'URL' =>
+ PHPWG_ROOT_PATH.'picture.php'
+ .get_query_string_diff(array())
+ .'&amp;representative=1'
+ )
+ );
+}
//------------------------------------------------------- favorite manipulation
if ( !$user['is_the_guest'] )
{
diff --git a/template/default/category.tpl b/template/default/category.tpl
index 437652138..0d523c129 100644
--- a/template/default/category.tpl
+++ b/template/default/category.tpl
@@ -88,7 +88,14 @@
</td>
<td style="padding:0px 10px 0px 10px; width:99%;" valign="top">
<div class="home">
- <div class="titrePage">{TITLE}</div>
+ <div class="titrePage">
+ <ul class="categoryActions">
+ <!-- BEGIN caddie -->
+ <li><a href="{U_CADDIE}" title="{lang:add to caddie}"><img src="./template/default/theme/caddie_add.png" /></a></li>
+ <!-- END caddie -->
+ </ul>
+ {TITLE}
+ </div>
<!-- BEGIN calendar -->
<div class="navigationBar">{calendar.YEARS_NAV_BAR}</div>
<div class="navigationBar">{calendar.MONTHS_NAV_BAR}</div>
@@ -123,10 +130,6 @@
<!-- END line -->
</table>
<!-- END thumbnails -->
- <!-- BEGIN caddie -->
- <br />
- <div class="navigationBar"><a href="{U_CADDIE}">add to caddie</a></div>
- <!-- END caddie -->
<!-- BEGIN cat_infos -->
<!-- BEGIN navigation -->
<div class="navigationBar">{cat_infos.navigation.NAV_BAR}</div>
diff --git a/template/default/default.css b/template/default/default.css
index 5091b7431..d326f45ff 100644
--- a/template/default/default.css
+++ b/template/default/default.css
@@ -414,6 +414,11 @@ form#categoryOrdering ul.categoryActions {
margin-top: 5px;
}
+div.titrePage ul.categoryActions {
+ float: right;
+ margin: 0;
+}
+
div#adminMain>ul.categoryActions {
text-align: center;
}
diff --git a/template/default/picture.tpl b/template/default/picture.tpl
index 2633113d8..e43fe7b14 100644
--- a/template/default/picture.tpl
+++ b/template/default/picture.tpl
@@ -28,6 +28,15 @@
<img src="template/default/theme/metadata.gif" alt="{L_PICTURE_METADATA}" />
</a>
</div>
+
+<!-- BEGIN representative -->
+<div class="imgMenu" id="left">
+ <a href="{representative.URL}" title="{lang:set as category representative}">
+ <img src="template/default/theme/representative.png" alt="{lang:representative}" />
+ </a>
+</div>
+<!-- END representative -->
+
<!-- BEGIN favorite -->
<div class="imgMenu" id="right">
<a href="{favorite.U_FAVORITE}" title="{favorite.FAVORITE_HINT}">
diff --git a/template/default/theme/caddie_add.png b/template/default/theme/caddie_add.png
new file mode 100644
index 000000000..425109697
--- /dev/null
+++ b/template/default/theme/caddie_add.png
Binary files differ
diff --git a/template/default/theme/representative.png b/template/default/theme/representative.png
new file mode 100644
index 000000000..ea8a07233
--- /dev/null
+++ b/template/default/theme/representative.png
Binary files differ