source: trunk/include/menubar.inc.php @ 2362

Last change on this file since 2362 was 2325, checked in by rub, 16 years ago

Resolved issue 0000823: Enhance upload functionalities

First commit, others will be follow.
Not hesitate to change my translations.

Add upload configuration tabsheet (move and add configuration)
Change and add define for access level
Can show upload link every time
Can restrict access upload.class.php
Can choice category on upload page
Add upload class not use for the moment
Review quickly and temporary style of upload.tpl

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 8.1 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | Piwigo - a PHP based picture gallery                                  |
4// +-----------------------------------------------------------------------+
5// | Copyright(C) 2008      Piwigo Team                  http://piwigo.org |
6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
8// +-----------------------------------------------------------------------+
9// | This program is free software; you can redistribute it and/or modify  |
10// | it under the terms of the GNU General Public License as published by  |
11// | the Free Software Foundation                                          |
12// |                                                                       |
13// | This program is distributed in the hope that it will be useful, but   |
14// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
15// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
16// | General Public License for more details.                              |
17// |                                                                       |
18// | You should have received a copy of the GNU General Public License     |
19// | along with this program; if not, write to the Free Software           |
20// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
21// | USA.                                                                  |
22// +-----------------------------------------------------------------------+
23
24/**
25 * This file is included by the main page to show the menu bar
26 *
27 */
28$template->set_filenames(
29  array(
30    'menubar' => 'menubar.tpl',
31    )
32  );
33
34trigger_action('loc_begin_menubar');
35
36$template->assign(
37  array(
38    'NB_PICTURE' => $user['nb_total_images'],
39    'MENU_CATEGORIES_CONTENT' => get_categories_menu(),
40    'U_CATEGORIES' => make_index_url(array('section' => 'categories')),
41    'U_LOST_PASSWORD' => get_root_url().'password.php',
42    'U_UPLOAD' => get_upload_menu_link()
43    )
44  );
45
46//-------------------------------------------------------------- external links
47foreach ($conf['links'] as $url => $url_data)
48{
49  if (!is_array($url_data))
50  {
51    $url_data = array('label' => $url_data);
52  }
53
54  if
55    (
56      (!isset($url_data['eval_visible']))
57      or
58      (eval($url_data['eval_visible']))
59    )
60  {
61    $tpl_var = array(
62        'URL' => $url,
63        'LABEL' => $url_data['label']
64      );
65
66    if (!isset($url_data['new_window']) or $url_data['new_window'])
67    {
68      $tpl_var['new_window'] =
69        array(
70          'NAME' => (isset($url_data['nw_name']) ? $url_data['nw_name'] : ''),
71          'FEATURES' => (isset($url_data['nw_features']) ? $url_data['nw_features'] : '')
72        );
73    }
74    $template->append('links', $tpl_var);
75  }
76}
77
78//------------------------------------------------------------------------ filter
79if (!empty($conf['filter_pages']) and get_filter_page_value('used'))
80{
81  if ($filter['enabled'])
82  {
83    $template->assign(
84      'U_STOP_FILTER',
85      add_url_params(make_index_url(array()), array('filter' => 'stop'))
86      );
87  }
88  else
89  {
90    $template->assign(
91      'U_START_FILTER',
92      add_url_params(make_index_url(array()), array('filter' => 'start-recent-'.$user['recent_period']))
93      );
94  }
95}
96
97//------------------------------------------------------------------------ tags
98if ('tags' == @$page['section'])
99{
100  // display tags associated to currently tagged items, less current tags
101  $tags = array();
102  if ( !empty($page['items']) )
103  {
104    $tags = get_common_tags($page['items'],
105        $conf['menubar_tag_cloud_items_number'], $page['tag_ids']);
106  }
107
108  $tags = add_level_to_tags($tags);
109
110  foreach ($tags as $tag)
111  {
112    $template->append(
113      'related_tags',
114      array(
115        'U_TAG' => make_index_url(
116          array(
117            'tags' => array($tag)
118            )
119          ),
120
121        'NAME' => $tag['name'],
122
123        'CLASS' => 'tagLevel'.$tag['level'],
124
125        'add' => array(
126
127            'URL' => make_index_url(
128              array(
129                'tags' => array_merge(
130                  $page['tags'],
131                  array($tag)
132                  )
133                )
134              ),
135            'COUNTER' => $tag['counter'],
136            )
137        )
138      );
139  }
140}
141//---------------------------------------------------------- special categories
142// favorites categories
143if ( !is_a_guest() )
144{
145  $template->append(
146    'special_categories',
147    array(
148      'URL' => make_index_url(array('section' => 'favorites')),
149      'TITLE' => l10n('favorite_cat_hint'),
150      'NAME' => l10n('favorite_cat')
151      ));
152}
153// most visited
154$template->append(
155  'special_categories',
156  array(
157    'URL' => make_index_url(array('section' => 'most_visited')),
158    'TITLE' => l10n('most_visited_cat_hint'),
159    'NAME' => l10n('most_visited_cat')
160    ));
161// best rated
162if ($conf['rate'])
163{
164  $template->append(
165    'special_categories',
166    array(
167      'URL' => make_index_url(array('section' => 'best_rated')),
168      'TITLE' => l10n('best_rated_cat_hint'),
169      'NAME' => l10n('best_rated_cat')
170      )
171    );
172}
173// random
174$template->append(
175  'special_categories',
176  array(
177    'URL' => get_root_url().'random.php',
178    'TITLE' => l10n('random_cat_hint'),
179    'NAME' => l10n('random_cat'),
180    'REL'=> 'rel="nofollow"'
181    ));
182
183// recent pics
184$template->append(
185  'special_categories',
186  array(
187    'URL' => make_index_url(array('section' => 'recent_pics')),
188    'TITLE' => l10n('recent_pics_cat_hint'),
189    'NAME' => l10n('recent_pics_cat'),
190    ));
191// recent cats
192$template->append(
193  'special_categories',
194  array(
195    'URL' => make_index_url(array('section' => 'recent_cats')),
196    'TITLE' => l10n('recent_cats_cat_hint'),
197    'NAME' => l10n('recent_cats_cat'),
198    ));
199
200// calendar
201$template->append(
202  'special_categories',
203  array(
204    'URL' =>
205      make_index_url(
206        array(
207          'chronology_field' => ($conf['calendar_datefield']=='date_available'
208                                  ? 'posted' : 'created'),
209           'chronology_style'=> 'monthly',
210           'chronology_view' => 'calendar'
211        )
212      ),
213    'TITLE' => l10n('calendar_hint'),
214    'NAME' => l10n('calendar'),
215    'REL'=> 'rel="nofollow"'
216    )
217  );
218//--------------------------------------------------------------------- summary
219
220if (is_a_guest())
221{
222  $template->assign(
223      array(
224        'U_IDENTIFY' => get_root_url().'identification.php',
225        'AUTHORIZE_REMEMBERING' => $conf['authorize_remembering']
226      )
227    );
228
229  if ($conf['allow_user_registration'])
230  {
231    $template->assign( 'U_REGISTER', get_root_url().'register.php');
232  }
233}
234else
235{
236  $template->assign('USERNAME', $user['username']);
237
238  if (is_autorize_status(ACCESS_CLASSIC))
239  {
240    $template->assign('U_PROFILE', get_root_url().'profile.php');
241  }
242
243  // the logout link has no meaning with Apache authentication : it is not
244  // possible to logout with this kind of authentication.
245  if (!$conf['apache_authentication'])
246  {
247    $template->assign('U_LOGOUT', get_root_url().'?act=logout');
248  }
249
250  if (is_admin())
251  {
252    $template->assign('U_ADMIN', get_root_url().'admin.php');
253  }
254}
255
256// tags link
257$template->append(
258  'summaries',
259  array(
260    'TITLE' => l10n('See available tags'),
261    'NAME' => l10n('Tags'),
262    'U_SUMMARY'=> get_root_url().'tags.php',
263    )
264  );
265
266// search link
267$template->append(
268  'summaries',
269  array(
270    'TITLE'=>l10n('hint_search'),
271    'NAME'=>l10n('Search'),
272    'U_SUMMARY'=> get_root_url().'search.php',
273    'REL'=> 'rel="search"'
274    )
275  );
276
277// comments link
278$template->append(
279  'summaries',
280  array(
281    'TITLE'=>l10n('hint_comments'),
282    'NAME'=>l10n('comments'),
283    'U_SUMMARY'=> get_root_url().'comments.php',
284    )
285  );
286
287// about link
288$template->append(
289  'summaries',
290  array(
291    'TITLE'     => l10n('about_page_title'),
292    'NAME'      => l10n('About'),
293    'U_SUMMARY' => get_root_url().'about.php',
294    )
295  );
296
297// notification
298$template->append(
299  'summaries',
300  array(
301    'TITLE'=>l10n('RSS feed'),
302    'NAME'=>l10n('Notification'),
303    'U_SUMMARY'=> get_root_url().'notification.php',
304    'REL'=> 'rel="nofollow"'
305    )
306  );
307
308trigger_action('loc_end_menubar');
309$template->assign_var_from_handle('MENUBAR', 'menubar');
310
311?>
Note: See TracBrowser for help on using the repository browser.