PageRenderTime 49ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/lazyest-gallery/lazyest-captions.php

http://cartonbank.googlecode.com/
PHP | 563 lines | 468 code | 51 blank | 44 comment | 52 complexity | 7422f38b65d2d6a974885746a7192709 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, LGPL-2.1, AGPL-1.0, LGPL-3.0
  1. <?php
  2. /*
  3. * This file handle all captions
  4. * Functions list:
  5. * -TODO-
  6. */
  7. /** This function builds the structure of the gallery inside the main LG admin panel
  8. * TODO:
  9. * - Add a filter here (password or "not to show" option)
  10. * - Add the icon of each folder
  11. */
  12. function lg_show_gallery_structure(){
  13. global $gallery_root, $lg_text_domain;
  14. echo "<div style='font-family:monospace;background:#efefef;padding:5px;border:1px solid #ccc;'>\n";
  15. echo "<ul>\n";
  16. if (file_exists($gallery_root)){
  17. if ($dir_content = opendir($gallery_root)) {
  18. while ( false !== ($dir = readdir($dir_content)) ) {
  19. if (is_dir($gallery_root.$dir) && !in_array($dir, get_option('lg_excluded_folders')) && $dir!='.' && $dir!='..' ) {
  20. lg_show_structure($dir);
  21. }
  22. }
  23. }
  24. }
  25. else {
  26. echo "<div style='border: solid 1px #000; padding: 10px;'><b style='color:#ff0000;'>". __('WARNING', $lg_text_domain) ." </b>: ". __('Specified gallery folder does not exists', $lg_text_domain) ."</div>";
  27. }
  28. echo "</ul>\n";
  29. echo "</div>\n";
  30. }
  31. /**
  32. * This function is used from show_gallery_structure() to build nested structures
  33. * NOTE: $sscurrentdir stays for Show Structure current directory
  34. */
  35. function lg_show_structure($sscurrentdir){
  36. global $excluded_folders, $gallery_root, $lg_text_domain;
  37. if( substr($sscurrentdir, strlen($sscurrentdir)-1 ) != '/'){
  38. $sscurrentdir .= '/';
  39. }
  40. $righturl = urlencode($sscurrentdir);
  41. echo '<li><a href="?page=lazyest-gallery/lazyest-admin.php&amp;captions=' . $righturl . '">' . $sscurrentdir . '</a>';
  42. if ($dir_content = opendir($gallery_root.$sscurrentdir)) {
  43. $dir_list = array();
  44. while ( false !== ($dir = readdir($dir_content)) ) {
  45. if (is_dir($gallery_root.$sscurrentdir.$dir) && !in_array($dir, get_option('lg_excluded_folders')) && $dir!='.' && $dir!='..' ) {
  46. $dir_list[] = $sscurrentdir.$dir;
  47. }
  48. }
  49. if($dir_list != NULL && sizeof($dir_list) > 0) {
  50. echo "<ul>\n";
  51. foreach($dir_list as $subdir) {
  52. lg_show_structure($subdir);
  53. }
  54. echo "</ul>\n";
  55. }
  56. }
  57. echo '</li>';
  58. }
  59. /**
  60. * This function builds the page relative to the caption system
  61. */
  62. function lg_build_captions_form(){
  63. global $gallery_root, $gallery_address, $lg_text_domain;
  64. $capdir = $_GET['captions'];
  65. // main container div
  66. echo '<div class="wrap">';
  67. /* ==========
  68. * Upload div
  69. * ========== */
  70. $folder = $gallery_root.$capdir;
  71. $allowed_types = explode(' ', trim(strtolower(get_option('lg_fileupload_allowedtypes'))));
  72. if ($_POST['upload'])
  73. $action = 'upload';
  74. if (!is_writable($folder))
  75. $action = 'not-writable';
  76. switch ($action) {
  77. case 'not-writable':
  78. ?>
  79. <p><?php printf(__("It doesn't look like you can use the file upload feature at this time because the directory you have specified (<code>%s</code>) doesn't appear to be writable by WordPress. Check the permissions on the directory and for typos.", $lg_text_domain), $folder) ?></p>
  80. <?php
  81. break;
  82. case 'upload':
  83. $imgalt = basename( (isset($_POST['imgalt'])) ? $_POST['imgalt'] : '' );
  84. $img1_name = (strlen($imgalt)) ? $imgalt : basename( $_FILES['img1']['name'] );
  85. $img1_name = preg_replace('/[^a-z0-9_.]/i', '', $img1_name);
  86. $img1_size = $_POST['img1_size'] ? intval($_POST['img1_size']) : intval($_FILES['img1']['size']);
  87. $img1_type = (strlen($imgalt)) ? $_POST['img1_type'] : $_FILES['img1']['type'];
  88. $pi = pathinfo($img1_name);
  89. $imgtype = strtolower($pi['extension']);
  90. if (in_array($imgtype, $allowed_types) == false)
  91. die(sprintf(__('File %1$s of type %2$s is not allowed.', $lg_text_domain) , $img1_name, $imgtype));
  92. if (strlen($imgalt)) {
  93. $pathtofile = $folder.$imgalt;
  94. $img1 = $_POST['img1'];
  95. } else {
  96. $pathtofile = $folder.$img1_name;
  97. $img1 = $_FILES['img1']['tmp_name'];
  98. }
  99. // makes sure not to upload duplicates, rename duplicates
  100. $i = 1;
  101. $pathtofile2 = $pathtofile;
  102. $tmppathtofile = $pathtofile2;
  103. $img2_name = $img1_name;
  104. while ( file_exists($pathtofile2) ) {
  105. $pos = strpos( strtolower($tmppathtofile), '.' . trim($imgtype) );
  106. $pathtofile_start = substr($tmppathtofile, 0, $pos);
  107. $pathtofile2 = $pathtofile_start.'_'.zeroise($i++, 2).'.'.trim($imgtype);
  108. $img2_name = explode('/', $pathtofile2);
  109. $img2_name = $img2_name[count($img2_name)-1];
  110. }
  111. if (file_exists($pathtofile) && !strlen($imgalt)) {
  112. $i = explode(' ', get_option('lg_fileupload_allowedtypes'));
  113. $i = implode(', ',array_slice($i, 1, count($i)-2));
  114. $moved = move_uploaded_file($img1, $pathtofile2);
  115. if (!$moved) {
  116. $moved = copy($img1, $pathtofile2);
  117. }
  118. if (!$moved) {
  119. die(sprintf(__("Couldn't upload your file to %s.", $lg_text_domain), $pathtofile2));
  120. } else {
  121. chmod($pathtofile2, 0666);
  122. @unlink($img1);
  123. }
  124. //
  125. // duplicate-renaming function contributed by Gary Lawrence Murphy
  126. ?>
  127. <p><strong><?php __('Duplicate File?') ?></strong></p>
  128. <p><b><em><?php printf(__("The filename '%s' already exists!"), $img1_name); ?></em></b></p>
  129. <p><?php printf(__("Filename '%1\$s' moved to '%2\$s'"), $img1, "$pathtofile2 - $img2_name") ?></p>
  130. <p><?php _e('Confirm or rename:') ?></p>
  131. <form action="" method="post" enctype="multipart/form-data">
  132. <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo get_option('lg_fileupload_maxk') *1024 ?>" />
  133. <input type="hidden" name="img1_type" value="<?php echo $img1_type;?>" />
  134. <input type="hidden" name="img1_name" value="<?php echo $img2_name;?>" />
  135. <input type="hidden" name="img1_size" value="<?php echo $img1_size;?>" />
  136. <input type="hidden" name="img1" value="<?php echo $pathtofile2;?>" />
  137. <?php _e('Alternate name:') ?><br /><input type="text" name="imgalt" size="30" class="uploadform" value="<?php echo $img2_name;?>" /><br />
  138. <br />
  139. <input type="submit" name="submit" value="<?php _e('Rename') ?>" class="search" />
  140. </form>
  141. <?php
  142. die();
  143. }
  144. if (!strlen($imgalt)) {
  145. @$moved = move_uploaded_file($img1, $pathtofile); //Path to your images directory, chmod the dir to 777
  146. // move_uploaded_file() can fail if open_basedir in PHP.INI doesn't
  147. // include your tmp directory. Try copy instead?
  148. if(!$moved) {
  149. $moved = copy($img1, $pathtofile);
  150. }
  151. // Still couldn't get it. Give up.
  152. if (!$moved) {
  153. die(sprintf(__("Couldn't upload your file to %s.", $lg_text_domain), $pathtofile));
  154. } else {
  155. chmod($pathtofile, 0666);
  156. @unlink($img1);
  157. }
  158. } else {
  159. rename($img1, $pathtofile)
  160. or die(sprintf(__("Couldn't upload your file to %s.", $lg_text_domain), $pathtofile));
  161. }
  162. if ( ereg('image/',$img1_type) )
  163. $piece_of_code = "[[Image:".$capdir.$img1_name."]]";
  164. else
  165. $piece_of_code = "<a href='" . $gallery_address.$capdir.$img1_name . "'>$img1_name</a>";
  166. $piece_of_code = htmlspecialchars( $piece_of_code );
  167. ?>
  168. <div id="message" class="updated fade"><p><?php _e('File uploaded!', $lg_text_domain) ?></p></div>
  169. <p><?php printf(__("Your file <code>%s</code> was uploaded successfully!", $lg_text_domain), $img1_name); ?></p>
  170. <p><?php _e('Here&#8217;s the code to display it in your posts:', $lg_text_domain) ?></p>
  171. <p><code><?php echo $piece_of_code; ?></code></p>
  172. <p>
  173. <strong><?php _e('Image Details') ?></strong>: <br />
  174. <?php _e('Name:'); ?>
  175. <?php echo $img1_name; ?>
  176. <br />
  177. <?php _e('Size:') ?>
  178. <?php echo round($img1_size / 1024, 2); ?> <?php _e('<abbr title="Kilobyte">KB</abbr>', $lg_text_domain) ?><br />
  179. <?php _e('Type:') ?>
  180. <?php echo $img1_type; ?>
  181. </p>
  182. <p><a href="options-general.php?page=lazyest-gallery/lazyest-admin.php&amp;captions=<?php echo $capdir; ?>"><?php _e('Upload another') ?></a></p>
  183. <?php
  184. break;
  185. }
  186. /* =================
  187. * End of Upload div
  188. * ================= */
  189. /* =================
  190. * Confirmations div
  191. * ================= */
  192. if (isset($_POST['yes'])) {
  193. if (!is_dir($_POST['delete_this'])) {
  194. if(@unlink($_POST['delete_this'])) {
  195. echo '<div id="message" class="updated fade"><p>'. __('File deleted successfully', $lg_text_domain) .'</p></div>';
  196. } else {
  197. echo '<div id="message" class="error fade"><p>'. __('Cannot delete file, maybe it has already been deleted or have wrong permissions', $lg_text_domain) .'</p></div>';
  198. }
  199. } else {
  200. if(lg_remove_directory($_POST['delete_this'])) {
  201. echo '<div id="message" class="updated fade"><p>'. __('Folder deleted successfully', $lg_text_domain) .'</p></div>';
  202. } else {
  203. echo '<div id="message" class="error fade"><p>'. __('Cannot delete folder: maybe it is already empty or have bad permissions', $lg_text_domain) .'</p></div>';
  204. }
  205. }
  206. // Unsetting informations
  207. unset($_POST);
  208. unset($_GET);
  209. }
  210. if (isset($_POST['no'])) {
  211. echo '<div id="message" class="updated fade"><p>'. __('Nothing Changed', $lg_text_domain) .'</p></div>';
  212. // Unsetting informations
  213. unset($_POST);
  214. unset($_GET);
  215. }
  216. /* =================
  217. * file deletion div
  218. * ================= */
  219. if (isset($_GET['file_to_delete']) && !isset($_POST['update_captions']) && !isset($_POST['upload'])) {
  220. ?>
  221. <div style="padding:10px;">
  222. <div style="text-align:center;padding:0px;color:red;border:1px solid #ff0000;background:#ffdddd">
  223. <?php
  224. _e('You are about to delete', $lg_text_domain);
  225. echo " <code>".basename($_GET['file_to_delete'])."</code><br />";
  226. echo __('Are you sure?', $lg_text_domain)."<br />";
  227. ?>
  228. <form name="delete_image_file" method="post" action="" style="padding:5px;">
  229. <div class="submit" style="text-align:center">
  230. <input type="submit" name="yes" value="<?php _e('Yes', $lg_text_domain); ?>" style="width:80px;" />
  231. <input type="submit" name="no" value="<?php _e('No', $lg_text_domain); ?>" style="width:80px;" />
  232. <input type="hidden" name="delete_this" value="<?php echo $_GET['file_to_delete']; ?>" />
  233. </div>
  234. </form>
  235. <?php
  236. echo "</div>\n</div>";
  237. }
  238. $imgfiles = get_imgfiles($capdir);
  239. $act_current = $capdir;
  240. ?>
  241. <fieldset class="options">
  242. <h2><?php echo sprintf(__('Captions page for <code>%s</code>', $lg_text_domain), $act_current); ?></h2>
  243. <!-- Shortcuts-->
  244. <div style="padding:5px;display:block;background:#efefef;border:1px solid #ccc;height:20px;">
  245. <a href="options-general.php?page=lazyest-gallery/lazyest-admin.php">&laquo; <?php _e('Admin page', $lg_text_domain); ?></a>
  246. </div>
  247. <!-- End of Shortcuts-->
  248. <br />
  249. <!-- Tip div -->
  250. <div style="padding:5px;border:1px solid #3fbd3f;background:#beffbe;color:#088000;">
  251. <?php _e('You can use HTML links but be sure to use "[" and "]" instead of "<" and ">"; something like [a href="somewhere"]Link[/a]', $lg_text_domain); ?>
  252. </div>
  253. <!-- End of tip div -->
  254. <form name="gallery_captions" method="post" action="">
  255. <input type="hidden" name="folder" value="<?php echo $act_current ?>"/>
  256. <table summary="thumbs" cellspacing="1" cellpadding="10">
  257. <tr>
  258. <!-- Folder Caption code -->
  259. <td colspan='2'><b>&raquo; <?php _e("Folder's description:", $lg_text_domain); ?></b>
  260. <?php $foldcap = clean_folder_caption($act_current, false);
  261. echo '<input type="text" name="folder_caption" value="'.$foldcap.'" size="80" style="width:98%" />';
  262. ?>
  263. <ul>
  264. <li>&raquo; <a href="?page=lazyest-gallery/lazyest-admin.php&amp;captions=<?php echo $act_current; ?>&amp;file_to_delete=<?php echo $gallery_root.$act_current.get_option('lg_thumb_folder') ?>" class="delete" style="display:inline;"><?php _e('Empty thumbs cache', $lg_text_domain); ?></a></li>
  265. <li>&raquo; <a href="?page=lazyest-gallery/lazyest-admin.php&amp;captions=<?php echo $act_current; ?>&amp;file_to_delete=<?php echo $gallery_root.$act_current.get_option('lg_slide_folder') ?>" class="delete" style="display:inline;"><?php _e('Empty slides cache', $lg_text_domain); ?></a></li>
  266. </ul>
  267. </td>
  268. </tr>
  269. <tr>
  270. <td colspan="2" style="text-algin: left;" ><b>&raquo; <?php _e('Minimum level to access this folder:', $lg_text_domain); ?></b>
  271. <select name="folder_minimum_level">
  272. <?php
  273. for ($i = 1; $i < 11; $i++) {
  274. if ($i == get_minimum_folder_level($act_current)) {
  275. $selected = " selected='selected'";
  276. } else {
  277. $selected = '0';
  278. }
  279. echo "\n\t<option value='$i' $selected>$i</option>";
  280. }
  281. ?>
  282. </select>
  283. <span style="font-size:x-small;text-align:center;padding:2px;color:red;border:1px solid #ff0000;background:#ffdddd">
  284. <?php _e('EXPERIMENTAL: Folder will be still browsable (if full path is known).', $lg_text_domain) ?>
  285. </span>
  286. </td>
  287. </tr>
  288. <!-- End of Folder Caption code -->
  289. <?php
  290. if (isset($imgfiles)) {
  291. foreach ($imgfiles as $img) {
  292. // clean_image_caption() function is in lazyest-gallery.php file
  293. // and checks if xml file exists, if not it returns false
  294. // we need a "clean" (with "<" and ">") caption
  295. $caption = clean_image_caption($img, $capdir);
  296. // this will removes HTML tags and used as title argument
  297. $title = ereg_replace("<[^>]*>", "", $caption);
  298. $righturl = urlencode($act_current.$img);
  299. echo '<tr><td><a href="'.get_option('lg_gallery_uri').'&amp;file='.$righturl.'">';
  300. // If thumbs cache system is enabled
  301. if (get_option('lg_enable_cache') == "TRUE"){
  302. // we check if thumbs exist
  303. if (!file_exists($gallery_root.$act_current.get_option('lg_thumb_folder').$img)) {
  304. // keeping track of subfolders
  305. $img_file_path = explode('/', $img);
  306. $img_index = count($img_file_path)-1;
  307. $img_file = $img_file_path[$img_index];
  308. // If there are subfolders
  309. if ($img_index > 1){
  310. for ($i = 1; $i < count($img_file_path)-1; $i++) {
  311. // set the new "current" directory
  312. $act_current .= $img_file_path[$i]."/";
  313. }
  314. }
  315. // if thumbs do not exist we create them
  316. createCache($act_current, $img, true);
  317. }
  318. // trimming spaces (XHTML Urls)
  319. $righturl = str_replace(" ", "%20", $gallery_address.$act_current.get_option('lg_thumb_folder').$img);
  320. echo '<img src="'.$righturl.'" alt="'.$img.'" title="'. $title . '" />';
  321. } else { // otherwise
  322. $righturl = str_replace(" ", "%20", get_option('siteurl')."/wp-content/plugins/lazyest-gallery/lazyest-img.php?file=". $act_current.$img."&amp;thumb=1");
  323. echo "<img src=".$righturl." alt=".$img." title=".$title." />";
  324. }
  325. // this time we need a "rebuilded" (with "" and "") caption
  326. $caption = clean_image_caption($img, $capdir, false);
  327. // this is a dynamic form name construct that we need for the captions system
  328. $form_name = str_replace('.', '_', $img);
  329. $form_name = str_replace(' ', '_', $form_name);
  330. echo '</a></td>';
  331. echo '<td>&raquo; '.$img.'<br />';
  332. // Inputs
  333. ?>
  334. <input type="text" name="<?php echo $form_name; ?>" value="<?php echo $caption; ?>" size="90" style="width:88%" />
  335. <a href="?page=lazyest-gallery/lazyest-admin.php&amp;captions=<?php echo $act_current; ?>&amp;file_to_delete=<?php echo $gallery_root.$act_current.$img ?>" class="button" style="display:inline;"><?php _e('Delete', $lg_text_domain); ?></a>
  336. <?php
  337. }
  338. }
  339. ?>
  340. </table>
  341. <div class="submit">
  342. <input type="hidden" name="directory" value="<?php echo $act_current ?>" />
  343. <input type="submit" name="update_captions" value="<?php _e('Update Folder', $lg_text_domain); ?>" />
  344. </div>
  345. </form>
  346. </fieldset>
  347. <!-- Upload section -->
  348. <fieldset class="dbx-box">
  349. <h3 title="click-down and drag to move this box" class="dbx-handle"><?php _e('Upload Image', $lg_text_domain) ?></h3>
  350. <div class="dbx-content">
  351. <?php upload_page($act_current); ?>
  352. </div><br /><br />
  353. </fieldset>
  354. <!-- Gallery structure section -->
  355. <fieldset class="dbx-box">
  356. <h3 title="click-down and drag to move this box" class="dbx-handle"><?php _e('Image Captions', $lg_text_domain) ?></h3>
  357. <div class="dbx-content">
  358. <?php lg_show_gallery_structure(); ?>
  359. </div>
  360. </fieldset>
  361. </div>
  362. <?php
  363. }
  364. /**
  365. * This function builds the xml file where images infos are stored
  366. * NOTE: $capdir stays for Captions Directory
  367. */
  368. function lg_generate_xml($capdir){
  369. global $gallery_root;
  370. if (is_writable($gallery_root.$capdir)){
  371. $imgfiles = get_imgfiles($capdir);
  372. // Check if $capdir ends with the "/" and providing one if not
  373. if (substr($capdir, strlen($capdir)-1, strlen($capdir)) != "/")
  374. $capdir .= "/";
  375. $handle = fopen($gallery_root.$capdir.'captions.xml', 'wb');
  376. fwrite($handle, "<?xml version='1.0' encoding='" . get_option('blog_charset') . "'?>\n");
  377. fwrite($handle, "<data>\n");
  378. // Folder caption
  379. $folder_caption = str_replace('\\', '', $_POST['folder_caption']);
  380. fwrite($handle, "\t<folder>".$folder_caption."</folder>\n");
  381. // Folder access level
  382. $folder_access = $_POST['folder_minimum_level'];
  383. fwrite($handle, "\t<level>".$folder_access."</level>\n");
  384. if (isset($imgfiles)) {
  385. foreach ($imgfiles as $img) {
  386. // prepare the strings to be written
  387. $form_value = str_replace('.', '_', $img);
  388. $form_value = str_replace(' ', '_', $form_value);
  389. $dirty_caption = $_POST[$form_value];
  390. $clean_caption = str_replace('\\', '', $dirty_caption);
  391. // write strings
  392. fwrite($handle, "\t<photo id='".$img."'>\n");
  393. fwrite($handle, "\t\t<caption>".$clean_caption ."</caption>\n");
  394. fwrite($handle, "\t</photo>\n");
  395. }
  396. }
  397. fwrite($handle, "</data>");
  398. fclose($handle);
  399. @chmod($gallery_root.$capdir.'captions.xml', 0666);
  400. }
  401. else {
  402. lg_cannot_rw($capdir);
  403. }
  404. }
  405. function lg_cannot_rw($rwdir){
  406. global $gallery_root;
  407. ?>
  408. <div style='background-color: rgb(207, 235, 247);' id='message' class='updated fade'>
  409. <b>WARNING:</b><br />
  410. <p>
  411. Unable to create xml file inside the folder. <br />
  412. File permissions are actually set to
  413. <b><?php echo substr(sprintf('%o', fileperms($gallery_root.$rwdir)), -4) ?></b><br />
  414. Try to set them to <b>777</b>
  415. </p>
  416. </div>
  417. <?php
  418. }
  419. // ============= Captions Utility Functions =============
  420. function lg_clear_directory($path) {
  421. if($dir_handle = opendir($path)) {
  422. while($file = readdir($dir_handle)) {
  423. if($file == "." || $file == "..") {
  424. continue;
  425. } else {
  426. unlink($path.$file);
  427. }
  428. }
  429. closedir($dir_handle);
  430. return true;
  431. // all files deleted
  432. } else {
  433. return false;
  434. // directory doesn't exist
  435. }
  436. }
  437. function lg_remove_directory($path) {
  438. if(lg_clear_directory($path)){
  439. if(rmdir($path)){
  440. return true;
  441. // directory removed
  442. } else {
  443. return false;
  444. // directory couldn't removed
  445. }
  446. } else {
  447. return false;
  448. // no empty directory
  449. }
  450. }
  451. // ================= Write Options Page ================
  452. /* This is the function that will build the form in the editor */
  453. function lg_build_smartlink_form(){
  454. }
  455. /* Adds the gallery browser form in the posts editor */
  456. function lg_add_gallery_browser(){
  457. lg_build_smartlink_form();
  458. }
  459. // =================== Upload functions =================
  460. function upload_page($upload) {
  461. global $gallery_root, $gallery_address;
  462. $folder = $gallery_root.$upload;
  463. if ( !get_option('lg_fileupload_minlevel') )
  464. die (__("You are not allowed to upload files", $lg_text_domain));
  465. $allowed_types = explode(' ', trim(strtolower(get_option('lg_fileupload_allowedtypes'))));
  466. foreach ($allowed_types as $type) {
  467. $type_tags[] = "<code>$type</code>";
  468. }
  469. $i = implode(', ', $type_tags);
  470. ?>
  471. <p><?php printf(__('You can upload files with the extension %1$s as long as they are no larger than %2$s <abbr title="Kilobytes">KB</abbr>.', $lg_text_domain), $i, get_option('lg_fileupload_maxk')); ?></p>
  472. <form action="" method="post" enctype="multipart/form-data">
  473. <p>
  474. <label for="img1"><?php _e('File:', $lg_text_domain) ?></label>
  475. <br />
  476. <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo get_option('lg_fileupload_maxk') * 1024 ?>" />
  477. <input type="file" name="img1" id="img1" size="100" />
  478. </p>
  479. <p><input type="submit" name="upload" class="button" value="<?php _e('Upload File', $lg_text_domain) ?>" /></p>
  480. </form>
  481. <?php
  482. }
  483. ?>