Changeset 31469 for extensions/bmp_description
- Timestamp:
- Mar 20, 2016, 9:58:00 AM (8 years ago)
- Location:
- extensions/bmp_description
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/bmp_description/index.php
r22247 r31469 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2013 Piwigo Team http://piwigo.org |6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |8 // +-----------------------------------------------------------------------+9 // | This program is free software; you can redistribute it and/or modify |10 // | it under the terms of the GNU General Public License as published by |11 // | the Free Software Foundation |12 // | |13 // | This program is distributed in the hope that it will be useful, but |14 // | WITHOUT ANY WARRANTY; without even the implied warranty of |15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |16 // | General Public License for more details. |17 // | |18 // | You should have received a copy of the GNU General Public License |19 // | along with this program; if not, write to the Free Software |20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |21 // | USA. |22 // +-----------------------------------------------------------------------+23 24 2 // Recursive call 25 3 $url = '../'; -
extensions/bmp_description/initadmin.php
r22253 r31469 1 1 <?php 2 // +-----------------------------------------------------------------------+ 3 // | Batch Manager, Photo Description by plugin for Piwigo | 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2013-2016 ddtddt http://temmii.com/piwigo/ | 6 // +-----------------------------------------------------------------------+ 7 // | This program is free software; you can redistribute it and/or modify | 8 // | it under the terms of the GNU General Public License as published by | 9 // | the Free Software Foundation | 10 // | | 11 // | This program is distributed in the hope that it will be useful, but | 12 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 13 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 // | General Public License for more details. | 15 // | | 16 // | You should have received a copy of the GNU General Public License | 17 // | along with this program; if not, write to the Free Software | 18 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 19 // | USA. | 20 // +-----------------------------------------------------------------------+ 2 21 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 22 … … 5 24 6 25 global $prefilter; 26 27 add_event_handler('get_batch_manager_prefilters', 'BMPD_add_batch_manager_prefilters'); 28 add_event_handler('perform_batch_manager_prefilters', 'BMPD_perform_batch_manager_prefilters', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 7 29 8 add_event_handler('get_batch_manager_prefilters', 'BMPD_add_batch_manager_prefilters'); 9 add_event_handler('perform_batch_manager_prefilters', 'BMPD_perform_batch_manager_prefilters', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 10 11 function BMPD_add_batch_manager_prefilters($prefilters) 12 {load_language('plugin.lang', BMPD_PATH); 13 array_push($prefilters, array( 30 function BMPD_add_batch_manager_prefilters($prefilters){ 31 array_push($prefilters, array( 14 32 'ID' => 'BMPD', 15 33 'NAME' => l10n('With no description'), … … 18 36 } 19 37 20 function BMPD_perform_batch_manager_prefilters($filter_sets, $prefilter) 21 { 22 if ($prefilter == 'BMPD') 23 { 24 $query = ' 25 SELECT id 26 FROM '.IMAGES_TABLE.' 27 WHERE comment is null 28 ;'; 38 function BMPD_perform_batch_manager_prefilters($filter_sets, $prefilter){ 39 if ($prefilter == 'BMPD'){ 40 $query = 'SELECT id FROM '.IMAGES_TABLE.' WHERE comment is null;'; 29 41 $filter_sets[] = array_from_query($query, 'id'); 30 42 } 31 32 return $filter_sets; 43 return $filter_sets; 33 44 } 34 45 35 36 46 add_event_handler('get_batch_manager_prefilters', 'BMPD2_add_batch_manager_prefilters'); 47 add_event_handler('perform_batch_manager_prefilters', 'BMPD2_perform_batch_manager_prefilters', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 37 48 38 function BMPD2_add_batch_manager_prefilters($prefilters) 39 { 40 array_push($prefilters, array( 49 function BMPD2_add_batch_manager_prefilters($prefilters){ 50 array_push($prefilters, array( 41 51 'ID' => 'BMPD2', 42 52 'NAME' => l10n('With description'), 43 53 )); 44 54 return $prefilters; 45 55 } 46 56 47 function BMPD2_perform_batch_manager_prefilters($filter_sets, $prefilter) 48 { 49 if ($prefilter == 'BMPD2') 50 { 51 $query = ' 52 SELECT id 53 FROM '.IMAGES_TABLE.' 54 WHERE comment is not null 55 ;'; 57 function BMPD2_perform_batch_manager_prefilters($filter_sets, $prefilter){ 58 if ($prefilter == 'BMPD2'){ 59 $query = 'SELECT id FROM '.IMAGES_TABLE.' WHERE comment is not null ;'; 56 60 $filter_sets[] = array_from_query($query, 'id'); 57 61 } 58 59 return $filter_sets; 62 return $filter_sets; 60 63 } 61 64 62 63 add_event_handler('loc_end_element_set_global', 'BMPD_loc_end_element_set_global'); 64 add_event_handler('element_set_global_action', 'BMPD_element_set_global_action', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 65 add_event_handler('loc_end_element_set_global', 'BMPD_loc_end_element_set_global'); 66 add_event_handler('element_set_global_action', 'BMPD_element_set_global_action', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 65 67 66 function BMPD_loc_end_element_set_global() 67 { 68 function BMPD_loc_end_element_set_global(){ 68 69 global $template; 69 70 $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';")); 71 if($PAED['state'] == 'active'){ 72 $templatebmpd=' 73 <input type="checkbox" name="check_BMPD4"> '.l10n('remove description').'<br> 74 <textarea rows="5" cols="50" placeholder="'.l10n('Type here the description')." / ".l10n('Use Extended Description tags...').'" class="description" name="BMPD3" id="BMPD3"></textarea><br> 75 <input type="checkbox" name="check_BMPD"> '.l10n('confirm').' 76 '; 77 }else{ 78 $templatebmpd=' 79 <input type="checkbox" name="check_BMPD4"> '.l10n('remove description').'<br> 80 <textarea rows="5" cols="50" placeholder="'.l10n('Type here the description').'" class="description" name="BMPD3" id="BMPD3"></textarea><br> 81 <input type="checkbox" name="check_BMPD"> '.l10n('confirm').' 82 '; 83 } 70 84 $template->append('element_set_global_plugins_actions', array( 71 'ID' => 'BMPD3', 72 'NAME' => l10n('Set description'), 73 'CONTENT' => ' 74 <input type="checkbox" name="check_BMPD4"> '.l10n('remove description').'<br> 75 <textarea rows="5" cols="50" class="description" name="BMPD3" id="BMPD3">'.l10n('Type here the description').'</textarea> 76 <input type="checkbox" name="check_BMPD"> '.l10n('confirm').' 77 ', 85 'ID' => 'BMPD3', 86 'NAME' => l10n('Set description'), 87 'CONTENT' => $templatebmpd, 78 88 )); 79 89 } 80 90 81 function BMPD_element_set_global_action($action, $collection) 82 { 83 if ($action == 'BMPD3') 84 { 91 function BMPD_element_set_global_action($action, $collection) { 92 if ($action == 'BMPD3'){ 85 93 global $page; 86 87 if (empty($_POST['check_BMPD'])) 88 { 94 if (empty($_POST['check_BMPD'])){ 89 95 array_push($page['warnings'], l10n('You need to confirm')); 90 } 91 else 92 { 93 94 if (isset($_POST['check_BMPD4'])) 95 { 96 $_POST['BMPD3'] = null; 97 } 98 99 $datas = array(); 100 foreach ($collection as $image_id) 101 { 102 array_push( 103 $datas, 104 array( 105 'id' => $image_id, 106 'comment' => $_POST['BMPD3'] 107 ) 108 ); 109 } 110 111 mass_updates( 112 IMAGES_TABLE, 113 array('primary' => array('id'), 'update' => array('comment')), 114 $datas 115 ); 116 96 }else{ 97 if (isset($_POST['check_BMPD4'])){ 98 $_POST['BMPD3'] = null; 99 } 100 $datas = array(); 101 foreach ($collection as $image_id){ 102 array_push( 103 $datas, 104 array( 105 'id' => $image_id, 106 'comment' => $_POST['BMPD3'] 107 ) 108 ); 109 } 110 mass_updates( 111 IMAGES_TABLE, 112 array('primary' => array('id'), 'update' => array('comment')), 113 $datas 114 ); 117 115 } 118 116 } 119 117 } 120 118 121 119 ?> -
extensions/bmp_description/language/en_UK/index.php
r22247 r31469 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2009 Piwigo Team http://piwigo.org |6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |8 // +-----------------------------------------------------------------------+9 // | This program is free software; you can redistribute it and/or modify |10 // | it under the terms of the GNU General Public License as published by |11 // | the Free Software Foundation |12 // | |13 // | This program is distributed in the hope that it will be useful, but |14 // | WITHOUT ANY WARRANTY; without even the implied warranty of |15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |16 // | General Public License for more details. |17 // | |18 // | You should have received a copy of the GNU General Public License |19 // | along with this program; if not, write to the Free Software |20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |21 // | USA. |22 // +-----------------------------------------------------------------------+23 24 2 // Recursive call 25 3 $url = '../'; -
extensions/bmp_description/language/en_UK/plugin.lang.php
r22269 r31469 1 1 <?php 2 // +-----------------------------------------------------------------------+ 3 // | Batch Manager, Photo Description by plugin for Piwigo | 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2013-2016 ddtddt http://temmii.com/piwigo/ | 6 // +-----------------------------------------------------------------------+ 7 // | This program is free software; you can redistribute it and/or modify | 8 // | it under the terms of the GNU General Public License as published by | 9 // | the Free Software Foundation | 10 // | | 11 // | This program is distributed in the hope that it will be useful, but | 12 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 13 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 // | General Public License for more details. | 15 // | | 16 // | You should have received a copy of the GNU General Public License | 17 // | along with this program; if not, write to the Free Software | 18 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 19 // | USA. | 20 // +-----------------------------------------------------------------------+ 2 21 $lang['With description'] = 'With description'; 3 22 $lang['With no description'] = 'Without description'; -
extensions/bmp_description/language/fr_FR/index.php
r22247 r31469 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2009 Piwigo Team http://piwigo.org |6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |8 // +-----------------------------------------------------------------------+9 // | This program is free software; you can redistribute it and/or modify |10 // | it under the terms of the GNU General Public License as published by |11 // | the Free Software Foundation |12 // | |13 // | This program is distributed in the hope that it will be useful, but |14 // | WITHOUT ANY WARRANTY; without even the implied warranty of |15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |16 // | General Public License for more details. |17 // | |18 // | You should have received a copy of the GNU General Public License |19 // | along with this program; if not, write to the Free Software |20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |21 // | USA. |22 // +-----------------------------------------------------------------------+23 24 2 // Recursive call 25 3 $url = '../'; -
extensions/bmp_description/language/fr_FR/plugin.lang.php
r22254 r31469 1 1 <?php 2 // +-----------------------------------------------------------------------+ 3 // | Batch Manager, Photo Description by plugin for Piwigo | 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2013-2016 ddtddt http://temmii.com/piwigo/ | 6 // +-----------------------------------------------------------------------+ 7 // | This program is free software; you can redistribute it and/or modify | 8 // | it under the terms of the GNU General Public License as published by | 9 // | the Free Software Foundation | 10 // | | 11 // | This program is distributed in the hope that it will be useful, but | 12 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 13 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 // | General Public License for more details. | 15 // | | 16 // | You should have received a copy of the GNU General Public License | 17 // | along with this program; if not, write to the Free Software | 18 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 19 // | USA. | 20 // +-----------------------------------------------------------------------+ 2 21 $lang['With description'] = 'Avec description'; 3 22 $lang['With no description'] = 'Sans description'; -
extensions/bmp_description/main.inc.php
r22255 r31469 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=695 7 7 Author: ddtddt 8 Author URI: http:// piwigo.org/8 Author URI: http://temmii.com/piwigo/ 9 9 */ 10 11 // +-----------------------------------------------------------------------+ 12 // | Batch Manager, Photo Description by plugin for Piwigo | 13 // +-----------------------------------------------------------------------+ 14 // | Copyright(C) 2013-2016 ddtddt http://temmii.com/piwigo/ | 15 // +-----------------------------------------------------------------------+ 16 // | This program is free software; you can redistribute it and/or modify | 17 // | it under the terms of the GNU General Public License as published by | 18 // | the Free Software Foundation | 19 // | | 20 // | This program is distributed in the hope that it will be useful, but | 21 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 22 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 23 // | General Public License for more details. | 24 // | | 25 // | You should have received a copy of the GNU General Public License | 26 // | along with this program; if not, write to the Free Software | 27 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 28 // | USA. | 29 // +-----------------------------------------------------------------------+ 10 30 11 31 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); … … 16 36 define('BMPD_PATH' , PHPWG_PLUGINS_PATH . BMPD_DIR . '/'); 17 37 38 add_event_handler('loading_lang', 'batch_manager_photo_description_loading_lang'); 39 function batch_manager_photo_description_loading_lang(){ 40 load_language('plugin.lang', BMPD_PATH); 41 } 42 18 43 // Plugin for admin 19 44 if (script_basename() == 'admin')
Note: See TracChangeset
for help on using the changeset viewer.