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

Last change on this file since 2272 was 2272, checked in by patdenice, 16 years ago

Corrections in plugins management.
Add "Last revisions" sort order.

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