Changeset 4796 for extensions/upload_form
- Timestamp:
- Jan 29, 2010, 11:14:41 PM (14 years ago)
- Location:
- extensions/upload_form
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/upload_form/language/en_UK/plugin.lang.php
r4789 r4796 27 27 $lang['Create the "%s" directory at the root of your Piwigo installation'] = 'Create the "%s" directory at the root of your Piwigo installation'; 28 28 $lang['Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'] = 'Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'; 29 $lang['existing category'] = 'existing category'; 30 $lang['create a new category'] = 'create a new category'; 31 $lang['Category name'] = 'Category name'; 32 $lang['Category "%s" has been added'] = 'Category "%s" has been added'; 29 33 ?> -
extensions/upload_form/language/fr_FR/plugin.lang.php
r4789 r4796 27 27 $lang['Create the "%s" directory at the root of your Piwigo installation'] = 'Créez le répertoire "%s" à la racine de votre installation Piwigo'; 28 28 $lang['Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'] = 'Donnez les droits en écriture (chmod 777) sur le répertoire "%s" à la racine de votre installation Piwigo'; 29 $lang['existing category'] = 'catégorie existante'; 30 $lang['create a new category'] = 'créer une nouvelle catégorie'; 31 $lang['Category name'] = 'Nom de la catégorie'; 32 $lang['Category "%s" has been added'] = 'La catégorie "%s" a été ajoutée'; 29 33 ?> -
extensions/upload_form/upload.php
r4789 r4796 37 37 38 38 // +-----------------------------------------------------------------------+ 39 // | functions|39 // | process form | 40 40 // +-----------------------------------------------------------------------+ 41 41 42 42 if (isset($_POST['submit_upload'])) 43 43 { 44 // echo '<pre>'; print_r($_FILES); echo '</pre>'; exit(); 44 $category_id = null; 45 if ('existing' == $_POST['category_type']) 46 { 47 $category_id = $_POST['category']; 48 } 49 elseif ('new' == $_POST['category_type']) 50 { 51 $output_create = create_virtual_category( 52 $_POST['category_name'], 53 (0 == $_POST['category_parent'] ? null : $_POST['category_parent']) 54 ); 55 56 if (isset($output_create['error'])) 57 { 58 array_push($page['errors'], $output_create['error']); 59 } 60 else 61 { 62 // information 63 array_push( 64 $page['infos'], 65 sprintf( 66 l10n('Category "%s" has been added'), 67 '<em>'.get_cat_display_name_from_id($output_create['id']).'</em>' 68 ) 69 ); 70 } 71 72 $category_id = $output_create['id']; 73 } 45 74 46 75 $starttime = get_moment(); … … 52 81 $source_filepath = $_FILES['image_upload']['tmp_name'][$idx]; 53 82 $original_filename = $_FILES['image_upload']['name'][$idx]; 54 add_uploaded_file($source_filepath, $original_filename, array($ _POST['category']));83 add_uploaded_file($source_filepath, $original_filename, array($category_id)); 55 84 } 56 85 } -
extensions/upload_form/upload.tpl
r4789 r4796 1 {known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"} 2 3 {literal} 4 <script> 5 $(document).ready(function(){ 6 7 $("input[name=category_type]").click(function () { 8 $("[id^=category_type_]").hide(); 9 $("#category_type_"+$(this).attr("value")).show(); 10 }); 11 12 }); 13 </script> 14 {/literal} 15 1 16 <script type="text/javascript" src="{$plugin_path}/include/upload.js"></script> 2 17 … … 32 47 <td>{'Drop into category'|@translate}</td> 33 48 <td> 34 <select class="categoryDropDown" name="category"> 35 <option value="0">------------</option> 36 {html_options options=$category_options} 37 </select> 49 <label><input type="radio" name="category_type" value="existing" checked="checked"> {'existing category'|@translate}</label> 50 <label><input type="radio" name="category_type" value="new"> {'create a new category'|@translate}</label> 51 52 <div id="category_type_existing"> 53 <select class="categoryDropDown" name="category"> 54 {html_options options=$category_options} 55 </select> 56 </div> 57 58 <div id="category_type_new" style="display:none"> 59 <table> 60 <tr> 61 <td>{'Parent category'|@translate}</td> 62 <td> 63 <select class="categoryDropDown" name="category_parent"> 64 <option value="0">------------</option> 65 {html_options options=$category_options} 66 </select> 67 </td> 68 </tr> 69 <tr> 70 <td>{'Category name'|@translate}</td> 71 <td> 72 <input type="text" name="category_name" value="{$F_CATEGORY_NAME}" 73 </td> 74 </tr> 75 </table> 76 </div> 77 38 78 </td> 39 79 </tr>
Note: See TracChangeset
for help on using the changeset viewer.