Ignore:
Timestamp:
Jan 5, 2013, 1:39:08 AM (12 years ago)
Author:
julien1311
Message:

[file_uploader] pdf2tab update

Location:
extensions/File_Uploader
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/File_Uploader

    • Property tsvn:logtemplate set to [file_uploader]
  • extensions/File_Uploader/admin

    • Property tsvn:logtemplate set to [file_uploader]
  • extensions/File_Uploader/admin/admin_configuration.php

    r19472 r19821  
    1313        }
    1414       
     15        $conf_file_uploader['pdf2tab_extensions'] = $_POST['file_uploader_pdf2tab_extensions'];
     16        $conf_file_uploader['pdf2tab_extensions'] = explode(',', $conf_file_uploader['pdf2tab_extensions']);
     17       
    1518        //Save
    1619        conf_update_param('file_uploader', serialize($conf_file_uploader));
     
    2124foreach ($conf_file_uploader as $file_uploader_key => $value)
    2225        $file_uploader_checked[$file_uploader_key] = (($conf_file_uploader[$file_uploader_key] == 1) ? 'checked = "checked"' : '');
     26$template->assign('file_uploader_checked', $file_uploader_checked);
    2327
    24 $template->assign('file_uploader_checked', $file_uploader_checked);
     28if ($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']);
    2531
    2632//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'}
     5jQuery(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
    123<div class="titrePage">
    224  <h2>{'File Uploader Plugin'|@translate}</h2>
     
    931                        <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>
    1032                </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>
    1143                <p>
    1244                        <label><input type="checkbox" name="file_uploader_checkbox[overwrite]" value="1" {$file_uploader_checked.overwrite}> {'Overwrite files without notice'|@translate}</label>
Note: See TracChangeset for help on using the changeset viewer.