From 4489066c982c1044028295164ec2f2e840c16881 Mon Sep 17 00:00:00 2001 From: rub Date: Mon, 8 Jan 2007 00:16:10 +0000 Subject: 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 --- plugins/add_index/admin/main_page.php | 220 +++++++++++++++++++++ plugins/add_index/admin/main_page.tpl | 14 ++ plugins/add_index/index.php | 35 ++++ .../en_UK.iso-8859-1/help/advanced_feature.html | 7 + .../language/en_UK.iso-8859-1/help/index.php | 35 ++++ .../en_UK.iso-8859-1/help/site_manager.html | 7 + .../add_index/language/en_UK.iso-8859-1/index.php | 35 ++++ .../language/en_UK.iso-8859-1/plugin.lang.php | 44 +++++ .../fr_FR.iso-8859-1/help/advanced_feature.html | 7 + .../language/fr_FR.iso-8859-1/help/index.php | 35 ++++ .../fr_FR.iso-8859-1/help/site_manager.html | 7 + .../add_index/language/fr_FR.iso-8859-1/index.php | 35 ++++ .../language/fr_FR.iso-8859-1/plugin.lang.php | 44 +++++ plugins/add_index/language/index.php | 35 ++++ plugins/add_index/main.admin.inc.php | 78 ++++++++ plugins/add_index/main.inc.php | 74 +++++++ plugins/admin_advices/main.inc.php | 4 +- 17 files changed, 715 insertions(+), 1 deletion(-) create mode 100644 plugins/add_index/admin/main_page.php create mode 100644 plugins/add_index/admin/main_page.tpl create mode 100644 plugins/add_index/index.php create mode 100644 plugins/add_index/language/en_UK.iso-8859-1/help/advanced_feature.html create mode 100644 plugins/add_index/language/en_UK.iso-8859-1/help/index.php create mode 100644 plugins/add_index/language/en_UK.iso-8859-1/help/site_manager.html create mode 100644 plugins/add_index/language/en_UK.iso-8859-1/index.php create mode 100644 plugins/add_index/language/en_UK.iso-8859-1/plugin.lang.php create mode 100644 plugins/add_index/language/fr_FR.iso-8859-1/help/advanced_feature.html create mode 100644 plugins/add_index/language/fr_FR.iso-8859-1/help/index.php create mode 100644 plugins/add_index/language/fr_FR.iso-8859-1/help/site_manager.html create mode 100644 plugins/add_index/language/fr_FR.iso-8859-1/index.php create mode 100644 plugins/add_index/language/fr_FR.iso-8859-1/plugin.lang.php create mode 100644 plugins/add_index/language/index.php create mode 100644 plugins/add_index/main.admin.inc.php create mode 100644 plugins/add_index/main.inc.php (limited to 'plugins') 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 @@ + 0) + { + while (list($galleries_url) = mysql_fetch_row($result)) + { + if (!url_is_remote($galleries_url)) + { + //echo $galleries_url.'
'; + 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 @@ + +
+

{lang:Add_Index}

+
+ + +
+ +
+ 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 @@ + 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 @@ +

Functionality of AddIndex plugin:

+