PageRenderTime 41ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/plugins/nextgen-gallery/admin/tinymce/window.php

https://github.com/archives-of-michigan/seekingmichigan.org-Wordpress
PHP | 152 lines | 139 code | 11 blank | 2 comment | 5 complexity | 0bf2c5c3cdc70a2d8570b1eaafac8116 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. // look up for the path
  3. require_once( dirname( dirname( dirname(__FILE__) ) ) . '/ngg-config.php');
  4. // check for rights
  5. if ( !is_user_logged_in() || !current_user_can('edit_posts') )
  6. wp_die(__("You are not allowed to be here"));
  7. global $wpdb;
  8. ?>
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11. <title>NextGEN Gallery</title>
  12. <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
  13. <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
  14. <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
  15. <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
  16. <script language="javascript" type="text/javascript" src="<?php echo NGGALLERY_URLPATH ?>admin/tinymce/tinymce.js"></script>
  17. <base target="_self" />
  18. </head>
  19. <body id="link" onload="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';document.getElementById('gallerytag').focus();" style="display: none">
  20. <!-- <form onsubmit="insertLink();return false;" action="#"> -->
  21. <form name="NextGEN" action="#">
  22. <div class="tabs">
  23. <ul>
  24. <li id="gallery_tab" class="current"><span><a href="javascript:mcTabs.displayTab('gallery_tab','gallery_panel');" onmousedown="return false;"><?php _e("Gallery", 'nggallery'); ?></a></span></li>
  25. <li id="album_tab"><span><a href="javascript:mcTabs.displayTab('album_tab','album_panel');" onmousedown="return false;"><?php _e("Album", 'nggallery'); ?></a></span></li>
  26. <li id="singlepic_tab"><span><a href="javascript:mcTabs.displayTab('singlepic_tab','singlepic_panel');" onmousedown="return false;"><?php _e("Picture", 'nggallery'); ?></a></span></li>
  27. </ul>
  28. </div>
  29. <div class="panel_wrapper">
  30. <!-- gallery panel -->
  31. <div id="gallery_panel" class="panel current">
  32. <br />
  33. <table border="0" cellpadding="4" cellspacing="0">
  34. <tr>
  35. <td nowrap="nowrap"><label for="gallerytag"><?php _e("Select gallery", 'nggallery'); ?></label></td>
  36. <td><select id="gallerytag" name="gallerytag" style="width: 200px">
  37. <option value="0"><?php _e("No gallery", 'nggallery'); ?></option>
  38. <?php
  39. $gallerylist = $wpdb->get_results("SELECT * FROM $wpdb->nggallery ORDER BY gid DESC");
  40. if(is_array($gallerylist)) {
  41. foreach($gallerylist as $gallery) {
  42. $name = ( empty($gallery->title) ) ? $gallery->name : $gallery->title;
  43. echo '<option value="' . $gallery->gid . '" >' . $gallery->gid . ' - ' . $name . '</option>' . "\n";
  44. }
  45. }
  46. ?>
  47. </select></td>
  48. </tr>
  49. <tr>
  50. <td nowrap="nowrap" valign="top"><label for="showtype"><?php _e("Show as", 'nggallery'); ?></label></td>
  51. <td><label><input name="showtype" type="radio" value="nggallery" checked="checked" /> <?php _e('Image list', 'nggallery') ;?></label><br />
  52. <label><input name="showtype" type="radio" value="slideshow" /> <?php _e('Slideshow', 'nggallery') ;?></label><br />
  53. <label><input name="showtype" type="radio" value="imagebrowser" /> <?php _e('Imagebrowser', 'nggallery') ;?></label></td>
  54. </tr>
  55. </table>
  56. </div>
  57. <!-- gallery panel -->
  58. <!-- album panel -->
  59. <div id="album_panel" class="panel">
  60. <br />
  61. <table border="0" cellpadding="4" cellspacing="0">
  62. <tr>
  63. <td nowrap="nowrap"><label for="albumtag"><?php _e("Select album", 'nggallery'); ?></label></td>
  64. <td><select id="albumtag" name="albumtag" style="width: 200px">
  65. <option value="0"><?php _e("No album", 'nggallery'); ?></option>
  66. <?php
  67. $albumlist = $wpdb->get_results("SELECT * FROM $wpdb->nggalbum ORDER BY id DESC");
  68. if(is_array($albumlist)) {
  69. foreach($albumlist as $album) {
  70. echo '<option value="' . $album->id . '" >' . $album->id . ' - ' . $album->name . '</option>'."\n";
  71. }
  72. }
  73. ?>
  74. </select></td>
  75. </tr>
  76. <tr>
  77. <td nowrap="nowrap" valign="top"><label for="showtype"><?php _e("Show as", 'nggallery'); ?></label></td>
  78. <td><label><input name="albumtype" type="radio" value="extend" checked="checked" /> <?php _e('Extended version', 'nggallery') ;?></label><br />
  79. <label><input name="albumtype" type="radio" value="compact" /> <?php _e('Compact version', 'nggallery') ;?></label></td>
  80. </tr>
  81. </table>
  82. </div>
  83. <!-- album panel -->
  84. <!-- single pic panel -->
  85. <div id="singlepic_panel" class="panel">
  86. <br />
  87. <table border="0" cellpadding="4" cellspacing="0">
  88. <tr>
  89. <td nowrap="nowrap"><label for="singlepictag"><?php _e("Select picture", 'nggallery'); ?></label></td>
  90. <td><select id="singlepictag" name="singlepictag" style="width: 200px">
  91. <option value="0"><?php _e("No picture", 'nggallery'); ?></option>
  92. <?php
  93. $picturelist = $wpdb->get_results("SELECT * FROM $wpdb->nggpictures ORDER BY pid DESC");
  94. if(is_array($picturelist)) {
  95. foreach($picturelist as $picture) {
  96. echo '<option value="' . $picture->pid . '" >'. $picture->pid . ' - ' . $picture->filename.'</option>'."\n";
  97. }
  98. }
  99. ?>
  100. </select></td>
  101. </tr>
  102. <tr>
  103. <td nowrap="nowrap"><?php _e("Width x Height", 'nggallery'); ?></td>
  104. <td><input type="text" size="5" id="imgWidth" name="imgWidth" value="320" /> x <input type="text" size="5" id="imgHeight" name="imgHeight" value="240" /></td>
  105. </tr>
  106. <tr>
  107. <td nowrap="nowrap" valign="top"><?php _e("Effect", 'nggallery'); ?></td>
  108. <td>
  109. <label><select id="imgeffect" name="imgeffect">
  110. <option value="none"><?php _e("No effect", 'nggallery'); ?></option>
  111. <option value="watermark"><?php _e("Watermark", 'nggallery'); ?></option>
  112. <option value="web20"><?php _e("Web 2.0", 'nggallery'); ?></option>
  113. </select></label>
  114. </td>
  115. </tr>
  116. <tr>
  117. <td nowrap="nowrap" valign="top"><?php _e("Float", 'nggallery'); ?></td>
  118. <td>
  119. <label><select id="imgfloat" name="imgfloat">
  120. <option value=""><?php _e("No float", 'nggallery'); ?></option>
  121. <option value="left"><?php _e("Left", 'nggallery'); ?></option>
  122. <option value="center"><?php _e("Center", 'nggallery'); ?></option>
  123. <option value="right"><?php _e("Right", 'nggallery'); ?></option>
  124. </select></label>
  125. </td>
  126. </tr>
  127. </table>
  128. </div>
  129. <!-- single pic panel -->
  130. </div>
  131. <div class="mceActionPanel">
  132. <div style="float: left">
  133. <input type="button" id="cancel" name="cancel" value="<?php _e("Cancel", 'nggallery'); ?>" onclick="tinyMCEPopup.close();" />
  134. </div>
  135. <div style="float: right">
  136. <input type="submit" id="insert" name="insert" value="<?php _e("Insert", 'nggallery'); ?>" onclick="insertNGGLink();" />
  137. </div>
  138. </div>
  139. </form>
  140. </body>
  141. </html>