aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-01-08 00:16:10 +0000
committerrub <rub@piwigo.org>2007-01-08 00:16:10 +0000
commit4489066c982c1044028295164ec2f2e840c16881 (patch)
tree9dbe71687d9ac6743b7137b45c943d15eb28e045
parentf992150313a63d30aeda6e5f3dcd64fc62a06adb (diff)
Feature Issue ID 0000496: Integrate MOD add_index on PWG with plugin.lang.php
Add some plugin triggers: o for help o for language o for site manager o for advanced features Allow to launch directly plugin page (without section key) Add add_index plugin, available on site manager and advanced features Configuration page and best help must be coming soon. git-svn-id: http://piwigo.org/svn/trunk@1699 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin.php81
-rw-r--r--admin/advanced_feature.php63
-rw-r--r--admin/include/functions_notification_by_mail.inc.php3
-rw-r--r--admin/plugins.php10
-rw-r--r--admin/site_manager.php18
-rw-r--r--include/common.inc.php1
-rw-r--r--include/functions.inc.php1
-rw-r--r--include/functions_plugins.inc.php2
-rw-r--r--include/functions_user.inc.php15
-rw-r--r--language/en_UK.iso-8859-1/help/advanced_feature.html2
-rw-r--r--language/en_UK.iso-8859-1/help/site_manager.html (renamed from language/en_UK.iso-8859-1/help/remote_site.html)0
-rw-r--r--language/fr_FR.iso-8859-1/help/advanced_feature.html6
-rw-r--r--language/fr_FR.iso-8859-1/help/site_manager.html (renamed from language/fr_FR.iso-8859-1/help/remote_site.html)0
-rw-r--r--nbm.php4
-rw-r--r--plugins/add_index/admin/main_page.php220
-rw-r--r--plugins/add_index/admin/main_page.tpl14
-rw-r--r--plugins/add_index/index.php35
-rw-r--r--plugins/add_index/language/en_UK.iso-8859-1/help/advanced_feature.html7
-rw-r--r--plugins/add_index/language/en_UK.iso-8859-1/help/index.php35
-rw-r--r--plugins/add_index/language/en_UK.iso-8859-1/help/site_manager.html7
-rw-r--r--plugins/add_index/language/en_UK.iso-8859-1/index.php35
-rw-r--r--plugins/add_index/language/en_UK.iso-8859-1/plugin.lang.php44
-rw-r--r--plugins/add_index/language/fr_FR.iso-8859-1/help/advanced_feature.html7
-rw-r--r--plugins/add_index/language/fr_FR.iso-8859-1/help/index.php35
-rw-r--r--plugins/add_index/language/fr_FR.iso-8859-1/help/site_manager.html7
-rw-r--r--plugins/add_index/language/fr_FR.iso-8859-1/index.php35
-rw-r--r--plugins/add_index/language/fr_FR.iso-8859-1/plugin.lang.php44
-rw-r--r--plugins/add_index/language/index.php35
-rw-r--r--plugins/add_index/main.admin.inc.php78
-rw-r--r--plugins/add_index/main.inc.php74
-rw-r--r--plugins/admin_advices/main.inc.php4
-rw-r--r--popuphelp.php33
-rw-r--r--template/yoga/admin/advanced_feature.tpl8
-rw-r--r--template/yoga/admin/site_manager.tpl6
34 files changed, 929 insertions, 40 deletions
diff --git a/admin.php b/admin.php
index a7830ba9c..b5165257d 100644
--- a/admin.php
+++ b/admin.php
@@ -54,15 +54,66 @@ check_conf();
// | variables init |
// +-----------------------------------------------------------------------+
-if (isset($_GET['page'])
+unset($page['page']);
+
+if
+ (
+ isset($_GET['page'])
and preg_match('/^[a-z_]*$/', $_GET['page'])
- and is_file(PHPWG_ROOT_PATH.'admin/'.$_GET['page'].'.php'))
+ )
{
- $page['page'] = $_GET['page'];
+ if
+ (
+ (!isset($_GET['page_type']) or $_GET['page_type'] == 'standard')
+ and is_file(PHPWG_ROOT_PATH.'admin/'.$_GET['page'].'.php')
+ )
+ {
+ $page['page']['type'] = 'standard';
+ $page['page']['name'] = $_GET['page'];
+ }
+ else if
+ (
+ (isset($_GET['page_type']) and $_GET['page_type'] == 'plugin')
+ and isset($_GET['plugin_id'])
+ and preg_match('/^[a-z_]*$/', $_GET['plugin_id'])
+ and is_file(PHPWG_PLUGINS_PATH.$_GET['plugin_id'].'/admin/'.$_GET['page'].'.php')
+ )
+ {
+ if (function_exists('mysql_real_escape_string'))
+ {
+ $page['page']['plugin_id'] = mysql_real_escape_string($_GET['plugin_id']);
+ }
+ else
+ {
+ $page['page']['plugin_id'] = mysql_escape_string($_GET['plugin_id']);
+ }
+
+ $check_db_plugin = get_db_plugins('', $page['page']['plugin_id']);
+ if (!empty($check_db_plugin))
+ {
+ $page['page']['type'] = $_GET['page_type'];
+ $page['page']['name'] = $_GET['page'];
+ }
+ else
+ {
+ unset($page['page']);
+ }
+ unset($check_db_plugin);
+ }
}
-else
+
+if (!isset($page['page']))
{
- $page['page'] = 'intro';
+ if (isset($_GET['page_type']) and $_GET['page_type'] == 'plugin')
+ {
+ $page['page']['type'] = 'standard';
+ $page['page']['name'] = 'plugins';
+ }
+ else
+ {
+ $page['page']['type'] = 'standard';
+ $page['page']['name'] = 'intro';
+ }
}
$page['errors'] = array();
@@ -135,7 +186,25 @@ if ($conf['allow_random_representative'])
// required before plugin page inclusion
trigger_action('plugin_admin_menu');
-include(PHPWG_ROOT_PATH.'admin/'.$page['page'].'.php');
+switch($page['page']['type'])
+{
+ case 'standard':
+ {
+ include(PHPWG_ROOT_PATH.'admin/'.$page['page']['name'].'.php');
+ break;
+ }
+ case 'plugin':
+ {
+ include(PHPWG_PLUGINS_PATH.$page['page']['plugin_id'].'/admin/'.$page['page']['name'].'.php');
+ break;
+ }
+ default:
+ {
+ die ("Hacking attempt!");
+ break;
+ }
+}
+
//------------------------------------------------------------- content display
$template->assign_block_vars('plugin_menu.menu_item',
diff --git a/admin/advanced_feature.php b/admin/advanced_feature.php
index a178b50f1..f8991ff07 100644
--- a/admin/advanced_feature.php
+++ b/admin/advanced_feature.php
@@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
-// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | branch : BSF (Best So Far)
// | file : $RCSfile$
@@ -36,7 +36,7 @@ if (!defined('PHPWG_ROOT_PATH'))
check_status(ACCESS_ADMINISTRATOR);
// +-----------------------------------------------------------------------+
-// | actions |
+// | Actions |
// +-----------------------------------------------------------------------+
/*$action = (isset($_GET['action']) and !is_adviser()) ? $_GET['action'] : '';
@@ -54,25 +54,64 @@ switch ($action)
}*/
// +-----------------------------------------------------------------------+
-// | template init |
+// | Define advanced features |
+// +-----------------------------------------------------------------------+
+
+$advanced_features = array();
+
+// Add advanced features
+/*array_push($advanced_features,
+ array
+ (
+ 'CAPTION' => l10n('???'),
+ 'URL' => $start_url.'???'
+ ));*/
+
+array_push($advanced_features,
+ array
+ (
+ 'CAPTION' => l10n('Elements_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'
+ ));
+
+//$advanced_features is array of array composed of CAPTION & URL
+$advanced_features =
+ trigger_event('array_advanced_features', $advanced_features);
+
+// +-----------------------------------------------------------------------+
+// | Template init |
// +-----------------------------------------------------------------------+
$template->set_filenames(array('advanced_feature'=>'admin/advanced_feature.tpl'));
-$start_url = PHPWG_ROOT_PATH.'admin.php?page=advanced_feature&amp;action=';
+$start_url = get_root_url().'admin.php?page=advanced_feature&amp;action=';
$template->assign_vars(
- array(
-// 'U_ADV_????' => $start_url.'???',
- 'U_ADV_ELEMENT_NOT_LINKED' => PHPWG_ROOT_PATH.'admin.php?page=element_set&cat=not_linked',
- 'U_ADV_DUP_FILES' => PHPWG_ROOT_PATH.'admin.php?page=element_set&cat=duplicates',
- 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=advanced_feature'
- )
- );
+ array
+ (
+ 'U_HELP' => get_root_url().'popuphelp.php?page=advanced_feature'
+ ));
+
+// advanced_features
+if (count($advanced_features) > 0)
+{
+ foreach ($advanced_features as $advanced_feature)
+ {
+ $template->assign_block_vars('advanced_features.advanced_feature', $advanced_feature);
+ }
+}
// +-----------------------------------------------------------------------+
-// | sending html code |
+// | Sending html code |
// +-----------------------------------------------------------------------+
$template->assign_var_from_handle('ADMIN_CONTENT', 'advanced_feature');
+
?>
diff --git a/admin/include/functions_notification_by_mail.inc.php b/admin/include/functions_notification_by_mail.inc.php
index 13113da28..29ec90372 100644
--- a/admin/include/functions_notification_by_mail.inc.php
+++ b/admin/include/functions_notification_by_mail.inc.php
@@ -254,10 +254,11 @@ function set_user_id_on_env_nbm($user_id)
// language files
include(get_language_filepath('common.lang.php'));
- @include(get_language_filepath('local.lang.php'));
// No test admin because script is checked admin (user selected no)
// Translations are in admin file too
include(get_language_filepath('admin.lang.php'));
+ trigger_action('loading_lang');
+ @include(get_language_filepath('local.lang.php'));
}
}
diff --git a/admin/plugins.php b/admin/plugins.php
index e8f2c2a5a..d58e25a64 100644
--- a/admin/plugins.php
+++ b/admin/plugins.php
@@ -42,7 +42,15 @@ $my_base_url = PHPWG_ROOT_PATH.'admin.php?page=plugins';
// +-----------------------------------------------------------------------+
if ( isset($_REQUEST['action']) and isset($_REQUEST['plugin']) )
{
- $plugin_id = $_REQUEST['plugin'];
+ if (function_exists('mysql_real_escape_string'))
+ {
+ $plugin_id = mysql_real_escape_string($_REQUEST['plugin']);
+ }
+ else
+ {
+ $plugin_id = mysql_escape_string($_REQUEST['plugin']);
+ }
+
$crt_db_plugin = get_db_plugins('', $plugin_id);
if (!empty($crt_db_plugin))
{
diff --git a/admin/site_manager.php b/admin/site_manager.php
index aa0ad5f31..53330d7f9 100644
--- a/admin/site_manager.php
+++ b/admin/site_manager.php
@@ -205,7 +205,7 @@ SELECT galleries_url
}
$template->assign_vars( array(
- 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=remote_site',
+ 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=site_manager',
'F_ACTION' => PHPWG_ROOT_PATH.'admin.php'
.get_query_string_diff( array('action','site') )
) );
@@ -293,6 +293,22 @@ 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',
+ $plugin_links, $row['id'], $is_remote);
+
+ // plugin_links
+ if (count($plugin_links) > 0)
+ {
+ foreach ($plugin_links as $plugin_link)
+ {
+ $template->assign_block_vars('sites.site.plugin_links.plugin_link', $plugin_link);
+ }
+ }
+
}
if ( isset($local_listing_site_url) and !isset($local_listing_site_id) )
diff --git a/include/common.inc.php b/include/common.inc.php
index 07d73ee6c..01e6869e1 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -149,6 +149,7 @@ if (defined('IN_ADMIN') and IN_ADMIN)
{
include_once(get_language_filepath('admin.lang.php'));
}
+trigger_action('loading_lang');
@include_once(get_language_filepath('local.lang.php'));
// only now we can set the localized username of the guest user (and not in
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 3593652e0..3a3ee5259 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -640,6 +640,7 @@ function redirect_html( $url , $msg = '', $refresh_time = 0)
{
$user = build_user( $conf['guest_id'], true);
include_once(get_language_filepath('common.lang.php'));
+ trigger_action('loading_lang');
@include_once(get_language_filepath('local.lang.php'));
list($tmpl, $thm) = explode('/', $conf['default_template']);
$template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm);
diff --git a/include/functions_plugins.inc.php b/include/functions_plugins.inc.php
index 3eda2e3f8..204d4e315 100644
--- a/include/functions_plugins.inc.php
+++ b/include/functions_plugins.inc.php
@@ -33,7 +33,7 @@ register their functions to handle these events. An event is identified by a
string.
*/
-define('PHPWG_PLUGINS_PATH',PHPWG_ROOT_PATH.'plugins/');
+define('PHPWG_PLUGINS_PATH', PHPWG_ROOT_PATH.'plugins/');
define('EVENT_HANDLER_PRIORITY_NEUTRAL', 50);
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index dba5072fb..5499eb86c 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -821,19 +821,26 @@ SELECT name
* PhpWebGallery default language.
*
* @param string filename
+ * @param string dirname
* @return string filepath
*/
-function get_language_filepath($filename)
+function get_language_filepath($filename, $dirname = '')
{
global $user, $conf;
+ if (empty($dirname))
+ {
+ $dirname = PHPWG_ROOT_PATH;
+ }
+ $dirname .= 'language'.'/';
+
$directories = array();
if ( isset($user['language']) )
{
- $directories[] = PHPWG_ROOT_PATH.'language/'.$user['language'];
+ $directories[] = $dirname.$user['language'];
}
- $directories[] = PHPWG_ROOT_PATH.'language/'.$conf['default_language'];
- $directories[] = PHPWG_ROOT_PATH.'language/'.PHPWG_DEFAULT_LANGUAGE;
+ $directories[] = $dirname.$conf['default_language'];
+ $directories[] = $dirname.PHPWG_DEFAULT_LANGUAGE;
foreach ($directories as $directory)
{
diff --git a/language/en_UK.iso-8859-1/help/advanced_feature.html b/language/en_UK.iso-8859-1/help/advanced_feature.html
index 821604712..59b28616e 100644
--- a/language/en_UK.iso-8859-1/help/advanced_feature.html
+++ b/language/en_UK.iso-8859-1/help/advanced_feature.html
@@ -1,6 +1,6 @@
<h2>Advanced features</h2>
-<p>List special functionnalties for expert PWG administrator.</p>
+<p>List special functionnalties for expert PWG administrator:</p>
<ul>
diff --git a/language/en_UK.iso-8859-1/help/remote_site.html b/language/en_UK.iso-8859-1/help/site_manager.html
index 5cb8b5081..5cb8b5081 100644
--- a/language/en_UK.iso-8859-1/help/remote_site.html
+++ b/language/en_UK.iso-8859-1/help/site_manager.html
diff --git a/language/fr_FR.iso-8859-1/help/advanced_feature.html b/language/fr_FR.iso-8859-1/help/advanced_feature.html
index d58a05426..fb5fbd5b6 100644
--- a/language/fr_FR.iso-8859-1/help/advanced_feature.html
+++ b/language/fr_FR.iso-8859-1/help/advanced_feature.html
@@ -1,15 +1,15 @@
<h2>Fonctions avancées</h2>
-<p>Liste des fonctionnalités spéciales pour les administrateurs experts de PWG.</p>
+<p>Liste des fonctionnalités spéciales pour les administrateurs experts de PWG:</p>
<ul>
<li>
- <strong>Eléments non liés :</strong>
+ <strong>Eléments non liés:</strong>
Affiche les images qui ne sont pas associées à une catégorie virtuelle
</li>
<li>
- <strong>Fichiers portant le même nom dans plusieurs catégories physiques :</strong>
+ <strong>Fichiers portant le même nom dans plusieurs catégories physiques:</strong>
Affiche les images ou les éventuels fichiers qui pourraient être trouvés dans plusieurs catégories.
</li>
diff --git a/language/fr_FR.iso-8859-1/help/remote_site.html b/language/fr_FR.iso-8859-1/help/site_manager.html
index d36c345ad..d36c345ad 100644
--- a/language/fr_FR.iso-8859-1/help/remote_site.html
+++ b/language/fr_FR.iso-8859-1/help/site_manager.html
diff --git a/nbm.php b/nbm.php
index 6f5e69d8b..62f482423 100644
--- a/nbm.php
+++ b/nbm.php
@@ -35,6 +35,10 @@ include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
include_once(PHPWG_ROOT_PATH.'admin/include/functions_notification_by_mail.inc.php');
// Translations are in admin file too
include(get_language_filepath('admin.lang.php'));
+// Need to update a second time
+trigger_action('loading_lang');
+@include(get_language_filepath('local.lang.php'));
+
// +-----------------------------------------------------------------------+
// | Main |
diff --git a/plugins/add_index/admin/main_page.php b/plugins/add_index/admin/main_page.php
new file mode 100644
index 000000000..488e0bb85
--- /dev/null
+++ b/plugins/add_index/admin/main_page.php
@@ -0,0 +1,220 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | 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 |
+// +-----------------------------------------------------------------------+
+// | last modifier : $Author: rub $
+// | revision : $Revision: 1.0.2.0 $
+// +-----------------------------------------------------------------------+
+// | 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. |
+// +-----------------------------------------------------------------------+
+
+// +-----------------------------------------------------------------------+
+// | 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']))
+{
+ // Name of the directoty use in order to copy index file
+ $conf['index']['source_directory_name'] = 'include/index.php';
+}
+
+// +-----------------------------------------------------------------------+
+// | include |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+ die ("Hacking attempt!");
+}
+
+include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+// +-----------------------------------------------------------------------+
+// | Functions |
+// +-----------------------------------------------------------------------+
+/**
+ * returns an array containing sub-directories
+ * recursive by default
+ *
+ * directories nammed ".svn" are omitted
+ *
+ * @param string $path
+ * @param bool $recursive
+ * @return array
+ */
+function get_add_index_directories($path, $recursive = true)
+{
+ $dirs = array();
+
+ if (is_dir($path))
+ {
+ if ($contents = opendir($path))
+ {
+ while (($node = readdir($contents)) !== false)
+ {
+ if (
+ is_dir($path.'/'.$node)
+ and $node != '.'
+ and $node != '..'
+ and $node != '.svn'
+ )
+ {
+ array_push($dirs, $path.'/'.$node);
+ if ($recursive)
+ {
+ $dirs = array_merge($dirs, get_add_index_directories($path.'/'.$node));
+ }
+ }
+ }
+ }
+ }
+
+ return $dirs;
+}
+
+// +-----------------------------------------------------------------------+
+// | Main |
+// +-----------------------------------------------------------------------+
+$index_file_src=PHPWG_ROOT_PATH.$conf['index']['source_directory_name'];
+$overwrite_file=isset($_GET['overwrite']);
+$site_id = (isset($_GET['site_id']) and is_numeric($_GET['site_id'])
+ ? $_GET['site_id']
+ : 0);
+
+$add_index_results = array();
+$count_copy = 0;
+$count_skip = 0;
+$count_error = 0;
+
+if (@file_exists($index_file_src))
+{
+ $query = '
+select
+ galleries_url
+from
+ '.SITES_TABLE;
+ if (!empty($site_id))
+ {
+ $query .= '
+where
+ id = '.$site_id;
+ }
+ $query .= '
+order by
+ id';
+
+ $result = pwg_query($query);
+
+ if (mysql_num_rows($result) > 0)
+ {
+ while (list($galleries_url) = mysql_fetch_row($result))
+ {
+ if (!url_is_remote($galleries_url))
+ {
+ //echo $galleries_url.'<BR>';
+ foreach (get_add_index_directories($galleries_url) as $dir_galleries)
+ {
+ $file_dest = $dir_galleries.'/'.$conf['index']['file_name'];
+ if ($overwrite_file or !@file_exists($file_dest))
+ {
+ if (copy($index_file_src, $file_dest))
+ {
+ array_push($add_index_results,
+ sprintf(l10n('add_index_file_copied'), $file_dest));
+ $count_copy++;
+ }
+ else
+ {
+ array_push($page['errors'],
+ sprintf(l10n('add_index_file_not_copied'), $file_dest));
+ $count_error++;
+ }
+ }
+ else
+ {
+ $count_skip++;
+ }
+ }
+ }
+ else
+ {
+ if (!empty($site_id))
+ {
+ array_push($page['errors'],
+ sprintf(l10n('add_index_not_local_site'),
+ $galleries_url, $site_id));
+ }
+ }
+ }
+ }
+
+ if ($count_copy != 0)
+ {
+ array_push($add_index_results,
+ l10n_dec('add_index_nb_copied_file', 'add_index_nb_copied_files',
+ $count_copy));
+ }
+ if ($count_skip != 0)
+ {
+ array_push($add_index_results,
+ l10n_dec('add_index_nb_skipped_file', 'add_index_nb_skipped_files',
+ $count_skip));
+ }
+ if ($count_error != 0)
+ {
+ array_push($page['errors'],
+ l10n_dec('add_index_nb_not_copied_file', 'add_index_nb_not_copied_files',
+ $count_error));
+ }
+}
+else
+{
+ array_push($page['errors'],
+ sprintf(l10n('add_index_src_file_dont_exists'), $index_file_src));
+}
+
+// +-----------------------------------------------------------------------+
+// | template initialization |
+// +-----------------------------------------------------------------------+
+$template->set_filenames(array('main_page' => dirname(__FILE__).'/main_page.tpl'));
+
+if (count($add_index_results) != 0)
+{
+ foreach ($add_index_results as $result)
+ {
+ $template->assign_block_vars('add_index_results.result', array('RESULT' => $result));
+ }
+}
+
+// +-----------------------------------------------------------------------+
+// | Sending html code |
+// +-----------------------------------------------------------------------+
+$template->assign_var_from_handle( 'ADMIN_CONTENT', 'main_page');
+
+?> \ No newline at end of file
diff --git a/plugins/add_index/admin/main_page.tpl b/plugins/add_index/admin/main_page.tpl
new file mode 100644
index 000000000..155151851
--- /dev/null
+++ b/plugins/add_index/admin/main_page.tpl
@@ -0,0 +1,14 @@
+<!-- $Id: notification_by_mail.tpl Ruben ARNAUD -->
+<div class="titrePage">
+ <h2>{lang:Add_Index}</h2>
+</div>
+
+<!-- BEGIN add_index_results -->
+<div>
+ <ul>
+ <!-- BEGIN result -->
+ <li>{add_index_results.result.RESULT}</li>
+ <!-- END result -->
+ </ul>
+</div>
+<!-- END add_index_results -->
diff --git a/plugins/add_index/index.php b/plugins/add_index/index.php
new file mode 100644
index 000000000..f0ba36fa3
--- /dev/null
+++ b/plugins/add_index/index.php
@@ -0,0 +1,35 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2005 PhpWebGallery Team - http://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. |
+// +-----------------------------------------------------------------------+
+
+// recursive call of index.php
+
+$url = '../index.php';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
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
new file mode 100644
index 000000000..46eae4b61
--- /dev/null
+++ b/plugins/add_index/language/en_UK.iso-8859-1/help/advanced_feature.html
@@ -0,0 +1,7 @@
+<p>Functionality of AddIndex plugin:</p>
+<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.
+ </li>
+<ul>
diff --git a/plugins/add_index/language/en_UK.iso-8859-1/help/index.php b/plugins/add_index/language/en_UK.iso-8859-1/help/index.php
new file mode 100644
index 000000000..ad16c4524
--- /dev/null
+++ b/plugins/add_index/language/en_UK.iso-8859-1/help/index.php
@@ -0,0 +1,35 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | branch : BSF (Best So Far)
+// | file : $RCSfile$
+// | last update : $Date: 2006-03-15 23:44:35 +0100 (mer., 15 mars 2006) $
+// | last modifier : $Author: plg $
+// | revision : $Revision: 1082 $
+// +-----------------------------------------------------------------------+
+// | 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. |
+// +-----------------------------------------------------------------------+
+
+// recursive call of index.php
+
+$url = '../index.php';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
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
new file mode 100644
index 000000000..7bd92283a
--- /dev/null
+++ b/plugins/add_index/language/en_UK.iso-8859-1/help/site_manager.html
@@ -0,0 +1,7 @@
+<p>Functionality of AddIndex plugin:</p>
+<ul>
+ <li>
+ <strong>Add "index" files for local site:</strong>
+ Copy the file ./include/index.php in all sub-directories of selected local site.
+ </li>
+<ul>
diff --git a/plugins/add_index/language/en_UK.iso-8859-1/index.php b/plugins/add_index/language/en_UK.iso-8859-1/index.php
new file mode 100644
index 000000000..ad16c4524
--- /dev/null
+++ b/plugins/add_index/language/en_UK.iso-8859-1/index.php
@@ -0,0 +1,35 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | branch : BSF (Best So Far)
+// | file : $RCSfile$
+// | last update : $Date: 2006-03-15 23:44:35 +0100 (mer., 15 mars 2006) $
+// | last modifier : $Author: plg $
+// | revision : $Revision: 1082 $
+// +-----------------------------------------------------------------------+
+// | 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. |
+// +-----------------------------------------------------------------------+
+
+// recursive call of index.php
+
+$url = '../index.php';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
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
new file mode 100644
index 000000000..b7e68ced1
--- /dev/null
+++ b/plugins/add_index/language/en_UK.iso-8859-1/plugin.lang.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) 2006-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. |
+// +-----------------------------------------------------------------------+
+
+$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['add_index_file_copied'] = '%s copied';
+$lang['add_index_file_not_copied'] = '%s not copied';
+$lang['add_index_not_local_site'] = '%s [%d] is a remote site, it\`s compatible with add "index" files';
+$lang['add_index_nb_copied_file'] = '%d file copied';
+$lang['add_index_nb_copied_files'] = '%d files copied';
+$lang['add_index_nb_skipped_file'] = '%d file skipped';
+$lang['add_index_nb_skipped_files'] = '%d files skipped';
+$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';
+
+?>
diff --git a/plugins/add_index/language/fr_FR.iso-8859-1/help/advanced_feature.html b/plugins/add_index/language/fr_FR.iso-8859-1/help/advanced_feature.html
new file mode 100644
index 000000000..5f0172d05
--- /dev/null
+++ b/plugins/add_index/language/fr_FR.iso-8859-1/help/advanced_feature.html
@@ -0,0 +1,7 @@
+<p>Fonctionnalité du plugin AddIndex:</p>
+<ul>
+ <li>
+ <strong>Ajout et écrasement des fichiers "index" pour tous les sites locaux :</strong>
+ Copie avec écrasement le fichier ./include/index.php dans tous les sous-répertoires des galeries des sites locaux.
+ </li>
+</ul>
diff --git a/plugins/add_index/language/fr_FR.iso-8859-1/help/index.php b/plugins/add_index/language/fr_FR.iso-8859-1/help/index.php
new file mode 100644
index 000000000..ad16c4524
--- /dev/null
+++ b/plugins/add_index/language/fr_FR.iso-8859-1/help/index.php
@@ -0,0 +1,35 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | branch : BSF (Best So Far)
+// | file : $RCSfile$
+// | last update : $Date: 2006-03-15 23:44:35 +0100 (mer., 15 mars 2006) $
+// | last modifier : $Author: plg $
+// | revision : $Revision: 1082 $
+// +-----------------------------------------------------------------------+
+// | 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. |
+// +-----------------------------------------------------------------------+
+
+// recursive call of index.php
+
+$url = '../index.php';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/plugins/add_index/language/fr_FR.iso-8859-1/help/site_manager.html b/plugins/add_index/language/fr_FR.iso-8859-1/help/site_manager.html
new file mode 100644
index 000000000..f341c7cda
--- /dev/null
+++ b/plugins/add_index/language/fr_FR.iso-8859-1/help/site_manager.html
@@ -0,0 +1,7 @@
+<p>Fonctionnalité du plugin AddIndex:</p>
+<ul>
+ <li>
+ <strong>Ajout des fichiers "index" pour le site local :</strong>
+ Copie le fichier ./include/index.php dans tous les sous-répertoires du site sélectionné.
+ </li>
+</ul>
diff --git a/plugins/add_index/language/fr_FR.iso-8859-1/index.php b/plugins/add_index/language/fr_FR.iso-8859-1/index.php
new file mode 100644
index 000000000..ad16c4524
--- /dev/null
+++ b/plugins/add_index/language/fr_FR.iso-8859-1/index.php
@@ -0,0 +1,35 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | branch : BSF (Best So Far)
+// | file : $RCSfile$
+// | last update : $Date: 2006-03-15 23:44:35 +0100 (mer., 15 mars 2006) $
+// | last modifier : $Author: plg $
+// | revision : $Revision: 1082 $
+// +-----------------------------------------------------------------------+
+// | 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. |
+// +-----------------------------------------------------------------------+
+
+// recursive call of index.php
+
+$url = '../index.php';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
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
new file mode 100644
index 000000000..1e64654aa
--- /dev/null
+++ b/plugins/add_index/language/fr_FR.iso-8859-1/plugin.lang.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) 2006-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. |
+// +-----------------------------------------------------------------------+
+
+$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['add_index_file_copied'] = '%s copié';
+$lang['add_index_file_not_copied'] = '%s non copié';
+$lang['add_index_not_local_site'] = '%s [%d] est un site distant, ce n\'est pas compatible avec l\'ajout de fichiers "index"';
+$lang['add_index_nb_copied_file'] = '%d fichier copié';
+$lang['add_index_nb_copied_files'] = '%d fichiers copiés';
+$lang['add_index_nb_skipped_file'] = '%d fichier à ne pas traiter';
+$lang['add_index_nb_skipped_files'] = '%d fichiers à ne pas traiter';
+$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';
+
+?>
diff --git a/plugins/add_index/language/index.php b/plugins/add_index/language/index.php
new file mode 100644
index 000000000..f0ba36fa3
--- /dev/null
+++ b/plugins/add_index/language/index.php
@@ -0,0 +1,35 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2005 PhpWebGallery Team - http://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. |
+// +-----------------------------------------------------------------------+
+
+// recursive call of index.php
+
+$url = '../index.php';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/plugins/add_index/main.admin.inc.php b/plugins/add_index/main.admin.inc.php
new file mode 100644
index 000000000..cf55c6edf
--- /dev/null
+++ b/plugins/add_index/main.admin.inc.php
@@ -0,0 +1,78 @@
+<?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) 2006-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!');
+}
+
+class AdminAddIndex extends AddIndex
+{
+ function loading_lang()
+ {
+ global $lang;
+
+ include(get_language_filepath('plugin.lang.php', $this->path));
+ }
+
+ function array_advanced_features($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'
+ ));
+
+ return $advanced_features;
+ }
+
+ function array_site_manager_plugin_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_CAPTION' => l10n('Manager_Add_Index'),
+ 'U_HINT' => l10n('Add_Index')
+ ));
+ }
+
+ return $site_manager_plugin_links;
+ }
+}
+
+$add_index = new AdminAddIndex();
+
+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);
+
+?> \ No newline at end of file
diff --git a/plugins/add_index/main.inc.php b/plugins/add_index/main.inc.php
new file mode 100644
index 000000000..cf334be63
--- /dev/null
+++ b/plugins/add_index/main.inc.php
@@ -0,0 +1,74 @@
+<?php
+/*
+Plugin Name: Add Index
+Version: 1.1.0.0
+Description: Add file index.php file on all sub-directories of local galleries pictures. / Ajoute le fichier index.php sur les sous-répertoires de galeries d'images locales.
+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 |
+// +-----------------------------------------------------------------------+
+// | 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__).'/';
+ }
+
+ function get_popup_help_content($popup_help_content, $page)
+ {
+ $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;
+ }
+ }
+}
+
+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/admin_advices/main.inc.php b/plugins/admin_advices/main.inc.php
index c6362a72b..5af0b8f9a 100644
--- a/plugins/admin_advices/main.inc.php
+++ b/plugins/admin_advices/main.inc.php
@@ -13,7 +13,9 @@ function set_admin_advice()
// This Plugin works only on the Admin page
if ( isset($page['body_id']) and $page['body_id']=='theAdminPage'
- and isset($page['page']) and $page['page'] == 'intro' )
+ and isset($page['page']['name']) and $page['page']['name'] == 'intro'
+ and isset($page['page']['type']) and $page['page']['type'] == 'standard'
+ )
{
// Setup Advice Language (Maybe there is already a variable)
$advlang = ( isset($user['language']) ) ?
diff --git a/popuphelp.php b/popuphelp.php
index a66ded4a7..39abd3596 100644
--- a/popuphelp.php
+++ b/popuphelp.php
@@ -42,15 +42,35 @@ $title = l10n('PhpWebGallery Help');
$page['page_banner'] = '<h1>'.$title.'</h1>';
include(PHPWG_ROOT_PATH.'include/page_header.php');
-$template->set_filenames(
- array(
- 'help_content' => get_language_filepath('help/'.$_GET['page'].'.html')
- )
- );
+if
+ (
+ isset($_GET['page'])
+ and preg_match('/^[a-z_]*$/', $_GET['page'])
+ )
+{
+ $help_content =
+ @file_get_contents(get_language_filepath('help/'.$_GET['page'].'.html'));
+
+ if ($help_content == false)
+ {
+ $help_content = '';
+ }
+
+ $help_content = trigger_event(
+ 'get_popup_help_content', $help_content, $_GET['page']);
+}
+else
+{
+ die('Hacking attempt!');
+}
$template->set_filenames(array('popuphelp' => 'popuphelp.tpl'));
-$template->assign_var_from_handle('HELP_CONTENT', 'help_content');
+$template->assign_vars(
+ array
+ (
+ 'HELP_CONTENT' => $help_content
+ ));
// +-----------------------------------------------------------------------+
// | html code display |
@@ -59,4 +79,5 @@ $template->assign_var_from_handle('HELP_CONTENT', 'help_content');
$template->parse('popuphelp');
include(PHPWG_ROOT_PATH.'include/page_tail.php');
+
?> \ No newline at end of file
diff --git a/template/yoga/admin/advanced_feature.tpl b/template/yoga/admin/advanced_feature.tpl
index 9925d83e4..ac0143e53 100644
--- a/template/yoga/admin/advanced_feature.tpl
+++ b/template/yoga/admin/advanced_feature.tpl
@@ -7,7 +7,9 @@
</div>
<ul>
-<!-- <li><a href="{U_ADV_????}" {TAG_INPUT_ENABLED}>{lang:update categories informations}</a></li>-->
- <li><a href="{U_ADV_ELEMENT_NOT_LINKED}" {TAG_INPUT_ENABLED}>{lang:Elements_not_linked}</a></li>
- <li><a href="{U_ADV_DUP_FILES}" {TAG_INPUT_ENABLED}>{lang:Duplicates}</a></li>
+ <!-- BEGIN advanced_features -->
+ <!-- BEGIN advanced_feature -->
+ <li><a href="{advanced_features.advanced_feature.URL}" {TAG_INPUT_ENABLED}>{advanced_features.advanced_feature.CAPTION}</a></li>
+ <!-- END advanced_feature -->
+ <!-- END advanced_features -->
</ul>
diff --git a/template/yoga/admin/site_manager.tpl b/template/yoga/admin/site_manager.tpl
index 0168bb078..6406bf520 100644
--- a/template/yoga/admin/site_manager.tpl
+++ b/template/yoga/admin/site_manager.tpl
@@ -50,6 +50,12 @@
[<a href="{sites.site.remote.U_GENERATE}" title="{lang:remote_site_generate_hint}" {TAG_INPUT_ENABLED}>{lang:remote_site_generate}</a>]
[<a href="{sites.site.remote.U_CLEAN}" title="{lang:remote_site_clean_hint}" {TAG_INPUT_ENABLED}>{lang:remote_site_clean}</a>]
<!-- END remote -->
+ <!-- BEGIN plugin_links -->
+ <br>
+ <!-- BEGIN plugin_link -->
+ [<a href="{sites.site.plugin_links.plugin_link.U_HREF}" title='{sites.site.plugin_links.plugin_link.U_HINT}' {TAG_INPUT_ENABLED}>{sites.site.plugin_links.plugin_link.U_CAPTION}</a>]
+ <!-- END plugin_link -->
+ <!-- END plugin_links -->
</td></tr>
<!-- END site -->
</table>