diff options
author | rub <rub@piwigo.org> | 2007-01-09 06:01:49 +0000 |
---|---|---|
committer | rub <rub@piwigo.org> | 2007-01-09 06:01:49 +0000 |
commit | c841c568f6d6f098fc097b7d8ee06c8602aa03d4 (patch) | |
tree | 1831e747741ffc360305c99462a8236c1590f92c | |
parent | 1e7b286faaf29ae55b60a0bd28b8f5ce74ab6654 (diff) |
Feature Issue ID 0000496: Integrate MOD add_index on PWG with plugin.lang.php
Change name of news triggers.
Replace & by &
Improve a little add_index plugin implementation.
Add parameters pages (under construction) for add_index plugin
git-svn-id: http://piwigo.org/svn/trunk@1704 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | admin/advanced_feature.php | 6 | ||||
-rw-r--r-- | admin/site_manager.php | 2 | ||||
-rw-r--r-- | plugins/add_index/admin/admin_menu.php | 76 | ||||
-rw-r--r-- | plugins/add_index/admin/admin_menu.tpl | 29 | ||||
-rw-r--r-- | plugins/add_index/admin/main_page.php | 39 | ||||
-rw-r--r-- | plugins/add_index/language/en_UK.iso-8859-1/help/advanced_feature.html | 2 | ||||
-rw-r--r-- | plugins/add_index/language/en_UK.iso-8859-1/help/site_manager.html | 2 | ||||
-rw-r--r-- | plugins/add_index/language/en_UK.iso-8859-1/plugin.lang.php | 10 | ||||
-rw-r--r-- | plugins/add_index/language/fr_FR.iso-8859-1/plugin.lang.php | 9 | ||||
-rw-r--r-- | plugins/add_index/main.admin.inc.php | 47 | ||||
-rw-r--r-- | plugins/add_index/main.base.inc.php | 44 | ||||
-rw-r--r-- | plugins/add_index/main.inc.php | 36 | ||||
-rw-r--r-- | plugins/add_index/main.normal.inc.php | 65 | ||||
-rw-r--r-- | plugins/add_index/maintain.inc.php | 38 |
14 files changed, 336 insertions, 69 deletions
diff --git a/admin/advanced_feature.php b/admin/advanced_feature.php index f8991ff07..b1614b488 100644 --- a/admin/advanced_feature.php +++ b/admin/advanced_feature.php @@ -71,19 +71,19 @@ array_push($advanced_features, array
(
'CAPTION' => l10n('Elements_not_linked'),
- 'URL' => get_root_url().'admin.php?page=element_set&cat=not_linked'
+ 'URL' => get_root_url().'admin.php?page=element_set&cat=not_linked'
));
array_push($advanced_features,
array
(
'CAPTION' => l10n('Duplicates'),
- 'URL' => get_root_url().'admin.php?page=element_set&cat=duplicates'
+ 'URL' => get_root_url().'admin.php?page=element_set&cat=duplicates'
));
//$advanced_features is array of array composed of CAPTION & URL
$advanced_features =
- trigger_event('array_advanced_features', $advanced_features);
+ trigger_event('get_admin_advanced_features_links', $advanced_features);
// +-----------------------------------------------------------------------+
// | Template init |
diff --git a/admin/site_manager.php b/admin/site_manager.php index 53330d7f9..375f92349 100644 --- a/admin/site_manager.php +++ b/admin/site_manager.php @@ -297,7 +297,7 @@ while ($row = mysql_fetch_array($result)) $plugin_links = array(); //$plugin_links is array of array composed of U_HREF, U_HINT & U_CAPTION $plugin_links = - trigger_event('array_site_manager_plugin_links', + trigger_event('get_admins_site_links', $plugin_links, $row['id'], $is_remote); // plugin_links diff --git a/plugins/add_index/admin/admin_menu.php b/plugins/add_index/admin/admin_menu.php new file mode 100644 index 000000000..2ab250119 --- /dev/null +++ b/plugins/add_index/admin/admin_menu.php @@ -0,0 +1,76 @@ +<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// | Copyright (C) 2007 Ruben ARNAUD - team@phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | branch : BSF (Best So Far)
+// | file : $RCSfile$
+// | last update : $Date: 2006-07-18 23:38:54 +0200 (mar., 18 juil. 2006) $
+// | last modifier : $Author: rub $
+// | revision : $Revision: 1481 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+if ((!defined('PHPWG_ROOT_PATH')) or (!(defined('IN_ADMIN') and IN_ADMIN)))
+{
+ die('Hacking attempt!');
+}
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+// +-----------------------------------------------------------------------+
+// | Main |
+// +-----------------------------------------------------------------------+
+global $template, $conf;
+
+// +-----------------------------------------------------------------------+
+// | template initialization |
+// +-----------------------------------------------------------------------+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/admin_menu.tpl'));
+
+/*
+if ( isset($_POST['eventTracer_filters']) )
+{
+ $v = $_POST['eventTracer_filters'];
+ $v = str_replace( "\r\n", "\n", $v );
+ $v = str_replace( "\n\n", "\n", $v );
+ $v = stripslashes($v);
+ if (!empty($v))
+ $this->my_config['filters'] = explode("\n", $v);
+ else
+ $this->my_config['filters'] = array();
+ $this->my_config['show_args'] = isset($_POST['eventTracer_show_args']);
+ $this->save_config();
+ global $page;
+ array_push($page['infos'], 'event tracer options saved');
+}
+$template->assign_var('EVENT_TRACER_FILTERS', implode("\n", $this->my_config['filters'] ) );
+$template->assign_var('EVENT_TRACER_SHOW_ARGS', $this->my_config['show_args'] ? 'checked="checked"' : '' );*/
+$template->assign_var('filename', $conf['add_index_filename']);
+$template->assign_var('source_directory_path', $conf['add_index_source_directory_path']);
+$template->assign_var('F_ACTION', $my_url);
+
+// +-----------------------------------------------------------------------+
+// | Sending html code |
+// +-----------------------------------------------------------------------+
+$template->assign_var_from_handle('PLUGIN_ADMIN_CONTENT', 'plugin_admin_content');
+
+?>
\ No newline at end of file diff --git a/plugins/add_index/admin/admin_menu.tpl b/plugins/add_index/admin/admin_menu.tpl new file mode 100644 index 000000000..b365e312f --- /dev/null +++ b/plugins/add_index/admin/admin_menu.tpl @@ -0,0 +1,29 @@ +<!-- $Id: admin_menu.tpl Ruben ARNAUD -->
+<p>{lang:add_index_Description_1}</p>
+<p>{lang:add_index_Description_2}</p>
+
+<form method="post" name="admin_menu" id="admin_menu" action="{F_ACTION}">
+ <fieldset>
+ <legend>{lang:add_index_Parameters}</legend>
+ <table>
+ <tr>
+ <td>
+ <label for="filename">{lang:add_index_filename}</label>
+ </td>
+ <td><input type="text" maxlength="35" size="35" name="add_index_filename" id="filename" value="{filename}"/></td>
+ </tr>
+ <tr>
+ <td>
+ <label for="source_directory_path">{lang:add_index_source_directory_path}</label>
+ </td>
+ <td><input type="text" maxlength="35" size="35" name="add_index_source_directory_path" id="source_directory_path" value="{source_directory_path}"/></td>
+ </tr>
+ </table>
+ </fieldset>
+
+ <p>
+ <!--<input type="submit" value="{lang:Submit}" name="param_submit" {TAG_INPUT_ENABLED}/>-->
+ <input type="reset" value="{lang:Reset}" name="param_reset"/>
+ </p>
+
+</form>
diff --git a/plugins/add_index/admin/main_page.php b/plugins/add_index/admin/main_page.php index 488e0bb85..a99eefa90 100644 --- a/plugins/add_index/admin/main_page.php +++ b/plugins/add_index/admin/main_page.php @@ -3,7 +3,7 @@ // | PhpWebGallery - a PHP based picture gallery | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | -// | Copyright (C) 2006 Ruben ARNAUD - team@phpwebgallery.net | +// | Copyright (C) 2006-2007 Ruben ARNAUD - team@phpwebgallery.net | // +-----------------------------------------------------------------------+ // | last modifier : $Author: rub $ // | revision : $Revision: 1.0.2.0 $ @@ -23,30 +23,14 @@ // | USA. | // +-----------------------------------------------------------------------+ -// +-----------------------------------------------------------------------+
-// | Here before to modify by user |
-// +-----------------------------------------------------------------------+
-// Name of index file (index.php or index.htm or index.html)
-if (!isset($conf['index']['file_name']))
-{
- $conf['index']['file_name'] = 'index.php';
-}
-// Name of index file (index.php or index.htm or index.html)
-if (!isset($conf['index']['source_directory_name']))
+if ((!defined('PHPWG_ROOT_PATH')) or (!(defined('IN_ADMIN') and IN_ADMIN)))
{
- // Name of the directoty use in order to copy index file
- $conf['index']['source_directory_name'] = 'include/index.php';
+ die('Hacking attempt!');
}
-// +-----------------------------------------------------------------------+ -// | include | -// +-----------------------------------------------------------------------+ - -if (!defined('PHPWG_ROOT_PATH')) -{ - die ("Hacking attempt!"); -} - +// +-----------------------------------------------------------------------+
+// | include |
+// +-----------------------------------------------------------------------+
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); @@ -100,13 +84,15 @@ function get_add_index_directories($path, $recursive = true) // +-----------------------------------------------------------------------+ // | Main | -// +-----------------------------------------------------------------------+ -$index_file_src=PHPWG_ROOT_PATH.$conf['index']['source_directory_name']; +// +-----------------------------------------------------------------------+
+// Compute values
+$index_file_src=$conf['add_index_source_directory_path'].$conf['add_index_filename']; $overwrite_file=isset($_GET['overwrite']); $site_id = (isset($_GET['site_id']) and is_numeric($_GET['site_id']) ? $_GET['site_id'] : 0); +// Init values
$add_index_results = array(); $count_copy = 0; $count_skip = 0; @@ -140,7 +126,7 @@ order by //echo $galleries_url.'<BR>'; foreach (get_add_index_directories($galleries_url) as $dir_galleries) { - $file_dest = $dir_galleries.'/'.$conf['index']['file_name']; + $file_dest = $dir_galleries.'/'.$conf['add_index_filename']; if ($overwrite_file or !@file_exists($file_dest)) { if (copy($index_file_src, $file_dest)) @@ -174,7 +160,8 @@ order by } } - if ($count_copy != 0) + // Show always an result, defaut (0 copy, $count_copy == $count_skip == 0) + if (($count_copy != 0) or ($count_skip == 0)) { array_push($add_index_results, l10n_dec('add_index_nb_copied_file', 'add_index_nb_copied_files', diff --git a/plugins/add_index/language/en_UK.iso-8859-1/help/advanced_feature.html b/plugins/add_index/language/en_UK.iso-8859-1/help/advanced_feature.html index 46eae4b61..5724d5d1b 100644 --- a/plugins/add_index/language/en_UK.iso-8859-1/help/advanced_feature.html +++ b/plugins/add_index/language/en_UK.iso-8859-1/help/advanced_feature.html @@ -2,6 +2,6 @@ <ul>
<li>
<strong>Add and overwrite "index" files for all local sites:</strong>
- Overwrite copy the file ./include/index.php in all sub-directories of gallerie local sites.
+ Overwrite copy the file ./include/index.php to all sub-directories of gallerie local sites.
</li>
<ul>
diff --git a/plugins/add_index/language/en_UK.iso-8859-1/help/site_manager.html b/plugins/add_index/language/en_UK.iso-8859-1/help/site_manager.html index 7bd92283a..3ea24ac6b 100644 --- a/plugins/add_index/language/en_UK.iso-8859-1/help/site_manager.html +++ b/plugins/add_index/language/en_UK.iso-8859-1/help/site_manager.html @@ -2,6 +2,6 @@ <ul>
<li>
<strong>Add "index" files for local site:</strong>
- Copy the file ./include/index.php in all sub-directories of selected local site.
+ Copy the file ./include/index.php to all sub-directories of selected local site.
</li>
<ul>
diff --git a/plugins/add_index/language/en_UK.iso-8859-1/plugin.lang.php b/plugins/add_index/language/en_UK.iso-8859-1/plugin.lang.php index b7e68ced1..c76bbc24c 100644 --- a/plugins/add_index/language/en_UK.iso-8859-1/plugin.lang.php +++ b/plugins/add_index/language/en_UK.iso-8859-1/plugin.lang.php @@ -3,7 +3,7 @@ // | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
-// | Copyright (C) 2006-2007 Ruben ARNAUD - team@phpwebgallery.net |
+// | Copyright (C) 2007 Ruben ARNAUD - team@phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | branch : BSF (Best So Far)
// | file : $RCSfile$
@@ -29,6 +29,7 @@ $lang['Add_Index'] = 'Add "index" files';
$lang['Advanced_Add_Index'] = 'Add and overwrite "index" files for all local sites';
$lang['Manager_Add_Index'] = 'add "index"';
+$lang['Menu_Add_Index'] = 'Add "index"';
$lang['add_index_file_copied'] = '%s copied';
$lang['add_index_file_not_copied'] = '%s not copied';
@@ -41,4 +42,11 @@ $lang['add_index_nb_not_copied_file'] = '%d file not copied'; $lang['add_index_nb_not_copied_files'] = '%d files not copied';
$lang['add_index_src_file_dont_exists'] = 'Source file %s don\'t esists, cannot duplicate this file';
+$lang['add_index_Description_1'] = 'Add "index" files allows to copy "index" file from source directory to all sub-directories of gallerie local sites.';
+$lang['add_index_Description_2'] = '"index" file prevents to list contents of a directory.';
+$lang['add_index_Parameters'] = 'Parameters';
+$lang['add_index_filename'] = 'File name';
+$lang['add_index_source_directory_path'] = 'Path of source directory';
+
+
?>
diff --git a/plugins/add_index/language/fr_FR.iso-8859-1/plugin.lang.php b/plugins/add_index/language/fr_FR.iso-8859-1/plugin.lang.php index 1e64654aa..579a56aa3 100644 --- a/plugins/add_index/language/fr_FR.iso-8859-1/plugin.lang.php +++ b/plugins/add_index/language/fr_FR.iso-8859-1/plugin.lang.php @@ -3,7 +3,7 @@ // | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
-// | Copyright (C) 2006-2007 Ruben ARNAUD - team@phpwebgallery.net |
+// | Copyright (C) 2007 Ruben ARNAUD - team@phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | branch : BSF (Best So Far)
// | file : $RCSfile$
@@ -29,6 +29,7 @@ $lang['Add_Index'] = 'Ajout des fichiers "index"';
$lang['Advanced_Add_Index'] = 'Ajout et écrasement des fichiers "index" pour tous les sites locaux';
$lang['Manager_Add_Index'] = 'ajout des "index"';
+$lang['Menu_Add_Index'] = 'Add "index"';
$lang['add_index_file_copied'] = '%s copié';
$lang['add_index_file_not_copied'] = '%s non copié';
@@ -41,4 +42,10 @@ $lang['add_index_nb_not_copied_file'] = '%d fichier non copié'; $lang['add_index_nb_not_copied_files'] = '%d fichiers non copiés';
$lang['add_index_src_file_dont_exists'] = 'Le fichier source n\'existe pas, la duplication de ce fichier n\'est pas possible';
+$lang['add_index_Description_1'] = 'L\'ajout des fichiers " permet de copier le fichier "index" du repertoire source vers tous les sous-répertoires des galeries des sites locaux.';
+$lang['add_index_Description_2'] = 'Le fichier "index" empêche de lister le contenu d\'un répertoire.';
+$lang['add_index_Parameters'] = 'Paramètres';
+$lang['add_index_filename'] = 'Nom du fichier';
+$lang['add_index_source_directory_path'] = 'Chemin du répertoire source';
+
?>
diff --git a/plugins/add_index/main.admin.inc.php b/plugins/add_index/main.admin.inc.php index cf55c6edf..24cfa1dc5 100644 --- a/plugins/add_index/main.admin.inc.php +++ b/plugins/add_index/main.admin.inc.php @@ -3,7 +3,7 @@ // | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
-// | Copyright (C) 2006-2007 Ruben ARNAUD - team@phpwebgallery.net |
+// | Copyright (C) 2007 Ruben ARNAUD - team@phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | branch : BSF (Best So Far)
// | file : $RCSfile$
@@ -33,6 +33,22 @@ if ((!defined('PHPWG_ROOT_PATH')) or (!(defined('IN_ADMIN') and IN_ADMIN))) class AdminAddIndex extends AddIndex
{
+ function load_params()
+ {
+ global $conf;
+ // Name of index file (index.php or index.htm or index.html)
+ if (!isset($conf['add_index_filename']))
+ {
+ $conf['add_index_filename'] = 'index.php';
+ }
+ // Name of index file (index.php or index.htm or index.html)
+ if (!isset($conf['add_index_source_directory_path']))
+ {
+ // Name of the directoty use in order to copy index file
+ $conf['add_index_source_directory_path'] = PHPWG_ROOT_PATH.'include/';
+ }
+ }
+
function loading_lang()
{
global $lang;
@@ -40,26 +56,26 @@ class AdminAddIndex extends AddIndex include(get_language_filepath('plugin.lang.php', $this->path));
}
- function array_advanced_features($advanced_features)
+ function get_admin_advanced_features_links($advanced_features)
{
array_push($advanced_features,
array
(
'CAPTION' => l10n('Advanced_Add_Index'),
- 'URL' => get_root_url().'admin.php?page=main_page&page_type=plugin&plugin_id=add_index&overwrite'
+ 'URL' => get_root_url().'admin.php?page=main_page&page_type=plugin&plugin_id=add_index&overwrite'
));
return $advanced_features;
}
- function array_site_manager_plugin_links($site_manager_plugin_links, $site_id, $is_remote)
+ function get_admins_site_links($site_manager_plugin_links, $site_id, $is_remote)
{
if (!$is_remote)
{
array_push($site_manager_plugin_links,
array
(
- 'U_HREF' => get_root_url().'admin.php?page=main_page&page_type=plugin&plugin_id=add_index&site_id='.$site_id,
+ 'U_HREF' => get_root_url().'admin.php?page=main_page&page_type=plugin&plugin_id=add_index&site_id='.$site_id,
'U_CAPTION' => l10n('Manager_Add_Index'),
'U_HINT' => l10n('Add_Index')
));
@@ -67,12 +83,29 @@ class AdminAddIndex extends AddIndex return $site_manager_plugin_links;
}
+
+ function plugin_admin_menu()
+ {
+ add_plugin_admin_menu(l10n('Menu_Add_Index'), array(&$this, 'do_plugin_admin_menu'));
+ }
+
+ function do_plugin_admin_menu($my_url)
+ {
+ include_once(dirname(__FILE__).'/admin/'.'admin_menu.php');
+ }
+
}
+// Create object
$add_index = new AdminAddIndex();
+// Load Add Index parameters
+$add_index->load_params();
+
+// Add events
add_event_handler('loading_lang', array(&$add_index, 'loading_lang'));
-add_event_handler('array_advanced_features', array(&$add_index, 'array_advanced_features'));
-add_event_handler('array_site_manager_plugin_links', array(&$add_index, 'array_site_manager_plugin_links'), EVENT_HANDLER_PRIORITY_NEUTRAL, 3);
+add_event_handler('get_admin_advanced_features_links', array(&$add_index, 'get_admin_advanced_features_links'));
+add_event_handler('get_admins_site_links', array(&$add_index, 'get_admins_site_links'), EVENT_HANDLER_PRIORITY_NEUTRAL, 3);
+add_event_handler('plugin_admin_menu', array(&$add_index, 'plugin_admin_menu') );
?>
\ No newline at end of file diff --git a/plugins/add_index/main.base.inc.php b/plugins/add_index/main.base.inc.php new file mode 100644 index 000000000..50f6e898a --- /dev/null +++ b/plugins/add_index/main.base.inc.php @@ -0,0 +1,44 @@ +<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// | Copyright (C) 2007 Ruben ARNAUD - team@phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | branch : BSF (Best So Far)
+// | file : $RCSfile$
+// | last update : $Date: 2006-07-18 23:38:54 +0200 (mar., 18 juil. 2006) $
+// | last modifier : $Author: rub $
+// | revision : $Revision: 1481 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+ die('Hacking attempt!');
+}
+
+class AddIndex
+{
+ var $path;
+
+ function AddIndex()
+ {
+ $this->path = dirname(__FILE__).'/';
+ }
+}
+
+?>
\ No newline at end of file diff --git a/plugins/add_index/main.inc.php b/plugins/add_index/main.inc.php index cf334be63..1f6346486 100644 --- a/plugins/add_index/main.inc.php +++ b/plugins/add_index/main.inc.php @@ -9,7 +9,7 @@ Plugin URI: http://www.phpwebgallery.net // | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
-// | Copyright (C) 2006-2007 Ruben ARNAUD - team@phpwebgallery.net |
+// | Copyright (C) 2007 Ruben ARNAUD - team@phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | branch : BSF (Best So Far)
// | file : $RCSfile$
@@ -37,38 +37,18 @@ if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
}
-class AddIndex
+if (in_array(script_basename(), array('popuphelp', 'admin')))
{
- var $path;
-
- function AddIndex()
+ if (defined('IN_ADMIN') and IN_ADMIN)
{
- $this->path = dirname(__FILE__).'/';
+ include_once(dirname(__FILE__).'/'.'main.base.inc.php');
+ include_once(dirname(__FILE__).'/'.'main.admin.inc.php');
}
-
- function get_popup_help_content($popup_help_content, $page)
+ else
{
- $help_content =
- @file_get_contents(get_language_filepath('help/'.$page.'.html', $this->path));
- if ($help_content == false)
- {
- return $popup_help_content;
- }
- else
- {
- return $popup_help_content.$help_content;
- }
+ include_once(dirname(__FILE__).'/'.'main.base.inc.php');
+ include_once(dirname(__FILE__).'/'.'main.normal.inc.php');
}
}
-if (defined('IN_ADMIN') and IN_ADMIN)
-{
- include_once(dirname(__FILE__).'/'.'main.admin.inc.php');
-}
-else
-{
- $add_index = new AddIndex();
- add_event_handler('get_popup_help_content', array(&$add_index, 'get_popup_help_content'), EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
-}
-
?>
\ No newline at end of file diff --git a/plugins/add_index/main.normal.inc.php b/plugins/add_index/main.normal.inc.php new file mode 100644 index 000000000..f412a4b1f --- /dev/null +++ b/plugins/add_index/main.normal.inc.php @@ -0,0 +1,65 @@ +<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// | Copyright (C) 2007 Ruben ARNAUD - team@phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | branch : BSF (Best So Far)
+// | file : $RCSfile$
+// | last update : $Date: 2006-07-18 23:38:54 +0200 (mar., 18 juil. 2006) $
+// | last modifier : $Author: rub $
+// | revision : $Revision: 1481 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+ die('Hacking attempt!');
+}
+
+class NormalAddIndex extends AddIndex
+{
+ function get_popup_help_content($popup_help_content, $page)
+ {
+ if (in_array($page, array('advanced_feature', 'site_manager')))
+ {
+ $help_content =
+ @file_get_contents(get_language_filepath('help/'.$page.'.html', $this->path));
+ }
+ else
+ {
+ $help_content = false;
+ }
+
+ if ($help_content == false)
+ {
+ return $popup_help_content;
+ }
+ else
+ {
+ return $popup_help_content.$help_content;
+ }
+ }
+}
+
+// Create object
+$add_index = new NormalAddIndex();
+
+// Add events
+add_event_handler('get_popup_help_content', array(&$add_index, 'get_popup_help_content'), EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+
+?>
\ No newline at end of file diff --git a/plugins/add_index/maintain.inc.php b/plugins/add_index/maintain.inc.php new file mode 100644 index 000000000..a2b3aa201 --- /dev/null +++ b/plugins/add_index/maintain.inc.php @@ -0,0 +1,38 @@ +<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// | Copyright (C) 2007 Ruben ARNAUD - team@phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | branch : BSF (Best So Far)
+// | file : $RCSfile$
+// | last update : $Date: 2006-07-18 23:38:54 +0200 (mar., 18 juil. 2006) $
+// | last modifier : $Author: rub $
+// | revision : $Revision: 1481 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+function plugin_uninstall($plugin_id)
+(
+ if ($plugin_id == 'add_index')
+ {
+ //$query = 'delete from '.CONFIG_TABLE.' where param in ';
+ //pwg_query($query);
+ }
+)
+
+?>
\ No newline at end of file |