source: trunk/admin/include/functions_plugins.inc.php @ 2297

Last change on this file since 2297 was 2297, checked in by plg, 16 years ago

Modification: new header on PHP files, PhpWebGallery renamed Piwigo.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 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// | PhpWebGallery - a PHP based picture gallery                           |
25// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
26// +-----------------------------------------------------------------------+
27// | branch        : BSF (Best So Far)
28// | file          : $Id: functions_plugins.inc.php 2297 2008-04-04 22:57:23Z plg $
29// | last update   : $Date: 2008-04-04 22:57:23 +0000 (Fri, 04 Apr 2008) $
30// | last modifier : $Author: plg $
31// | revision      : $Revision: 2297 $
32// +-----------------------------------------------------------------------+
33// | This program is free software; you can redistribute it and/or modify  |
34// | it under the terms of the GNU General Public License as published by  |
35// | the Free Software Foundation                                          |
36// |                                                                       |
37// | This program is distributed in the hope that it will be useful, but   |
38// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
39// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
40// | General Public License for more details.                              |
41// |                                                                       |
42// | You should have received a copy of the GNU General Public License     |
43// | along with this program; if not, write to the Free Software           |
44// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
45// | USA.                                                                  |
46// +-----------------------------------------------------------------------+
47
48/**
49 * Retrieves an url for a plugin page.
50 * @param string file - php script full name
51 */
52function get_admin_plugin_menu_link($file)
53{
54  global $page;
55  $real_file = realpath($file);
56  $url = get_root_url().'admin.php?page=plugin';
57  if (false!==$real_file)
58  {
59    $real_plugin_path = rtrim(realpath(PHPWG_PLUGINS_PATH), '\\/');
60    $file = substr($real_file, strlen($real_plugin_path)+1);
61    $file = str_replace('\\', '/', $file);//Windows
62    $url .= '&amp;section='.urlencode($file);
63  }
64  else if (isset($page['errors']))
65  {
66    array_push($page['errors'], 'PLUGIN ERROR: "'.$file.'" is not a valid file');
67  }
68  return $url;
69}
70
71/**
72 * Set tabsheet for plugins pages.
73 * @param string selected page.
74 */
75function set_plugins_tabsheet($selected)
76{
77  include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
78
79  $link = get_root_url().'admin.php?page=';
80
81  $tabsheet = new tabsheet();
82  $tabsheet->add('plugins_list', l10n('plugins_tab_list'), $link.'plugins_list');
83  $tabsheet->add('plugins_update', l10n('plugins_tab_update'), $link.'plugins_update');
84  $tabsheet->add('plugins_new', l10n('plugins_tab_new'), $link.'plugins_new');
85  $tabsheet->select($selected);
86  $tabsheet->assign();
87}
88?>
Note: See TracBrowser for help on using the repository browser.