aboutsummaryrefslogtreecommitdiffstats
path: root/BSF/plugins/add_index
diff options
context:
space:
mode:
authorvdigital <vdigital@piwigo.org>2008-05-23 21:05:41 +0000
committervdigital <vdigital@piwigo.org>2008-05-23 21:05:41 +0000
commit77fd1f51a3c5f5a52f72ef8a299fe368228e2285 (patch)
treea67ede42904657ccf3349ecdaef1cec8b8e36ff8 /BSF/plugins/add_index
parent553727dffacc48e8337c1d141f2a25af359e74b1 (diff)
git-svn-id: http://piwigo.org/svn/trunk@2357 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'BSF/plugins/add_index')
-rw-r--r--BSF/plugins/add_index/admin/index.php30
-rw-r--r--BSF/plugins/add_index/admin/main_page.php205
-rw-r--r--BSF/plugins/add_index/admin/main_page.tpl15
-rw-r--r--BSF/plugins/add_index/index.php30
-rw-r--r--BSF/plugins/add_index/language/en_UK/help/advanced_feature.html7
-rw-r--r--BSF/plugins/add_index/language/en_UK/help/index.php30
-rw-r--r--BSF/plugins/add_index/language/en_UK/help/site_manager.html7
-rw-r--r--BSF/plugins/add_index/language/en_UK/index.php30
-rw-r--r--BSF/plugins/add_index/language/en_UK/plugin.lang.php39
-rw-r--r--BSF/plugins/add_index/language/es_ES/help/advanced_feature.html7
-rw-r--r--BSF/plugins/add_index/language/es_ES/help/index.php30
-rw-r--r--BSF/plugins/add_index/language/es_ES/help/site_manager.html7
-rw-r--r--BSF/plugins/add_index/language/es_ES/index.php30
-rw-r--r--BSF/plugins/add_index/language/es_ES/plugin.lang.php39
-rw-r--r--BSF/plugins/add_index/language/fr_FR/help/advanced_feature.html7
-rw-r--r--BSF/plugins/add_index/language/fr_FR/help/index.php30
-rw-r--r--BSF/plugins/add_index/language/fr_FR/help/site_manager.html7
-rw-r--r--BSF/plugins/add_index/language/fr_FR/index.php30
-rw-r--r--BSF/plugins/add_index/language/fr_FR/plugin.lang.php39
-rw-r--r--BSF/plugins/add_index/language/index.php30
-rw-r--r--BSF/plugins/add_index/main.admin.inc.php93
-rw-r--r--BSF/plugins/add_index/main.base.inc.php39
-rw-r--r--BSF/plugins/add_index/main.inc.php53
-rw-r--r--BSF/plugins/add_index/main.normal.inc.php60
24 files changed, 894 insertions, 0 deletions
diff --git a/BSF/plugins/add_index/admin/index.php b/BSF/plugins/add_index/admin/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/add_index/admin/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/add_index/admin/main_page.php b/BSF/plugins/add_index/admin/main_page.php
new file mode 100644
index 000000000..35193af4e
--- /dev/null
+++ b/BSF/plugins/add_index/admin/main_page.php
@@ -0,0 +1,205 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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!');
+}
+
+// +-----------------------------------------------------------------------+
+// | include |
+// +-----------------------------------------------------------------------+
+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 |
+// +-----------------------------------------------------------------------+
+// 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;
+$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['add_index_filename'];
+ 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));
+ }
+ }
+ }
+ }
+
+ // 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',
+ $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/BSF/plugins/add_index/admin/main_page.tpl b/BSF/plugins/add_index/admin/main_page.tpl
new file mode 100644
index 000000000..591ff7fc0
--- /dev/null
+++ b/BSF/plugins/add_index/admin/main_page.tpl
@@ -0,0 +1,15 @@
+<!-- DEV TAG: not smarty migrated -->
+<!-- $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/BSF/plugins/add_index/index.php b/BSF/plugins/add_index/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/add_index/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/add_index/language/en_UK/help/advanced_feature.html b/BSF/plugins/add_index/language/en_UK/help/advanced_feature.html
new file mode 100644
index 000000000..00d15b57c
--- /dev/null
+++ b/BSF/plugins/add_index/language/en_UK/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 to all sub-directories of gallerie local sites.
+ </li>
+<ul>
diff --git a/BSF/plugins/add_index/language/en_UK/help/index.php b/BSF/plugins/add_index/language/en_UK/help/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/add_index/language/en_UK/help/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/add_index/language/en_UK/help/site_manager.html b/BSF/plugins/add_index/language/en_UK/help/site_manager.html
new file mode 100644
index 000000000..353980adc
--- /dev/null
+++ b/BSF/plugins/add_index/language/en_UK/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 to all sub-directories of selected local site.
+ </li>
+<ul>
diff --git a/BSF/plugins/add_index/language/en_UK/index.php b/BSF/plugins/add_index/language/en_UK/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/add_index/language/en_UK/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/add_index/language/en_UK/plugin.lang.php b/BSF/plugins/add_index/language/en_UK/plugin.lang.php
new file mode 100644
index 000000000..63c3931ce
--- /dev/null
+++ b/BSF/plugins/add_index/language/en_UK/plugin.lang.php
@@ -0,0 +1,39 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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/BSF/plugins/add_index/language/es_ES/help/advanced_feature.html b/BSF/plugins/add_index/language/es_ES/help/advanced_feature.html
new file mode 100644
index 000000000..82734b259
--- /dev/null
+++ b/BSF/plugins/add_index/language/es_ES/help/advanced_feature.html
@@ -0,0 +1,7 @@
+<p>Funcionalidad del plugin AddIndex:</p>
+<ul>
+ <li>
+ <strong>Adición y aplastamiento de los ficheros "index" para todos los sitios locales :</strong>
+ Copia con aplastamiento el fichero ./include/index.php en todos los subficheros de las galerías de los sitios locales.
+ </li>
+</ul>
diff --git a/BSF/plugins/add_index/language/es_ES/help/index.php b/BSF/plugins/add_index/language/es_ES/help/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/add_index/language/es_ES/help/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/add_index/language/es_ES/help/site_manager.html b/BSF/plugins/add_index/language/es_ES/help/site_manager.html
new file mode 100644
index 000000000..c09a6f3c3
--- /dev/null
+++ b/BSF/plugins/add_index/language/es_ES/help/site_manager.html
@@ -0,0 +1,7 @@
+<p>Funcionalidad del plugin AddIndex:</p>
+<ul>
+ <li>
+ <strong>Adición de los ficheros "index" para el sitio local:</strong>
+ Copia el fichero ./include/index.php en todos los subficheros del sitio seleccionado.
+ </li>
+</ul>
diff --git a/BSF/plugins/add_index/language/es_ES/index.php b/BSF/plugins/add_index/language/es_ES/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/add_index/language/es_ES/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/add_index/language/es_ES/plugin.lang.php b/BSF/plugins/add_index/language/es_ES/plugin.lang.php
new file mode 100644
index 000000000..26d104de6
--- /dev/null
+++ b/BSF/plugins/add_index/language/es_ES/plugin.lang.php
@@ -0,0 +1,39 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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'] = 'Adición de los ficheros "index"';
+$lang['Advanced_Add_Index'] = 'Adición y aplastamiento de los ficheros "index" para todos los sitios locales';
+$lang['Manager_Add_Index'] = 'adición de "index"';
+
+$lang['add_index_file_copied'] = '%s copiado';
+$lang['add_index_file_not_copied'] = '%s no copiado';
+$lang['add_index_not_local_site'] = '%s [%d] es un sitio distante, no es compatible con la adición de ficheros "index"';
+$lang['add_index_nb_copied_file'] = '%d fichero copiado';
+$lang['add_index_nb_copied_files'] = '%d ficheros copiados';
+$lang['add_index_nb_skipped_file'] = '%d fichero que debe tratarse';
+$lang['add_index_nb_skipped_files'] = '%d ficheros que deben tratarse';
+$lang['add_index_nb_not_copied_file'] = '%d fichero no copiado';
+$lang['add_index_nb_not_copied_files'] = '%d ficheros no copiados';
+$lang['add_index_src_file_dont_exists'] = 'El fichero fuente no existe, la duplicación de este fichero no es posible';
+
+?>
diff --git a/BSF/plugins/add_index/language/fr_FR/help/advanced_feature.html b/BSF/plugins/add_index/language/fr_FR/help/advanced_feature.html
new file mode 100644
index 000000000..a5bf92e5b
--- /dev/null
+++ b/BSF/plugins/add_index/language/fr_FR/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/BSF/plugins/add_index/language/fr_FR/help/index.php b/BSF/plugins/add_index/language/fr_FR/help/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/add_index/language/fr_FR/help/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/add_index/language/fr_FR/help/site_manager.html b/BSF/plugins/add_index/language/fr_FR/help/site_manager.html
new file mode 100644
index 000000000..87b6ec15c
--- /dev/null
+++ b/BSF/plugins/add_index/language/fr_FR/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/BSF/plugins/add_index/language/fr_FR/index.php b/BSF/plugins/add_index/language/fr_FR/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/add_index/language/fr_FR/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/add_index/language/fr_FR/plugin.lang.php b/BSF/plugins/add_index/language/fr_FR/plugin.lang.php
new file mode 100644
index 000000000..228ed75af
--- /dev/null
+++ b/BSF/plugins/add_index/language/fr_FR/plugin.lang.php
@@ -0,0 +1,39 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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/BSF/plugins/add_index/language/index.php b/BSF/plugins/add_index/language/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/add_index/language/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/add_index/main.admin.inc.php b/BSF/plugins/add_index/main.admin.inc.php
new file mode 100644
index 000000000..f293d30e0
--- /dev/null
+++ b/BSF/plugins/add_index/main.admin.inc.php
@@ -0,0 +1,93 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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 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()
+ {
+ load_language('plugin.lang', $this->path);
+ }
+
+ function get_admin_advanced_features_links($advanced_features)
+ {
+ array_push($advanced_features,
+ array
+ (
+ 'CAPTION' => l10n('Advanced_Add_Index'),
+ 'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/main_page.php').'&amp;overwrite'
+ ));
+
+ return $advanced_features;
+ }
+
+ 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_admin_plugin_menu_link(dirname(__FILE__).'/admin/main_page.php').'&amp;site_id='.$site_id,
+ 'U_CAPTION' => l10n('Manager_Add_Index'),
+ 'U_HINT' => l10n('Add_Index')
+ ));
+ }
+
+ return $site_manager_plugin_links;
+ }
+}
+
+// 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('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);
+
+?> \ No newline at end of file
diff --git a/BSF/plugins/add_index/main.base.inc.php b/BSF/plugins/add_index/main.base.inc.php
new file mode 100644
index 000000000..765d1cbbf
--- /dev/null
+++ b/BSF/plugins/add_index/main.base.inc.php
@@ -0,0 +1,39 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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/BSF/plugins/add_index/main.inc.php b/BSF/plugins/add_index/main.inc.php
new file mode 100644
index 000000000..30e6b9ff6
--- /dev/null
+++ b/BSF/plugins/add_index/main.inc.php
@@ -0,0 +1,53 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 Piwigo team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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. |
+// +-----------------------------------------------------------------------+
+
+/*
+Plugin Name: Add Index
+Version: 1.8
+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://piwigo.org
+Author: Piwigo team
+Author URI: http://piwigo.org
+*/
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+ die('Hacking attempt!');
+}
+
+if (in_array(script_basename(), array('popuphelp', 'admin')))
+{
+ if (defined('IN_ADMIN') and IN_ADMIN)
+ {
+ include_once(dirname(__FILE__).'/'.'main.base.inc.php');
+ include_once(dirname(__FILE__).'/'.'main.admin.inc.php');
+ }
+ else
+ {
+ include_once(dirname(__FILE__).'/'.'main.base.inc.php');
+ include_once(dirname(__FILE__).'/'.'main.normal.inc.php');
+ }
+ set_plugin_data($plugin['id'], $add_index);
+}
+
+?> \ No newline at end of file
diff --git a/BSF/plugins/add_index/main.normal.inc.php b/BSF/plugins/add_index/main.normal.inc.php
new file mode 100644
index 000000000..6f43c6e40
--- /dev/null
+++ b/BSF/plugins/add_index/main.normal.inc.php
@@ -0,0 +1,60 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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 =
+ load_language('help/'.$page.'.html', $this->path, '', true);
+ }
+ 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