Changeset 19821
- Timestamp:
- Jan 5, 2013, 1:39:08 AM (12 years ago)
- Location:
- extensions/File_Uploader
- Files:
-
- 3 added
- 1 deleted
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/File_Uploader
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/admin
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/admin/admin_configuration.php
r19472 r19821 13 13 } 14 14 15 $conf_file_uploader['pdf2tab_extensions'] = $_POST['file_uploader_pdf2tab_extensions']; 16 $conf_file_uploader['pdf2tab_extensions'] = explode(',', $conf_file_uploader['pdf2tab_extensions']); 17 15 18 //Save 16 19 conf_update_param('file_uploader', serialize($conf_file_uploader)); … … 21 24 foreach ($conf_file_uploader as $file_uploader_key => $value) 22 25 $file_uploader_checked[$file_uploader_key] = (($conf_file_uploader[$file_uploader_key] == 1) ? 'checked = "checked"' : ''); 26 $template->assign('file_uploader_checked', $file_uploader_checked); 23 27 24 $template->assign('file_uploader_checked', $file_uploader_checked); 28 if ($conf_file_uploader['pdf2tab_extensions'][0]=='') 29 $conf_file_uploader['pdf2tab_extensions'] = null; 30 $template->assign('file_uploader_pdf2tab_extensions',$conf_file_uploader['pdf2tab_extensions']); 25 31 26 32 //Add our template to the global template -
extensions/File_Uploader/admin/admin_configuration.tpl
r19666 r19821 1 {include file='include/colorbox.inc.tpl'} 2 3 {combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} 4 {footer_script require='jquery.tokeninput'} 5 jQuery(document).ready(function() {ldelim} 6 jQuery('select[name="file_uploader_pdf2tab_extensions"]').tokenInput( 7 [{foreach from=$extensions item=extension name=extensions}{ldelim}"{$extension|@escape:'javascript'}"{rdelim}{if !$smarty.foreach.extensions.last},{/if}{/foreach}], 8 {ldelim} 9 hintText: '{'file_uploader_pdf2tab_hint_text'|@translate}', 10 noResultsText: '', 11 searchingText: '', 12 newText: '', 13 animateDropdown: false, 14 preventDuplicates: true, 15 allowCreation: true 16 } 17 ); 18 19 jQuery("a.preview-box").colorbox(); 20 }); 21 {/footer_script} 22 1 23 <div class="titrePage"> 2 24 <h2>{'File Uploader Plugin'|@translate}</h2> … … 9 31 <label><input type="checkbox" name="file_uploader_checkbox[new_tab]" value="1" {$file_uploader_checked.new_tab}> {'Open files in a new tab'|@translate}</label> 10 32 </p> 33 <p id="file_uploader_pdf2tab_supported_extensions"> 34 {'file_uploader_pdf2tab_supported_extensions_description'|@translate} 35 </p> 36 <p id="file_uploader_pdf2tab_supported_extensions"> 37 <select name="file_uploader_pdf2tab_extensions"> 38 {foreach from=$file_uploader_pdf2tab_extensions item=file_uploader_pdf2tab_extension} 39 <option value="{$file_uploader_pdf2tab_extension}" class="selected">{$file_uploader_pdf2tab_extension}</option> 40 {/foreach} 41 </select> 42 </p> 11 43 <p> 12 44 <label><input type="checkbox" name="file_uploader_checkbox[overwrite]" value="1" {$file_uploader_checked.overwrite}> {'Overwrite files without notice'|@translate}</label> -
extensions/File_Uploader/install
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/install/config_default.inc.php
r19775 r19821 35 35 'new_tab' => 1, 36 36 'overwrite' => 0, 37 'pdf2tab_extensions' => array('pdf', 'docx', 'doc', 'odt', 'xlsx', 'xls', 'ods', 'pptx', 'ppt', 'odp'), 37 38 ); 38 39 -
extensions/File_Uploader/install/functions.inc.php
r19775 r19821 1 1 <?php 2 function file_uploader_install($config) { 3 $query = 'INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("file_uploader" ,"'.pwg_db_real_escape_string(serialize($config)).'", "File Uploader plugin parameters");'; 4 pwg_query($query); 5 } 6 7 function file_uploader_update_db() { 8 global $conf; 9 include(dirname(__FILE__).'/config_default.inc.php'); 10 11 $config = array(); 12 if (isset($conf['file_uploader'])) 13 $conf_file_uploader = unserialize($conf['file_uploader']); 14 15 if (isset($conf_file_uploader)) { 16 foreach ($config_default as $key => $value) { 17 if (isset($conf_file_uploader[$key])) 18 $config[$key] = $conf_file_uploader[$key]; 19 else 20 $config[$key] = $config_default[$key]; 21 } 22 file_uploader_delete_conf("file_uploader"); 23 file_uploader_install($config); 24 } else { 25 file_uploader_install($config_default); 26 } 27 } 28 29 function file_uploader_delete_conf($where) { 30 $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE (param="'.$where.'");'; 31 pwg_query($query); 32 } 33 2 34 function file_uploader_folder($file_uploader_galleries_folder, $file_uploader_galleries_dir) { 3 35 //If the directory does not exist, we create it -
extensions/File_Uploader/language
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/language/da_DK
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/language/da_DK/plugin.lang.php
r19724 r19821 26 26 $lang['No file to upload'] = 'Der er ingen fil at uploade'; 27 27 $lang['Open files in a new tab'] = 'Åbn filer i et nyt faneblad'; 28 $lang[' Open the file in a new tab'] = 'Åbn filen i et nyt faneblad';28 $lang['file_uploader_pdf2tab_tooltip'] = 'Åbn filen i et nyt faneblad'; 29 29 $lang['Overwrite files without notice'] = 'Overskriv filer uden advarsel'; 30 30 $lang['Piwigo is a free software (opensource software), you can use it for free and this is not going to change. Donations are collected by the Piwigo Foundation (non profit organization) to cover project fees.'] = 'Piwigo er fri software (open source-software), som du frit kan anvende og vil altid være det. Donationer modtages af Piwigo Foundation (nonprofitnorganisation) med det formål at dække projektomkostninger.'; -
extensions/File_Uploader/language/de_DE
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/language/de_DE/plugin.lang.php
r19697 r19821 24 24 $lang['No file to upload'] = 'Keine Datei zum hochladen'; 25 25 $lang['Open files in a new tab'] = 'Öffne Datei in neuem TAB'; 26 $lang[' Open the file in a new tab'] = 'Öffne die Datei in einem neuen TAB';26 $lang['file_uploader_pdf2tab_tooltip'] = 'Öffne die Datei in einem neuen TAB'; 27 27 $lang['Overwrite files without notice'] = 'Überschreibe Datei ohne Warnhinweis'; 28 28 $lang['Piwigo is a free software (opensource software), you can use it for free and this is not going to change. Donations are collected by the Piwigo Foundation (non profit organization) to cover project fees.'] = 'Piwigo ist eine freie Software (Open Source), Du kannst sie kostenlos benutzen. Piwigo wird stets kostenlos bleiben. Spenden werden von der Piwigo Foundation (nicht kommerzielle Organisation) verwendet um Projektkosten zu decken.'; -
extensions/File_Uploader/language/el_GR
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/language/el_GR/plugin.lang.php
r19713 r19821 31 31 $lang['Piwigo is a free software (opensource software), you can use it for free and this is not going to change. Donations are collected by the Piwigo Foundation (non profit organization) to cover project fees.'] = 'Το Piwigo είναι δωρεάν λογισμικό (λογισμικό ανοικτού κώδικα), μπορείτε να το χρησιμοποιήσετε ελεύθερα και αυτό δεν πρόκειται να αλλάξει. Δωρεές συλλέγονται από το Ίδρυμα Piwigo Foundation (μη κερδοσκοπικός οργανισμός) για την κάλυψη των αμοιβών του έργου.'; 32 32 $lang['Overwrite files without notice'] = 'Αντικατάσταση αρχείων χωρίς προειδοποίηση'; 33 $lang[' Open the file in a new tab'] = 'Ανοίξτε το αρχείο σε μια νέα καρτέλα';33 $lang['file_uploader_pdf2tab_tooltip'] = 'Ανοίξτε το αρχείο σε μια νέα καρτέλα'; 34 34 $lang['Open files in a new tab'] = 'Ανοίξτε το αρχεία σε μια νέα καρτέλα'; 35 35 $lang['No file to upload'] = 'Δεν υπάρχει αρχείο για να φορτώσετε'; -
extensions/File_Uploader/language/en_UK
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/language/en_UK/plugin.lang.php
r19666 r19821 54 54 //pdf2tab 55 55 //picture.php 56 $lang[' Open the file in a new tab'] = 'Open the file in a new tab';56 $lang['file_uploader_pdf2tab_tooltip'] = 'Open the file in a new tab'; 57 57 ?> -
extensions/File_Uploader/language/es_ES
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/language/es_ES/plugin.lang.php
r19730 r19821 26 26 $lang['No file to upload'] = 'Ningun archivo para subir'; 27 27 $lang['Open files in a new tab'] = 'Abrir archivos en una nueva pestaña'; 28 $lang[' Open the file in a new tab'] = 'Abrir archivo en una nueva pestaña';28 $lang['file_uploader_pdf2tab_tooltip'] = 'Abrir archivo en una nueva pestaña'; 29 29 $lang['Overwrite files without notice'] = 'Sobrescribir archivos sin notificarlo'; 30 30 $lang['Piwigo is a free software (opensource software), you can use it for free and this is not going to change. Donations are collected by the Piwigo Foundation (non profit organization) to cover project fees.'] = 'Piwigo es un software gratuito (código abierto), puedes usarlo gratis y esto no va a cambiar. Las donaciones son recolectadas por la fundación Piwigo (sin ánimo de lucro) para cubrir los gastos del proyecto.'; -
extensions/File_Uploader/language/fr_FR
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/language/fr_FR/plugin.lang.php
r19666 r19821 54 54 //pdf2tab 55 55 //picture.php 56 $lang[' Open the file in a new tab'] = 'Ouvrir le fichier dans un nouvel onglet';56 $lang['file_uploader_pdf2tab_tooltip'] = 'Ouvrir le fichier dans un nouvel onglet'; 57 57 ?> -
extensions/File_Uploader/language/hu_HU
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/language/hu_HU/plugin.lang.php
r19710 r19821 31 31 $lang['Specify a thumbnail for your file'] = 'Adja meg a bélyegkép fájlt'; 32 32 $lang['Type of file not supported'] = 'A fájltípus nem támogatott'; 33 $lang[' Open the file in a new tab'] = 'Nyissa meg a fájlt egy új fülön';33 $lang['file_uploader_pdf2tab_tooltip'] = 'Nyissa meg a fájlt egy új fülön'; 34 34 $lang['There have been errors. See below'] = 'Hibák történtek. Lásd alább'; 35 35 $lang['File upload stopped by extension'] = 'A fájl feltöltést leállította a bővítmény'; -
extensions/File_Uploader/language/tr_TR
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/language/tr_TR/plugin.lang.php
r19693 r19821 39 39 $lang['No file to upload'] = 'Yükleyecek dosya yok'; 40 40 $lang['Open files in a new tab'] = 'PDF dosyaların yeni sekmede aç'; 41 $lang[' Open the file in a new tab'] = 'Dosyayı yeni sekmede aç';41 $lang['file_uploader_pdf2tab_tooltip'] = 'Dosyayı yeni sekmede aç'; 42 42 $lang['Overwrite files without notice'] = 'Uyarmaksızın dosyaların üzerine yaz'; 43 43 $lang['Specify a file to upload'] = 'Yüklenecek bir dosya seçin'; -
extensions/File_Uploader/main.inc.php
r19675 r19821 57 57 //add a stylesheet 58 58 $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.FILE_UPLOADER_PATH.'admin/admin.css">'); 59 $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.FILE_UPLOADER_PDF2TAB_ABSOLUTE_PATH.'css/admin.css">'); 59 60 } 60 61 ?> -
extensions/File_Uploader/maintain.inc.php
r19775 r19821 6 6 include_once(dirname(__FILE__).'/install/functions.inc.php'); 7 7 8 $query = 'INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("file_uploader" ,"'.pwg_db_real_escape_string(serialize($config_default)).'", "File Uploader plugin parameters");'; 9 pwg_query($query); 8 file_uploader_install($config_default); 10 9 11 10 file_uploader_folder($file_uploader_galleries_folder, $file_uploader_galleries_dir); … … 16 15 include_once(dirname(__FILE__).'/install/functions.inc.php'); 17 16 17 file_uploader_update_db(); 18 18 file_uploader_folder($file_uploader_galleries_folder, $file_uploader_galleries_dir); 19 19 } 20 20 21 21 function plugin_uninstall() { 22 $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE (param="file_uploader");'; 23 pwg_query($query); 22 include_once(dirname(__FILE__).'/install/functions.inc.php'); 23 24 file_uploader_delete_conf("file_uploader"); 24 25 } 25 26 -
extensions/File_Uploader/plugin_pdf2tab
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/plugin_pdf2tab/include
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/plugin_pdf2tab/include/picture.inc.php
r19680 r19821 1 1 <?php 2 add_event_handler('render_element_content',' pdf2tab_add_links_picture',EVENT_HANDLER_PRIORITY_NEUTRAL+10,2);2 add_event_handler('render_element_content','file_uploader_pdf2tab_add_links_picture',EVENT_HANDLER_PRIORITY_NEUTRAL+10,2); 3 3 4 function pdf2tab_add_links_picture($content, $element_info) { 5 include_once('constants.inc.php'); 6 7 if (in_array(strtolower(substr(strrchr($element_info['file'], "."),1)), $supported_extensions)) { 8 $content = pdf2tab_add_link_image($content, $element_info); 9 $content = pdf2tab_add_link_beside_image($content, $element_info); 4 function file_uploader_pdf2tab_add_links_picture($content, $element_info) { 5 global $conf; 6 7 $conf_file_uploader = unserialize($conf['file_uploader']); 8 9 if (in_array(strtolower(substr(strrchr($element_info['file'], "."),1)), $conf_file_uploader['pdf2tab_extensions'])) { 10 $content = file_uploader_pdf2tab_add_link_image($content, $element_info); 11 $content = file_uploader_pdf2tab_add_link_beside_image($content, $element_info); 10 12 } 11 13 … … 13 15 } 14 16 15 function pdf2tab_add_link_image($content, $element_info) {17 function file_uploader_pdf2tab_add_link_image($content, $element_info) { 16 18 preg_match('/<\s*img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i',$content,$match); 17 $content = str_replace($match[0],'<a href="'.$element_info['element_url'].'" target="_blank" title="'.l10n(' Open the file in a new tab').'">'.$match[0].'</a>',$content);19 $content = str_replace($match[0],'<a href="'.$element_info['element_url'].'" target="_blank" title="'.l10n('file_uploader_pdf2tab_tooltip').'">'.$match[0].'</a>',$content); 18 20 19 21 return $content; 20 22 } 21 23 22 function pdf2tab_add_link_beside_image($content, $element_info) {23 $content .= '<p class="imageComment"><a href="'.$element_info['element_url'].'" target="_blank" title="'.l10n(' Open the file in a new tab').'">'.l10n('Open the file in a new tab').'</a>';24 function file_uploader_pdf2tab_add_link_beside_image($content, $element_info) { 25 $content .= '<p class="imageComment"><a href="'.$element_info['element_url'].'" target="_blank" title="'.l10n('file_uploader_pdf2tab_tooltip').'">'.l10n('file_uploader_pdf2tab_tooltip').'</a>'; 24 26 25 27 return $content; -
extensions/File_Uploader/plugin_pdf2tab/include/thumbnails.inc.php
r19680 r19821 1 1 <?php 2 add_event_handler('loc_end_index_thumbnails', ' pdf2tab_thumbnails');2 add_event_handler('loc_end_index_thumbnails', 'file_uploader_pdf2tab_thumbnails'); 3 3 4 function pdf2tab_thumbnails($tpl_thumbnails_var) { 5 global $template; 6 include_once('constants.inc.php'); 4 function file_uploader_pdf2tab_thumbnails($tpl_thumbnails_var) { 5 global $template, $conf; 7 6 8 $ template->set_prefilter('index_thumbnails', 'pdf2tab_add_tag_thumbnails');7 $conf_file_uploader = unserialize($conf['file_uploader']); 9 8 10 $template->assign('pdf2tab_supported_extensions', $supported_extensions); 11 $template->set_filename('pdf2tab_template_thumbnails', FILE_UPLOADER_PDF2TAB_ABSOLUTE_PATH.'template/thumbnails.tpl'); 12 $template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('pdf2tab_template_thumbnails', true)); 9 $template->set_prefilter('index_thumbnails', 'file_uploader_pdf2tab_add_tag_thumbnails'); 10 11 $template->assign('file_uploader_pdf2tab_supported_extensions', $conf_file_uploader['pdf2tab_extensions']); 12 $template->set_filename('file_uploader_pdf2tab_template_thumbnails', FILE_UPLOADER_PDF2TAB_ABSOLUTE_PATH.'template/thumbnails.tpl'); 13 $template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('file_uploader_pdf2tab_template_thumbnails', true)); 13 14 14 15 return $tpl_thumbnails_var; 15 16 } 16 17 17 function pdf2tab_add_tag_thumbnails($content, &$smarty) {18 function file_uploader_pdf2tab_add_tag_thumbnails($content, &$smarty) { 18 19 global $template; 19 20 20 21 $search = 'class="thumbnail"'; 21 22 22 $replacement = 'class="thumbnail" pdf2tab="{$thumbnail.path}"';23 $replacement = 'class="thumbnail" file_uploader_pdf2tab="{$thumbnail.path}"'; 23 24 $content= str_replace($search, $replacement, $content); 24 25 -
extensions/File_Uploader/plugin_pdf2tab/template
-
Property
tsvn:logtemplate
set to
[file_uploader]
-
Property
tsvn:logtemplate
set to
-
extensions/File_Uploader/plugin_pdf2tab/template/thumbnails.tpl
r19675 r19821 4 4 <script type="text/javascript"> 5 5 //Add a link to the thumbnail 6 function pdf2tab_link() {6 function file_uploader_pdf2tab_link() { 7 7 $("img[class=thumbnail]").each(function() { 8 var filename_array = $(this).attr(" pdf2tab").split(".");8 var filename_array = $(this).attr("file_uploader_pdf2tab").split("."); 9 9 var filename_extension = filename_array[filename_array.length-1].toLowerCase(); 10 10 11 11 {/literal} 12 var pdf2tab_supported_extensions = new Array();13 {foreach from=$ pdf2tab_supported_extensions item=extension name=loop}14 pdf2tab_supported_extensions[{$smarty.foreach.loop.index}] = "{$extension}";12 var file_uploader_pdf2tab_supported_extensions = new Array(); 13 {foreach from=$file_uploader_pdf2tab_supported_extensions item=extension name=loop} 14 file_uploader_pdf2tab_supported_extensions[{$smarty.foreach.loop.index}] = "{$extension}"; 15 15 {/foreach} 16 16 {literal} 17 if(jQuery.inArray(filename_extension, pdf2tab_supported_extensions) != -1)17 if(jQuery.inArray(filename_extension, file_uploader_pdf2tab_supported_extensions) != -1) 18 18 { 19 19 $(this).closest('a').attr({ 20 20 target: "_blank", 21 href: $(this).attr(" pdf2tab")21 href: $(this).attr("file_uploader_pdf2tab") 22 22 }); 23 23 {/literal} 24 $(this).attr("title","{' Open the file in a new tab'|@translate}");24 $(this).attr("title","{'file_uploader_pdf2tab_tooltip'|@translate}"); 25 25 {literal} 26 26 } … … 30 30 //When the document has finiched to load 31 31 jQuery(document).ready(function(){ 32 pdf2tab_link();32 file_uploader_pdf2tab_link(); 33 33 }); 34 34 35 35 //Allow pdf2tab to work with RV Thumb Scroller 36 36 jQuery(window).bind("RVTS_loaded", function(){ 37 pdf2tab_link();37 file_uploader_pdf2tab_link(); 38 38 }); 39 39 </script>
Note: See TracChangeset
for help on using the changeset viewer.