PageRenderTime 30ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/wp-homepage-slideshow/html/edit_image.php

https://bitbucket.org/lgorence/quickpress
PHP | 94 lines | 83 code | 6 blank | 5 comment | 3 complexity | 372783e2a00490f87779be85cdd53c22 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, AGPL-1.0
  1. <?php
  2. ini_set('display_errors', 1);
  3. error_reporting(E_ALL);
  4. /** Load WordPress Administration Bootstrap */
  5. $path = dirname(dirname(dirname(dirname(dirname(__FILE__)))));
  6. require_once $path . '/wp-admin/admin.php';
  7. //require_once $path . '/wp-admin/includes/screen.php';
  8. //require_once $path . '/wp-admin/includes/plugin.php';
  9. //require_once $path . '/wp-admin/includes/template.php';
  10. //require_once $path . '/wp-admin/admin-header.php';
  11. global $wpdb, $ghss;
  12. $album_id = (int)$_REQUEST['album_id'];
  13. $image_id = (int)$_REQUEST['hss_image_id'];
  14. if( !($album = $ghss->hss_get_album($album_id)) )
  15. {
  16. die('Album id does not exists');
  17. }
  18. if( !($image = $ghss->get_image($image_id)) )
  19. {
  20. die('Invalid image id');
  21. }
  22. ?>
  23. <?php if( function_exists('_wp_admin_html_begin') ): _wp_admin_html_begin(); else:?>
  24. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  25. <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
  26. <head>
  27. <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
  28. <?php endif;?>
  29. <title></title>
  30. <?php
  31. wp_enqueue_style( 'colors' );
  32. wp_enqueue_style( 'ie' );
  33. wp_enqueue_script('utils');
  34. wp_enqueue_script('jquery');
  35. do_action('admin_enqueue_scripts', $hook_suffix);
  36. do_action("admin_print_styles-$hook_suffix");
  37. do_action('admin_print_styles');
  38. do_action("admin_print_scripts-$hook_suffix");
  39. do_action('admin_print_scripts');
  40. do_action("hss_admin_head-$hook_suffix");
  41. do_action('hss_admin_head');
  42. ?>
  43. </head>
  44. <body>
  45. <div id="wpwrap">
  46. <!-- <div id="wpcontent"> -->
  47. <?php do_action('in_admin_header'); ?>
  48. <div id="wpbody"><!-- <div id="wpbody-content"> -->
  49. <div class="wrap" style="padding: 12px;">
  50. <h2 style="margin-left: 5px !important;"><?php _e('Edit Image'); ?></h2>
  51. <form id="edit_album_form" action="<?php print admin_url() ?>" method="post" enctype="multipart/form-data">
  52. <input type="hidden" name="task" value="hss_single_image_upload" />
  53. <input type="hidden" name="TB_iframe" value="1" />
  54. <input type="hidden" name="album_id" value="<?php print $album_id; ?>" />
  55. <input type="hidden" name="image_id" value="<?php print $image_id; ?>" />
  56. <input type="hidden" name="image_thumb" value="generate" />
  57. <table>
  58. <tr>
  59. <td><label><?php _e('Image Title'); ?></label></td>
  60. <td><input type="text" id="image_title" name="image_title" value="<?php print $image['title']; ?>" /></td>
  61. </tr>
  62. <tr>
  63. <td><label><?php _e('Image Description'); ?></label></td>
  64. <td><textarea id="image_description" name="image_description"><?php print $image['description']; ?></textarea></td>
  65. </tr>
  66. <tr>
  67. <td><label><?php _e('View more Link'); ?></label></td>
  68. <td><input type="text" id="image_link" name="image_link" value="<?php print @$image['link']; ?>" /></td>
  69. </tr>
  70. <tr>
  71. <td><label><?php _e('Image file'); ?></label></td>
  72. <td>
  73. <input type="file" name="image_file" value="" />
  74. <img src="<?php print hss_get_album_url($album_id) . '/thumb/' . $image['thumb']; ?>" />
  75. </td>
  76. </tr>
  77. </table>
  78. <p>
  79. <button type="submit" class="button-primary"><?php _e('Save'); ?></button>
  80. </p>
  81. </form>
  82. </div>
  83. </div><!-- </div> -->
  84. <!-- </div> -->
  85. </div>
  86. <?php //include $path . '/wp-admin/admin-footer.php'; ?>
  87. </body>
  88. </html>