NextCellent Gallery – NextGEN Legacy - Version 1.9.14

Version Description

  • 01.09.2013 =
  • The plugin will deactivate if NextGEN (all versions) plugin is installed & activated
  • text messages were adjusted to this plugin, to avoid user confusion.
Download this release

Release Info

Developer WPReady
Plugin Icon NextCellent Gallery – NextGEN Legacy
Version 1.9.14
Comparing to
See all releases

Version 1.9.14

Files changed (147) hide show
  1. admin/about.php +168 -0
  2. admin/addgallery.php +545 -0
  3. admin/admin.php +576 -0
  4. admin/ajax.php +450 -0
  5. admin/album.php +597 -0
  6. admin/css/images/dropdown.png +0 -0
  7. admin/css/images/ui-anim_basic_16x16.gif +0 -0
  8. admin/css/images/ui-icons_222222_256x240.png +0 -0
  9. admin/css/images/ui-icons_cccccc_256x240.png +0 -0
  10. admin/css/images/ui-icons_ffffff_256x240.png +0 -0
  11. admin/css/jquery.ui.css +140 -0
  12. admin/css/jquery.ui.tabs.css +158 -0
  13. admin/css/menu.css +3 -0
  14. admin/css/nggColorPicker.css +14 -0
  15. admin/css/ngg_social_media.css +33 -0
  16. admin/css/nggadmin.css +412 -0
  17. admin/css/tags-admin.css +10 -0
  18. admin/edit-thumbnail.php +171 -0
  19. admin/functions.php +1501 -0
  20. admin/images/facebook.png +0 -0
  21. admin/images/googleplus.png +0 -0
  22. admin/images/icon-paypal.gif +0 -0
  23. admin/images/icon-rating.png +0 -0
  24. admin/images/icon-translate.png +0 -0
  25. admin/images/marker_bottom.gif +0 -0
  26. admin/images/marker_middle.gif +0 -0
  27. admin/images/marker_top.gif +0 -0
  28. admin/images/menu-bits.gif +0 -0
  29. admin/images/nextgen.png +0 -0
  30. admin/images/nextgen_16_color.png +0 -0
  31. admin/images/nextgen_16_grey.png +0 -0
  32. admin/images/nextgen_32_color.png +0 -0
  33. admin/images/nextgen_32_grey.png +0 -0
  34. admin/images/select.png +0 -0
  35. admin/images/twitter.png +0 -0
  36. admin/index.html +0 -0
  37. admin/install.php +282 -0
  38. admin/js/Jcrop/css/Jcrop.gif +0 -0
  39. admin/js/Jcrop/css/jquery.Jcrop.css +35 -0
  40. admin/js/Jcrop/js/jquery.Jcrop.js +1197 -0
  41. admin/js/colorpicker/css/colorpicker.css +161 -0
  42. admin/js/colorpicker/images/blank.gif +0 -0
  43. admin/js/colorpicker/images/colorpicker_background.png +0 -0
  44. admin/js/colorpicker/images/colorpicker_hex.png +0 -0
  45. admin/js/colorpicker/images/colorpicker_hsb_b.png +0 -0
  46. admin/js/colorpicker/images/colorpicker_hsb_h.png +0 -0
  47. admin/js/colorpicker/images/colorpicker_hsb_s.png +0 -0
  48. admin/js/colorpicker/images/colorpicker_indic.gif +0 -0
  49. admin/js/colorpicker/images/colorpicker_overlay.png +0 -0
  50. admin/js/colorpicker/images/colorpicker_rgb_b.png +0 -0
  51. admin/js/colorpicker/images/colorpicker_rgb_g.png +0 -0
  52. admin/js/colorpicker/images/colorpicker_rgb_r.png +0 -0
  53. admin/js/colorpicker/images/colorpicker_select.gif +0 -0
  54. admin/js/colorpicker/images/colorpicker_submit.png +0 -0
  55. admin/js/colorpicker/images/custom_background.png +0 -0
  56. admin/js/colorpicker/images/custom_hex.png +0 -0
  57. admin/js/colorpicker/images/custom_hsb_b.png +0 -0
  58. admin/js/colorpicker/images/custom_hsb_h.png +0 -0
  59. admin/js/colorpicker/images/custom_hsb_s.png +0 -0
  60. admin/js/colorpicker/images/custom_indic.gif +0 -0
  61. admin/js/colorpicker/images/custom_rgb_b.png +0 -0
  62. admin/js/colorpicker/images/custom_rgb_g.png +0 -0
  63. admin/js/colorpicker/images/custom_rgb_r.png +0 -0
  64. admin/js/colorpicker/images/custom_submit.png +0 -0
  65. admin/js/colorpicker/images/select.png +0 -0
  66. admin/js/colorpicker/images/select2.png +0 -0
  67. admin/js/colorpicker/images/slider.png +0 -0
  68. admin/js/colorpicker/js/colorpicker.js +484 -0
  69. admin/js/jquery.MultiFile.js +535 -0
  70. admin/js/jquery.MultiFile.pack.js +11 -0
  71. admin/js/jquery.ui.autocomplete.js +612 -0
  72. admin/js/jquery.ui.autocomplete.min.js +32 -0
  73. admin/js/jqueryFileTree/images/directory.png +0 -0
  74. admin/js/jqueryFileTree/images/folder_open.png +0 -0
  75. admin/js/jqueryFileTree/images/spinner.gif +0 -0
  76. admin/js/jqueryFileTree/jqueryFileTree.css +81 -0
  77. admin/js/jqueryFileTree/jqueryFileTree.js +98 -0
  78. admin/js/ngg.ajax.js +118 -0
  79. admin/js/ngg.autocomplete.js +77 -0
  80. admin/js/ngg.progressbar.js +96 -0
  81. admin/js/ngg_social_media.js +8 -0
  82. admin/js/plupload.handler.js +244 -0
  83. admin/js/swfupload.handler.js +153 -0
  84. admin/manage-galleries.php +427 -0
  85. admin/manage-images.php +715 -0
  86. admin/manage-sort.php +122 -0
  87. admin/manage.php +657 -0
  88. admin/media-upload.php +282 -0
  89. admin/overview.php +854 -0
  90. admin/publish.php +64 -0
  91. admin/roles.php +140 -0
  92. admin/rotate.php +94 -0
  93. admin/settings.php +938 -0
  94. admin/setup.php +58 -0
  95. admin/showmeta.php +124 -0
  96. admin/style.php +252 -0
  97. admin/tags.php +292 -0
  98. admin/templates/facebook_like_button.php +2 -0
  99. admin/templates/social_media_buttons.php +4 -0
  100. admin/templates/twitter_follow_link.php +8 -0
  101. admin/tinymce/editor_plugin.js +77 -0
  102. admin/tinymce/langs/de.js +6 -0
  103. admin/tinymce/langs/de_de.js +6 -0
  104. admin/tinymce/langs/en.js +6 -0
  105. admin/tinymce/langs/en_US.js +6 -0
  106. admin/tinymce/nextgen.gif +0 -0
  107. admin/tinymce/tinymce.js +75 -0
  108. admin/tinymce/tinymce.php +102 -0
  109. admin/tinymce/window.php +152 -0
  110. admin/upload.php +49 -0
  111. admin/wpmu.php +117 -0
  112. changelog.txt +5 -0
  113. css/Black_Minimalism.css +375 -0
  114. css/albumset.gif +0 -0
  115. css/hovereffect.css +425 -0
  116. css/ngg_dkret3.css +318 -0
  117. css/ngg_k2.css +330 -0
  118. css/ngg_shadow.css +371 -0
  119. css/ngg_shadow2.css +379 -0
  120. css/nggallery.css +403 -0
  121. css/shadow.gif +0 -0
  122. css/shadowAlpha.png +0 -0
  123. fonts/arial.ttf +0 -0
  124. images/ajax-loader.gif +0 -0
  125. images/loader.gif +0 -0
  126. images/mrss-icon.gif +0 -0
  127. images/piclens.gif +0 -0
  128. index.html +0 -0
  129. js/jquery.cycle.all.js +1491 -0
  130. js/jquery.cycle.all.min.js +1 -0
  131. js/ngg.js +188 -0
  132. js/ngg.slideshow.js +138 -0
  133. js/ngg.slideshow.min.js +1 -0
  134. lang/nggallery-de_DE.mo +0 -0
  135. lang/nggallery-de_DE.po +3956 -0
  136. lang/nggallery.pot +3640 -0
  137. lib/core.php +591 -0
  138. lib/gd.thumbnail.inc.php +944 -0
  139. lib/image.php +223 -0
  140. lib/imagemagick.inc.php +598 -0
  141. lib/locale.php +152 -0
  142. lib/media-rss.php +246 -0
  143. lib/meta.php +574 -0
  144. lib/multisite.php +57 -0
  145. lib/navigation.php +120 -0
  146. lib/ngg-db.php +1113 -0
  147. lib/post-thumbnail.php +163 -0
admin/about.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ function nggallery_admin_about() {
5
+
6
+ ?>
7
+
8
+ <div class="wrap">
9
+ <?php include('templates/social_media_buttons.php'); ?>
10
+ <?php screen_icon( 'nextgen-gallery' ); ?>
11
+ <h2><?php _e('Copyright notes / Credits', 'nggallery') ;?></h2>
12
+ <div id="poststuff">
13
+ <div class="postbox">
14
+ <h3 class="hndle"><span><?php _e('NextCellent', 'nggallery'); ?></span></h3>
15
+ <div class="inside">
16
+ <p><?php _e('NextCellent Gallery is based on code due by <a href="http://www.photocrati.com" target="_blank">Photocrati Media</a>. We\'d like to offer a special thanks to Alex Rabe, who first developed the plugin and maintained it through 2011. There are many others who have made contributions:', 'nggallery') ;?></p>
17
+ <p><?php ngg_list_contributors(); ?></p>
18
+ </div>
19
+ </div>
20
+ <div class="postbox">
21
+ <h3 class="hndle"><span><?php _e('Contributors / Tribute to', 'nggallery'); ?></span></h3>
22
+ <div class="inside">
23
+ <p><?php _e('If you study the code of this plugin, you\'ll find we\'ve included a lot of good, existing code and ideas. We\'d like to thank the following people for their work:', 'nggallery') ;?></p>
24
+ <ul class="ngg-list">
25
+ <li><a href="http://wordpress.org" target="_blank">The WordPress Team</a> <?php _e('for their great documented code', 'nggallery') ;?></li>
26
+ <li><a href="http://jquery.com" target="_blank">The jQuery Team</a> <?php _e('for jQuery, which is the best Web2.0 framework', 'nggallery') ;?></li>
27
+ <li><a href="http://www.gen-x-design.com" target="_blank">Ian Selby</a> <?php _e('for the fantastic PHP Thumbnail Class', 'nggallery') ;?></li>
28
+ <li><a href="http://www.lesterchan.net/" target="_blank">GaMerZ</a> <?php _e('for a lot of very useful plugins and ideas', 'nggallery') ;?></li>
29
+ <li><a href="http://www.laptoptips.ca/" target="_blank">Andrew Ozz</a> <?php _e('for Shutter Reloaded, a real lightweight image effect', 'nggallery') ;?></li>
30
+ <li><a href="http://www.jeroenwijering.com/" target="_blank">Jeroen Wijering</a> <?php _e('for the best Media Flash Scripts on earth', 'nggallery') ;?></li>
31
+ <li><a href="http://field2.com" target="_blank">Ben Dunkle</a> <?php _e('for the Gallery Icon', 'nggallery') ;?></li>
32
+ <li><a href="http://watermark.malcherek.com/" target="_blank">Marek Malcherek</a> <?php _e('for the Watermark plugin', 'nggallery') ;?></li>
33
+ </ul>
34
+ <p><?php _e('If you don\'t see your name on this list and we\'ve integrated some of your code into the plugin, don\'t hesitate to email us.', 'nggallery') ;?></p>
35
+ </div>
36
+ </div>
37
+ <div class="postbox">
38
+ <h3 class="hndle"><span><?php _e('How to support ?', 'nggallery'); ?></span></h3>
39
+ <div class="inside">
40
+ <p><?php _e('There are several ways to contribute:', 'nggallery') ;?></p>
41
+ <ul class="ngg-list">
42
+ <li><strong><?php _e('Send us bugfixes / code changes', 'nggallery') ;?></strong><br /><?php _e('The most motivated support for this plugin are your ideas and brain work.', 'nggallery') ;?></li>
43
+ <li><strong><?php _e('Translate the plugin', 'nggallery') ;?></strong><br /><?php _e('To help people to work with this plugin, we would like to have it in all available languages.', 'nggallery') ;?></li>
44
+ <li><strong><?php _e('Place a link to the plugin in your blog/webpage', 'nggallery') ;?></strong><br /><?php _e('Yes, sharing and linking are also supportive and helpful.', 'nggallery') ;?></li>
45
+ </ul>
46
+ </div>
47
+ </div>
48
+ <div class="postbox" id="donators">
49
+ <h3 class="hndle"><span><?php _e('Thanks!', 'nggallery'); ?></span></h3>
50
+ <div class="inside">
51
+ <p><?php _e('We would like to thank the following people who have supported the NextGEN Gallery plugin:', 'nggallery'); ?></p>
52
+ <p><a href="http://www.boelinger.com/heike/" target="_blank">HEIKE</a>, <?php ngg_list_support(); ?></p>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </div>
57
+
58
+ <?php
59
+ }
60
+
61
+ function ngg_list_contributors() {
62
+ /* The list of my contributors. Thanks to all of them !*/
63
+
64
+ $contributors = array(
65
+ 'Anty (Code contributor)' => 'http://www.anty.at/',
66
+ 'Bjoern von Prollius (Code contributor)' => 'http://www.prollius.de/',
67
+ 'Simone Fumagalli (Code contributor)' => 'http://www.iliveinperego.com/',
68
+ 'Vincent Prat (Code contributor)' => 'http://www.vincentprat.info',
69
+ 'Frederic De Ranter (AJAX code contributor)' => 'http://li.deranter.com/',
70
+ 'Christian Arnold (Code contributor)' => 'http://blog.arctic-media.de/',
71
+ 'Thomas Matzke (Album code contributor)' => 'http://mufuschnu.mu.funpic.de/',
72
+ 'KeViN (Sidebar Widget developer)' => 'http://www.kev.hu/',
73
+ 'Lazy (German Translation)' => 'http://www.lazychris.de/',
74
+ 'Lise (French Translation)' => 'http://liseweb.fr/',
75
+ 'Anja (Dutch Translation)' => 'http://www.werkgroepen.net/wordpress',
76
+ 'Adrian (Indonesian Translation)' => 'http://adrian.web.id/',
77
+ 'Gaspard Tseng / SillyCCSmile (Chinese Translation)' => '',
78
+ 'Mika Pennanen (Finnish Translation)' => 'http://kapsi.fi/~penni',
79
+ 'Wojciech Owczarek (Polish Translation)' => 'http://www.owczi.net',
80
+ 'Dilip Ramirez (Spanish Translation)' => 'http://jmtd.110mb.com/blog',
81
+ 'Oleinikov Vedmak Evgeny (Russian Translation)' => 'http://ka-2-03.mirea.org/',
82
+ 'Sebastien MALHERBE (Logo design)' => 'http://www.7vision.com/',
83
+ 'Claudia (German documentation)' => 'http://www.blog-werkstatt.de/',
84
+ 'Robert (German documentation)' => 'http://www.curlyrob.de/',
85
+ 'Pierpaolo Mannone (Italian Translation)' => 'http://www.interscambiocasa.com/',
86
+ 'Mattias Tengblad (Swedish Translation)' => 'http://wp-support.se/',
87
+ 'M&uuml;fit Kiper (Swedish Translation)' => 'http://www.kiper.se/',
88
+ 'Gil Yaker (Documentation)' => 'http://bamboosoup.com/',
89
+ 'Morten Johansen (Danish Translation)' => 'http://www.fr3ak.dk/',
90
+ 'Vidar Seland (Norwegian Translation)' => 'http://www.viidar.net/',
91
+ 'Emre G&uuml;ler (Turkish Translation)' => 'http://www.emreguler.com/',
92
+ 'Emilio Lauretti (Italian Translation)' => '',
93
+ 'Jan Angelovic (Czech Translation)' => 'http://www.angelovic.cz/',
94
+ 'Laki (Slovak Translation)' => 'http://www.laki.sk/',
95
+ 'Rowan Crane (WPMU support)' => 'http://blog.rowancrane.com/',
96
+ 'Kuba Zwolinski (Polish Translation)' => 'http://kubazwolinski.com/',
97
+ 'Rina Jiang (Chinese Translation)' => 'http://http://mysticecho.net/',
98
+ 'Anthony (Chinese Translation)' => 'http://www.angryouth.com/',
99
+ 'Milan Vasicek (Czech Translation)' => 'http://www.NoWorkTeam.cz/',
100
+ 'Joo Gi-young (Korean Translation)' => 'http://lombric.linuxstudy.pe.kr/wp/',
101
+ 'Oleg A. Safonov (Russian Translation)' => 'http://blog.olart.ru',
102
+ 'AleXander Kirichev (Bulgarian Translation)' => 'http://xsakex.art-bg.org/',
103
+ 'Richer Yang (Chinese Translation)' => 'http://fantasyworld.idv.tw/',
104
+ 'Bill Jones (Forums contributor)' => 'http://jonesphoto.bluehorizoninternet.com/',
105
+ 'TheDonSansone (Forums contributor)' => 'http://abseiling.200blogs.co.uk/',
106
+ 'Komyshov (Russian Translation)' => 'http://kf-web.ru/',
107
+ 'aleX Zhang (Chinese Translation)' => 'http://zhangfei.info/',
108
+ 'TheSoloist (Chinese Translation)' => 'http://www.soloist-ic.cn/',
109
+ 'Nica Luigi Cristian (Romanian Translation)' => 'http://www.cristiannica.com/',
110
+ 'Zdenek Hatas (Czech Translation)' => '',
111
+ 'David Potter (Documentation and Help)' => 'http://dpotter.net/',
112
+ 'Carlale Chen (Chinese Translation)' => 'http://0-o-0.cc/',
113
+ 'Nica Luigi Cristian (Romanian Translation)' => 'http://www.cristiannica.com/',
114
+ 'Igor Shevkoplyas (Russian Translation)' => 'http://www.russian-translation-matters.com',
115
+ 'Alexandr Kindras (Code contributor)' => 'http://www.fixdev.com',
116
+ 'Manabu Togawa (Japanese Translation)' => 'http://www.churadesign.com/',
117
+ 'Serhiy Tretyak (Ukrainian Translation)' => 'http://designpoint.com.ua/',
118
+ 'Janis Grinvalds (Latvian Translation)' => 'http://riga.bmxrace.lv/',
119
+ 'Kristoffer Th&oslash;ring (Norwegian Translation)' => '',
120
+ 'Flactarus (Italian Translation)' => 'http://www.giroevago.it',
121
+ 'Felip Alfred Galit&oacute; i Trilla (Catalan Translation)' => 'http://www.bratac.cat',
122
+ 'Luka Komac (Slovenian Translation)' => 'http://www.komac.biz',
123
+ 'Dimitris Ikonomou / Nikos Mouratidis (Greek Translation)' => 'http://www.kepik.gr'
124
+ );
125
+
126
+ ksort($contributors);
127
+ $i = count($contributors);
128
+ foreach ($contributors as $name => $url)
129
+ {
130
+ if ($url)
131
+ echo "<a href=\"$url\" target=\"_blank\">$name</a>";
132
+ else
133
+ echo $name;
134
+ $i--;
135
+ if ($i == 1)
136
+ echo " & ";
137
+ elseif ($i)
138
+ echo ", ";
139
+ }
140
+ }
141
+
142
+ function ngg_list_support() {
143
+ /* The list of my supporters. Thanks to all of them !*/
144
+
145
+ global $ngg;
146
+
147
+ $supporter = nggAdminPanel::get_remote_array($ngg->donators);
148
+
149
+ // Ensure that this is a array
150
+ if ( !is_array($supporter) )
151
+ return _e('and all donators...', 'nggallery');
152
+
153
+ ksort($supporter);
154
+ $i = count($supporter);
155
+ foreach ($supporter as $name => $url)
156
+ {
157
+ if ($url)
158
+ echo "<a href=\"$url\" target=\"_blank\">$name</a>";
159
+ else
160
+ echo $name;
161
+ $i--;
162
+ if ($i == 1)
163
+ echo " & ";
164
+ elseif ($i)
165
+ echo ", ";
166
+ }
167
+ }
168
+ ?>
admin/addgallery.php ADDED
@@ -0,0 +1,545 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ class nggAddGallery {
5
+
6
+ /**
7
+ * PHP4 compatibility layer for calling the PHP5 constructor.
8
+ *
9
+ */
10
+ function nggAddGallery() {
11
+ return $this->__construct();
12
+ }
13
+
14
+ /**
15
+ * nggAddGallery::__construct()
16
+ *
17
+ * @return void
18
+ */
19
+ function __construct() {
20
+
21
+ // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
22
+ $this->filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
23
+
24
+ //Look for POST updates
25
+ if ( !empty($_POST) )
26
+ $this->processor();
27
+ }
28
+
29
+ /**
30
+ * Perform the upload and add a new hook for plugins
31
+ *
32
+ * @return void
33
+ */
34
+ function processor() {
35
+ global $wpdb, $ngg, $nggdb;
36
+
37
+ $defaultpath = $ngg->options['gallerypath'];
38
+
39
+ if ( isset($_POST['addgallery']) ){
40
+ check_admin_referer('ngg_addgallery');
41
+
42
+ if ( !nggGallery::current_user_can( 'NextGEN Add new gallery' ))
43
+ wp_die(__('Cheatin&#8217; uh?'));
44
+
45
+ $newgallery = esc_attr( $_POST['galleryname']);
46
+ if ( !empty($newgallery) )
47
+ nggAdmin::create_gallery($newgallery, $defaultpath);
48
+ }
49
+
50
+ if ( isset($_POST['zipupload']) ){
51
+ check_admin_referer('ngg_addgallery');
52
+
53
+ if ( !nggGallery::current_user_can( 'NextGEN Upload a zip' ))
54
+ wp_die(__('Cheatin&#8217; uh?'));
55
+
56
+ if ($_FILES['zipfile']['error'] == 0 || (!empty($_POST['zipurl'])))
57
+ nggAdmin::import_zipfile( intval( $_POST['zipgalselect'] ) );
58
+ else
59
+ nggGallery::show_error( __('Upload failed!','nggallery') );
60
+ }
61
+
62
+ if ( isset($_POST['importfolder']) ){
63
+ check_admin_referer('ngg_addgallery');
64
+
65
+ if ( !nggGallery::current_user_can( 'NextGEN Import image folder' ))
66
+ wp_die(__('Cheatin&#8217; uh?'));
67
+
68
+ $galleryfolder = $_POST['galleryfolder'];
69
+ if ( ( !empty($galleryfolder) ) AND ($defaultpath != $galleryfolder) )
70
+ nggAdmin::import_gallery($galleryfolder);
71
+ }
72
+
73
+ if ( isset($_POST['uploadimage']) ){
74
+ check_admin_referer('ngg_addgallery');
75
+
76
+ if ( !nggGallery::current_user_can( 'NextGEN Upload in all galleries' ))
77
+ wp_die(__('Cheatin&#8217; uh?'));
78
+
79
+ if ( $_FILES['imagefiles']['error'][0] == 0 )
80
+ $messagetext = nggAdmin::upload_images();
81
+ else
82
+ nggGallery::show_error( __('Upload failed! ' . nggAdmin::decode_upload_error( $_FILES['imagefiles']['error'][0]),'nggallery') );
83
+ }
84
+
85
+ if ( isset($_POST['swf_callback']) ){
86
+ if ($_POST['galleryselect'] == '0' )
87
+ nggGallery::show_error(__('No gallery selected !','nggallery'));
88
+ else {
89
+ if ($_POST['swf_callback'] == '-1' )
90
+ nggGallery::show_error( __('Upload failed! ','nggallery') );
91
+ else {
92
+ $gallery = $nggdb->find_gallery( (int) $_POST['galleryselect'] );
93
+ nggAdmin::import_gallery( $gallery->path );
94
+ }
95
+ }
96
+ }
97
+
98
+ if ( isset($_POST['disable_flash']) ){
99
+ check_admin_referer('ngg_addgallery');
100
+ $ngg->options['swfUpload'] = false;
101
+ update_option('ngg_options', $ngg->options);
102
+ }
103
+
104
+ if ( isset($_POST['enable_flash']) ){
105
+ check_admin_referer('ngg_addgallery');
106
+ $ngg->options['swfUpload'] = true;
107
+ update_option('ngg_options', $ngg->options);
108
+ }
109
+
110
+ do_action( 'ngg_update_addgallery_page' );
111
+
112
+ }
113
+
114
+ /**
115
+ * Render the page content
116
+ *
117
+ * @return void
118
+ */
119
+ function controller() {
120
+ global $ngg, $nggdb;
121
+
122
+ // check for the max image size
123
+ $this->maxsize = nggGallery::check_memory_limit();
124
+
125
+ //get all galleries (after we added new ones)
126
+ $this->gallerylist = $nggdb->find_all_galleries('gid', 'DESC');
127
+
128
+ $this->defaultpath = $ngg->options['gallerypath'];
129
+
130
+ // link for the flash file
131
+ $swf_upload_link = admin_url('/?nggupload');
132
+
133
+ // get list of tabs
134
+ $tabs = $this->tabs_order();
135
+
136
+ // with this filter you can add custom file types
137
+ $file_types = apply_filters( 'ngg_swf_file_types', '*.jpg;*.jpeg;*.gif;*.png;*.JPG;*.JPEG;*.GIF;*.PNG' );
138
+
139
+ // Set the post params, which plupload will post back with the file, and pass them through a filter.
140
+ $post_params = array(
141
+ "auth_cookie" => (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]),
142
+ "logged_in_cookie" => $_COOKIE[LOGGED_IN_COOKIE],
143
+ "_wpnonce" => wp_create_nonce('ngg_swfupload'),
144
+ "galleryselect" => "0",
145
+ );
146
+ $p = array();
147
+
148
+ foreach ( $post_params as $param => $val ) {
149
+ $val = esc_js( $val );
150
+ $p[] = "'$param' : '$val'";
151
+ }
152
+
153
+ $post_params_str = implode( ',', $p ). "\n";
154
+ ?>
155
+
156
+ <?php include('templates/social_media_buttons.php'); ?>
157
+
158
+ <?php if($ngg->options['swfUpload'] && !empty ($this->gallerylist) ) { ?>
159
+ <?php if ( defined('IS_WP_3_3') ) { ?>
160
+ <!-- plupload script -->
161
+ <script type="text/javascript">
162
+ //<![CDATA[
163
+ var resize_height = <?php echo (int) $ngg->options['imgHeight']; ?>,
164
+ resize_width = <?php echo (int) $ngg->options['imgWidth']; ?>;
165
+
166
+ jQuery(document).ready(function($) {
167
+ window.uploader = new plupload.Uploader({
168
+ runtimes: '<?php echo apply_filters('plupload_runtimes', 'html5,flash,silverlight,html4,'); ?>',
169
+ browse_button: 'plupload-browse-button',
170
+ container: 'plupload-upload-ui',
171
+ drop_element: 'uploadimage',
172
+ file_data_name: 'Filedata',
173
+ max_file_size: '<?php echo round( (int) wp_max_upload_size() / 1024 ); ?>kb',
174
+ url: '<?php echo esc_js( $swf_upload_link ); ?>',
175
+ flash_swf_url: '<?php echo esc_js( includes_url('js/plupload/plupload.flash.swf') ); ?>',
176
+ silverlight_xap_url: '<?php echo esc_js( includes_url('js/plupload/plupload.silverlight.xap') ); ?>',
177
+ filters: [
178
+ {title: '<?php echo esc_js( __('Image Files', 'nggallery') ); ?>', extensions: '<?php echo esc_js( str_replace( array('*.', ';'), array('', ','), $file_types) ); ?>'}
179
+ ],
180
+ multipart: true,
181
+ urlstream_upload: true,
182
+ multipart_params : {
183
+ <?php echo $post_params_str; ?>
184
+ },
185
+ debug: false,
186
+ preinit : {
187
+ Init: function(up, info) {
188
+ debug('[Init]', 'Info :', info, 'Features :', up.features);
189
+ if (navigator.appVersion.indexOf("MSIE 10") > -1) {
190
+ up.features.triggerDialog = true;
191
+ }
192
+ initUploader();
193
+ }
194
+ },
195
+ i18n : {
196
+ 'remove' : '<?php _e('remove', 'nggallery') ;?>',
197
+ 'browse' : '<?php _e('Browse...', 'nggallery') ;?>',
198
+ 'upload' : '<?php _e('Upload images', 'nggallery') ;?>'
199
+ }
200
+ });
201
+
202
+ uploader.bind('FilesAdded', function(up, files) {
203
+ $.each(files, function(i, file) {
204
+ fileQueued(file);
205
+ });
206
+
207
+ up.refresh();
208
+ });
209
+
210
+ uploader.bind('BeforeUpload', function(up, file) {
211
+ uploadStart(file);
212
+ });
213
+
214
+ uploader.bind('UploadProgress', function(up, file) {
215
+ uploadProgress(file, file.loaded, file.size);
216
+ });
217
+
218
+ uploader.bind('Error', function(up, err) {
219
+ uploadError(err.file, err.code, err.message);
220
+
221
+ up.refresh();
222
+ });
223
+
224
+ uploader.bind('FileUploaded', function(up, file, response) {
225
+ uploadSuccess(file, response);
226
+ });
227
+
228
+ uploader.bind('UploadComplete', function(up, file) {
229
+ uploadComplete(file);
230
+ });
231
+
232
+ // on load change the upload to plupload
233
+ uploader.init();
234
+
235
+ nggAjaxOptions = {
236
+ header: "<?php _e('Upload images', 'nggallery') ;?>",
237
+ maxStep: 100
238
+ };
239
+
240
+ });
241
+ //]]>
242
+ </script>
243
+ <?php } else { ?>
244
+ <!-- SWFUpload script -->
245
+ <script type="text/javascript">
246
+ var ngg_swf_upload;
247
+
248
+ window.onload = function () {
249
+ ngg_swf_upload = new SWFUpload({
250
+ // Backend settings
251
+ upload_url : "<?php echo esc_js( $swf_upload_link ); ?>",
252
+ flash_url : "<?php echo esc_js( includes_url('js/swfupload/swfupload.swf') ); ?>",
253
+
254
+ // Button Settings
255
+ button_placeholder_id : "spanButtonPlaceholder",
256
+ button_width: 300,
257
+ button_height: 27,
258
+ button_text_top_padding: 3,
259
+ button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
260
+ button_cursor: SWFUpload.CURSOR.HAND,
261
+
262
+ // File Upload Settings
263
+ file_size_limit : "<?php echo wp_max_upload_size(); ?>b",
264
+ file_types : "<?php echo $file_types; ?>",
265
+ file_types_description : "<?php _e('Image Files', 'nggallery') ;?>",
266
+
267
+ // Queue handler
268
+ file_queued_handler : fileQueued,
269
+
270
+ // Upload handler
271
+ upload_start_handler : uploadStart,
272
+ upload_progress_handler : uploadProgress,
273
+ upload_error_handler : uploadError,
274
+ upload_success_handler : uploadSuccess,
275
+ upload_complete_handler : uploadComplete,
276
+
277
+ post_params : {
278
+ "auth_cookie" : "<?php echo (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]); ?>",
279
+ "logged_in_cookie": "<?php echo $_COOKIE[LOGGED_IN_COOKIE]; ?>",
280
+ "_wpnonce" : "<?php echo wp_create_nonce('ngg_swfupload'); ?>",
281
+ "galleryselect" : "0"
282
+ },
283
+
284
+ // i18names
285
+ custom_settings : {
286
+ "remove" : "<?php _e('remove', 'nggallery') ;?>",
287
+ "browse" : "<?php _e('Browse...', 'nggallery') ;?>",
288
+ "upload" : "<?php _e('Upload images', 'nggallery') ;?>"
289
+ },
290
+
291
+ // Debug settings
292
+ debug: false
293
+
294
+ });
295
+
296
+ // on load change the upload to swfupload
297
+ initSWFUpload();
298
+
299
+ nggAjaxOptions = {
300
+ header: "<?php _e('Upload images', 'nggallery') ;?>",
301
+ maxStep: 100
302
+ };
303
+
304
+ };
305
+ </script>
306
+ <?php } ?>
307
+ <?php } else { ?>
308
+ <!-- MultiFile script -->
309
+ <script type="text/javascript">
310
+ /* <![CDATA[ */
311
+ jQuery(document).ready(function(){
312
+ jQuery('#imagefiles').MultiFile({
313
+ STRING: {
314
+ remove:'[<?php _e('remove', 'nggallery') ;?>]'
315
+ }
316
+ });
317
+ });
318
+ /* ]]> */
319
+ </script>
320
+ <?php } ?>
321
+ <!-- jQuery Tabs script -->
322
+ <script type="text/javascript">
323
+ /* <![CDATA[ */
324
+ jQuery(document).ready(function(){
325
+ jQuery('html,body').scrollTop(0);
326
+ jQuery('#slider').tabs({ fxFade: true, fxSpeed: 'fast' });
327
+ jQuery('#slider').css('display', 'block');
328
+ });
329
+
330
+ // File Tree implementation
331
+ jQuery(function() {
332
+ jQuery("span.browsefiles").show().click(function(){
333
+ jQuery("#file_browser").fileTree({
334
+ script: "admin-ajax.php?action=ngg_file_browser&nonce=<?php echo wp_create_nonce( 'ngg-ajax' ) ;?>",
335
+ root: jQuery("#galleryfolder").val()
336
+ }, function(folder) {
337
+ jQuery("#galleryfolder").val( folder );
338
+ });
339
+ jQuery("#file_browser").show('slide');
340
+ });
341
+ });
342
+ /* ]]> */
343
+ </script>
344
+ <div id="slider" class="wrap" style="display: none;">
345
+ <ul id="tabs">
346
+ <?php
347
+ foreach($tabs as $tab_key => $tab_name) {
348
+ echo "\n\t\t<li><a href='#$tab_key'>$tab_name</a></li>";
349
+ }
350
+ ?>
351
+ </ul>
352
+ <?php
353
+ foreach($tabs as $tab_key => $tab_name) {
354
+ echo "\n\t<div id='$tab_key'>\n";
355
+ // Looks for the internal class function, otherwise enable a hook for plugins
356
+ if ( method_exists( $this, "tab_$tab_key" ))
357
+ call_user_func( array( &$this , "tab_$tab_key") );
358
+ else
359
+ do_action( 'ngg_tab_content_' . $tab_key );
360
+ echo "\n\t</div>";
361
+ }
362
+ ?>
363
+ </div>
364
+ <?php
365
+
366
+ }
367
+
368
+ /**
369
+ * Create array for tabs and add a filter for other plugins to inject more tabs
370
+ *
371
+ * @return array $tabs
372
+ */
373
+ function tabs_order() {
374
+
375
+ $tabs = array();
376
+
377
+ if ( !empty ($this->gallerylist) )
378
+ $tabs['uploadimage'] = __( 'Upload Images', 'nggallery' );
379
+
380
+ if ( nggGallery::current_user_can( 'NextGEN Add new gallery' ))
381
+ $tabs['addgallery'] = __('Add new gallery', 'nggallery');
382
+
383
+ if ( wpmu_enable_function('wpmuZipUpload') && nggGallery::current_user_can( 'NextGEN Upload a zip' ) )
384
+ $tabs['zipupload'] = __('Upload a Zip-File', 'nggallery');
385
+
386
+ if ( wpmu_enable_function('wpmuImportFolder') && nggGallery::current_user_can( 'NextGEN Import image folder' ) )
387
+ $tabs['importfolder'] = __('Import image folder', 'nggallery');
388
+
389
+ $tabs = apply_filters('ngg_addgallery_tabs', $tabs);
390
+
391
+ return $tabs;
392
+
393
+ }
394
+
395
+ function tab_addgallery() {
396
+ ?>
397
+ <!-- create gallery -->
398
+ <h2><?php _e('Add new gallery', 'nggallery') ;?></h2>
399
+ <form name="addgallery" id="addgallery_form" method="POST" action="<?php echo $this->filepath; ?>" accept-charset="utf-8" >
400
+ <?php wp_nonce_field('ngg_addgallery') ?>
401
+ <table class="form-table">
402
+ <tr valign="top">
403
+ <th scope="row"><?php _e('New Gallery', 'nggallery') ;?>:</th>
404
+ <td><input type="text" size="35" name="galleryname" value="" /><br />
405
+ <?php if(!is_multisite()) { ?>
406
+ <?php _e('Create a new , empty gallery below the folder', 'nggallery') ;?> <strong><?php echo $this->defaultpath ?></strong><br />
407
+ <?php } ?>
408
+ <i>( <?php _e('Allowed characters for file and folder names are', 'nggallery') ;?>: a-z, A-Z, 0-9, -, _ )</i></td>
409
+ </tr>
410
+ <?php do_action('ngg_add_new_gallery_form'); ?>
411
+ </table>
412
+ <div class="submit"><input class="button-primary" type="submit" name= "addgallery" value="<?php _e('Add gallery', 'nggallery') ;?>"/></div>
413
+ </form>
414
+ <?php
415
+ }
416
+
417
+ function tab_zipupload() {
418
+ ?>
419
+ <!-- zip-file operation -->
420
+ <h2><?php _e('Upload a Zip-File', 'nggallery') ;?></h2>
421
+ <form name="zipupload" id="zipupload_form" method="POST" enctype="multipart/form-data" action="<?php echo $this->filepath.'#zipupload'; ?>" accept-charset="utf-8" >
422
+ <?php wp_nonce_field('ngg_addgallery') ?>
423
+ <table class="form-table">
424
+ <tr valign="top">
425
+ <th scope="row"><?php _e('Select Zip-File', 'nggallery') ;?>:</th>
426
+ <td><input type="file" name="zipfile" id="zipfile" size="35" class="uploadform"/><br />
427
+ <?php _e('Upload a zip file with images', 'nggallery') ;?></td>
428
+ </tr>
429
+ <?php if (function_exists('curl_init')) : ?>
430
+ <tr valign="top">
431
+ <th scope="row"><?php _e('or enter a Zip-File URL', 'nggallery') ;?>:</th>
432
+ <td><input type="text" name="zipurl" id="zipurl" size="35" class="uploadform"/><br />
433
+ <?php _e('Import a zip file with images from a url', 'nggallery') ;?></td>
434
+ </tr>
435
+ <?php endif; ?>
436
+ <tr valign="top">
437
+ <th scope="row"><?php _e('in to', 'nggallery') ;?></th>
438
+ <td><select name="zipgalselect">
439
+ <option value="0" ><?php _e('a new gallery', 'nggallery') ?></option>
440
+ <?php
441
+ foreach($this->gallerylist as $gallery) {
442
+ if ( !nggAdmin::can_manage_this_gallery($gallery->author) )
443
+ continue;
444
+ $name = ( empty($gallery->title) ) ? $gallery->name : $gallery->title;
445
+ echo '<option value="' . $gallery->gid . '" >' . $gallery->gid . ' - ' . esc_attr( $name ). '</option>' . "\n";
446
+ }
447
+ ?>
448
+ </select>
449
+ <br /><?php echo $this->maxsize; ?>
450
+ <br /><?php echo _e('Note : The upload limit on your server is ','nggallery') . "<strong>" . ini_get('upload_max_filesize') . "Byte</strong>\n"; ?>
451
+ <br /><?php if ( (is_multisite()) && wpmu_enable_function('wpmuQuotaCheck') ) display_space_usage(); ?></td>
452
+ </tr>
453
+ </table>
454
+ <div class="submit"><input class="button-primary" type="submit" name= "zipupload" value="<?php _e('Start upload', 'nggallery') ;?>"/></div>
455
+ </form>
456
+ <?php
457
+ }
458
+
459
+ function tab_importfolder() {
460
+ ?>
461
+ <!-- import folder -->
462
+ <h2><?php _e('Import image folder', 'nggallery') ;?></h2>
463
+ <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $this->filepath.'#importfolder'; ?>" accept-charset="utf-8" >
464
+ <?php wp_nonce_field('ngg_addgallery') ?>
465
+ <table class="form-table">
466
+ <tr valign="top">
467
+ <th scope="row"><?php _e('Import from Server path:', 'nggallery') ;?></th>
468
+ <td><input type="text" size="35" id="galleryfolder" name="galleryfolder" value="<?php echo $this->defaultpath; ?>" /><span class="browsefiles button" style="display:none"><?php _e('Browse...', 'nggallery'); ?></span><br />
469
+ <div id="file_browser"></div>
470
+ <br /><i>( <?php _e('Note : Change the default path in the gallery settings', 'nggallery') ;?> )</i>
471
+ <br /><?php echo $this->maxsize; ?>
472
+ <?php if (SAFE_MODE) {?><br /><?php _e(' Please note : For safe-mode = ON you need to add the subfolder thumbs manually', 'nggallery') ;?><?php }; ?></td>
473
+ </tr>
474
+ </table>
475
+ <div class="submit"><input class="button-primary" type="submit" name= "importfolder" value="<?php _e('Import folder', 'nggallery') ;?>"/></div>
476
+ </form>
477
+ <?php
478
+ }
479
+
480
+ function tab_uploadimage() {
481
+ global $ngg;
482
+ // check the cookie for the current setting
483
+ $checked = get_user_setting('ngg_upload_resize') ? ' checked="true"' : '';
484
+ ?>
485
+ <!-- upload images -->
486
+ <h2><?php _e('Upload Images', 'nggallery') ;?></h2>
487
+ <form name="uploadimage" id="uploadimage_form" method="POST" enctype="multipart/form-data" action="<?php echo $this->filepath.'#uploadimage'; ?>" accept-charset="utf-8" >
488
+ <?php wp_nonce_field('ngg_addgallery') ?>
489
+ <table class="form-table">
490
+
491
+ <tr valign="top">
492
+ <th scope="row"><?php _e('Upload image', 'nggallery') ;?></th>
493
+ <?php if ($ngg->options['swfUpload'] && defined('IS_WP_3_3') ) { ?>
494
+ <td>
495
+ <div id="plupload-upload-ui">
496
+ <div>
497
+ <?php _e( 'Choose files to upload' ); ?>
498
+ <input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" />
499
+ </div>
500
+ <p class="ngg-dragdrop-info howto" style="display:none;" ><?php _e('Or you can drop the files into this window.'); ?></p>
501
+ <div id='uploadQueue'></div>
502
+ <p><label><input name="image_resize" type="checkbox" id="image_resize" value="true"<?php echo $checked; ?> />
503
+ <?php printf( __( 'Scale images to max width %1$dpx or max height %2$dpx', 'nggallery' ), (int) $ngg->options['imgWidth' ], (int) $ngg->options[ 'imgHeight' ] ); ?>
504
+ </label>
505
+ </p>
506
+
507
+ </div>
508
+ </td>
509
+ <?php } else { ?>
510
+ <td><span id='spanButtonPlaceholder'></span><input type="file" name="imagefiles[]" id="imagefiles" size="35" class="imagefiles"/></td>
511
+ <?php } ?>
512
+ </tr>
513
+ <tr valign="top">
514
+ <th scope="row"><?php _e('in to', 'nggallery') ;?></th>
515
+ <td><select name="galleryselect" id="galleryselect">
516
+ <option value="0" ><?php _e('Choose gallery', 'nggallery') ?></option>
517
+ <?php
518
+ foreach($this->gallerylist as $gallery) {
519
+
520
+ //special case : we check if a user has this cap, then we override the second cap check
521
+ if ( !current_user_can( 'NextGEN Upload in all galleries' ) )
522
+ if ( !nggAdmin::can_manage_this_gallery($gallery->author) )
523
+ continue;
524
+
525
+ $name = ( empty($gallery->title) ) ? $gallery->name : $gallery->title;
526
+ echo '<option value="' . $gallery->gid . '" >' . $gallery->gid . ' - ' . esc_attr( $name ) . '</option>' . "\n";
527
+ } ?>
528
+ </select>
529
+ <br /><?php echo $this->maxsize; ?>
530
+ <br /><?php if ((is_multisite()) && wpmu_enable_function('wpmuQuotaCheck')) display_space_usage(); ?></td>
531
+ </tr>
532
+ </table>
533
+ <div class="submit">
534
+ <?php if ($ngg->options['swfUpload']) { ?>
535
+ <input type="submit" name="disable_flash" id="disable_flash" title="<?php _e('The batch upload requires Adobe Flash 10, disable it if you have problems','nggallery') ?>" value="<?php _e('Disable flash upload', 'nggallery') ;?>" />
536
+ <?php } else { ?>
537
+ <input type="submit" name="enable_flash" id="enable_flash" title="<?php _e('Upload multiple files at once by ctrl/shift-selecting in dialog','nggallery') ?>" value="<?php _e('Enable flash based upload', 'nggallery') ;?>" />
538
+ <?php } ?>
539
+ <input class="button-primary" type="submit" name="uploadimage" id="uploadimage_btn" value="<?php _e('Upload images', 'nggallery') ;?>" />
540
+ </div>
541
+ </form>
542
+ <?php
543
+ }
544
+ }
545
+ ?>
admin/admin.php ADDED
@@ -0,0 +1,576 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * nggAdminPanel - Admin Section for NextGEN Gallery
4
+ *
5
+ * @package NextGEN Gallery
6
+ * @author Alex Rabe
7
+ *
8
+ * @since 1.0.0
9
+ */
10
+ class nggAdminPanel{
11
+
12
+ // constructor
13
+ function __construct() {
14
+
15
+ // Add the admin menu
16
+ add_action( 'admin_menu', array (&$this, 'add_menu') );
17
+ add_action( 'admin_bar_menu', array(&$this, 'admin_bar_menu'), 99 );
18
+ add_action( 'network_admin_menu', array (&$this, 'add_network_admin_menu') );
19
+
20
+ // Add the script and style files
21
+ add_action('admin_print_scripts', array(&$this, 'load_scripts') );
22
+ add_action('admin_print_styles', array(&$this, 'load_styles') );
23
+
24
+ // Try to detect plugins that embed their own jQuery and jQuery UI
25
+ // libraries and load them in NGG's admin pages
26
+ add_action('admin_enqueue_scripts', array(&$this, 'buffer_scripts'), 0);
27
+ add_action('admin_print_scripts', array(&$this, 'output_scripts'), PHP_INT_MAX);
28
+
29
+ //TODO: remove after release of Wordpress 3.3
30
+ add_filter('contextual_help', array(&$this, 'show_help'), 10, 2);
31
+ add_filter('current_screen', array(&$this, 'edit_current_screen'));
32
+
33
+ // Add WPML hook to register description / alt text for translation
34
+ add_action('ngg_image_updated', array('nggGallery', 'RegisterString') );
35
+
36
+ }
37
+
38
+ /**
39
+ * If a NGG page is being requested, we buffer any rendering of <script>
40
+ * tags to detect conflicts and remove them if need be
41
+ */
42
+ function buffer_scripts()
43
+ {
44
+ // Is this a NGG admin page?
45
+ if (isset($_REQUEST['page']) && strpos($_REQUEST['page'] ,'nggallery') !== FALSE) {
46
+ ob_start();
47
+ }
48
+ }
49
+
50
+ function output_scripts()
51
+ {
52
+ // Is this a NGG admin page?
53
+ if (isset($_REQUEST['page']) && strpos($_REQUEST['page'] ,'nggallery') !== FALSE) {
54
+ $plugin_folder = NGGFOLDER;
55
+ $skipjs_count = 0;
56
+ $html = ob_get_contents();
57
+ ob_end_clean();
58
+
59
+ if (!defined('NGG_JQUERY_CONFLICT_DETECTION')) {
60
+ define('NGG_JQUERY_CONFLICT_DETECTION', TRUE);
61
+ }
62
+
63
+ if (NGG_JQUERY_CONFLICT_DETECTION) {
64
+ // Detect custom jQuery script
65
+ if (preg_match_all("/<script.*wp-content.*jquery[-_\.](min\.)?js.*<\script>/", $html, $matches, PREG_SET_ORDER)) {
66
+ foreach ($matches as $match) {
67
+ $old_script = array_shift($match);
68
+ if (strpos($old_script, NGGFOLDER) === FALSE)
69
+ $html = str_replace($old_script, '', $html);
70
+ }
71
+ }
72
+
73
+ // Detect custom jQuery UI script and remove
74
+ if (preg_match_all("/<script.*wp-content.*jquery[-_\.]ui.*<\/script>/", $html, $matches, PREG_SET_ORDER)) {
75
+ $detected_jquery_ui = TRUE;
76
+ foreach ($matches as $match) {
77
+ $old_script = array_shift($match);
78
+ if (strpos($old_script, NGGFOLDER) === FALSE)
79
+ $html = str_replace($old_script, '', $html);
80
+ }
81
+ }
82
+
83
+ if (isset($_REQUEST['skipjs'])) {
84
+ foreach ($_REQUEST['skipjs'] as $js) {
85
+ $js = preg_quote($js);
86
+ if (preg_match_all("#<script.*{$js}.*</script>#", $html, $matches, PREG_SET_ORDER)) {
87
+ foreach ($matches as $match) {
88
+ $old_script = array_shift($match);
89
+ if (strpos($old_script, NGGFOLDER) === FALSE)
90
+ $html = str_replace($old_script, '', $html);
91
+ }
92
+ }
93
+ }
94
+ $skipjs_count = count($_REQUEST['skipjs']);
95
+ }
96
+
97
+
98
+ // Use WordPress built-in version of jQuery
99
+ $jquery_url = includes_url('js/jquery/jquery.js');
100
+ $html = implode('', array(
101
+ "<script type='text/javascript' src='{$jquery_url}'></script>\n",
102
+ "<script type='text/javascript'>
103
+ window.onerror = function(msg, url, line){
104
+ if (url.match(/\.js$|\.js\?/)) {
105
+ if (window.location.search.length > 0) {
106
+ if (window.location.search.indexOf(url) == -1)
107
+ window.location.search += '&skipjs[{$skipjs_count}]='+url;
108
+ }
109
+ else {
110
+ window.location.search = '?skipjs[{$skipjs_count}]='+url;
111
+ }
112
+ }
113
+ return true;
114
+ };</script>\n",
115
+ $html
116
+ ));
117
+ }
118
+
119
+ echo $html;
120
+ }
121
+ }
122
+
123
+ // integrate the menu
124
+ function add_menu() {
125
+
126
+ add_menu_page( _n( 'Gallery', 'Galleries', 1, 'nggallery' ), _n( 'Gallery', 'Galleries', 1, 'nggallery' ), 'NextGEN Gallery overview', NGGFOLDER, array (&$this, 'show_menu'), path_join(NGGALLERY_URLPATH, 'admin/images/nextgen_16_color.png') );
127
+ add_submenu_page( NGGFOLDER , __('Overview', 'nggallery'), __('Overview', 'nggallery'), 'NextGEN Gallery overview', NGGFOLDER, array (&$this, 'show_menu'));
128
+ add_submenu_page( NGGFOLDER , __('Add Gallery / Images', 'nggallery'), __('Add Gallery / Images', 'nggallery'), 'NextGEN Upload images', 'nggallery-add-gallery', array (&$this, 'show_menu'));
129
+ add_submenu_page( NGGFOLDER , __('Manage Gallery', 'nggallery'), __('Manage Gallery', 'nggallery'), 'NextGEN Manage gallery', 'nggallery-manage-gallery', array (&$this, 'show_menu'));
130
+ add_submenu_page( NGGFOLDER , _n( 'Album', 'Albums', 1, 'nggallery' ), _n( 'Album', 'Albums', 1, 'nggallery' ), 'NextGEN Edit album', 'nggallery-manage-album', array (&$this, 'show_menu'));
131
+ add_submenu_page( NGGFOLDER , __('Tags', 'nggallery'), __('Tags', 'nggallery'), 'NextGEN Manage tags', 'nggallery-tags', array (&$this, 'show_menu'));
132
+ add_submenu_page( NGGFOLDER , __('Options', 'nggallery'), __('Options', 'nggallery'), 'NextGEN Change options', 'nggallery-options', array (&$this, 'show_menu'));
133
+ if ( wpmu_enable_function('wpmuStyle') )
134
+ add_submenu_page( NGGFOLDER , __('Style', 'nggallery'), __('Style', 'nggallery'), 'NextGEN Change style', 'nggallery-style', array (&$this, 'show_menu'));
135
+ if ( wpmu_enable_function('wpmuRoles') || wpmu_site_admin() )
136
+ add_submenu_page( NGGFOLDER , __('Roles', 'nggallery'), __('Roles', 'nggallery'), 'activate_plugins', 'nggallery-roles', array (&$this, 'show_menu'));
137
+ add_submenu_page( NGGFOLDER , __('About this Gallery', 'nggallery'), __('About', 'nggallery'), 'NextGEN Gallery overview', 'nggallery-about', array (&$this, 'show_menu'));
138
+
139
+ if ( !is_multisite() || wpmu_site_admin() )
140
+ add_submenu_page( NGGFOLDER , __('Reset / Uninstall', 'nggallery'), __('Reset / Uninstall', 'nggallery'), 'activate_plugins', 'nggallery-setup', array (&$this, 'show_menu'));
141
+
142
+ //register the column fields
143
+ $this->register_columns();
144
+ }
145
+
146
+ // integrate the network menu
147
+ function add_network_admin_menu() {
148
+
149
+ add_menu_page( _n( 'Gallery', 'Galleries', 1, 'nggallery' ), _n( 'Gallery', 'Galleries', 1, 'nggallery' ), 'nggallery-wpmu', NGGFOLDER, array (&$this, 'show_network_settings'), path_join(NGGALLERY_URLPATH, 'admin/images/nextgen_16_color.png') );
150
+ add_submenu_page( NGGFOLDER , __('Network settings', 'nggallery'), __('Network settings', 'nggallery'), 'nggallery-wpmu', NGGFOLDER, array (&$this, 'show_network_settings'));
151
+ add_submenu_page( NGGFOLDER , __('Reset / Uninstall', 'nggallery'), __('Reset / Uninstall', 'nggallery'), 'activate_plugins', 'nggallery-setup', array (&$this, 'show_menu'));
152
+ }
153
+
154
+ /**
155
+ * Adding NextGEN Gallery to the Admin bar
156
+ *
157
+ * @since 1.9.0
158
+ *
159
+ * @return void
160
+ */
161
+ function admin_bar_menu() {
162
+ // If the current user can't write posts, this is all of no use, so let's not output an admin menu
163
+ if ( !current_user_can('NextGEN Gallery overview') )
164
+ return;
165
+
166
+ global $wp_admin_bar;
167
+
168
+ $wp_admin_bar->add_menu( array( 'id' => 'ngg-menu', 'title' => __( 'Gallery' ), 'href' => admin_url('admin.php?page='. NGGFOLDER) ) );
169
+ $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-overview', 'title' => __('Overview', 'nggallery'), 'href' => admin_url('admin.php?page='. NGGFOLDER) ) );
170
+ if ( current_user_can('NextGEN Upload images') )
171
+ $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-add-gallery', 'title' => __('Add Gallery / Images', 'nggallery'), 'href' => admin_url('admin.php?page=nggallery-add-gallery') ) );
172
+ if ( current_user_can('NextGEN Manage gallery') )
173
+ $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-manage-gallery', 'title' => __('Manage Gallery', 'nggallery'), 'href' => admin_url('admin.php?page=nggallery-manage-gallery') ) );
174
+ if ( current_user_can('NextGEN Edit album') )
175
+ $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-manage-album', 'title' => _n( 'Album', 'Albums', 1, 'nggallery' ), 'href' => admin_url('admin.php?page=nggallery-manage-album') ) );
176
+ if ( current_user_can('NextGEN Manage tags') )
177
+ $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-tags', 'title' => __('Tags', 'nggallery'), 'href' => admin_url('admin.php?page=nggallery-tags') ) );
178
+ if ( current_user_can('NextGEN Change options') )
179
+ $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-options', 'title' => __('Options', 'nggallery'), 'href' => admin_url('admin.php?page=nggallery-options') ) );
180
+ if ( wpmu_enable_function('wpmuStyle') && ( current_user_can('NextGEN Change style') ))
181
+ $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-style', 'title' => __('Style', 'nggallery'), 'href' => admin_url('admin.php?page=nggallery-style') ) );
182
+ $wp_admin_bar->add_menu( array( 'parent' => 'ngg-menu', 'id' => 'ngg-menu-about', 'title' => __('About', 'nggallery'), 'href' => admin_url('admin.php?page=nggallery-about') ) );
183
+ }
184
+
185
+ // show the network page
186
+ function show_network_settings() {
187
+ include_once ( dirname (__FILE__) . '/style.php' );
188
+ include_once ( dirname (__FILE__) . '/wpmu.php' );
189
+ nggallery_wpmu_setup();
190
+ }
191
+
192
+ // load the script for the defined page and load only this code
193
+ function show_menu() {
194
+
195
+ global $ngg;
196
+
197
+ // Set installation date
198
+ if( empty($ngg->options['installDate']) ) {
199
+ $ngg->options['installDate'] = time();
200
+ update_option('ngg_options', $ngg->options);
201
+ }
202
+
203
+ // Show donation message only one time.
204
+ if (isset ( $_GET['hide_donation']) ) {
205
+ $ngg->options['hideDonation'] = true;
206
+ update_option('ngg_options', $ngg->options);
207
+ }
208
+
209
+ switch ($_GET['page']){
210
+ case "nggallery-add-gallery" :
211
+ include_once ( dirname (__FILE__) . '/functions.php' ); // admin functions
212
+ include_once ( dirname (__FILE__) . '/addgallery.php' ); // nggallery_admin_add_gallery
213
+ $ngg->addgallery_page = new nggAddGallery ();
214
+ $ngg->addgallery_page->controller();
215
+ break;
216
+ case "nggallery-manage-gallery" :
217
+ include_once ( dirname (__FILE__) . '/functions.php' ); // admin functions
218
+ include_once ( dirname (__FILE__) . '/manage.php' ); // nggallery_admin_manage_gallery
219
+ // Initate the Manage Gallery page
220
+ $ngg->manage_page = new nggManageGallery ();
221
+ // Render the output now, because you cannot access a object during the constructor is not finished
222
+ $ngg->manage_page->controller();
223
+ break;
224
+ case "nggallery-manage-album" :
225
+ include_once ( dirname (__FILE__) . '/album.php' ); // nggallery_admin_manage_album
226
+ $ngg->manage_album = new nggManageAlbum ();
227
+ $ngg->manage_album->controller();
228
+ break;
229
+ case "nggallery-options" :
230
+ include_once ( dirname (__FILE__) . '/settings.php' ); // nggallery_admin_options
231
+ $ngg->option_page = new nggOptions ();
232
+ $ngg->option_page->controller();
233
+ break;
234
+ case "nggallery-tags" :
235
+ include_once ( dirname (__FILE__) . '/tags.php' ); // nggallery_admin_tags
236
+ break;
237
+ case "nggallery-style" :
238
+ include_once ( dirname (__FILE__) . '/style.php' ); // nggallery_admin_style
239
+ nggallery_admin_style();
240
+ break;
241
+ case "nggallery-setup" :
242
+ include_once ( dirname (__FILE__) . '/setup.php' ); // nggallery_admin_setup
243
+ nggallery_admin_setup();
244
+ break;
245
+ case "nggallery-roles" :
246
+ include_once ( dirname (__FILE__) . '/roles.php' ); // nggallery_admin_roles
247
+ nggallery_admin_roles();
248
+ break;
249
+ case "nggallery-import" :
250
+ include_once ( dirname (__FILE__) . '/myimport.php' ); // nggallery_admin_import
251
+ nggallery_admin_import();
252
+ break;
253
+ case "nggallery-about" :
254
+ include_once ( dirname (__FILE__) . '/about.php' ); // nggallery_admin_about
255
+ nggallery_admin_about();
256
+ break;
257
+ case "nggallery" :
258
+ default :
259
+ include_once ( dirname (__FILE__) . '/overview.php' ); // nggallery_admin_overview
260
+ nggallery_admin_overview();
261
+ break;
262
+ }
263
+ }
264
+
265
+ function load_scripts() {
266
+ global $wp_version;
267
+
268
+ // no need to go on if it's not a plugin page
269
+ if( !isset($_GET['page']) )
270
+ return;
271
+
272
+ // If we're on a NextGen Page
273
+ if (preg_match("/ngg|nextgen-gallery/", $_GET['page'])) {
274
+ wp_register_script('ngg_social_media', path_join(
275
+ NGGALLERY_URLPATH,
276
+ 'admin/js/ngg_social_media.js'
277
+ ), array('jquery'));
278
+
279
+ wp_register_style('ngg_social_media', path_join(
280
+ NGGALLERY_URLPATH,
281
+ 'admin/css/ngg_social_media.css'
282
+ ));
283
+
284
+ wp_enqueue_style('ngg_social_media');
285
+ wp_enqueue_script('ngg_social_media');
286
+ }
287
+
288
+ wp_register_script('ngg-ajax', NGGALLERY_URLPATH . 'admin/js/ngg.ajax.js', array('jquery'), '1.4.1');
289
+ wp_localize_script('ngg-ajax', 'nggAjaxSetup', array(
290
+ 'url' => admin_url('admin-ajax.php'),
291
+ 'action' => 'ngg_ajax_operation',
292
+ 'operation' => '',
293
+ 'nonce' => wp_create_nonce( 'ngg-ajax' ),
294
+ 'ids' => '',
295
+ 'permission' => __('You do not have the correct permission', 'nggallery'),
296
+ 'error' => __('Unexpected Error', 'nggallery'),
297
+ 'failure' => __('A failure occurred', 'nggallery')
298
+ ) );
299
+ wp_register_script( 'ngg-plupload-handler', NGGALLERY_URLPATH .'admin/js/plupload.handler.js', array('plupload-all'), '0.0.1' );
300
+ wp_localize_script( 'ngg-plupload-handler', 'pluploadL10n', array(
301
+ 'queue_limit_exceeded' => __('You have attempted to queue too many files.'),
302
+ 'file_exceeds_size_limit' => __('This file exceeds the maximum upload size for this site.'),
303
+ 'zero_byte_file' => __('This file is empty. Please try another.'),
304
+ 'invalid_filetype' => __('This file type is not allowed. Please try another.'),
305
+ 'not_an_image' => __('This file is not an image. Please try another.'),
306
+ 'image_memory_exceeded' => __('Memory exceeded. Please try another smaller file.'),
307
+ 'image_dimensions_exceeded' => __('This is larger than the maximum size. Please try another.'),
308
+ 'default_error' => __('An error occurred in the upload. Please try again later.'),
309
+ 'missing_upload_url' => __('There was a configuration error. Please contact the server administrator.'),
310
+ 'upload_limit_exceeded' => __('You may only upload 1 file.'),
311
+ 'http_error' => __('HTTP error.'),
312
+ 'upload_failed' => __('Upload failed.'),
313
+ 'io_error' => __('IO error.'),
314
+ 'security_error' => __('Security error.'),
315
+ 'file_cancelled' => __('File canceled.'),
316
+ 'upload_stopped' => __('Upload stopped.'),
317
+ 'dismiss' => __('Dismiss'),
318
+ 'crunching' => __('Crunching&hellip;'),
319
+ 'deleted' => __('moved to the trash.'),
320
+ 'error_uploading' => __('&#8220;%s&#8221; has failed to upload due to an error')
321
+ ) );
322
+ wp_register_script('ngg-progressbar', NGGALLERY_URLPATH .'admin/js/ngg.progressbar.js', array('jquery'), '2.0.1');
323
+ wp_register_script('jquery-ui-autocomplete', NGGALLERY_URLPATH .'admin/js/jquery.ui.autocomplete.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.8.15');
324
+
325
+ switch ($_GET['page']) {
326
+ case NGGFOLDER :
327
+ wp_enqueue_script( 'postbox' );
328
+ add_thickbox();
329
+ break;
330
+ case "nggallery-manage-gallery" :
331
+ wp_enqueue_script( 'postbox' );
332
+ wp_enqueue_script( 'ngg-ajax' );
333
+ wp_enqueue_script( 'ngg-progressbar' );
334
+ wp_enqueue_script( 'jquery-ui-dialog' );
335
+ wp_enqueue_script( 'jquery-ui-sortable' );
336
+ wp_register_script('shutter', NGGALLERY_URLPATH .'shutter/shutter-reloaded.js', false ,'1.3.2');
337
+ wp_localize_script('shutter', 'shutterSettings', array(
338
+ 'msgLoading' => __('L O A D I N G', 'nggallery'),
339
+ 'msgClose' => __('Click to Close', 'nggallery'),
340
+ 'imageCount' => '1'
341
+ ) );
342
+ wp_enqueue_script( 'shutter' );
343
+ break;
344
+ case "nggallery-manage-album" :
345
+ wp_enqueue_script( 'jquery-ui-autocomplete' );
346
+ wp_enqueue_script( 'jquery-ui-dialog' );
347
+ wp_enqueue_script( 'jquery-ui-sortable' );
348
+ wp_enqueue_script( 'ngg-autocomplete', NGGALLERY_URLPATH .'admin/js/ngg.autocomplete.js', array('jquery-ui-autocomplete'), '1.0.1');
349
+ break;
350
+ case "nggallery-options" :
351
+ wp_enqueue_script( 'jquery-ui-tabs' );
352
+ //wp_enqueue_script( 'ngg-colorpicker', NGGALLERY_URLPATH .'admin/js/colorpicker/js/colorpicker.js', array('jquery'), '1.0');
353
+ break;
354
+ case "nggallery-add-gallery" :
355
+ wp_enqueue_script( 'jquery-ui-tabs' );
356
+ wp_enqueue_script( 'multifile', NGGALLERY_URLPATH .'admin/js/jquery.MultiFile.js', array('jquery'), '1.4.4' );
357
+ if ( defined('IS_WP_3_3') )
358
+ wp_enqueue_script( 'ngg-plupload-handler' );
359
+ else
360
+ wp_enqueue_script( 'ngg-swfupload-handler', NGGALLERY_URLPATH .'admin/js/swfupload.handler.js', array('jquery', 'swfupload'), '1.0.3' );
361
+ wp_enqueue_script( 'ngg-ajax' );
362
+ wp_enqueue_script( 'ngg-progressbar' );
363
+ wp_enqueue_script( 'jquery-ui-dialog' );
364
+ wp_enqueue_script( 'jqueryFileTree', NGGALLERY_URLPATH .'admin/js/jqueryFileTree/jqueryFileTree.js', array('jquery'), '1.0.1' );
365
+ break;
366
+ case "nggallery-style" :
367
+ wp_enqueue_script( 'codepress' );
368
+ wp_enqueue_script( 'ngg-colorpicker', NGGALLERY_URLPATH .'admin/js/colorpicker/js/colorpicker.js', array('jquery'), '1.0');
369
+ break;
370
+
371
+ }
372
+ }
373
+
374
+ function load_styles() {
375
+ // load the icon for the navigation menu
376
+ wp_enqueue_style( 'nggmenu', NGGALLERY_URLPATH .'admin/css/menu.css', array() );
377
+ wp_register_style( 'nggadmin', NGGALLERY_URLPATH .'admin/css/nggadmin.css', false, '2.8.1', 'screen' );
378
+ wp_register_style( 'ngg-jqueryui', NGGALLERY_URLPATH .'admin/css/jquery.ui.css', false, '1.8.5', 'screen' );
379
+
380
+ // no need to go on if it's not a plugin page
381
+ if( !isset($_GET['page']) )
382
+ return;
383
+
384
+ switch ($_GET['page']) {
385
+ case NGGFOLDER :
386
+ wp_enqueue_style( 'thickbox' );
387
+ case "nggallery-about" :
388
+ wp_enqueue_style( 'nggadmin' );
389
+ //TODO:Remove after WP 3.3 release
390
+ if ( !defined('IS_WP_3_3') )
391
+ wp_admin_css( 'css/dashboard' );
392
+ break;
393
+ case "nggallery-add-gallery" :
394
+ wp_enqueue_style( 'ngg-jqueryui' );
395
+ wp_enqueue_style( 'jqueryFileTree', NGGALLERY_URLPATH .'admin/js/jqueryFileTree/jqueryFileTree.css', false, '1.0.1', 'screen' );
396
+ case "nggallery-options" :
397
+ wp_enqueue_style( 'nggtabs', NGGALLERY_URLPATH .'admin/css/jquery.ui.tabs.css', false, '2.5.0', 'screen' );
398
+ wp_enqueue_style( 'nggadmin' );
399
+ break;
400
+ case "nggallery-manage-gallery" :
401
+ wp_enqueue_style('shutter', NGGALLERY_URLPATH .'shutter/shutter-reloaded.css', false, '1.3.2', 'screen');
402
+ case "nggallery-roles" :
403
+ case "nggallery-manage-album" :
404
+ wp_enqueue_style( 'ngg-jqueryui' );
405
+ wp_enqueue_style( 'nggadmin' );
406
+ break;
407
+ case "nggallery-tags" :
408
+ wp_enqueue_style( 'nggtags', NGGALLERY_URLPATH .'admin/css/tags-admin.css', false, '2.6.1', 'screen' );
409
+ break;
410
+ case "nggallery-style" :
411
+ wp_admin_css( 'css/theme-editor' );
412
+ wp_enqueue_style('nggcolorpicker', NGGALLERY_URLPATH.'admin/js/colorpicker/css/colorpicker.css', false, '1.0', 'screen');
413
+ wp_enqueue_style('nggadmincp', NGGALLERY_URLPATH.'admin/css/nggColorPicker.css', false, '1.0', 'screen');
414
+ break;
415
+ }
416
+ }
417
+
418
+ function show_help($help, $screen) {
419
+
420
+ // since WP3.0 it's an object
421
+ if ( is_object($screen) )
422
+ $screen = $screen->id;
423
+
424
+ $link = '';
425
+ // menu title is localized...
426
+ $i18n = strtolower ( _n( 'Gallery', 'Galleries', 1, 'nggallery' ) );
427
+
428
+ switch ($screen) {
429
+ case 'toplevel_page_' . NGGFOLDER :
430
+ $link = __('<a href="http://www.nextgen-gallery.com" target="_blank">Introduction</a>', 'nggallery');
431
+ break;
432
+ case "{$i18n}_page_nggallery-about" :
433
+ $link = __('<a href="http://www.nextgen-gallery.com/languages" target="_blank">Languages</a>', 'nggallery');
434
+ break;
435
+ }
436
+
437
+ if ( !empty($link) ) {
438
+ $help = '<h5>' . __('Get help with NextGEN Gallery', 'nggallery') . '</h5>';
439
+ $help .= '<div class="metabox-prefs">';
440
+ $help .= $link;
441
+ $help .= "</div>\n";
442
+ $help .= '<h5>' . __('More Help & Info', 'nggallery') . '</h5>';
443
+ $help .= '<div class="metabox-prefs">';
444
+ $help .= __('<a href="http://wordpress.org/tags/nextgen-gallery?forum_id=10" target="_blank">Support Forums</a>', 'nggallery');
445
+ $help .= ' | <a href="http://www.nextgen-gallery.com/faq/" target="_blank">' . __('FAQ', 'nggallery') . '</a>';
446
+ $help .= ' | <a href="https://bitbucket.org/photocrati/nextgen-gallery/issues" target="_blank">' . __('Feature request', 'nggallery') . '</a>';
447
+ $help .= ' | <a href="http://www.nextgen-gallery.com/languages" target="_blank">' . __('Get your language pack', 'nggallery') . '</a>';
448
+ $help .= ' | <a href="https://bitbucket.org/photocrati/nextgen-gallery" target="_blank">' . __('Contribute development', 'nggallery') . '</a>';
449
+ $help .= ' | <a href="http://wordpress.org/extend/plugins/nextgen-gallery" target="_blank">' . __('Download latest version', 'nggallery') . '</a>';
450
+ $help .= "</div>\n";
451
+ }
452
+
453
+ return $help;
454
+ }
455
+
456
+ /**
457
+ * New wrapper for WordPress 3.3, so contextual help will be added to the admin bar
458
+ * Rework this see http://wpdevel.wordpress.com/2011/12/06/help-and-screen-api-changes-in-3-3/
459
+ *
460
+ * @since 1.9.0
461
+ * @param object $screen
462
+ * @return void
463
+ */
464
+ function add_contextual_help($screen) {
465
+
466
+ $help = $this->show_help('', $screen);
467
+ //add_contextual_help( $screen, $help );
468
+ }
469
+
470
+ /**
471
+ * We need to manipulate the current_screen name so that we can show the correct column screen options
472
+ *
473
+ * @since 1.8.0
474
+ * @param object $screen
475
+ * @return object $screen
476
+ */
477
+ function edit_current_screen($screen) {
478
+
479
+ if ( is_string($screen) )
480
+ $screen = convert_to_screen($screen);
481
+
482
+ // menu title is localized, so we need to change the toplevel name
483
+ $i18n = strtolower ( _n( 'Gallery', 'Galleries', 1, 'nggallery' ) );
484
+
485
+ switch ($screen->id) {
486
+ case "{$i18n}_page_nggallery-manage-gallery" :
487
+ // we would like to have screen option only at the manage images / gallery page
488
+ if ( isset ($_POST['sortGallery']) )
489
+ $screen = $screen;
490
+ else if ( (isset($_GET['mode']) && $_GET['mode'] == 'edit') || isset ($_POST['backToGallery']) )
491
+ $screen->base = $screen->id = 'nggallery-manage-images';
492
+ else if ( (isset($_GET['mode']) && $_GET['mode'] == 'sort') )
493
+ $screen = $screen;
494
+ else
495
+ $screen->base = $screen->id = 'nggallery-manage-gallery';
496
+ break;
497
+ }
498
+
499
+ if ( defined('IS_WP_3_3') )
500
+ $this->add_contextual_help($screen);
501
+
502
+ return $screen;
503
+ }
504
+
505
+ /**
506
+ * We need to register the columns at a very early point
507
+ *
508
+ * @return void
509
+ */
510
+ function register_columns() {
511
+ include_once ( dirname (__FILE__) . '/manage-images.php' );
512
+
513
+ $wp_list_table = new _NGG_Images_List_Table('nggallery-manage-images');
514
+
515
+ include_once ( dirname (__FILE__) . '/manage-galleries.php' );
516
+
517
+ $wp_list_table = new _NGG_Galleries_List_Table('nggallery-manage-gallery');
518
+ }
519
+
520
+ /**
521
+ * Read an array from a remote url
522
+ *
523
+ * @param string $url
524
+ * @return array of the content
525
+ */
526
+ function get_remote_array($url) {
527
+
528
+ if ( function_exists('wp_remote_request') ) {
529
+
530
+ if ( false === ( $content = get_transient( 'ngg_request_' . md5($url) ) ) ) {
531
+
532
+ $options = array();
533
+ $options['headers'] = array(
534
+ 'User-Agent' => 'NextGEN Gallery Information Reader V' . NGGVERSION . '; (' . get_bloginfo('url') .')'
535
+ );
536
+
537
+ $response = wp_remote_request($url, $options);
538
+
539
+ if ( is_wp_error( $response ) )
540
+ return false;
541
+
542
+ if ( 200 != $response['response']['code'] )
543
+ return false;
544
+
545
+ $content = $response['body'];
546
+ set_transient( 'ngg_request_' . md5($url), $content, 60*60*48 );
547
+ }
548
+
549
+ $content = unserialize($content);
550
+
551
+ if (is_array($content))
552
+ return $content;
553
+ }
554
+
555
+ return false;
556
+ }
557
+
558
+ }
559
+
560
+ function wpmu_site_admin() {
561
+ // Check for site admin
562
+ if ( function_exists('is_super_admin') )
563
+ if ( is_super_admin() )
564
+ return true;
565
+
566
+ return false;
567
+ }
568
+
569
+ function wpmu_enable_function($value) {
570
+ if (is_multisite()) {
571
+ $ngg_options = get_site_option('ngg_options');
572
+ return $ngg_options[$value];
573
+ }
574
+ // if this is not WPMU, enable it !
575
+ return true;
576
+ }
admin/ajax.php ADDED
@@ -0,0 +1,450 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('wp_ajax_ngg_ajax_operation', 'ngg_ajax_operation' );
3
+
4
+ /**
5
+ * Image edit functions via AJAX
6
+ *
7
+ * @author Alex Rabe
8
+ *
9
+ *
10
+ * @return void
11
+ */
12
+ function ngg_ajax_operation() {
13
+
14
+ global $wpdb;
15
+
16
+ // if nonce is not correct it returns -1
17
+ check_ajax_referer( "ngg-ajax" );
18
+
19
+ // check for correct capability
20
+ if ( !is_user_logged_in() )
21
+ die('-1');
22
+
23
+ // check for correct NextGEN capability
24
+ if ( !current_user_can('NextGEN Upload images') && !current_user_can('NextGEN Manage gallery') )
25
+ die('-1');
26
+
27
+ // include the ngg function
28
+ include_once (dirname (__FILE__) . '/functions.php');
29
+
30
+ // Get the image id
31
+ if ( isset($_POST['image'])) {
32
+ $id = (int) $_POST['image'];
33
+ // let's get the image data
34
+ $picture = nggdb::find_image( $id );
35
+ // what do you want to do ?
36
+ switch ( $_POST['operation'] ) {
37
+ case 'create_thumbnail' :
38
+ $result = nggAdmin::create_thumbnail($picture);
39
+ break;
40
+ case 'resize_image' :
41
+ $result = nggAdmin::resize_image($picture);
42
+ break;
43
+ case 'rotate_cw' :
44
+ $result = nggAdmin::rotate_image($picture, 'CW');
45
+ nggAdmin::create_thumbnail($picture);
46
+ break;
47
+ case 'rotate_ccw' :
48
+ $result = nggAdmin::rotate_image($picture, 'CCW');
49
+ nggAdmin::create_thumbnail($picture);
50
+ break;
51
+ case 'set_watermark' :
52
+ $result = nggAdmin::set_watermark($picture);
53
+ break;
54
+ case 'recover_image' :
55
+ $result = nggAdmin::recover_image($picture);
56
+ break;
57
+ case 'import_metadata' :
58
+ $result = nggAdmin::import_MetaData( $id );
59
+ break;
60
+ case 'get_image_ids' :
61
+ $result = nggAdmin::get_image_ids( $id );
62
+ break;
63
+ default :
64
+ do_action( 'ngg_ajax_' . $_POST['operation'] );
65
+ die('-1');
66
+ break;
67
+ }
68
+ // A success should return a '1'
69
+ die ($result);
70
+ }
71
+
72
+ // The script should never stop here
73
+ die('0');
74
+ }
75
+
76
+ add_action('wp_ajax_createNewThumb', 'createNewThumb');
77
+
78
+ function createNewThumb() {
79
+
80
+ global $ngg;
81
+
82
+ // check for correct capability
83
+ if ( !is_user_logged_in() )
84
+ die('-1');
85
+
86
+ // check for correct NextGEN capability
87
+ if ( !current_user_can('NextGEN Manage gallery') )
88
+ die('-1');
89
+
90
+ include_once( nggGallery::graphic_library() );
91
+
92
+ $id = (int) $_POST['id'];
93
+ $picture = nggdb::find_image( $id );
94
+
95
+ $x = round( $_POST['x'] * $_POST['rr'], 0);
96
+ $y = round( $_POST['y'] * $_POST['rr'], 0);
97
+ $w = round( $_POST['w'] * $_POST['rr'], 0);
98
+ $h = round( $_POST['h'] * $_POST['rr'], 0);
99
+
100
+ $thumb = new ngg_Thumbnail($picture->imagePath, TRUE);
101
+
102
+ $thumb->crop($x, $y, $w, $h);
103
+
104
+ // Note : the routine is a bit different to create_thumbnail(), due to rounding it's resized in the other way
105
+ if ($ngg->options['thumbfix']) {
106
+ // check for portrait format
107
+ if ($thumb->currentDimensions['height'] > $thumb->currentDimensions['width']) {
108
+ // first resize to the wanted height, here changed to create_thumbnail()
109
+ $thumb->resize(0, $ngg->options['thumbheight']);
110
+ // get optimal y startpos
111
+ $ypos = ($thumb->currentDimensions['height'] - $ngg->options['thumbheight']) / 2;
112
+ $thumb->crop(0, $ypos, $ngg->options['thumbwidth'],$ngg->options['thumbheight']);
113
+ } else {
114
+ // first resize to the wanted width, here changed to create_thumbnail()
115
+ $thumb->resize($ngg->options['thumbwidth'], 0);
116
+ //
117
+ // get optimal x startpos
118
+ $xpos = ($thumb->currentDimensions['width'] - $ngg->options['thumbwidth']) / 2;
119
+ $thumb->crop($xpos, 0, $ngg->options['thumbwidth'],$ngg->options['thumbheight']);
120
+ }
121
+ //this create a thumbnail but keep ratio settings
122
+ } else {
123
+ $thumb->resize($ngg->options['thumbwidth'],$ngg->options['thumbheight']);
124
+ }
125
+
126
+ if ( $thumb->save($picture->thumbPath, 100)) {
127
+
128
+ //read the new sizes
129
+ $new_size = @getimagesize ( $picture->thumbPath );
130
+ $size['width'] = $new_size[0];
131
+ $size['height'] = $new_size[1];
132
+
133
+ // add them to the database
134
+ nggdb::update_image_meta($picture->pid, array( 'thumbnail' => $size) );
135
+
136
+ echo "OK";
137
+ } else {
138
+ header('HTTP/1.1 500 Internal Server Error');
139
+ echo "KO";
140
+ }
141
+
142
+ exit();
143
+
144
+ }
145
+
146
+ add_action('wp_ajax_rotateImage', 'ngg_rotateImage');
147
+
148
+ function ngg_rotateImage() {
149
+
150
+ // check for correct capability
151
+ if ( !is_user_logged_in() )
152
+ die('-1');
153
+
154
+ // check for correct NextGEN capability
155
+ if ( !current_user_can('NextGEN Manage gallery') )
156
+ die('-1');
157
+
158
+ require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php');
159
+
160
+ // include the ngg function
161
+ include_once (dirname (__FILE__). '/functions.php');
162
+
163
+ $ngg_options = get_option('ngg_options');
164
+
165
+ $id = (int) $_POST['id'];
166
+ $result = '-1';
167
+
168
+ switch ( $_POST['ra'] ) {
169
+ case 'cw' :
170
+ $result = nggAdmin::rotate_image($id, 'CW');
171
+ break;
172
+ case 'ccw' :
173
+ $result = nggAdmin::rotate_image($id, 'CCW');
174
+ break;
175
+ case 'fv' :
176
+ $result = nggAdmin::rotate_image($id, 0, 'V');
177
+ break;
178
+ case 'fh' :
179
+ $result = nggAdmin::rotate_image($id, 0, 'H');
180
+ break;
181
+ }
182
+
183
+ // recreate the thumbnail
184
+ nggAdmin::create_thumbnail($id);
185
+
186
+ if ( $result == 1 )
187
+ die('1');
188
+
189
+ header('HTTP/1.1 500 Internal Server Error');
190
+ die( $result );
191
+
192
+ }
193
+
194
+ add_action('wp_ajax_ngg_dashboard', 'ngg_ajax_dashboard');
195
+
196
+ function ngg_ajax_dashboard() {
197
+
198
+ require_once( dirname( dirname(__FILE__) ) . '/admin/admin.php');
199
+ require_once( dirname( dirname(__FILE__) ) . '/admin/overview.php');
200
+
201
+ if ( !current_user_can('NextGEN Gallery overview') )
202
+ die('-1');
203
+
204
+ @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
205
+ @header( 'X-Content-Type-Options: nosniff' );
206
+
207
+ switch ( $_GET['jax'] ) {
208
+
209
+ case 'ngg_lastdonators' :
210
+ ngg_overview_donators();
211
+ break;
212
+
213
+ case 'dashboard_primary' :
214
+ ngg_overview_news();
215
+ break;
216
+
217
+ case 'ngg_locale' :
218
+ ngg_locale();
219
+ break;
220
+
221
+ case 'dashboard_plugins' :
222
+ ngg_related_plugins();
223
+ break;
224
+
225
+ }
226
+ die();
227
+ }
228
+
229
+ add_action('wp_ajax_ngg_file_browser', 'ngg_ajax_file_browser');
230
+
231
+ /**
232
+ * jQuery File Tree PHP Connector
233
+ * @author Cory S.N. LaViska - A Beautiful Site (http://abeautifulsite.net/)
234
+ * @version 1.0.1
235
+ *
236
+ * @return string folder content
237
+ */
238
+ function ngg_ajax_file_browser() {
239
+
240
+ global $ngg;
241
+
242
+ // check for correct NextGEN capability
243
+ if ( !current_user_can('NextGEN Upload images') && !current_user_can('NextGEN Manage gallery') )
244
+ die('No access');
245
+
246
+ if ( !defined('ABSPATH') )
247
+ die('No access');
248
+
249
+ // if nonce is not correct it returns -1
250
+ check_ajax_referer( 'ngg-ajax', 'nonce' );
251
+
252
+ //PHP4 compat script
253
+ if (!function_exists('scandir')) {
254
+ function scandir($dir, $listDirectories = false, $skipDots = true ) {
255
+ $dirArray = array();
256
+ if ($handle = opendir($dir) ) {
257
+ while (false !== ($file = readdir($handle))) {
258
+ if (($file != '.' && $file != '..' ) || $skipDots == true) {
259
+ if($listDirectories == false) { if(is_dir($file)) { continue; } }
260
+ array_push($dirArray, basename($file) );
261
+ }
262
+ }
263
+ closedir($handle);
264
+ }
265
+ return $dirArray;
266
+ }
267
+ }
268
+
269
+ // start from the default path
270
+ $root = trailingslashit ( WINABSPATH );
271
+ // get the current directory
272
+ $dir = trailingslashit ( urldecode($_POST['dir']) );
273
+
274
+ if( file_exists($root . $dir) ) {
275
+ $files = scandir($root . $dir);
276
+ natcasesort($files);
277
+
278
+ // The 2 counts for . and ..
279
+ if( count($files) > 2 ) {
280
+ echo "<ul class=\"jqueryDirTree\" style=\"display: none;\">";
281
+
282
+ // return only directories
283
+ foreach( $files as $file ) {
284
+
285
+ //reserved name for the thumnbnails, don't use it as folder name
286
+ if ( $file == 'thumbs')
287
+ continue;
288
+
289
+ if ( file_exists($root . $dir . $file) && $file != '.' && $file != '..' && is_dir($root . $dir . $file) ) {
290
+ echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . esc_html($dir . $file) . "/\">" . esc_html($file) . "</a></li>";
291
+ }
292
+ }
293
+
294
+ echo "</ul>";
295
+ }
296
+ }
297
+
298
+ die();
299
+ }
300
+
301
+ add_action('wp_ajax_ngg_tinymce', 'ngg_ajax_tinymce');
302
+ /**
303
+ * Call TinyMCE window content via admin-ajax
304
+ *
305
+ * @since 1.7.0
306
+ * @return html content
307
+ */
308
+ function ngg_ajax_tinymce() {
309
+
310
+ // check for rights
311
+ if ( !current_user_can('edit_pages') && !current_user_can('edit_posts') )
312
+ die(__("You are not allowed to be here"));
313
+
314
+ include_once( dirname( dirname(__FILE__) ) . '/admin/tinymce/window.php');
315
+
316
+ throw new E_Clean_Exit();
317
+ }
318
+
319
+ add_action( 'wp_ajax_ngg_rebuild_unique_slugs', 'ngg_ajax_rebuild_unique_slugs' );
320
+ /**
321
+ * This rebuild the slugs for albums, galleries and images as ajax routine, max 50 elements per request
322
+ *
323
+ * @since 1.7.0
324
+ * @return string '1'
325
+ */
326
+ function ngg_ajax_rebuild_unique_slugs() {
327
+ global $wpdb;
328
+
329
+ // check for correct NextGEN capability
330
+ if ( !current_user_can('NextGEN Change options') )
331
+ die('No access');
332
+
333
+ $action = $_POST['_action'];
334
+ $offset = (int) $_POST['offset'];
335
+
336
+ switch ($action) {
337
+ case 'images':
338
+ $images = $wpdb->get_results("SELECT * FROM $wpdb->nggpictures ORDER BY pid ASC LIMIT $offset, 50", OBJECT_K);
339
+ if ( is_array($images) ) {
340
+ foreach ($images as $image) {
341
+ //slug must be unique, we use the alttext for that
342
+ $image->slug = nggdb::get_unique_slug( sanitize_title( $image->alttext ), 'image', $image->pid );
343
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->nggpictures SET image_slug= '%s' WHERE pid = '%d'" , $image->slug, $image->pid ) );
344
+ }
345
+ }
346
+ break;
347
+ case 'gallery':
348
+ $galleries = $wpdb->get_results("SELECT * FROM $wpdb->nggallery ORDER BY gid ASC LIMIT $offset, 50", OBJECT_K);
349
+ if ( is_array($galleries) ) {
350
+ foreach ($galleries as $gallery) {
351
+ //slug must be unique, we use the title for that
352
+ $gallery->slug = nggdb::get_unique_slug( sanitize_title( $gallery->title ), 'gallery', $gallery->gid );
353
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->nggallery SET slug= '%s' WHERE gid = '%d'" , $gallery->slug, $gallery->gid ) );
354
+ }
355
+ }
356
+ break;
357
+ case 'album':
358
+ $albumlist = $wpdb->get_results("SELECT * FROM $wpdb->nggalbum ORDER BY id ASC LIMIT $offset, 50", OBJECT_K);
359
+ if ( is_array($albumlist) ) {
360
+ foreach ($albumlist as $album) {
361
+ //slug must be unique, we use the name for that
362
+ $album->slug = nggdb::get_unique_slug( sanitize_title( $album->name ), 'album', $album->id );
363
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->nggalbum SET slug= '%s' WHERE id = '%d'" , $album->slug, $album->id ) );
364
+ }
365
+ }
366
+ break;
367
+ }
368
+
369
+ die(1);
370
+ }
371
+ add_action('wp_ajax_ngg_image_check', 'ngg_ajax_image_check');
372
+ /**
373
+ * Test for various image resolution
374
+ *
375
+ * @since 1.7.3
376
+ * @return result
377
+ */
378
+ function ngg_ajax_image_check() {
379
+
380
+ // check for correct NextGEN capability
381
+ if ( !current_user_can('NextGEN Upload images') )
382
+ die('No access');
383
+
384
+ if ( !defined('ABSPATH') )
385
+ die('No access');
386
+
387
+ $step = (int) $_POST['step'];
388
+
389
+ // build the test sizes
390
+ $sizes = array();
391
+ $sizes[1] = array ( 'width' => 800, 'height' => 600);
392
+ $sizes[2] = array ( 'width' => 1024, 'height' => 768);
393
+ $sizes[3] = array ( 'width' => 1280, 'height' => 960); // 1MP
394
+ $sizes[4] = array ( 'width' => 1600, 'height' => 1200); // 2MP
395
+ $sizes[5] = array ( 'width' => 2016, 'height' => 1512); // 3MP
396
+ $sizes[6] = array ( 'width' => 2272, 'height' => 1704); // 4MP
397
+ $sizes[7] = array ( 'width' => 2560, 'height' => 1920); // 5MP
398
+ $sizes[8] = array ( 'width' => 2848, 'height' => 2136); // 6MP
399
+ $sizes[9] = array ( 'width' => 3072, 'height' => 2304); // 7MP
400
+ $sizes[10] = array ( 'width' => 3264, 'height' => 2448); // 8MP
401
+ $sizes[11] = array ( 'width' => 4048, 'height' => 3040); // 12MP
402
+
403
+ if ( $step < 1 || $step > 11 )
404
+ die('No vaild value');
405
+
406
+ // let's test each image size
407
+ $temp = imagecreatetruecolor ($sizes[$step]['width'], $sizes[$step]['height'] );
408
+ imagedestroy ($temp);
409
+
410
+ $result = array ('stat' => 'ok', 'message' => sprintf(__('Could create image with %s x %s pixel', 'nggallery'), $sizes[$step]['width'], $sizes[$step]['height'] ) );
411
+
412
+ header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
413
+ echo json_encode($result);
414
+
415
+ die();
416
+ }
417
+
418
+ add_action('wp_ajax_ngg_test_head_footer', 'ngg_ajax_test_head_footer');
419
+ /**
420
+ * Check for the header / footer, parts taken from Matt Martz (http://sivel.net/)
421
+ *
422
+ * @see https://gist.github.com/378450
423
+ * @since 1.7.3
424
+ * @return result
425
+ */
426
+ function ngg_ajax_test_head_footer() {
427
+
428
+ // Build the url to call, NOTE: uses home_url and thus requires WordPress 3.0
429
+ $url = add_query_arg( array( 'test-head' => '', 'test-footer' => '' ), home_url() );
430
+ // Perform the HTTP GET ignoring SSL errors
431
+ $response = wp_remote_get( $url, array( 'sslverify' => false ) );
432
+ // Grab the response code and make sure the request was sucessful
433
+ $code = (int) wp_remote_retrieve_response_code( $response );
434
+ if ( $code == 200 ) {
435
+ global $head_footer_errors;
436
+ $head_footer_errors = array();
437
+
438
+ // Strip all tabs, line feeds, carriage returns and spaces
439
+ $html = preg_replace( '/[\t\r\n\s]/', '', wp_remote_retrieve_body( $response ) );
440
+
441
+ // Check to see if we found the existence of wp_head
442
+ if ( ! strstr( $html, '<!--wp_head-->' ) )
443
+ die('Missing the call to wp_head() in your theme, contact the theme author');
444
+ // Check to see if we found the existence of wp_footer
445
+ if ( ! strstr( $html, '<!--wp_footer-->' ) )
446
+ die('Missing the call to wp_footer() in your theme, contact the theme author');
447
+ }
448
+ die('success');
449
+ }
450
+ ?>
admin/album.php ADDED
@@ -0,0 +1,597 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ class nggManageAlbum {
6
+
7
+ /**
8
+ * The selected album ID
9
+ *
10
+ * @since 1.3.0
11
+ * @access privat
12
+ * @var int
13
+ */
14
+ var $currentID = 0;
15
+
16
+ /**
17
+ * The array for the galleries
18
+ *
19
+ * @since 1.3.0
20
+ * @access privat
21
+ * @var array
22
+ */
23
+ var $galleries = false;
24
+
25
+ /**
26
+ * The array for the albums
27
+ *
28
+ * @since 1.3.0
29
+ * @access privat
30
+ * @var array
31
+ */
32
+ var $albums = false;
33
+
34
+ /**
35
+ * The amount of all galleries
36
+ *
37
+ * @since 1.4.0
38
+ * @access privat
39
+ * @var int
40
+ */
41
+ var $num_galleries = false;
42
+
43
+ /**
44
+ * The amount of all albums
45
+ *
46
+ * @since 1.4.0
47
+ * @access privat
48
+ * @var int
49
+ */
50
+ var $num_albums = false;
51
+
52
+ /**
53
+ * PHP4 compatibility layer for calling the PHP5 constructor.
54
+ *
55
+ */
56
+ function nggManageAlbum() {
57
+ return $this->__construct();
58
+ }
59
+
60
+ /**
61
+ * Init the album output
62
+ *
63
+ */
64
+ function __construct() {
65
+ return true;
66
+ }
67
+
68
+ function controller() {
69
+ global $nggdb;
70
+
71
+ $this->currentID = isset($_REQUEST['act_album']) ? (int) $_REQUEST['act_album'] : 0 ;
72
+
73
+ if (isset ($_POST['update']) || isset( $_POST['delete'] ) || isset( $_POST['add'] ) )
74
+ $this->processor();
75
+
76
+ if (isset ($_POST['update_album']) )
77
+ $this->update_album();
78
+
79
+ // get first all galleries & albums
80
+ $this->albums = $nggdb->find_all_album();
81
+ $this->galleries = $nggdb->find_all_galleries();
82
+ $this->num_albums = count( $this->albums );
83
+ $this->num_galleries = count( $this->galleries );
84
+ $this->output();
85
+
86
+ }
87
+
88
+ function processor() {
89
+ global $wpdb;
90
+
91
+ check_admin_referer('ngg_album');
92
+
93
+ if ( isset($_POST['add']) && isset ($_POST['newalbum']) ) {
94
+
95
+ if (!nggGallery::current_user_can( 'NextGEN Add/Delete album' ))
96
+ wp_die(__('Cheatin&#8217; uh?'));
97
+
98
+ $result = nggdb::add_album( $_POST['newalbum'] );
99
+ $this->currentID = ($result) ? $result : 0 ;
100
+
101
+ //hook for other plugins
102
+ do_action('ngg_add_album', $this->currentID);
103
+
104
+ if ($result)
105
+ nggGallery::show_message(__('Update Successfully','nggallery'));
106
+ }
107
+
108
+ if ( isset($_POST['update']) && ($this->currentID > 0) ) {
109
+
110
+ $gid = '';
111
+
112
+ // get variable galleryContainer
113
+ parse_str($_POST['sortorder']);
114
+ if ( is_array($gid) ){
115
+ $serial_sort = serialize($gid);
116
+ $wpdb->query("UPDATE $wpdb->nggalbum SET sortorder = '$serial_sort' WHERE id = $this->currentID ");
117
+ } else {
118
+ $wpdb->query("UPDATE $wpdb->nggalbum SET sortorder = '0' WHERE id = $this->currentID ");
119
+ }
120
+
121
+ //hook for other plugins
122
+ do_action('ngg_update_album_sortorder', $this->currentID);
123
+
124
+ nggGallery::show_message(__('Update Successfully','nggallery'));
125
+
126
+ }
127
+
128
+ if ( isset($_POST['delete']) ) {
129
+
130
+ if (!nggGallery::current_user_can( 'NextGEN Add/Delete album' ))
131
+ wp_die(__('Cheatin&#8217; uh?'));
132
+
133
+ $result = nggdb::delete_album( $this->currentID );
134
+
135
+ //hook for other plugins
136
+ do_action('ngg_delete_album', $this->currentID);
137
+
138
+ // jump back to main selection
139
+ $this->currentID = 0;
140
+
141
+ if ($result)
142
+ nggGallery::show_message(__('Album deleted','nggallery'));
143
+ }
144
+
145
+ }
146
+
147
+ function update_album() {
148
+ global $wpdb, $nggdb;
149
+
150
+ check_admin_referer('ngg_thickbox_form');
151
+
152
+ if (!nggGallery::current_user_can( 'NextGEN Edit album settings' ))
153
+ wp_die(__('Cheatin&#8217; uh?'));
154
+
155
+ $name = $_POST['album_name'];
156
+ $desc = $_POST['album_desc'];
157
+ $prev = (int) $_POST['previewpic'];
158
+ $link = (int) $_POST['pageid'];
159
+
160
+ // slug must be unique, we use the title for that
161
+ $slug = nggdb::get_unique_slug( sanitize_title( $name ), 'album', $this->currentID );
162
+
163
+ $result = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->nggalbum SET slug= '%s', name= '%s', albumdesc= '%s', previewpic= %d, pageid= %d WHERE id = '%d'" , $slug, $name, $desc, $prev, $link, $this->currentID ) );
164
+
165
+ //hook for other plugin to update the fields
166
+ do_action('ngg_update_album', $this->currentID, $_POST);
167
+
168
+ if ($result)
169
+ nggGallery::show_message(__('Update Successfully','nggallery'));
170
+ }
171
+
172
+ function output() {
173
+
174
+ global $wpdb, $nggdb;
175
+
176
+ //TODO:Code MUST be optimized, how to flag a used gallery better ?
177
+ $used_list = $this->get_used_galleries();
178
+
179
+ ?>
180
+
181
+ <script type="text/javascript">
182
+
183
+ jQuery(document).ready(
184
+ function()
185
+ {
186
+ jQuery("#previewpic").nggAutocomplete( {
187
+ type: 'image',domain: "<?php echo home_url('index.php', is_ssl() ? 'https' : 'http'); ?>",width: "95%"
188
+ });
189
+
190
+ jQuery('#selectContainer').sortable( {
191
+ items: '.groupItem',
192
+ placeholder: 'sort_placeholder',
193
+ opacity: 0.7,
194
+ tolerance: 'intersect',
195
+ distance: 2,
196
+ forcePlaceholderSize: true ,
197
+ connectWith: ['#galleryContainer']
198
+ } );
199
+
200
+ jQuery('#galleryContainer').sortable( {
201
+ items: '.groupItem',
202
+ placeholder: 'sort_placeholder',
203
+ opacity: 0.7,
204
+ tolerance: 'intersect',
205
+ distance: 2,
206
+ forcePlaceholderSize: true ,
207
+ connectWith: ['#selectContainer', '#albumContainer']
208
+ } );
209
+
210
+ jQuery('#albumContainer').sortable( {
211
+ items: '.groupItem',
212
+ placeholder: 'sort_placeholder',
213
+ opacity: 0.7,
214
+ tolerance: 'intersect',
215
+ distance: 2,
216
+ forcePlaceholderSize: true ,
217
+ connectWith: ['#galleryContainer']
218
+ } );
219
+
220
+ jQuery('a.min').bind('click', toggleContent);
221
+
222
+ // Hide used galleries
223
+ jQuery('a#toggle_used').click(function()
224
+ {
225
+ jQuery('#selectContainer div.inUse').toggle();
226
+ return false;
227
+ }
228
+ );
229
+
230
+ // Maximize All Portlets (whole site, no differentiation)
231
+ jQuery('a#all_max').click(function()
232
+ {
233
+ jQuery('div.itemContent:hidden').show();
234
+ return false;
235
+ }
236
+ );
237
+
238
+ // Minimize All Portlets (whole site, no differentiation)
239
+ jQuery('a#all_min').click(function()
240
+ {
241
+ jQuery('div.itemContent:visible').hide();
242
+ return false;
243
+ }
244
+ );
245
+ // Auto Minimize if more than 4 (whole site, no differentiation)
246
+ if(jQuery('a.min').length > 4)
247
+ {
248
+ jQuery('a.min').html('[+]');
249
+ jQuery('div.itemContent:visible').hide();
250
+ jQuery('#selectContainer div.inUse').toggle();
251
+ };
252
+ }
253
+ );
254
+
255
+ var toggleContent = function(e)
256
+ {
257
+ var targetContent = jQuery('div.itemContent', this.parentNode.parentNode);
258
+ if (targetContent.css('display') == 'none') {
259
+ targetContent.slideDown(300);
260
+ jQuery(this).html('[-]');
261
+ } else {
262
+ targetContent.slideUp(300);
263
+ jQuery(this).html('[+]');
264
+ }
265
+ return false;
266
+ }
267
+
268
+ function ngg_serialize(s)
269
+ {
270
+ //serial = jQuery.SortSerialize(s);
271
+ serial = jQuery('#galleryContainer').sortable('serialize');
272
+ jQuery('input[name=sortorder]').val(serial);
273
+ }
274
+
275
+ function showDialog() {
276
+ jQuery( "#editalbum").dialog({
277
+ width: 640,
278
+ resizable : false,
279
+ modal: true,
280
+ title: '<?php echo esc_js( __('Edit Album', 'nggallery') ); ?>'
281
+ });
282
+ jQuery('#editalbum .dialog-cancel').click(function() { jQuery( "#editalbum" ).dialog("close"); });
283
+ }
284
+
285
+ </script>
286
+
287
+ <div class="wrap album" id="wrap" >
288
+ <?php include('templates/social_media_buttons.php'); ?>
289
+ <?php screen_icon( 'nextgen-gallery' ); ?>
290
+ <h2><?php esc_html_e('Manage Albums', 'nggallery') ?></h2>
291
+ <form id="selectalbum" method="POST" onsubmit="ngg_serialize()" accept-charset="utf-8">
292
+ <?php wp_nonce_field('ngg_album') ?>
293
+ <input name="sortorder" type="hidden" />
294
+ <div class="albumnav tablenav">
295
+ <div class="alignleft actions">
296
+ <?php esc_html_e('Select album', 'nggallery') ?>
297
+ <select id="act_album" name="act_album" onchange="this.form.submit();">
298
+ <option value="0" ><?php esc_html_e('No album selected', 'nggallery') ?></option>
299
+ <?php
300
+ if( is_array($this->albums) ) {
301
+ foreach($this->albums as $album) {
302
+ $selected = ($this->currentID == $album->id) ? 'selected="selected" ' : '';
303
+ echo '<option value="' . $album->id . '" ' . $selected . '>' . $album->id . ' - ' . esc_attr( $album->name ) . '</option>'."\n";
304
+ }
305
+ }
306
+ ?>
307
+ </select>
308
+ <?php if ($this->currentID > 0){ ?>
309
+ <input class="button-primary" type="submit" name="update" value="<?php esc_attr_e('Update', 'nggallery'); ?>"/>
310
+ <?php if(nggGallery::current_user_can( 'NextGEN Edit album settings' )) { ?>
311
+ <input class="button-secondary" type="submit" name="showThickbox" value="<?php esc_attr_e( 'Edit album', 'nggallery'); ?>" onclick="showDialog(); return false;" />
312
+ <?php } ?>
313
+ <?php if(nggGallery::current_user_can( 'NextGEN Add/Delete album' )) { ?>
314
+ <input class="button-secondary action "type="submit" name="delete" value="<?php esc_attr_e('Delete', 'nggallery'); ?>" onclick="javascript:check=confirm('<?php echo esc_js('Delete album ?','nggallery'); ?>');if(check==false) return false;"/>
315
+ <?php } ?>
316
+ <?php } else { ?>
317
+ <?php if(nggGallery::current_user_can( 'NextGEN Add/Delete album' )) { ?>
318
+ <span><?php esc_html_e('Add new album', 'nggallery'); ?>&nbsp;</span>
319
+ <input class="search-input" id="newalbum" name="newalbum" type="text" value="" />
320
+ <input class="button-secondary action" type="submit" name="add" value="<?php esc_attr_e('Add', 'nggallery'); ?>"/>
321
+ <?php } ?>
322
+ <?php } ?>
323
+ </div>
324
+ </div>
325
+ </form>
326
+
327
+ <br class="clear"/>
328
+
329
+ <div>
330
+ <div style="float:right;">
331
+ <a href="#" title="<?php esc_attr_e('Show / hide used galleries','nggallery'); ?>" id="toggle_used"><?php esc_html_e('[Show all]', 'nggallery'); ?></a>
332
+ | <a href="#" title="<?php esc_attr_e('Maximize the widget content','nggallery'); ?>" id="all_max"><?php esc_html_e('[Maximize]', 'nggallery'); ?></a>
333
+ | <a href="#" title="<?php esc_attr_e('Minimize the widget content','nggallery'); ?>" id="all_min"><?php esc_html_e('[Minimize]', 'nggallery'); ?></a>
334
+ </div>
335
+ <?php esc_html_e('After you create and select a album, you can drag and drop a gallery or another album into your new album below','nggallery'); ?>
336
+ </div>
337
+
338
+ <br class="clear" />
339
+
340
+ <div class="container">
341
+
342
+ <!-- /#album container -->
343
+ <div class="widget widget-right">
344
+ <div class="widget-top">
345
+ <h3><?php esc_html_e('Select album', 'nggallery'); ?></h3>
346
+ </div>
347
+ <div id="albumContainer" class="widget-holder">
348
+ <?php
349
+ if( is_array( $this->albums ) ) {
350
+ foreach($this->albums as $album) {
351
+ $this->get_container('a' . $album->id);
352
+ }
353
+ }
354
+ ?>
355
+ </div>
356
+ </div>
357
+
358
+ <!-- /#select container -->
359
+ <div class="widget widget-right">
360
+ <div class="widget-top">
361
+ <h3><?php esc_html_e('Select gallery', 'nggallery'); ?></h3>
362
+ </div>
363
+ <div id="selectContainer" class="widget-holder">
364
+ <?php
365
+
366
+ if( is_array( $this->galleries ) ) {
367
+ //get the array of galleries
368
+ $sort_array = $this->currentID > 0 ? (array) $this->albums[$this->currentID]->galleries : array() ;
369
+ foreach($this->galleries as $gallery) {
370
+ if (!in_array($gallery->gid, $sort_array)) {
371
+ if (in_array($gallery->gid,$used_list))
372
+ $this->get_container($gallery->gid,true);
373
+ else
374
+ $this->get_container($gallery->gid,false);
375
+ }
376
+ }
377
+ }
378
+ ?>
379
+ </div>
380
+ </div>
381
+
382
+ <!-- /#target-album -->
383
+ <div class="widget target-album widget-left">
384
+
385
+ <?php
386
+ if ($this->currentID > 0){
387
+ $album = $this->albums[$this->currentID];
388
+ ?>
389
+ <div class="widget-top">
390
+ <h3><?php esc_html_e('Album ID', 'nggallery'); ?> <?php echo $album->id . ' : ' . esc_html( $album->name ); ?> </h3>
391
+ </div>
392
+ <div id="galleryContainer" class="widget-holder target">
393
+ <?php
394
+ $sort_array = (array) $this->albums[$this->currentID]->galleries;
395
+ foreach($sort_array as $galleryid) {
396
+ $this->get_container($galleryid, false);
397
+ }
398
+ }
399
+ else
400
+ {
401
+ ?>
402
+ <div class="widget-top">
403
+ <h3><?php esc_html_e('No album selected!', 'nggallery'); ?></h3>
404
+ </div>
405
+ <div class="widget-holder target">
406
+ <?php
407
+ }
408
+ ?>
409
+ </div>
410
+ </div><!-- /#target-album -->
411
+
412
+ </div><!-- /#container -->
413
+ </div><!-- /#wrap -->
414
+
415
+ <?php if ($this->currentID > 0) : ?>
416
+ <!-- #editalbum -->
417
+ <div id="editalbum" style="display: none;" >
418
+ <form id="form-edit-album" method="POST" accept-charset="utf-8">
419
+ <?php wp_nonce_field('ngg_thickbox_form') ?>
420
+ <input type="hidden" id="current_album" name="act_album" value="<?php echo $this->currentID; ?>" />
421
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
422
+ <tr>
423
+ <th>
424
+ <?php esc_html_e('Album name:', 'nggallery'); ?><br />
425
+ <input class="search-input" id="album_name" name="album_name" type="text" value="<?php echo esc_attr( $album->name ); ?>" style="width:95%" />
426
+ </th>
427
+ </tr>
428
+ <tr>
429
+ <th>
430
+ <?php esc_html_e('Album description:', 'nggallery'); ?><br />
431
+ <textarea class="search-input" id="album_desc" name="album_desc" cols="50" rows="2" style="width:95%" ><?php echo esc_attr( $album->albumdesc ); ?></textarea>
432
+ </th>
433
+ </tr>
434
+ <tr>
435
+ <th>
436
+ <?php esc_html_e('Select a preview image:', 'nggallery'); ?><br />
437
+ <select id="previewpic" name="previewpic" style="width:95%" >
438
+ <?php if ($album->previewpic == 0) ?>
439
+ <option value="0"><?php esc_html_e('No picture', 'nggallery'); ?></option>
440
+ <?php
441
+ if ($album->previewpic == 0)
442
+ echo '<option value="0" selected="selected">' . __('No picture', 'nggallery') . '</option>';
443
+ else {
444
+ $picture = nggdb::find_image($album->previewpic);
445
+ echo '<option value="' . $picture->pid . '" selected="selected" >'. $picture->pid . ' - ' . ( empty($picture->alltext) ? esc_attr( $picture->filename ) : esc_attr( $picture->alltext ) ) .' </option>'."\n";
446
+ }
447
+ ?>
448
+ </select>
449
+ </th>
450
+ </tr>
451
+ <tr>
452
+ <th>
453
+ <?php esc_html_e('Page Link to', 'nggallery')?><br />
454
+ <select name="pageid" style="width:95%">
455
+ <option value="0" ><?php esc_html_e('Not linked', 'nggallery') ?></option>
456
+ <?php
457
+ if (!isset($album->pageid))
458
+ $album->pageid = 0;
459
+ parent_dropdown($album->pageid); ?>
460
+ </select>
461
+ </th>
462
+ </tr>
463
+
464
+ <?php do_action('ngg_edit_album_settings', $this->currentID); ?>
465
+
466
+ <tr align="right">
467
+ <td class="submit">
468
+ <input type="submit" class="button-primary" name="update_album" value="<?php esc_attr_e('OK', 'nggallery'); ?>" />
469
+ &nbsp;
470
+ <input class="button-secondary dialog-cancel" type="reset" value="<?php esc_attr_e('Cancel', 'nggallery'); ?>"/>
471
+ </td>
472
+ </tr>
473
+ </table>
474
+ </form>
475
+ </div>
476
+ <!-- /#editalbum -->
477
+ <?php endif; ?>
478
+
479
+ <?php
480
+
481
+ }
482
+
483
+ /**
484
+ * Create the album or gallery container
485
+ *
486
+ * @param integer $id (the prefix 'a' indidcates that you look for a album
487
+ * @param bool $used (object will be hidden)
488
+ * @return $output
489
+ */
490
+ function get_container($id = 0, $used = false) {
491
+ global $wpdb, $nggdb;
492
+
493
+ $obj = array();
494
+ $preview_image = '';
495
+ $class = '';
496
+
497
+ // if the id started with a 'a', then it's a sub album
498
+ if (substr( $id, 0, 1) == 'a') {
499
+
500
+ if ( !$album = $this->albums[ substr( $id, 1) ] )
501
+ return;
502
+
503
+ $obj['id'] = $album->id;
504
+ $obj['name'] = $obj['title'] = $album->name;
505
+ $obj['type'] = 'album';
506
+ $class = 'album_obj';
507
+
508
+ // get the post name
509
+ $post = get_post($album->pageid);
510
+ $obj['pagenname'] = ($post == null) ? '---' : $post->post_title;
511
+
512
+ // for speed reason we limit it to 50
513
+ if ( $this->num_albums < 50 ) {
514
+ if ($album->previewpic != 0) {
515
+ $image = $nggdb->find_image( $album->previewpic );
516
+ $preview_image = ( !is_null($image->thumbURL) ) ? '<div class="inlinepicture"><img src="' . esc_url( $image->thumbURL ). '" /></div>' : '';
517
+ }
518
+ }
519
+
520
+ // this indicates that we have a album container
521
+ $prefix = 'a';
522
+
523
+ } else {
524
+ if ( !$gallery = $nggdb->find_gallery( $id ) )
525
+ return;
526
+
527
+ $obj['id'] = $gallery->gid;
528
+ $obj['name'] = $gallery->name;
529
+ $obj['title'] = $gallery->title;
530
+ $obj['type'] = 'gallery';
531
+
532
+ // get the post name
533
+ $post = get_post($gallery->pageid);
534
+ $obj['pagenname'] = ($post == null) ? '---' : $post->post_title;
535
+
536
+ // for spped reason we limit it to 50
537
+ if ( $this->num_galleries < 50 ) {
538
+ // set image url
539
+ $image = $nggdb->find_image( $gallery->previewpic );
540
+ $preview_image = isset($image->thumbURL) ? '<div class="inlinepicture"><img src="' . esc_url( $image->thumbURL ) . '" /></div>' : '';
541
+ }
542
+
543
+ $prefix = '';
544
+ }
545
+
546
+ // add class if it's in use in other albums
547
+ $used = $used ? ' inUse' : '';
548
+
549
+ echo '<div id="gid-' . $prefix . $obj['id'] . '" class="groupItem' . $used . '">
550
+ <div class="innerhandle">
551
+ <div class="item_top ' . $class . '">
552
+ <a href="#" class="min" title="close">[-]</a>
553
+ ID: ' . $obj['id'] . ' | ' . wp_html_excerpt( esc_html ( nggGallery::i18n( $obj['title'] ) ) , 25) . '
554
+ </div>
555
+ <div class="itemContent">
556
+ ' . $preview_image . '
557
+ <p><strong>' . __('Name', 'nggallery') . ' : </strong>' . esc_html ( nggGallery::i18n( $obj['name'] ) ). '</p>
558
+ <p><strong>' . __('Title', 'nggallery') . ' : </strong>' . esc_html ( nggGallery::i18n( $obj['title'] ) ) . '</p>
559
+ <p><strong>' . __('Page', 'nggallery'). ' : </strong>' . esc_html ( nggGallery::i18n( $obj['pagenname'] ) ) . '</p>
560
+ ' . apply_filters('ngg_display_album_item_content', '', $obj) . '
561
+ </div>
562
+ </div>
563
+ </div>';
564
+ }
565
+
566
+ /**
567
+ * get all used galleries from all albums
568
+ *
569
+ * @return array $used_galleries_ids
570
+ */
571
+ function get_used_galleries() {
572
+
573
+ $used = array();
574
+
575
+ if ($this->albums) {
576
+ foreach($this->albums as $key => $value) {
577
+ $sort_array = $this->albums[$key]->galleries;
578
+ foreach($sort_array as $galleryid) {
579
+ if (!in_array($galleryid, $used))
580
+ $used[] = $galleryid;
581
+ }
582
+ }
583
+ }
584
+
585
+ return $used;
586
+ }
587
+
588
+ /**
589
+ * PHP5 style destructor
590
+ *
591
+ * @return bool Always true
592
+ */
593
+ function __destruct() {
594
+ return true;
595
+ }
596
+
597
+ }
admin/css/images/dropdown.png ADDED
Binary file
admin/css/images/ui-anim_basic_16x16.gif ADDED
Binary file
admin/css/images/ui-icons_222222_256x240.png ADDED
Binary file
admin/css/images/ui-icons_cccccc_256x240.png ADDED
Binary file
admin/css/images/ui-icons_ffffff_256x240.png ADDED
Binary file
admin/css/jquery.ui.css ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI CSS Framework @VERSION
3
+ *
4
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Theming/API
9
+ */
10
+
11
+ /* Layout helpers
12
+ ----------------------------------*/
13
+ .ui-helper-hidden { display: none; }
14
+ .ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
15
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
+ .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17
+ .ui-helper-clearfix { display: inline-block; }
18
+ /* required comment for clearfix to work in Opera \*/
19
+ * html .ui-helper-clearfix { height:1%; }
20
+ .ui-helper-clearfix { display:block; }
21
+ /* end clearfix */
22
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23
+
24
+ /* Interaction Cues
25
+ ----------------------------------*/
26
+ .ui-state-disabled { cursor: default !important; }
27
+
28
+ /* Icons
29
+ ----------------------------------*/
30
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
31
+
32
+ /* states and images */
33
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
34
+
35
+ /* Misc visuals
36
+ ----------------------------------*/
37
+
38
+ /* Overlays */
39
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
40
+
41
+ /* jQuery UI CSS Framework @VERSION */
42
+
43
+ /* Component containers
44
+ ----------------------------------*/
45
+ .ui-widget-content { background: #fcfdfd 50% bottom repeat-x; color: #222222; }
46
+ /* .ui-widget-content a { color: #222222; } */
47
+ .ui-widget-header { background: #222222 50% 50% repeat-x; color: #CFCFCF; }
48
+ .ui-widget-header a { color: #CFCFCF; }
49
+
50
+ /* Interaction states
51
+ ----------------------------------*/
52
+ .ui-dialog-titlebar-close:hover { border: 1px solid #464646; background: #464646 50% 50% repeat-x; font-weight: normal; color: #ffffff; }
53
+ .ui-widget :active { outline: none; }
54
+
55
+ /* Icons
56
+ ----------------------------------*/
57
+
58
+ /* states and images */
59
+ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_cccccc_256x240.png); }
60
+ .ui-widget-content .ui-icon {background-image: url(images/ui-icons_cccccc_256x240.png); }
61
+ .ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
62
+ .ui-state-default .ui-icon { background-image: url(images/ui-icons_cccccc_256x240.png); }
63
+ .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
64
+ .ui-state-active .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
65
+
66
+ /* positioning */
67
+ .ui-icon-close { background-position: -80px -128px; }
68
+ .ui-icon-closethick { background-position: -96px -128px; }
69
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
70
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
71
+
72
+ /* Misc visuals
73
+ ----------------------------------*/
74
+
75
+ /* Corner radius */
76
+ .ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; }
77
+ .ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; }
78
+ .ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; }
79
+ .ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
80
+ .ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; }
81
+ .ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
82
+ .ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
83
+ .ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; }
84
+ .ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }
85
+
86
+ /* Overlays */
87
+ .ui-widget-overlay { background: #000000 50% 50% repeat-x; opacity: .75;filter:Alpha(Opacity=75); }
88
+ .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #000000 50% 50% repeat-x; opacity: .75;filter:Alpha(Opacity=75); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
89
+
90
+ /* jQuery UI Resizable */
91
+ .ui-resizable { position: relative;}
92
+ .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
93
+ .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
94
+ .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
95
+ .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
96
+ .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
97
+ .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
98
+ .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
99
+ .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
100
+ .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
101
+ .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
102
+
103
+ /* jQuery UI Dialog */
104
+ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
105
+ .ui-dialog { -moz-box-shadow: rgba(0,0,0,1) 0 4px 30px; -webkit-box-shadow: rgba(0,0,0,1) 0 4px 30px; -khtml-box-shadow: rgba(0,0,0,1) 0 4px 30px; box-shadow: rgba(0,0,0,1) 0 4px 30px; }
106
+ .ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; }
107
+ .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; }
108
+ .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
109
+ .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
110
+ .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
111
+ .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
112
+ .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
113
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
114
+ .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
115
+ .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
116
+ .ui-draggable .ui-dialog-titlebar { cursor: move; }
117
+
118
+ /* jQuery UI Progressbar */
119
+ .ui-progressbar { height:2em; text-align: left; }
120
+ .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
121
+
122
+ /* jQuery UI Dialog loading spinner */
123
+ #spinner {display: none; width:100px; height: 100px; position: fixed; top: 50%; left: 50%; background:url(../../images/loader.gif) no-repeat center #fff; padding:10px; border:1px solid #666; margin-left: -50px; margin-top: -50px; z-index:2; overflow: auto; }
124
+
125
+ /* jQuery Autocomplete */
126
+ .ui-autocomplete { position: absolute; cursor: default; }
127
+ .ui-autocomplete-start { background: white url('images/dropdown.png') right center no-repeat; }
128
+ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
129
+ .ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
130
+ /* this limit the height of the result list*/
131
+ .ui-autocomplete { max-height: 90px; overflow-y: auto; }
132
+ * html .ui-autocomplete { height: 90px; }
133
+ .ui-autocomplete .ui-state-hover, .ui-autocomplete .ui-widget-content .ui-state-hover { background: #1e90ff; color: #FFFFFF !important; }
134
+ .ui-widget-content { border: 1px solid #dddddd; border-style:outset; background: #FFFFFF; }
135
+ .ui-autocomplete, .ui-autocomplete .ui-corner-all { -moz-border-radius: 0px; -webkit-border-radius: 0px; border-radius: 0px; }
136
+ .ui-menu { list-style:none; padding: 1px; margin: 0; display:block; float: left; }
137
+ .ui-menu .ui-menu { margin-top: -3px; }
138
+ .ui-menu .ui-menu-item { margin:0; padding:0; zoom:1; float:left; clear:left; width:100%; }
139
+ .ui-menu .ui-menu-item a { text-decoration:none; display:block; zoom:1; color: black;}
140
+ .ui-helper-hidden-accessible {display: none}
admin/css/jquery.ui.tabs.css ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Caution! Ensure accessibility in print and other media types... */
2
+ @media projection, screen { /* Use class for showing/hiding tab content, so that visibility can be better controlled in different media types... */
3
+ .ui-tabs-hide {
4
+ display: none;
5
+ }
6
+ }
7
+
8
+ /* Hide useless elements in print layouts... */
9
+ @media print {
10
+ .ui-tabs-nav {
11
+ display: none;
12
+ }
13
+ }
14
+
15
+ /* Skin */
16
+ #slider {
17
+ border-color:#EBEBEB rgb(204, 204, 204) rgb(204, 204, 204) rgb(235, 235, 235);
18
+ border-style:solid;
19
+ border-width:1px;
20
+ margin:15px 15% 0pt 15px;
21
+ padding:2px;
22
+ }
23
+ #tabs{
24
+ display: block;
25
+ background:#F1F1F1 none repeat scroll 0%;
26
+ font-size:14px;
27
+ overflow:hidden;
28
+ }
29
+
30
+ .ui-tabs-nav {
31
+ list-style: none;
32
+ margin: 0;
33
+ padding: 0 0 0 10px;
34
+ }
35
+ .ui-tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */
36
+ display: block;
37
+ clear: both;
38
+ content: " ";
39
+ }
40
+ .ui-tabs-nav li {
41
+ float: left;
42
+ padding: 6px 5px;
43
+ min-width: 84px; /* be nice to Opera */
44
+ margin: 2px 2px 0px 1px !important;
45
+ text-decoration: none;
46
+ list-style: none;
47
+ }
48
+ .ui-tabs-nav a, .ui-tabs-nav a span {
49
+ display: block;
50
+ padding: 0 1px;
51
+ }
52
+
53
+ .ui-tabs-nav a {
54
+ margin: 1px 0 0; /* position: relative makes opacity fail for disabled tab in IE */
55
+ padding-left: 0;
56
+ color: #2583AD;
57
+ line-height: 1.2;
58
+ text-align: center;
59
+ text-decoration: none;
60
+ white-space: nowrap; /* required in IE 6 */
61
+ outline: 0; /* prevent dotted border in Firefox */
62
+ }
63
+ .ui-tabs-nav .ui-tabs-selected{
64
+ background: #6D6D6D url(../images/menu-bits.gif) repeat-x scroll left top;
65
+ border-color: #6D6D6D;
66
+ color: #FFFFFF;
67
+ text-shadow:0 -1px 0 #666666;
68
+
69
+ -moz-border-radius-topright: 6px;
70
+ -khtml-border-top-right-radius: 6px;
71
+ -webkit-border-top-right-radius: 6px;
72
+ border-top-right-radius: 6px;
73
+ -moz-border-radius-topleft: 6px;
74
+ -khtml-border-top-left-radius: 6px;
75
+ -webkit-border-top-left-radius: 6px;
76
+ border-top-left-radius: 6px;
77
+ }
78
+
79
+ .ui-tabs-selected a,
80
+ .ui-tabs-selected a:hover {
81
+ color:#FFFFFF !important;
82
+ }
83
+
84
+ .ui-tabs-nav .ui-tabs-selected a,
85
+ .ui-tabs-nav .ui-tabs-selected a:hover {
86
+ position: relative;
87
+ top: 1px;
88
+ z-index: 2;
89
+ margin-top: 0;
90
+ }
91
+
92
+ .ui-tabs-nav li a:hover {
93
+ color:#D54E21;
94
+ }
95
+
96
+ .ui-tabs-nav a span {
97
+ width: 64px; /* IE 6 treats width as min-width */
98
+ min-width: 64px;
99
+ height: 18px; /* IE 6 treats height as min-height */
100
+ min-height: 18px;
101
+ padding-top: 6px;
102
+ padding-right: 0;
103
+ }
104
+ *>.ui-tabs-nav a span { /* hide from IE 6 */
105
+ width: auto;
106
+ height: auto;
107
+ }
108
+ .ui-tabs-nav .ui-tabs-selected a span {
109
+ padding-bottom: 1px;
110
+ }
111
+ .ui-tabs-nav .ui-tabs-selected a, .ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active {
112
+ background-position: 100% -150px;
113
+ }
114
+ .ui-tabs-nav a, .ui-tabs-nav .ui-tabs-disabled a:hover, .ui-tabs-nav .ui-tabs-disabled a:focus, .ui-tabs-nav .ui-tabs-disabled a:active {
115
+ background-position: 100% -100px;
116
+ }
117
+ .ui-tabs-nav .ui-tabs-selected a span, .ui-tabs-nav a:hover span, .ui-tabs-nav a:focus span, .ui-tabs-nav a:active span {
118
+ background-position: 0 -50px;
119
+ }
120
+ .ui-tabs-nav a span, .ui-tabs-nav .ui-tabs-disabled a:hover span, .ui-tabs-nav .ui-tabs-disabled a:focus span, .ui-tabs-nav .ui-tabs-disabled a:active span {
121
+ background-position: 0 0;
122
+ }
123
+ .ui-tabs-nav .ui-tabs-selected a:link, .ui-tabs-nav .ui-tabs-selected a:visited, .ui-tabs-nav .ui-tabs-disabled a:link, .ui-tabs-nav .ui-tabs-disabled a:visited { /* @ Opera, use pseudo classes otherwise it confuses cursor... */
124
+ cursor: text;
125
+ }
126
+ .ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active,
127
+ .ui-tabs-nav .ui-tabs-unselect a:hover, .ui-tabs-nav .ui-tabs-unselect a:focus, .ui-tabs-nav .ui-tabs-unselect a:active { /* @ Opera, we need to be explicit again here now... */
128
+ cursor: pointer;
129
+ }
130
+ .ui-tabs-disabled {
131
+ opacity: .4;
132
+ filter: alpha(opacity=40);
133
+ }
134
+ .ui-tabs-panel {
135
+ border-top: 1px solid #97a5b0 !important;
136
+ padding: 1em 8px;
137
+ background: #fff; /* declare background color for container to avoid distorted fonts in IE while fading */
138
+
139
+ /* overwrite wp-admin */
140
+ border:none !important;
141
+ height:100% !important;
142
+ margin:0pt 0pt 0pt 0px !important;
143
+ overflow:visible !important;
144
+ }
145
+
146
+ .ui-tabs-panel a {
147
+ display:inline;
148
+ }
149
+
150
+
151
+ /* Additional IE specific bug fixes... */
152
+ * html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
153
+ display: inline-block;
154
+ }
155
+ *:first-child+html .ui-tabs-nav { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
156
+ display: inline-block;
157
+ }
158
+
admin/css/menu.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ #icon-nextgen-gallery {
2
+ background:url("../images/nextgen_32_grey.png") no-repeat scroll 1px 1px transparent;
3
+ }
admin/css/nggColorPicker.css ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #colorSelector{
2
+ background:transparent url(../images/select.png) repeat scroll 0 0;
3
+ height:36px;
4
+ position:relative;
5
+ width:36px;
6
+ }
7
+ #colorSelector div{
8
+ background:transparent url(../images/select.png) repeat scroll center center;
9
+ height:30px;
10
+ left:3px;
11
+ position:absolute;
12
+ top:3px;
13
+ width:30px;
14
+ }
admin/css/ngg_social_media.css ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ngg_social_media {
2
+ margin-top: -2px;
3
+ width: 85%;
4
+ position: relative;
5
+ overflow: hidden;
6
+ height: 20px;
7
+ }
8
+
9
+ .gallery_page_nggallery-manage-gallery #ngg_social_media,
10
+ .gallery_page_nggallery-manage-album #ngg_social_media,
11
+ .gallery_page_nggallery-tags #ngg_social_media,
12
+ .gallery_page_nggallery-roles #ngg_social_media,
13
+ .gallery_page_nggallery-about #ngg_social_media,
14
+ .toplevel_page_nextgen-gallery #ngg_social_media {
15
+ float: right;
16
+ width: 55%;
17
+ }
18
+
19
+ #ngg_facebook_like {
20
+ position: absolute;
21
+ right: 0px;
22
+ width: 81px;
23
+ overflow: hidden;
24
+ }
25
+
26
+ #ngg_social_media .twitter-follow-button {
27
+ position: absolute;
28
+ right: 85px;
29
+ }
30
+
31
+ #slider {
32
+ margin-top: 5px !important;
33
+ }
admin/css/nggadmin.css ADDED
@@ -0,0 +1,412 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ** NextGEN Gallery Style for Wordpress 3.3
3
+ */
4
+
5
+ /* SETTINGS FOR Overview Gallery */
6
+
7
+ #newversion {
8
+ border-color:#CCCCCC;
9
+ border-style:solid;
10
+ border-width:1px;
11
+ margin-right:7px;
12
+ margin-top:10px;
13
+ padding:2px;
14
+ }
15
+
16
+ .ngg-dashboard-widget ul.settings span {
17
+ padding-left : 10px;
18
+ color:#2583AD;
19
+ font-weight:bold;
20
+ }
21
+
22
+ .ngg-overview .postbox .handlediv {
23
+ float:right;
24
+ height:24px;
25
+ width:24px;
26
+ }
27
+
28
+ .warning {
29
+ color: #9F6000;
30
+ background-color: #FEEFB3;
31
+ border: 1px solid;
32
+ margin: 5px 0px;
33
+ padding:5px;
34
+ }
35
+
36
+ #donator_message {
37
+ margin:5px 0 15px;
38
+ background-color:#BDE5F8;
39
+ border-color:#00529B;
40
+ -moz-border-radius-bottomleft:3px;
41
+ -moz-border-radius-bottomright:3px;
42
+ -moz-border-radius-topleft:3px;
43
+ -moz-border-radius-topright:3px;
44
+ border-style:solid;
45
+ border-width:1px;
46
+ margin:5px 15px 2px;
47
+ padding:0 0.6em;
48
+ }
49
+
50
+ #donator_message p{
51
+ line-height:1;
52
+ margin:0.5em 0;
53
+ padding:2px;
54
+ padding-bottom:10px;
55
+ }
56
+
57
+ #donator_message span{
58
+ padding-top:10px;
59
+ float:right;
60
+ }
61
+
62
+ #plugin_check img {
63
+ float: right;
64
+ }
65
+
66
+ #plugin_check p.message {
67
+ font-size: 90%;
68
+ color: #666;
69
+ }
70
+ /* SETTING FOR FLASH UPLOAD BUTTON */
71
+ .swfupload {
72
+ position:absolute;
73
+ z-index:1;
74
+ vertical-align:top;
75
+ }
76
+
77
+ /* SETTINGS FOR THE OPTIONS TABLE */
78
+ .ngg-options th {
79
+ width:22%;
80
+ }
81
+
82
+ a.switch-expert {
83
+ text-decoration:none;
84
+ }
85
+
86
+ /* WATERMARK */
87
+ #wm-preview {
88
+ float:right;
89
+ font-size:90%;
90
+ width:35%;
91
+ border-color:#EBEBEB rgb(204, 204, 204) rgb(204, 204, 204) rgb(235, 235, 235);
92
+ border-style:solid;
93
+ border-width:1px;
94
+ margin-bottom:10px;
95
+ margin-left:10px;
96
+ margin-right:8px;
97
+ padding:2px;
98
+ }
99
+ #wm-preview h3{
100
+ background:#F9F9F9 none repeat scroll 0%;
101
+ font-size:14px;
102
+ font-weight:bold;
103
+ margin:0pt 0pt 10px;
104
+ padding:8px 5px;
105
+ }
106
+
107
+ #wm-position {
108
+ width:100%;
109
+ margin-left:40px;
110
+ }
111
+
112
+ .wm-table {
113
+ border-collapse:collapse;
114
+ margin-top:1em;
115
+ width: 60%;
116
+ clear:none;
117
+ }
118
+ .wm-table td {
119
+ border-bottom:8px solid #FFFFFF;
120
+ line-height:20px;
121
+ margin-bottom:9px;
122
+ padding:10px;
123
+ }
124
+ .wm-table th {
125
+ border-bottom:8px solid #FFFFFF;
126
+ padding:10px;
127
+ text-align:left;
128
+ }
129
+ .wm-table tr {
130
+ background:#F9F9F9 none repeat scroll 0%;
131
+ }
132
+
133
+ /* SETTINGS FOR MANAGE TABLE */
134
+
135
+ div#poststuff #gallerydiv {
136
+ cursor:pointer;
137
+ }
138
+
139
+ p#ngg-inlinebutton {
140
+ float:right;
141
+ margin:0pt;
142
+ position:relative;
143
+ top:-25pt;
144
+ }
145
+
146
+ .fixed tbody th.column-cb {
147
+ padding:7px 0 22px;
148
+ }
149
+
150
+ .fixed .column-thumbnail{
151
+ width:85px;
152
+ }
153
+
154
+ .fixed .column-thumbnail img{
155
+ max-height:80px;
156
+ max-width:80px;
157
+ }
158
+
159
+ .fixed .column-id {
160
+ width: 5em;
161
+ }
162
+
163
+ .fixed .column-title {
164
+ width: 25%;
165
+ }
166
+
167
+ .fixed .column-description {
168
+ width: 40%;
169
+ }
170
+
171
+ .fixed .column-exclude, .fixed .column-action, .fixed .column-delete {
172
+ width: 10%;
173
+ }
174
+
175
+ /* SETTINGS FOR PROGRESS BAR */
176
+
177
+ div .progressborder {
178
+ border:1px solid #DDDDDD;
179
+ display: block;
180
+ height: 30px;
181
+ background-color: #464646;
182
+ width: 100%;
183
+ margin-top: 15px;
184
+ margin-bottom: 15px;
185
+ -moz-border-radius: 5px;
186
+ -webkit-border-radius: 5px;
187
+ border-radius: 5px;
188
+ }
189
+
190
+ div .progressbar {
191
+ border: medium none ;
192
+ display: block;
193
+ height: 30px;
194
+ background-color: #D54E21;
195
+ width: 0%;
196
+ -moz-border-radius: 5px;
197
+ -webkit-border-radius: 5px;
198
+ border-radius: 5px;
199
+ }
200
+
201
+ div .progressbar span {
202
+ display: inline;
203
+ position: absolute;
204
+ color: white;
205
+ font-weight: bold;
206
+ padding: 5px 0 0 5px;
207
+ }
208
+
209
+ .show_details
210
+ {
211
+ height: 16px;
212
+ line-height: 20px;
213
+ overflow: hidden;
214
+ min-width: 8em;
215
+ padding: 3px;
216
+ cursor:pointer;
217
+ }
218
+
219
+ .show_details span
220
+ {
221
+ border-bottom:1px solid #999;
222
+ white-space:pre;
223
+ }
224
+ .show_details:hover
225
+ {
226
+ height: auto;
227
+ overflow: visible;
228
+ border: 1px solid #999;
229
+ }
230
+
231
+ /* SETTINGS FOR ALBUM PAGE */
232
+
233
+ .albumnav select[name="act_album"] {
234
+ width:150px;
235
+ }
236
+
237
+ .albumnav span {
238
+ padding-left: 50px;
239
+ }
240
+
241
+ div .groupItem
242
+ {
243
+ cursor: move;
244
+ width: 295px;
245
+ padding: 5px;
246
+ line-height: 1.5;
247
+ }
248
+
249
+ div .innerhandle {
250
+ background-color:#FBFBFB;
251
+ }
252
+
253
+ .groupItem .item_top
254
+ {
255
+ background-color:#2683AE;
256
+ color: #FFFFFF;
257
+ font-weight:bold;
258
+ line-height: 28px;
259
+ height: 28px;
260
+ padding: 0 5px;
261
+ -moz-border-radius: 3px;
262
+ -khtml-border-radius: 3px;
263
+ -webkit-border-radius: 3px;
264
+ border-radius: 3px;
265
+ }
266
+
267
+ .groupItem .album_obj
268
+ {
269
+ background-color:#D54E21;
270
+ }
271
+
272
+ .groupItem .item_top a
273
+ {
274
+ color:#FFFFFF;
275
+ float:right;
276
+ text-decoration: none;
277
+ }
278
+
279
+ .groupItem .item_top a:hover
280
+ {
281
+ color:#FFFFFF;
282
+ }
283
+
284
+ .itemContent {
285
+ border-color:#DFDFDF;
286
+ border-style:none solid solid;
287
+ border-width:0 1px 1px;
288
+ padding:2px 0 20px 2px;
289
+ }
290
+
291
+ .itemContent p {
292
+ border: 0;
293
+ margin: 0;
294
+ padding: 0;
295
+ }
296
+
297
+ .inlinepicture
298
+ {
299
+ float:left;
300
+ display:inline;
301
+ margin:0pt;
302
+ padding:0pt 3px 1px;
303
+ }
304
+
305
+ .inlinepicture img
306
+ {
307
+ margin:3px;
308
+ max-height:60px;
309
+ }
310
+
311
+ .sort_placeholder
312
+ {
313
+ border:1px dashed #bba !important;
314
+ margin: 5px;
315
+ background: #F9F9F9;
316
+ }
317
+
318
+ .container {
319
+ margin-top: 10px;
320
+ }
321
+
322
+ .target-album {
323
+ margin:10px 685px 10px 10px;
324
+ }
325
+
326
+ .widget-right {
327
+ float:right;
328
+ margin:0pt 10px;
329
+ width:315px;
330
+ }
331
+
332
+ .widget-holder {
333
+ min-height: 400px;
334
+ padding-top:1px;
335
+ }
336
+
337
+ .target {
338
+ background-color:#F1F1F1;
339
+ }
340
+
341
+ div.widget-top h3 {
342
+ text-align:center;
343
+ line-height:25px;
344
+ margin: 0;
345
+ padding: 5px 12px;
346
+ font-size: 13px;
347
+ }
348
+
349
+ div.widget-top {
350
+ text-shadow:0 1px 0 #FFFFFF;
351
+ background-repeat: repeat-x;
352
+ background-position: 0 0;
353
+ font-size: 13px;
354
+ }
355
+
356
+ .ui-autocomplete-start { background-position: 99% center; }
357
+
358
+ /* SETTINGS FOR SORT GALLERY */
359
+
360
+ #sortGallery {
361
+ position:relative;
362
+ }
363
+
364
+ p#sortButton{
365
+ margin:0;
366
+ position:absolute;
367
+ right:0;
368
+ top:0;
369
+ }
370
+
371
+ .imageBox,.imageBoxHighlighted{
372
+ width:130px; /* Total width of each image box */
373
+ height:160px; /* Total height of each image box */
374
+ float:left;
375
+ overflow: hidden;
376
+ text-overflow: ellipsis;
377
+ padding: 5px;
378
+ }
379
+ .imageBox_theImage{
380
+ width:110px; /* Width of image */
381
+ height:125px; /* Height of image */
382
+
383
+ background-position: center;
384
+ background-repeat: no-repeat;
385
+ margin: 0 auto;
386
+ margin-bottom:2px;
387
+ }
388
+
389
+ .imageBox_label{ /* Title of images - both selected and not selected */
390
+ text-align:center;
391
+ font-family: arial;
392
+ font-size:11px;
393
+ padding-top:2px;
394
+ margin: 0 auto;
395
+ }
396
+
397
+ /* UPGRADE PAGE */
398
+
399
+ .error_inline {
400
+ background:#FFEBE8 none repeat scroll 0%;
401
+ border:1px solid #CC0000;
402
+ margin:5px auto;
403
+ padding:10px;
404
+ }
405
+
406
+ /* ABOUT PAGE */
407
+ .ngg-list {
408
+ font-size:11px;
409
+ margin-left:15px;
410
+ list-style-position:inside;
411
+ list-style-type:disc;
412
+ }
admin/css/tags-admin.css ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ .ngg_wrap .auto_list{width:98%;margin:3px 0;padding:3px 5px;}
2
+ .ngg_wrap .list_tags {width:240px;vertical-align:top;}
3
+ .ngg_wrap .forms_manage {vertical-align:top;}
4
+ .ngg_wrap .forms_manage h3 {margin-bottom:5px;}
5
+ .ngg_wrap .forms_manage .form-table {margin-top:0;}
6
+ .ngg_wrap .sort_order h3 {margin:0;}
7
+ .ngg_wrap #ajax_area_tagslist {}
8
+ .ngg_wrap #ajax_area_tagslist ul{list-style:square;margin:10px 0 10px 20px;padding:0;}
9
+ .ngg_wrap #ajax_area_tagslist ul li{margin:0;padding:0;line-height:1.4;}
10
+ .ngg_wrap #ajax_area_tagslist ul li span{cursor:pointer;}
admin/edit-thumbnail.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+
5
+ Custom thumbnail for NGG
6
+ Author : Simone Fumagalli | simone@iliveinperego.com
7
+ More info and update : http://www.iliveinperego.com/custom_thumbnail_for_ngg/
8
+
9
+ Credits:
10
+ NextGen Gallery : Alex Rabe | http://alexrabe.boelinger.com/wordpress-plugins/nextgen-gallery/
11
+ jCrop : Kelly Hallman <khallman@wrack.org> | http://deepliquid.com/content/Jcrop.html
12
+
13
+ **/
14
+
15
+ require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php');
16
+ require_once( NGGALLERY_ABSPATH . '/lib/image.php' );
17
+
18
+ if ( !is_user_logged_in() )
19
+ die(__('Cheatin&#8217; uh?'));
20
+
21
+ if ( !current_user_can('NextGEN Manage gallery') )
22
+ die(__('Cheatin&#8217; uh?'));
23
+
24
+ global $wpdb;
25
+
26
+ $id = (int) $_GET['id'];
27
+
28
+ // let's get the image data
29
+ $picture = nggdb::find_image($id);
30
+
31
+ include_once( nggGallery::graphic_library() );
32
+ $ngg_options=get_option('ngg_options');
33
+
34
+ $thumb = new ngg_Thumbnail($picture->imagePath, TRUE);
35
+ $thumb->resize(350,350);
36
+ // we need the new dimension
37
+ $resizedPreviewInfo = $thumb->newDimensions;
38
+ $thumb->destruct();
39
+
40
+ $preview_image = NGGALLERY_URLPATH . 'nggshow.php?pid=' . $picture->pid . '&amp;width=350&amp;height=350';
41
+ $imageInfo = @getimagesize($picture->imagePath);
42
+ $rr = round($imageInfo[0] / $resizedPreviewInfo['newWidth'], 2);
43
+
44
+ if ( ($ngg_options['thumbfix'] == 1) ) {
45
+
46
+ $WidthHtmlPrev = $ngg_options['thumbwidth'];
47
+ $HeightHtmlPrev = $ngg_options['thumbheight'];
48
+
49
+ } else {
50
+ // H > W
51
+ if ($imageInfo[1] > $imageInfo[0]) {
52
+
53
+ $HeightHtmlPrev = $ngg_options['thumbheight'];
54
+ $WidthHtmlPrev = round($imageInfo[0] / ($imageInfo[1] / $ngg_options['thumbheight']),0);
55
+
56
+ } else {
57
+
58
+ $WidthHtmlPrev = $ngg_options['thumbwidth'];
59
+ $HeightHtmlPrev = round($imageInfo[1] / ($imageInfo[0] / $ngg_options['thumbwidth']),0);
60
+
61
+ }
62
+ }
63
+
64
+ ?>
65
+ <script src="<?php echo NGGALLERY_URLPATH; ?>/admin/js/Jcrop/js/jquery.Jcrop.js"></script>
66
+ <link rel="stylesheet" href="<?php echo NGGALLERY_URLPATH; ?>/admin/js/Jcrop/css/jquery.Jcrop.css" type="text/css" />
67
+
68
+ <script type="text/javascript">
69
+ //<![CDATA[
70
+ var status = 'start';
71
+ var xT, yT, wT, hT, selectedCoords;
72
+ var selectedImage = "thumb<?php echo $id ?>";
73
+
74
+ function showPreview(coords)
75
+ {
76
+
77
+ if (status != 'edit') {
78
+ jQuery('#actualThumb').hide();
79
+ jQuery('#previewNewThumb').show();
80
+ status = 'edit';
81
+ }
82
+
83
+ var rx = <?php echo $WidthHtmlPrev; ?> / coords.w;
84
+ var ry = <?php echo $HeightHtmlPrev; ?> / coords.h;
85
+
86
+ jQuery('#imageToEditPreview').css({
87
+ width: Math.round(rx * <?php echo $resizedPreviewInfo['newWidth']; ?>) + 'px',
88
+ height: Math.round(ry * <?php echo $resizedPreviewInfo['newHeight']; ?>) + 'px',
89
+ marginLeft: '-' + Math.round(rx * coords.x) + 'px',
90
+ marginTop: '-' + Math.round(ry * coords.y) + 'px'
91
+ });
92
+
93
+ xT = coords.x;
94
+ yT = coords.y;
95
+ wT = coords.w;
96
+ hT = coords.h;
97
+
98
+ jQuery("#sizeThumb").html(xT+" "+yT+" "+wT+" "+hT);
99
+
100
+ };
101
+
102
+ function updateThumb() {
103
+
104
+ if ( (wT == 0) || (hT == 0) || (wT == undefined) || (hT == undefined) ) {
105
+ alert("<?php _e('Select with the mouse the area for the new thumbnail', 'nggallery'); ?>");
106
+ return false;
107
+ }
108
+
109
+ jQuery.ajax({
110
+ url: ajaxurl,
111
+ type : "POST",
112
+ data: {x: xT, y: yT, w: wT, h: hT, action: 'createNewThumb', id: <?php echo $id; ?>, rr: <?php echo str_replace(',','.',$rr); ?>},
113
+ cache: false,
114
+ success: function(data){
115
+ var d = new Date();
116
+ newUrl = jQuery("#"+selectedImage).attr("src") + "?" + d.getTime();
117
+ jQuery("#"+selectedImage).attr("src" , newUrl);
118
+
119
+ jQuery('#thumbMsg').html("<?php _e('Thumbnail updated', 'nggallery') ?>");
120
+ jQuery('#thumbMsg').css({'display':'block'});
121
+ setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
122
+ },
123
+ error: function() {
124
+ jQuery('#thumbMsg').html("<?php _e('Error updating thumbnail', 'nggallery') ?>");
125
+ jQuery('#thumbMsg').css({'display':'block'});
126
+ setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
127
+ }
128
+ });
129
+
130
+ };
131
+ //]]>
132
+ </script>
133
+
134
+ <table width="98%" align="center" style="border:1px solid #DADADA">
135
+ <tr>
136
+ <td rowspan="3" valign="middle" align="center" width="350" style="background-color:#DADADA;">
137
+ <img src="<?php echo esc_url( $preview_image ); ?>" alt="" id="imageToEdit" />
138
+ </td>
139
+ <td width="300" style="background-color : #DADADA;">
140
+ <small style="margin-left:6px; display:block;"><?php esc_html_e('Select the area for the thumbnail from the picture on the left.', 'nggallery'); ?></small>
141
+ </td>
142
+ </tr>
143
+ <tr>
144
+ <td align="center" width="300" height="320">
145
+ <div id="previewNewThumb" style="display:none;width:<?php echo $WidthHtmlPrev; ?>px;height:<?php echo $HeightHtmlPrev; ?>px;overflow:hidden; margin-left:5px;">
146
+ <img src="<?php echo esc_url( $preview_image ); ?>" id="imageToEditPreview" />
147
+ </div>
148
+ <div id="actualThumb">
149
+ <img src="<?php echo esc_url( $picture->thumbURL ); ?>?<?php echo time()?>" />
150
+ </div>
151
+ </td>
152
+ </tr>
153
+ <tr style="background-color:#DADADA;">
154
+ <td>
155
+ <input type="button" name="update" value="<?php esc_attr_e('Update', 'nggallery'); ?>" onclick="updateThumb()" class="button-secondary" style="float:left; margin-left:4px;"/>
156
+ <div id="thumbMsg" style="color:#FF0000; display : none;font-size:11px; float:right; width:60%; height:2em; line-height:2em;"></div>
157
+ </td>
158
+ </tr>
159
+ </table>
160
+
161
+ <script type="text/javascript">
162
+ //<![CDATA[
163
+ jQuery(document).ready(function(){
164
+ jQuery('#imageToEdit').Jcrop({
165
+ onChange: showPreview,
166
+ onSelect: showPreview,
167
+ aspectRatio: <?php echo str_replace(',', '.', round($WidthHtmlPrev/$HeightHtmlPrev, 3)); ?>
168
+ });
169
+ });
170
+ //]]>
171
+ </script>
admin/functions.php ADDED
@@ -0,0 +1,1501 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ /**
6
+ * nggAdmin - Class for admin operation
7
+ *
8
+ * @package NextGEN Gallery
9
+ * @author Alex Rabe
10
+ *
11
+ * @access public
12
+ */
13
+ class nggAdmin{
14
+
15
+ /**
16
+ * create a new gallery & folder
17
+ *
18
+ * @class nggAdmin
19
+ * @param string $name of the gallery
20
+ * @param string $defaultpath
21
+ * @param bool $output if the function should show an error messsage or not
22
+ * @return
23
+ */
24
+ function create_gallery($title, $defaultpath, $output = true) {
25
+
26
+ global $user_ID;
27
+
28
+ // get the current user ID
29
+ get_currentuserinfo();
30
+
31
+ //cleanup pathname
32
+ $name = sanitize_file_name( sanitize_title($title) );
33
+ $name = apply_filters('ngg_gallery_name', $name);
34
+ $nggRoot = WINABSPATH . $defaultpath;
35
+ $txt = '';
36
+
37
+ // No gallery name ?
38
+ if ( empty($name) ) {
39
+ if ($output) nggGallery::show_error( __('No valid gallery name!', 'nggallery') );
40
+ return false;
41
+ }
42
+
43
+ // check for main folder
44
+ if ( !is_dir($nggRoot) ) {
45
+ if ( !wp_mkdir_p( $nggRoot ) ) {
46
+ $txt = __('Directory', 'nggallery').' <strong>' . esc_html( $defaultpath ) . '</strong> '.__('didn\'t exist. Please create first the main gallery folder ', 'nggallery').'!<br />';
47
+ $txt .= __('Check this link, if you didn\'t know how to set the permission :', 'nggallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
48
+ if ($output) nggGallery::show_error($txt);
49
+ return false;
50
+ }
51
+ }
52
+
53
+ // check for permission settings, Safe mode limitations are not taken into account.
54
+ if ( !is_writeable( $nggRoot ) ) {
55
+ $txt = __('Directory', 'nggallery').' <strong>' . esc_html( $defaultpath ) . '</strong> '.__('is not writeable !', 'nggallery').'<br />';
56
+ $txt .= __('Check this link, if you didn\'t know how to set the permission :', 'nggallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
57
+ if ($output) nggGallery::show_error($txt);
58
+ return false;
59
+ }
60
+
61
+ // 1. Check for existing folder
62
+ if ( is_dir(WINABSPATH . $defaultpath . $name ) && !(SAFE_MODE) ) {
63
+ $suffix = 1;
64
+ do {
65
+ $alt_name = substr ($name, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "_$suffix";
66
+ $dir_check = is_dir(WINABSPATH . $defaultpath . $alt_name );
67
+ $suffix++;
68
+ } while ( $dir_check );
69
+ $name = $alt_name;
70
+ }
71
+ // define relative path to gallery inside wp root folder
72
+ $nggpath = $defaultpath . $name;
73
+
74
+ // 2. Create new gallery folder
75
+ if ( !wp_mkdir_p (WINABSPATH . $nggpath) )
76
+ $txt = __('Unable to create directory ', 'nggallery') . esc_html( $nggpath ) . '!<br />';
77
+
78
+ // 3. Check folder permission
79
+ if ( !is_writeable(WINABSPATH . $nggpath ) )
80
+ $txt .= __('Directory', 'nggallery').' <strong>' . esc_html( $nggpath ) . '</strong> '.__('is not writeable !', 'nggallery').'<br />';
81
+
82
+ // 4. Now create thumbnail folder inside
83
+ if ( !is_dir(WINABSPATH . $nggpath . '/thumbs') ) {
84
+ if ( !wp_mkdir_p ( WINABSPATH . $nggpath . '/thumbs') )
85
+ $txt .= __('Unable to create directory ', 'nggallery').' <strong>' . esc_html( $nggpath ) . '/thumbs !</strong>';
86
+ }
87
+
88
+ if (SAFE_MODE) {
89
+ $help = __('The server setting Safe-Mode is on !', 'nggallery');
90
+ $help .= '<br />'.__('If you have problems, please create directory', 'nggallery').' <strong>' . esc_html( $nggpath ) . '</strong> ';
91
+ $help .= __('and the thumbnails directory', 'nggallery').' <strong>' . esc_html( $nggpath ) . '/thumbs</strong> '.__('with permission 777 manually !', 'nggallery');
92
+ if ($output) nggGallery::show_message($help);
93
+ }
94
+
95
+ // show a error message
96
+ if ( !empty($txt) ) {
97
+ if (SAFE_MODE) {
98
+ // for safe_mode , better delete folder, both folder must be created manually
99
+ @rmdir(WINABSPATH . $nggpath . '/thumbs');
100
+ @rmdir(WINABSPATH . $nggpath);
101
+ }
102
+ if ($output) nggGallery::show_error($txt);
103
+ return false;
104
+ }
105
+
106
+ // now add the gallery to the database
107
+ $galleryID = nggdb::add_gallery($title, $nggpath, '', 0, 0, $user_ID );
108
+ // here you can inject a custom function
109
+ do_action('ngg_created_new_gallery', $galleryID);
110
+
111
+ // return only the id if defined
112
+ if ($output == false)
113
+ return $galleryID;
114
+
115
+ if ($galleryID != false) {
116
+ $message = __('Gallery ID %1$s successfully created. You can show this gallery in your post or page with the shortcode %2$s.<br/>','nggallery');
117
+ $message = sprintf($message, $galleryID, '<strong>[nggallery id=' . $galleryID . ']</strong>');
118
+ $message .= '<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $galleryID . '" >';
119
+ $message .= __('Edit gallery','nggallery');
120
+ $message .= '</a>';
121
+
122
+ if ($output) nggGallery::show_message($message);
123
+ }
124
+ return true;
125
+ }
126
+
127
+ /**
128
+ * nggAdmin::import_gallery()
129
+ * TODO: Check permission of existing thumb folder & images
130
+ *
131
+ * @class nggAdmin
132
+ * @param string $galleryfolder contains relative path to the gallery itself
133
+ * @return void
134
+ */
135
+ function import_gallery($galleryfolder) {
136
+
137
+ global $wpdb, $user_ID;
138
+
139
+ // get the current user ID
140
+ get_currentuserinfo();
141
+
142
+ $created_msg = '';
143
+
144
+ // remove trailing slash at the end, if somebody use it
145
+ $galleryfolder = untrailingslashit($galleryfolder);
146
+ $gallerypath = WINABSPATH . $galleryfolder;
147
+
148
+ if (!is_dir($gallerypath)) {
149
+ nggGallery::show_error(__('Directory', 'nggallery').' <strong>' . esc_html( $gallerypath ) .'</strong> '.__('doesn&#96;t exist!', 'nggallery'));
150
+ return ;
151
+ }
152
+
153
+ // read list of images
154
+ $new_imageslist = nggAdmin::scandir($gallerypath);
155
+
156
+ if (empty($new_imageslist)) {
157
+ nggGallery::show_message(__('Directory', 'nggallery').' <strong>' . esc_html( $gallerypath ) . '</strong> '.__('contains no pictures', 'nggallery'));
158
+ return;
159
+ }
160
+
161
+ // check & create thumbnail folder
162
+ if ( !nggGallery::get_thumbnail_folder($gallerypath) )
163
+ return;
164
+
165
+ // take folder name as gallery name
166
+ $galleryname = basename($galleryfolder);
167
+ $galleryname = apply_filters('ngg_gallery_name', $galleryname);
168
+
169
+ // check for existing gallery folder
170
+ $gallery_id = $wpdb->get_var("SELECT gid FROM $wpdb->nggallery WHERE path = '$galleryfolder' ");
171
+
172
+ if (!$gallery_id) {
173
+ // now add the gallery to the database
174
+ $gallery_id = nggdb::add_gallery( $galleryname, $galleryfolder, '', 0, 0, $user_ID );
175
+ if (!$gallery_id) {
176
+ nggGallery::show_error(__('Database error. Could not add gallery!','nggallery'));
177
+ return;
178
+ }
179
+ $created_msg = _n( 'Gallery', 'Galleries', 1, 'nggallery' ) . ' <strong>' . esc_html( $galleryname ) . '</strong> ' . __('successfully created!','nggallery') . '<br />';
180
+ }
181
+
182
+ // Look for existing image list
183
+ $old_imageslist = $wpdb->get_col("SELECT filename FROM $wpdb->nggpictures WHERE galleryid = '$gallery_id' ");
184
+
185
+ // if no images are there, create empty array
186
+ if ($old_imageslist == NULL)
187
+ $old_imageslist = array();
188
+
189
+ // check difference
190
+ $new_images = array_diff($new_imageslist, $old_imageslist);
191
+
192
+ // all images must be valid files
193
+ foreach($new_images as $key => $picture) {
194
+
195
+ // filter function to rename/change/modify image before
196
+ $picture = apply_filters('ngg_pre_add_new_image', $picture, $gallery_id);
197
+ $new_images[$key] = $picture;
198
+
199
+ if (!@getimagesize($gallerypath . '/' . $picture) ) {
200
+ unset($new_images[$key]);
201
+ @unlink($gallerypath . '/' . $picture);
202
+ }
203
+ }
204
+
205
+ // add images to database
206
+ $image_ids = nggAdmin::add_Images($gallery_id, $new_images);
207
+
208
+ //add the preview image if needed
209
+ nggAdmin::set_gallery_preview ( $gallery_id );
210
+
211
+ // now create thumbnails
212
+ nggAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','nggallery') );
213
+
214
+ //TODO:Message will not shown, because AJAX routine require more time, message should be passed to AJAX
215
+ $message = $created_msg . count($image_ids) .__(' picture(s) successfully added','nggallery');
216
+ $message .= ' [<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $gallery_id . '" >';
217
+ $message .= __('Edit gallery','nggallery');
218
+ $message .= '</a>]';
219
+
220
+ nggGallery::show_message($message);
221
+
222
+ return;
223
+
224
+ }
225
+
226
+ /**
227
+ * Scan folder for new images
228
+ *
229
+ * @class nggAdmin
230
+ * @param string $dirname
231
+ * @return array $files list of image filenames
232
+ */
233
+ function scandir( $dirname = '.' ) {
234
+ $ext = apply_filters('ngg_allowed_file_types', array('jpeg', 'jpg', 'png', 'gif') );
235
+
236
+ $files = array();
237
+ if( $handle = opendir( $dirname ) ) {
238
+ while( false !== ( $file = readdir( $handle ) ) ) {
239
+ $info = pathinfo( $file );
240
+ // just look for images with the correct extension
241
+ if ( isset($info['extension']) )
242
+ if ( in_array( strtolower($info['extension']), $ext) )
243
+ $files[] = utf8_encode( $file );
244
+ }
245
+ closedir( $handle );
246
+ }
247
+ sort( $files );
248
+ return ( $files );
249
+ }
250
+
251
+ /**
252
+ * nggAdmin::createThumbnail() - function to create or recreate a thumbnail
253
+ *
254
+ * @class nggAdmin
255
+ * @param object | int $image contain all information about the image or the id
256
+ * @return string result code
257
+ * @since v1.0.0
258
+ */
259
+ function create_thumbnail($image) {
260
+
261
+ global $ngg;
262
+
263
+ if(! class_exists('ngg_Thumbnail'))
264
+ require_once( nggGallery::graphic_library() );
265
+
266
+ if ( is_numeric($image) )
267
+ $image = nggdb::find_image( $image );
268
+
269
+ if ( !is_object($image) )
270
+ return __('Object didn\'t contain correct data','nggallery');
271
+
272
+ // before we start we import the meta data to database (required for uploads before V1.4.0)
273
+ nggAdmin::maybe_import_meta( $image->pid );
274
+
275
+ // check for existing thumbnail
276
+ if (file_exists($image->thumbPath))
277
+ if (!is_writable($image->thumbPath))
278
+ return esc_html( $image->filename ) . __(' is not writeable ','nggallery');
279
+
280
+ $thumb = new ngg_Thumbnail($image->imagePath, TRUE);
281
+
282
+ // skip if file is not there
283
+ if (!$thumb->error) {
284
+ if ($ngg->options['thumbfix']) {
285
+
286
+ // calculate correct ratio
287
+ $wratio = $ngg->options['thumbwidth'] / $thumb->currentDimensions['width'];
288
+ $hratio = $ngg->options['thumbheight'] / $thumb->currentDimensions['height'];
289
+
290
+ if ($wratio > $hratio) {
291
+ // first resize to the wanted width
292
+ $thumb->resize($ngg->options['thumbwidth'], 0);
293
+ // get optimal y startpos
294
+ $ypos = ($thumb->currentDimensions['height'] - $ngg->options['thumbheight']) / 2;
295
+ $thumb->crop(0, $ypos, $ngg->options['thumbwidth'],$ngg->options['thumbheight']);
296
+ } else {
297
+ // first resize to the wanted height
298
+ $thumb->resize(0, $ngg->options['thumbheight']);
299
+ // get optimal x startpos
300
+ $xpos = ($thumb->currentDimensions['width'] - $ngg->options['thumbwidth']) / 2;
301
+ $thumb->crop($xpos, 0, $ngg->options['thumbwidth'],$ngg->options['thumbheight']);
302
+ }
303
+ //this create a thumbnail but keep ratio settings
304
+ } else {
305
+ $thumb->resize($ngg->options['thumbwidth'],$ngg->options['thumbheight']);
306
+ }
307
+
308
+ // save the new thumbnail
309
+ $thumb->save($image->thumbPath, $ngg->options['thumbquality']);
310
+ nggAdmin::chmod ($image->thumbPath);
311
+
312
+ //read the new sizes
313
+ $new_size = @getimagesize ( $image->thumbPath );
314
+ $size['width'] = $new_size[0];
315
+ $size['height'] = $new_size[1];
316
+
317
+ // add them to the database
318
+ nggdb::update_image_meta($image->pid, array( 'thumbnail' => $size) );
319
+ }
320
+
321
+ $thumb->destruct();
322
+
323
+ if ( !empty($thumb->errmsg) )
324
+ return ' <strong>' . esc_html( $image->filename ) . ' (Error : '.$thumb->errmsg .')</strong>';
325
+
326
+ // success
327
+ return '1';
328
+ }
329
+
330
+ /**
331
+ * nggAdmin::resize_image() - create a new image, based on the height /width
332
+ *
333
+ * @class nggAdmin
334
+ * @param object | int $image contain all information about the image or the id
335
+ * @param integer $width optional
336
+ * @param integer $height optional
337
+ * @return string result code
338
+ */
339
+ function resize_image($image, $width = 0, $height = 0) {
340
+
341
+ global $ngg;
342
+
343
+ if(! class_exists('ngg_Thumbnail'))
344
+ require_once( nggGallery::graphic_library() );
345
+
346
+ if ( is_numeric($image) )
347
+ $image = nggdb::find_image( $image );
348
+
349
+ if ( !is_object($image) )
350
+ return __('Object didn\'t contain correct data','nggallery');
351
+
352
+ // before we start we import the meta data to database (required for uploads before V1.4.0)
353
+ nggAdmin::maybe_import_meta( $image->pid );
354
+
355
+ // if no parameter is set, take global settings
356
+ $width = ($width == 0) ? $ngg->options['imgWidth'] : $width;
357
+ $height = ($height == 0) ? $ngg->options['imgHeight'] : $height;
358
+
359
+ if (!is_writable($image->imagePath))
360
+ return ' <strong>' . esc_html( $image->filename ) . __(' is not writeable','nggallery') . '</strong>';
361
+
362
+ $file = new ngg_Thumbnail($image->imagePath, TRUE);
363
+
364
+ // skip if file is not there
365
+ if (!$file->error) {
366
+
367
+ // If required save a backup copy of the file
368
+ if ( ($ngg->options['imgBackup'] == 1) && (!file_exists($image->imagePath . '_backup')) )
369
+ @copy ($image->imagePath, $image->imagePath . '_backup');
370
+
371
+ $file->resize($width, $height);
372
+ $file->save($image->imagePath, $ngg->options['imgQuality']);
373
+ // read the new sizes
374
+ $size = @getimagesize ( $image->imagePath );
375
+ // add them to the database
376
+ nggdb::update_image_meta($image->pid, array( 'width' => $size[0], 'height' => $size[1] ) );
377
+ $file->destruct();
378
+ } else {
379
+ $file->destruct();
380
+ return ' <strong>' . esc_html( $image->filename ) . ' (Error : ' . $file->errmsg . ')</strong>';
381
+ }
382
+
383
+ return '1';
384
+ }
385
+
386
+ /**
387
+ * Rotated/Flip an image based on the orientation flag or a definded angle
388
+ *
389
+ * @param int|object $image
390
+ * @param string (optional) $dir, CW (clockwise)or CCW (counter clockwise), if set to false, the exif flag will be used
391
+ * @param string (optional) $flip, could be either false | V (flip vertical) | H (flip horizontal)
392
+ * @return string result code
393
+ */
394
+ function rotate_image($image, $dir = false, $flip = false) {
395
+
396
+ global $ngg;
397
+
398
+ if(! class_exists('ngg_Thumbnail'))
399
+ require_once( nggGallery::graphic_library() );
400
+
401
+ if ( is_numeric($image) )
402
+ $image = nggdb::find_image( $image );
403
+
404
+ if ( !is_object($image) )
405
+ return __('Object didn\'t contain correct data','nggallery');
406
+
407
+ if (!is_writable($image->imagePath))
408
+ return ' <strong>' . esc_html( $image->filename ) . __(' is not writeable','nggallery') . '</strong>';
409
+
410
+ // if you didn't define a rotation, we look for the orientation flag in EXIF
411
+ if ( $dir === false ) {
412
+ $meta = new nggMeta( $image->pid );
413
+ $exif = $meta->get_EXIF();
414
+
415
+ if (isset($exif['Orientation'])) {
416
+
417
+ switch ($exif['Orientation']) {
418
+ case 5 : // vertical flip + 90 rotate right
419
+ $flip = 'V';
420
+ case 6 : // 90 rotate right
421
+ $dir = 'CW';
422
+ break;
423
+ case 7 : // horizontal flip + 90 rotate right
424
+ $flip = 'H';
425
+ case 8 : // 90 rotate left
426
+ $dir = 'CCW';
427
+ break;
428
+ case 4 : // vertical flip
429
+ $flip = 'V';
430
+ break;
431
+ case 3 : // 180 rotate left
432
+ $dir = 180;
433
+ break;
434
+ case 2 : // horizontal flip
435
+ $flip = 'H';
436
+ break;
437
+ case 1 : // no action in the case it doesn't need a rotation
438
+ default:
439
+ return '0';
440
+ break;
441
+ }
442
+ } else
443
+ return '0';
444
+ }
445
+ $file = new ngg_Thumbnail( $image->imagePath, TRUE );
446
+
447
+ // skip if file is not there
448
+ if (!$file->error) {
449
+
450
+ // If required save a backup copy of the file
451
+ if ( ($ngg->options['imgBackup'] == 1) && (!file_exists($image->imagePath . '_backup')) )
452
+ @copy ($image->imagePath, $image->imagePath . '_backup');
453
+
454
+ // before we start we import the meta data to database (required for uploads before V1.4.X)
455
+ nggAdmin::maybe_import_meta( $image->pid );
456
+
457
+ if ( $dir !== 0 )
458
+ $file->rotateImage( $dir );
459
+ if ( $dir === 180)
460
+ $file->rotateImage( 'CCW' ); // very special case, we rotate the image two times
461
+ if ( $flip == 'H')
462
+ $file->flipImage(true, false);
463
+ if ( $flip == 'V')
464
+ $file->flipImage(false, true);
465
+
466
+ $file->save($image->imagePath, $ngg->options['imgQuality']);
467
+
468
+ // read the new sizes
469
+ $size = @getimagesize ( $image->imagePath );
470
+ // add them to the database
471
+ nggdb::update_image_meta($image->pid, array( 'width' => $size[0], 'height' => $size[1] ) );
472
+
473
+ }
474
+
475
+ $file->destruct();
476
+
477
+ if ( !empty($file->errmsg) )
478
+ return ' <strong>' . esc_html( $image->filename ) . ' (Error : '.$file->errmsg .')</strong>';
479
+
480
+ return '1';
481
+
482
+ }
483
+
484
+ /**
485
+ * nggAdmin::set_watermark() - set the watermark for the image
486
+ *
487
+ * @class nggAdmin
488
+ * @param object | int $image contain all information about the image or the id
489
+ * @return string result code
490
+ */
491
+ function set_watermark($image) {
492
+
493
+ global $ngg;
494
+
495
+ if(! class_exists('ngg_Thumbnail'))
496
+ require_once( nggGallery::graphic_library() );
497
+
498
+ if ( is_numeric($image) )
499
+ $image = nggdb::find_image( $image );
500
+
501
+ if ( !is_object($image) )
502
+ return __('Object didn\'t contain correct data','nggallery');
503
+
504
+ // before we start we import the meta data to database (required for uploads before V1.4.0)
505
+ nggAdmin::maybe_import_meta( $image->pid );
506
+
507
+ if (!is_writable($image->imagePath))
508
+ return ' <strong>' . esc_html( $image->filename ) . __(' is not writeable','nggallery') . '</strong>';
509
+
510
+ $file = new ngg_Thumbnail( $image->imagePath, TRUE );
511
+
512
+ // skip if file is not there
513
+ if (!$file->error) {
514
+
515
+ // If required save a backup copy of the file
516
+ if ( ($ngg->options['imgBackup'] == 1) && (!file_exists($image->imagePath . '_backup')) )
517
+ @copy ($image->imagePath, $image->imagePath . '_backup');
518
+
519
+ if ($ngg->options['wmType'] == 'image') {
520
+ $file->watermarkImgPath = $ngg->options['wmPath'];
521
+ $file->watermarkImage($ngg->options['wmPos'], $ngg->options['wmXpos'], $ngg->options['wmYpos']);
522
+ }
523
+ if ($ngg->options['wmType'] == 'text') {
524
+ $file->watermarkText = $ngg->options['wmText'];
525
+ $file->watermarkCreateText($ngg->options['wmColor'], $ngg->options['wmFont'], $ngg->options['wmSize'], $ngg->options['wmOpaque']);
526
+ $file->watermarkImage($ngg->options['wmPos'], $ngg->options['wmXpos'], $ngg->options['wmYpos']);
527
+ }
528
+ $file->save($image->imagePath, $ngg->options['imgQuality']);
529
+ }
530
+
531
+ $file->destruct();
532
+
533
+ if ( !empty($file->errmsg) )
534
+ return ' <strong>' . esc_html( $image->filename ) . ' (Error : '.$file->errmsg .')</strong>';
535
+
536
+ return '1';
537
+ }
538
+
539
+ /**
540
+ * Recover image from backup copy and reprocess it
541
+ *
542
+ * @class nggAdmin
543
+ * @since 1.5.0
544
+ * @param object | int $image contain all information about the image or the id
545
+ * @return string result code
546
+ */
547
+
548
+ function recover_image($image) {
549
+
550
+ global $ngg;
551
+
552
+ if ( is_numeric($image) )
553
+ $image = nggdb::find_image( $image );
554
+
555
+ if ( !is_object( $image ) )
556
+ return __('Object didn\'t contain correct data','nggallery');
557
+
558
+ if (!is_writable( $image->imagePath ))
559
+ return ' <strong>' . esc_html( $image->filename ) . __(' is not writeable','nggallery') . '</strong>';
560
+
561
+ if (!file_exists( $image->imagePath . '_backup' )) {
562
+ return ' <strong>'.__('File do not exists','nggallery').'</strong>';
563
+ }
564
+
565
+ if (!@copy( $image->imagePath . '_backup' , $image->imagePath) )
566
+ return ' <strong>'.__('Couldn\'t restore original image','nggallery').'</strong>';
567
+
568
+ require_once(NGGALLERY_ABSPATH . '/lib/meta.php');
569
+
570
+ $meta_obj = new nggMeta( $image->pid );
571
+
572
+ $common = $meta_obj->get_common_meta();
573
+ $common['saved'] = true;
574
+ $result = nggdb::update_image_meta($image->pid, $common);
575
+
576
+ return '1';
577
+
578
+ }
579
+
580
+ /**
581
+ * Add images to database
582
+ *
583
+ * @class nggAdmin
584
+ * @param int $galleryID
585
+ * @param array $imageslist
586
+ * @return array $image_ids Id's which are sucessful added
587
+ */
588
+ function add_Images($galleryID, $imageslist) {
589
+
590
+ global $wpdb, $ngg;
591
+
592
+ $image_ids = array();
593
+
594
+ if ( is_array($imageslist) ) {
595
+ foreach($imageslist as $picture) {
596
+
597
+ // filter function to rename/change/modify image before
598
+ $picture = apply_filters('ngg_pre_add_new_image', $picture, $galleryID);
599
+
600
+ // strip off the extension of the filename
601
+ $path_parts = pathinfo( $picture );
602
+ $alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename'];
603
+ // save it to the database
604
+ $pic_id = nggdb::add_image( $galleryID, $picture, '', $alttext );
605
+
606
+ if ( !empty($pic_id) )
607
+ $image_ids[] = $pic_id;
608
+
609
+ // add the metadata
610
+ nggAdmin::import_MetaData( $pic_id );
611
+
612
+ // auto rotate
613
+ nggAdmin::rotate_image( $pic_id );
614
+
615
+ // Autoresize image if required
616
+ if ($ngg->options['imgAutoResize']) {
617
+ $imagetmp = nggdb::find_image( $pic_id );
618
+ $sizetmp = @getimagesize ( $imagetmp->imagePath );
619
+ $widthtmp = $ngg->options['imgWidth'];
620
+ $heighttmp = $ngg->options['imgHeight'];
621
+ if (($sizetmp[0] > $widthtmp && $widthtmp) || ($sizetmp[1] > $heighttmp && $heighttmp)) {
622
+ nggAdmin::resize_image( $pic_id );
623
+ }
624
+ }
625
+
626
+ // action hook for post process after the image is added to the database
627
+ $image = array( 'id' => $pic_id, 'filename' => $picture, 'galleryID' => $galleryID);
628
+ do_action('ngg_added_new_image', $image);
629
+
630
+ }
631
+ } // is_array
632
+
633
+ // delete dirsize after adding new images
634
+ delete_transient( 'dirsize_cache' );
635
+
636
+ do_action('ngg_after_new_images_added', $galleryID, $image_ids );
637
+
638
+ return $image_ids;
639
+
640
+ }
641
+
642
+ /**
643
+ * Import some meta data into the database (if avialable)
644
+ *
645
+ * @class nggAdmin
646
+ * @param array|int $imagesIds
647
+ * @return string result code
648
+ */
649
+ function import_MetaData($imagesIds) {
650
+
651
+ global $wpdb;
652
+
653
+ require_once(NGGALLERY_ABSPATH . '/lib/image.php');
654
+
655
+ if (!is_array($imagesIds))
656
+ $imagesIds = array($imagesIds);
657
+
658
+ foreach($imagesIds as $imageID) {
659
+
660
+ $image = nggdb::find_image( $imageID );
661
+ if (!$image->error) {
662
+
663
+ $meta = nggAdmin::get_MetaData( $image->pid );
664
+
665
+ // get the title
666
+ $alttext = empty( $meta['title'] ) ? $image->alttext : $meta['title'];
667
+
668
+ // get the caption / description field
669
+ $description = empty( $meta['caption'] ) ? $image->description : $meta['caption'];
670
+
671
+ // get the file date/time from exif
672
+ $timestamp = $meta['timestamp'];
673
+ // first update database
674
+ $result = $wpdb->query(
675
+ $wpdb->prepare("UPDATE $wpdb->nggpictures SET
676
+ alttext = %s,
677
+ description = %s,
678
+ imagedate = %s
679
+ WHERE pid = %d", $alttext, $description, $timestamp, $image->pid) );
680
+
681
+ if ($result === false)
682
+ return ' <strong>' . esc_html( $image->filename ) . ' ' . __('(Error : Couldn\'t not update data base)', 'nggallery') . '</strong>';
683
+
684
+ //this flag will inform us that the import is already one time performed
685
+ $meta['common']['saved'] = true;
686
+ $result = nggdb::update_image_meta($image->pid, $meta['common']);
687
+
688
+ if ($result === false)
689
+ return ' <strong>' . esc_html( $image->filename ) . ' ' . __('(Error : Couldn\'t not update meta data)', 'nggallery') . '</strong>';
690
+
691
+ // add the tags if we found some
692
+ if ($meta['keywords']) {
693
+ $taglist = explode(',', $meta['keywords']);
694
+ wp_set_object_terms($image->pid, $taglist, 'ngg_tag');
695
+ }
696
+
697
+ } else
698
+ return ' <strong>' . esc_html( $image->filename ) . ' ' . __('(Error : Couldn\'t not find image)', 'nggallery') . '</strong>';// error check
699
+ }
700
+
701
+ return '1';
702
+ }
703
+
704
+ /**
705
+ * nggAdmin::get_MetaData()
706
+ *
707
+ * @class nggAdmin
708
+ * @require NextGEN Meta class
709
+ * @param int $id image ID
710
+ * @return array metadata
711
+ */
712
+ function get_MetaData($id) {
713
+
714
+ require_once(NGGALLERY_ABSPATH . '/lib/meta.php');
715
+
716
+ $meta = array();
717
+
718
+ $pdata = new nggMeta( $id );
719
+
720
+ $meta['title'] = trim ( $pdata->get_META('title') );
721
+ $meta['caption'] = trim ( $pdata->get_META('caption') );
722
+ $meta['keywords'] = trim ( $pdata->get_META('keywords') );
723
+ $meta['timestamp'] = $pdata->get_date_time();
724
+ // this contain other useful meta information
725
+ $meta['common'] = $pdata->get_common_meta();
726
+ // hook for addon plugin to add more meta fields
727
+ $meta = apply_filters('ngg_get_image_metadata', $meta, $pdata);
728
+
729
+ return $meta;
730
+
731
+ }
732
+
733
+ /**
734
+ * Maybe import some meta data to the database. The functions checks the flag 'saved'
735
+ * and if based on compat reason (pre V1.4.0) we save then some meta datas to the database
736
+ *
737
+ * @since V1.4.0
738
+ * @param int $id
739
+ * @return result
740
+ */
741
+ function maybe_import_meta( $id ) {
742
+
743
+ require_once(NGGALLERY_ABSPATH . '/lib/meta.php');
744
+
745
+ $meta_obj = new nggMeta( $id );
746
+
747
+ if ( $meta_obj->image->meta_data['saved'] != true ) {
748
+ $common = $meta_obj->get_common_meta();
749
+ //this flag will inform us that the import is already one time performed
750
+ $common['saved'] = true;
751
+ $result = nggdb::update_image_meta($id, $common);
752
+ } else
753
+ return false;
754
+
755
+ return $result;
756
+
757
+ }
758
+
759
+ /**
760
+ * Unzip a file via the PclZip class
761
+ *
762
+ * @class nggAdmin
763
+ * @require PclZip class
764
+ * @param string $dir
765
+ * @param string $file
766
+ * @return bool
767
+ */
768
+ function unzip($dir, $file) {
769
+
770
+ if(! class_exists('PclZip'))
771
+ require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php');
772
+
773
+ $archive = new PclZip($file);
774
+
775
+ // extract all files in one folder
776
+ if ($archive->extract(PCLZIP_OPT_PATH, $dir, PCLZIP_OPT_REMOVE_ALL_PATH,
777
+ PCLZIP_CB_PRE_EXTRACT, 'ngg_getOnlyImages',
778
+ PCLZIP_CB_POST_EXTRACT, 'ngg_checkExtract') == 0) {
779
+ nggGallery::show_error( 'Error : ' . $archive->errorInfo(true) );
780
+ return false;
781
+ }
782
+
783
+ return true;
784
+ }
785
+
786
+ /**
787
+ * nggAdmin::getOnlyImages()
788
+ *
789
+ * @class nggAdmin
790
+ * @param mixed $p_event
791
+ * @param mixed $p_header
792
+ * @return bool
793
+ */
794
+ function getOnlyImages($p_event, &$p_header) {
795
+ // avoid null byte hack (THX to Dominic Szablewski)
796
+ if ( strpos($p_header['filename'], chr(0) ) !== false )
797
+ $p_header['filename'] = substr ( $p_header['filename'], 0, strpos($p_header['filename'], chr(0) ));
798
+ // check for extension
799
+ $info = pathinfo($p_header['filename']);
800
+ // check for extension
801
+ $ext = apply_filters('ngg_allowed_file_types', array('jpeg', 'jpg', 'png', 'gif') );
802
+ if ( in_array( strtolower($info['extension']), $ext) ) {
803
+ // For MAC skip the ".image" files
804
+ if ($info['basename']{0} == '.' )
805
+ return 0;
806
+ else {
807
+ // sanitize the file name before we do further processing
808
+ $info['basename'] = sanitize_file_name( $info['basename'] );
809
+ $p_header['filename'] = $info['dirname'] . '/' . $info['basename'];
810
+ return 1;
811
+ }
812
+
813
+ }
814
+ // ----- all other files are skipped
815
+ else {
816
+ return 0;
817
+ }
818
+ }
819
+
820
+ /**
821
+ * Import a ZIP file via a upload form or a URL
822
+ *
823
+ * @class nggAdmin
824
+ * @param int (optional) $galleryID
825
+ * @return bool $result
826
+ */
827
+ function import_zipfile($galleryID) {
828
+
829
+ global $ngg, $wpdb;
830
+
831
+ if (nggWPMU::check_quota())
832
+ return false;
833
+
834
+ $defaultpath = $ngg->options['gallerypath'];
835
+ $zipurl = $_POST['zipurl'];
836
+
837
+ // if someone entered a URL try to upload it
838
+ if (!empty($zipurl) && (function_exists('curl_init')) ) {
839
+
840
+ if (!(preg_match('/^http(s)?:\/\//i', $zipurl) )) {
841
+ nggGallery::show_error( __('No valid URL path ','nggallery') );
842
+ return false;
843
+ }
844
+
845
+ $temp_zipfile = tempnam('/tmp', 'zipimport_');
846
+ $filename = basename($zipurl);
847
+
848
+ //Grab the zip via cURL
849
+ $save = fopen ( $temp_zipfile, "w" );
850
+ $ch = curl_init ();
851
+ curl_setopt ( $ch, CURLOPT_FILE, $save );
852
+ curl_setopt ( $ch, CURLOPT_HEADER, 0 );
853
+ curl_setopt ( $ch, CURLOPT_BINARYTRANSFER, 1 );
854
+ curl_setopt ( $ch, CURLOPT_URL, $zipurl );
855
+ $success = curl_exec ( $ch );
856
+ if (!$success)
857
+ nggGallery::show_error( __('Import via cURL failed.','nggallery') . ' Error code ' . curl_errno( $ch ) . ' : ' . curl_error( $ch ) );
858
+ curl_close ( $ch );
859
+ fclose($save);
860
+
861
+ if (!$success)
862
+ return false;
863
+
864
+ } else {
865
+
866
+ $temp_zipfile = $_FILES['zipfile']['tmp_name'];
867
+ $filename = $_FILES['zipfile']['name'];
868
+
869
+ // Chrome return a empty content-type : http://code.google.com/p/chromium/issues/detail?id=6800
870
+ if ( !preg_match('/chrome/i', $_SERVER['HTTP_USER_AGENT']) ) {
871
+ // check if file is a zip file
872
+ if ( !preg_match('/(zip|download|octet-stream)/i', $_FILES['zipfile']['type']) ) {
873
+ @unlink($temp_zipfile); // del temp file
874
+ nggGallery::show_error(__('Uploaded file was no or a faulty zip file ! The server recognized : ','nggallery') . $_FILES['zipfile']['type']);
875
+ return false;
876
+ }
877
+ }
878
+ }
879
+
880
+ // should this unpacked into a new folder ?
881
+ if ( $galleryID == '0' ) {
882
+ //cleanup and take the zipfile name as folder name
883
+ $foldername = sanitize_title(strtok ($filename, '.'));
884
+ $foldername = $defaultpath . $foldername;
885
+ } else {
886
+ // get foldername if selected
887
+ $foldername = $wpdb->get_var("SELECT path FROM $wpdb->nggallery WHERE gid = '$galleryID' ");
888
+ }
889
+
890
+ if ( empty($foldername) ) {
891
+ nggGallery::show_error( __('Could not get a valid foldername', 'nggallery') );
892
+ return false;
893
+ }
894
+
895
+ // set complete folder path
896
+ $newfolder = WINABSPATH . $foldername;
897
+
898
+ // check first if the traget folder exist
899
+ if (!is_dir($newfolder)) {
900
+ // create new directories
901
+ if (!wp_mkdir_p ($newfolder)) {
902
+ $message = sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?', 'nggallery'), esc_html( $newfolder ) );
903
+ nggGallery::show_error($message);
904
+ return false;
905
+ }
906
+ if (!wp_mkdir_p ($newfolder . '/thumbs')) {
907
+ nggGallery::show_error(__('Unable to create directory ', 'nggallery') . esc_html( $newfolder ). '/thumbs !');
908
+ return false;
909
+ }
910
+ }
911
+
912
+ // unzip and del temp file
913
+ $result = nggAdmin::unzip($newfolder, $temp_zipfile);
914
+ @unlink($temp_zipfile);
915
+
916
+ if ($result) {
917
+ $message = __('Zip-File successfully unpacked','nggallery') . '<br />';
918
+
919
+ // parse now the folder and add to database
920
+ $message .= nggAdmin::import_gallery( $foldername );
921
+ nggGallery::show_message($message);
922
+ }
923
+
924
+ return true;
925
+ }
926
+
927
+ /**
928
+ * Function for uploading of images via the upload form
929
+ *
930
+ * @class nggAdmin
931
+ * @return void
932
+ */
933
+ function upload_images() {
934
+
935
+ global $nggdb;
936
+
937
+ // WPMU action
938
+ if (nggWPMU::check_quota())
939
+ return;
940
+
941
+ // Images must be an array
942
+ $imageslist = array();
943
+
944
+ // get selected gallery
945
+ $galleryID = (int) $_POST['galleryselect'];
946
+
947
+ if ($galleryID == 0) {
948
+ nggGallery::show_error(__('No gallery selected !','nggallery'));
949
+ return;
950
+ }
951
+
952
+ // get the path to the gallery
953
+ $gallery = $nggdb->find_gallery($galleryID);
954
+
955
+ if ( empty($gallery->path) ){
956
+ nggGallery::show_error(__('Failure in database, no gallery path set !','nggallery'));
957
+ return;
958
+ }
959
+
960
+ // read list of images
961
+ $dirlist = nggAdmin::scandir($gallery->abspath);
962
+
963
+ $imagefiles = $_FILES['imagefiles'];
964
+
965
+ if (is_array($imagefiles)) {
966
+ foreach ($imagefiles['name'] as $key => $value) {
967
+
968
+ // look only for uploded files
969
+ if ($imagefiles['error'][$key] == 0) {
970
+
971
+ $temp_file = $imagefiles['tmp_name'][$key];
972
+
973
+ //clean filename and extract extension
974
+ $filepart = nggGallery::fileinfo( $imagefiles['name'][$key] );
975
+ $filename = $filepart['basename'];
976
+
977
+ // check for allowed extension and if it's an image file
978
+ $ext = array('jpg', 'png', 'gif');
979
+ if ( !in_array($filepart['extension'], $ext) || !@getimagesize($temp_file) ){
980
+ nggGallery::show_error('<strong>' . esc_html( $imagefiles['name'][$key] ) . ' </strong>' . __('is no valid image file!','nggallery'));
981
+ continue;
982
+ }
983
+
984
+ // check if this filename already exist in the folder
985
+ $i = 0;
986
+ while ( in_array( $filename, $dirlist ) ) {
987
+ $filename = $filepart['filename'] . '_' . $i++ . '.' .$filepart['extension'];
988
+ }
989
+
990
+ $dest_file = $gallery->abspath . '/' . $filename;
991
+
992
+ //check for folder permission
993
+ if ( !is_writeable($gallery->abspath) ) {
994
+ $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'nggallery'), esc_html($gallery->abspath) );
995
+ nggGallery::show_error($message);
996
+ return;
997
+ }
998
+
999
+ // save temp file to gallery
1000
+ if ( !@move_uploaded_file($temp_file, $dest_file) ){
1001
+ nggGallery::show_error(__('Error, the file could not be moved to : ','nggallery') . esc_html( $dest_file ) );
1002
+ nggAdmin::check_safemode( $gallery->abspath );
1003
+ continue;
1004
+ }
1005
+ if ( !nggAdmin::chmod($dest_file) ) {
1006
+ nggGallery::show_error(__('Error, the file permissions could not be set','nggallery'));
1007
+ continue;
1008
+ }
1009
+
1010
+ // add to imagelist & dirlist
1011
+ $imageslist[] = $filename;
1012
+ $dirlist[] = $filename;
1013
+
1014
+ }
1015
+ }
1016
+ }
1017
+
1018
+ if (count($imageslist) > 0) {
1019
+
1020
+ // add images to database
1021
+ $image_ids = nggAdmin::add_Images($galleryID, $imageslist);
1022
+
1023
+ //create thumbnails
1024
+ nggAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','nggallery') );
1025
+
1026
+ //add the preview image if needed
1027
+ nggAdmin::set_gallery_preview ( $galleryID );
1028
+
1029
+ nggGallery::show_message( count($image_ids) . __(' Image(s) successfully added','nggallery'));
1030
+ }
1031
+
1032
+ return;
1033
+
1034
+ }
1035
+
1036
+ /**
1037
+ * Upload function will be called via the Flash uploader
1038
+ *
1039
+ * @class nggAdmin
1040
+ * @param integer $galleryID
1041
+ * @return string $result
1042
+ */
1043
+ static function swfupload_image($galleryID = 0) {
1044
+
1045
+ global $nggdb;
1046
+
1047
+ if ($galleryID == 0)
1048
+ return __('No gallery selected !', 'nggallery');
1049
+
1050
+ // WPMU action
1051
+ if (nggWPMU::check_quota())
1052
+ return '0';
1053
+
1054
+ // Check the upload
1055
+ if (!isset($_FILES['Filedata']) || !is_uploaded_file($_FILES['Filedata']['tmp_name']) || $_FILES['Filedata']['error'] != 0)
1056
+ return __('Invalid upload. Error Code : ', 'nggallery') . $_FILES['Filedata']['error'];
1057
+
1058
+ // get the filename and extension
1059
+ $temp_file = $_FILES['Filedata']['tmp_name'];
1060
+
1061
+ $filepart = nggGallery::fileinfo( $_FILES['Filedata']['name'] );
1062
+ $filename = $filepart['basename'];
1063
+
1064
+ // check for allowed extension
1065
+ $ext = apply_filters('ngg_allowed_file_types', array('jpeg', 'jpg', 'png', 'gif') );
1066
+ if (!in_array( strtolower( $filepart['extension'] ), $ext))
1067
+ return esc_html( $_FILES[$key]['name'] ) . __('is no valid image file!', 'nggallery');
1068
+
1069
+ // get the path to the gallery
1070
+ $gallery = $nggdb->find_gallery( (int) $galleryID );
1071
+ if ( empty($gallery->path) ){
1072
+ @unlink($temp_file);
1073
+ return __('Failure in database, no gallery path set !', 'nggallery');
1074
+ }
1075
+
1076
+ // read list of images
1077
+ $imageslist = nggAdmin::scandir( WINABSPATH . $gallery->path );
1078
+
1079
+ // check if this filename already exist
1080
+ $i = 0;
1081
+ while (in_array($filename, $imageslist)) {
1082
+ $filename = $filepart['filename'] . '_' . $i++ . '.' . $filepart['extension'];
1083
+ }
1084
+
1085
+ $dest_file = WINABSPATH . $gallery->path . '/' . $filename;
1086
+
1087
+ // save temp file to gallery
1088
+ if ( !@move_uploaded_file($_FILES["Filedata"]['tmp_name'], $dest_file) ){
1089
+ nggAdmin::check_safemode(WINABSPATH . $gallery->path);
1090
+ return __('Error, the file could not be moved to : ','nggallery'). esc_html( $dest_file );
1091
+ }
1092
+
1093
+ if ( !nggAdmin::chmod($dest_file) )
1094
+ return __('Error, the file permissions could not be set','nggallery');
1095
+
1096
+ return '0';
1097
+ }
1098
+
1099
+ /**
1100
+ * Set correct file permissions (taken from wp core)
1101
+ *
1102
+ * @class nggAdmin
1103
+ * @param string $filename
1104
+ * @return bool $result
1105
+ */
1106
+ function chmod($filename = '') {
1107
+
1108
+ $stat = @ stat( dirname($filename) );
1109
+ $perms = $stat['mode'] & 0000666; // Remove execute bits for files
1110
+ if ( @chmod($filename, $perms) )
1111
+ return true;
1112
+
1113
+ return false;
1114
+ }
1115
+
1116
+ /**
1117
+ * Check UID in folder and Script
1118
+ * Read http://www.php.net/manual/en/features.safe-mode.php to understand safe_mode
1119
+ *
1120
+ * @class nggAdmin
1121
+ * @param string $foldername
1122
+ * @return bool $result
1123
+ */
1124
+ function check_safemode($foldername) {
1125
+
1126
+ if ( SAFE_MODE ) {
1127
+
1128
+ $script_uid = ( ini_get('safe_mode_gid') ) ? getmygid() : getmyuid();
1129
+ $folder_uid = fileowner($foldername);
1130
+
1131
+ if ($script_uid != $folder_uid) {
1132
+ $message = sprintf(__('SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually','nggallery'), esc_html( $foldername ) );
1133
+ $message .= '<br />' . sprintf(__('When safe_mode is on, PHP checks to see if the owner (%s) of the current script matches the owner (%s) of the file to be operated on by a file function or its directory','nggallery'), $script_uid, $folder_uid );
1134
+ nggGallery::show_error($message);
1135
+ return false;
1136
+ }
1137
+ }
1138
+
1139
+ return true;
1140
+ }
1141
+
1142
+ /**
1143
+ * Capability check. Check is the ID fit's to the user_ID
1144
+ *
1145
+ * @class nggAdmin
1146
+ * @param int $check_ID is the user_id
1147
+ * @return bool $result
1148
+ */
1149
+ function can_manage_this_gallery($check_ID) {
1150
+
1151
+ global $user_ID, $wp_roles;
1152
+
1153
+ if ( !current_user_can('NextGEN Manage others gallery') ) {
1154
+ // get the current user ID
1155
+ get_currentuserinfo();
1156
+
1157
+ if ( $user_ID != $check_ID)
1158
+ return false;
1159
+ }
1160
+
1161
+ return true;
1162
+
1163
+ }
1164
+
1165
+ /**
1166
+ * Move images from one folder to another
1167
+ *
1168
+ * @class nggAdmin
1169
+ * @param array|int $pic_ids ID's of the images
1170
+ * @param int $dest_gid destination gallery
1171
+ * @return void
1172
+ */
1173
+ function move_images($pic_ids, $dest_gid) {
1174
+
1175
+ $errors = '';
1176
+ $count = 0;
1177
+
1178
+ if ( !is_array($pic_ids) )
1179
+ $pic_ids = array($pic_ids);
1180
+
1181
+ // Get destination gallery
1182
+ $destination = nggdb::find_gallery( $dest_gid );
1183
+ $dest_abspath = WINABSPATH . $destination->path;
1184
+
1185
+ if ( $destination == null ) {
1186
+ nggGallery::show_error(__('The destination gallery does not exist','nggallery'));
1187
+ return;
1188
+ }
1189
+
1190
+ // Check for folder permission
1191
+ if ( !is_writeable( $dest_abspath ) ) {
1192
+ $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'nggallery'), esc_html( $dest_abspath ) );
1193
+ nggGallery::show_error($message);
1194
+ return;
1195
+ }
1196
+
1197
+ // Get pictures
1198
+ $images = nggdb::find_images_in_list($pic_ids);
1199
+
1200
+ foreach ($images as $image) {
1201
+
1202
+ $i = 0;
1203
+ $tmp_prefix = '';
1204
+
1205
+ $destination_file_name = $image->filename;
1206
+ // check if the filename already exist, then we add a copy_ prefix
1207
+ while (file_exists( $dest_abspath . '/' . $destination_file_name)) {
1208
+ $tmp_prefix = 'copy_' . ($i++) . '_';
1209
+ $destination_file_name = $tmp_prefix . $image->filename;
1210
+ }
1211
+
1212
+ $destination_path = $dest_abspath . '/' . $destination_file_name;
1213
+ $destination_thumbnail = $dest_abspath . '/thumbs/thumbs_' . $destination_file_name;
1214
+
1215
+ // Move files
1216
+ if ( !@rename($image->imagePath, $destination_path) ) {
1217
+ $errors .= sprintf(__('Failed to move image %1$s to %2$s','nggallery'),
1218
+ '<strong>' . esc_html( $image->filename ) . '</strong>', esc_html( $destination_path ) ) . '<br />';
1219
+ continue;
1220
+ }
1221
+
1222
+ // Move backup file, if possible
1223
+ @rename($image->imagePath . '_backup', $destination_path . '_backup');
1224
+ // Move the thumbnail, if possible
1225
+ @rename($image->thumbPath, $destination_thumbnail);
1226
+
1227
+ // Change the gallery id in the database , maybe the filename
1228
+ if ( nggdb::update_image($image->pid, $dest_gid, $destination_file_name) )
1229
+ $count++;
1230
+
1231
+ }
1232
+
1233
+ if ( $errors != '' )
1234
+ nggGallery::show_error($errors);
1235
+
1236
+ $link = '<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . esc_html( $destination->title ) . '</a>';
1237
+ $messages = sprintf(__('Moved %1$s picture(s) to gallery : %2$s .','nggallery'), $count, $link);
1238
+ nggGallery::show_message($messages);
1239
+
1240
+ return;
1241
+ }
1242
+
1243
+ /**
1244
+ * Copy images to another gallery
1245
+ *
1246
+ * @class nggAdmin
1247
+ * @param array|int $pic_ids ID's of the images
1248
+ * @param int $dest_gid destination gallery
1249
+ * @return void
1250
+ */
1251
+ function copy_images($pic_ids, $dest_gid) {
1252
+
1253
+ require_once(NGGALLERY_ABSPATH . '/lib/meta.php');
1254
+
1255
+ $errors = $messages = '';
1256
+
1257
+ if (!is_array($pic_ids))
1258
+ $pic_ids = array($pic_ids);
1259
+
1260
+ // Get destination gallery
1261
+ $destination = nggdb::find_gallery( $dest_gid );
1262
+ if ( $destination == null ) {
1263
+ nggGallery::show_error(__('The destination gallery does not exist','nggallery'));
1264
+ return;
1265
+ }
1266
+
1267
+ // Check for folder permission
1268
+ if (!is_writeable(WINABSPATH.$destination->path)) {
1269
+ $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'nggallery'), esc_html( WINABSPATH.$destination->path) );
1270
+ nggGallery::show_error($message);
1271
+ return;
1272
+ }
1273
+
1274
+ // Get pictures
1275
+ $images = nggdb::find_images_in_list($pic_ids);
1276
+ $destination_path = WINABSPATH . $destination->path;
1277
+
1278
+ foreach ($images as $image) {
1279
+ // WPMU action
1280
+ if ( nggWPMU::check_quota() )
1281
+ return;
1282
+
1283
+ $i = 0;
1284
+ $tmp_prefix = '';
1285
+ $destination_file_name = $image->filename;
1286
+ while (file_exists($destination_path . '/' . $destination_file_name)) {
1287
+ $tmp_prefix = 'copy_' . ($i++) . '_';
1288
+ $destination_file_name = $tmp_prefix . $image->filename;
1289
+ }
1290
+
1291
+ $destination_file_path = $destination_path . '/' . $destination_file_name;
1292
+ $destination_thumb_file_path = $destination_path . '/' . $image->thumbFolder . $image->thumbPrefix . $destination_file_name;
1293
+
1294
+ // Copy files
1295
+ if ( !@copy($image->imagePath, $destination_file_path) ) {
1296
+ $errors .= sprintf(__('Failed to copy image %1$s to %2$s','nggallery'),
1297
+ esc_html( $image->filename ), esc_html( $destination_file_path) ) . '<br />';
1298
+ continue;
1299
+ }
1300
+
1301
+ // Copy backup file, if possible
1302
+ @copy($image->imagePath . '_backup', $destination_file_path . '_backup');
1303
+ // Copy the thumbnail if possible
1304
+ @copy($image->thumbPath, $destination_thumb_file_path);
1305
+
1306
+ // Create new database entry for the image
1307
+ $new_pid = nggdb::insert_image( $destination->gid, $destination_file_name, $image->alttext, $image->description, $image->exclude);
1308
+
1309
+ if (!isset($new_pid)) {
1310
+ $errors .= sprintf(__('Failed to copy database row for picture %s','nggallery'), $image->pid) . '<br />';
1311
+ continue;
1312
+ }
1313
+
1314
+ // Copy tags
1315
+ nggTags::copy_tags($image->pid, $new_pid);
1316
+
1317
+ // Copy meta information
1318
+ $meta = new nggMeta($image->pid);
1319
+ nggdb::update_image_meta( $new_pid, $meta->image->meta_data);
1320
+
1321
+ if ( $tmp_prefix != '' ) {
1322
+ $messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery.','nggallery'),
1323
+ $image->pid, esc_html($image->filename), $new_pid, esc_html($destination_file_name) ) . '<br />';
1324
+ } else {
1325
+ $messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s)','nggallery'),
1326
+ $image->pid, esc_html($image->filename), $new_pid, esc_html($destination_file_name) ) . '<br />';
1327
+ }
1328
+
1329
+ }
1330
+
1331
+ // Finish by showing errors or success
1332
+ if ( $errors == '' ) {
1333
+ $link = '<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . esc_html($destination->title) . '</a>';
1334
+ $messages .= '<hr />' . sprintf(__('Copied %1$s picture(s) to gallery: %2$s .','nggallery'), count($images), $link);
1335
+ }
1336
+
1337
+ if ( $messages != '' )
1338
+ nggGallery::show_message($messages);
1339
+
1340
+ if ( $errors != '' )
1341
+ nggGallery::show_error($errors);
1342
+
1343
+ return;
1344
+ }
1345
+
1346
+ /**
1347
+ * Initate the Ajax operation
1348
+ *
1349
+ * @class nggAdmin
1350
+ * @param string $operation name of the function which should be executed
1351
+ * @param array $image_array
1352
+ * @param string $title name of the operation
1353
+ * @return string the javascript output
1354
+ */
1355
+ function do_ajax_operation( $operation, $image_array, $title = '' ) {
1356
+
1357
+ if ( !is_array($image_array) || empty($image_array) )
1358
+ return;
1359
+
1360
+ $js_array = implode('","', $image_array);
1361
+
1362
+ // send out some JavaScript, which initate the ajax operation
1363
+ ?>
1364
+ <script type="text/javascript">
1365
+
1366
+ Images = new Array("<?php echo $js_array; ?>");
1367
+
1368
+ nggAjaxOptions = {
1369
+ operation: "<?php echo $operation; ?>",
1370
+ ids: Images,
1371
+ header: "<?php echo $title; ?>",
1372
+ maxStep: Images.length
1373
+ };
1374
+
1375
+ jQuery(document).ready( function(){
1376
+ nggProgressBar.init( nggAjaxOptions );
1377
+ nggAjax.init( nggAjaxOptions );
1378
+ } );
1379
+ </script>
1380
+
1381
+ <?php
1382
+ }
1383
+
1384
+ /**
1385
+ * nggAdmin::set_gallery_preview() - define a preview pic after the first upload, can be changed in the gallery settings
1386
+ *
1387
+ * @class nggAdmin
1388
+ * @param int $galleryID
1389
+ * @return void
1390
+ */
1391
+ function set_gallery_preview( $galleryID ) {
1392
+
1393
+ global $wpdb;
1394
+
1395
+ $gallery = nggdb::find_gallery( $galleryID );
1396
+
1397
+ // in the case no preview image is setup, we do this now
1398
+ if ($gallery->previewpic == 0) {
1399
+ $firstImage = $wpdb->get_var("SELECT pid FROM $wpdb->nggpictures WHERE exclude != 1 AND galleryid = '$galleryID' ORDER by pid DESC limit 0,1");
1400
+ if ($firstImage) {
1401
+ $wpdb->query("UPDATE $wpdb->nggallery SET previewpic = '$firstImage' WHERE gid = '$galleryID'");
1402
+ wp_cache_delete($galleryID, 'ngg_gallery');
1403
+ }
1404
+ }
1405
+
1406
+ return;
1407
+ }
1408
+
1409
+ /**
1410
+ * Return a JSON coded array of Image ids for a requested gallery
1411
+ *
1412
+ * @class nggAdmin
1413
+ * @param int $galleryID
1414
+ * @return arry (JSON)
1415
+ */
1416
+ function get_image_ids( $galleryID ) {
1417
+
1418
+ if ( !function_exists('json_encode') )
1419
+ return(-2);
1420
+
1421
+ $gallery = nggdb::get_ids_from_gallery($galleryID, 'pid', 'ASC', false);
1422
+
1423
+ header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true);
1424
+ $output = json_encode($gallery);
1425
+
1426
+ return $output;
1427
+ }
1428
+
1429
+ /**
1430
+ * Decode upload error to normal message
1431
+ *
1432
+ * @class nggAdmin
1433
+ * @access internal
1434
+ * @param int $code php upload error code
1435
+ * @return string message
1436
+ */
1437
+
1438
+ function decode_upload_error( $code ) {
1439
+
1440
+ switch ($code) {
1441
+ case UPLOAD_ERR_INI_SIZE:
1442
+ $message = __ ( 'The uploaded file exceeds the upload_max_filesize directive in php.ini', 'nggallery' );
1443
+ break;
1444
+ case UPLOAD_ERR_FORM_SIZE:
1445
+ $message = __ ( 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form', 'nggallery' );
1446
+ break;
1447
+ case UPLOAD_ERR_PARTIAL:
1448
+ $message = __ ( 'The uploaded file was only partially uploaded', 'nggallery' );
1449
+ break;
1450
+ case UPLOAD_ERR_NO_FILE:
1451
+ $message = __ ( 'No file was uploaded', 'nggallery' );
1452
+ break;
1453
+ case UPLOAD_ERR_NO_TMP_DIR:
1454
+ $message = __ ( 'Missing a temporary folder', 'nggallery' );
1455
+ break;
1456
+ case UPLOAD_ERR_CANT_WRITE:
1457
+ $message = __ ( 'Failed to write file to disk', 'nggallery' );
1458
+ break;
1459
+ case UPLOAD_ERR_EXTENSION:
1460
+ $message = __ ( 'File upload stopped by extension', 'nggallery' );
1461
+ break;
1462
+ default:
1463
+ $message = __ ( 'Unknown upload error', 'nggallery' );
1464
+ break;
1465
+ }
1466
+
1467
+ return $message;
1468
+ }
1469
+
1470
+ } // END class nggAdmin
1471
+
1472
+ /**
1473
+ * TODO: Cannot be member of a class ? Check PCLZIP later...
1474
+ *
1475
+ * @param mixed $p_event
1476
+ * @param mixed $p_header
1477
+ * @return
1478
+ */
1479
+ function ngg_getOnlyImages($p_event, &$p_header) {
1480
+ return nggAdmin::getOnlyImages($p_event, $p_header);
1481
+ }
1482
+
1483
+ /**
1484
+ * Ensure after zip extraction that it could be only a image file
1485
+ *
1486
+ * @param mixed $p_event
1487
+ * @param mixed $p_header
1488
+ * @return 1
1489
+ */
1490
+ function ngg_checkExtract($p_event, &$p_header) {
1491
+
1492
+ // look for valid extraction
1493
+ if ($p_header['status'] == 'ok') {
1494
+ // check if it's any image file, delete all other files
1495
+ if ( !@getimagesize ( $p_header['filename'] ))
1496
+ unlink($p_header['filename']);
1497
+ }
1498
+
1499
+ return 1;
1500
+ }
1501
+ ?>
admin/images/facebook.png ADDED
Binary file
admin/images/googleplus.png ADDED
Binary file
admin/images/icon-paypal.gif ADDED
Binary file
admin/images/icon-rating.png ADDED
Binary file
admin/images/icon-translate.png ADDED
Binary file
admin/images/marker_bottom.gif ADDED
Binary file
admin/images/marker_middle.gif ADDED
Binary file
admin/images/marker_top.gif ADDED
Binary file
admin/images/menu-bits.gif ADDED
Binary file
admin/images/nextgen.png ADDED
Binary file
admin/images/nextgen_16_color.png ADDED
Binary file
admin/images/nextgen_16_grey.png ADDED
Binary file
admin/images/nextgen_32_color.png ADDED
Binary file
admin/images/nextgen_32_grey.png ADDED
Binary file
admin/images/select.png ADDED
Binary file
admin/images/twitter.png ADDED
Binary file
admin/index.html ADDED
File without changes
admin/install.php ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ /**
5
+ * creates all tables for the gallery
6
+ * called during register_activation hook
7
+ *
8
+ * @access internal
9
+ * @return void
10
+ */
11
+ function nggallery_install () {
12
+
13
+ global $wpdb , $wp_roles, $wp_version;
14
+
15
+ // Check for capability
16
+ if ( !current_user_can('activate_plugins') )
17
+ return;
18
+
19
+ // Set the capabilities for the administrator
20
+ $role = get_role('administrator');
21
+ // We need this role, no other chance
22
+ if ( empty($role) ) {
23
+ update_option( "ngg_init_check", __('Sorry, NextCellent Gallery works only with a role called administrator',"nggallery") );
24
+ return;
25
+ }
26
+
27
+ $role->add_cap('NextGEN Gallery overview');
28
+ $role->add_cap('NextGEN Use TinyMCE');
29
+ $role->add_cap('NextGEN Upload images');
30
+ $role->add_cap('NextGEN Manage gallery');
31
+ $role->add_cap('NextGEN Manage tags');
32
+ $role->add_cap('NextGEN Manage others gallery');
33
+ $role->add_cap('NextGEN Edit album');
34
+ $role->add_cap('NextGEN Change style');
35
+ $role->add_cap('NextGEN Change options');
36
+
37
+ // upgrade function changed in WordPress 2.3
38
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
39
+
40
+ // add charset & collate like wp core
41
+ $charset_collate = '';
42
+
43
+ if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) {
44
+ if ( ! empty($wpdb->charset) )
45
+ $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
46
+ if ( ! empty($wpdb->collate) )
47
+ $charset_collate .= " COLLATE $wpdb->collate";
48
+ }
49
+
50
+ $nggpictures = $wpdb->prefix . 'ngg_pictures';
51
+ $nggallery = $wpdb->prefix . 'ngg_gallery';
52
+ $nggalbum = $wpdb->prefix . 'ngg_album';
53
+
54
+ // Create pictures table
55
+ $sql = "CREATE TABLE " . $nggpictures . " (
56
+ pid BIGINT(20) NOT NULL AUTO_INCREMENT ,
57
+ image_slug VARCHAR(255) NOT NULL ,
58
+ post_id BIGINT(20) DEFAULT '0' NOT NULL ,
59
+ galleryid BIGINT(20) DEFAULT '0' NOT NULL ,
60
+ filename VARCHAR(255) NOT NULL ,
61
+ description MEDIUMTEXT NULL ,
62
+ alttext MEDIUMTEXT NULL ,
63
+ imagedate DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
64
+ exclude TINYINT NULL DEFAULT '0' ,
65
+ sortorder BIGINT(20) DEFAULT '0' NOT NULL ,
66
+ meta_data LONGTEXT,
67
+ PRIMARY KEY (pid),
68
+ KEY post_id (post_id)
69
+ ) $charset_collate;";
70
+ dbDelta($sql);
71
+
72
+ // Create gallery table
73
+ $sql = "CREATE TABLE " . $nggallery . " (
74
+ gid BIGINT(20) NOT NULL AUTO_INCREMENT ,
75
+ name VARCHAR(255) NOT NULL ,
76
+ slug VARCHAR(255) NOT NULL ,
77
+ path MEDIUMTEXT NULL ,
78
+ title MEDIUMTEXT NULL ,
79
+ galdesc MEDIUMTEXT NULL ,
80
+ pageid BIGINT(20) DEFAULT '0' NOT NULL ,
81
+ previewpic BIGINT(20) DEFAULT '0' NOT NULL ,
82
+ author BIGINT(20) DEFAULT '0' NOT NULL ,
83
+ PRIMARY KEY (gid)
84
+ ) $charset_collate;";
85
+ dbDelta($sql);
86
+
87
+ // Create albums table
88
+ $sql = "CREATE TABLE " . $nggalbum . " (
89
+ id BIGINT(20) NOT NULL AUTO_INCREMENT ,
90
+ name VARCHAR(255) NOT NULL ,
91
+ slug VARCHAR(255) NOT NULL ,
92
+ previewpic BIGINT(20) DEFAULT '0' NOT NULL ,
93
+ albumdesc MEDIUMTEXT NULL ,
94
+ sortorder LONGTEXT NOT NULL,
95
+ pageid BIGINT(20) DEFAULT '0' NOT NULL,
96
+ PRIMARY KEY (id)
97
+ ) $charset_collate;";
98
+ dbDelta($sql);
99
+
100
+ // check one table again, to be sure
101
+ if( !$wpdb->get_var( "SHOW TABLES LIKE '$nggpictures'" ) ) {
102
+ update_option( "ngg_init_check", __('NextCellent Gallery : Tables could not created, please check your database settings',"nggallery") );
103
+ return;
104
+ }
105
+
106
+ $options = get_option('ngg_options');
107
+ // set the default settings, if we didn't upgrade
108
+ if ( empty( $options ) )
109
+ ngg_default_options();
110
+
111
+ // if all is passed , save the DBVERSION
112
+ add_option("ngg_db_version", NGG_DBVERSION);
113
+
114
+ }
115
+
116
+ /**
117
+ * Setup the default option array for the gallery
118
+ *
119
+ * @access internal
120
+ * @since version 0.33
121
+ * @return void
122
+ */
123
+ function ngg_default_options() {
124
+
125
+ global $blog_id, $ngg;
126
+
127
+ $ngg_options['gallerypath'] = 'wp-content/gallery/'; // set default path to the gallery
128
+ $ngg_options['deleteImg'] = true; // delete Images
129
+ $ngg_options['swfUpload'] = true; // activate the batch upload
130
+ $ngg_options['usePermalinks'] = false; // use permalinks for parameters
131
+ $ngg_options['permalinkSlug'] = 'nggallery'; // the default slug for permalinks
132
+ $ngg_options['graphicLibrary'] = 'gd'; // default graphic library
133
+ $ngg_options['imageMagickDir'] = '/usr/local/bin/'; // default path to ImageMagick
134
+ $ngg_options['useMediaRSS'] = false; // activate the global Media RSS file
135
+ $ngg_options['usePicLens'] = false; // activate the PicLens Link for galleries
136
+
137
+ // Tags / categories
138
+ $ngg_options['activateTags'] = false; // append related images
139
+ $ngg_options['appendType'] = 'tags'; // look for category or tags
140
+ $ngg_options['maxImages'] = 7; // number of images toshow
141
+
142
+ // Thumbnail Settings
143
+ $ngg_options['thumbwidth'] = 100; // Thumb Width
144
+ $ngg_options['thumbheight'] = 75; // Thumb height
145
+ $ngg_options['thumbfix'] = true; // Fix the dimension
146
+ $ngg_options['thumbquality'] = 100; // Thumb Quality
147
+
148
+ // Image Settings
149
+ $ngg_options['imgWidth'] = 800; // Image Width
150
+ $ngg_options['imgHeight'] = 600; // Image height
151
+ $ngg_options['imgQuality'] = 85; // Image Quality
152
+ $ngg_options['imgBackup'] = true; // Create a backup
153
+ $ngg_options['imgAutoResize'] = false; // Resize after upload
154
+
155
+ // Gallery Settings
156
+ $ngg_options['galImages'] = '20'; // Number of images per page
157
+ $ngg_options['galPagedGalleries'] = 0; // Number of galleries per page (in a album)
158
+ $ngg_options['galColumns'] = 0; // Number of columns for the gallery
159
+ $ngg_options['galShowSlide'] = true; // Show slideshow
160
+ $ngg_options['galTextSlide'] = __('[Show as slideshow]','nggallery'); // Text for slideshow
161
+ $ngg_options['galTextGallery'] = __('[Show picture list]','nggallery'); // Text for gallery
162
+ $ngg_options['galShowOrder'] = 'gallery'; // Show order
163
+ $ngg_options['galSort'] = 'sortorder'; // Sort order
164
+ $ngg_options['galSortDir'] = 'ASC'; // Sort direction
165
+ $ngg_options['galNoPages'] = true; // use no subpages for gallery
166
+ $ngg_options['galImgBrowser'] = false; // Show ImageBrowser, instead effect
167
+ $ngg_options['galHiddenImg'] = false; // For paged galleries we can hide image
168
+ $ngg_options['galAjaxNav'] = false; // AJAX Navigation for Shutter effect
169
+
170
+ // Thumbnail Effect
171
+ $ngg_options['thumbEffect'] = 'shutter'; // select effect
172
+ $ngg_options['thumbCode'] = 'class="shutterset_%GALLERY_NAME%"';
173
+
174
+ // Watermark settings
175
+ $ngg_options['wmPos'] = 'botRight'; // Postion
176
+ $ngg_options['wmXpos'] = 5; // X Pos
177
+ $ngg_options['wmYpos'] = 5; // Y Pos
178
+ $ngg_options['wmType'] = 'text'; // Type : 'image' / 'text'
179
+ $ngg_options['wmPath'] = ''; // Path to image
180
+ $ngg_options['wmFont'] = 'arial.ttf'; // Font type
181
+ $ngg_options['wmSize'] = 10; // Font Size
182
+ $ngg_options['wmText'] = get_option('blogname'); // Text
183
+ $ngg_options['wmColor'] = '000000'; // Font Color
184
+ $ngg_options['wmOpaque'] = '100'; // Font Opaque
185
+
186
+ // Image Rotator settings
187
+ $ngg_options['enableIR'] = false;
188
+ $ngg_options['slideFx'] = 'fade';
189
+ $ngg_options['irURL'] = path_join(NGGALLERY_URLPATH, 'imagerotator.swf');
190
+ $ngg_options['irXHTMLvalid'] = false;
191
+ $ngg_options['irAudio'] = '';
192
+ $ngg_options['irWidth'] = 320;
193
+ $ngg_options['irHeight'] = 240;
194
+ $ngg_options['irShuffle'] = true;
195
+ $ngg_options['irLinkfromdisplay'] = true;
196
+ $ngg_options['irShownavigation'] = false;
197
+ $ngg_options['irShowicons'] = false;
198
+ $ngg_options['irWatermark'] = false;
199
+ $ngg_options['irOverstretch'] = 'true';
200
+ $ngg_options['irRotatetime'] = 10;
201
+ $ngg_options['irTransition'] = 'random';
202
+ $ngg_options['irKenburns'] = false;
203
+ $ngg_options['irBackcolor'] = '000000';
204
+ $ngg_options['irFrontcolor'] = 'FFFFFF';
205
+ $ngg_options['irLightcolor'] = 'CC0000';
206
+ $ngg_options['irScreencolor'] = '000000';
207
+
208
+ // CSS Style
209
+ $ngg_options['activateCSS'] = true; // activate the CSS file
210
+ $ngg_options['CSSfile'] = 'nggallery.css'; // set default css filename
211
+
212
+ // special overrides for WPMU
213
+ if (is_multisite()) {
214
+ // get the site options
215
+ $ngg_wpmu_options = get_site_option('ngg_options');
216
+
217
+ // get the default value during first installation
218
+ if (!is_array($ngg_wpmu_options)) {
219
+ $ngg_wpmu_options['gallerypath'] = 'wp-content/blogs.dir/%BLOG_ID%/files/';
220
+ $ngg_wpmu_options['wpmuCSSfile'] = 'nggallery.css';
221
+ update_site_option('ngg_options', $ngg_wpmu_options);
222
+ }
223
+
224
+ $ngg_options['gallerypath'] = str_replace("%BLOG_ID%", $blog_id , $ngg_wpmu_options['gallerypath']);
225
+ $ngg_options['CSSfile'] = $ngg_wpmu_options['wpmuCSSfile'];
226
+ }
227
+
228
+ update_option('ngg_options', $ngg_options);
229
+
230
+ }
231
+
232
+ /**
233
+ * Deregister a capability from all classic roles
234
+ *
235
+ * @access internal
236
+ * @param string $capability name of the capability which should be deregister
237
+ * @return void
238
+ */
239
+ function ngg_remove_capability($capability){
240
+ // this function remove the $capability only from the classic roles
241
+ $check_order = array("subscriber", "contributor", "author", "editor", "administrator");
242
+
243
+ foreach ($check_order as $role) {
244
+
245
+ $role = get_role($role);
246
+ $role->remove_cap($capability) ;
247
+ }
248
+
249
+ }
250
+
251
+ /**
252
+ * Uninstall all settings and tables
253
+ * Called via Setup and register_unstall hook
254
+ *
255
+ * @access internal
256
+ * @return void
257
+ */
258
+ function nggallery_uninstall() {
259
+ global $wpdb;
260
+
261
+ // first remove all tables
262
+ $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}ngg_pictures");
263
+ $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}ngg_gallery");
264
+ $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}ngg_album");
265
+
266
+ // then remove all options
267
+ delete_option( 'ngg_options' );
268
+ delete_option( 'ngg_db_version' );
269
+ delete_option( 'ngg_update_exists' );
270
+ delete_option( 'ngg_next_update' );
271
+
272
+ // now remove the capability
273
+ ngg_remove_capability("NextGEN Gallery overview");
274
+ ngg_remove_capability("NextGEN Use TinyMCE");
275
+ ngg_remove_capability("NextGEN Upload images");
276
+ ngg_remove_capability("NextGEN Manage gallery");
277
+ ngg_remove_capability("NextGEN Edit album");
278
+ ngg_remove_capability("NextGEN Change style");
279
+ ngg_remove_capability("NextGEN Change options");
280
+ }
281
+
282
+ ?>
admin/js/Jcrop/css/Jcrop.gif ADDED
Binary file
admin/js/Jcrop/css/jquery.Jcrop.css ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Fixes issue here http://code.google.com/p/jcrop/issues/detail?id=1 */
2
+ .jcrop-holder { text-align: left; }
3
+
4
+ .jcrop-vline, .jcrop-hline
5
+ {
6
+ font-size: 0;
7
+ position: absolute;
8
+ background: white url('Jcrop.gif') top left repeat;
9
+ }
10
+ .jcrop-vline { height: 100%; width: 1px !important; }
11
+ .jcrop-hline { width: 100%; height: 1px !important; }
12
+ .jcrop-handle {
13
+ font-size: 1px;
14
+ width: 7px !important;
15
+ height: 7px !important;
16
+ border: 1px #eee solid;
17
+ background-color: #333;
18
+ *width: 9px;
19
+ *height: 9px;
20
+ }
21
+
22
+ .jcrop-tracker { width: 100%; height: 100%; }
23
+
24
+ .custom .jcrop-vline,
25
+ .custom .jcrop-hline
26
+ {
27
+ background: yellow;
28
+ }
29
+ .custom .jcrop-handle
30
+ {
31
+ border-color: black;
32
+ background-color: #C7BB00;
33
+ -moz-border-radius: 3px;
34
+ -webkit-border-radius: 3px;
35
+ }
admin/js/Jcrop/js/jquery.Jcrop.js ADDED
@@ -0,0 +1,1197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jquery.Jcrop.js v0.9.8
3
+ * jQuery Image Cropping Plugin
4
+ * @author Kelly Hallman <khallman@gmail.com>
5
+ * Copyright (c) 2008-2009 Kelly Hallman - released under MIT License {{{
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person
8
+ * obtaining a copy of this software and associated documentation
9
+ * files (the "Software"), to deal in the Software without
10
+ * restriction, including without limitation the rights to use,
11
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the
13
+ * Software is furnished to do so, subject to the following
14
+ * conditions:
15
+
16
+ * The above copyright notice and this permission notice shall be
17
+ * included in all copies or substantial portions of the Software.
18
+
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
21
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26
+ * OTHER DEALINGS IN THE SOFTWARE.
27
+
28
+ * }}}
29
+ */
30
+
31
+ (function($) {
32
+
33
+ $.Jcrop = function(obj,opt)
34
+ {
35
+ // Initialization {{{
36
+
37
+ // Sanitize some options {{{
38
+ var obj = obj, opt = opt;
39
+
40
+ if (typeof(obj) !== 'object') obj = $(obj)[0];
41
+ if (typeof(opt) !== 'object') opt = { };
42
+
43
+ // Some on-the-fly fixes for MSIE...sigh
44
+ if (!('trackDocument' in opt))
45
+ {
46
+ opt.trackDocument = $.browser.msie ? false : true;
47
+ if ($.browser.msie && $.browser.version.split('.')[0] == '8')
48
+ opt.trackDocument = true;
49
+ }
50
+
51
+ if (!('keySupport' in opt))
52
+ opt.keySupport = $.browser.msie ? false : true;
53
+
54
+ // }}}
55
+ // Extend the default options {{{
56
+ var defaults = {
57
+
58
+ // Basic Settings
59
+ trackDocument: false,
60
+ baseClass: 'jcrop',
61
+ addClass: null,
62
+
63
+ // Styling Options
64
+ bgColor: 'black',
65
+ bgOpacity: .6,
66
+ borderOpacity: .4,
67
+ handleOpacity: .5,
68
+
69
+ handlePad: 5,
70
+ handleSize: 9,
71
+ handleOffset: 5,
72
+ edgeMargin: 14,
73
+
74
+ aspectRatio: 0,
75
+ keySupport: true,
76
+ cornerHandles: true,
77
+ sideHandles: true,
78
+ drawBorders: true,
79
+ dragEdges: true,
80
+
81
+ boxWidth: 0,
82
+ boxHeight: 0,
83
+
84
+ boundary: 8,
85
+ animationDelay: 20,
86
+ swingSpeed: 3,
87
+
88
+ allowSelect: true,
89
+ allowMove: true,
90
+ allowResize: true,
91
+
92
+ minSelect: [ 0, 0 ],
93
+ maxSize: [ 0, 0 ],
94
+ minSize: [ 0, 0 ],
95
+
96
+ // Callbacks / Event Handlers
97
+ onChange: function() { },
98
+ onSelect: function() { }
99
+
100
+ };
101
+ var options = defaults;
102
+ setOptions(opt);
103
+
104
+ // }}}
105
+ // Initialize some jQuery objects {{{
106
+
107
+ var $origimg = $(obj);
108
+ var $img = $origimg.clone().removeAttr('id').css({ position: 'absolute' });
109
+
110
+ $img.width($origimg.width());
111
+ $img.height($origimg.height());
112
+ $origimg.after($img).hide();
113
+
114
+ presize($img,options.boxWidth,options.boxHeight);
115
+
116
+ var boundx = $img.width(),
117
+ boundy = $img.height(),
118
+
119
+ $div = $('<div />')
120
+ .width(boundx).height(boundy)
121
+ .addClass(cssClass('holder'))
122
+ .css({
123
+ position: 'relative',
124
+ backgroundColor: options.bgColor
125
+ }).insertAfter($origimg).append($img);
126
+ ;
127
+
128
+ if (options.addClass) $div.addClass(options.addClass);
129
+ //$img.wrap($div);
130
+
131
+ var $img2 = $('<img />')/*{{{*/
132
+ .attr('src',$img.attr('src'))
133
+ .css('position','absolute')
134
+ .width(boundx).height(boundy)
135
+ ;/*}}}*/
136
+ var $img_holder = $('<div />')/*{{{*/
137
+ .width(pct(100)).height(pct(100))
138
+ .css({
139
+ zIndex: 310,
140
+ position: 'absolute',
141
+ overflow: 'hidden'
142
+ })
143
+ .append($img2)
144
+ ;/*}}}*/
145
+ var $hdl_holder = $('<div />')/*{{{*/
146
+ .width(pct(100)).height(pct(100))
147
+ .css('zIndex',320);
148
+ /*}}}*/
149
+ var $sel = $('<div />')/*{{{*/
150
+ .css({
151
+ position: 'absolute',
152
+ zIndex: 300
153
+ })
154
+ .insertBefore($img)
155
+ .append($img_holder,$hdl_holder)
156
+ ;/*}}}*/
157
+
158
+ var bound = options.boundary;
159
+ var $trk = newTracker().width(boundx+(bound*2)).height(boundy+(bound*2))
160
+ .css({ position: 'absolute', top: px(-bound), left: px(-bound), zIndex: 290 })
161
+ .mousedown(newSelection);
162
+
163
+ /* }}} */
164
+ // Set more variables {{{
165
+
166
+ var xlimit, ylimit, xmin, ymin;
167
+ var xscale, yscale, enabled = true;
168
+ var docOffset = getPos($img),
169
+ // Internal states
170
+ btndown, lastcurs, dimmed, animating,
171
+ shift_down;
172
+
173
+ // }}}
174
+
175
+
176
+ // }}}
177
+ // Internal Modules {{{
178
+
179
+ var Coords = function()/*{{{*/
180
+ {
181
+ var x1 = 0, y1 = 0, x2 = 0, y2 = 0, ox, oy;
182
+
183
+ function setPressed(pos)/*{{{*/
184
+ {
185
+ var pos = rebound(pos);
186
+ x2 = x1 = pos[0];
187
+ y2 = y1 = pos[1];
188
+ };
189
+ /*}}}*/
190
+ function setCurrent(pos)/*{{{*/
191
+ {
192
+ var pos = rebound(pos);
193
+ ox = pos[0] - x2;
194
+ oy = pos[1] - y2;
195
+ x2 = pos[0];
196
+ y2 = pos[1];
197
+ };
198
+ /*}}}*/
199
+ function getOffset()/*{{{*/
200
+ {
201
+ return [ ox, oy ];
202
+ };
203
+ /*}}}*/
204
+ function moveOffset(offset)/*{{{*/
205
+ {
206
+ var ox = offset[0], oy = offset[1];
207
+
208
+ if (0 > x1 + ox) ox -= ox + x1;
209
+ if (0 > y1 + oy) oy -= oy + y1;
210
+
211
+ if (boundy < y2 + oy) oy += boundy - (y2 + oy);
212
+ if (boundx < x2 + ox) ox += boundx - (x2 + ox);
213
+
214
+ x1 += ox;
215
+ x2 += ox;
216
+ y1 += oy;
217
+ y2 += oy;
218
+ };
219
+ /*}}}*/
220
+ function getCorner(ord)/*{{{*/
221
+ {
222
+ var c = getFixed();
223
+ switch(ord)
224
+ {
225
+ case 'ne': return [ c.x2, c.y ];
226
+ case 'nw': return [ c.x, c.y ];
227
+ case 'se': return [ c.x2, c.y2 ];
228
+ case 'sw': return [ c.x, c.y2 ];
229
+ }
230
+ };
231
+ /*}}}*/
232
+ function getFixed()/*{{{*/
233
+ {
234
+ if (!options.aspectRatio) return getRect();
235
+ // This function could use some optimization I think...
236
+ var aspect = options.aspectRatio,
237
+ min_x = options.minSize[0]/xscale,
238
+ min_y = options.minSize[1]/yscale,
239
+ max_x = options.maxSize[0]/xscale,
240
+ max_y = options.maxSize[1]/yscale,
241
+ rw = x2 - x1,
242
+ rh = y2 - y1,
243
+ rwa = Math.abs(rw),
244
+ rha = Math.abs(rh),
245
+ real_ratio = rwa / rha,
246
+ xx, yy
247
+ ;
248
+ if (max_x == 0) { max_x = boundx * 10 }
249
+ if (max_y == 0) { max_y = boundy * 10 }
250
+ if (real_ratio < aspect)
251
+ {
252
+ yy = y2;
253
+ w = rha * aspect;
254
+ xx = rw < 0 ? x1 - w : w + x1;
255
+
256
+ if (xx < 0)
257
+ {
258
+ xx = 0;
259
+ h = Math.abs((xx - x1) / aspect);
260
+ yy = rh < 0 ? y1 - h: h + y1;
261
+ }
262
+ else if (xx > boundx)
263
+ {
264
+ xx = boundx;
265
+ h = Math.abs((xx - x1) / aspect);
266
+ yy = rh < 0 ? y1 - h : h + y1;
267
+ }
268
+ }
269
+ else
270
+ {
271
+ xx = x2;
272
+ h = rwa / aspect;
273
+ yy = rh < 0 ? y1 - h : y1 + h;
274
+ if (yy < 0)
275
+ {
276
+ yy = 0;
277
+ w = Math.abs((yy - y1) * aspect);
278
+ xx = rw < 0 ? x1 - w : w + x1;
279
+ }
280
+ else if (yy > boundy)
281
+ {
282
+ yy = boundy;
283
+ w = Math.abs(yy - y1) * aspect;
284
+ xx = rw < 0 ? x1 - w : w + x1;
285
+ }
286
+ }
287
+
288
+ // Magic %-)
289
+ if(xx > x1) { // right side
290
+ if(xx - x1 < min_x) {
291
+ xx = x1 + min_x;
292
+ } else if (xx - x1 > max_x) {
293
+ xx = x1 + max_x;
294
+ }
295
+ if(yy > y1) {
296
+ yy = y1 + (xx - x1)/aspect;
297
+ } else {
298
+ yy = y1 - (xx - x1)/aspect;
299
+ }
300
+ } else if (xx < x1) { // left side
301
+ if(x1 - xx < min_x) {
302
+ xx = x1 - min_x
303
+ } else if (x1 - xx > max_x) {
304
+ xx = x1 - max_x;
305
+ }
306
+ if(yy > y1) {
307
+ yy = y1 + (x1 - xx)/aspect;
308
+ } else {
309
+ yy = y1 - (x1 - xx)/aspect;
310
+ }
311
+ }
312
+
313
+ if(xx < 0) {
314
+ x1 -= xx;
315
+ xx = 0;
316
+ } else if (xx > boundx) {
317
+ x1 -= xx - boundx;
318
+ xx = boundx;
319
+ }
320
+
321
+ if(yy < 0) {
322
+ y1 -= yy;
323
+ yy = 0;
324
+ } else if (yy > boundy) {
325
+ y1 -= yy - boundy;
326
+ yy = boundy;
327
+ }
328
+
329
+ return last = makeObj(flipCoords(x1,y1,xx,yy));
330
+ };
331
+ /*}}}*/
332
+ function rebound(p)/*{{{*/
333
+ {
334
+ if (p[0] < 0) p[0] = 0;
335
+ if (p[1] < 0) p[1] = 0;
336
+
337
+ if (p[0] > boundx) p[0] = boundx;
338
+ if (p[1] > boundy) p[1] = boundy;
339
+
340
+ return [ p[0], p[1] ];
341
+ };
342
+ /*}}}*/
343
+ function flipCoords(x1,y1,x2,y2)/*{{{*/
344
+ {
345
+ var xa = x1, xb = x2, ya = y1, yb = y2;
346
+ if (x2 < x1)
347
+ {
348
+ xa = x2;
349
+ xb = x1;
350
+ }
351
+ if (y2 < y1)
352
+ {
353
+ ya = y2;
354
+ yb = y1;
355
+ }
356
+ return [ Math.round(xa), Math.round(ya), Math.round(xb), Math.round(yb) ];
357
+ };
358
+ /*}}}*/
359
+ function getRect()/*{{{*/
360
+ {
361
+ var xsize = x2 - x1;
362
+ var ysize = y2 - y1;
363
+
364
+ if (xlimit && (Math.abs(xsize) > xlimit))
365
+ x2 = (xsize > 0) ? (x1 + xlimit) : (x1 - xlimit);
366
+ if (ylimit && (Math.abs(ysize) > ylimit))
367
+ y2 = (ysize > 0) ? (y1 + ylimit) : (y1 - ylimit);
368
+
369
+ if (ymin && (Math.abs(ysize) < ymin))
370
+ y2 = (ysize > 0) ? (y1 + ymin) : (y1 - ymin);
371
+ if (xmin && (Math.abs(xsize) < xmin))
372
+ x2 = (xsize > 0) ? (x1 + xmin) : (x1 - xmin);
373
+
374
+ if (x1 < 0) { x2 -= x1; x1 -= x1; }
375
+ if (y1 < 0) { y2 -= y1; y1 -= y1; }
376
+ if (x2 < 0) { x1 -= x2; x2 -= x2; }
377
+ if (y2 < 0) { y1 -= y2; y2 -= y2; }
378
+ if (x2 > boundx) { var delta = x2 - boundx; x1 -= delta; x2 -= delta; }
379
+ if (y2 > boundy) { var delta = y2 - boundy; y1 -= delta; y2 -= delta; }
380
+ if (x1 > boundx) { var delta = x1 - boundy; y2 -= delta; y1 -= delta; }
381
+ if (y1 > boundy) { var delta = y1 - boundy; y2 -= delta; y1 -= delta; }
382
+
383
+ return makeObj(flipCoords(x1,y1,x2,y2));
384
+ };
385
+ /*}}}*/
386
+ function makeObj(a)/*{{{*/
387
+ {
388
+ return { x: a[0], y: a[1], x2: a[2], y2: a[3],
389
+ w: a[2] - a[0], h: a[3] - a[1] };
390
+ };
391
+ /*}}}*/
392
+
393
+ return {
394
+ flipCoords: flipCoords,
395
+ setPressed: setPressed,
396
+ setCurrent: setCurrent,
397
+ getOffset: getOffset,
398
+ moveOffset: moveOffset,
399
+ getCorner: getCorner,
400
+ getFixed: getFixed
401
+ };
402
+ }();
403
+
404
+ /*}}}*/
405
+ var Selection = function()/*{{{*/
406
+ {
407
+ var start, end, dragmode, awake, hdep = 370;
408
+ var borders = { };
409
+ var handle = { };
410
+ var seehandles = false;
411
+ var hhs = options.handleOffset;
412
+
413
+ /* Insert draggable elements {{{*/
414
+
415
+ // Insert border divs for outline
416
+ if (options.drawBorders) {
417
+ borders = {
418
+ top: insertBorder('hline')
419
+ .css('top',$.browser.msie?px(-1):px(0)),
420
+ bottom: insertBorder('hline'),
421
+ left: insertBorder('vline'),
422
+ right: insertBorder('vline')
423
+ };
424
+ }
425
+
426
+ // Insert handles on edges
427
+ if (options.dragEdges) {
428
+ handle.t = insertDragbar('n');
429
+ handle.b = insertDragbar('s');
430
+ handle.r = insertDragbar('e');
431
+ handle.l = insertDragbar('w');
432
+ }
433
+
434
+ // Insert side handles
435
+ options.sideHandles &&
436
+ createHandles(['n','s','e','w']);
437
+
438
+ // Insert corner handles
439
+ options.cornerHandles &&
440
+ createHandles(['sw','nw','ne','se']);
441
+
442
+ /*}}}*/
443
+ // Private Methods
444
+ function insertBorder(type)/*{{{*/
445
+ {
446
+ var jq = $('<div />')
447
+ .css({position: 'absolute', opacity: options.borderOpacity })
448
+ .addClass(cssClass(type));
449
+ $img_holder.append(jq);
450
+ return jq;
451
+ };
452
+ /*}}}*/
453
+ function dragDiv(ord,zi)/*{{{*/
454
+ {
455
+ var jq = $('<div />')
456
+ .mousedown(createDragger(ord))
457
+ .css({
458
+ cursor: ord+'-resize',
459
+ position: 'absolute',
460
+ zIndex: zi
461
+ })
462
+ ;
463
+ $hdl_holder.append(jq);
464
+ return jq;
465
+ };
466
+ /*}}}*/
467
+ function insertHandle(ord)/*{{{*/
468
+ {
469
+ return dragDiv(ord,hdep++)
470
+ .css({ top: px(-hhs+1), left: px(-hhs+1), opacity: options.handleOpacity })
471
+ .addClass(cssClass('handle'));
472
+ };
473
+ /*}}}*/
474
+ function insertDragbar(ord)/*{{{*/
475
+ {
476
+ var s = options.handleSize,
477
+ o = hhs,
478
+ h = s, w = s,
479
+ t = o, l = o;
480
+
481
+ switch(ord)
482
+ {
483
+ case 'n': case 's': w = pct(100); break;
484
+ case 'e': case 'w': h = pct(100); break;
485
+ }
486
+
487
+ return dragDiv(ord,hdep++).width(w).height(h)
488
+ .css({ top: px(-t+1), left: px(-l+1)});
489
+ };
490
+ /*}}}*/
491
+ function createHandles(li)/*{{{*/
492
+ {
493
+ for(i in li) handle[li[i]] = insertHandle(li[i]);
494
+ };
495
+ /*}}}*/
496
+ function moveHandles(c)/*{{{*/
497
+ {
498
+ var midvert = Math.round((c.h / 2) - hhs),
499
+ midhoriz = Math.round((c.w / 2) - hhs),
500
+ north = west = -hhs+1,
501
+ east = c.w - hhs,
502
+ south = c.h - hhs,
503
+ x, y;
504
+
505
+ 'e' in handle &&
506
+ handle.e.css({ top: px(midvert), left: px(east) }) &&
507
+ handle.w.css({ top: px(midvert) }) &&
508
+ handle.s.css({ top: px(south), left: px(midhoriz) }) &&
509
+ handle.n.css({ left: px(midhoriz) });
510
+
511
+ 'ne' in handle &&
512
+ handle.ne.css({ left: px(east) }) &&
513
+ handle.se.css({ top: px(south), left: px(east) }) &&
514
+ handle.sw.css({ top: px(south) });
515
+
516
+ 'b' in handle &&
517
+ handle.b.css({ top: px(south) }) &&
518
+ handle.r.css({ left: px(east) });
519
+ };
520
+ /*}}}*/
521
+ function moveto(x,y)/*{{{*/
522
+ {
523
+ $img2.css({ top: px(-y), left: px(-x) });
524
+ $sel.css({ top: px(y), left: px(x) });
525
+ };
526
+ /*}}}*/
527
+ function resize(w,h)/*{{{*/
528
+ {
529
+ $sel.width(w).height(h);
530
+ };
531
+ /*}}}*/
532
+ function refresh()/*{{{*/
533
+ {
534
+ var c = Coords.getFixed();
535
+
536
+ Coords.setPressed([c.x,c.y]);
537
+ Coords.setCurrent([c.x2,c.y2]);
538
+
539
+ updateVisible();
540
+ };
541
+ /*}}}*/
542
+
543
+ // Internal Methods
544
+ function updateVisible()/*{{{*/
545
+ { if (awake) return update(); };
546
+ /*}}}*/
547
+ function update()/*{{{*/
548
+ {
549
+ var c = Coords.getFixed();
550
+
551
+ resize(c.w,c.h);
552
+ moveto(c.x,c.y);
553
+
554
+ options.drawBorders &&
555
+ borders['right'].css({ left: px(c.w-1) }) &&
556
+ borders['bottom'].css({ top: px(c.h-1) });
557
+
558
+ seehandles && moveHandles(c);
559
+ awake || show();
560
+
561
+ options.onChange(unscale(c));
562
+ };
563
+ /*}}}*/
564
+ function show()/*{{{*/
565
+ {
566
+ $sel.show();
567
+ $img.css('opacity',options.bgOpacity);
568
+ awake = true;
569
+ };
570
+ /*}}}*/
571
+ function release()/*{{{*/
572
+ {
573
+ disableHandles();
574
+ $sel.hide();
575
+ $img.css('opacity',1);
576
+ awake = false;
577
+ };
578
+ /*}}}*/
579
+ function showHandles()//{{{
580
+ {
581
+ if (seehandles)
582
+ {
583
+ moveHandles(Coords.getFixed());
584
+ $hdl_holder.show();
585
+ }
586
+ };
587
+ //}}}
588
+ function enableHandles()/*{{{*/
589
+ {
590
+ seehandles = true;
591
+ if (options.allowResize)
592
+ {
593
+ moveHandles(Coords.getFixed());
594
+ $hdl_holder.show();
595
+ return true;
596
+ }
597
+ };
598
+ /*}}}*/
599
+ function disableHandles()/*{{{*/
600
+ {
601
+ seehandles = false;
602
+ $hdl_holder.hide();
603
+ };
604
+ /*}}}*/
605
+ function animMode(v)/*{{{*/
606
+ {
607
+ (animating = v) ? disableHandles(): enableHandles();
608
+ };
609
+ /*}}}*/
610
+ function done()/*{{{*/
611
+ {
612
+ animMode(false);
613
+ refresh();
614
+ };
615
+ /*}}}*/
616
+
617
+ var $track = newTracker().mousedown(createDragger('move'))
618
+ .css({ cursor: 'move', position: 'absolute', zIndex: 360 })
619
+
620
+ $img_holder.append($track);
621
+ disableHandles();
622
+
623
+ return {
624
+ updateVisible: updateVisible,
625
+ update: update,
626
+ release: release,
627
+ refresh: refresh,
628
+ setCursor: function (cursor) { $track.css('cursor',cursor); },
629
+ enableHandles: enableHandles,
630
+ enableOnly: function() { seehandles = true; },
631
+ showHandles: showHandles,
632
+ disableHandles: disableHandles,
633
+ animMode: animMode,
634
+ done: done
635
+ };
636
+ }();
637
+ /*}}}*/
638
+ var Tracker = function()/*{{{*/
639
+ {
640
+ var onMove = function() { },
641
+ onDone = function() { },
642
+ trackDoc = options.trackDocument;
643
+
644
+ if (!trackDoc)
645
+ {
646
+ $trk
647
+ .mousemove(trackMove)
648
+ .mouseup(trackUp)
649
+ .mouseout(trackUp)
650
+ ;
651
+ }
652
+
653
+ function toFront()/*{{{*/
654
+ {
655
+ $trk.css({zIndex:450});
656
+ if (trackDoc)
657
+ {
658
+ $(document)
659
+ .mousemove(trackMove)
660
+ .mouseup(trackUp)
661
+ ;
662
+ }
663
+ }
664
+ /*}}}*/
665
+ function toBack()/*{{{*/
666
+ {
667
+ $trk.css({zIndex:290});
668
+ if (trackDoc)
669
+ {
670
+ $(document)
671
+ .unbind('mousemove',trackMove)
672
+ .unbind('mouseup',trackUp)
673
+ ;
674
+ }
675
+ }
676
+ /*}}}*/
677
+ function trackMove(e)/*{{{*/
678
+ {
679
+ onMove(mouseAbs(e));
680
+ };
681
+ /*}}}*/
682
+ function trackUp(e)/*{{{*/
683
+ {
684
+ e.preventDefault();
685
+ e.stopPropagation();
686
+
687
+ if (btndown)
688
+ {
689
+ btndown = false;
690
+
691
+ onDone(mouseAbs(e));
692
+ options.onSelect(unscale(Coords.getFixed()));
693
+ toBack();
694
+ onMove = function() { };
695
+ onDone = function() { };
696
+ }
697
+
698
+ return false;
699
+ };
700
+ /*}}}*/
701
+
702
+ function activateHandlers(move,done)/* {{{ */
703
+ {
704
+ btndown = true;
705
+ onMove = move;
706
+ onDone = done;
707
+ toFront();
708
+ return false;
709
+ };
710
+ /* }}} */
711
+
712
+ function setCursor(t) { $trk.css('cursor',t); };
713
+
714
+ $img.before($trk);
715
+ return {
716
+ activateHandlers: activateHandlers,
717
+ setCursor: setCursor
718
+ };
719
+ }();
720
+ /*}}}*/
721
+ var KeyManager = function()/*{{{*/
722
+ {
723
+ var $keymgr = $('<input type="radio" />')
724
+ .css({ position: 'absolute', left: '-30px' })
725
+ .keypress(parseKey)
726
+ .blur(onBlur),
727
+
728
+ $keywrap = $('<div />')
729
+ .css({
730
+ position: 'absolute',
731
+ overflow: 'hidden'
732
+ })
733
+ .append($keymgr)
734
+ ;
735
+
736
+ function watchKeys()/*{{{*/
737
+ {
738
+ if (options.keySupport)
739
+ {
740
+ $keymgr.show();
741
+ $keymgr.focus();
742
+ }
743
+ };
744
+ /*}}}*/
745
+ function onBlur(e)/*{{{*/
746
+ {
747
+ $keymgr.hide();
748
+ };
749
+ /*}}}*/
750
+ function doNudge(e,x,y)/*{{{*/
751
+ {
752
+ if (options.allowMove) {
753
+ Coords.moveOffset([x,y]);
754
+ Selection.updateVisible();
755
+ };
756
+ e.preventDefault();
757
+ e.stopPropagation();
758
+ };
759
+ /*}}}*/
760
+ function parseKey(e)/*{{{*/
761
+ {
762
+ if (e.ctrlKey) return true;
763
+ shift_down = e.shiftKey ? true : false;
764
+ var nudge = shift_down ? 10 : 1;
765
+ switch(e.keyCode)
766
+ {
767
+ case 37: doNudge(e,-nudge,0); break;
768
+ case 39: doNudge(e,nudge,0); break;
769
+ case 38: doNudge(e,0,-nudge); break;
770
+ case 40: doNudge(e,0,nudge); break;
771
+
772
+ case 27: Selection.release(); break;
773
+
774
+ case 9: return true;
775
+ }
776
+
777
+ return nothing(e);
778
+ };
779
+ /*}}}*/
780
+
781
+ if (options.keySupport) $keywrap.insertBefore($img);
782
+ return {
783
+ watchKeys: watchKeys
784
+ };
785
+ }();
786
+ /*}}}*/
787
+
788
+ // }}}
789
+ // Internal Methods {{{
790
+
791
+ function px(n) { return '' + parseInt(n) + 'px'; };
792
+ function pct(n) { return '' + parseInt(n) + '%'; };
793
+ function cssClass(cl) { return options.baseClass + '-' + cl; };
794
+ function getPos(obj)/*{{{*/
795
+ {
796
+ // Updated in v0.9.4 to use built-in dimensions plugin
797
+ var pos = $(obj).offset();
798
+ return [ pos.left, pos.top ];
799
+ };
800
+ /*}}}*/
801
+ function mouseAbs(e)/*{{{*/
802
+ {
803
+ return [ (e.pageX - docOffset[0]), (e.pageY - docOffset[1]) ];
804
+ };
805
+ /*}}}*/
806
+ function myCursor(type)/*{{{*/
807
+ {
808
+ if (type != lastcurs)
809
+ {
810
+ Tracker.setCursor(type);
811
+ //Handles.xsetCursor(type);
812
+ lastcurs = type;
813
+ }
814
+ };
815
+ /*}}}*/
816
+ function startDragMode(mode,pos)/*{{{*/
817
+ {
818
+ docOffset = getPos($img);
819
+ Tracker.setCursor(mode=='move'?mode:mode+'-resize');
820
+
821
+ if (mode == 'move')
822
+ return Tracker.activateHandlers(createMover(pos), doneSelect);
823
+
824
+ var fc = Coords.getFixed();
825
+ var opp = oppLockCorner(mode);
826
+ var opc = Coords.getCorner(oppLockCorner(opp));
827
+
828
+ Coords.setPressed(Coords.getCorner(opp));
829
+ Coords.setCurrent(opc);
830
+
831
+ Tracker.activateHandlers(dragmodeHandler(mode,fc),doneSelect);
832
+ };
833
+ /*}}}*/
834
+ function dragmodeHandler(mode,f)/*{{{*/
835
+ {
836
+ return function(pos) {
837
+ if (!options.aspectRatio) switch(mode)
838
+ {
839
+ case 'e': pos[1] = f.y2; break;
840
+ case 'w': pos[1] = f.y2; break;
841
+ case 'n': pos[0] = f.x2; break;
842
+ case 's': pos[0] = f.x2; break;
843
+ }
844
+ else switch(mode)
845
+ {
846
+ case 'e': pos[1] = f.y+1; break;
847
+ case 'w': pos[1] = f.y+1; break;
848
+ case 'n': pos[0] = f.x+1; break;
849
+ case 's': pos[0] = f.x+1; break;
850
+ }
851
+ Coords.setCurrent(pos);
852
+ Selection.update();
853
+ };
854
+ };
855
+ /*}}}*/
856
+ function createMover(pos)/*{{{*/
857
+ {
858
+ var lloc = pos;
859
+ KeyManager.watchKeys();
860
+
861
+ return function(pos)
862
+ {
863
+ Coords.moveOffset([pos[0] - lloc[0], pos[1] - lloc[1]]);
864
+ lloc = pos;
865
+
866
+ Selection.update();
867
+ };
868
+ };
869
+ /*}}}*/
870
+ function oppLockCorner(ord)/*{{{*/
871
+ {
872
+ switch(ord)
873
+ {
874
+ case 'n': return 'sw';
875
+ case 's': return 'nw';
876
+ case 'e': return 'nw';
877
+ case 'w': return 'ne';
878
+ case 'ne': return 'sw';
879
+ case 'nw': return 'se';
880
+ case 'se': return 'nw';
881
+ case 'sw': return 'ne';
882
+ };
883
+ };
884
+ /*}}}*/
885
+ function createDragger(ord)/*{{{*/
886
+ {
887
+ return function(e) {
888
+ if (options.disabled) return false;
889
+ if ((ord == 'move') && !options.allowMove) return false;
890
+ btndown = true;
891
+ startDragMode(ord,mouseAbs(e));
892
+ e.stopPropagation();
893
+ e.preventDefault();
894
+ return false;
895
+ };
896
+ };
897
+ /*}}}*/
898
+ function presize($obj,w,h)/*{{{*/
899
+ {
900
+ var nw = $obj.width(), nh = $obj.height();
901
+ if ((nw > w) && w > 0)
902
+ {
903
+ nw = w;
904
+ nh = (w/$obj.width()) * $obj.height();
905
+ }
906
+ if ((nh > h) && h > 0)
907
+ {
908
+ nh = h;
909
+ nw = (h/$obj.height()) * $obj.width();
910
+ }
911
+ xscale = $obj.width() / nw;
912
+ yscale = $obj.height() / nh;
913
+ $obj.width(nw).height(nh);
914
+ };
915
+ /*}}}*/
916
+ function unscale(c)/*{{{*/
917
+ {
918
+ return {
919
+ x: parseInt(c.x * xscale), y: parseInt(c.y * yscale),
920
+ x2: parseInt(c.x2 * xscale), y2: parseInt(c.y2 * yscale),
921
+ w: parseInt(c.w * xscale), h: parseInt(c.h * yscale)
922
+ };
923
+ };
924
+ /*}}}*/
925
+ function doneSelect(pos)/*{{{*/
926
+ {
927
+ var c = Coords.getFixed();
928
+ if (c.w > options.minSelect[0] && c.h > options.minSelect[1])
929
+ {
930
+ Selection.enableHandles();
931
+ Selection.done();
932
+ }
933
+ else
934
+ {
935
+ Selection.release();
936
+ }
937
+ Tracker.setCursor( options.allowSelect?'crosshair':'default' );
938
+ };
939
+ /*}}}*/
940
+ function newSelection(e)/*{{{*/
941
+ {
942
+ if (options.disabled) return false;
943
+ if (!options.allowSelect) return false;
944
+ btndown = true;
945
+ docOffset = getPos($img);
946
+ Selection.disableHandles();
947
+ myCursor('crosshair');
948
+ var pos = mouseAbs(e);
949
+ Coords.setPressed(pos);
950
+ Tracker.activateHandlers(selectDrag,doneSelect);
951
+ KeyManager.watchKeys();
952
+ Selection.update();
953
+
954
+ e.stopPropagation();
955
+ e.preventDefault();
956
+ return false;
957
+ };
958
+ /*}}}*/
959
+ function selectDrag(pos)/*{{{*/
960
+ {
961
+ Coords.setCurrent(pos);
962
+ Selection.update();
963
+ };
964
+ /*}}}*/
965
+ function newTracker()
966
+ {
967
+ var trk = $('<div></div>').addClass(cssClass('tracker'));
968
+ $.browser.msie && trk.css({ opacity: 0, backgroundColor: 'white' });
969
+ return trk;
970
+ };
971
+
972
+ // }}}
973
+ // API methods {{{
974
+
975
+ function animateTo(a)/*{{{*/
976
+ {
977
+ var x1 = a[0] / xscale,
978
+ y1 = a[1] / yscale,
979
+ x2 = a[2] / xscale,
980
+ y2 = a[3] / yscale;
981
+
982
+ if (animating) return;
983
+
984
+ var animto = Coords.flipCoords(x1,y1,x2,y2);
985
+ var c = Coords.getFixed();
986
+ var animat = initcr = [ c.x, c.y, c.x2, c.y2 ];
987
+ var interv = options.animationDelay;
988
+
989
+ var x = animat[0];
990
+ var y = animat[1];
991
+ var x2 = animat[2];
992
+ var y2 = animat[3];
993
+ var ix1 = animto[0] - initcr[0];
994
+ var iy1 = animto[1] - initcr[1];
995
+ var ix2 = animto[2] - initcr[2];
996
+ var iy2 = animto[3] - initcr[3];
997
+ var pcent = 0;
998
+ var velocity = options.swingSpeed;
999
+
1000
+ Selection.animMode(true);
1001
+
1002
+ var animator = function()
1003
+ {
1004
+ return function()
1005
+ {
1006
+ pcent += (100 - pcent) / velocity;
1007
+
1008
+ animat[0] = x + ((pcent / 100) * ix1);
1009
+ animat[1] = y + ((pcent / 100) * iy1);
1010
+ animat[2] = x2 + ((pcent / 100) * ix2);
1011
+ animat[3] = y2 + ((pcent / 100) * iy2);
1012
+
1013
+ if (pcent < 100) animateStart();
1014
+ else Selection.done();
1015
+
1016
+ if (pcent >= 99.8) pcent = 100;
1017
+
1018
+ setSelectRaw(animat);
1019
+ };
1020
+ }();
1021
+
1022
+ function animateStart()
1023
+ { window.setTimeout(animator,interv); };
1024
+
1025
+ animateStart();
1026
+ };
1027
+ /*}}}*/
1028
+ function setSelect(rect)//{{{
1029
+ {
1030
+ setSelectRaw([rect[0]/xscale,rect[1]/yscale,rect[2]/xscale,rect[3]/yscale]);
1031
+ };
1032
+ //}}}
1033
+ function setSelectRaw(l) /*{{{*/
1034
+ {
1035
+ Coords.setPressed([l[0],l[1]]);
1036
+ Coords.setCurrent([l[2],l[3]]);
1037
+ Selection.update();
1038
+ };
1039
+ /*}}}*/
1040
+ function setOptions(opt)/*{{{*/
1041
+ {
1042
+ if (typeof(opt) != 'object') opt = { };
1043
+ options = $.extend(options,opt);
1044
+
1045
+ if (typeof(options.onChange)!=='function')
1046
+ options.onChange = function() { };
1047
+
1048
+ if (typeof(options.onSelect)!=='function')
1049
+ options.onSelect = function() { };
1050
+
1051
+ };
1052
+ /*}}}*/
1053
+ function tellSelect()/*{{{*/
1054
+ {
1055
+ return unscale(Coords.getFixed());
1056
+ };
1057
+ /*}}}*/
1058
+ function tellScaled()/*{{{*/
1059
+ {
1060
+ return Coords.getFixed();
1061
+ };
1062
+ /*}}}*/
1063
+ function setOptionsNew(opt)/*{{{*/
1064
+ {
1065
+ setOptions(opt);
1066
+ interfaceUpdate();
1067
+ };
1068
+ /*}}}*/
1069
+ function disableCrop()//{{{
1070
+ {
1071
+ options.disabled = true;
1072
+ Selection.disableHandles();
1073
+ Selection.setCursor('default');
1074
+ Tracker.setCursor('default');
1075
+ };
1076
+ //}}}
1077
+ function enableCrop()//{{{
1078
+ {
1079
+ options.disabled = false;
1080
+ interfaceUpdate();
1081
+ };
1082
+ //}}}
1083
+ function cancelCrop()//{{{
1084
+ {
1085
+ Selection.done();
1086
+ Tracker.activateHandlers(null,null);
1087
+ };
1088
+ //}}}
1089
+ function destroy()//{{{
1090
+ {
1091
+ $div.remove();
1092
+ $origimg.show();
1093
+ };
1094
+ //}}}
1095
+
1096
+ function interfaceUpdate(alt)//{{{
1097
+ // This method tweaks the interface based on options object.
1098
+ // Called when options are changed and at end of initialization.
1099
+ {
1100
+ options.allowResize ?
1101
+ alt?Selection.enableOnly():Selection.enableHandles():
1102
+ Selection.disableHandles();
1103
+
1104
+ Tracker.setCursor( options.allowSelect? 'crosshair': 'default' );
1105
+ Selection.setCursor( options.allowMove? 'move': 'default' );
1106
+
1107
+ $div.css('backgroundColor',options.bgColor);
1108
+
1109
+ if ('setSelect' in options) {
1110
+ setSelect(opt.setSelect);
1111
+ Selection.done();
1112
+ delete(options.setSelect);
1113
+ }
1114
+
1115
+ if ('trueSize' in options) {
1116
+ xscale = options.trueSize[0] / boundx;
1117
+ yscale = options.trueSize[1] / boundy;
1118
+ }
1119
+
1120
+ xlimit = options.maxSize[0] || 0;
1121
+ ylimit = options.maxSize[1] || 0;
1122
+ xmin = options.minSize[0] || 0;
1123
+ ymin = options.minSize[1] || 0;
1124
+
1125
+ if ('outerImage' in options)
1126
+ {
1127
+ $img.attr('src',options.outerImage);
1128
+ delete(options.outerImage);
1129
+ }
1130
+
1131
+ Selection.refresh();
1132
+ };
1133
+ //}}}
1134
+
1135
+ // }}}
1136
+
1137
+ $hdl_holder.hide();
1138
+ interfaceUpdate(true);
1139
+
1140
+ var api = {
1141
+ animateTo: animateTo,
1142
+ setSelect: setSelect,
1143
+ setOptions: setOptionsNew,
1144
+ tellSelect: tellSelect,
1145
+ tellScaled: tellScaled,
1146
+
1147
+ disable: disableCrop,
1148
+ enable: enableCrop,
1149
+ cancel: cancelCrop,
1150
+
1151
+ focus: KeyManager.watchKeys,
1152
+
1153
+ getBounds: function() { return [ boundx * xscale, boundy * yscale ]; },
1154
+ getWidgetSize: function() { return [ boundx, boundy ]; },
1155
+
1156
+ release: Selection.release,
1157
+ destroy: destroy
1158
+
1159
+ };
1160
+
1161
+ $origimg.data('Jcrop',api);
1162
+ return api;
1163
+ };
1164
+
1165
+ $.fn.Jcrop = function(options)/*{{{*/
1166
+ {
1167
+ function attachWhenDone(from)/*{{{*/
1168
+ {
1169
+ var loadsrc = options.useImg || from.src;
1170
+ var img = new Image();
1171
+ img.onload = function() { $.Jcrop(from,options); };
1172
+ img.src = loadsrc;
1173
+ };
1174
+ /*}}}*/
1175
+ if (typeof(options) !== 'object') options = { };
1176
+
1177
+ // Iterate over each object, attach Jcrop
1178
+ this.each(function()
1179
+ {
1180
+ // If we've already attached to this object
1181
+ if ($(this).data('Jcrop'))
1182
+ {
1183
+ // The API can be requested this way (undocumented)
1184
+ if (options == 'api') return $(this).data('Jcrop');
1185
+ // Otherwise, we just reset the options...
1186
+ else $(this).data('Jcrop').setOptions(options);
1187
+ }
1188
+ // If we haven't been attached, preload and attach
1189
+ else attachWhenDone(this);
1190
+ });
1191
+
1192
+ // Return "this" so we're chainable a la jQuery plugin-style!
1193
+ return this;
1194
+ };
1195
+ /*}}}*/
1196
+
1197
+ })(jQuery);
admin/js/colorpicker/css/colorpicker.css ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .colorpicker {
2
+ width: 356px;
3
+ height: 176px;
4
+ overflow: hidden;
5
+ position: absolute;
6
+ background: url(../images/colorpicker_background.png);
7
+ font-family: Arial, Helvetica, sans-serif;
8
+ display: none;
9
+ }
10
+ .colorpicker_color {
11
+ width: 150px;
12
+ height: 150px;
13
+ left: 14px;
14
+ top: 13px;
15
+ position: absolute;
16
+ background: #f00;
17
+ overflow: hidden;
18
+ cursor: crosshair;
19
+ }
20
+ .colorpicker_color div {
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ width: 150px;
25
+ height: 150px;
26
+ background: url(../images/colorpicker_overlay.png);
27
+ }
28
+ .colorpicker_color div div {
29
+ position: absolute;
30
+ top: 0;
31
+ left: 0;
32
+ width: 11px;
33
+ height: 11px;
34
+ overflow: hidden;
35
+ background: url(../images/colorpicker_select.gif);
36
+ margin: -5px 0 0 -5px;
37
+ }
38
+ .colorpicker_hue {
39
+ position: absolute;
40
+ top: 13px;
41
+ left: 171px;
42
+ width: 35px;
43
+ height: 150px;
44
+ cursor: n-resize;
45
+ }
46
+ .colorpicker_hue div {
47
+ position: absolute;
48
+ width: 35px;
49
+ height: 9px;
50
+ overflow: hidden;
51
+ background: url(../images/colorpicker_indic.gif) left top;
52
+ margin: -4px 0 0 0;
53
+ left: 0px;
54
+ }
55
+ .colorpicker_new_color {
56
+ position: absolute;
57
+ width: 60px;
58
+ height: 30px;
59
+ left: 213px;
60
+ top: 13px;
61
+ background: #f00;
62
+ }
63
+ .colorpicker_current_color {
64
+ position: absolute;
65
+ width: 60px;
66
+ height: 30px;
67
+ left: 283px;
68
+ top: 13px;
69
+ background: #f00;
70
+ }
71
+ .colorpicker input {
72
+ background-color: transparent;
73
+ border: 1px solid transparent;
74
+ position: absolute;
75
+ font-size: 10px;
76
+ font-family: Arial, Helvetica, sans-serif;
77
+ color: #898989;
78
+ top: 4px;
79
+ right: 11px;
80
+ text-align: right;
81
+ margin: 0;
82
+ padding: 0;
83
+ height: 13px;
84
+ }
85
+ .colorpicker_hex {
86
+ position: absolute;
87
+ width: 72px;
88
+ height: 22px;
89
+ background: url(../images/colorpicker_hex.png) top;
90
+ left: 212px;
91
+ top: 142px;
92
+ }
93
+ .colorpicker_hex input {
94
+ right: 6px;
95
+ }
96
+ .colorpicker_field {
97
+ height: 22px;
98
+ width: 62px;
99
+ background-position: top;
100
+ position: absolute;
101
+ }
102
+ .colorpicker_field span {
103
+ position: absolute;
104
+ width: 12px;
105
+ height: 22px;
106
+ overflow: hidden;
107
+ top: 0;
108
+ right: 0;
109
+ cursor: n-resize;
110
+ }
111
+ .colorpicker_rgb_r {
112
+ background-image: url(../images/colorpicker_rgb_r.png);
113
+ top: 52px;
114
+ left: 212px;
115
+ }
116
+ .colorpicker_rgb_g {
117
+ background-image: url(../images/colorpicker_rgb_g.png);
118
+ top: 82px;
119
+ left: 212px;
120
+ }
121
+ .colorpicker_rgb_b {
122
+ background-image: url(../images/colorpicker_rgb_b.png);
123
+ top: 112px;
124
+ left: 212px;
125
+ }
126
+ .colorpicker_hsb_h {
127
+ background-image: url(../images/colorpicker_hsb_h.png);
128
+ top: 52px;
129
+ left: 282px;
130
+ }
131
+ .colorpicker_hsb_s {
132
+ background-image: url(../images/colorpicker_hsb_s.png);
133
+ top: 82px;
134
+ left: 282px;
135
+ }
136
+ .colorpicker_hsb_b {
137
+ background-image: url(../images/colorpicker_hsb_b.png);
138
+ top: 112px;
139
+ left: 282px;
140
+ }
141
+ .colorpicker_submit {
142
+ position: absolute;
143
+ width: 22px;
144
+ height: 22px;
145
+ background: url(../images/colorpicker_submit.png) top;
146
+ left: 322px;
147
+ top: 142px;
148
+ overflow: hidden;
149
+ }
150
+ .colorpicker_focus {
151
+ background-position: center;
152
+ }
153
+ .colorpicker_hex.colorpicker_focus {
154
+ background-position: bottom;
155
+ }
156
+ .colorpicker_submit.colorpicker_focus {
157
+ background-position: bottom;
158
+ }
159
+ .colorpicker_slider {
160
+ background-position: bottom;
161
+ }
admin/js/colorpicker/images/blank.gif ADDED
Binary file
admin/js/colorpicker/images/colorpicker_background.png ADDED
Binary file
admin/js/colorpicker/images/colorpicker_hex.png ADDED
Binary file
admin/js/colorpicker/images/colorpicker_hsb_b.png ADDED
Binary file
admin/js/colorpicker/images/colorpicker_hsb_h.png ADDED
Binary file
admin/js/colorpicker/images/colorpicker_hsb_s.png ADDED
Binary file
admin/js/colorpicker/images/colorpicker_indic.gif ADDED
Binary file
admin/js/colorpicker/images/colorpicker_overlay.png ADDED
Binary file
admin/js/colorpicker/images/colorpicker_rgb_b.png ADDED
Binary file
admin/js/colorpicker/images/colorpicker_rgb_g.png ADDED
Binary file
admin/js/colorpicker/images/colorpicker_rgb_r.png ADDED
Binary file
admin/js/colorpicker/images/colorpicker_select.gif ADDED
Binary file
admin/js/colorpicker/images/colorpicker_submit.png ADDED
Binary file
admin/js/colorpicker/images/custom_background.png ADDED
Binary file
admin/js/colorpicker/images/custom_hex.png ADDED
Binary file
admin/js/colorpicker/images/custom_hsb_b.png ADDED
Binary file
admin/js/colorpicker/images/custom_hsb_h.png ADDED
Binary file
admin/js/colorpicker/images/custom_hsb_s.png ADDED
Binary file
admin/js/colorpicker/images/custom_indic.gif ADDED
Binary file
admin/js/colorpicker/images/custom_rgb_b.png ADDED
Binary file
admin/js/colorpicker/images/custom_rgb_g.png ADDED
Binary file
admin/js/colorpicker/images/custom_rgb_r.png ADDED
Binary file
admin/js/colorpicker/images/custom_submit.png ADDED
Binary file
admin/js/colorpicker/images/select.png ADDED
Binary file
admin/js/colorpicker/images/select2.png ADDED
Binary file
admin/js/colorpicker/images/slider.png ADDED
Binary file
admin/js/colorpicker/js/colorpicker.js ADDED
@@ -0,0 +1,484 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * Color picker
4
+ * Author: Stefan Petre www.eyecon.ro
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses
7
+ *
8
+ */
9
+ (function ($) {
10
+ var ColorPicker = function () {
11
+ var
12
+ ids = {},
13
+ inAction,
14
+ charMin = 65,
15
+ visible,
16
+ tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
17
+ defaults = {
18
+ eventName: 'click',
19
+ onShow: function () {},
20
+ onBeforeShow: function(){},
21
+ onHide: function () {},
22
+ onChange: function () {},
23
+ onSubmit: function () {},
24
+ color: 'ff0000',
25
+ livePreview: true,
26
+ flat: false
27
+ },
28
+ fillRGBFields = function (hsb, cal) {
29
+ var rgb = HSBToRGB(hsb);
30
+ $(cal).data('colorpicker').fields
31
+ .eq(1).val(rgb.r).end()
32
+ .eq(2).val(rgb.g).end()
33
+ .eq(3).val(rgb.b).end();
34
+ },
35
+ fillHSBFields = function (hsb, cal) {
36
+ $(cal).data('colorpicker').fields
37
+ .eq(4).val(hsb.h).end()
38
+ .eq(5).val(hsb.s).end()
39
+ .eq(6).val(hsb.b).end();
40
+ },
41
+ fillHexFields = function (hsb, cal) {
42
+ $(cal).data('colorpicker').fields
43
+ .eq(0).val(HSBToHex(hsb)).end();
44
+ },
45
+ setSelector = function (hsb, cal) {
46
+ $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
47
+ $(cal).data('colorpicker').selectorIndic.css({
48
+ left: parseInt(150 * hsb.s/100, 10),
49
+ top: parseInt(150 * (100-hsb.b)/100, 10)
50
+ });
51
+ },
52
+ setHue = function (hsb, cal) {
53
+ $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
54
+ },
55
+ setCurrentColor = function (hsb, cal) {
56
+ $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
57
+ },
58
+ setNewColor = function (hsb, cal) {
59
+ $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
60
+ },
61
+ keyDown = function (ev) {
62
+ var pressedKey = ev.charCode || ev.keyCode || -1;
63
+ if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
64
+ return false;
65
+ }
66
+ var cal = $(this).parent().parent();
67
+ if (cal.data('colorpicker').livePreview === true) {
68
+ change.apply(this);
69
+ }
70
+ },
71
+ change = function (ev) {
72
+ var cal = $(this).parent().parent(), col;
73
+ if (this.parentNode.className.indexOf('_hex') > 0) {
74
+ cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
75
+ } else if (this.parentNode.className.indexOf('_hsb') > 0) {
76
+ cal.data('colorpicker').color = col = fixHSB({
77
+ h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
78
+ s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
79
+ b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
80
+ });
81
+ } else {
82
+ cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
83
+ r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
84
+ g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
85
+ b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
86
+ }));
87
+ }
88
+ if (ev) {
89
+ fillRGBFields(col, cal.get(0));
90
+ fillHexFields(col, cal.get(0));
91
+ fillHSBFields(col, cal.get(0));
92
+ }
93
+ setSelector(col, cal.get(0));
94
+ setHue(col, cal.get(0));
95
+ setNewColor(col, cal.get(0));
96
+ cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
97
+ },
98
+ blur = function (ev) {
99
+ var cal = $(this).parent().parent();
100
+ cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
101
+ },
102
+ focus = function () {
103
+ charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
104
+ $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
105
+ $(this).parent().addClass('colorpicker_focus');
106
+ },
107
+ downIncrement = function (ev) {
108
+ var field = $(this).parent().find('input').focus();
109
+ var current = {
110
+ el: $(this).parent().addClass('colorpicker_slider'),
111
+ max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
112
+ y: ev.pageY,
113
+ field: field,
114
+ val: parseInt(field.val(), 10),
115
+ preview: $(this).parent().parent().data('colorpicker').livePreview
116
+ };
117
+ $(document).bind('mouseup', current, upIncrement);
118
+ $(document).bind('mousemove', current, moveIncrement);
119
+ },
120
+ moveIncrement = function (ev) {
121
+ ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
122
+ if (ev.data.preview) {
123
+ change.apply(ev.data.field.get(0), [true]);
124
+ }
125
+ return false;
126
+ },
127
+ upIncrement = function (ev) {
128
+ change.apply(ev.data.field.get(0), [true]);
129
+ ev.data.el.removeClass('colorpicker_slider').find('input').focus();
130
+ $(document).unbind('mouseup', upIncrement);
131
+ $(document).unbind('mousemove', moveIncrement);
132
+ return false;
133
+ },
134
+ downHue = function (ev) {
135
+ var current = {
136
+ cal: $(this).parent(),
137
+ y: $(this).offset().top
138
+ };
139
+ current.preview = current.cal.data('colorpicker').livePreview;
140
+ $(document).bind('mouseup', current, upHue);
141
+ $(document).bind('mousemove', current, moveHue);
142
+ },
143
+ moveHue = function (ev) {
144
+ change.apply(
145
+ ev.data.cal.data('colorpicker')
146
+ .fields
147
+ .eq(4)
148
+ .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
149
+ .get(0),
150
+ [ev.data.preview]
151
+ );
152
+ return false;
153
+ },
154
+ upHue = function (ev) {
155
+ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
156
+ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
157
+ $(document).unbind('mouseup', upHue);
158
+ $(document).unbind('mousemove', moveHue);
159
+ return false;
160
+ },
161
+ downSelector = function (ev) {
162
+ var current = {
163
+ cal: $(this).parent(),
164
+ pos: $(this).offset()
165
+ };
166
+ current.preview = current.cal.data('colorpicker').livePreview;
167
+ $(document).bind('mouseup', current, upSelector);
168
+ $(document).bind('mousemove', current, moveSelector);
169
+ },
170
+ moveSelector = function (ev) {
171
+ change.apply(
172
+ ev.data.cal.data('colorpicker')
173
+ .fields
174
+ .eq(6)
175
+ .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
176
+ .end()
177
+ .eq(5)
178
+ .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
179
+ .get(0),
180
+ [ev.data.preview]
181
+ );
182
+ return false;
183
+ },
184
+ upSelector = function (ev) {
185
+ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
186
+ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
187
+ $(document).unbind('mouseup', upSelector);
188
+ $(document).unbind('mousemove', moveSelector);
189
+ return false;
190
+ },
191
+ enterSubmit = function (ev) {
192
+ $(this).addClass('colorpicker_focus');
193
+ },
194
+ leaveSubmit = function (ev) {
195
+ $(this).removeClass('colorpicker_focus');
196
+ },
197
+ clickSubmit = function (ev) {
198
+ var cal = $(this).parent();
199
+ var col = cal.data('colorpicker').color;
200
+ cal.data('colorpicker').origColor = col;
201
+ setCurrentColor(col, cal.get(0));
202
+ cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
203
+ },
204
+ show = function (ev) {
205
+ var cal = $('#' + $(this).data('colorpickerId'));
206
+ cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
207
+ var pos = $(this).offset();
208
+ var viewPort = getViewport();
209
+ var top = pos.top + this.offsetHeight;
210
+ var left = pos.left;
211
+ if (top + 176 > viewPort.t + viewPort.h) {
212
+ top -= this.offsetHeight + 176;
213
+ }
214
+ if (left + 356 > viewPort.l + viewPort.w) {
215
+ left -= 356;
216
+ }
217
+ cal.css({left: left + 'px', top: top + 'px'});
218
+ if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
219
+ cal.show();
220
+ }
221
+ $(document).bind('mousedown', {cal: cal}, hide);
222
+ return false;
223
+ },
224
+ hide = function (ev) {
225
+ if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
226
+ if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
227
+ ev.data.cal.hide();
228
+ }
229
+ $(document).unbind('mousedown', hide);
230
+ }
231
+ },
232
+ isChildOf = function(parentEl, el, container) {
233
+ if (parentEl == el) {
234
+ return true;
235
+ }
236
+ if (parentEl.contains) {
237
+ return parentEl.contains(el);
238
+ }
239
+ if ( parentEl.compareDocumentPosition ) {
240
+ return !!(parentEl.compareDocumentPosition(el) & 16);
241
+ }
242
+ var prEl = el.parentNode;
243
+ while(prEl && prEl != container) {
244
+ if (prEl == parentEl)
245
+ return true;
246
+ prEl = prEl.parentNode;
247
+ }
248
+ return false;
249
+ },
250
+ getViewport = function () {
251
+ var m = document.compatMode == 'CSS1Compat';
252
+ return {
253
+ l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
254
+ t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
255
+ w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
256
+ h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
257
+ };
258
+ },
259
+ fixHSB = function (hsb) {
260
+ return {
261
+ h: Math.min(360, Math.max(0, hsb.h)),
262
+ s: Math.min(100, Math.max(0, hsb.s)),
263
+ b: Math.min(100, Math.max(0, hsb.b))
264
+ };
265
+ },
266
+ fixRGB = function (rgb) {
267
+ return {
268
+ r: Math.min(255, Math.max(0, rgb.r)),
269
+ g: Math.min(255, Math.max(0, rgb.g)),
270
+ b: Math.min(255, Math.max(0, rgb.b))
271
+ };
272
+ },
273
+ fixHex = function (hex) {
274
+ var len = 6 - hex.length;
275
+ if (len > 0) {
276
+ var o = [];
277
+ for (var i=0; i<len; i++) {
278
+ o.push('0');
279
+ }
280
+ o.push(hex);
281
+ hex = o.join('');
282
+ }
283
+ return hex;
284
+ },
285
+ HexToRGB = function (hex) {
286
+ var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
287
+ return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
288
+ },
289
+ HexToHSB = function (hex) {
290
+ return RGBToHSB(HexToRGB(hex));
291
+ },
292
+ RGBToHSB = function (rgb) {
293
+ var hsb = {
294
+ h: 0,
295
+ s: 0,
296
+ b: 0
297
+ };
298
+ var min = Math.min(rgb.r, rgb.g, rgb.b);
299
+ var max = Math.max(rgb.r, rgb.g, rgb.b);
300
+ var delta = max - min;
301
+ hsb.b = max;
302
+ if (max != 0) {
303
+
304
+ }
305
+ hsb.s = max != 0 ? 255 * delta / max : 0;
306
+ if (hsb.s != 0) {
307
+ if (rgb.r == max) {
308
+ hsb.h = (rgb.g - rgb.b) / delta;
309
+ } else if (rgb.g == max) {
310
+ hsb.h = 2 + (rgb.b - rgb.r) / delta;
311
+ } else {
312
+ hsb.h = 4 + (rgb.r - rgb.g) / delta;
313
+ }
314
+ } else {
315
+ hsb.h = -1;
316
+ }
317
+ hsb.h *= 60;
318
+ if (hsb.h < 0) {
319
+ hsb.h += 360;
320
+ }
321
+ hsb.s *= 100/255;
322
+ hsb.b *= 100/255;
323
+ return hsb;
324
+ },
325
+ HSBToRGB = function (hsb) {
326
+ var rgb = {};
327
+ var h = Math.round(hsb.h);
328
+ var s = Math.round(hsb.s*255/100);
329
+ var v = Math.round(hsb.b*255/100);
330
+ if(s == 0) {
331
+ rgb.r = rgb.g = rgb.b = v;
332
+ } else {
333
+ var t1 = v;
334
+ var t2 = (255-s)*v/255;
335
+ var t3 = (t1-t2)*(h%60)/60;
336
+ if(h==360) h = 0;
337
+ if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
338
+ else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
339
+ else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
340
+ else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
341
+ else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
342
+ else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
343
+ else {rgb.r=0; rgb.g=0; rgb.b=0}
344
+ }
345
+ return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
346
+ },
347
+ RGBToHex = function (rgb) {
348
+ var hex = [
349
+ rgb.r.toString(16),
350
+ rgb.g.toString(16),
351
+ rgb.b.toString(16)
352
+ ];
353
+ $.each(hex, function (nr, val) {
354
+ if (val.length == 1) {
355
+ hex[nr] = '0' + val;
356
+ }
357
+ });
358
+ return hex.join('');
359
+ },
360
+ HSBToHex = function (hsb) {
361
+ return RGBToHex(HSBToRGB(hsb));
362
+ },
363
+ restoreOriginal = function () {
364
+ var cal = $(this).parent();
365
+ var col = cal.data('colorpicker').origColor;
366
+ cal.data('colorpicker').color = col;
367
+ fillRGBFields(col, cal.get(0));
368
+ fillHexFields(col, cal.get(0));
369
+ fillHSBFields(col, cal.get(0));
370
+ setSelector(col, cal.get(0));
371
+ setHue(col, cal.get(0));
372
+ setNewColor(col, cal.get(0));
373
+ };
374
+ return {
375
+ init: function (opt) {
376
+ opt = $.extend({}, defaults, opt||{});
377
+ if (typeof opt.color == 'string') {
378
+ opt.color = HexToHSB(opt.color);
379
+ } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
380
+ opt.color = RGBToHSB(opt.color);
381
+ } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
382
+ opt.color = fixHSB(opt.color);
383
+ } else {
384
+ return this;
385
+ }
386
+ return this.each(function () {
387
+ if (!$(this).data('colorpickerId')) {
388
+ var options = $.extend({}, opt);
389
+ options.origColor = opt.color;
390
+ var id = 'collorpicker_' + parseInt(Math.random() * 1000);
391
+ $(this).data('colorpickerId', id);
392
+ var cal = $(tpl).attr('id', id);
393
+ if (options.flat) {
394
+ cal.appendTo(this).show();
395
+ } else {
396
+ cal.appendTo(document.body);
397
+ }
398
+ options.fields = cal
399
+ .find('input')
400
+ .bind('keyup', keyDown)
401
+ .bind('change', change)
402
+ .bind('blur', blur)
403
+ .bind('focus', focus);
404
+ cal
405
+ .find('span').bind('mousedown', downIncrement).end()
406
+ .find('>div.colorpicker_current_color').bind('click', restoreOriginal);
407
+ options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
408
+ options.selectorIndic = options.selector.find('div div');
409
+ options.el = this;
410
+ options.hue = cal.find('div.colorpicker_hue div');
411
+ cal.find('div.colorpicker_hue').bind('mousedown', downHue);
412
+ options.newColor = cal.find('div.colorpicker_new_color');
413
+ options.currentColor = cal.find('div.colorpicker_current_color');
414
+ cal.data('colorpicker', options);
415
+ cal.find('div.colorpicker_submit')
416
+ .bind('mouseenter', enterSubmit)
417
+ .bind('mouseleave', leaveSubmit)
418
+ .bind('click', clickSubmit);
419
+ fillRGBFields(options.color, cal.get(0));
420
+ fillHSBFields(options.color, cal.get(0));
421
+ fillHexFields(options.color, cal.get(0));
422
+ setHue(options.color, cal.get(0));
423
+ setSelector(options.color, cal.get(0));
424
+ setCurrentColor(options.color, cal.get(0));
425
+ setNewColor(options.color, cal.get(0));
426
+ if (options.flat) {
427
+ cal.css({
428
+ position: 'relative',
429
+ display: 'block'
430
+ });
431
+ } else {
432
+ $(this).bind(options.eventName, show);
433
+ }
434
+ }
435
+ });
436
+ },
437
+ showPicker: function() {
438
+ return this.each( function () {
439
+ if ($(this).data('colorpickerId')) {
440
+ show.apply(this);
441
+ }
442
+ });
443
+ },
444
+ hidePicker: function() {
445
+ return this.each( function () {
446
+ if ($(this).data('colorpickerId')) {
447
+ $('#' + $(this).data('colorpickerId')).hide();
448
+ }
449
+ });
450
+ },
451
+ setColor: function(col) {
452
+ if (typeof col == 'string') {
453
+ col = HexToHSB(col);
454
+ } else if (col.r != undefined && col.g != undefined && col.b != undefined) {
455
+ col = RGBToHSB(col);
456
+ } else if (col.h != undefined && col.s != undefined && col.b != undefined) {
457
+ col = fixHSB(col);
458
+ } else {
459
+ return this;
460
+ }
461
+ return this.each(function(){
462
+ if ($(this).data('colorpickerId')) {
463
+ var cal = $('#' + $(this).data('colorpickerId'));
464
+ cal.data('colorpicker').color = col;
465
+ cal.data('colorpicker').origColor = col;
466
+ fillRGBFields(col, cal.get(0));
467
+ fillHSBFields(col, cal.get(0));
468
+ fillHexFields(col, cal.get(0));
469
+ setHue(col, cal.get(0));
470
+ setSelector(col, cal.get(0));
471
+ setCurrentColor(col, cal.get(0));
472
+ setNewColor(col, cal.get(0));
473
+ }
474
+ });
475
+ }
476
+ };
477
+ }();
478
+ $.fn.extend({
479
+ ColorPicker: ColorPicker.init,
480
+ ColorPickerHide: ColorPicker.hidePicker,
481
+ ColorPickerShow: ColorPicker.showPicker,
482
+ ColorPickerSetColor: ColorPicker.setColor
483
+ });
484
+ })(jQuery)
admin/js/jquery.MultiFile.js ADDED
@@ -0,0 +1,535 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ### jQuery Multiple File Upload Plugin v1.46 - 2009-05-12 ###
3
+ * Home: http://www.fyneworks.com/jquery/multiple-file-upload/
4
+ * Code: http://code.google.com/p/jquery-multifile-plugin/
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl.html
9
+ ###
10
+ */
11
+
12
+ /*# AVOID COLLISIONS #*/
13
+ ;if(window.jQuery) (function($){
14
+ /*# AVOID COLLISIONS #*/
15
+
16
+ // plugin initialization
17
+ $.fn.MultiFile = function(options){
18
+ if(this.length==0) return this; // quick fail
19
+
20
+ // Handle API methods
21
+ if(typeof arguments[0]=='string'){
22
+ // Perform API methods on individual elements
23
+ if(this.length>1){
24
+ var args = arguments;
25
+ return this.each(function(){
26
+ $.fn.MultiFile.apply($(this), args);
27
+ });
28
+ };
29
+ // Invoke API method handler
30
+ $.fn.MultiFile[arguments[0]].apply(this, $.makeArray(arguments).slice(1) || []);
31
+ // Quick exit...
32
+ return this;
33
+ };
34
+
35
+ // Initialize options for this call
36
+ var options = $.extend(
37
+ {}/* new object */,
38
+ $.fn.MultiFile.options/* default options */,
39
+ options || {} /* just-in-time options */
40
+ );
41
+
42
+ // Empty Element Fix!!!
43
+ // this code will automatically intercept native form submissions
44
+ // and disable empty file elements
45
+ $('form')
46
+ .not('MultiFile-intercepted')
47
+ .addClass('MultiFile-intercepted')
48
+ .submit($.fn.MultiFile.disableEmpty);
49
+
50
+ //### http://plugins.jquery.com/node/1363
51
+ // utility method to integrate this plugin with others...
52
+ if($.fn.MultiFile.options.autoIntercept){
53
+ $.fn.MultiFile.intercept( $.fn.MultiFile.options.autoIntercept /* array of methods to intercept */ );
54
+ $.fn.MultiFile.options.autoIntercept = null; /* only run this once */
55
+ };
56
+
57
+ // loop through each matched element
58
+ this
59
+ .not('.MultiFile-applied')
60
+ .addClass('MultiFile-applied')
61
+ .each(function(){
62
+ //#####################################################################
63
+ // MAIN PLUGIN FUNCTIONALITY - START
64
+ //#####################################################################
65
+
66
+ // BUG 1251 FIX: http://plugins.jquery.com/project/comments/add/1251
67
+ // variable group_count would repeat itself on multiple calls to the plugin.
68
+ // this would cause a conflict with multiple elements
69
+ // changes scope of variable to global so id will be unique over n calls
70
+ window.MultiFile = (window.MultiFile || 0) + 1;
71
+ var group_count = window.MultiFile;
72
+
73
+ // Copy parent attributes - Thanks to Jonas Wagner
74
+ // we will use this one to create new input elements
75
+ var MultiFile = {e:this, E:$(this), clone:$(this).clone()};
76
+
77
+ //===
78
+
79
+ //# USE CONFIGURATION
80
+ if(typeof options=='number') options = {max:options};
81
+ var o = $.extend({},
82
+ $.fn.MultiFile.options,
83
+ options || {},
84
+ ($.metadata? MultiFile.E.metadata(): ($.meta?MultiFile.E.data():null)) || {}, /* metadata options */
85
+ {} /* internals */
86
+ );
87
+ // limit number of files that can be selected?
88
+ if(!(o.max>0) /*IsNull(MultiFile.max)*/){
89
+ o.max = MultiFile.E.attr('maxlength');
90
+ if(!(o.max>0) /*IsNull(MultiFile.max)*/){
91
+ o.max = (String(MultiFile.e.className.match(/\b(max|limit)\-([0-9]+)\b/gi) || ['']).match(/[0-9]+/gi) || [''])[0];
92
+ if(!(o.max>0)) o.max = -1;
93
+ else o.max = String(o.max).match(/[0-9]+/gi)[0];
94
+ }
95
+ };
96
+ o.max = new Number(o.max);
97
+ // limit extensions?
98
+ o.accept = o.accept || MultiFile.E.attr('accept') || '';
99
+ if(!o.accept){
100
+ o.accept = (MultiFile.e.className.match(/\b(accept\-[\w\|]+)\b/gi)) || '';
101
+ o.accept = new String(o.accept).replace(/^(accept|ext)\-/i,'');
102
+ };
103
+
104
+ //===
105
+
106
+ // APPLY CONFIGURATION
107
+ $.extend(MultiFile, o || {});
108
+ MultiFile.STRING = $.extend({},$.fn.MultiFile.options.STRING,MultiFile.STRING);
109
+
110
+ //===
111
+
112
+ //#########################################
113
+ // PRIVATE PROPERTIES/METHODS
114
+ $.extend(MultiFile, {
115
+ n: 0, // How many elements are currently selected?
116
+ slaves: [], files: [],
117
+ instanceKey: MultiFile.e.id || 'MultiFile'+String(group_count), // Instance Key?
118
+ generateID: function(z){ return MultiFile.instanceKey + (z>0 ?'_F'+String(z):''); },
119
+ trigger: function(event, element){
120
+ var handler = MultiFile[event], value = $(element).attr('value');
121
+ if(handler){
122
+ var returnValue = handler(element, value, MultiFile);
123
+ if( returnValue!=null ) return returnValue;
124
+ }
125
+ return true;
126
+ }
127
+ });
128
+
129
+ //===
130
+
131
+ // Setup dynamic regular expression for extension validation
132
+ // - thanks to John-Paul Bader: http://smyck.de/2006/08/11/javascript-dynamic-regular-expresions/
133
+ if(String(MultiFile.accept).length>1){
134
+ MultiFile.accept = MultiFile.accept.replace(/\W+/g,'|').replace(/^\W|\W$/g,'');
135
+ MultiFile.rxAccept = new RegExp('\\.('+(MultiFile.accept?MultiFile.accept:'')+')$','gi');
136
+ };
137
+
138
+ //===
139
+
140
+ // Create wrapper to hold our file list
141
+ MultiFile.wrapID = MultiFile.instanceKey+'_wrap'; // Wrapper ID?
142
+ MultiFile.E.wrap('<div class="MultiFile-wrap" id="'+MultiFile.wrapID+'"></div>');
143
+ MultiFile.wrapper = $('#'+MultiFile.wrapID+'');
144
+
145
+ //===
146
+
147
+ // MultiFile MUST have a name - default: file1[], file2[], file3[]
148
+ MultiFile.e.name = MultiFile.e.name || 'file'+ group_count +'[]';
149
+
150
+ //===
151
+
152
+ if(!MultiFile.list){
153
+ // Create a wrapper for the list
154
+ // * OPERA BUG: NO_MODIFICATION_ALLOWED_ERR ('list' is a read-only property)
155
+ // this change allows us to keep the files in the order they were selected
156
+ MultiFile.wrapper.append( '<div class="MultiFile-list" id="'+MultiFile.wrapID+'_list"></div>' );
157
+ MultiFile.list = $('#'+MultiFile.wrapID+'_list');
158
+ };
159
+ MultiFile.list = $(MultiFile.list);
160
+
161
+ //===
162
+
163
+ // Bind a new element
164
+ MultiFile.addSlave = function( slave, slave_count ){
165
+ //if(window.console) console.log('MultiFile.addSlave',slave_count);
166
+
167
+ // Keep track of how many elements have been displayed
168
+ MultiFile.n++;
169
+ // Add reference to master element
170
+ slave.MultiFile = MultiFile;
171
+
172
+ // BUG FIX: http://plugins.jquery.com/node/1495
173
+ // Clear identifying properties from clones
174
+ if(slave_count>0) slave.id = slave.name = '';
175
+
176
+ // Define element's ID and name (upload components need this!)
177
+ //slave.id = slave.id || MultiFile.generateID(slave_count);
178
+ if(slave_count>0) slave.id = MultiFile.generateID(slave_count);
179
+ //FIX for: http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=23
180
+
181
+ // 2008-Apr-29: New customizable naming convention (see url below)
182
+ // http://groups.google.com/group/jquery-dev/browse_frm/thread/765c73e41b34f924#
183
+ slave.name = String(MultiFile.namePattern
184
+ /*master name*/.replace(/\$name/gi,$(MultiFile.clone).attr('name'))
185
+ /*master id */.replace(/\$id/gi, $(MultiFile.clone).attr('id'))
186
+ /*group count*/.replace(/\$g/gi, group_count)//(group_count>0?group_count:''))
187
+ /*slave count*/.replace(/\$i/gi, slave_count)//(slave_count>0?slave_count:''))
188
+ );
189
+
190
+ // If we've reached maximum number, disable input slave
191
+ if( (MultiFile.max > 0) && ((MultiFile.n-1) > (MultiFile.max)) )//{ // MultiFile.n Starts at 1, so subtract 1 to find true count
192
+ slave.disabled = true;
193
+ //};
194
+
195
+ // Remember most recent slave
196
+ MultiFile.current = MultiFile.slaves[slave_count] = slave;
197
+
198
+ // We'll use jQuery from now on
199
+ slave = $(slave);
200
+
201
+ // Clear value
202
+ slave.val('').attr('value','')[0].value = '';
203
+
204
+ // Stop plugin initializing on slaves
205
+ slave.addClass('MultiFile-applied');
206
+
207
+ // Triggered when a file is selected
208
+ slave.change(function(){
209
+ //if(window.console) console.log('MultiFile.slave.change',slave_count);
210
+
211
+ // Lose focus to stop IE7 firing onchange again
212
+ $(this).blur();
213
+
214
+ //# Trigger Event! onFileSelect
215
+ if(!MultiFile.trigger('onFileSelect', this, MultiFile)) return false;
216
+ //# End Event!
217
+
218
+ //# Retrive value of selected file from element
219
+ var ERROR = '', v = String(this.value || ''/*.attr('value)*/);
220
+
221
+ // check extension
222
+ if(MultiFile.accept && v && !v.match(MultiFile.rxAccept))//{
223
+ ERROR = MultiFile.STRING.denied.replace('$ext', String(v.match(/\.\w{1,4}$/gi)));
224
+ //}
225
+ //};
226
+
227
+ // Disallow duplicates
228
+ for(var f in MultiFile.slaves)//{
229
+ if(MultiFile.slaves[f] && MultiFile.slaves[f]!=this)//{
230
+ //console.log(MultiFile.slaves[f],MultiFile.slaves[f].value);
231
+ if(MultiFile.slaves[f].value==v)//{
232
+ ERROR = MultiFile.STRING.duplicate.replace('$file', v.match(/[^\/\\]+$/gi));
233
+ //};
234
+ //};
235
+ //};
236
+
237
+ // Create a new file input element
238
+ var newEle = $(MultiFile.clone).clone();// Copy parent attributes - Thanks to Jonas Wagner
239
+ //# Let's remember which input we've generated so
240
+ // we can disable the empty ones before submission
241
+ // See: http://plugins.jquery.com/node/1495
242
+ newEle.addClass('MultiFile');
243
+
244
+ // Handle error
245
+ if(ERROR!=''){
246
+ // Handle error
247
+ MultiFile.error(ERROR);
248
+
249
+ // 2007-06-24: BUG FIX - Thanks to Adrian Wr�bel <adrian [dot] wrobel [at] gmail.com>
250
+ // Ditch the trouble maker and add a fresh new element
251
+ MultiFile.n--;
252
+ MultiFile.addSlave(newEle[0], slave_count);
253
+ slave.parent().prepend(newEle);
254
+ slave.remove();
255
+ return false;
256
+ };
257
+
258
+ // Hide this element (NB: display:none is evil!)
259
+ $(this).css({ position:'absolute', top: '-3000px' });
260
+
261
+ // Add new element to the form
262
+ slave.after(newEle);
263
+
264
+ // Update list
265
+ MultiFile.addToList( this, slave_count );
266
+
267
+ // Bind functionality
268
+ MultiFile.addSlave( newEle[0], slave_count+1 );
269
+
270
+ //# Trigger Event! afterFileSelect
271
+ if(!MultiFile.trigger('afterFileSelect', this, MultiFile)) return false;
272
+ //# End Event!
273
+
274
+ }); // slave.change()
275
+
276
+ // Save control to element
277
+ $(slave).data('MultiFile', MultiFile);
278
+
279
+ };// MultiFile.addSlave
280
+ // Bind a new element
281
+
282
+
283
+
284
+ // Add a new file to the list
285
+ MultiFile.addToList = function( slave, slave_count ){
286
+ //if(window.console) console.log('MultiFile.addToList',slave_count);
287
+
288
+ //# Trigger Event! onFileAppend
289
+ if(!MultiFile.trigger('onFileAppend', slave, MultiFile)) return false;
290
+ //# End Event!
291
+
292
+ // Create label elements
293
+ var
294
+ r = $('<div class="MultiFile-label"></div>'),
295
+ v = String(slave.value || ''/*.attr('value)*/),
296
+ a = $('<span class="MultiFile-title" title="'+MultiFile.STRING.selected.replace('$file', v)+'">'+MultiFile.STRING.file.replace('$file', v.match(/[^\/\\]+$/gi)[0])+'</span>'),
297
+ b = $('<a class="MultiFile-remove" href="#'+MultiFile.wrapID+'">'+MultiFile.STRING.remove+'</a>');
298
+
299
+ // Insert label
300
+ MultiFile.list.append(
301
+ r.append(b, ' ', a)
302
+ );
303
+
304
+ b
305
+ .click(function(){
306
+
307
+ //# Trigger Event! onFileRemove
308
+ if(!MultiFile.trigger('onFileRemove', slave, MultiFile)) return false;
309
+ //# End Event!
310
+
311
+ MultiFile.n--;
312
+ MultiFile.current.disabled = false;
313
+
314
+ // Remove element, remove label, point to current
315
+ MultiFile.slaves[slave_count] = null;
316
+ $(slave).remove();
317
+ $(this).parent().remove();
318
+
319
+ // Show most current element again (move into view) and clear selection
320
+ $(MultiFile.current).css({ position:'', top: '' });
321
+ $(MultiFile.current).reset().val('').attr('value', '')[0].value = '';
322
+
323
+ //# Trigger Event! afterFileRemove
324
+ if(!MultiFile.trigger('afterFileRemove', slave, MultiFile)) return false;
325
+ //# End Event!
326
+
327
+ return false;
328
+ });
329
+
330
+ //# Trigger Event! afterFileAppend
331
+ if(!MultiFile.trigger('afterFileAppend', slave, MultiFile)) return false;
332
+ //# End Event!
333
+
334
+ }; // MultiFile.addToList
335
+ // Add element to selected files list
336
+
337
+
338
+
339
+ // Bind functionality to the first element
340
+ if(!MultiFile.MultiFile) MultiFile.addSlave(MultiFile.e, 0);
341
+
342
+ // Increment control count
343
+ //MultiFile.I++; // using window.MultiFile
344
+ MultiFile.n++;
345
+
346
+ // Save control to element
347
+ MultiFile.E.data('MultiFile', MultiFile);
348
+
349
+
350
+ //#####################################################################
351
+ // MAIN PLUGIN FUNCTIONALITY - END
352
+ //#####################################################################
353
+ }); // each element
354
+ };
355
+
356
+ /*--------------------------------------------------------*/
357
+
358
+ /*
359
+ ### Core functionality and API ###
360
+ */
361
+ $.extend($.fn.MultiFile, {
362
+ /**
363
+ * This method removes all selected files
364
+ *
365
+ * Returns a jQuery collection of all affected elements.
366
+ *
367
+ * @name reset
368
+ * @type jQuery
369
+ * @cat Plugins/MultiFile
370
+ * @author Diego A. (http://www.fyneworks.com/)
371
+ *
372
+ * @example $.fn.MultiFile.reset();
373
+ */
374
+ reset: function(){
375
+ var settings = $(this).data('MultiFile');
376
+ //if(settings) settings.wrapper.find('a.MultiFile-remove').click();
377
+ if(settings) settings.list.find('a.MultiFile-remove').click();
378
+ return $(this);
379
+ },
380
+
381
+
382
+ /**
383
+ * This utility makes it easy to disable all 'empty' file elements in the document before submitting a form.
384
+ * It marks the affected elements so they can be easily re-enabled after the form submission or validation.
385
+ *
386
+ * Returns a jQuery collection of all affected elements.
387
+ *
388
+ * @name disableEmpty
389
+ * @type jQuery
390
+ * @cat Plugins/MultiFile
391
+ * @author Diego A. (http://www.fyneworks.com/)
392
+ *
393
+ * @example $.fn.MultiFile.disableEmpty();
394
+ * @param String class (optional) A string specifying a class to be applied to all affected elements - Default: 'mfD'.
395
+ */
396
+ disableEmpty: function(klass){ klass = (typeof(klass)=='string'?klass:'')||'mfD';
397
+ var o = [];
398
+ $('input:file.MultiFile').each(function(){ if($(this).val()=='') o[o.length] = this; });
399
+ return $(o).each(function(){ this.disabled = true }).addClass(klass);
400
+ },
401
+
402
+
403
+ /**
404
+ * This method re-enables 'empty' file elements that were disabled (and marked) with the $.fn.MultiFile.disableEmpty method.
405
+ *
406
+ * Returns a jQuery collection of all affected elements.
407
+ *
408
+ * @name reEnableEmpty
409
+ * @type jQuery
410
+ * @cat Plugins/MultiFile
411
+ * @author Diego A. (http://www.fyneworks.com/)
412
+ *
413
+ * @example $.fn.MultiFile.reEnableEmpty();
414
+ * @param String klass (optional) A string specifying the class that was used to mark affected elements - Default: 'mfD'.
415
+ */
416
+ reEnableEmpty: function(klass){ klass = (typeof(klass)=='string'?klass:'')||'mfD';
417
+ return $('input:file.'+klass).removeClass(klass).each(function(){ this.disabled = false });
418
+ },
419
+
420
+
421
+ /**
422
+ * This method will intercept other jQuery plugins and disable empty file input elements prior to form submission
423
+ *
424
+
425
+ * @name intercept
426
+ * @cat Plugins/MultiFile
427
+ * @author Diego A. (http://www.fyneworks.com/)
428
+ *
429
+ * @example $.fn.MultiFile.intercept();
430
+ * @param Array methods (optional) Array of method names to be intercepted
431
+ */
432
+ intercepted: {},
433
+ intercept: function(methods, context, args){
434
+ var method, value; args = args || [];
435
+ if(args.constructor.toString().indexOf("Array")<0) args = [ args ];
436
+ if(typeof(methods)=='function'){
437
+ $.fn.MultiFile.disableEmpty();
438
+ value = methods.apply(context || window, args);
439
+ //SEE-http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=27
440
+ setTimeout(function(){ $.fn.MultiFile.reEnableEmpty() },1000);
441
+ return value;
442
+ };
443
+ if(methods.constructor.toString().indexOf("Array")<0) methods = [methods];
444
+ for(var i=0;i<methods.length;i++){
445
+ method = methods[i]+''; // make sure that we have a STRING
446
+ if(method) (function(method){ // make sure that method is ISOLATED for the interception
447
+ $.fn.MultiFile.intercepted[method] = $.fn[method] || function(){};
448
+ $.fn[method] = function(){
449
+ $.fn.MultiFile.disableEmpty();
450
+ value = $.fn.MultiFile.intercepted[method].apply(this, arguments);
451
+ //SEE-http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=27
452
+ setTimeout(function(){ $.fn.MultiFile.reEnableEmpty() },1000);
453
+ return value;
454
+ }; // interception
455
+ })(method); // MAKE SURE THAT method IS ISOLATED for the interception
456
+ };// for each method
457
+ }
458
+ });
459
+
460
+ /*--------------------------------------------------------*/
461
+
462
+ /*
463
+ ### Default Settings ###
464
+ eg.: You can override default control like this:
465
+ $.fn.MultiFile.options.accept = 'gif|jpg';
466
+ */
467
+ $.fn.MultiFile.options = { //$.extend($.fn.MultiFile, { options: {
468
+ accept: '', // accepted file extensions
469
+ max: -1, // maximum number of selectable files
470
+
471
+ // name to use for newly created elements
472
+ namePattern: '$name', // same name by default (which creates an array)
473
+
474
+ // STRING: collection lets you show messages in different languages
475
+ STRING: {
476
+ remove:'x',
477
+ denied:'You cannot select a $ext file.\nTry again...',
478
+ file:'$file',
479
+ selected:'File selected: $file',
480
+ duplicate:'This file has already been selected:\n$file'
481
+ },
482
+
483
+ // name of methods that should be automcatically intercepted so the plugin can disable
484
+ // extra file elements that are empty before execution and automatically re-enable them afterwards
485
+ autoIntercept: [ 'submit', 'ajaxSubmit', 'ajaxForm', 'validate' /* array of methods to intercept */ ],
486
+
487
+ // error handling function
488
+ error: function(s){
489
+ /*
490
+ ERROR! blockUI is not currently working in IE
491
+ if($.blockUI){
492
+ $.blockUI({
493
+ message: s.replace(/\n/gi,'<br/>'),
494
+ css: {
495
+ border:'none', padding:'15px', size:'12.0pt',
496
+ backgroundColor:'#900', color:'#fff',
497
+ opacity:'.8','-webkit-border-radius': '10px','-moz-border-radius': '10px'
498
+ }
499
+ });
500
+ window.setTimeout($.unblockUI, 2000);
501
+ }
502
+ else//{// save a byte!
503
+ */
504
+ alert(s);
505
+ //}// save a byte!
506
+ }
507
+ }; //} });
508
+
509
+ /*--------------------------------------------------------*/
510
+
511
+ /*
512
+ ### Additional Methods ###
513
+ Required functionality outside the plugin's scope
514
+ */
515
+
516
+ // Native input reset method - because this alone doesn't always work: $(element).val('').attr('value', '')[0].value = '';
517
+ $.fn.reset = function(){ return this.each(function(){ try{ this.reset(); }catch(e){} }); };
518
+
519
+ /*--------------------------------------------------------*/
520
+
521
+ /*
522
+ ### Default implementation ###
523
+ The plugin will attach itself to file inputs
524
+ with the class 'multi' when the page loads
525
+ */
526
+ $(function(){
527
+ //$("input:file.multi").MultiFile();
528
+ $("input[type=file].multi").MultiFile();
529
+ });
530
+
531
+
532
+
533
+ /*# AVOID COLLISIONS #*/
534
+ })(jQuery);
535
+ /*# AVOID COLLISIONS #*/
admin/js/jquery.MultiFile.pack.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ### jQuery Multiple File Upload Plugin v1.46 - 2009-05-12 ###
3
+ * Home: http://www.fyneworks.com/jquery/multiple-file-upload/
4
+ * Code: http://code.google.com/p/jquery-multifile-plugin/
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl.html
9
+ ###
10
+ */
11
+ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';3(U.1u)(6($){$.7.2=6(h){3(5.V==0)8 5;3(T S[0]==\'19\'){3(5.V>1){m i=S;8 5.M(6(){$.7.2.13($(5),i)})};$.7.2[S[0]].13(5,$.1N(S).27(1)||[]);8 5};m h=$.N({},$.7.2.F,h||{});$(\'2d\').1B(\'2-R\').Q(\'2-R\').1n($.7.2.Z);3($.7.2.F.15){$.7.2.1M($.7.2.F.15);$.7.2.F.15=10};5.1B(\'.2-1e\').Q(\'2-1e\').M(6(){U.2=(U.2||0)+1;m e=U.2;m g={e:5,E:$(5),L:$(5).L()};3(T h==\'21\')h={l:h};m o=$.N({},$.7.2.F,h||{},($.1m?g.E.1m():($.1S?g.E.17():10))||{},{});3(!(o.l>0)){o.l=g.E.D(\'28\');3(!(o.l>0)){o.l=(u(g.e.1D.B(/\\b(l|23)\\-([0-9]+)\\b/q)||[\'\']).B(/[0-9]+/q)||[\'\'])[0];3(!(o.l>0))o.l=-1;2b o.l=u(o.l).B(/[0-9]+/q)[0]}};o.l=18 2f(o.l);o.j=o.j||g.E.D(\'j\')||\'\';3(!o.j){o.j=(g.e.1D.B(/\\b(j\\-[\\w\\|]+)\\b/q))||\'\';o.j=18 u(o.j).t(/^(j|1d)\\-/i,\'\')};$.N(g,o||{});g.A=$.N({},$.7.2.F.A,g.A);$.N(g,{n:0,J:[],2c:[],1c:g.e.I||\'2\'+u(e),1i:6(z){8 g.1c+(z>0?\'1Z\'+u(z):\'\')},G:6(a,b){m c=g[a],k=$(b).D(\'k\');3(c){m d=c(b,k,g);3(d!=10)8 d}8 1a}});3(u(g.j).V>1){g.j=g.j.t(/\\W+/g,\'|\').t(/^\\W|\\W$/g,\'\');g.1k=18 2t(\'\\\\.(\'+(g.j?g.j:\'\')+\')$\',\'q\')};g.O=g.1c+\'1P\';g.E.1l(\'<P X="2-1l" I="\'+g.O+\'"></P>\');g.1q=$(\'#\'+g.O+\'\');g.e.H=g.e.H||\'p\'+e+\'[]\';3(!g.K){g.1q.1g(\'<P X="2-K" I="\'+g.O+\'1F"></P>\');g.K=$(\'#\'+g.O+\'1F\')};g.K=$(g.K);g.16=6(c,d){g.n++;c.2=g;3(d>0)c.I=c.H=\'\';3(d>0)c.I=g.1i(d);c.H=u(g.1j.t(/\\$H/q,$(g.L).D(\'H\')).t(/\\$I/q,$(g.L).D(\'I\')).t(/\\$g/q,e).t(/\\$i/q,d));3((g.l>0)&&((g.n-1)>(g.l)))c.14=1a;g.Y=g.J[d]=c;c=$(c);c.1b(\'\').D(\'k\',\'\')[0].k=\'\';c.Q(\'2-1e\');c.1V(6(){$(5).1X();3(!g.G(\'1Y\',5,g))8 y;m a=\'\',v=u(5.k||\'\');3(g.j&&v&&!v.B(g.1k))a=g.A.1o.t(\'$1d\',u(v.B(/\\.\\w{1,4}$/q)));1p(m f 2a g.J)3(g.J[f]&&g.J[f]!=5)3(g.J[f].k==v)a=g.A.1r.t(\'$p\',v.B(/[^\\/\\\\]+$/q));m b=$(g.L).L();b.Q(\'2\');3(a!=\'\'){g.1s(a);g.n--;g.16(b[0],d);c.1t().2e(b);c.C();8 y};$(5).1v({1w:\'1O\',1x:\'-1Q\'});c.1R(b);g.1y(5,d);g.16(b[0],d+1);3(!g.G(\'1T\',5,g))8 y});$(c).17(\'2\',g)};g.1y=6(c,d){3(!g.G(\'1U\',c,g))8 y;m r=$(\'<P X="2-1W"></P>\'),v=u(c.k||\'\'),a=$(\'<1z X="2-1A" 1A="\'+g.A.12.t(\'$p\',v)+\'">\'+g.A.p.t(\'$p\',v.B(/[^\\/\\\\]+$/q)[0])+\'</1z>\'),b=$(\'<a X="2-C" 2y="#\'+g.O+\'">\'+g.A.C+\'</a>\');g.K.1g(r.1g(b,\' \',a));b.1C(6(){3(!g.G(\'22\',c,g))8 y;g.n--;g.Y.14=y;g.J[d]=10;$(c).C();$(5).1t().C();$(g.Y).1v({1w:\'\',1x:\'\'});$(g.Y).11().1b(\'\').D(\'k\',\'\')[0].k=\'\';3(!g.G(\'24\',c,g))8 y;8 y});3(!g.G(\'25\',c,g))8 y};3(!g.2)g.16(g.e,0);g.n++;g.E.17(\'2\',g)})};$.N($.7.2,{11:6(){m a=$(5).17(\'2\');3(a)a.K.26(\'a.2-C\').1C();8 $(5)},Z:6(a){a=(T(a)==\'19\'?a:\'\')||\'1E\';m o=[];$(\'1h:p.2\').M(6(){3($(5).1b()==\'\')o[o.V]=5});8 $(o).M(6(){5.14=1a}).Q(a)},1f:6(a){a=(T(a)==\'19\'?a:\'\')||\'1E\';8 $(\'1h:p.\'+a).29(a).M(6(){5.14=y})},R:{},1M:6(b,c,d){m e,k;d=d||[];3(d.1G.1H().1I("1J")<0)d=[d];3(T(b)==\'6\'){$.7.2.Z();k=b.13(c||U,d);1K(6(){$.7.2.1f()},1L);8 k};3(b.1G.1H().1I("1J")<0)b=[b];1p(m i=0;i<b.V;i++){e=b[i]+\'\';3(e)(6(a){$.7.2.R[a]=$.7[a]||6(){};$.7[a]=6(){$.7.2.Z();k=$.7.2.R[a].13(5,S);1K(6(){$.7.2.1f()},1L);8 k}})(e)}}});$.7.2.F={j:\'\',l:-1,1j:\'$H\',A:{C:\'x\',1o:\'2g 2h 2i a $1d p.\\2j 2k...\',p:\'$p\',12:\'2l 12: $p\',1r:\'2m p 2n 2o 2p 12:\\n$p\'},15:[\'1n\',\'2q\',\'2r\',\'2s\'],1s:6(s){2u(s)}};$.7.11=6(){8 5.M(6(){2v{5.11()}2w(e){}})};$(6(){$("1h[2x=p].20").2()})})(1u);',62,159,'||MultiFile|if||this|function|fn|return|||||||||||accept|value|max|var|||file|gi|||replace|String||||false||STRING|match|remove|attr||options|trigger|name|id|slaves|list|clone|each|extend|wrapID|div|addClass|intercepted|arguments|typeof|window|length||class|current|disableEmpty|null|reset|selected|apply|disabled|autoIntercept|addSlave|data|new|string|true|val|instanceKey|ext|applied|reEnableEmpty|append|input|generateID|namePattern|rxAccept|wrap|metadata|submit|denied|for|wrapper|duplicate|error|parent|jQuery|css|position|top|addToList|span|title|not|click|className|mfD|_list|constructor|toString|indexOf|Array|setTimeout|1000|intercept|makeArray|absolute|_wrap|3000px|after|meta|afterFileSelect|onFileAppend|change|label|blur|onFileSelect|_F|multi|number|onFileRemove|limit|afterFileRemove|afterFileAppend|find|slice|maxlength|removeClass|in|else|files|form|prepend|Number|You|cannot|select|nTry|again|File|This|has|already|been|ajaxSubmit|ajaxForm|validate|RegExp|alert|try|catch|type|href'.split('|'),0,{}))
admin/js/jquery.ui.autocomplete.js ADDED
@@ -0,0 +1,612 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI Autocomplete 1.8.15
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Autocomplete
9
+ *
10
+ * Depends:
11
+ * jquery.ui.core.js
12
+ * jquery.ui.widget.js
13
+ * jquery.ui.position.js
14
+ */
15
+ (function( $, undefined ) {
16
+
17
+ // used to prevent race conditions with remote data sources
18
+ var requestIndex = 0;
19
+
20
+ $.widget( "ui.autocomplete", {
21
+ options: {
22
+ appendTo: "body",
23
+ autoFocus: false,
24
+ delay: 300,
25
+ minLength: 1,
26
+ position: {
27
+ my: "left top",
28
+ at: "left bottom",
29
+ collision: "none"
30
+ },
31
+ source: null
32
+ },
33
+
34
+ pending: 0,
35
+
36
+ _create: function() {
37
+ var self = this,
38
+ doc = this.element[ 0 ].ownerDocument,
39
+ suppressKeyPress;
40
+
41
+ this.element
42
+ .addClass( "ui-autocomplete-input" )
43
+ .attr( "autocomplete", "off" )
44
+ // TODO verify these actually work as intended
45
+ .attr({
46
+ role: "textbox",
47
+ "aria-autocomplete": "list",
48
+ "aria-haspopup": "true"
49
+ })
50
+ .bind( "keydown.autocomplete", function( event ) {
51
+ if ( self.options.disabled || self.element.propAttr( "readOnly" ) ) {
52
+ return;
53
+ }
54
+
55
+ suppressKeyPress = false;
56
+ var keyCode = $.ui.keyCode;
57
+ switch( event.keyCode ) {
58
+ case keyCode.PAGE_UP:
59
+ self._move( "previousPage", event );
60
+ break;
61
+ case keyCode.PAGE_DOWN:
62
+ self._move( "nextPage", event );
63
+ break;
64
+ case keyCode.UP:
65
+ self._move( "previous", event );
66
+ // prevent moving cursor to beginning of text field in some browsers
67
+ event.preventDefault();
68
+ break;
69
+ case keyCode.DOWN:
70
+ self._move( "next", event );
71
+ // prevent moving cursor to end of text field in some browsers
72
+ event.preventDefault();
73
+ break;
74
+ case keyCode.ENTER:
75
+ case keyCode.NUMPAD_ENTER:
76
+ // when menu is open and has focus
77
+ if ( self.menu.active ) {
78
+ // #6055 - Opera still allows the keypress to occur
79
+ // which causes forms to submit
80
+ suppressKeyPress = true;
81
+ event.preventDefault();
82
+ }
83
+ //passthrough - ENTER and TAB both select the current element
84
+ case keyCode.TAB:
85
+ if ( !self.menu.active ) {
86
+ return;
87
+ }
88
+ self.menu.select( event );
89
+ break;
90
+ case keyCode.ESCAPE:
91
+ self.element.val( self.term );
92
+ self.close( event );
93
+ break;
94
+ default:
95
+ // keypress is triggered before the input value is changed
96
+ clearTimeout( self.searching );
97
+ self.searching = setTimeout(function() {
98
+ // only search if the value has changed
99
+ if ( self.term != self.element.val() ) {
100
+ self.selectedItem = null;
101
+ self.search( null, event );
102
+ }
103
+ }, self.options.delay );
104
+ break;
105
+ }
106
+ })
107
+ .bind( "keypress.autocomplete", function( event ) {
108
+ if ( suppressKeyPress ) {
109
+ suppressKeyPress = false;
110
+ event.preventDefault();
111
+ }
112
+ })
113
+ .bind( "focus.autocomplete", function() {
114
+ if ( self.options.disabled ) {
115
+ return;
116
+ }
117
+
118
+ self.selectedItem = null;
119
+ self.previous = self.element.val();
120
+ })
121
+ .bind( "blur.autocomplete", function( event ) {
122
+ if ( self.options.disabled ) {
123
+ return;
124
+ }
125
+
126
+ clearTimeout( self.searching );
127
+ // clicks on the menu (or a button to trigger a search) will cause a blur event
128
+ self.closing = setTimeout(function() {
129
+ self.close( event );
130
+ self._change( event );
131
+ }, 150 );
132
+ });
133
+ this._initSource();
134
+ this.response = function() {
135
+ return self._response.apply( self, arguments );
136
+ };
137
+ this.menu = $( "<ul></ul>" )
138
+ .addClass( "ui-autocomplete" )
139
+ .appendTo( $( this.options.appendTo || "body", doc )[0] )
140
+ // prevent the close-on-blur in case of a "slow" click on the menu (long mousedown)
141
+ .mousedown(function( event ) {
142
+ // clicking on the scrollbar causes focus to shift to the body
143
+ // but we can't detect a mouseup or a click immediately afterward
144
+ // so we have to track the next mousedown and close the menu if
145
+ // the user clicks somewhere outside of the autocomplete
146
+ var menuElement = self.menu.element[ 0 ];
147
+ if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
148
+ setTimeout(function() {
149
+ $( document ).one( 'mousedown', function( event ) {
150
+ if ( event.target !== self.element[ 0 ] &&
151
+ event.target !== menuElement &&
152
+ !$.ui.contains( menuElement, event.target ) ) {
153
+ self.close();
154
+ }
155
+ });
156
+ }, 1 );
157
+ }
158
+
159
+ // use another timeout to make sure the blur-event-handler on the input was already triggered
160
+ setTimeout(function() {
161
+ clearTimeout( self.closing );
162
+ }, 13);
163
+ })
164
+ .menu({
165
+ focus: function( event, ui ) {
166
+ var item = ui.item.data( "item.autocomplete" );
167
+ if ( false !== self._trigger( "focus", event, { item: item } ) ) {
168
+ // use value to match what will end up in the input, if it was a key event
169
+ if ( /^key/.test(event.originalEvent.type) ) {
170
+ self.element.val( item.value );
171
+ }
172
+ }
173
+ },
174
+ selected: function( event, ui ) {
175
+ var item = ui.item.data( "item.autocomplete" ),
176
+ previous = self.previous;
177
+
178
+ // only trigger when focus was lost (click on menu)
179
+ if ( self.element[0] !== doc.activeElement ) {
180
+ self.element.focus();
181
+ self.previous = previous;
182
+ // #6109 - IE triggers two focus events and the second
183
+ // is asynchronous, so we need to reset the previous
184
+ // term synchronously and asynchronously :-(
185
+ setTimeout(function() {
186
+ self.previous = previous;
187
+ self.selectedItem = item;
188
+ }, 1);
189
+ }
190
+
191
+ if ( false !== self._trigger( "select", event, { item: item } ) ) {
192
+ self.element.val( item.value );
193
+ }
194
+ // reset the term after the select event
195
+ // this allows custom select handling to work properly
196
+ self.term = self.element.val();
197
+
198
+ self.close( event );
199
+ self.selectedItem = item;
200
+ },
201
+ blur: function( event, ui ) {
202
+ // don't set the value of the text field if it's already correct
203
+ // this prevents moving the cursor unnecessarily
204
+ if ( self.menu.element.is(":visible") &&
205
+ ( self.element.val() !== self.term ) ) {
206
+ self.element.val( self.term );
207
+ }
208
+ }
209
+ })
210
+ .zIndex( this.element.zIndex() + 1 )
211
+ // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781
212
+ .css({ top: 0, left: 0 })
213
+ .hide()
214
+ .data( "menu" );
215
+ if ( $.fn.bgiframe ) {
216
+ this.menu.element.bgiframe();
217
+ }
218
+ },
219
+
220
+ destroy: function() {
221
+ this.element
222
+ .removeClass( "ui-autocomplete-input" )
223
+ .removeAttr( "autocomplete" )
224
+ .removeAttr( "role" )
225
+ .removeAttr( "aria-autocomplete" )
226
+ .removeAttr( "aria-haspopup" );
227
+ this.menu.element.remove();
228
+ $.Widget.prototype.destroy.call( this );
229
+ },
230
+
231
+ _setOption: function( key, value ) {
232
+ $.Widget.prototype._setOption.apply( this, arguments );
233
+ if ( key === "source" ) {
234
+ this._initSource();
235
+ }
236
+ if ( key === "appendTo" ) {
237
+ this.menu.element.appendTo( $( value || "body", this.element[0].ownerDocument )[0] )
238
+ }
239
+ if ( key === "disabled" && value && this.xhr ) {
240
+ this.xhr.abort();
241
+ }
242
+ },
243
+
244
+ _initSource: function() {
245
+ var self = this,
246
+ array,
247
+ url;
248
+ if ( $.isArray(this.options.source) ) {
249
+ array = this.options.source;
250
+ this.source = function( request, response ) {
251
+ response( $.ui.autocomplete.filter(array, request.term) );
252
+ };
253
+ } else if ( typeof this.options.source === "string" ) {
254
+ url = this.options.source;
255
+ this.source = function( request, response ) {
256
+ if ( self.xhr ) {
257
+ self.xhr.abort();
258
+ }
259
+ self.xhr = $.ajax({
260
+ url: url,
261
+ data: request,
262
+ dataType: "json",
263
+ autocompleteRequest: ++requestIndex,
264
+ success: function( data, status ) {
265
+ if ( this.autocompleteRequest === requestIndex ) {
266
+ response( data );
267
+ }
268
+ },
269
+ error: function() {
270
+ if ( this.autocompleteRequest === requestIndex ) {
271
+ response( [] );
272
+ }
273
+ }
274
+ });
275
+ };
276
+ } else {
277
+ this.source = this.options.source;
278
+ }
279
+ },
280
+
281
+ search: function( value, event ) {
282
+ value = value != null ? value : this.element.val();
283
+
284
+ // always save the actual value, not the one passed as an argument
285
+ this.term = this.element.val();
286
+
287
+ if ( value.length < this.options.minLength ) {
288
+ return this.close( event );
289
+ }
290
+
291
+ clearTimeout( this.closing );
292
+ if ( this._trigger( "search", event ) === false ) {
293
+ return;
294
+ }
295
+
296
+ return this._search( value );
297
+ },
298
+
299
+ _search: function( value ) {
300
+ this.pending++;
301
+ this.element.addClass( "ui-autocomplete-loading" );
302
+
303
+ this.source( { term: value }, this.response );
304
+ },
305
+
306
+ _response: function( content ) {
307
+ if ( !this.options.disabled && content && content.length ) {
308
+ content = this._normalize( content );
309
+ this._suggest( content );
310
+ this._trigger( "open" );
311
+ } else {
312
+ this.close();
313
+ }
314
+ this.pending--;
315
+ if ( !this.pending ) {
316
+ this.element.removeClass( "ui-autocomplete-loading" );
317
+ }
318
+ },
319
+
320
+ close: function( event ) {
321
+ clearTimeout( this.closing );
322
+ if ( this.menu.element.is(":visible") ) {
323
+ this.menu.element.hide();
324
+ this.menu.deactivate();
325
+ this._trigger( "close", event );
326
+ }
327
+ },
328
+
329
+ _change: function( event ) {
330
+ if ( this.previous !== this.element.val() ) {
331
+ this._trigger( "change", event, { item: this.selectedItem } );
332
+ }
333
+ },
334
+
335
+ _normalize: function( items ) {
336
+ // assume all items have the right format when the first item is complete
337
+ if ( items.length && items[0].label && items[0].value ) {
338
+ return items;
339
+ }
340
+ return $.map( items, function(item) {
341
+ if ( typeof item === "string" ) {
342
+ return {
343
+ label: item,
344
+ value: item
345
+ };
346
+ }
347
+ return $.extend({
348
+ label: item.label || item.value,
349
+ value: item.value || item.label
350
+ }, item );
351
+ });
352
+ },
353
+
354
+ _suggest: function( items ) {
355
+ var ul = this.menu.element
356
+ .empty()
357
+ .zIndex( this.element.zIndex() + 1 );
358
+ this._renderMenu( ul, items );
359
+ // TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate
360
+ this.menu.deactivate();
361
+ this.menu.refresh();
362
+
363
+ // size and position menu
364
+ ul.show();
365
+ this._resizeMenu();
366
+ ul.position( $.extend({
367
+ of: this.element
368
+ }, this.options.position ));
369
+
370
+ if ( this.options.autoFocus ) {
371
+ this.menu.next( new $.Event("mouseover") );
372
+ }
373
+ },
374
+
375
+ _resizeMenu: function() {
376
+ var ul = this.menu.element;
377
+ ul.outerWidth( Math.max(
378
+ ul.width( "" ).outerWidth(),
379
+ this.element.outerWidth()
380
+ ) );
381
+ },
382
+
383
+ _renderMenu: function( ul, items ) {
384
+ var self = this;
385
+ $.each( items, function( index, item ) {
386
+ self._renderItem( ul, item );
387
+ });
388
+ },
389
+
390
+ _renderItem: function( ul, item) {
391
+ return $( "<li></li>" )
392
+ .data( "item.autocomplete", item )
393
+ .append( $( "<a></a>" ).text( item.label ) )
394
+ .appendTo( ul );
395
+ },
396
+
397
+ _move: function( direction, event ) {
398
+ if ( !this.menu.element.is(":visible") ) {
399
+ this.search( null, event );
400
+ return;
401
+ }
402
+ if ( this.menu.first() && /^previous/.test(direction) ||
403
+ this.menu.last() && /^next/.test(direction) ) {
404
+ this.element.val( this.term );
405
+ this.menu.deactivate();
406
+ return;
407
+ }
408
+ this.menu[ direction ]( event );
409
+ },
410
+
411
+ widget: function() {
412
+ return this.menu.element;
413
+ }
414
+ });
415
+
416
+ $.extend( $.ui.autocomplete, {
417
+ escapeRegex: function( value ) {
418
+ return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
419
+ },
420
+ filter: function(array, term) {
421
+ var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
422
+ return $.grep( array, function(value) {
423
+ return matcher.test( value.label || value.value || value );
424
+ });
425
+ }
426
+ });
427
+
428
+ }( jQuery ));
429
+
430
+ /*
431
+ * jQuery UI Menu (not officially released)
432
+ *
433
+ * This widget isn't yet finished and the API is subject to change. We plan to finish
434
+ * it for the next release. You're welcome to give it a try anyway and give us feedback,
435
+ * as long as you're okay with migrating your code later on. We can help with that, too.
436
+ *
437
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
438
+ * Dual licensed under the MIT or GPL Version 2 licenses.
439
+ * http://jquery.org/license
440
+ *
441
+ * http://docs.jquery.com/UI/Menu
442
+ *
443
+ * Depends:
444
+ * jquery.ui.core.js
445
+ * jquery.ui.widget.js
446
+ */
447
+ (function($) {
448
+
449
+ $.widget("ui.menu", {
450
+ _create: function() {
451
+ var self = this;
452
+ this.element
453
+ .addClass("ui-menu ui-widget ui-widget-content ui-corner-all")
454
+ .attr({
455
+ role: "listbox",
456
+ "aria-activedescendant": "ui-active-menuitem"
457
+ })
458
+ .click(function( event ) {
459
+ if ( !$( event.target ).closest( ".ui-menu-item a" ).length ) {
460
+ return;
461
+ }
462
+ // temporary
463
+ event.preventDefault();
464
+ self.select( event );
465
+ });
466
+ this.refresh();
467
+ },
468
+
469
+ refresh: function() {
470
+ var self = this;
471
+
472
+ // don't refresh list items that are already adapted
473
+ var items = this.element.children("li:not(.ui-menu-item):has(a)")
474
+ .addClass("ui-menu-item")
475
+ .attr("role", "menuitem");
476
+
477
+ items.children("a")
478
+ .addClass("ui-corner-all")
479
+ .attr("tabindex", -1)
480
+ // mouseenter doesn't work with event delegation
481
+ .mouseenter(function( event ) {
482
+ self.activate( event, $(this).parent() );
483
+ })
484
+ .mouseleave(function() {
485
+ self.deactivate();
486
+ });
487
+ },
488
+
489
+ activate: function( event, item ) {
490
+ this.deactivate();
491
+ if (this.hasScroll()) {
492
+ var offset = item.offset().top - this.element.offset().top,
493
+ scroll = this.element.scrollTop(),
494
+ elementHeight = this.element.height();
495
+ if (offset < 0) {
496
+ this.element.scrollTop( scroll + offset);
497
+ } else if (offset >= elementHeight) {
498
+ this.element.scrollTop( scroll + offset - elementHeight + item.height());
499
+ }
500
+ }
501
+ this.active = item.eq(0)
502
+ .children("a")
503
+ .addClass("ui-state-hover")
504
+ .attr("id", "ui-active-menuitem")
505
+ .end();
506
+ this._trigger("focus", event, { item: item });
507
+ },
508
+
509
+ deactivate: function() {
510
+ if (!this.active) { return; }
511
+
512
+ this.active.children("a")
513
+ .removeClass("ui-state-hover")
514
+ .removeAttr("id");
515
+ this._trigger("blur");
516
+ this.active = null;
517
+ },
518
+
519
+ next: function(event) {
520
+ this.move("next", ".ui-menu-item:first", event);
521
+ },
522
+
523
+ previous: function(event) {
524
+ this.move("prev", ".ui-menu-item:last", event);
525
+ },
526
+
527
+ first: function() {
528
+ return this.active && !this.active.prevAll(".ui-menu-item").length;
529
+ },
530
+
531
+ last: function() {
532
+ return this.active && !this.active.nextAll(".ui-menu-item").length;
533
+ },
534
+
535
+ move: function(direction, edge, event) {
536
+ if (!this.active) {
537
+ this.activate(event, this.element.children(edge));
538
+ return;
539
+ }
540
+ var next = this.active[direction + "All"](".ui-menu-item").eq(0);
541
+ if (next.length) {
542
+ this.activate(event, next);
543
+ } else {
544
+ this.activate(event, this.element.children(edge));
545
+ }
546
+ },
547
+
548
+ // TODO merge with previousPage
549
+ nextPage: function(event) {
550
+ if (this.hasScroll()) {
551
+ // TODO merge with no-scroll-else
552
+ if (!this.active || this.last()) {
553
+ this.activate(event, this.element.children(".ui-menu-item:first"));
554
+ return;
555
+ }
556
+ var base = this.active.offset().top,
557
+ height = this.element.height(),
558
+ result = this.element.children(".ui-menu-item").filter(function() {
559
+ var close = $(this).offset().top - base - height + $(this).height();
560
+ // TODO improve approximation
561
+ return close < 10 && close > -10;
562
+ });
563
+
564
+ // TODO try to catch this earlier when scrollTop indicates the last page anyway
565
+ if (!result.length) {
566
+ result = this.element.children(".ui-menu-item:last");
567
+ }
568
+ this.activate(event, result);
569
+ } else {
570
+ this.activate(event, this.element.children(".ui-menu-item")
571
+ .filter(!this.active || this.last() ? ":first" : ":last"));
572
+ }
573
+ },
574
+
575
+ // TODO merge with nextPage
576
+ previousPage: function(event) {
577
+ if (this.hasScroll()) {
578
+ // TODO merge with no-scroll-else
579
+ if (!this.active || this.first()) {
580
+ this.activate(event, this.element.children(".ui-menu-item:last"));
581
+ return;
582
+ }
583
+
584
+ var base = this.active.offset().top,
585
+ height = this.element.height();
586
+ result = this.element.children(".ui-menu-item").filter(function() {
587
+ var close = $(this).offset().top - base + height - $(this).height();
588
+ // TODO improve approximation
589
+ return close < 10 && close > -10;
590
+ });
591
+
592
+ // TODO try to catch this earlier when scrollTop indicates the last page anyway
593
+ if (!result.length) {
594
+ result = this.element.children(".ui-menu-item:first");
595
+ }
596
+ this.activate(event, result);
597
+ } else {
598
+ this.activate(event, this.element.children(".ui-menu-item")
599
+ .filter(!this.active || this.first() ? ":last" : ":first"));
600
+ }
601
+ },
602
+
603
+ hasScroll: function() {
604
+ return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]("scrollHeight");
605
+ },
606
+
607
+ select: function( event ) {
608
+ this._trigger("selected", event, { item: this.active });
609
+ }
610
+ });
611
+
612
+ }(jQuery));
admin/js/jquery.ui.autocomplete.min.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI Autocomplete 1.8.15
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Autocomplete
9
+ *
10
+ * Depends:
11
+ * jquery.ui.core.js
12
+ * jquery.ui.widget.js
13
+ * jquery.ui.position.js
14
+ */
15
+ (function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.propAttr("readOnly"))){g=
16
+ false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=
17
+ a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};
18
+ this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&
19
+ a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");
20
+ d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&
21
+ b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source=
22
+ this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==false)return this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else this.close();
23
+ this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return a;return d.map(a,function(b){if(typeof b==="string")return{label:b,value:b};return d.extend({label:b.label||
24
+ b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,b){var g=this;
25
+ d.each(b,function(c,f){g._renderItem(a,f)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
26
+ "\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery);
27
+ (function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
28
+ -1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");
29
+ this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b,
30
+ this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
31
+ this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
32
+ this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[d.fn.prop?"prop":"attr"]("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})})(jQuery);
admin/js/jqueryFileTree/images/directory.png ADDED
Binary file
admin/js/jqueryFileTree/images/folder_open.png ADDED
Binary file
admin/js/jqueryFileTree/images/spinner.gif ADDED
Binary file
admin/js/jqueryFileTree/jqueryFileTree.css ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #file_browser {
2
+ border: 2px solid #999;
3
+ height: 200px;
4
+ overflow: auto;
5
+ padding: 4px 8px;
6
+ background: #fff;
7
+ margin: 4px 0px;
8
+ width: 350px;
9
+ position:relative;
10
+ display:none;
11
+ }
12
+ .browsefiles {margin-left:5px;}
13
+
14
+ ul.jqueryDirTree {
15
+ font-family: Verdana, sans-serif;
16
+ font-size: 11px;
17
+ line-height: 18px;
18
+ padding: 0px;
19
+ margin: 0px;
20
+ }
21
+
22
+ ul.jqueryDirTree li {
23
+ list-style: none;
24
+ padding: 2px 0px;
25
+ padding-left: 20px;
26
+ margin: 0px;
27
+ white-space: nowrap;
28
+ }
29
+
30
+ ul.jqueryDirTree a {
31
+ color: #333;
32
+ text-decoration: none;
33
+ display: block;
34
+ padding: 0px 2px;
35
+ }
36
+
37
+ ul.jqueryDirTree a:hover {
38
+ background: #bdf;
39
+ }
40
+ ul.jqueryDirTree li.active a {
41
+ background: #bdf;
42
+ }
43
+ ul.jqueryDirTree li.active li a {
44
+ background: none;
45
+ }
46
+ ul.jqueryDirTree li.active li a:hover {
47
+ background: #bdf;
48
+ }
49
+
50
+ /* Core Styles */
51
+ .jqueryDirTree li.directory { background: url(images/directory.png) left top no-repeat; }
52
+ .jqueryDirTree li.expanded { background: url(images/folder_open.png) left top no-repeat; }
53
+ .jqueryDirTree li.file { background: url(images/file.png) left top no-repeat; }
54
+ .jqueryDirTree li.wait { background: url(images/spinner.gif) left top no-repeat; }
55
+ /* File Extensions*/
56
+ .jqueryDirTree li.ext_3gp { background: url(images/film.png) left top no-repeat; }
57
+ .jqueryDirTree li.ext_avi { background: url(images/film.png) left top no-repeat; }
58
+ .jqueryDirTree li.ext_bat { background: url(images/application.png) left top no-repeat; }
59
+ .jqueryDirTree li.ext_bmp { background: url(images/picture.png) left top no-repeat; }
60
+ .jqueryDirTree li.ext_com { background: url(images/application.png) left top no-repeat; }
61
+ .jqueryDirTree li.ext_exe { background: url(images/application.png) left top no-repeat; }
62
+ .jqueryDirTree li.ext_gif { background: url(images/picture.png) left top no-repeat; }
63
+ .jqueryDirTree li.ext_fla { background: url(images/flash.png) left top no-repeat; }
64
+ .jqueryDirTree li.ext_jpg { background: url(images/picture.png) left top no-repeat; }
65
+ .jqueryDirTree li.ext_jpeg { background: url(images/picture.png) left top no-repeat; }
66
+ .jqueryDirTree li.ext_m4p { background: url(images/music.png) left top no-repeat; }
67
+ .jqueryDirTree li.ext_mov { background: url(images/film.png) left top no-repeat; }
68
+ .jqueryDirTree li.ext_mp3 { background: url(images/music.png) left top no-repeat; }
69
+ .jqueryDirTree li.ext_mp4 { background: url(images/film.png) left top no-repeat; }
70
+ .jqueryDirTree li.ext_mpg { background: url(images/film.png) left top no-repeat; }
71
+ .jqueryDirTree li.ext_mpeg { background: url(images/film.png) left top no-repeat; }
72
+ .jqueryDirTree li.ext_ogg { background: url(images/music.png) left top no-repeat; }
73
+ .jqueryDirTree li.ext_pcx { background: url(images/picture.png) left top no-repeat; }
74
+ .jqueryDirTree li.ext_pdf { background: url(images/pdf.png) left top no-repeat; }
75
+ .jqueryDirTree li.ext_png { background: url(images/picture.png) left top no-repeat; }
76
+ .jqueryDirTree li.ext_swf { background: url(images/flash.png) left top no-repeat; }
77
+ .jqueryDirTree li.ext_tif { background: url(images/picture.png) left top no-repeat; }
78
+ .jqueryDirTree li.ext_tiff { background: url(images/picture.png) left top no-repeat; }
79
+ .jqueryDirTree li.ext_wav { background: url(images/music.png) left top no-repeat; }
80
+ .jqueryDirTree li.ext_wmv { background: url(images/film.png) left top no-repeat; }
81
+ .jqueryDirTree li.ext_zip { background: url(images/zip.png) left top no-repeat; }
admin/js/jqueryFileTree/jqueryFileTree.js ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // jQuery File Tree Plugin
2
+ //
3
+ // Version 1.01
4
+ //
5
+ // Cory S.N. LaViska
6
+ // A Beautiful Site (http://abeautifulsite.net/)
7
+ // 24 March 2008
8
+ //
9
+ // Visit http://abeautifulsite.net/notebook.php?article=58 for more information
10
+ //
11
+ // Usage: $('.fileTreeDemo').fileTree( options, callback )
12
+ //
13
+ // Options: root - root folder to display; default = /
14
+ // script - location of the serverside AJAX file to use; default = jqueryFileTree.php
15
+ // folderEvent - event to trigger expand/collapse; default = click
16
+ // expandSpeed - default = 500 (ms); use -1 for no animation
17
+ // collapseSpeed - default = 500 (ms); use -1 for no animation
18
+ // expandEasing - easing function to use on expand (optional)
19
+ // collapseEasing - easing function to use on collapse (optional)
20
+ // multiFolder - whether or not to limit the browser to one subfolder at a time
21
+ // loadMessage - Message to display while initial tree loads (can be HTML)
22
+ //
23
+ // History:
24
+ //
25
+ // 1.01 - updated to work with foreign characters in directory/file names (12 April 2008)
26
+ // 1.00 - released (24 March 2008)
27
+ //
28
+ // TERMS OF USE
29
+ //
30
+ // This plugin is dual-licensed under the GNU General Public License and the MIT License and
31
+ // is copyright 2008 A Beautiful Site, LLC.
32
+ //
33
+ if(jQuery) (function($){
34
+
35
+ $.extend($.fn, {
36
+ fileTree: function(o, h) {
37
+ // Defaults
38
+ if( !o ) var o = {};
39
+ if( o.root == undefined ) o.root = '/';
40
+ if( o.script == undefined ) o.script = 'jqueryFileTree.php';
41
+ if( o.folderEvent == undefined ) o.folderEvent = 'dblclick';
42
+ if( o.expandSpeed == undefined ) o.expandSpeed= 200;
43
+ if( o.collapseSpeed == undefined ) o.collapseSpeed= 500;
44
+ if( o.expandEasing == undefined ) o.expandEasing = null;
45
+ if( o.collapseEasing == undefined ) o.collapseEasing = null;
46
+ if( o.multiFolder == undefined ) o.multiFolder = true;
47
+ if( o.loadMessage == undefined ) o.loadMessage = 'Loading...';
48
+
49
+ $(this).each( function() {
50
+
51
+ function showTree(c, t) {
52
+ $(c).addClass('wait');
53
+ $(".jqueryFileTree.start").remove();
54
+ $.post(o.script, { dir: t }, function(data) {
55
+ $(c).find('.start').html('');
56
+ $(c).removeClass('wait').append(data);
57
+ if( o.root == t )
58
+ $(c).find('UL:hidden').show();
59
+ else
60
+ $(c).find('UL:hidden').slideDown({ duration: o.expandSpeed, easing: o.expandEasing });
61
+ bindTree(c);
62
+ });
63
+ }
64
+
65
+ function bindTree(t) {
66
+ $(t).find('li a').bind(o.folderEvent, function() {
67
+ if( $(this).parent().hasClass('collapsed') ) {
68
+ // Expand
69
+ if( !o.multiFolder ) {
70
+ $(this).parent().parent().find('ul').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
71
+ $(this).parent().parent().find('li.directory').removeClass('expanded').addClass('collapsed');
72
+ }
73
+ $(this).parent().find('ul').remove(); // cleanup
74
+ showTree( $(this).parent(), escape($(this).attr('rel').match( /.*\// )) );
75
+ $(this).parent().removeClass('collapsed').addClass('expanded');
76
+ } else {
77
+ // Collapse
78
+ $(this).parent().find('ul').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
79
+ $(this).parent().removeClass('expanded').addClass('collapsed');
80
+ }
81
+ return false;
82
+ });
83
+ $(t).find('li a').bind('click', function() {
84
+ h($(this).attr('rel'));
85
+ $(this).parents('#file_browser').find('.active').removeClass('active');
86
+ $(this).parent().addClass('active');
87
+ return false;
88
+ });
89
+ }
90
+ // Loading message
91
+ $(this).html('<ul class="jqueryFileTree start"><li class="wait">' + o.loadMessage + '<li></ul>');
92
+ // Get the initial file list
93
+ showTree( $(this), escape(o.root) );
94
+ });
95
+ }
96
+ });
97
+
98
+ })(jQuery);
admin/js/ngg.ajax.js ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Ajax Plugin for NextGEN gallery
3
+ * Version: 1.4.1
4
+ * Author : Alex Rabe
5
+ *
6
+ */
7
+ (function($) {
8
+ nggAjax = {
9
+ settings: {
10
+ url: nggAjaxSetup.url,
11
+ type: "POST",
12
+ action: nggAjaxSetup.action,
13
+ operation : nggAjaxSetup.operation,
14
+ nonce: nggAjaxSetup.nonce,
15
+ ids: nggAjaxSetup.ids,
16
+ permission: nggAjaxSetup.permission,
17
+ error: nggAjaxSetup.error,
18
+ failure: nggAjaxSetup.failure,
19
+ timeout: 10000
20
+ },
21
+
22
+ run: function( index ) {
23
+ s = this.settings;
24
+ var req = $.ajax({
25
+ type: "POST",
26
+ url: s.url,
27
+ data:"action=" + s.action + "&operation=" + s.operation + "&_wpnonce=" + s.nonce + "&image=" + s.ids[index],
28
+ cache: false,
29
+ timeout: 10000,
30
+ success: function(msg){
31
+ switch ( parseInt(msg) ) {
32
+ case -1:
33
+ nggProgressBar.addNote( nggAjax.settings.permission );
34
+ break;
35
+ case 0:
36
+ nggProgressBar.addNote( nggAjax.settings.error );
37
+ break;
38
+ case 1:
39
+ // show nothing, its better
40
+ break;
41
+ default:
42
+ // Return the message
43
+ nggProgressBar.addNote( "<strong>ID " + nggAjax.settings.ids[index] + ":</strong> " + nggAjax.settings.failure, msg );
44
+ break;
45
+ }
46
+
47
+ },
48
+ error: function (msg) {
49
+ nggProgressBar.addNote( "<strong>ID " + nggAjax.settings.ids[index] + ":</strong> " + nggAjax.settings.failure, msg.responseText );
50
+ },
51
+ complete: function () {
52
+ index++;
53
+ nggProgressBar.increase( index );
54
+ // parse the whole array
55
+ if (index < nggAjax.settings.ids.length)
56
+ nggAjax.run( index );
57
+ else
58
+ nggProgressBar.finished();
59
+ }
60
+ });
61
+ },
62
+
63
+ readIDs: function( index ) {
64
+ s = this.settings;
65
+ var req = $.ajax({
66
+ type: "POST",
67
+ url: s.url,
68
+ data:"action=" + s.action + "&operation=" + s.operation + "&_wpnonce=" + s.nonce + "&image=" + s.ids[index],
69
+ dataType: "json",
70
+ cache: false,
71
+ timeout: 10000,
72
+ success: function(msg){
73
+ // join the array
74
+ imageIDS = imageIDS.concat(msg);
75
+ },
76
+ error: function (msg) {
77
+ nggProgressBar.addNote( "<strong>ID " + nggAjax.settings.ids[index] + ":</strong> " + nggAjax.settings.failure, msg.responseText );
78
+ },
79
+ complete: function () {
80
+ index++;
81
+ nggProgressBar.increase( index );
82
+ // parse the whole array
83
+ if (index < nggAjax.settings.ids.length)
84
+ nggAjax.readIDs( index );
85
+ else {
86
+ // and now run the image operation
87
+ index = 0;
88
+ nggAjax.settings.ids = imageIDS;
89
+ nggAjax.settings.operation = nextOperation;
90
+ nggAjax.settings.maxStep = imageIDS.length;
91
+ nggProgressBar.init( nggAjax.settings );
92
+ nggAjax.run( index );
93
+ }
94
+ }
95
+ });
96
+ },
97
+
98
+ init: function( s ) {
99
+
100
+ var index = 0;
101
+
102
+ // get the settings
103
+ this.settings = $.extend( {}, this.settings, {}, s || {} );
104
+
105
+ // a gallery operation need first all image ids via ajax
106
+ if ( this.settings.operation.substring(0, 8) == 'gallery_' ) {
107
+ nextOperation = this.settings.operation.substring(8);
108
+ //first run, get all the ids
109
+ this.settings.operation = 'get_image_ids';
110
+ imageIDS = new Array();
111
+ this.readIDs( index );
112
+ } else {
113
+ // start the ajax process
114
+ this.run( index );
115
+ }
116
+ }
117
+ }
118
+ }(jQuery));
admin/js/ngg.autocomplete.js ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Implementation of jQuery UI Autocomplete
3
+ * see http://jqueryui.com/demos/autocomplete/
4
+ * Version: 1.0.1
5
+ * Author : Alex Rabe
6
+ *
7
+ */
8
+ jQuery.fn.nggAutocomplete = function ( args ) {
9
+
10
+ var defaults = { type: 'image',
11
+ domain: '',
12
+ limit: 50 };
13
+
14
+ var s = jQuery.extend( {}, defaults, args);
15
+
16
+ var settings = { method: 'autocomplete',
17
+ type: s.type,
18
+ format: 'json',
19
+ callback: 'json',
20
+ limit: s.limit };
21
+
22
+ var obj = this.selector;
23
+ var id = jQuery(this).attr('id');
24
+ var cache = {}, lastXhr;
25
+
26
+ // get current value of drop down field
27
+ var c_text = jQuery(obj + ' :selected').text();
28
+ var c_val = jQuery(obj).val();
29
+ // IE7 / IE 8 didnt get often the correct width
30
+ if (s.width == undefined)
31
+ var c_width = jQuery(this).width();
32
+ else
33
+ var c_width = s.width;
34
+ //hide first the drop down field
35
+ jQuery(obj).hide();
36
+ jQuery(obj).after('<input name="' + id + '_ac" type="text" id="' + id + '_ac"/>');
37
+ // Fill up current value & style
38
+ jQuery(obj + "_ac").val(c_text);
39
+ jQuery(obj + "_ac").css('width', c_width);
40
+ // Add the dropdown icon
41
+ jQuery(obj + "_ac").addClass('ui-autocomplete-start')
42
+ jQuery(obj + "_ac").autocomplete({
43
+ source: function( request, response ) {
44
+ var term = request.term;
45
+ if ( term in cache ) {
46
+ response( cache[ term ] );
47
+ return;
48
+ }
49
+ // adding more $_GET parameter
50
+ request = jQuery.extend( {}, settings, request);
51
+ lastXhr = jQuery.getJSON( s.domain, request, function( data, status, xhr ) {
52
+ // add term to cache
53
+ cache[ term ] = data;
54
+ if ( xhr === lastXhr )
55
+ response( data );
56
+ });
57
+ },
58
+ minLength: 0,
59
+ select: function( event, ui ) {
60
+ // adding this to the dropdown list
61
+ jQuery(obj).append( new Option(ui.item.label, ui.item.id) );
62
+ // now select it
63
+ jQuery(obj).val(ui.item.id);
64
+ jQuery(obj + "_ac").removeClass('ui-autocomplete-start');
65
+ }
66
+ });
67
+
68
+ jQuery(obj + "_ac").click(function() {
69
+
70
+ var search = jQuery(obj + "_ac").val();
71
+ // if the value is prefilled, we pass a empty string
72
+ if ( search == c_text)
73
+ search = '';
74
+ // pass empty string as value to search for, displaying all results
75
+ jQuery(obj + "_ac").autocomplete('search', search );
76
+ });
77
+ }
admin/js/ngg.progressbar.js ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Progress bar Plugin for NextGEN gallery
3
+ * Version: 2.0.3
4
+ * Author : Alex Rabe
5
+ *
6
+ */
7
+ (function($) {
8
+ nggProgressBar = {
9
+
10
+ settings: {
11
+ id: 'progressbar',
12
+ maxStep: 100,
13
+ wait: false,
14
+ header: '',
15
+ init:false
16
+ },
17
+
18
+ init: function( s ) {
19
+
20
+ s = this.settings = $.extend( {}, this.settings, {}, s || {} );
21
+ width = Math.round( ( 100 / s.maxStep ) * 100 ) /100;
22
+ // add the initial progressbar
23
+ if ( $( "#" + s.id + "_dialog" ).length == 0) {
24
+ s.header = (s.header.length > 0) ? s.header : '' ;
25
+ $("body").append('<div id="' + s.id + '_dialog"><div id="' + s.id + '" class="progressborder"><div class="' + s.id + '"><span>0%</span></div></div></div>');
26
+ $('html,body').scrollTop(0); // works only in IE, FF
27
+ // we open the dialog
28
+ $( "#" + s.id + "_dialog" ).dialog({
29
+ width: 640,
30
+ resizable : true,
31
+ modal: true,
32
+ title: s.header
33
+ });
34
+ }
35
+ // get the pointer to the dialog
36
+ div = $('#' + s.id + '_dialog');
37
+ s.init = true;
38
+ },
39
+
40
+ addMessage: function( message ) {
41
+ s = this.settings;
42
+ if ( div.find("#" + s.id + "_message").length == 0)
43
+ div.append('<div class="' + s.id + '_message"><span style="display:block" id="' + s.id + '_message">' + message + '</span></div>');
44
+ else
45
+ $("#" + s.id + "_message").html( message );
46
+ },
47
+
48
+ addNote: function( note, detail ) {
49
+ s = this.settings;
50
+ s.wait = true;
51
+ if ( div.find("#" + s.id + "_note").length == 0)
52
+ div.append('<ul id="' + s.id + '_note">&nbsp;</ul>');
53
+
54
+ if (detail)
55
+ $("#" + s.id + "_note").append("<li>" + note + "<div class='show_details'><span>[more]</span><br />" + detail + "</div></li>");
56
+ else
57
+ $("#" + s.id + "_note").append("<li>" + note + "</li>");
58
+ // increase the height to show the note
59
+ div.dialog("option", "height", 220);
60
+ },
61
+
62
+ increase: function( step ) {
63
+ s = this.settings;
64
+ var value = step * width + "%";
65
+ var rvalue = Math.round (step * width) + "%" ;
66
+ $("#" + s.id + " div").width( value );
67
+ $("#" + s.id + " span").html( rvalue );
68
+ },
69
+
70
+ finished: function() {
71
+ s = this.settings;
72
+ $("#" + s.id + " div").width( '100%' );
73
+ $("#" + s.id + " span").html( '100%' );
74
+ // in the case we add a note , we should wait for a click
75
+ if (s.wait) {
76
+ $("#" + s.id).delay(1000).hide("slow");
77
+ div.click(function () {
78
+ $("#" + s.id + "_dialog").dialog("destroy");
79
+ $("#" + s.id + "_dialog").remove();
80
+ // In the casee it's the manage page, force a submit
81
+ $('.nggform').prepend("<input type=\"hidden\" name=\"ajax_callback\" value=\"0\">");
82
+ $('.nggform').submit();
83
+ });
84
+ } else {
85
+
86
+ window.setTimeout(function() {
87
+ $("#" + s.id + "_dialog" ).delay(4000).dialog("destroy");
88
+ $("#" + s.id + "_dialog").remove();
89
+ // In the casee it's the manage page, force a submit
90
+ $('.nggform').prepend("<input type=\"hidden\" name=\"ajax_callback\" value=\"1\">");
91
+ $('.nggform').delay(4000).submit();
92
+ }, 1000);
93
+ }
94
+ }
95
+ };
96
+ })(jQuery);
admin/js/ngg_social_media.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
2
+ (function(d, s, id) {
3
+ var js, fjs = d.getElementsByTagName(s)[0];
4
+ if (d.getElementById(id)) return;
5
+ js = d.createElement(s); js.id = id;
6
+ js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
7
+ fjs.parentNode.insertBefore(js, fjs);
8
+ }(document, 'script', 'facebook-jssdk'));
admin/js/plupload.handler.js ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * NextGEN Gallery - plupload Handlers
3
+ *
4
+ * Built on top of the plupload library
5
+ * http://www.plupload.com version 1.4.2
6
+ *
7
+ * version 1.0.0
8
+ */
9
+
10
+ // on load change the upload to plupload
11
+ function initUploader() {
12
+
13
+ jQuery(document).ready(function($){
14
+
15
+ /* Not working in chrome, needs rework
16
+ var dropElm = jQuery('#' + uploader.settings.drop_element);
17
+ if (dropElm.length && uploader.features.dragdrop) {
18
+ dropElm.bind('dragenter', function() {
19
+ jQuery(this).css('border', '3px dashed #cccccc');
20
+ });
21
+ dropElm.bind('dragout drop', function() {
22
+ jQuery(this).css('border', 'none');
23
+ });
24
+ }*/
25
+
26
+ // enable or disable the resize feature
27
+ jQuery('#image_resize').bind('change', function() {
28
+ var arg = jQuery(this).prop('checked');
29
+ setResize( arg );
30
+
31
+ if ( arg )
32
+ setUserSetting('ngg_upload_resize', '1');
33
+ else
34
+ deleteUserSetting('ngg_upload_resize');
35
+ });
36
+
37
+ // get user settings from cookie
38
+ setResize( getUserSetting('ngg_upload_resize', false) );
39
+
40
+ if ( uploader.features.dragdrop )
41
+ jQuery('.ngg-dragdrop-info').show();
42
+
43
+ jQuery("#uploadimage_btn").after("<input class='button-primary' type='button' name='uploadimage' id='plupload_btn' value='" + uploader.settings.i18n.upload + "' />")
44
+ .remove();
45
+ jQuery("#plupload_btn").click( function() { uploader.start(); } );
46
+ });
47
+ }
48
+
49
+ // called when a file is added
50
+ function fileQueued( fileObj ) {
51
+ debug('[FilesAdded]', fileObj);
52
+
53
+ filesize = " (" + plupload.formatSize(fileObj.size) + ") ";
54
+ jQuery("#txtFileName").val(fileObj.name);
55
+ jQuery("#uploadQueue")
56
+ .append("<div id='" + fileObj.id + "' class='nggUploadItem'> [<a href=''>" + uploader.settings.i18n.remove + "</a>] " + fileObj.name + filesize + "</div>")
57
+ .children("div:last").slideDown("slow")
58
+ .end();
59
+ jQuery('#' + fileObj.id + ' a').click(function(e) {
60
+ jQuery('#' + fileObj.id).remove();
61
+ uploader.removeFile(fileObj);
62
+ e.preventDefault();
63
+ });
64
+ }
65
+
66
+ // called before the uploads start
67
+ function uploadStart(fileObj) {
68
+ debug('[uploadStart]');
69
+ nggProgressBar.init(nggAjaxOptions);
70
+ // check if a gallery is selected
71
+ if (jQuery('#galleryselect').val() > "0") {
72
+ debug('[gallery selected]');
73
+ // update the selected gallery in the post_params
74
+ uploader.settings.multipart_params.galleryselect = jQuery('#galleryselect').val();
75
+ } else {
76
+ debug('[gallery not selected]');
77
+ jQuery('#uploadimage_form').prepend("<input type=\"hidden\" name=\"swf_callback\" value=\"-1\">");
78
+ jQuery("#uploadimage_form").submit();
79
+ }
80
+ return true;
81
+ }
82
+
83
+ // called during the upload progress
84
+ function uploadProgress(fileObj, bytesDone, bytesTotal) {
85
+ var percent = Math.ceil((bytesDone / bytesTotal) * 100);
86
+ debug('[uploadProgress]', fileObj.name + ' : ' + percent + "%");
87
+ nggProgressBar.increase( percent );
88
+ jQuery("#progressbar span").text(percent + "% - " + fileObj.name);
89
+ }
90
+
91
+ // called when all files are uploaded
92
+ function uploadComplete(fileObj) {
93
+ debug('[uploadComplete]');
94
+
95
+ // Upload the next file until queue is empty
96
+ if ( uploader.total.queued == 0) {
97
+ //TODO: we submit here no error code
98
+ jQuery('#uploadimage_form').prepend("<input type=\"hidden\" name=\"swf_callback\" value=\"0\">");
99
+ nggProgressBar.finished();
100
+ jQuery("#uploadimage_form").submit();
101
+ }
102
+ }
103
+
104
+ // called when the file is uploaded
105
+ function uploadSuccess(fileObj, serverData) {
106
+ debug('[uploadSuccess]', serverData);
107
+
108
+ if (serverData.response != 0)
109
+ nggProgressBar.addNote("<strong>ERROR</strong>: " + fileObj.name + " : " + serverData.response);
110
+
111
+ jQuery("#" + fileObj.id).hide("slow");
112
+ jQuery("#" + fileObj.id).remove();
113
+ }
114
+
115
+ function cancelUpload() {
116
+ uploader.stop();
117
+ jQuery.each(uploader.files, function(i,file) {
118
+ if (file.status == plupload.STOPPED)
119
+ jQuery('#' + file.id).remove();
120
+ });
121
+ }
122
+
123
+ function uploadError(fileObj, errorCode, message) {
124
+ debug('[uploadError]', errorCode, message);
125
+ switch (errorCode) {
126
+ case plupload.FAILED:
127
+ error_name = fileObj.name + " : " + pluploadL10n.upload_failed;
128
+ break;
129
+ case plupload.FILE_EXTENSION_ERROR:
130
+ error_name = fileObj.name + " : " + pluploadL10n.invalid_filetype;
131
+ break;
132
+ case plupload.FILE_SIZE_ERROR:
133
+ error_name = fileObj.name + " : " + pluploadL10n.upload_limit_exceeded;
134
+ break;
135
+ case plupload.IMAGE_FORMAT_ERROR:
136
+ error_name = fileObj.name + " : " + pluploadL10n.not_an_image;
137
+ break;
138
+ case plupload.IMAGE_MEMORY_ERROR:
139
+ error_name = fileObj.name + " : " + pluploadL10n.image_memory_exceeded;
140
+ break;
141
+ case plupload.IMAGE_DIMENSIONS_ERROR:
142
+ error_name = fileObj.name + " : " + pluploadL10n.image_dimensions_exceeded;
143
+ break;
144
+ case plupload.GENERIC_ERROR:
145
+ error_name = pluploadL10n.upload_failed;
146
+ break;
147
+ case plupload.IO_ERROR:
148
+ error_name = pluploadL10n.io_error;
149
+ break;
150
+ case plupload.HTTP_ERROR:
151
+ error_name = pluploadL10n.http_error;
152
+ break;
153
+ case plupload.INIT_ERROR:
154
+ /* what should we do in this case ? */
155
+ //switchUploader(0);
156
+ //jQuery('.upload-html-bypass').hide();
157
+ break;
158
+ case plupload.SECURITY_ERROR:
159
+ error_name = pluploadL10n.security_error;
160
+ break;
161
+ case plupload.UPLOAD_ERROR.UPLOAD_STOPPED:
162
+ case plupload.UPLOAD_ERROR.FILE_CANCELLED:
163
+ break;
164
+ default:
165
+ FileError(fileObj, pluploadL10n.default_error);
166
+ }
167
+ nggProgressBar.addNote("<strong>ERROR " + error_name + " </strong>: " + message);
168
+ jQuery("#" + fileObj.id).hide("slow");
169
+ jQuery("#" + fileObj.id).remove();
170
+ }
171
+
172
+ // client side resize feature
173
+ function setResize(arg) {
174
+ if ( arg ) {
175
+ debug('[enable resize]');
176
+ if ( uploader.features.jpgresize )
177
+ uploader.settings['resize'] = { width: resize_width, height: resize_height, quality: 100 };
178
+ else
179
+ uploader.settings.multipart_params.image_resize = true;
180
+ } else {
181
+ debug('[disable resize]');
182
+ delete(uploader.settings.resize);
183
+ delete(uploader.settings.multipart_params.image_resize);
184
+ }
185
+ }
186
+
187
+ function debug() {
188
+ if ( uploader.settings.debug ) {
189
+ plupload.each(arguments, function(message) {
190
+ var exceptionMessage, exceptionValues = [];
191
+
192
+ // Check for an exception object and print it nicely
193
+ if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") {
194
+ for (var key in message) {
195
+ if (message.hasOwnProperty(key)) {
196
+ exceptionValues.push(key + ": " + message[key]);
197
+ }
198
+ }
199
+ exceptionMessage = exceptionValues.join("\n") || "";
200
+ exceptionValues = exceptionMessage.split("\n");
201
+ exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: ");
202
+ if (window.console)
203
+ console.log(exceptionMessage);
204
+ else
205
+ debugConsole(exceptionMessage);
206
+ } else {
207
+ if (window.console)
208
+ console.log(message);
209
+ else
210
+ debugConsole(message);
211
+ }
212
+ });
213
+ }
214
+ };
215
+
216
+ function debugConsole(message) {
217
+ var console, documentForm;
218
+
219
+ try {
220
+ console = document.getElementById("plupload_Console");
221
+
222
+ if (!console) {
223
+ documentForm = document.createElement("form");
224
+ document.getElementsByTagName("body")[0].appendChild(documentForm);
225
+
226
+ console = document.createElement("textarea");
227
+ console.id = "plupload_Console";
228
+ console.style.fontFamily = "monospace";
229
+ console.setAttribute("wrap", "off");
230
+ console.wrap = "off";
231
+ console.style.overflow = "auto";
232
+ console.style.width = "99%";
233
+ console.style.height = "350px";
234
+ console.style.margin = "5px";
235
+ documentForm.appendChild(console);
236
+ }
237
+
238
+ console.value += message + "\n";
239
+
240
+ console.scrollTop = console.scrollHeight - console.clientHeight;
241
+ } catch (ex) {
242
+ alert("Exception: " + ex.name + " Message: " + ex.message);
243
+ }
244
+ };
admin/js/swfupload.handler.js ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * NextGEN Gallery - SWFUpload Handler
3
+ * http://www.nextgen-gallery.com/
4
+ *
5
+ * Built on top of the swfupload library
6
+ * http://swfupload.org version 2.2.0
7
+ *
8
+ * version 1.0.3
9
+ */
10
+
11
+ // on load change the upload to swfupload
12
+ function initSWFUpload() {
13
+ jQuery(function() {
14
+ jQuery("#uploadimage_btn").after("<input class='button-primary' type='button' name='uploadimage' id='swfupload_btn' value='" + ngg_swf_upload.customSettings.upload + "' />")
15
+ .remove();
16
+ jQuery("#swfupload_btn").click( function() { submitFiles(); } );
17
+ jQuery("#imagefiles")
18
+ .after("<div id='uploadQueue'></div>")
19
+ .after("<input id='imagefiles' type='button' class='button-secondary uploadform' value='" + ngg_swf_upload.customSettings.browse + "' />")
20
+ .after("<input type='text' id='txtFileName' readonly='readonly' />")
21
+ .remove();
22
+ jQuery("#imagefiles").click( function() { fileBrowse(); } );
23
+ });
24
+ }
25
+
26
+ // call the upload dialog
27
+ function fileBrowse() {
28
+ jQuery("#txtFileName").val("");
29
+ ngg_swf_upload.cancelUpload();
30
+ ngg_swf_upload.selectFiles();
31
+ }
32
+
33
+ // called when a file is added
34
+ function fileQueued(fileObj) {
35
+ filesize = " (" + Math.round(fileObj.size/1024) + " kB) ";
36
+ jQuery("#txtFileName").val(fileObj.name);
37
+ jQuery("#uploadQueue")
38
+ .append("<div id='" + fileObj.id + "' class='nggUploadItem'> [<a href='javascript:removeFile(\"" + fileObj.id + "\");'>" + ngg_swf_upload.customSettings.remove + "</a>] " + fileObj.name + filesize + "</div>")
39
+ .children("div:last").slideDown("slow")
40
+ .end();
41
+ }
42
+
43
+ // start the upload
44
+ function submitFiles() {
45
+ // check if a gallery is selected
46
+ if (jQuery('#galleryselect').val() > "0") {
47
+ nggProgressBar.init(nggAjaxOptions);
48
+ // get old post_params
49
+ post_params = ngg_swf_upload.getSetting("post_params");
50
+ // update the selected gallery in the post_params
51
+ post_params['galleryselect'] = jQuery('#galleryselect').val();
52
+ ngg_swf_upload.setPostParams(post_params);
53
+ ngg_swf_upload.startUpload();
54
+ } else {
55
+ jQuery('#uploadimage_form').prepend("<input type=\"hidden\" name=\"swf_callback\" value=\"-1\">");
56
+ jQuery("#uploadimage_form").submit();
57
+ }
58
+ }
59
+
60
+ // called when a file will be removed
61
+ function removeFile(fileID) {
62
+ ngg_swf_upload.cancelUpload(fileID);
63
+ jQuery("#" + fileID).hide("slow");
64
+ jQuery("#" + fileID).remove();
65
+ }
66
+
67
+ // called before the uploads start
68
+ function uploadStart(fileObj) {
69
+ nggProgressBar.init(nggAjaxOptions);
70
+ return true;
71
+ }
72
+
73
+ // called during the upload progress
74
+ function uploadProgress(fileObj, bytesLoaded) {
75
+ var percent = Math.ceil((bytesLoaded / fileObj.size) * 100);
76
+ nggProgressBar.increase( percent );
77
+ jQuery("#progressbar span").text(percent + "% - " + fileObj.name);
78
+ }
79
+
80
+ // called when the file is uploaded
81
+ function uploadComplete(fileObj) {
82
+ jQuery("#" + fileObj.id).hide("slow");
83
+ jQuery("#" + fileObj.id).remove();
84
+ if ( ngg_swf_upload.getStats().files_queued == 0) {
85
+ nggProgressBar.finished();
86
+ jQuery("#uploadimage_form").submit();
87
+ }
88
+ }
89
+
90
+ // called when all files are uploaded
91
+ function uploadSuccess(fileObj, server_data) {
92
+ // Show any error message
93
+ if (server_data != 0){
94
+ nggProgressBar.addNote("<strong>ERROR</strong>: " + fileObj.name + " : " + server_data);
95
+ }
96
+ // Upload the next file until queue is empty
97
+ if ( ngg_swf_upload.getStats().files_queued > 0) {
98
+ ngg_swf_upload.startUpload();
99
+ } else {
100
+ // server_data could be add as hidden field
101
+ jQuery('#uploadimage_form').prepend("<input type=\"hidden\" name=\"swf_callback\" value=\"" + server_data + "\">");
102
+ }
103
+ }
104
+
105
+ // called on error
106
+ function uploadError(fileObj, error_code, message) {
107
+ var error_name = "";
108
+ switch(error_code) {
109
+ case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
110
+ error_name = "HTTP ERROR";
111
+ break;
112
+ case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:
113
+ error_name = "MISSING UPLOAD URL";
114
+ break;
115
+ case SWFUpload.UPLOAD_ERROR.IO_ERROR:
116
+ error_name = "IO FAILURE";
117
+ break;
118
+ case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
119
+ error_name = "SECURITY ERROR";
120
+ break;
121
+ case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
122
+ error_name = "UPLOAD LIMIT EXCEEDED";
123
+ break;
124
+ case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
125
+ error_name = "UPLOAD FAILED";
126
+ break;
127
+ case SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND:
128
+ error_name = "SPECIFIED FILE ID NOT FOUND";
129
+ break;
130
+ case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
131
+ error_name = "FILE VALIDATION FAILED";
132
+ break;
133
+ case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
134
+ error_name = "FILE CANCELLED";
135
+ return;
136
+ break;
137
+ case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
138
+ error_name = "FILE STOPPED";
139
+ break;
140
+ default:
141
+ error_name = "UNKNOWN";
142
+ break;
143
+ }
144
+ nggProgressBar.addNote("<strong>ERROR " + error_name + " </strong>: " + fileObj.name + " : " + message);
145
+ jQuery("#" + fileObj.id).hide("slow");
146
+ jQuery("#" + fileObj.id).remove();
147
+ if ( ngg_swf_upload.getStats().files_queued > 0) {
148
+ ngg_swf_upload.startUpload();
149
+ } else {
150
+ jQuery('#uploadimage_form').prepend("<input type=\"hidden\" name=\"swf_callback\" value=\"" + error_name + "\">");
151
+ jQuery("#uploadimage_form").submit();
152
+ }
153
+ }
admin/manage-galleries.php ADDED
@@ -0,0 +1,427 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ // *** show main gallery list
6
+ function nggallery_manage_gallery_main() {
7
+
8
+ global $ngg, $nggdb, $wp_query;
9
+
10
+ //Build the pagination for more than 25 galleries
11
+ $_GET['paged'] = isset($_GET['paged']) && ($_GET['paged'] > 0) ? absint($_GET['paged']) : 1;
12
+
13
+ $items_per_page = 25;
14
+
15
+ $start = ( $_GET['paged'] - 1 ) * $items_per_page;
16
+
17
+ $order = ( isset ( $_GET['order'] ) && $_GET['order'] == 'desc' ) ? 'DESC' : 'ASC';
18
+ $orderby = ( isset ( $_GET['orderby'] ) && ( in_array( $_GET['orderby'], array('gid', 'title', 'author') )) ) ? $_GET['orderby'] : 'gid';
19
+
20
+ $gallerylist = $nggdb->find_all_galleries( $orderby, $order , TRUE, $items_per_page, $start, false);
21
+ $wp_list_table = new _NGG_Galleries_List_Table('nggallery-manage-gallery');
22
+
23
+ ?>
24
+ <script type="text/javascript">
25
+ <!--
26
+ function checkAll(form)
27
+ {
28
+ for (i = 0, n = form.elements.length; i < n; i++) {
29
+ if(form.elements[i].type == "checkbox") {
30
+ if(form.elements[i].name == "doaction[]") {
31
+ if(form.elements[i].checked == true)
32
+ form.elements[i].checked = false;
33
+ else
34
+ form.elements[i].checked = true;
35
+ }
36
+ }
37
+ }
38
+ }
39
+
40
+ function getNumChecked(form)
41
+ {
42
+ var num = 0;
43
+ for (i = 0, n = form.elements.length; i < n; i++) {
44
+ if(form.elements[i].type == "checkbox") {
45
+ if(form.elements[i].name == "doaction[]")
46
+ if(form.elements[i].checked == true)
47
+ num++;
48
+ }
49
+ }
50
+ return num;
51
+ }
52
+
53
+ // this function check for a the number of selected images, sumbmit false when no one selected
54
+ function checkSelected() {
55
+
56
+ if (typeof document.activeElement == "undefined" && document.addEventListener) {
57
+ document.addEventListener("focus", function (e) {
58
+ document.activeElement = e.target;
59
+ }, true);
60
+ }
61
+
62
+ if ( document.activeElement.name == 'post_paged' )
63
+ return true;
64
+
65
+ var numchecked = getNumChecked(document.getElementById('editgalleries'));
66
+
67
+ if(numchecked < 1) {
68
+ alert('<?php echo esc_js(__('No images selected', 'nggallery')); ?>');
69
+ return false;
70
+ }
71
+
72
+ actionId = jQuery('#bulkaction').val();
73
+
74
+ switch (actionId) {
75
+ case "resize_images":
76
+ showDialog('resize_images', '<?php echo esc_js(__('Resize images','nggallery')); ?>');
77
+ return false;
78
+ break;
79
+ case "new_thumbnail":
80
+ showDialog('new_thumbnail', '<?php echo esc_js(__('Create new thumbnails','nggallery')); ?>');
81
+ return false;
82
+ break;
83
+ }
84
+
85
+ return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s galleries \n \n 'Cancel' to stop, 'OK' to proceed.",'nggallery')), "' + numchecked + '") ; ?>');
86
+ }
87
+
88
+ function showDialog( windowId, title ) {
89
+ var form = document.getElementById('editgalleries');
90
+ var elementlist = "";
91
+ for (i = 0, n = form.elements.length; i < n; i++) {
92
+ if(form.elements[i].type == "checkbox") {
93
+ if(form.elements[i].name == "doaction[]")
94
+ if(form.elements[i].checked == true)
95
+ if (elementlist == "")
96
+ elementlist = form.elements[i].value
97
+ else
98
+ elementlist += "," + form.elements[i].value ;
99
+ }
100
+ }
101
+ jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
102
+ jQuery("#" + windowId + "_imagelist").val(elementlist);
103
+ // now show the dialog
104
+ jQuery( "#" + windowId ).dialog({
105
+ width: 640,
106
+ resizable : false,
107
+ modal: true,
108
+ title: title
109
+ });
110
+ jQuery("#" + windowId + ' .dialog-cancel').click(function() { jQuery( "#" + windowId ).dialog("close"); });
111
+ }
112
+
113
+ function showAddGallery() {
114
+ jQuery( "#addGallery").dialog({
115
+ width: 640,
116
+ resizable : false,
117
+ modal: true,
118
+ title: '<?php echo esc_js(__('Add new gallery','nggallery')); ?>'
119
+ });
120
+ jQuery("#addGallery .dialog-cancel").click(function() { jQuery( "#addGallery" ).dialog("close"); });
121
+ }
122
+ //-->
123
+ </script>
124
+ <div class="wrap">
125
+ <?php include('templates/social_media_buttons.php'); ?>
126
+ <?php screen_icon( 'nextgen-gallery' ); ?>
127
+ <h2><?php echo _n( 'Gallery', 'Galleries', 2, 'nggallery'); ?></h2>
128
+ <form class="search-form" action="" method="get">
129
+ <p class="search-box">
130
+ <label class="hidden" for="media-search-input"><?php _e( 'Search Images', 'nggallery' ); ?>:</label>
131
+ <input type="hidden" id="page-name" name="page" value="nggallery-manage-gallery" />
132
+ <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
133
+ <input type="submit" value="<?php _e( 'Search Images', 'nggallery' ); ?>" class="button" />
134
+ </p>
135
+ </form>
136
+ <form id="editgalleries" class="nggform" method="POST" action="<?php echo $ngg->manage_page->base_page . '&amp;paged=' . $_GET['paged']; ?>" accept-charset="utf-8">
137
+ <?php wp_nonce_field('ngg_bulkgallery') ?>
138
+ <input type="hidden" name="page" value="manage-galleries" />
139
+
140
+ <div class="tablenav top">
141
+
142
+ <div class="alignleft actions">
143
+ <?php if ( function_exists('json_encode') ) : ?>
144
+ <select name="bulkaction" id="bulkaction">
145
+ <option value="no_action" ><?php _e("Bulk actions",'nggallery'); ?></option>
146
+ <option value="delete_gallery" ><?php _e("Delete",'nggallery'); ?></option>
147
+ <option value="set_watermark" ><?php _e("Set watermark",'nggallery'); ?></option>
148
+ <option value="new_thumbnail" ><?php _e("Create new thumbnails",'nggallery'); ?></option>
149
+ <option value="resize_images" ><?php _e("Resize images",'nggallery'); ?></option>
150
+ <option value="import_meta" ><?php _e("Import metadata",'nggallery'); ?></option>
151
+ <option value="recover_images" ><?php _e("Recover from backup",'nggallery'); ?></option>
152
+ </select>
153
+ <input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply','nggallery'); ?>" onclick="if ( !checkSelected() ) return false;" />
154
+ <?php endif; ?>
155
+ <?php if ( current_user_can('NextGEN Upload images') && nggGallery::current_user_can( 'NextGEN Add new gallery' ) ) : ?>
156
+ <input name="doaction" class="button-secondary action" type="submit" onclick="showAddGallery(); return false;" value="<?php _e('Add new gallery', 'nggallery') ?>"/>
157
+ <?php endif; ?>
158
+ </div>
159
+
160
+
161
+ <?php $ngg->manage_page->pagination( 'top', $_GET['paged'], $nggdb->paged['total_objects'], $nggdb->paged['objects_per_page'] ); ?>
162
+
163
+ </div>
164
+ <table class="wp-list-table widefat fixed" cellspacing="0">
165
+ <thead>
166
+ <tr>
167
+ <?php $wp_list_table->print_column_headers(true); ?>
168
+ </tr>
169
+ </thead>
170
+ <tfoot>
171
+ <tr>
172
+ <?php $wp_list_table->print_column_headers(false); ?>
173
+ </tr>
174
+ </tfoot>
175
+ <tbody id="the-list">
176
+ <?php
177
+
178
+ if($gallerylist) {
179
+ //get the columns
180
+ $gallery_columns = $wp_list_table->get_columns();
181
+ $hidden_columns = get_hidden_columns('nggallery-manage-gallery');
182
+ $num_columns = count($gallery_columns) - count($hidden_columns);
183
+
184
+ foreach($gallerylist as $gallery) {
185
+ $alternate = ( !isset($alternate) || $alternate == 'class="alternate"' ) ? '' : 'class="alternate"';
186
+ $gid = $gallery->gid;
187
+ $name = (empty($gallery->title) ) ? $gallery->name : $gallery->title;
188
+ $author_user = get_userdata( (int) $gallery->author );
189
+ ?>
190
+ <tr id="gallery-<?php echo $gid ?>" <?php echo $alternate; ?> >
191
+ <?php
192
+ foreach($gallery_columns as $gallery_column_key => $column_display_name) {
193
+ $class = "class=\"$gallery_column_key column-$gallery_column_key\"";
194
+
195
+ $style = '';
196
+ if ( in_array($gallery_column_key, $hidden_columns) )
197
+ $style = ' style="display:none;"';
198
+
199
+ $attributes = "$class$style";
200
+
201
+ switch ($gallery_column_key) {
202
+ case 'cb' :
203
+ ?>
204
+ <th scope="row" class="column-cb check-column">
205
+ <?php if (nggAdmin::can_manage_this_gallery($gallery->author)) { ?>
206
+ <input name="doaction[]" type="checkbox" value="<?php echo $gid ?>" />
207
+ <?php } ?>
208
+ </th>
209
+ <?php
210
+ break;
211
+ case 'id' :
212
+ ?>
213
+ <td <?php echo $attributes ?>><?php echo $gid; ?></td>
214
+ <?php
215
+ break;
216
+ case 'title' :
217
+ ?>
218
+ <td class="title column-title">
219
+ <?php if (nggAdmin::can_manage_this_gallery($gallery->author)) { ?>
220
+ <a href="<?php echo wp_nonce_url( $ngg->manage_page->base_page . '&amp;mode=edit&amp;gid=' . $gid, 'ngg_editgallery')?>" class='edit' title="<?php _e('Edit'); ?>" >
221
+ <?php echo esc_html( nggGallery::i18n($name) ); ?>
222
+ </a>
223
+ <?php } else { ?>
224
+ <?php echo esc_html( nggGallery::i18n($gallery->title) ); ?>
225
+ <?php } ?>
226
+ <div class="row-actions"></div>
227
+ </td>
228
+ <?php
229
+ break;
230
+ case 'description' :
231
+ ?>
232
+ <td <?php echo $attributes ?>><?php echo esc_html( nggGallery::i18n($gallery->galdesc) ); ?>&nbsp;</td>
233
+ <?php
234
+ break;
235
+ case 'author' :
236
+ ?>
237
+ <td <?php echo $attributes ?>><?php echo esc_html( $author_user->display_name ); ?></td>
238
+ <?php
239
+ break;
240
+ case 'page_id' :
241
+ ?>
242
+ <td <?php echo $attributes ?>><?php echo $gallery->pageid; ?></td>
243
+ <?php
244
+ break;
245
+ case 'quantity' :
246
+ ?>
247
+ <td <?php echo $attributes ?>><?php echo $gallery->counter; ?></td>
248
+ <?php
249
+ break;
250
+ default :
251
+ ?>
252
+ <td <?php echo $attributes ?>><?php do_action('ngg_manage_gallery_custom_column', $gallery_column_key, $gid); ?></td>
253
+ <?php
254
+ break;
255
+ }
256
+ } ?>
257
+ </tr>
258
+ <?php
259
+ }
260
+ } else {
261
+ echo '<tr><td colspan="7" align="center"><strong>' . __('No entries found', 'nggallery') . '</strong></td></tr>';
262
+ }
263
+ ?>
264
+ </tbody>
265
+ </table>
266
+ <div class="tablenav bottom">
267
+ <?php $ngg->manage_page->pagination( 'bottom', $_GET['paged'], $nggdb->paged['total_objects'], $nggdb->paged['objects_per_page'] ); ?>
268
+ </div>
269
+ </form>
270
+ </div>
271
+ <!-- #addGallery -->
272
+ <div id="addGallery" style="display: none;" >
273
+ <form id="form-tags" method="POST" accept-charset="utf-8">
274
+ <?php wp_nonce_field('ngg_addgallery'); ?>
275
+ <input type="hidden" name="page" value="manage-galleries" />
276
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
277
+ <tr>
278
+ <td>
279
+ <strong><?php _e('New Gallery', 'nggallery') ;?>:</strong> <input type="text" size="35" name="galleryname" value="" /><br />
280
+ <?php if(!is_multisite()) { ?>
281
+ <?php _e('Create a new , empty gallery below the folder', 'nggallery') ;?> <strong><?php echo $ngg->options['gallerypath']; ?></strong><br />
282
+ <?php } ?>
283
+ <i>( <?php _e('Allowed characters for file and folder names are', 'nggallery') ;?>: a-z, A-Z, 0-9, -, _ )</i>
284
+ </td>
285
+ </tr>
286
+ <?php do_action('ngg_add_new_gallery_form'); ?>
287
+ <tr align="right">
288
+ <td class="submit">
289
+ <input class="button-primary" type="submit" name="addgallery" value="<?php _e('OK','nggallery'); ?>" />
290
+ &nbsp;
291
+ <input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php _e('Cancel', 'nggallery'); ?>&nbsp;" />
292
+ </td>
293
+ </tr>
294
+ </table>
295
+ </form>
296
+ </div>
297
+ <!-- /#addGallery -->
298
+
299
+ <!-- #resize_images -->
300
+ <div id="resize_images" style="display: none;" >
301
+ <form id="form-resize-images" method="POST" accept-charset="utf-8">
302
+ <?php wp_nonce_field('ngg_thickbox_form') ?>
303
+ <input type="hidden" id="resize_images_imagelist" name="TB_imagelist" value="" />
304
+ <input type="hidden" id="resize_images_bulkaction" name="TB_bulkaction" value="" />
305
+ <input type="hidden" name="page" value="manage-galleries" />
306
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
307
+ <tr valign="top">
308
+ <td>
309
+ <strong><?php _e('Resize Images to', 'nggallery'); ?>:</strong>
310
+ </td>
311
+ <td>
312
+ <input type="text" size="5" name="imgWidth" value="<?php echo $ngg->options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $ngg->options['imgHeight']; ?>" />
313
+ <br /><small><?php _e('Width x height (in pixel). NextCellent Gallery will keep ratio size','nggallery') ?></small>
314
+ </td>
315
+ </tr>
316
+ <tr align="right">
317
+ <td colspan="2" class="submit">
318
+ <input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'nggallery'); ?>" />
319
+ &nbsp;
320
+ <input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php _e('Cancel', 'nggallery'); ?>&nbsp;" />
321
+ </td>
322
+ </tr>
323
+ </table>
324
+ </form>
325
+ </div>
326
+ <!-- /#resize_images -->
327
+
328
+ <!-- #new_thumbnail -->
329
+ <div id="new_thumbnail" style="display: none;" >
330
+ <form id="form-new-thumbnail" method="POST" accept-charset="utf-8">
331
+ <?php wp_nonce_field('ngg_thickbox_form') ?>
332
+ <input type="hidden" id="new_thumbnail_imagelist" name="TB_imagelist" value="" />
333
+ <input type="hidden" id="new_thumbnail_bulkaction" name="TB_bulkaction" value="" />
334
+ <input type="hidden" name="page" value="manage-galleries" />
335
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
336
+ <tr valign="top">
337
+ <th align="left"><?php _e('Width x height (in pixel)','nggallery') ?></th>
338
+ <td><input type="text" size="5" maxlength="5" name="thumbwidth" value="<?php echo $ngg->options['thumbwidth']; ?>" /> x <input type="text" size="5" maxlength="5" name="thumbheight" value="<?php echo $ngg->options['thumbheight']; ?>" />
339
+ <br /><small><?php _e('These values are maximum values ','nggallery') ?></small></td>
340
+ </tr>
341
+ <tr valign="top">
342
+ <th align="left"><?php _e('Set fix dimension','nggallery') ?></th>
343
+ <td><input type="checkbox" name="thumbfix" value="1" <?php checked('1', $ngg->options['thumbfix']); ?> />
344
+ <br /><small><?php _e('Ignore the aspect ratio, no portrait thumbnails','nggallery') ?></small></td>
345
+ </tr>
346
+ <tr align="right">
347
+ <td colspan="2" class="submit">
348
+ <input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'nggallery');?>" />
349
+ &nbsp;
350
+ <input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php _e('Cancel', 'nggallery'); ?>&nbsp;" />
351
+ </td>
352
+ </tr>
353
+ </table>
354
+ </form>
355
+ </div>
356
+ <!-- /#new_thumbnail -->
357
+
358
+ <?php
359
+ }
360
+
361
+ /**
362
+ * Construtor class to create the table layout
363
+ *
364
+ * @package WordPress
365
+ * @subpackage List_Table
366
+ * @since 1.8.0
367
+ * @access private
368
+ */
369
+ class _NGG_Galleries_List_Table extends WP_List_Table {
370
+ var $_screen;
371
+ var $_columns;
372
+
373
+ function _NGG_Galleries_List_Table( $screen ) {
374
+ if ( is_string( $screen ) )
375
+ $screen = convert_to_screen( $screen );
376
+
377
+ $this->_screen = $screen;
378
+ $this->_columns = array() ;
379
+
380
+ add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 );
381
+ }
382
+
383
+ function get_column_info() {
384
+ $columns = get_column_headers( $this->_screen );
385
+ $hidden = get_hidden_columns( $this->_screen );
386
+ $_sortable = $this->get_sortable_columns();
387
+
388
+ foreach ( $_sortable as $id => $data ) {
389
+ if ( empty( $data ) )
390
+ continue;
391
+
392
+ $data = (array) $data;
393
+ if ( !isset( $data[1] ) )
394
+ $data[1] = false;
395
+
396
+ $sortable[$id] = $data;
397
+ }
398
+
399
+ return array( $columns, $hidden, $sortable );
400
+ }
401
+
402
+ // define the columns to display, the syntax is 'internal name' => 'display name'
403
+ function get_columns() {
404
+ $columns = array();
405
+
406
+ $columns['cb'] = '<input name="checkall" type="checkbox" onclick="checkAll(document.getElementById(\'editgalleries\'));" />';
407
+ $columns['id'] = __('ID');
408
+ $columns['title'] = _n( 'Gallery', 'Galleries', 1, 'nggallery');
409
+ $columns['description'] = __('Description', 'nggallery');
410
+ $columns['author'] = __('Author', 'nggallery');
411
+ $columns['page_id'] = __('Page ID', 'nggallery');
412
+ $columns['quantity'] = _n( 'Image', 'Images', 2, 'nggallery' );
413
+
414
+ $columns = apply_filters('ngg_manage_gallery_columns', $columns);
415
+
416
+ return $columns;
417
+ }
418
+
419
+ function get_sortable_columns() {
420
+ return array(
421
+ 'id' => array( 'gid', true ),
422
+ 'title' => 'title',
423
+ 'author' => 'author'
424
+ );
425
+ }
426
+ }
427
+ ?>
admin/manage-images.php ADDED
@@ -0,0 +1,715 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.');}
4
+
5
+ function nggallery_picturelist() {
6
+ // *** show picture list
7
+ global $wpdb, $nggdb, $user_ID, $ngg;
8
+
9
+ // Look if its a search result
10
+ $is_search = isset ($_GET['s']) ? true : false;
11
+ $counter = 0;
12
+
13
+ $wp_list_table = new _NGG_Images_List_Table('nggallery-manage-images');
14
+
15
+ if ($is_search) {
16
+
17
+ // fetch the imagelist
18
+ $picturelist = $ngg->manage_page->search_result;
19
+
20
+ // we didn't set a gallery or a pagination
21
+ $act_gid = 0;
22
+ $_GET['paged'] = 1;
23
+ $page_links = false;
24
+
25
+ } else {
26
+
27
+ // GET variables
28
+ $act_gid = $ngg->manage_page->gid;
29
+
30
+ // Load the gallery metadata
31
+ $gallery = $nggdb->find_gallery($act_gid);
32
+
33
+ if (!$gallery) {
34
+ nggGallery::show_error(__('Gallery not found.', 'nggallery'));
35
+ return;
36
+ }
37
+
38
+ // Check if you have the correct capability
39
+ if (!nggAdmin::can_manage_this_gallery($gallery->author)) {
40
+ nggGallery::show_error(__('Sorry, you have no access here', 'nggallery'));
41
+ return;
42
+ }
43
+
44
+ // look for pagination
45
+ $_GET['paged'] = isset($_GET['paged']) && ($_GET['paged'] > 0) ? absint($_GET['paged']) : 1;
46
+
47
+ $start = ( $_GET['paged'] - 1 ) * 50;
48
+
49
+ // get picture values
50
+ $picturelist = $nggdb->get_gallery($act_gid, $ngg->options['galSort'], $ngg->options['galSortDir'], false, 50, $start );
51
+
52
+ // get the current author
53
+ $act_author_user = get_userdata( (int) $gallery->author );
54
+
55
+ }
56
+
57
+ // list all galleries
58
+ $gallerylist = $nggdb->find_all_galleries();
59
+
60
+ //get the columns
61
+ $image_columns = $wp_list_table->get_columns();
62
+ $hidden_columns = get_hidden_columns('nggallery-manage-images');
63
+ $num_columns = count($image_columns) - count($hidden_columns);
64
+
65
+ $attr = (nggGallery::current_user_can( 'NextGEN Edit gallery options' )) ? '' : 'disabled="disabled"';
66
+
67
+ ?>
68
+ <script type="text/javascript">
69
+ <!--
70
+ function showDialog( windowId, title ) {
71
+ var form = document.getElementById('updategallery');
72
+ var elementlist = "";
73
+ for (i = 0, n = form.elements.length; i < n; i++) {
74
+ if(form.elements[i].type == "checkbox") {
75
+ if(form.elements[i].name == "doaction[]")
76
+ if(form.elements[i].checked == true)
77
+ if (elementlist == "")
78
+ elementlist = form.elements[i].value
79
+ else
80
+ elementlist += "," + form.elements[i].value ;
81
+ }
82
+ }
83
+ jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
84
+ jQuery("#" + windowId + "_imagelist").val(elementlist);
85
+ // now show the dialog
86
+ jQuery( "#" + windowId ).dialog({
87
+ width: 640,
88
+ resizable : false,
89
+ modal: true,
90
+ title: title
91
+ });
92
+ jQuery("#" + windowId + ' .dialog-cancel').click(function() { jQuery( "#" + windowId ).dialog("close"); });
93
+ }
94
+
95
+ jQuery(function (){
96
+ // load a content via ajax
97
+ jQuery('a.ngg-dialog').click(function() {
98
+ if ( jQuery( "#spinner" ).length == 0)
99
+ jQuery("body").append('<div id="spinner"></div>');
100
+ var $this = jQuery(this);
101
+ var results = new RegExp('[\\?&]w=([^&#]*)').exec(this.href);
102
+ var width = ( results ) ? results[1] : 600;
103
+ var results = new RegExp('[\\?&]h=([^&#]*)').exec(this.href);
104
+ var height = ( results ) ? results[1] : 440;
105
+ jQuery('#spinner').fadeIn();
106
+ var dialog = jQuery('<div style="display:hidden"></div>').appendTo('body');
107
+ // load the remote content
108
+ dialog.load(
109
+ this.href,
110
+ {},
111
+ function () {
112
+ jQuery('#spinner').hide();
113
+ dialog.dialog({
114
+ title: ($this.attr('title')) ? $this.attr('title') : '',
115
+ width: width,
116
+ height: height,
117
+ modal: true,
118
+ resizable: false,
119
+ close: function() { dialog.remove(); }
120
+ }).width(width - 30).height(height - 30);
121
+ }
122
+ );
123
+ //prevent the browser to follow the link
124
+ return false;
125
+ });
126
+ });
127
+
128
+ function checkAll(form)
129
+ {
130
+ for (i = 0, n = form.elements.length; i < n; i++) {
131
+ if(form.elements[i].type == "checkbox") {
132
+ if(form.elements[i].name == "doaction[]") {
133
+ if(form.elements[i].checked == true)
134
+ form.elements[i].checked = false;
135
+ else
136
+ form.elements[i].checked = true;
137
+ }
138
+ }
139
+ }
140
+ }
141
+
142
+ function getNumChecked(form)
143
+ {
144
+ var num = 0;
145
+ for (i = 0, n = form.elements.length; i < n; i++) {
146
+ if(form.elements[i].type == "checkbox") {
147
+ if(form.elements[i].name == "doaction[]")
148
+ if(form.elements[i].checked == true)
149
+ num++;
150
+ }
151
+ }
152
+ return num;
153
+ }
154
+
155
+ // this function check for a the number of selected images, sumbmit false when no one selected
156
+ function checkSelected() {
157
+
158
+ var numchecked = getNumChecked(document.getElementById('updategallery'));
159
+
160
+ if (typeof document.activeElement == "undefined" && document.addEventListener) {
161
+ document.addEventListener("focus", function (e) {
162
+ document.activeElement = e.target;
163
+ }, true);
164
+ }
165
+
166
+ if ( document.activeElement.name == 'post_paged' )
167
+ return true;
168
+
169
+ if(numchecked < 1) {
170
+ alert('<?php echo esc_js(__('No images selected', 'nggallery')); ?>');
171
+ return false;
172
+ }
173
+
174
+ actionId = jQuery('#bulkaction').val();
175
+
176
+ switch (actionId) {
177
+ case "copy_to":
178
+ showDialog('selectgallery', '<?php echo esc_js(__('Copy image to...','nggallery')); ?>');
179
+ return false;
180
+ break;
181
+ case "move_to":
182
+ showDialog('selectgallery', '<?php echo esc_js(__('Move image to...','nggallery')); ?>');
183
+ return false;
184
+ break;
185
+ case "add_tags":
186
+ showDialog('entertags', '<?php echo esc_js(__('Add new tags','nggallery')); ?>');
187
+ return false;
188
+ break;
189
+ case "delete_tags":
190
+ showDialog('entertags', '<?php echo esc_js(__('Delete tags','nggallery')); ?>');
191
+ return false;
192
+ break;
193
+ case "overwrite_tags":
194
+ showDialog('entertags', '<?php echo esc_js(__('Overwrite','nggallery')); ?>');
195
+ return false;
196
+ break;
197
+ case "resize_images":
198
+ showDialog('resize_images', '<?php echo esc_js(__('Resize images','nggallery')); ?>');
199
+ return false;
200
+ break;
201
+ case "new_thumbnail":
202
+ showDialog('new_thumbnail', '<?php echo esc_js(__('Create new thumbnails','nggallery')); ?>');
203
+ return false;
204
+ break;
205
+ }
206
+
207
+ return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s images \n \n 'Cancel' to stop, 'OK' to proceed.",'nggallery')), "' + numchecked + '") ; ?>');
208
+ }
209
+
210
+ jQuery(document).ready( function() {
211
+ // close postboxes that should be closed
212
+ jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
213
+ postboxes.add_postbox_toggles('ngg-manage-gallery');
214
+ });
215
+
216
+ //-->
217
+ </script>
218
+ <div class="wrap">
219
+ <?php include('templates/social_media_buttons.php'); ?>
220
+ <?php screen_icon( 'nextgen-gallery' ); ?>
221
+ <?php if ($is_search) :?>
222
+ <h2><?php printf( __('Search results for &#8220;%s&#8221;', 'nggallery'), esc_html( get_search_query() ) ); ?></h2>
223
+ <form class="search-form" action="" method="get">
224
+ <p class="search-box">
225
+ <label class="hidden" for="media-search-input"><?php _e( 'Search Images', 'nggallery' ); ?>:</label>
226
+ <input type="hidden" id="page-name" name="page" value="nggallery-manage-gallery" />
227
+ <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
228
+ <input type="submit" value="<?php _e( 'Search Images', 'nggallery' ); ?>" class="button" />
229
+ </p>
230
+ </form>
231
+
232
+ <br style="clear: both;" />
233
+
234
+ <form id="updategallery" class="nggform" method="POST" action="<?php echo $ngg->manage_page->base_page . '&amp;mode=edit&amp;s=' . get_search_query(); ?>" accept-charset="utf-8">
235
+ <?php wp_nonce_field('ngg_updategallery') ?>
236
+ <input type="hidden" name="page" value="manage-images" />
237
+
238
+ <?php else :?>
239
+ <h2><?php echo _n( 'Gallery', 'Galleries', 1, 'nggallery' ); ?> : <?php echo esc_html ( nggGallery::i18n($gallery->title) ); ?></h2>
240
+
241
+ <br style="clear: both;" />
242
+
243
+ <form id="updategallery" class="nggform" method="POST" action="<?php echo $ngg->manage_page->base_page . '&amp;mode=edit&amp;gid=' . $act_gid . '&amp;paged=' . $_GET['paged']; ?>" accept-charset="utf-8">
244
+ <?php wp_nonce_field('ngg_updategallery') ?>
245
+ <input type="hidden" name="page" value="manage-images" />
246
+
247
+ <?php if ( nggGallery::current_user_can( 'NextGEN Edit gallery options' )) : ?>
248
+ <div id="poststuff">
249
+ <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
250
+ <div id="gallerydiv" class="postbox <?php echo postbox_classes('gallerydiv', 'ngg-manage-gallery'); ?>" >
251
+ <h3><?php _e('Gallery settings', 'nggallery') ?><small> (<?php _e('Click here for more settings', 'nggallery') ?>)</small></h3>
252
+ <div class="inside">
253
+ <table class="form-table" >
254
+ <tr>
255
+ <th align="left"><?php _e('Title') ?>:</th>
256
+ <th align="left"><input <?php nggGallery::current_user_can_form( 'NextGEN Edit gallery title' ); ?> type="text" size="50" name="title" value="<?php echo $gallery->title; ?>" /></th>
257
+ <th align="right"><?php _e('Page Link to', 'nggallery') ?>:</th>
258
+ <th align="left">
259
+ <select <?php nggGallery::current_user_can_form( 'NextGEN Edit gallery page id' ); ?> name="pageid" style="width:95%">
260
+ <option value="0" ><?php _e('Not linked', 'nggallery') ?></option>
261
+ <?php $err = error_reporting(0); ?>
262
+ <?php parent_dropdown(intval($gallery->pageid)); ?>
263
+ <?php error_reporting($err); ?>
264
+ </select>
265
+ </th>
266
+ </tr>
267
+ <tr>
268
+ <th align="left"><?php _e('Description') ?>:</th>
269
+ <th align="left"><textarea <?php nggGallery::current_user_can_form( 'NextGEN Edit gallery description' ); ?> name="gallerydesc" cols="30" rows="3" style="width: 95%" ><?php echo $gallery->galdesc; ?></textarea></th>
270
+ <th align="right"><?php _e('Preview image', 'nggallery') ?>:</th>
271
+ <th align="left">
272
+ <select <?php nggGallery::current_user_can_form( 'NextGEN Edit gallery preview pic' ); ?> name="previewpic" style="width:95%" >
273
+ <option value="0" ><?php _e('No Picture', 'nggallery') ?></option>
274
+ <?php
275
+ // ensure that a preview pic from a other page is still shown here
276
+ if ( intval($gallery->previewpic) != 0) {
277
+ if ( !array_key_exists ($gallery->previewpic, $picturelist )){
278
+ $previewpic = $nggdb->find_image($gallery->previewpic);
279
+ if ($previewpic)
280
+ echo '<option value="'.$previewpic->pid.'" selected="selected" >'.$previewpic->pid.' - ' . esc_attr( $previewpic->filename ) . '</option>'."\n";
281
+ }
282
+ }
283
+ if(is_array($picturelist)) {
284
+ foreach($picturelist as $picture) {
285
+ if ($picture->exclude) continue;
286
+ $selected = ($picture->pid == $gallery->previewpic) ? 'selected="selected" ' : '';
287
+ echo '<option value="'.$picture->pid.'" '.$selected.'>'.$picture->pid.' - ' . esc_attr( $picture->filename ) . '</option>'."\n";
288
+ }
289
+ }
290
+ ?>
291
+ </select>
292
+ </th>
293
+ </tr>
294
+ <tr>
295
+ <th align="left"><?php _e('Path', 'nggallery') ?>:</th>
296
+ <th align="left"><input <?php if ( is_multisite() ) echo 'readonly = "readonly"'; ?> <?php nggGallery::current_user_can_form( 'NextGEN Edit gallery path' ); ?> type="text" size="50" name="path" value="<?php echo $gallery->path; ?>" /></th>
297
+ <th align="right"><?php _e('Author', 'nggallery'); ?>:</th>
298
+ <th align="left">
299
+ <?php
300
+ $editable_ids = $ngg->manage_page->get_editable_user_ids( $user_ID );
301
+ if ( $editable_ids && count( $editable_ids ) > 1 && nggGallery::current_user_can( 'NextGEN Edit gallery author') )
302
+ wp_dropdown_users( array('include' => $editable_ids, 'name' => 'author', 'selected' => empty( $gallery->author ) ? 0 : $gallery->author ) );
303
+ else
304
+ echo $act_author_user->display_name;
305
+ ?>
306
+ </th>
307
+ </tr>
308
+ <?php if(current_user_can( 'publish_pages' )) : ?>
309
+ <tr>
310
+ <th align="left">&nbsp;</th>
311
+ <th align="left">&nbsp;</th>
312
+ <th align="right"><?php _e('Create new page', 'nggallery') ?>:</th>
313
+ <th align="left">
314
+ <select name="parent_id" style="width:95%">
315
+ <option value="0"><?php _e ('Main page (No parent)', 'nggallery'); ?></option>
316
+ <?php if (get_post()): ?>
317
+ <?php parent_dropdown (); ?>
318
+ <?php endif ?>
319
+ </select>
320
+ <input class="button-secondary action" type="submit" name="addnewpage" value="<?php _e ('Add page', 'nggallery'); ?>" id="group"/>
321
+ </th>
322
+ </tr>
323
+ <?php endif; ?>
324
+ <?php do_action('ngg_manage_gallery_settings', $act_gid); ?>
325
+
326
+ </table>
327
+
328
+ <div class="submit">
329
+ <input type="submit" class="button-secondary" name="scanfolder" value="<?php _e("Scan Folder for new images",'nggallery'); ?> " />
330
+ <input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes",'nggallery'); ?>" />
331
+ </div>
332
+
333
+ </div>
334
+ </div>
335
+ </div> <!-- poststuff -->
336
+ <?php endif; ?>
337
+
338
+ <?php endif; ?>
339
+
340
+ <div class="tablenav top ngg-tablenav">
341
+ <?php $ngg->manage_page->pagination( 'top', $_GET['paged'], $nggdb->paged['total_objects'], $nggdb->paged['objects_per_page'] ); ?>
342
+ <div class="alignleft actions">
343
+ <select id="bulkaction" name="bulkaction">
344
+ <option value="no_action" ><?php _e("Bulk actions",'nggallery'); ?></option>
345
+ <option value="set_watermark" ><?php _e("Set watermark",'nggallery'); ?></option>
346
+ <option value="new_thumbnail" ><?php _e("Create new thumbnails",'nggallery'); ?></option>
347
+ <option value="resize_images" ><?php _e("Resize images",'nggallery'); ?></option>
348
+ <option value="recover_images" ><?php _e("Recover from backup",'nggallery'); ?></option>
349
+ <option value="delete_images" ><?php _e("Delete images",'nggallery'); ?></option>
350
+ <option value="import_meta" ><?php _e("Import metadata",'nggallery'); ?></option>
351
+ <option value="rotate_cw" ><?php _e("Rotate images clockwise",'nggallery'); ?></option>
352
+ <option value="rotate_ccw" ><?php _e("Rotate images counter-clockwise",'nggallery'); ?></option>
353
+ <option value="copy_to" ><?php _e("Copy to...",'nggallery'); ?></option>
354
+ <option value="move_to"><?php _e("Move to...",'nggallery'); ?></option>
355
+ <option value="add_tags" ><?php _e("Add tags",'nggallery'); ?></option>
356
+ <option value="delete_tags" ><?php _e("Delete tags",'nggallery'); ?></option>
357
+ <option value="overwrite_tags" ><?php _e("Overwrite tags",'nggallery'); ?></option>
358
+ </select>
359
+ <input class="button-secondary" type="submit" name="showThickbox" value="<?php _e('Apply', 'nggallery'); ?>" onclick="if ( !checkSelected() ) return false;" />
360
+
361
+ <?php if (($ngg->options['galSort'] == "sortorder") && (!$is_search) ) { ?>
362
+ <input class="button-secondary" type="submit" name="sortGallery" value="<?php _e('Sort gallery', 'nggallery');?>" />
363
+ <?php } ?>
364
+
365
+ <input type="submit" name="updatepictures" class="button-primary action" value="<?php _e('Save Changes', 'nggallery');?>" />
366
+ </div>
367
+ </div>
368
+
369
+ <table id="ngg-listimages" class="widefat fixed" cellspacing="0" >
370
+
371
+ <thead>
372
+ <tr>
373
+ <?php $wp_list_table->print_column_headers(true); ?>
374
+ </tr>
375
+ </thead>
376
+ <tfoot>
377
+ <tr>
378
+ <?php $wp_list_table->print_column_headers(false); ?>
379
+ </tr>
380
+ </tfoot>
381
+ <tbody id="the-list">
382
+ <?php
383
+ if($picturelist) {
384
+
385
+ $thumbsize = '';
386
+
387
+ if ($ngg->options['thumbfix'])
388
+ $thumbsize = 'width="' . $ngg->options['thumbwidth'] . '" height="' . $ngg->options['thumbheight'] . '"';
389
+
390
+ foreach($picturelist as $picture) {
391
+
392
+ //for search result we need to check the capatibiliy
393
+ if ( !nggAdmin::can_manage_this_gallery($picture->author) && $is_search )
394
+ continue;
395
+
396
+ $counter++;
397
+ $pid = (int) $picture->pid;
398
+ $alternate = ( !isset($alternate) || $alternate == 'alternate' ) ? '' : 'alternate';
399
+ $exclude = ( $picture->exclude ) ? 'checked="checked"' : '';
400
+ $date = mysql2date(get_option('date_format'), $picture->imagedate);
401
+ $time = mysql2date(get_option('time_format'), $picture->imagedate);
402
+
403
+ ?>
404
+ <tr id="picture-<?php echo $pid ?>" class="<?php echo $alternate ?> iedit" valign="top">
405
+ <?php
406
+ foreach($image_columns as $image_column_key => $column_display_name) {
407
+ $class = "class='$image_column_key column-$image_column_key'";
408
+
409
+ $style = '';
410
+ if ( in_array($image_column_key, $hidden_columns) )
411
+ $style = ' style="display:none;"';
412
+
413
+ $attributes = $class . $style;
414
+
415
+ switch ($image_column_key) {
416
+ case 'cb' :
417
+ $attributes = 'class="column-cb check-column"' . $style;
418
+ ?>
419
+ <th <?php echo $attributes ?> scope="row"><input name="doaction[]" type="checkbox" value="<?php echo $pid ?>" /></th>
420
+ <?php
421
+ break;
422
+ case 'id' :
423
+ ?>
424
+ <td <?php echo $attributes ?> style=""><?php echo $pid; ?>
425
+ <input type="hidden" name="pid[]" value="<?php echo $pid ?>" />
426
+ </td>
427
+ <?php
428
+ break;
429
+ case 'filename' :
430
+ $attributes = 'class="title column-filename column-title"' . $style;
431
+ ?>
432
+ <td <?php echo $attributes ?>>
433
+ <strong><a href="<?php echo esc_url( $picture->imageURL ); ?>" class="thickbox" title="<?php echo esc_attr ($picture->filename); ?>">
434
+ <?php echo ( empty($picture->alttext) ) ? esc_html( $picture->filename ) : esc_html( stripslashes(nggGallery::i18n($picture->alttext)) ); ?>
435
+ </a></strong>
436
+ <br /><?php echo $date; ?>
437
+ <?php if ( !empty($picture->meta_data) ): ?>
438
+ <br /><?php echo $picture->meta_data['width']; ?> x <?php echo $picture->meta_data['height']; ?> <?php _e('pixel', 'nggallery'); ?>
439
+
440
+ <?php endif; ?>
441
+ <p>
442
+ <?php
443
+ $actions = array();
444
+ $actions['view'] = '<a class="shutter" href="' . esc_url( $picture->imageURL ) . '" title="' . esc_attr( sprintf(__('View "%s"'), sanitize_title ($picture->filename) )) . '">' . __('View', 'nggallery') . '</a>';
445
+ $actions['meta'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/showmeta.php?id=' . $pid . '" title="' . __('Show Meta data','nggallery') . '">' . __('Meta', 'nggallery') . '</a>';
446
+ $actions['custom_thumb'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/edit-thumbnail.php?id=' . $pid . '" title="' . __('Customize thumbnail','nggallery') . '">' . __('Edit thumb', 'nggallery') . '</a>';
447
+ $actions['rotate'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/rotate.php?id=' . $pid . '" title="' . __('Rotate','nggallery') . '">' . __('Rotate', 'nggallery') . '</a>';
448
+ if ( current_user_can( 'publish_posts' ) )
449
+ $actions['publish'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/publish.php?id=' . $pid . '&h=230" title="' . __('Publish this image','nggallery') . '">' . __('Publish', 'nggallery') . '</a>';
450
+ if ( file_exists( $picture->imagePath . '_backup' ) )
451
+ $actions['recover'] = '<a class="confirmrecover" href="' .wp_nonce_url("admin.php?page=nggallery-manage-gallery&amp;mode=recoverpic&amp;gid=" . $act_gid . "&amp;pid=" . $pid, 'ngg_recoverpicture'). '" title="' . __('Recover','nggallery') . '" onclick="javascript:check=confirm( \'' . esc_attr(sprintf(__('Recover "%s" ?' , 'nggallery'), $picture->filename)). '\');if(check==false) return false;">' . __('Recover', 'nggallery') . '</a>';
452
+ $actions['delete'] = '<a class="submitdelete" href="' . wp_nonce_url("admin.php?page=nggallery-manage-gallery&amp;mode=delpic&amp;gid=" . $act_gid . "&amp;pid=" . $pid, 'ngg_delpicture'). '" class="delete column-delete" onclick="javascript:check=confirm( \'' . esc_attr(sprintf(__('Delete "%s" ?' , 'nggallery'), $picture->filename)). '\');if(check==false) return false;">' . __('Delete') . '</a>';
453
+ $action_count = count($actions);
454
+ $i = 0;
455
+ echo '<div class="row-actions">';
456
+ foreach ( $actions as $action => $link ) {
457
+ ++$i;
458
+ ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
459
+ echo "<span class='$action'>$link$sep</span>";
460
+ }
461
+ echo '</div>';
462
+ ?></p>
463
+ </td>
464
+ <?php
465
+ break;
466
+ case 'thumbnail' :
467
+ $attributes = 'class="id column-thumbnail media-icon"' . $style;
468
+ ?>
469
+ <td <?php echo $attributes ?>><a href="<?php echo esc_url ( add_query_arg('i', mt_rand(), $picture->imageURL) ); ?>" class="shutter" title="<?php echo $picture->filename ?>">
470
+ <img class="thumb" src="<?php echo esc_url ( add_query_arg('i', mt_rand(), $picture->thumbURL) ); ?>" id="thumb<?php echo $pid ?>" />
471
+ </a>
472
+ </td>
473
+ <?php
474
+ break;
475
+ case 'alt_title_desc' :
476
+ ?>
477
+ <td <?php echo $attributes ?>>
478
+ <input name="alttext[<?php echo $pid ?>]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo stripslashes($picture->alttext) ?>" /><br/>
479
+ <textarea name="description[<?php echo $pid ?>]" style="width:95%; margin-top: 2px;" rows="2" ><?php echo stripslashes($picture->description) ?></textarea>
480
+ </td>
481
+ <?php
482
+ break;
483
+ case 'exclude' :
484
+ ?>
485
+ <td <?php echo $attributes ?>><input name="exclude[<?php echo $pid ?>]" type="checkbox" value="1" <?php echo $exclude ?> /></td>
486
+ <?php
487
+ break;
488
+ case 'tags' :
489
+ $picture->tags = wp_get_object_terms($pid, 'ngg_tag', 'fields=names');
490
+ if (is_array ($picture->tags) ) $picture->tags = implode(', ', $picture->tags);
491
+ ?>
492
+ <td <?php echo $attributes ?>><textarea name="tags[<?php echo $pid ?>]" style="width:95%;" rows="2"><?php echo $picture->tags ?></textarea></td>
493
+ <?php
494
+ break;
495
+ default :
496
+ ?>
497
+ <td <?php echo $attributes ?>><?php do_action('ngg_manage_image_custom_column', $image_column_key, $pid); ?></td>
498
+ <?php
499
+ break;
500
+ }
501
+ ?>
502
+ <?php } ?>
503
+ </tr>
504
+ <?php
505
+ }
506
+ }
507
+
508
+ // In the case you have no capaptibility to see the search result
509
+ if ( $counter == 0 )
510
+ echo '<tr><td colspan="' . $num_columns . '" align="center"><strong>'.__('No entries found','nggallery').'</strong></td></tr>';
511
+
512
+ ?>
513
+
514
+ </tbody>
515
+ </table>
516
+ <div class="tablenav bottom">
517
+ <input type="submit" class="button-primary action" name="updatepictures" value="<?php _e('Save Changes', 'nggallery'); ?>" />
518
+ <?php $ngg->manage_page->pagination( 'bottom', $_GET['paged'], $nggdb->paged['total_objects'], $nggdb->paged['objects_per_page'] ); ?>
519
+ </div>
520
+ </form>
521
+ <br class="clear"/>
522
+ </div><!-- /#wrap -->
523
+
524
+ <!-- #entertags -->
525
+ <div id="entertags" style="display: none;" >
526
+ <form id="form-tags" method="POST" accept-charset="utf-8">
527
+ <?php wp_nonce_field('ngg_thickbox_form') ?>
528
+ <input type="hidden" id="entertags_imagelist" name="TB_imagelist" value="" />
529
+ <input type="hidden" id="entertags_bulkaction" name="TB_bulkaction" value="" />
530
+ <input type="hidden" name="page" value="manage-images" />
531
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
532
+ <tr>
533
+ <th><?php _e("Enter the tags",'nggallery'); ?> : <input name="taglist" type="text" style="width:90%" value="" /></th>
534
+ </tr>
535
+ <tr align="right">
536
+ <td class="submit">
537
+ <input class="button-primary" type="submit" name="TB_EditTags" value="<?php _e("OK",'nggallery'); ?>" />
538
+ &nbsp;
539
+ <input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php _e("Cancel",'nggallery'); ?>&nbsp;" />
540
+ </td>
541
+ </tr>
542
+ </table>
543
+ </form>
544
+ </div>
545
+ <!-- /#entertags -->
546
+
547
+ <!-- #selectgallery -->
548
+ <div id="selectgallery" style="display: none;" >
549
+ <form id="form-select-gallery" method="POST" accept-charset="utf-8">
550
+ <?php wp_nonce_field('ngg_thickbox_form') ?>
551
+ <input type="hidden" id="selectgallery_imagelist" name="TB_imagelist" value="" />
552
+ <input type="hidden" id="selectgallery_bulkaction" name="TB_bulkaction" value="" />
553
+ <input type="hidden" name="page" value="manage-images" />
554
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
555
+ <tr>
556
+ <th>
557
+ <?php _e('Select the destination gallery:', 'nggallery'); ?>&nbsp;
558
+ <select name="dest_gid" style="width:90%" >
559
+ <?php
560
+ foreach ($gallerylist as $gallery) {
561
+ if ($gallery->gid != $act_gid) {
562
+ ?>
563
+ <option value="<?php echo $gallery->gid; ?>" ><?php echo $gallery->gid; ?> - <?php echo esc_attr( stripslashes($gallery->title) ); ?></option>
564
+ <?php
565
+ }
566
+ }
567
+ ?>
568
+ </select>
569
+ </th>
570
+ </tr>
571
+ <tr align="right">
572
+ <td class="submit">
573
+ <input type="submit" class="button-primary" name="TB_SelectGallery" value="<?php _e("OK",'nggallery'); ?>" />
574
+ &nbsp;
575
+ <input class="button-secondary dialog-cancel" type="reset" value="<?php _e("Cancel",'nggallery'); ?>" />
576
+ </td>
577
+ </tr>
578
+ </table>
579
+ </form>
580
+ </div>
581
+ <!-- /#selectgallery -->
582
+
583
+ <!-- #resize_images -->
584
+ <div id="resize_images" style="display: none;" >
585
+ <form id="form-resize-images" method="POST" accept-charset="utf-8">
586
+ <?php wp_nonce_field('ngg_thickbox_form') ?>
587
+ <input type="hidden" id="resize_images_imagelist" name="TB_imagelist" value="" />
588
+ <input type="hidden" id="resize_images_bulkaction" name="TB_bulkaction" value="" />
589
+ <input type="hidden" name="page" value="manage-images" />
590
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
591
+ <tr valign="top">
592
+ <td>
593
+ <strong><?php _e('Resize Images to', 'nggallery'); ?>:</strong>
594
+ </td>
595
+ <td>
596
+ <input type="text" size="5" name="imgWidth" value="<?php echo $ngg->options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $ngg->options['imgHeight']; ?>" />
597
+ <br /><small><?php _e('Width x height (in pixel). NextGEN Gallery will keep ratio size','nggallery') ?></small>
598
+ </td>
599
+ </tr>
600
+ <tr align="right">
601
+ <td colspan="2" class="submit">
602
+ <input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'nggallery'); ?>" />
603
+ &nbsp;
604
+ <input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php _e('Cancel', 'nggallery'); ?>&nbsp;" />
605
+ </td>
606
+ </tr>
607
+ </table>
608
+ </form>
609
+ </div>
610
+ <!-- /#resize_images -->
611
+
612
+ <!-- #new_thumbnail -->
613
+ <div id="new_thumbnail" style="display: none;" >
614
+ <form id="form-new-thumbnail" method="POST" accept-charset="utf-8">
615
+ <?php wp_nonce_field('ngg_thickbox_form') ?>
616
+ <input type="hidden" id="new_thumbnail_imagelist" name="TB_imagelist" value="" />
617
+ <input type="hidden" id="new_thumbnail_bulkaction" name="TB_bulkaction" value="" />
618
+ <input type="hidden" name="page" value="manage-images" />
619
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
620
+ <tr valign="top">
621
+ <th align="left"><?php _e('Width x height (in pixel)','nggallery') ?></th>
622
+ <td><input type="text" size="5" maxlength="5" name="thumbwidth" value="<?php echo $ngg->options['thumbwidth']; ?>" /> x <input type="text" size="5" maxlength="5" name="thumbheight" value="<?php echo $ngg->options['thumbheight']; ?>" />
623
+ <br /><small><?php _e('These values are maximum values ','nggallery') ?></small></td>
624
+ </tr>
625
+ <tr valign="top">
626
+ <th align="left"><?php _e('Set fix dimension','nggallery') ?></th>
627
+ <td><input type="checkbox" name="thumbfix" value="1" <?php checked('1', $ngg->options['thumbfix']); ?> />
628
+ <br /><small><?php _e('Ignore the aspect ratio, no portrait thumbnails','nggallery') ?></small></td>
629
+ </tr>
630
+ <tr align="right">
631
+ <td colspan="2" class="submit">
632
+ <input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'nggallery');?>" />
633
+ &nbsp;
634
+ <input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php _e('Cancel', 'nggallery'); ?>&nbsp;" />
635
+ </td>
636
+ </tr>
637
+ </table>
638
+ </form>
639
+ </div>
640
+ <!-- /#new_thumbnail -->
641
+
642
+ <script type="text/javascript">
643
+ /* <![CDATA[ */
644
+ jQuery(document).ready(function(){columns.init('nggallery-manage-images');});
645
+ /* ]]> */
646
+ </script>
647
+ <?php
648
+ }
649
+
650
+ /**
651
+ * Construtor class to create the table layout
652
+ *
653
+ * @package WordPress
654
+ * @subpackage List_Table
655
+ * @since 1.8.0
656
+ * @access private
657
+ */
658
+ class _NGG_Images_List_Table extends WP_List_Table {
659
+ var $_screen;
660
+ var $_columns;
661
+
662
+ function _NGG_Images_List_Table( $screen ) {
663
+ if ( is_string( $screen ) )
664
+ $screen = convert_to_screen( $screen );
665
+
666
+ $this->_screen = $screen;
667
+ $this->_columns = array() ;
668
+
669
+ add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 );
670
+ }
671
+
672
+ function get_column_info() {
673
+
674
+ $columns = get_column_headers( $this->_screen );
675
+ $hidden = get_hidden_columns( $this->_screen );
676
+ $_sortable = $this->get_sortable_columns();
677
+ $sortable = array();
678
+
679
+ foreach ( $_sortable as $id => $data ) {
680
+ if ( empty( $data ) )
681
+ continue;
682
+
683
+ $data = (array) $data;
684
+ if ( !isset( $data[1] ) )
685
+ $data[1] = false;
686
+
687
+ $sortable[$id] = $data;
688
+ }
689
+
690
+ return array( $columns, $hidden, $sortable );
691
+ }
692
+
693
+ // define the columns to display, the syntax is 'internal name' => 'display name'
694
+ function get_columns() {
695
+ $columns = array();
696
+
697
+ $columns['cb'] = '<input name="checkall" type="checkbox" onclick="checkAll(document.getElementById(\'updategallery\'));" />';
698
+ $columns['id'] = __('ID');
699
+ $columns['thumbnail'] = __('Thumbnail', 'nggallery');
700
+ $columns['filename'] = __('Filename', 'nggallery');
701
+ $columns['alt_title_desc'] = __('Alt &amp; Title Text', 'nggallery') . ' / ' . __('Description', 'nggallery');
702
+ $columns['tags'] = __('Tags (comma separated list)', 'nggallery');
703
+ $columns['exclude'] = __('exclude', 'nggallery');
704
+
705
+ $columns = apply_filters('ngg_manage_images_columns', $columns);
706
+
707
+ return $columns;
708
+ }
709
+
710
+ function get_sortable_columns() {
711
+ return array();
712
+ }
713
+ }
714
+
715
+ ?>
admin/manage-sort.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @author Alex Rabe
5
+ *
6
+ */
7
+
8
+ function nggallery_sortorder($galleryID = 0){
9
+ global $wpdb, $ngg, $nggdb;
10
+
11
+ if ($galleryID == 0) return;
12
+
13
+ $galleryID = (int) $galleryID;
14
+
15
+ if (isset ($_POST['updateSortorder'])) {
16
+ check_admin_referer('ngg_updatesortorder');
17
+ // get variable new sortorder
18
+ parse_str($_POST['sortorder']);
19
+ if (is_array($sortArray)){
20
+ $neworder = array();
21
+ foreach($sortArray as $pid) {
22
+ $pid = substr($pid, 4); // get id from "pid-x"
23
+ $neworder[] = (int) $pid;
24
+ }
25
+ $sortindex = 1;
26
+ foreach($neworder as $pic_id) {
27
+ $wpdb->query("UPDATE $wpdb->nggpictures SET sortorder = '$sortindex' WHERE pid = $pic_id");
28
+ $sortindex++;
29
+ }
30
+
31
+ do_action('ngg_gallery_sort', $galleryID);
32
+
33
+ nggGallery::show_message(__('Sort order changed','nggallery'));
34
+ }
35
+ }
36
+
37
+ // look for presort args
38
+ $presort = isset($_GET['presort']) ? $_GET['presort'] : false;
39
+ $dir = ( isset($_GET['dir']) && $_GET['dir'] == 'DESC' ) ? 'DESC' : 'ASC';
40
+ $sortitems = array('pid', 'filename', 'alttext', 'imagedate');
41
+ // ensure that nobody added some evil sorting :-)
42
+ if (in_array( $presort, $sortitems) )
43
+ $picturelist = $nggdb->get_gallery($galleryID, $presort, $dir, false);
44
+ else
45
+ $picturelist = $nggdb->get_gallery($galleryID, 'sortorder', $dir, false);
46
+
47
+ //this is the url without any presort variable
48
+ $clean_url = 'admin.php?page=nggallery-manage-gallery&amp;mode=sort&amp;gid=' . $galleryID;
49
+ //if we go back , then the mode should be edit
50
+ $back_url = 'admin.php?page=nggallery-manage-gallery&amp;mode=edit&amp;gid=' . $galleryID;
51
+
52
+ // In the case somebody presort, then we take this url
53
+ if ( isset($_GET['dir']) || isset($_GET['presort']) )
54
+ $base_url = $_SERVER['REQUEST_URI'];
55
+ else
56
+ $base_url = $clean_url;
57
+
58
+ ?>
59
+ <script type="text/javascript">
60
+ // seralize the ImageOrder
61
+ function saveImageOrder()
62
+ {
63
+ var serial = "";
64
+ var objects = document.getElementsByTagName('div');
65
+ for(var no=0;no<objects.length;no++){
66
+ if(objects[no].className=='imageBox' || objects[no].className=='imageBoxHighlighted'){
67
+ if (serial.length > 0) serial = serial + '&'
68
+ serial = serial + "sortArray[]=" + objects[no].id;
69
+ }
70
+ }
71
+ jQuery('input[name=sortorder]').val(serial);
72
+ // debug( 'This is the new order of the images(IDs) : <br>' + orderString );
73
+
74
+ }
75
+ jQuery(document).ready(function($) {
76
+ $(".jqui-sortable").sortable({items: 'div.imageBox'});
77
+ });
78
+ </script>
79
+ <div class="wrap">
80
+ <form id="sortGallery" method="POST" action="<?php echo $clean_url ?>" onsubmit="saveImageOrder()" accept-charset="utf-8">
81
+ <h2><?php _e('Sort Gallery', 'nggallery') ?></h2>
82
+ <div class="tablenav">
83
+ <div class="alignleft actions">
84
+ <?php wp_nonce_field('ngg_updatesortorder') ?>
85
+ <input class="button-primary action" type="submit" name="updateSortorder" onclick="saveImageOrder()" value="<?php _e('Update Sort Order', 'nggallery') ?>" />
86
+ </div>
87
+ <div class="alignright actions">
88
+ <a href="<?php echo esc_url( $back_url ); ?>" class="button"><?php _e('Back to gallery', 'nggallery'); ?></a>
89
+ </div>
90
+ </div>
91
+ <input name="sortorder" type="hidden" />
92
+ <ul class="subsubsub">
93
+ <li><?php _e('Presort', 'nggallery') ?> :</li>
94
+ <li><a href="<?php echo esc_attr(remove_query_arg('presort', $base_url)); ?>" <?php if ($presort == '') echo 'class="current"'; ?>><?php _e('Unsorted', 'nggallery') ?></a> |</li>
95
+ <li><a href="<?php echo esc_attr(add_query_arg('presort', 'pid', $base_url)); ?>" <?php if ($presort == 'pid') echo 'class="current"'; ?>><?php _e('Image ID', 'nggallery') ?></a> |</li>
96
+ <li><a href="<?php echo esc_attr(add_query_arg('presort', 'filename', $base_url)); ?>" <?php if ($presort == 'filename') echo 'class="current"'; ?>><?php _e('Filename', 'nggallery') ?></a> |</li>
97
+ <li><a href="<?php echo esc_attr(add_query_arg('presort', 'alttext', $base_url)); ?>" <?php if ($presort == 'alttext') echo 'class="current"'; ?>><?php _e('Alt/Title text', 'nggallery') ?></a> |</li>
98
+ <li><a href="<?php echo esc_attr(add_query_arg('presort', 'imagedate', $base_url)); ?>" <?php if ($presort == 'imagedate') echo 'class="current"'; ?>><?php _e('Date/Time', 'nggallery') ?></a> |</li>
99
+ <li><a href="<?php echo esc_attr(add_query_arg('dir', 'ASC', $base_url)); ?>" <?php if ($dir == 'ASC') echo 'class="current"'; ?>><?php _e('Ascending', 'nggallery') ?></a> |</li>
100
+ <li><a href="<?php echo esc_attr(add_query_arg('dir', 'DESC', $base_url)); ?>" <?php if ($dir == 'DESC') echo 'class="current"'; ?>><?php _e('Descending', 'nggallery') ?></a></li>
101
+ </ul>
102
+ </form>
103
+ <div id="debug" style="clear:both"></div>
104
+ <div class='jqui-sortable'>
105
+ <?php
106
+ if($picturelist) {
107
+ foreach($picturelist as $picture) {
108
+ ?>
109
+ <div class="imageBox" id="pid-<?php echo $picture->pid ?>">
110
+ <div class="imageBox_theImage" style="background-image:url('<?php echo esc_url( $picture->thumbURL ); ?>')"></div>
111
+ <div class="imageBox_label"><span><?php echo esc_html( stripslashes($picture->alttext) ); ?></span></div>
112
+ </div>
113
+ <?php
114
+ }
115
+ }
116
+ ?>
117
+ </div>
118
+ </div>
119
+
120
+ <?php
121
+ }
122
+ ?>
admin/manage.php ADDED
@@ -0,0 +1,657 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ class nggManageGallery {
6
+
7
+ var $mode = 'main';
8
+ var $gid = false;
9
+ var $pid = false;
10
+ var $base_page = 'admin.php?page=nggallery-manage-gallery';
11
+ var $search_result = false;
12
+
13
+ // initiate the manage page
14
+ function nggManageGallery() {
15
+
16
+ // GET variables
17
+ if( isset($_GET['gid']) )
18
+ $this->gid = (int) $_GET['gid'];
19
+ if( isset($_GET['pid']) )
20
+ $this->pid = (int) $_GET['pid'];
21
+ if( isset($_GET['mode']) )
22
+ $this->mode = trim ($_GET['mode']);
23
+ // Check for pagination request, avoid post process of other submit button, exclude search results
24
+ if ( isset($_POST['post_paged']) && !isset($_GET['s'] ) ) {
25
+ if ( $_GET['paged'] != $_POST['post_paged'] ) {
26
+ $_GET['paged'] = absint( $_POST['post_paged'] );
27
+ return;
28
+ }
29
+ }
30
+ // Should be only called via manage galleries overview
31
+ if ( isset($_POST['page']) && $_POST['page'] == 'manage-galleries' )
32
+ $this->post_processor_galleries();
33
+ // Should be only called via a edit single gallery page
34
+ if ( isset($_POST['page']) && $_POST['page'] == 'manage-images' )
35
+ $this->post_processor_images();
36
+ // Should be called via a publish dialog
37
+ if ( isset($_POST['page']) && $_POST['page'] == 'publish-post' )
38
+ $this->publish_post();
39
+ //Look for other POST process
40
+ if ( !empty($_POST) || !empty($_GET) )
41
+ $this->processor();
42
+
43
+ }
44
+
45
+ function controller() {
46
+
47
+ switch($this->mode) {
48
+ case 'sort':
49
+ include_once (dirname (__FILE__) . '/manage-sort.php');
50
+ nggallery_sortorder($this->gid);
51
+ break;
52
+ case 'edit':
53
+ include_once (dirname (__FILE__) . '/manage-images.php');
54
+ nggallery_picturelist();
55
+ break;
56
+ case 'main':
57
+ default:
58
+ include_once (dirname (__FILE__) . '/manage-galleries.php');
59
+ nggallery_manage_gallery_main();
60
+ break;
61
+ }
62
+ }
63
+
64
+ function processor() {
65
+
66
+ global $wpdb, $ngg, $nggdb;
67
+
68
+ // Delete a picture
69
+ if ($this->mode == 'delpic') {
70
+
71
+ //TODO:Remove also Tag reference
72
+ check_admin_referer('ngg_delpicture');
73
+ $image = $nggdb->find_image( $this->pid );
74
+ if ($image) {
75
+ if ($ngg->options['deleteImg']) {
76
+ @unlink($image->imagePath);
77
+ @unlink($image->thumbPath);
78
+ @unlink($image->imagePath . '_backup' );
79
+ }
80
+ do_action('ngg_delete_picture', $this->pid);
81
+ $result = nggdb::delete_image ( $this->pid );
82
+ }
83
+
84
+ if ($result)
85
+ nggGallery::show_message( __('Picture','nggallery').' \''.$this->pid.'\' '.__('deleted successfully','nggallery') );
86
+
87
+ $this->mode = 'edit'; // show pictures
88
+
89
+ }
90
+
91
+ // Recover picture from backup
92
+ if ($this->mode == 'recoverpic') {
93
+
94
+ check_admin_referer('ngg_recoverpicture');
95
+ $image = $nggdb->find_image( $this->pid );
96
+ // bring back the old image
97
+ nggAdmin::recover_image($image);
98
+ nggAdmin::create_thumbnail($image);
99
+
100
+ nggGallery::show_message(__('Operation successful. Please clear your browser cache.',"nggallery"));
101
+
102
+ $this->mode = 'edit'; // show pictures
103
+
104
+ }
105
+
106
+ // will be called after a ajax operation
107
+ if (isset ($_POST['ajax_callback'])) {
108
+ if ($_POST['ajax_callback'] == 1)
109
+ nggGallery::show_message(__('Operation successful. Please clear your browser cache.',"nggallery"));
110
+ }
111
+
112
+ // show sort order
113
+ if ( isset ($_POST['sortGallery']) )
114
+ $this->mode = 'sort';
115
+
116
+ if ( isset ($_GET['s']) )
117
+ $this->search_images();
118
+
119
+ }
120
+
121
+ function post_processor_galleries() {
122
+ global $wpdb, $ngg, $nggdb;
123
+
124
+ // bulk update in a single gallery
125
+ if (isset ($_POST['bulkaction']) && isset ($_POST['doaction'])) {
126
+
127
+ check_admin_referer('ngg_bulkgallery');
128
+
129
+ switch ($_POST['bulkaction']) {
130
+ case 'no_action';
131
+ // No action
132
+ break;
133
+ case 'recover_images':
134
+ // Recover images from backup
135
+ // A prefix 'gallery_' will first fetch all ids from the selected galleries
136
+ nggAdmin::do_ajax_operation( 'gallery_recover_image' , $_POST['doaction'], __('Recover from backup','nggallery') );
137
+ break;
138
+ case 'set_watermark':
139
+ // Set watermark
140
+ // A prefix 'gallery_' will first fetch all ids from the selected galleries
141
+ nggAdmin::do_ajax_operation( 'gallery_set_watermark' , $_POST['doaction'], __('Set watermark','nggallery') );
142
+ break;
143
+ case 'import_meta':
144
+ // Import Metadata
145
+ // A prefix 'gallery_' will first fetch all ids from the selected galleries
146
+ nggAdmin::do_ajax_operation( 'gallery_import_metadata' , $_POST['doaction'], __('Import metadata','nggallery') );
147
+ break;
148
+ case 'delete_gallery':
149
+ // Delete gallery
150
+ if ( is_array($_POST['doaction']) ) {
151
+ $deleted = false;
152
+ foreach ( $_POST['doaction'] as $id ) {
153
+ // get the path to the gallery
154
+ $gallery = nggdb::find_gallery($id);
155
+ if ($gallery){
156
+ //TODO:Remove also Tag reference, look here for ids instead filename
157
+ $imagelist = $wpdb->get_col("SELECT filename FROM $wpdb->nggpictures WHERE galleryid = '$gallery->gid' ");
158
+ if ($ngg->options['deleteImg']) {
159
+ if (is_array($imagelist)) {
160
+ foreach ($imagelist as $filename) {
161
+ @unlink(WINABSPATH . $gallery->path . '/thumbs/thumbs_' . $filename);
162
+ @unlink(WINABSPATH . $gallery->path .'/'. $filename);
163
+ @unlink(WINABSPATH . $gallery->path .'/'. $filename . '_backup');
164
+ }
165
+ }
166
+ // delete folder
167
+ @rmdir( WINABSPATH . $gallery->path . '/thumbs' );
168
+ @rmdir( WINABSPATH . $gallery->path );
169
+ }
170
+ }
171
+ do_action('ngg_delete_gallery', $id);
172
+ $deleted = nggdb::delete_gallery( $id );
173
+ }
174
+
175
+ if($deleted)
176
+ nggGallery::show_message(__('Gallery deleted successfully ', 'nggallery'));
177
+
178
+ }
179
+ break;
180
+ }
181
+ }
182
+
183
+ if (isset ($_POST['addgallery']) && isset ($_POST['galleryname'])){
184
+
185
+ check_admin_referer('ngg_addgallery');
186
+
187
+ if ( !nggGallery::current_user_can( 'NextGEN Add new gallery' ))
188
+ wp_die(__('Cheatin&#8217; uh?'));
189
+
190
+ // get the default path for a new gallery
191
+ $defaultpath = $ngg->options['gallerypath'];
192
+ $newgallery = esc_attr( $_POST['galleryname']);
193
+ if ( !empty($newgallery) )
194
+ nggAdmin::create_gallery($newgallery, $defaultpath);
195
+
196
+ do_action( 'ngg_update_addgallery_page' );
197
+ }
198
+
199
+ if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_ResizeImages'])) {
200
+
201
+ check_admin_referer('ngg_thickbox_form');
202
+
203
+ //save the new values for the next operation
204
+ $ngg->options['imgWidth'] = (int) $_POST['imgWidth'];
205
+ $ngg->options['imgHeight'] = (int) $_POST['imgHeight'];
206
+ // What is in the case the user has no if cap 'NextGEN Change options' ? Check feedback
207
+ update_option('ngg_options', $ngg->options);
208
+
209
+ $gallery_ids = explode(',', $_POST['TB_imagelist']);
210
+ // A prefix 'gallery_' will first fetch all ids from the selected galleries
211
+ nggAdmin::do_ajax_operation( 'gallery_resize_image' , $gallery_ids, __('Resize images','nggallery') );
212
+ }
213
+
214
+ if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail'])) {
215
+
216
+ check_admin_referer('ngg_thickbox_form');
217
+
218
+ //save the new values for the next operation
219
+ $ngg->options['thumbwidth'] = (int) $_POST['thumbwidth'];
220
+ $ngg->options['thumbheight'] = (int) $_POST['thumbheight'];
221
+ $ngg->options['thumbfix'] = isset ($_POST['thumbfix']) ? true : false;
222
+ // What is in the case the user has no if cap 'NextGEN Change options' ? Check feedback
223
+ update_option('ngg_options', $ngg->options);
224
+
225
+ $gallery_ids = explode(',', $_POST['TB_imagelist']);
226
+ // A prefix 'gallery_' will first fetch all ids from the selected galleries
227
+ nggAdmin::do_ajax_operation( 'gallery_create_thumbnail' , $gallery_ids, __('Create new thumbnails','nggallery') );
228
+ }
229
+
230
+ }
231
+
232
+ function post_processor_images() {
233
+ global $wpdb, $ngg, $nggdb;
234
+
235
+ // bulk update in a single gallery
236
+ if (isset ($_POST['bulkaction']) && isset ($_POST['doaction'])) {
237
+
238
+ check_admin_referer('ngg_updategallery');
239
+
240
+ switch ($_POST['bulkaction']) {
241
+ case 'no_action';
242
+ break;
243
+ case 'rotate_cw':
244
+ nggAdmin::do_ajax_operation( 'rotate_cw' , $_POST['doaction'], __('Rotate images', 'nggallery') );
245
+ break;
246
+ case 'rotate_ccw':
247
+ nggAdmin::do_ajax_operation( 'rotate_ccw' , $_POST['doaction'], __('Rotate images', 'nggallery') );
248
+ break;
249
+ case 'recover_images':
250
+ nggAdmin::do_ajax_operation( 'recover_image' , $_POST['doaction'], __('Recover from backup', 'nggallery') );
251
+ break;
252
+ case 'set_watermark':
253
+ nggAdmin::do_ajax_operation( 'set_watermark' , $_POST['doaction'], __('Set watermark', 'nggallery') );
254
+ break;
255
+ case 'delete_images':
256
+ if ( is_array($_POST['doaction']) ) {
257
+ foreach ( $_POST['doaction'] as $imageID ) {
258
+ $image = $nggdb->find_image( $imageID );
259
+ if ($image) {
260
+ if ($ngg->options['deleteImg']) {
261
+ @unlink($image->imagePath);
262
+ @unlink($image->thumbPath);
263
+ @unlink($image->imagePath."_backup");
264
+ }
265
+ do_action('ngg_delete_picture', $image->pid);
266
+ $delete_pic = nggdb::delete_image( $image->pid );
267
+ }
268
+ }
269
+ if($delete_pic)
270
+ nggGallery::show_message(__('Pictures deleted successfully ', 'nggallery'));
271
+ }
272
+ break;
273
+ case 'import_meta':
274
+ nggAdmin::do_ajax_operation( 'import_metadata' , $_POST['doaction'], __('Import metadata', 'nggallery') );
275
+ break;
276
+ }
277
+ }
278
+
279
+ if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_ResizeImages'])) {
280
+
281
+ check_admin_referer('ngg_thickbox_form');
282
+
283
+ //save the new values for the next operation
284
+ $ngg->options['imgWidth'] = (int) $_POST['imgWidth'];
285
+ $ngg->options['imgHeight'] = (int) $_POST['imgHeight'];
286
+
287
+ update_option('ngg_options', $ngg->options);
288
+
289
+ $pic_ids = explode(',', $_POST['TB_imagelist']);
290
+ nggAdmin::do_ajax_operation( 'resize_image' , $pic_ids, __('Resize images','nggallery') );
291
+ }
292
+
293
+ if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail'])) {
294
+
295
+ check_admin_referer('ngg_thickbox_form');
296
+
297
+ //save the new values for the next operation
298
+ $ngg->options['thumbwidth'] = (int) $_POST['thumbwidth'];
299
+ $ngg->options['thumbheight'] = (int) $_POST['thumbheight'];
300
+ $ngg->options['thumbfix'] = isset ( $_POST['thumbfix'] ) ? true : false;
301
+ update_option('ngg_options', $ngg->options);
302
+
303
+ $pic_ids = explode(',', $_POST['TB_imagelist']);
304
+ nggAdmin::do_ajax_operation( 'create_thumbnail' , $pic_ids, __('Create new thumbnails','nggallery') );
305
+ }
306
+
307
+ if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_SelectGallery'])) {
308
+
309
+ check_admin_referer('ngg_thickbox_form');
310
+
311
+ $pic_ids = explode(',', $_POST['TB_imagelist']);
312
+ $dest_gid = (int) $_POST['dest_gid'];
313
+
314
+ switch ($_POST['TB_bulkaction']) {
315
+ case 'copy_to':
316
+ // Copy images
317
+ nggAdmin::copy_images( $pic_ids, $dest_gid );
318
+ break;
319
+ case 'move_to':
320
+ // Move images
321
+ nggAdmin::move_images( $pic_ids, $dest_gid );
322
+ break;
323
+ }
324
+ }
325
+
326
+ if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_EditTags'])) {
327
+ // do tags update
328
+
329
+ check_admin_referer('ngg_thickbox_form');
330
+
331
+ // get the images list
332
+ $pic_ids = explode(',', $_POST['TB_imagelist']);
333
+ $taglist = explode(',', $_POST['taglist']);
334
+ $taglist = array_map('trim', $taglist);
335
+
336
+ if (is_array($pic_ids)) {
337
+
338
+ foreach($pic_ids as $pic_id) {
339
+
340
+ // which action should be performed ?
341
+ switch ($_POST['TB_bulkaction']) {
342
+ case 'no_action';
343
+ // No action
344
+ break;
345
+ case 'overwrite_tags':
346
+ // Overwrite tags
347
+ wp_set_object_terms($pic_id, $taglist, 'ngg_tag');
348
+ break;
349
+ case 'add_tags':
350
+ // Add / append tags
351
+ wp_set_object_terms($pic_id, $taglist, 'ngg_tag', TRUE);
352
+ break;
353
+ case 'delete_tags':
354
+ // Delete tags
355
+ $oldtags = wp_get_object_terms($pic_id, 'ngg_tag', 'fields=names');
356
+ // get the slugs, to vaoid case sensitive problems
357
+ $slugarray = array_map('sanitize_title', $taglist);
358
+ $oldtags = array_map('sanitize_title', $oldtags);
359
+ // compare them and return the diff
360
+ $newtags = array_diff($oldtags, $slugarray);
361
+ wp_set_object_terms($pic_id, $newtags, 'ngg_tag');
362
+ break;
363
+ }
364
+ }
365
+
366
+ nggGallery::show_message( __('Tags changed', 'nggallery') );
367
+ }
368
+ }
369
+
370
+ if (isset ($_POST['updatepictures']) ) {
371
+ // Update pictures
372
+
373
+ check_admin_referer('ngg_updategallery');
374
+
375
+ if ( nggGallery::current_user_can( 'NextGEN Edit gallery options' ) && !isset ($_GET['s']) ) {
376
+
377
+ if ( nggGallery::current_user_can( 'NextGEN Edit gallery title' )) {
378
+ // don't forget to update the slug
379
+ $slug = nggdb::get_unique_slug( sanitize_title( $_POST['title'] ), 'gallery', $this->gid );
380
+ $wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggallery SET title= '%s', slug= '%s' WHERE gid = %d", esc_attr($_POST['title']), $slug, $this->gid) );
381
+ }
382
+ if ( nggGallery::current_user_can( 'NextGEN Edit gallery path' ))
383
+ $wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggallery SET path= '%s' WHERE gid = %d", untrailingslashit ( str_replace('\\', '/', trim( stripslashes($_POST['path']) )) ), $this->gid ) );
384
+ if ( nggGallery::current_user_can( 'NextGEN Edit gallery description' ))
385
+ $wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggallery SET galdesc= '%s' WHERE gid = %d", esc_attr( $_POST['gallerydesc'] ), $this->gid) );
386
+ if ( nggGallery::current_user_can( 'NextGEN Edit gallery page id' ))
387
+ $wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggallery SET pageid= '%d' WHERE gid = %d", (int) $_POST['pageid'], $this->gid) );
388
+ if ( nggGallery::current_user_can( 'NextGEN Edit gallery preview pic' ))
389
+ $wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggallery SET previewpic= '%d' WHERE gid = %d", (int) $_POST['previewpic'], $this->gid) );
390
+ if ( isset ($_POST['author']) && nggGallery::current_user_can( 'NextGEN Edit gallery author' ) )
391
+ $wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggallery SET author= '%d' WHERE gid = %d", (int) $_POST['author'], $this->gid) );
392
+
393
+ wp_cache_delete($this->gid, 'ngg_gallery');
394
+
395
+ }
396
+
397
+ $this->update_pictures();
398
+
399
+ //hook for other plugin to update the fields
400
+ do_action('ngg_update_gallery', $this->gid, $_POST);
401
+
402
+ nggGallery::show_message(__('Update successful',"nggallery"));
403
+ }
404
+
405
+ if (isset ($_POST['scanfolder'])) {
406
+ // Rescan folder
407
+ check_admin_referer('ngg_updategallery');
408
+
409
+ $gallerypath = $wpdb->get_var("SELECT path FROM $wpdb->nggallery WHERE gid = '$this->gid' ");
410
+ nggAdmin::import_gallery($gallerypath);
411
+ }
412
+
413
+ if (isset ($_POST['addnewpage'])) {
414
+ // Add a new page
415
+
416
+ check_admin_referer('ngg_updategallery');
417
+
418
+ $parent_id = esc_attr($_POST['parent_id']);
419
+ $gallery_title = esc_attr($_POST['title']);
420
+ $gallery_name = $wpdb->get_var("SELECT name FROM $wpdb->nggallery WHERE gid = '$this->gid' ");
421
+
422
+ // Create a WP page
423
+ global $user_ID;
424
+
425
+ $page['post_type'] = 'page';
426
+ $page['post_content'] = '[nggallery id=' . $this->gid . ']';
427
+ $page['post_parent'] = $parent_id;
428
+ $page['post_author'] = $user_ID;
429
+ $page['post_status'] = 'publish';
430
+ $page['post_title'] = $gallery_title == '' ? $gallery_name : $gallery_title;
431
+ $page = apply_filters('ngg_add_new_page', $page, $this->gid);
432
+
433
+ $gallery_pageid = wp_insert_post ($page);
434
+ if ($gallery_pageid != 0) {
435
+ $result = $wpdb->query("UPDATE $wpdb->nggallery SET title= '$gallery_title', pageid = '$gallery_pageid' WHERE gid = '$this->gid'");
436
+ wp_cache_delete($this->gid, 'ngg_gallery');
437
+ nggGallery::show_message( __('New gallery page ID','nggallery'). ' ' . $gallery_pageid . ' -> <strong>' . $gallery_title . '</strong> ' .__('created','nggallery') );
438
+ }
439
+
440
+ do_action('ngg_gallery_addnewpage', $this->gid);
441
+ }
442
+ }
443
+
444
+ /**
445
+ * Publish a new post with the shortcode from the selected image
446
+ *
447
+ * @since 1.7.0
448
+ * @return void
449
+ */
450
+ function publish_post() {
451
+
452
+ check_admin_referer('publish-post');
453
+
454
+ // Create a WP page
455
+ global $user_ID, $ngg;
456
+
457
+ $ngg->options['publish_width'] = (int) $_POST['width'];
458
+ $ngg->options['publish_height'] = (int) $_POST['height'];
459
+ $ngg->options['publish_align'] = $_POST['align'];
460
+ $align = ( $ngg->options['publish_align'] == 'none') ? '' : 'float='.$ngg->options['publish_align'];
461
+
462
+ //save the new values for the next operation
463
+ update_option('ngg_options', $ngg->options);
464
+
465
+ $post['post_type'] = 'post';
466
+ $post['post_content'] = '[singlepic id=' . intval($_POST['pid']) . ' w=' . $ngg->options['publish_width'] . ' h=' . $ngg->options['publish_height'] . ' ' . $align . ']';
467
+ $post['post_author'] = $user_ID;
468
+ $post['post_status'] = isset ( $_POST['publish'] ) ? 'publish' : 'draft';
469
+ $post['post_title'] = $_POST['post_title'];
470
+ $post = apply_filters('ngg_add_new_post', $post, $_POST['pid']);
471
+
472
+ $post_id = wp_insert_post ($post);
473
+
474
+ if ($post_id != 0)
475
+ nggGallery::show_message( __('Published a new post','nggallery') );
476
+
477
+ }
478
+
479
+ function update_pictures() {
480
+ global $wpdb, $nggdb;
481
+
482
+ //TODO:Error message when update failed
483
+
484
+ $description = isset ( $_POST['description'] ) ? $_POST['description'] : array();
485
+ $alttext = isset ( $_POST['alttext'] ) ? $_POST['alttext'] : array();
486
+ $exclude = isset ( $_POST['exclude'] ) ? $_POST['exclude'] : false;
487
+ $taglist = isset ( $_POST['tags'] ) ? $_POST['tags'] : false;
488
+ $pictures = isset ( $_POST['pid'] ) ? $_POST['pid'] : false;
489
+
490
+ if ( is_array($pictures) ){
491
+ foreach( $pictures as $pid ){
492
+ $image = $nggdb->find_image( $pid );
493
+ if ($image) {
494
+ // description field
495
+ $image->description = $description[$image->pid];
496
+
497
+ // only uptade this field if someone change the alttext
498
+ if ( $image->alttext != $alttext[$image->pid] ) {
499
+ $image->alttext = $alttext[$image->pid];
500
+ $image->image_slug = nggdb::get_unique_slug( sanitize_title( $image->alttext ), 'image', $image->pid );
501
+ }
502
+
503
+ // set exclude flag
504
+ if ( is_array($exclude) )
505
+ $image->exclude = ( array_key_exists($image->pid, $exclude) )? 1 : 0;
506
+ else
507
+ $image->exclude = 0;
508
+
509
+ // update the database
510
+ $wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggpictures SET image_slug = '%s', alttext = '%s', description = '%s', exclude = %d WHERE pid = %d",
511
+ $image->image_slug, $image->alttext, $image->description, $image->exclude, $image->pid) );
512
+ // remove from cache
513
+ wp_cache_delete($image->pid, 'ngg_image');
514
+
515
+ // hook for other plugins after image is updated
516
+ do_action('ngg_image_updated', $image);
517
+ }
518
+
519
+ }
520
+ }
521
+
522
+ //TODO: This produce 300-400 queries !
523
+ if ( is_array($taglist) ){
524
+ foreach($taglist as $key=>$value) {
525
+ $tags = explode(',', $value);
526
+ wp_set_object_terms($key, $tags, 'ngg_tag');
527
+ }
528
+ }
529
+
530
+ return;
531
+ }
532
+
533
+ // Check if user can select a author
534
+ function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
535
+ global $wpdb;
536
+
537
+ $user = new WP_User( $user_id );
538
+
539
+ if ( ! $user->has_cap('NextGEN Manage others gallery') ) {
540
+ if ( $user->has_cap('NextGEN Manage gallery') || $exclude_zeros == false )
541
+ return array($user->id);
542
+ else
543
+ return false;
544
+ }
545
+
546
+ $level_key = $wpdb->prefix . 'user_level';
547
+ $query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key'";
548
+ if ( $exclude_zeros )
549
+ $query .= " AND meta_value != '0'";
550
+
551
+ return $wpdb->get_col( $query );
552
+ }
553
+
554
+ function search_images() {
555
+ global $nggdb;
556
+
557
+ if ( empty($_GET['s']) )
558
+ return;
559
+ //on what ever reason I need to set again the query var
560
+ set_query_var('s', $_GET['s']);
561
+ $request = get_search_query();
562
+
563
+ // look now for the images
564
+ $search_for_images = (array) $nggdb->search_for_images( $request );
565
+ $search_for_tags = (array) nggTags::find_images_for_tags( $request , 'ASC' );
566
+
567
+ // finally merge the two results together
568
+ $this->search_result = array_merge( $search_for_images , $search_for_tags );
569
+
570
+ // TODO: Currently we didn't support a proper pagination
571
+ $nggdb->paged['total_objects'] = $nggdb->paged['objects_per_page'] = count ($this->search_result) ;
572
+ $nggdb->paged['max_objects_per_page'] = 1;
573
+
574
+ // show pictures page
575
+ $this->mode = 'edit';
576
+ }
577
+
578
+ /**
579
+ * Display the pagination.
580
+ *
581
+ * @since 1.8.0
582
+ * @author taken from WP core (see includes/class-wp-list-table.php)
583
+ * @return string echo the html pagination bar
584
+ */
585
+ function pagination( $which, $current, $total_items, $per_page ) {
586
+
587
+ $total_pages = ($per_page > 0) ? ceil( $total_items / $per_page ) : 1;
588
+
589
+ $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
590
+
591
+ $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
592
+
593
+ $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
594
+
595
+ $page_links = array();
596
+
597
+ $disable_first = $disable_last = '';
598
+ if ( $current == 1 )
599
+ $disable_first = ' disabled';
600
+ if ( $current == $total_pages )
601
+ $disable_last = ' disabled';
602
+
603
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
604
+ 'first-page' . $disable_first,
605
+ esc_attr__( 'Go to the first page' ),
606
+ esc_url( remove_query_arg( 'paged', $current_url ) ),
607
+ '&laquo;'
608
+ );
609
+
610
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
611
+ 'prev-page' . $disable_first,
612
+ esc_attr__( 'Go to the previous page' ),
613
+ esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
614
+ '&lsaquo;'
615
+ );
616
+
617
+ if ( 'bottom' == $which )
618
+ $html_current_page = $current;
619
+ else
620
+ $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />",
621
+ esc_attr__( 'Current page' ),
622
+ esc_attr( 'post_paged' ),
623
+ $current,
624
+ strlen( $total_pages )
625
+ );
626
+
627
+ $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
628
+ $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';
629
+
630
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
631
+ 'next-page' . $disable_last,
632
+ esc_attr__( 'Go to the next page' ),
633
+ esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
634
+ '&rsaquo;'
635
+ );
636
+
637
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
638
+ 'last-page' . $disable_last,
639
+ esc_attr__( 'Go to the last page' ),
640
+ esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
641
+ '&raquo;'
642
+ );
643
+
644
+ $output .= "\n<span class='pagination-links'>" . join( "\n", $page_links ) . '</span>';
645
+
646
+ if ( $total_pages )
647
+ $page_class = $total_pages < 2 ? ' one-page' : '';
648
+ else
649
+ $page_class = ' no-pages';
650
+
651
+ $pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
652
+
653
+ echo $pagination;
654
+ }
655
+
656
+ }
657
+ ?>
admin/media-upload.php ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @title Add action/filter for the upload tab
5
+ * @author Alex Rabe
6
+ *
7
+ */
8
+
9
+ function ngg_wp_upload_tabs ($tabs) {
10
+
11
+ $newtab = array('nextgen' => __('NextCellent Gallery','nggallery'));
12
+
13
+ return array_merge($tabs,$newtab);
14
+ }
15
+
16
+ add_filter('media_upload_tabs', 'ngg_wp_upload_tabs');
17
+
18
+ function media_upload_nextgen() {
19
+
20
+ // Not in use
21
+ $errors = false;
22
+
23
+ // Generate TinyMCE HTML output
24
+ if ( isset($_POST['send']) ) {
25
+ $keys = array_keys($_POST['send']);
26
+ $send_id = (int) array_shift($keys);
27
+ $image = $_POST['image'][$send_id];
28
+ $alttext = stripslashes( htmlspecialchars ($image['alttext'], ENT_QUOTES));
29
+ $description = stripslashes (htmlspecialchars($image['description'], ENT_QUOTES));
30
+
31
+ // here is no new line allowed
32
+ $clean_description = preg_replace("/\n|\r\n|\r$/", " ", $description);
33
+ $img = nggdb::find_image($send_id);
34
+ $thumbcode = $img->get_thumbcode();
35
+ $class="ngg-singlepic ngg-{$image['align']}";
36
+
37
+ // Build output
38
+ if ($image['size'] == "thumbnail")
39
+ $html = "<img src='{$image['thumb']}' alt='$alttext' class='$class' />";
40
+ // Wrap the link to the fullsize image around
41
+ $html = "<a $thumbcode href='{$image['url']}' title='$clean_description'>$html</a>";
42
+
43
+ if ($image['size'] == "full")
44
+ $html = "<img src='{$image['url']}' alt='$alttext' class='$class' />";
45
+
46
+ if ($image['size'] == "singlepic")
47
+ $html = "[singlepic id=$send_id w=320 h=240 float={$image['align']}]";
48
+
49
+ media_upload_nextgen_save_image();
50
+
51
+ // Return it to TinyMCE
52
+ return media_send_to_editor($html);
53
+ }
54
+
55
+ // Save button
56
+ if ( isset($_POST['save']) ) {
57
+ media_upload_nextgen_save_image();
58
+ }
59
+
60
+ return wp_iframe( 'media_upload_nextgen_form', $errors );
61
+ }
62
+
63
+ add_action('media_upload_nextgen', 'media_upload_nextgen');
64
+
65
+ function media_upload_nextgen_save_image() {
66
+
67
+ global $wpdb;
68
+
69
+ check_admin_referer('ngg-media-form');
70
+
71
+ if ( !empty($_POST['image']) ) foreach ( $_POST['image'] as $image_id => $image ) {
72
+
73
+ // create a unique slug
74
+ $image_slug = nggdb::get_unique_slug( sanitize_title( $image['alttext'] ), 'image' );
75
+ $wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggpictures SET image_slug= '%s', alttext= '%s', description = '%s' WHERE pid = %d", $image_slug, $image['alttext'], $image['description'], $image_id));
76
+ wp_cache_delete($image_id, 'ngg_image');
77
+ }
78
+ }
79
+
80
+ function media_upload_nextgen_form($errors) {
81
+
82
+ global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types, $ngg, $nggdb;
83
+
84
+ media_upload_header();
85
+
86
+ $post_id = intval($_REQUEST['post_id']);
87
+ $galleryID = 0;
88
+ $total = 1;
89
+ $picarray = array();
90
+
91
+ $form_action_url = site_url( "wp-admin/media-upload.php?type={$GLOBALS['type']}&tab=nextgen&post_id=$post_id", 'admin');
92
+
93
+ // Get number of images in gallery
94
+ if ( isset($_REQUEST['select_gal']) ){
95
+ $galleryID = (int) $_REQUEST['select_gal'];
96
+ $total = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggpictures WHERE galleryid = '$galleryID'");
97
+ }
98
+
99
+ // Build navigation
100
+ $_GET['paged'] = isset($_GET['paged']) ? intval($_GET['paged']) : 0;
101
+ if ( $_GET['paged'] < 1 )
102
+ $_GET['paged'] = 1;
103
+ $start = ( $_GET['paged'] - 1 ) * 10;
104
+ if ( $start < 1 )
105
+ $start = 0;
106
+
107
+ // Get the images
108
+ if ( $galleryID != 0 )
109
+ $picarray = $wpdb->get_col("SELECT pid FROM $wpdb->nggpictures WHERE galleryid = '$galleryID' AND exclude != 1 ORDER BY {$ngg->options['galSort']} {$ngg->options['galSortDir']} LIMIT $start, 10 ");
110
+
111
+ // WP-Core code for Post-thumbnail
112
+ $calling_post_id = 0;
113
+ if ( isset( $_GET['post_id'] ) )
114
+ $calling_post_id = $_GET['post_id'];
115
+
116
+ ?>
117
+
118
+ <script type="text/javascript">
119
+ <!--
120
+ function NGGSetAsThumbnail(id){
121
+ var $link = jQuery('a#ngg-post-thumbnail-' + id);
122
+
123
+ $link.text( setPostThumbnailL10n.saving );
124
+ jQuery.post(ajaxurl, {
125
+ action:"ngg_set_post_thumbnail", post_id: post_id, thumbnail_id: id, cookie: encodeURIComponent(document.cookie)
126
+ }, function(str){
127
+ var win = window.dialogArguments || opener || parent || top;
128
+ $link.text( setPostThumbnailL10n.setThumbnail );
129
+ if ( str == '0' ) {
130
+ alert( setPostThumbnailL10n.error );
131
+ } else {
132
+ jQuery('a.ngg-post-thumbnail').show();
133
+ $link.text( setPostThumbnailL10n.done );
134
+ $link.fadeOut( 2000 );
135
+ // set some id as meta input filed
136
+ win.WPSetThumbnailID('ngg-' + id);
137
+ // replace the meta box with the image
138
+ win.WPSetThumbnailHTML(str);
139
+ }
140
+ }
141
+ );
142
+ }
143
+ //-->
144
+ </script>
145
+
146
+ <form id="filter" action="" method="get">
147
+ <input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" />
148
+ <input type="hidden" name="tab" value="<?php echo esc_attr( $GLOBALS['tab'] ); ?>" />
149
+ <input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" />
150
+
151
+ <div class="tablenav">
152
+ <?php
153
+ $page_links = paginate_links( array(
154
+ 'base' => add_query_arg( 'paged', '%#%' ),
155
+ 'format' => '',
156
+ 'total' => ceil($total / 10),
157
+ 'current' => $_GET['paged']
158
+ ));
159
+
160
+ if ( $page_links )
161
+ echo "<div class='tablenav-pages'>$page_links</div>";
162
+ ?>
163
+
164
+ <div class="alignleft actions">
165
+ <select id="select_gal" name="select_gal" style="width:120px;">;
166
+ <option value="0" <?php selected('0', $galleryID); ?> ><?php esc_attr( _e('No gallery',"nggallery") ); ?></option>
167
+ <?php
168
+ // Show gallery selection
169
+ $gallerylist = $nggdb->find_all_galleries();
170
+ if(is_array($gallerylist)) {
171
+ foreach($gallerylist as $gallery) {
172
+ $selected = ($gallery->gid == $galleryID )? ' selected="selected"' : "";
173
+ echo '<option value="'.$gallery->gid.'"'.$selected.' >'.$gallery->title.'</option>'."\n";
174
+ }
175
+ }
176
+ ?>
177
+ </select>
178
+ <input type="submit" id="show-gallery" value="<?php esc_attr( _e('Select &#187;','nggallery') ); ?>" class="button-secondary" />
179
+ </div>
180
+ <br style="clear:both;" />
181
+ </div>
182
+ </form>
183
+
184
+ <form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form" id="library-form">
185
+
186
+ <?php wp_nonce_field('ngg-media-form'); ?>
187
+
188
+ <script type="text/javascript">
189
+ <!--
190
+ jQuery(function($){
191
+ var preloaded = $(".media-item.preloaded");
192
+ if ( preloaded.length > 0 ) {
193
+ preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
194
+ updateMediaForm();
195
+ }
196
+ });
197
+ -->
198
+ </script>
199
+
200
+ <div id="media-items">
201
+ <?php
202
+ if( is_array($picarray) ) {
203
+ foreach ($picarray as $picid) {
204
+ //TODO:Reduce SQL Queries
205
+ $picture = nggdb::find_image($picid);
206
+ ?>
207
+ <div id='media-item-<?php echo $picid ?>' class='media-item preloaded'>
208
+ <div class='filename'></div>
209
+ <a class='toggle describe-toggle-on' href='#'><?php esc_attr( _e('Show', "nggallery") ); ?></a>
210
+ <a class='toggle describe-toggle-off' href='#'><?php esc_attr( _e('Hide', "nggallery") );?></a>
211
+ <div class='filename new'><?php echo ( empty($picture->alttext) ) ? wp_html_excerpt( esc_html( $picture->filename ),60) : stripslashes( wp_html_excerpt( esc_html( $picture->alttext ),60) ); ?></div>
212
+ <table class='slidetoggle describe startclosed'><tbody>
213
+ <tr>
214
+ <td rowspan='4'><img class='thumbnail' alt='<?php echo esc_attr( $picture->alttext ); ?>' src='<?php echo esc_attr( $picture->thumbURL ); ?>'/></td>
215
+ <td><?php esc_html( _e('Image ID:', "nggallery") ); ?><?php echo $picid ?></td>
216
+ </tr>
217
+ <tr><td><?php echo esc_html( $picture->filename ); ?></td></tr>
218
+ <tr><td><?php echo esc_html( stripslashes($picture->alttext) ); ?></td></tr>
219
+ <tr><td>&nbsp;</td></tr>
220
+ <tr>
221
+ <td class="label"><label for="image[<?php echo $picid ?>][alttext]"><?php esc_attr_e('Alt/Title text', "nggallery") ;?></label></td>
222
+ <td class="field"><input id="image[<?php echo $picid ?>][alttext]" name="image[<?php echo $picid ?>][alttext]" value="<?php esc_attr_e( stripslashes($picture->alttext) ); ?>" type="text"/></td>
223
+ </tr>
224
+ <tr>
225
+ <td class="label"><label for="image[<?php echo $picid ?>][description]"><?php esc_attr_e("Description","nggallery") ; ?></label></td>
226
+ <td class="field"><textarea name="image[<?php echo $picid ?>][description]" id="image[<?php echo $picid ?>][description]"><?php esc_attr_e( stripslashes($picture->description) ); ?></textarea></td>
227
+ </tr>
228
+ <tr class="align">
229
+ <td class="label"><label for="image[<?php echo $picid ?>][align]"><?php esc_attr_e("Alignment"); ?></label></td>
230
+ <td class="field">
231
+ <input name="image[<?php echo $picid ?>][align]" id="image-align-none-<?php echo $picid ?>" checked="checked" value="none" type="radio" />
232
+ <label for="image-align-none-<?php echo $picid ?>" class="align image-align-none-label"><?php esc_attr_e("None") ;?></label>
233
+ <input name="image[<?php echo $picid ?>][align]" id="image-align-left-<?php echo $picid ?>" value="left" type="radio" />
234
+ <label for="image-align-left-<?php echo $picid ?>" class="align image-align-left-label"><?php esc_attr_e("Left") ;?></label>
235
+ <input name="image[<?php echo $picid ?>][align]" id="image-align-center-<?php echo $picid ?>" value="center" type="radio" />
236
+ <label for="image-align-center-<?php echo $picid ?>" class="align image-align-center-label"><?php esc_attr_e("Center") ;?></label>
237
+ <input name="image[<?php echo $picid ?>][align]" id="image-align-right-<?php echo $picid ?>" value="right" type="radio" />
238
+ <label for="image-align-right-<?php echo $picid ?>" class="align image-align-right-label"><?php esc_attr_e("Right") ;?></label>
239
+ </td>
240
+ </tr>
241
+ <tr class="image-size">
242
+ <th class="label"><label for="image[<?php echo $picid ?>][size]"><span class="alignleft"><?php esc_attr_e("Size") ; ?></span></label>
243
+ </th>
244
+ <td class="field">
245
+ <input name="image[<?php echo $picid ?>][size]" id="image-size-thumb-<?php echo $picid ?>" type="radio" checked="checked" value="thumbnail" />
246
+ <label for="image-size-thumb-<?php echo $picid ?>"><?php esc_attr_e("Thumbnail") ; ?></label>
247
+ <input name="image[<?php echo $picid ?>][size]" id="image-size-full-<?php echo $picid ?>" type="radio" value="full" />
248
+ <label for="image-size-full-<?php echo $picid ?>"><?php esc_attr_e("Full size") ; ?></label>
249
+ <input name="image[<?php echo $picid ?>][size]" id="image-size-singlepic-<?php echo $picid ?>" type="radio" value="singlepic" />
250
+ <label for="image-size-singlepic-<?php echo $picid ?>"><?php esc_attr_e("Singlepic", "nggallery") ; ?></label>
251
+ </td>
252
+ </tr>
253
+ <tr class="submit">
254
+ <td>
255
+ <input type="hidden" name="image[<?php echo $picid ?>][thumb]" value="<?php echo esc_attr( $picture->thumbURL ); ?>" />
256
+ <input type="hidden" name="image[<?php echo $picid ?>][url]" value="<?php echo esc_attr( $picture->imageURL ); ?>" />
257
+ </td>
258
+ <td class="savesend">
259
+ <?php
260
+ if ( $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) )
261
+ echo "<a class='ngg-post-thumbnail' id='ngg-post-thumbnail-" . $picid . "' href='#' onclick='NGGSetAsThumbnail(\"$picid\");return false;'>" . esc_html__( 'Use as featured image' ) . "</a>";
262
+ ?>
263
+ <button type="submit" class="button" value="1" name="send[<?php echo $picid ?>]"><?php esc_html_e( 'Insert into Post' ); ?></button>
264
+ </td>
265
+ </tr>
266
+ </tbody></table>
267
+ </div>
268
+ <?php
269
+ }
270
+ }
271
+ ?>
272
+ </div>
273
+ <p class="ml-submit">
274
+ <input type="submit" class="button savebutton" name="save" value="<?php esc_attr( _e('Save all changes','nggallery') ); ?>" />
275
+ </p>
276
+ <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
277
+ <input type="hidden" name="select_gal" id="select_gal" value="<?php echo (int) $galleryID; ?>" />
278
+ </form>
279
+
280
+ <?php
281
+ }
282
+ ?>
admin/overview.php ADDED
@@ -0,0 +1,854 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ /**
5
+ * nggallery_admin_overview()
6
+ *
7
+ * Add the admin overview the dashboard style
8
+ * @return mixed content
9
+ */
10
+ function nggallery_admin_overview() {
11
+ ?>
12
+ <div class="wrap ngg-wrap">
13
+ <?php include('templates/social_media_buttons.php'); ?>
14
+ <?php screen_icon( 'nextgen-gallery' ); ?>
15
+ <h2><?php _e('NextCellent Gallery Overview', 'nggallery') ?></h2>
16
+ <?php if (version_compare(PHP_VERSION, '5.0.0', '<')) ngg_check_for_PHP5(); ?>
17
+ <div id="dashboard-widgets-container" class="ngg-overview">
18
+ <div id="dashboard-widgets" class="metabox-holder">
19
+ <div id="post-body">
20
+ <div id="dashboard-widgets-main-content">
21
+ <div class="postbox-container" id="main-container" style="width:75%;">
22
+ <?php do_meta_boxes('ngg_overview', 'left', ''); ?>
23
+ </div>
24
+ <div class="postbox-container" id="side-container" style="width:24%;">
25
+ <?php do_meta_boxes('ngg_overview', 'right', ''); ?>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ <script type="text/javascript">
33
+ //<![CDATA[
34
+ var ajaxWidgets, ajaxPopulateWidgets;
35
+
36
+ jQuery(document).ready( function($) {
37
+ // These widgets are sometimes populated via ajax
38
+ ajaxWidgets = [
39
+ 'ngg_lastdonators',
40
+ 'dashboard_primary',
41
+ 'ngg_locale',
42
+ 'dashboard_plugins'
43
+ ];
44
+
45
+ ajaxPopulateWidgets = function(el) {
46
+ show = function(id, i) {
47
+ var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading');
48
+ if ( e.length ) {
49
+ p = e.parent();
50
+ setTimeout( function(){
51
+ p.load('admin-ajax.php?action=ngg_dashboard&jax=' + id, '', function() {
52
+ p.hide().slideDown('normal', function(){
53
+ $(this).css('display', '');
54
+ if ( 'dashboard_plugins' == id && $.isFunction(tb_init) )
55
+ tb_init('#dashboard_plugins a.thickbox');
56
+ });
57
+ });
58
+ }, i * 500 );
59
+ }
60
+ }
61
+ if ( el ) {
62
+ el = el.toString();
63
+ if ( $.inArray(el, ajaxWidgets) != -1 )
64
+ show(el, 0);
65
+ } else {
66
+ $.each( ajaxWidgets, function(i) {
67
+ show(this, i);
68
+ });
69
+ }
70
+ };
71
+ ajaxPopulateWidgets();
72
+ } );
73
+
74
+ jQuery(document).ready( function($) {
75
+ // postboxes setup
76
+ postboxes.add_postbox_toggles('ngg-overview');
77
+ });
78
+ //]]>
79
+ </script>
80
+ <?php
81
+ }
82
+
83
+ /**
84
+ * Load the meta boxes
85
+ *
86
+ */
87
+ add_meta_box('dashboard_right_now', __('Welcome to NextCellent Gallery !', 'nggallery'), 'ngg_overview_right_now', 'ngg_overview', 'left', 'core');
88
+ add_meta_box('ngg_meta_box', __('Do you like this Plugin?', 'nggallery'), 'ngg_likeThisMetaBox', 'ngg_overview', 'right', 'core');
89
+ if ( !(get_locale() == 'en_US') )
90
+ add_meta_box('ngg_locale', __('Translation', 'nggallery'), 'ngg_widget_locale', 'ngg_overview', 'right', 'core');
91
+ add_meta_box('dashboard_primary', __('Latest News', 'nggallery'), 'ngg_widget_overview_news', 'ngg_overview', 'left', 'core');
92
+ //add_meta_box('ngg_lastdonators', __('Recent donators', 'nggallery'), 'ngg_widget_overview_donators', 'ngg_overview', 'right', 'core');
93
+ if ( !is_multisite() || is_super_admin() ) {
94
+ add_meta_box('ngg_plugin_check', __('Plugin Check', 'nggallery'), 'ngg_plugin_check', 'ngg_overview', 'right', 'core');
95
+ add_meta_box('ngg_server', __('Server Settings', 'nggallery'), 'ngg_overview_server', 'ngg_overview', 'right', 'core');
96
+ add_meta_box('dashboard_plugins', __('Related plugins', 'nggallery'), 'ngg_widget_related_plugins', 'ngg_overview', 'left', 'core');
97
+ }
98
+
99
+ function ngg_likeThisMetaBox() {
100
+
101
+ echo '<p>';
102
+ echo sprintf(__('This plugin is primarily developed, maintained, supported and documented by <a href="%s" target="_blank">Photocrati Media</a> with a lot of love & effort. Any kind of contribution would be highly appreciated. Thanks!', 'nggallery'), 'http://www.photocrati.com/');
103
+ echo '</p><ul>';
104
+
105
+ $url = 'http://wordpress.org/extend/plugins/nextgen-gallery/' ;
106
+ echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-rating.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>";
107
+ _e('Give it a good rating on WordPress.org', 'nggallery');
108
+ echo "</a></li>";
109
+
110
+ $url = 'http://www.nextgen-gallery.com';
111
+ echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/nextgen.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>";
112
+ _e("Visit the plugin homepage", 'nggallery');
113
+ echo "</a></li>";
114
+
115
+ $url = 'http://www.nextgen-gallery.com/languages/';
116
+ echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-translate.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>";
117
+ _e("Help translating it", 'nggallery');
118
+ echo "</a></li>";
119
+
120
+ echo '</ul>';
121
+
122
+ echo '
123
+ <div class="social" style="text-align:center;margin:15px 0 10px 0;"><span class="social" style="margin-right:5px;"><a target="_blank" href="http://twitter.com/NextGENGallery"><img title="Follow NextGEN on Twitter" alt="Twitter" src="' . NGGALLERY_URLPATH . 'admin/images/twitter.png"></a></span><span class="social" style="margin-right:5px;"><a target="_blank" href="http://www.facebook.com/NextGENGallery"><img title="Like NextGEN on Facebook" alt="Facebook" src="' . NGGALLERY_URLPATH . 'admin/images/facebook.png"></a></span><span class="social"><a target="_blank" href="http://plus.google.com/101643895780935290171"><img title="Add NextGEN to your circles" alt="GooglePlus" src="' . NGGALLERY_URLPATH . 'admin/images/googleplus.png"></a></span></div>';
124
+ }
125
+
126
+ /**
127
+ * Ajax Check for conflict with other plugins/themes
128
+ *
129
+ * @return void
130
+ */
131
+ function ngg_plugin_check() {
132
+
133
+ global $ngg;
134
+ ?>
135
+ <script type="text/javascript">
136
+ (function($) {
137
+ nggPluginCheck = {
138
+
139
+ settings: {
140
+ img_run: '<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="icon" alt="started"/>',
141
+ img_ok: '<img src="<?php echo esc_url( admin_url( 'images/yes.png' ) ); ?>" class="icon" alt="ok"/>',
142
+ img_fail: '<img src="<?php echo esc_url( admin_url( 'images/no.png' ) ); ?>" class="icon" alt="failed" />',
143
+ domain: '<?php echo esc_url( home_url('index.php', is_ssl() ? 'https' : 'http') ); ?>'
144
+ },
145
+
146
+ run: function( index, state ) {
147
+ ul = $('#plugin_check');
148
+ s = this.settings;
149
+ var step = 1;
150
+ switch ( index ) {
151
+ case 1:
152
+ this.check1();
153
+ break;
154
+ case 2:
155
+ this.check2( step );
156
+ break;
157
+ case 3:
158
+ this.check3();
159
+ break;
160
+ }
161
+ },
162
+
163
+ // this function check if the json API will work with your theme & plugins
164
+ check1 : function() {
165
+ this.start(1);
166
+ var req = $.ajax({
167
+ dataType: 'json',
168
+ url: s.domain,
169
+ data:'callback=json&format=json&method=version',
170
+ cache: false,
171
+ timeout: 10000,
172
+ success: function(msg){
173
+ if (msg.version == '<?php echo $ngg->version; ?>')
174
+ nggPluginCheck.success(1);
175
+ else
176
+ nggPluginCheck.failed(1);
177
+ },
178
+ error: function (msg) {
179
+ nggPluginCheck.failed(1);
180
+ },
181
+ complete: function () {
182
+ nggPluginCheck.run(2);
183
+ }
184
+ });
185
+
186
+ },
187
+
188
+ // this function check if GD lib can create images & thumbnails
189
+ check2 : function( step ) {
190
+ if (step == 1) this.start(2);
191
+ var stop = false;
192
+ var req = $.ajax({
193
+ type: "POST",
194
+ url: ajaxurl,
195
+ data:"action=ngg_image_check&step=" + step,
196
+ cache: false,
197
+ timeout: 10000,
198
+ success: function(msg){
199
+ if (msg.stat == 'ok') {
200
+ nggPluginCheck.success(2, msg.message);
201
+ } else {
202
+ if (step == 1)
203
+ nggPluginCheck.failed(2);
204
+ stop = true;
205
+ }
206
+
207
+ },
208
+ error: function (msg) {
209
+ if (step == 1)
210
+ nggPluginCheck.failed(2);
211
+ stop = true;
212
+ },
213
+ complete: function () {
214
+ step++;
215
+ if (step <= 11 && stop == false)
216
+ nggPluginCheck.check2(step);
217
+ else
218
+ nggPluginCheck.run(3);
219
+ }
220
+ });
221
+ },
222
+
223
+ // this function check if wp_head / wp_footer is avaiable
224
+ check3 : function() {
225
+ this.start(3);
226
+ var req = $.ajax({
227
+ type: "POST",
228
+ url: ajaxurl,
229
+ data:"action=ngg_test_head_footer",
230
+ cache: false,
231
+ timeout: 10000,
232
+ success: function(msg){
233
+ if (msg == 'success')
234
+ nggPluginCheck.success(3);
235
+ else
236
+ nggPluginCheck.failed(3, msg);
237
+ },
238
+ error: function (msg) {
239
+ nggPluginCheck.failed(3);
240
+ }
241
+ });
242
+ },
243
+
244
+ start: function( id ) {
245
+
246
+ s = this.settings;
247
+ var field = "#check" + id;
248
+
249
+ if ( ul.find(field + " img").length == 0)
250
+ $(field).prepend( s.img_run );
251
+ else
252
+ $(field + " img").replaceWith( s.img_run );
253
+
254
+ $(field + " .success").hide();
255
+ $(field + " .failed").hide();
256
+ $(field + " .default").replaceWith('<p class="default message"><?php echo esc_js( __('Running...', 'nggallery') ); ?></p> ');
257
+ },
258
+
259
+ success: function( id, msg ) {
260
+
261
+ s = this.settings;
262
+ var field = "#check" + id;
263
+
264
+ if ( ul.find(field + " img").length == 0)
265
+ $(field).prepend( s.img_ok );
266
+ else
267
+ $(field + " img").replaceWith( s.img_ok );
268
+
269
+ $(field + " .default").hide();
270
+ if (msg)
271
+ $(field + " .success").replaceWith('<p class="success message">' + msg +' </p> ');
272
+ else
273
+ $(field + " .success").show();
274
+
275
+ },
276
+
277
+ failed: function( id, msg ) {
278
+
279
+ s = this.settings;
280
+ var field = "#check" + id;
281
+
282
+ if ( ul.find(field + " img").length == 0)
283
+ $(field).prepend( s.img_fail );
284
+ else
285
+ $(field + " img").replaceWith( s.img_fail );
286
+
287
+ $(field + " .default").hide();
288
+ if (msg)
289
+ $(field + " .failed").replaceWith('<p class="failed message">' + msg +' </p> ');
290
+ else
291
+ $(field + " .failed").show();
292
+
293
+ }
294
+
295
+ };
296
+ })(jQuery);
297
+ </script>
298
+ <div class="dashboard-widget-holder wp_dashboard_empty">
299
+ <div class="ngg-dashboard-widget">
300
+ <div class="dashboard-widget-content">
301
+ <ul id="plugin_check" class="settings">
302
+ <li id="check1">
303
+ <strong><?php _e('Check plugin/theme conflict', 'nggallery'); ?></strong>
304
+ <p class="default message"><?php _e('Not tested', 'nggallery'); ?></p>
305
+ <p class="success message" style="display: none;"><?php _e('No conflict could be detected', 'nggallery'); ?></p>
306
+ <p class="failed message" style="display: none;"><?php _e('Test failed, disable other plugins & switch to default theme', 'nggallery'); ?></p>
307
+ </li>
308
+ <li id="check2">
309
+ <strong><?php _e('Test image function', 'nggallery'); ?></strong>
310
+ <p class="default message"><?php _e('Not tested', 'nggallery'); ?></p>
311
+ <p class="success message" style="display: none;"><?php _e('The plugin could create images', 'nggallery'); ?></p>
312
+ <p class="failed message" style="display: none;"><?php _e('Couldn\'t create image, check your memory limit', 'nggallery'); ?></p>
313
+ </li>
314
+ <li id="check3">
315
+ <strong><?php _e('Check theme compatibility', 'nggallery'); ?></strong>
316
+ <p class="default message"><?php _e('Not tested', 'nggallery'); ?></p>
317
+ <p class="success message" style="display: none;"><?php _e('Your theme should work fine with NextCellent Gallery', 'nggallery'); ?></p>
318
+ <p class="failed message" style="display: none;"><?php _e('wp_head()/wp_footer() is missing, contact the theme author', 'nggallery'); ?></p>
319
+ </li>
320
+ </ul>
321
+ <p class="textright">
322
+ <input type="button" name="update" value="<?php _e('Check plugin', 'nggallery'); ?>" onclick="nggPluginCheck.run(1);" class="button-secondary" />
323
+ </p>
324
+ </div>
325
+ </div>
326
+ </div>
327
+ <?php
328
+ }
329
+
330
+ /**
331
+ * Show the server settings in a dashboard widget
332
+ *
333
+ * @return void
334
+ */
335
+ function ngg_overview_server() {
336
+ ?>
337
+ <div id="dashboard_server_settings" class="dashboard-widget-holder wp_dashboard_empty">
338
+ <div class="ngg-dashboard-widget">
339
+ <div class="dashboard-widget-content">
340
+ <ul class="settings">
341
+ <?php ngg_get_serverinfo(); ?>
342
+ </ul>
343
+ <p><strong><?php _e('Graphic Library', 'nggallery'); ?></strong></p>
344
+ <ul class="settings">
345
+ <?php ngg_gd_info(); ?>
346
+ </ul>
347
+ </div>
348
+ </div>
349
+ </div>
350
+ <?php
351
+ }
352
+
353
+ /**
354
+ * Show the most recent donators
355
+ *
356
+ * @return void
357
+ */
358
+ function ngg_widget_overview_donators() {
359
+ echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
360
+ }
361
+
362
+ function ngg_overview_donators() {
363
+ global $ngg;
364
+
365
+ $i = 0;
366
+ $list = '';
367
+
368
+ $supporter = nggAdminPanel::get_remote_array($ngg->donators);
369
+
370
+ // Ensure that this is a array
371
+ if ( !is_array($supporter) )
372
+ return _e('Thanks to all donators...', 'nggallery');
373
+
374
+ $supporter = array_reverse($supporter);
375
+
376
+ foreach ($supporter as $name => $url) {
377
+ $i++;
378
+ if ($url)
379
+ $list .= "<li><a href=\"$url\">$name</a></li>\n";
380
+ else
381
+ $list .= "<li>$name</li>";
382
+ if ($i > 4)
383
+ break;
384
+ }
385
+
386
+ ?>
387
+ <div id="dashboard_server_settings" class="dashboard-widget-holder">
388
+ <div class="ngg-dashboard-widget">
389
+ <div class="dashboard-widget-content">
390
+ <ul class="settings">
391
+ <?php echo $list; ?>
392
+ </ul>
393
+ <p class="textright">
394
+ <a class="button" href="admin.php?page=nggallery-about#donators"><?php _e('View all', 'nggallery'); ?></a>
395
+ </p>
396
+ </div>
397
+ </div>
398
+ </div>
399
+ <?php
400
+ }
401
+
402
+ /**
403
+ * Show the latest NextGEN Gallery news
404
+ *
405
+ * @return void
406
+ */
407
+ function ngg_widget_overview_news() {
408
+ echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
409
+ }
410
+ function ngg_overview_news(){
411
+
412
+ ?>
413
+ <div class="rss-widget">
414
+ <?php
415
+ $rss = @fetch_feed( 'http://feeds.feedburner.com/nextgen-gallery' );
416
+
417
+ if ( is_object($rss) ) {
418
+
419
+ if ( is_wp_error($rss) ) {
420
+ echo '<p>' . sprintf(__('Newsfeed could not be loaded. Check the <a href="%s">front page</a> to check for updates.', 'nggallery'), 'http://www.nextgen-gallery.com/') . '</p>';
421
+ return;
422
+ }
423
+
424
+ echo '<ul>';
425
+ foreach ( $rss->get_items(0, 3) as $item ) {
426
+ $link = $item->get_link();
427
+ while ( stristr($link, 'http') != $link )
428
+ $link = substr($link, 1);
429
+ $link = esc_url(strip_tags($link));
430
+ $title = esc_attr(strip_tags($item->get_title()));
431
+ if ( empty($title) )
432
+ $title = __('Untitled');
433
+
434
+ $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );
435
+ $desc = wp_html_excerpt( $desc, 360 );
436
+
437
+ // Append ellipsis. Change existing [...] to [&hellip;].
438
+ if ( '[...]' == substr( $desc, -5 ) )
439
+ $desc = substr( $desc, 0, -5 ) . '[&hellip;]';
440
+ elseif ( '[&hellip;]' != substr( $desc, -10 ) )
441
+ $desc .= ' [&hellip;]';
442
+
443
+ $desc = esc_html( $desc );
444
+
445
+ $date = $item->get_date();
446
+ $diff = '';
447
+
448
+ if ( $date ) {
449
+
450
+ $diff = human_time_diff( strtotime($date, time()) );
451
+
452
+ if ( $date_stamp = strtotime( $date ) )
453
+ $date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date_stamp ) . '</span>';
454
+ else
455
+ $date = '';
456
+ }
457
+ ?>
458
+ <li><a class="rsswidget" title="" target="_blank" href='<?php echo $link; ?>'><?php echo $title; ?></a>
459
+ <span class="rss-date"><?php echo $date; ?></span>
460
+ <div class="rssSummary"><strong><?php echo $diff; ?></strong> - <?php echo $desc; ?></div></li>
461
+ <?php
462
+ }
463
+ echo '</ul>';
464
+ }
465
+ ?>
466
+ </div>
467
+ <?php
468
+ }
469
+
470
+ /**
471
+ * Show a summary of the used images
472
+ *
473
+ * @return void
474
+ */
475
+ function ngg_overview_right_now() {
476
+ global $wpdb;
477
+ $images = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggpictures") );
478
+ $galleries = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggallery") );
479
+ $albums = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggalbum") );
480
+ ?>
481
+ <div class="table table_content">
482
+ <p class="sub"><?php _e('At a Glance', 'nggallery'); ?></p>
483
+ <table>
484
+ <tbody>
485
+ <tr class="first">
486
+ <td class="first b"><a href="admin.php?page=nggallery-add-gallery"><?php echo $images; ?></a></td>
487
+ <td class="t"><a href="admin.php?page=nggallery-add-gallery"><?php echo _n( 'Image', 'Images', $images, 'nggallery' ); ?></a></td>
488
+ <td class="b"></td>
489
+ <td class="last"></td>
490
+ </tr>
491
+ <tr>
492
+ <td class="first b"><a href="admin.php?page=nggallery-manage-gallery"><?php echo $galleries; ?></a></td>
493
+ <td class="t"><a href="admin.php?page=nggallery-manage-gallery"><?php echo _n( 'Gallery', 'Galleries', $galleries, 'nggallery' ); ?></a></td>
494
+ <td class="b"></td>
495
+ <td class="last"></td>
496
+ </tr>
497
+ <tr>
498
+ <td class="first b"><a href="admin.php?page=nggallery-manage-album"><?php echo $albums; ?></a></td>
499
+ <td class="t"><a href="admin.php?page=nggallery-manage-album"><?php echo _n( 'Album', 'Albums', $albums, 'nggallery' ); ?></a></td>
500
+ <td class="b"></td>
501
+ <td class="last"></td>
502
+ </tr>
503
+ </tbody>
504
+ </table>
505
+ </div>
506
+ <div class="versions" style="padding-top:14px">
507
+ <p>
508
+ <?php if(current_user_can('NextGEN Upload images')): ?><a class="button rbutton" href="admin.php?page=nggallery-add-gallery"><?php _e('Upload pictures', 'nggallery') ?></a><?php endif; ?>
509
+ <?php _e('Here you can control your images, galleries and albums.', 'nggallery') ?>
510
+ </p>
511
+ <br class="clear" />
512
+ </div>
513
+ <?php
514
+ if ( is_multisite() )
515
+ ngg_dashboard_quota();
516
+ }
517
+
518
+ // Display File upload quota on dashboard
519
+ function ngg_dashboard_quota() {
520
+
521
+ if ( get_site_option( 'upload_space_check_disabled' ) )
522
+ return;
523
+
524
+ if ( !wpmu_enable_function('wpmuQuotaCheck') )
525
+ return;
526
+
527
+ $quota = get_space_allowed();
528
+ $used = get_dirsize( BLOGUPLOADDIR ) / 1024 / 1024;
529
+
530
+ if ( $used > $quota )
531
+ $percentused = '100';
532
+ else
533
+ $percentused = ( $used / $quota ) * 100;
534
+ $used_color = ( $percentused < 70 ) ? ( ( $percentused >= 40 ) ? 'waiting' : 'approved' ) : 'spam';
535
+ $used = round( $used, 2 );
536
+ $percentused = number_format( $percentused );
537
+
538
+ ?>
539
+ <p class="sub musub" style="position:static" ><?php _e( 'Storage Space' ); ?></p>
540
+ <div class="table table_content musubtable">
541
+ <table>
542
+ <tr class="first">
543
+ <td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ), $quota ); ?></td>
544
+ <td class="t posts"><?php _e( 'Space Allowed' ); ?></td>
545
+ </tr>
546
+ </table>
547
+ </div>
548
+ <div class="table table_discussion musubtable">
549
+ <table>
550
+ <tr class="first">
551
+ <td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ), $used, $percentused ); ?></td>
552
+ <td class="last t comments <?php echo $used_color;?>"><?php _e( 'Space Used' );?></td>
553
+ </tr>
554
+ </table>
555
+ </div>
556
+ <br class="clear" />
557
+ <?php
558
+ }
559
+
560
+ /**
561
+ * Looks up for translation file
562
+ *
563
+ * @return void
564
+ */
565
+ function ngg_widget_locale() {
566
+
567
+ require_once(NGGALLERY_ABSPATH . '/lib/locale.php');
568
+
569
+ $locale = new ngg_locale();
570
+
571
+ $overview_url = admin_url() . 'admin.php?page=' . NGGFOLDER;
572
+
573
+ // Check if someone would like to update the translation file
574
+ if ( isset($_GET['locale']) && $_GET['locale'] == 'update' ) {
575
+ check_admin_referer('ngg_update_locale');
576
+
577
+ $result = $locale->download_locale();
578
+
579
+ if ($result == true) {
580
+ ?>
581
+ <p class="hint"><?php _e('Translation file successful updated. Please reload page.', 'nggallery'); ?></p>
582
+ <p class="textright">
583
+ <a class="button" href="<?php echo esc_url(strip_tags($overview_url)); ?>"><?php _e('Reload page', 'nggallery'); ?></a>
584
+ </p>
585
+ <?php
586
+ } else {
587
+ ?>
588
+ <p class="hint"><?php _e('Translation file couldn\'t be updated', 'nggallery'); ?></p>
589
+ <?php
590
+ }
591
+
592
+ return;
593
+ }
594
+
595
+ echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
596
+ }
597
+
598
+ function ngg_locale() {
599
+ global $ngg;
600
+
601
+ require_once(NGGALLERY_ABSPATH . '/lib/locale.php');
602
+
603
+ $locale = new ngg_locale();
604
+ $overview_url = admin_url() . 'admin.php?page=' . NGGFOLDER;
605
+ $result = $locale->check();
606
+ $update_url = wp_nonce_url ( $overview_url . '&amp;locale=update', 'ngg_update_locale');
607
+
608
+ //Translators can change this text via gettext
609
+ if ($result == 'installed') {
610
+ echo $ngg->translator;
611
+ if ( !is_wp_error($locale->response) && $locale->response['response']['code'] == '200') {
612
+ ?>
613
+ <p class="textright">
614
+ <a class="button" href="<?php echo esc_url( strip_tags($update_url) ); ?>"><?php _e('Update', 'nggallery'); ?></a>
615
+ </p>
616
+ <?php
617
+ }
618
+ }
619
+
620
+ //Translators can change this text via gettext
621
+ if ($result == 'available') {
622
+ ?>
623
+ <p><strong>Download now your language file !</strong></p>
624
+ <p class="textright">
625
+ <a class="button" href="<?php echo esc_url( strip_tags($update_url) ); ?>"><?php _e('Download', 'nggallery'); ?></a>
626
+ </p>
627
+ <?php
628
+ }
629
+
630
+
631
+ if ($result == 'not_exist')
632
+ echo '<p class="hint">'. sprintf( '<strong>Would you like to help translating this plugin?</strong> <a target="_blank" href="%s">Download</a> the current pot file and read <a href="http://www.nextgen-gallery.com/translating-nextgen-gallery/">here</a> how you can translate the plugin.', NGGALLERY_URLPATH . 'lang/nggallery.pot').'</p>';
633
+
634
+ }
635
+
636
+ /**
637
+ * Show GD Library version information
638
+ *
639
+ * @return void
640
+ */
641
+ function ngg_gd_info() {
642
+
643
+ if(function_exists("gd_info")){
644
+ $info = gd_info();
645
+ $keys = array_keys($info);
646
+ for($i=0; $i<count($keys); $i++) {
647
+ if(is_bool($info[$keys[$i]]))
648
+ echo "<li> " . $keys[$i] ." : <span>" . ngg_gd_yesNo($info[$keys[$i]]) . "</span></li>\n";
649
+ else
650
+ echo "<li> " . $keys[$i] ." : <span>" . $info[$keys[$i]] . "</span></li>\n";
651
+ }
652
+ }
653
+ else {
654
+ echo '<h4>'.__('No GD support', 'nggallery').'!</h4>';
655
+ }
656
+ }
657
+
658
+ /**
659
+ * Return localized Yes or no
660
+ *
661
+ * @param bool $bool
662
+ * @return return 'Yes' | 'No'
663
+ */
664
+ function ngg_gd_yesNo( $bool ){
665
+ if($bool)
666
+ return __('Yes', 'nggallery');
667
+ else
668
+ return __('No', 'nggallery');
669
+ }
670
+
671
+
672
+ /**
673
+ * Show up some server infor's
674
+ * @author GamerZ (http://www.lesterchan.net)
675
+ *
676
+ * @return void
677
+ */
678
+ function ngg_get_serverinfo() {
679
+
680
+ global $wpdb, $ngg;
681
+ // Get MYSQL Version
682
+ $sqlversion = $wpdb->get_var("SELECT VERSION() AS version");
683
+ // GET SQL Mode
684
+ $mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
685
+ if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value;
686
+ if (empty($sql_mode)) $sql_mode = __('Not set', 'nggallery');
687
+ // Get PHP Safe Mode
688
+ if(ini_get('safe_mode')) $safe_mode = __('On', 'nggallery');
689
+ else $safe_mode = __('Off', 'nggallery');
690
+ // Get PHP allow_url_fopen
691
+ if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On', 'nggallery');
692
+ else $allow_url_fopen = __('Off', 'nggallery');
693
+ // Get PHP Max Upload Size
694
+ if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize');
695
+ else $upload_max = __('N/A', 'nggallery');
696
+ // Get PHP Output buffer Size
697
+ if(ini_get('pcre.backtrack_limit')) $backtrack_limit = ini_get('pcre.backtrack_limit');
698
+ else $backtrack_limit = __('N/A', 'nggallery');
699
+ // Get PHP Max Post Size
700
+ if(ini_get('post_max_size')) $post_max = ini_get('post_max_size');
701
+ else $post_max = __('N/A', 'nggallery');
702
+ // Get PHP Max execution time
703
+ if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time');
704
+ else $max_execute = __('N/A', 'nggallery');
705
+ // Get PHP Memory Limit
706
+ if(ini_get('memory_limit')) $memory_limit = $ngg->memory_limit;
707
+ else $memory_limit = __('N/A', 'nggallery');
708
+ // Get actual memory_get_usage
709
+ if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', 'nggallery');
710
+ else $memory_usage = __('N/A', 'nggallery');
711
+ // required for EXIF read
712
+ if (is_callable('exif_read_data')) $exif = __('Yes', 'nggallery'). " ( V" . substr(phpversion('exif'),0,4) . ")" ;
713
+ else $exif = __('No', 'nggallery');
714
+ // required for meta data
715
+ if (is_callable('iptcparse')) $iptc = __('Yes', 'nggallery');
716
+ else $iptc = __('No', 'nggallery');
717
+ // required for meta data
718
+ if (is_callable('xml_parser_create')) $xml = __('Yes', 'nggallery');
719
+ else $xml = __('No', 'nggallery');
720
+
721
+ ?>
722
+ <li><?php _e('Operating System', 'nggallery'); ?> : <span><?php echo PHP_OS; ?>&nbsp;(<?php echo (PHP_INT_SIZE * 8) ?>&nbsp;Bit)</span></li>
723
+ <li><?php _e('Server', 'nggallery'); ?> : <span><?php echo $_SERVER["SERVER_SOFTWARE"]; ?></span></li>
724
+ <li><?php _e('Memory usage', 'nggallery'); ?> : <span><?php echo $memory_usage; ?></span></li>
725
+ <li><?php _e('MYSQL Version', 'nggallery'); ?> : <span><?php echo $sqlversion; ?></span></li>
726
+ <li><?php _e('SQL Mode', 'nggallery'); ?> : <span><?php echo $sql_mode; ?></span></li>
727
+ <li><?php _e('PHP Version', 'nggallery'); ?> : <span><?php echo PHP_VERSION; ?></span></li>
728
+ <li><?php _e('PHP Safe Mode', 'nggallery'); ?> : <span><?php echo $safe_mode; ?></span></li>
729
+ <li><?php _e('PHP Allow URL fopen', 'nggallery'); ?> : <span><?php echo $allow_url_fopen; ?></span></li>
730
+ <li><?php _e('PHP Memory Limit', 'nggallery'); ?> : <span><?php echo $memory_limit; ?></span></li>
731
+ <li><?php _e('PHP Max Upload Size', 'nggallery'); ?> : <span><?php echo $upload_max; ?></span></li>
732
+ <li><?php _e('PHP Max Post Size', 'nggallery'); ?> : <span><?php echo $post_max; ?></span></li>
733
+ <li><?php _e('PCRE Backtracking Limit', 'nggallery'); ?> : <span><?php echo $backtrack_limit; ?></span></li>
734
+ <li><?php _e('PHP Max Script Execute Time', 'nggallery'); ?> : <span><?php echo $max_execute; ?>s</span></li>
735
+ <li><?php _e('PHP Exif support', 'nggallery'); ?> : <span><?php echo $exif; ?></span></li>
736
+ <li><?php _e('PHP IPTC support', 'nggallery'); ?> : <span><?php echo $iptc; ?></span></li>
737
+ <li><?php _e('PHP XML support', 'nggallery'); ?> : <span><?php echo $xml; ?></span></li>
738
+ <?php
739
+ }
740
+
741
+ /**
742
+ * Inform about the end of PHP4
743
+ *
744
+ * @return void
745
+ */
746
+ function ngg_check_for_PHP5() {
747
+ ?>
748
+ <div class="updated">
749
+ <p><?php _e('NextCellent Gallery contains some functions which are only available under PHP 5.2. You are using the old PHP 4 version, upgrade now! It\'s no longer supported by the PHP group. Many shared hosting providers offer both PHP 4 and PHP 5, running simultaneously. Ask your provider if they can do this.', 'nggallery'); ?></p>
750
+ </div>
751
+ <?php
752
+ }
753
+
754
+ /**
755
+ * ngg_get_phpinfo() - Extract all of the data from phpinfo into a nested array
756
+ *
757
+ * @author jon@sitewizard.ca
758
+ * @return array
759
+ */
760
+ function ngg_get_phpinfo() {
761
+
762
+ ob_start();
763
+ phpinfo();
764
+ $phpinfo = array('phpinfo' => array());
765
+
766
+ if ( preg_match_all('#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>)?)?</tr>)#s', ob_get_clean(), $matches, PREG_SET_ORDER) )
767
+ foreach($matches as $match) {
768
+ if(strlen($match[1]))
769
+ $phpinfo[$match[1]] = array();
770
+ elseif(isset($match[3]))
771
+ $phpinfo[end(array_keys($phpinfo))][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3];
772
+ else
773
+ $phpinfo[end(array_keys($phpinfo))][] = $match[2];
774
+ }
775
+
776
+ return $phpinfo;
777
+ }
778
+
779
+ /**
780
+ * Show NextGEN Gallery related plugins. Fetch plugins from wp.org which have added 'nextgen-gallery' as tag in readme.txt
781
+ *
782
+ * @return postbox output
783
+ */
784
+ function ngg_widget_related_plugins() {
785
+ echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
786
+ }
787
+ function ngg_related_plugins() {
788
+ include(ABSPATH . 'wp-admin/includes/plugin-install.php');
789
+
790
+ if ( false === ( $api = get_transient( 'ngg_related_plugins' ) ) ) {
791
+ // this api sucks , tags will not be used in the correct way : nextgen-gallery cannot be searched
792
+ $api = plugins_api('query_plugins', array('search' => 'nextgen') );
793
+
794
+ if ( is_wp_error($api) )
795
+ return;
796
+
797
+ set_transient( 'ngg_related_plugins', $api, 60*60*24 );
798
+ }
799
+
800
+ echo '<div style="margin-bottom:10px;padding:8px;font-size:110%;background:#eebbaa;"><b>Note</b>: these plugins are provided by third parties and are <b>NOT</b> supported by Photocrati Media in any way</div>';
801
+
802
+ // don't show my own plugin :-) and some other plugins, which come up with the search result
803
+ $blacklist = array(
804
+ 'nextgen-gallery',
805
+ 'galleria-wp',
806
+ 'photosmash-galleries',
807
+ 'flash-album-gallery',
808
+ 'events-calendar',
809
+ 'widgets',
810
+ 'side-content',
811
+ 'featurific-for-wordpress',
812
+ 'smooth-gallery-replacement',
813
+ 'livesig',
814
+ 'wordpress-gallery-slideshow',
815
+ 'nkmimagefield',
816
+ 'nextgen-ajax',
817
+ 'projectmanager'
818
+ );
819
+
820
+ $i = 0;
821
+ while ( $i < 4 ) {
822
+
823
+ // pick them randomly
824
+ if ( 0 == count($api->plugins) )
825
+ return;
826
+
827
+ $key = array_rand($api->plugins);
828
+ $plugin = $api->plugins[$key];
829
+
830
+ // don't forget to remove them
831
+ unset($api->plugins[$key]);
832
+
833
+ if ( !isset($plugin->name) )
834
+ continue;
835
+
836
+ if ( in_array($plugin->slug , $blacklist ) )
837
+ continue;
838
+
839
+ $link = esc_url( $plugin->homepage );
840
+ $title = esc_html( $plugin->name );
841
+
842
+ $description = esc_html( strip_tags(@html_entity_decode($plugin->short_description, ENT_QUOTES, get_option('blog_charset'))) );
843
+
844
+ $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin->slug, 'install-plugin_' . $plugin->slug) .
845
+ '&amp;TB_iframe=true&amp;width=600&amp;height=800';
846
+
847
+ echo "<h5><a href='{$link}' target='_blank'>{$title}</a></h5>&nbsp;<span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span>\n";
848
+ echo "<p>$description<strong> " . __( 'Author' ) . " : </strong>$plugin->author</p>\n";
849
+
850
+ $i++;
851
+ }
852
+
853
+ }
854
+ ?>
admin/publish.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php');
4
+ require_once( NGGALLERY_ABSPATH . '/lib/image.php' );
5
+
6
+ if ( !is_user_logged_in() )
7
+ die(__('Cheatin&#8217; uh?'));
8
+
9
+ if ( !current_user_can('NextGEN Manage gallery') )
10
+ die(__('Cheatin&#8217; uh?'));
11
+
12
+ if ( !current_user_can( 'publish_posts' ) )
13
+ die(__('Cheatin&#8217; uh?'));
14
+
15
+ global $wpdb;
16
+
17
+ $id = (int) $_GET['id'];
18
+
19
+ // let's get the image data
20
+ $picture = nggdb::find_image($id);
21
+
22
+ // use defaults the first time
23
+ $width = empty ($ngg->options['publish_width']) ? $ngg->options['thumbwidth'] : $ngg->options['publish_width'];
24
+ $height = empty ($ngg->options['publish_height']) ? $ngg->options['thumbheight'] : $ngg->options['publish_height'];
25
+ $align = empty ($ngg->options['publish_align']) ? 'none' : $ngg->options['publish_align'];
26
+
27
+ ?>
28
+
29
+ <form id="form-publish-post" method="POST" accept-charset="utf-8">
30
+ <?php wp_nonce_field('publish-post') ?>
31
+ <input type="hidden" name="page" value="publish-post" />
32
+ <input type="hidden" name="pid" value="<?php echo $picture->pid; ?>" />
33
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
34
+ <tr valign="top">
35
+ <th align="left"><?php _e('Post title','nggallery') ?></th>
36
+ <td><input type="text" size="70" name="post_title" value="<?php echo esc_attr( $picture->alttext); ?>" />
37
+ <br /><small><?php _e('Enter the post title ','nggallery') ?></small></td>
38
+ </tr>
39
+ <tr valign="top">
40
+ <th align="left"><?php _e('Width x height (in pixel)','nggallery') ?></th>
41
+ <td><input type="text" size="5" maxlength="5" name="width" value="<?php echo $width; ?>" /> x <input type="text" size="5" maxlength="5" name="height" value="<?php echo $height; ?>" />
42
+ <br /><small><?php _e('Size of the image','nggallery') ?></small></td>
43
+ </tr>
44
+ <tr valign="top">
45
+ <th align="left"><?php _e('Alignment','nggallery') ?></th>
46
+ <td><input type="radio" value="none" <?php checked('none', $align); ?> id="image-align-none" name="align"/>
47
+ <label class="align" for="image-align-none"><?php _e('None','nggallery'); ?></label>
48
+ <input type="radio" value="left" <?php checked('left', $align); ?> id="image-align-left" name="align"/>
49
+ <label class="align" for="image-align-left"><?php _e('Left','nggallery'); ?></label>
50
+ <input type="radio" value="center" <?php checked('center', $align); ?> id="image-align-center" name="align"/>
51
+ <label class="align" for="image-align-center"><?php _e('Center','nggallery'); ?></label>
52
+ <input type="radio" value="right" <?php checked('right', $align); ?> id="image-align-right" name="align"/>
53
+ <label class="align" for="image-align-right"><?php _e('Right','nggallery'); ?></label>
54
+ </td>
55
+ </tr>
56
+ <tr align="right">
57
+ <td colspan="2" class="submit">
58
+ <input class="button-primary" type="submit" name="publish" value="<?php _e('Publish', 'nggallery');?>" />
59
+ &nbsp;
60
+ <input class="button-secondary" type="submit" name="draft" value="&nbsp;<?php _e('Draft', 'nggallery'); ?>&nbsp;" />
61
+ </td>
62
+ </tr>
63
+ </table>
64
+ </form>
admin/roles.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ function nggallery_admin_roles() {
6
+
7
+ if ( isset($_POST['update_cap']) ) {
8
+
9
+ check_admin_referer('ngg_addroles');
10
+
11
+ // now set or remove the capability
12
+ ngg_set_capability($_POST['general'],"NextGEN Gallery overview");
13
+ ngg_set_capability($_POST['tinymce'],"NextGEN Use TinyMCE");
14
+ ngg_set_capability($_POST['add_gallery'],"NextGEN Upload images");
15
+ ngg_set_capability($_POST['manage_gallery'],"NextGEN Manage gallery");
16
+ ngg_set_capability($_POST['manage_others'],"NextGEN Manage others gallery");
17
+ ngg_set_capability($_POST['manage_tags'],"NextGEN Manage tags");
18
+ ngg_set_capability($_POST['edit_album'],"NextGEN Edit album");
19
+ ngg_set_capability($_POST['change_style'],"NextGEN Change style");
20
+ ngg_set_capability($_POST['change_options'],"NextGEN Change options");
21
+
22
+ nggGallery::show_message(__('Updated capabilities',"nggallery"));
23
+ }
24
+
25
+ ?>
26
+ <div class="wrap">
27
+ <?php include('templates/social_media_buttons.php'); ?>
28
+ <?php screen_icon( 'nextgen-gallery' ); ?>
29
+ <h2><?php _e('Roles / capabilities', 'nggallery') ;?></h2>
30
+ <p><?php _e('Select the lowest role which should be able to access the following capabilities. NextCellent Gallery supports the standard roles from WordPress.', 'nggallery') ?> <br />
31
+ <?php _e('For a more flexible user management you can use the', 'nggallery') ?> <a href="http://wordpress.org/extend/plugins/capsman/" target="_blank">Capability Manager</a>.</p>
32
+ <form name="addroles" id="addroles" method="POST" accept-charset="utf-8" >
33
+ <?php wp_nonce_field('ngg_addroles') ?>
34
+ <table class="form-table">
35
+ <tr valign="top">
36
+ <th scope="row"><?php _e('Main NextCellent Gallery overview', 'nggallery') ;?>:</th>
37
+ <td><label for="general"><select name="general" id="general"><?php wp_dropdown_roles( ngg_get_role('NextGEN Gallery overview') ); ?></select></label></td>
38
+ </tr>
39
+ <tr valign="top">
40
+ <th scope="row"><?php _e('Use TinyMCE Button / Upload tab', 'nggallery') ;?>:</th>
41
+ <td><label for="tinymce"><select name="tinymce" id="tinymce"><?php wp_dropdown_roles( ngg_get_role('NextGEN Use TinyMCE') ); ?></select></label></td>
42
+ </tr>
43
+ <tr valign="top">
44
+ <th scope="row"><?php _e('Add gallery / Upload images', 'nggallery') ;?>:</th>
45
+ <td><label for="add_gallery"><select name="add_gallery" id="add_gallery"><?php wp_dropdown_roles( ngg_get_role('NextGEN Upload images') ); ?></select></label></td>
46
+ </tr>
47
+ <tr valign="top">
48
+ <th scope="row"><?php _e('Manage gallery', 'nggallery') ;?>:</th>
49
+ <td><label for="manage_gallery"><select name="manage_gallery" id="manage_gallery"><?php wp_dropdown_roles( ngg_get_role('NextGEN Manage gallery') ); ?></select></label></td>
50
+ </tr>
51
+ <tr valign="top">
52
+ <th scope="row"><?php _e('Manage others gallery', 'nggallery') ;?>:</th>
53
+ <td><label for="manage_others"><select name="manage_others" id="manage_others"><?php wp_dropdown_roles( ngg_get_role('NextGEN Manage others gallery') ); ?></select></label></td>
54
+ </tr>
55
+ <tr valign="top">
56
+ <th scope="row"><?php _e('Manage tags', 'nggallery') ;?>:</th>
57
+ <td><label for="manage_tags"><select name="manage_tags" id="manage_tags"><?php wp_dropdown_roles( ngg_get_role('NextGEN Manage tags') ); ?></select></label></td>
58
+ </tr>
59
+ <tr valign="top">
60
+ <th scope="row"><?php _e('Edit Album', 'nggallery') ;?>:</th>
61
+ <td><label for="edit_album"><select name="edit_album" id="edit_album"><?php wp_dropdown_roles( ngg_get_role('NextGEN Edit album') ); ?></select></label></td>
62
+ </tr>
63
+ <tr valign="top">
64
+ <th scope="row"><?php _e('Change style', 'nggallery') ;?>:</th>
65
+ <td><label for="change_style"><select name="change_style" id="change_style"><?php wp_dropdown_roles( ngg_get_role('NextGEN Change style') ); ?></select></label></td>
66
+ </tr>
67
+ <tr valign="top">
68
+ <th scope="row"><?php _e('Change options', 'nggallery') ;?>:</th>
69
+ <td><label for="change_options"><select name="change_options" id="change_options"><?php wp_dropdown_roles( ngg_get_role('NextGEN Change options') ); ?></select></label></td>
70
+ </tr>
71
+ </table>
72
+ <div class="submit"><input type="submit" class="button-primary" name= "update_cap" value="<?php _e('Update capabilities', 'nggallery') ;?>"/></div>
73
+ </form>
74
+ </div>
75
+ <?php
76
+
77
+ }
78
+
79
+ function ngg_get_sorted_roles() {
80
+ // This function returns all roles, sorted by user level (lowest to highest)
81
+ global $wp_roles;
82
+ $roles = $wp_roles->role_objects;
83
+ $sorted = array();
84
+
85
+ if( class_exists('RoleManager') ) {
86
+ foreach( $roles as $role_key => $role_name ) {
87
+ $role = get_role($role_key);
88
+ if( empty($role) ) continue;
89
+ $role_user_level = array_reduce(array_keys($role->capabilities), array('WP_User', 'level_reduction'), 0);
90
+ $sorted[$role_user_level] = $role;
91
+ }
92
+ $sorted = array_values($sorted);
93
+ } else {
94
+ $role_order = array("subscriber", "contributor", "author", "editor", "administrator");
95
+ foreach($role_order as $role_key) {
96
+ $sorted[$role_key] = get_role($role_key);
97
+ }
98
+ }
99
+ return $sorted;
100
+ }
101
+
102
+ function ngg_get_role($capability){
103
+ // This function return the lowest roles which has the capabilities
104
+ $check_order = ngg_get_sorted_roles();
105
+
106
+ $args = array_slice(func_get_args(), 1);
107
+ $args = array_merge(array($capability), $args);
108
+
109
+ foreach ($check_order as $check_role) {
110
+ if ( empty($check_role) )
111
+ return false;
112
+
113
+ if (call_user_func_array(array(&$check_role, 'has_cap'), $args))
114
+ return $check_role->name;
115
+ }
116
+ return false;
117
+ }
118
+
119
+ function ngg_set_capability($lowest_role, $capability){
120
+ // This function set or remove the $capability
121
+ $check_order = ngg_get_sorted_roles();
122
+
123
+ $add_capability = false;
124
+
125
+ foreach ($check_order as $the_role) {
126
+ $role = $the_role->name;
127
+
128
+ if ( $lowest_role == $role )
129
+ $add_capability = true;
130
+
131
+ // If you rename the roles, then please use a role manager plugin
132
+
133
+ if ( empty($the_role) )
134
+ continue;
135
+
136
+ $add_capability ? $the_role->add_cap($capability) : $the_role->remove_cap($capability) ;
137
+ }
138
+ }
139
+
140
+ ?>
admin/rotate.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+ Custom thumbnail for NGG
5
+ Author : Simone Fumagalli | simone@iliveinperego.com
6
+ More info and update : http://www.iliveinperego.com/rotate_for_ngg/
7
+
8
+ Credits:
9
+ NextGen Gallery : Alex Rabe | http://alexrabe.boelinger.com/wordpress-plugins/nextgen-gallery/
10
+
11
+ **/
12
+
13
+ require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php');
14
+ require_once( NGGALLERY_ABSPATH . '/lib/image.php' );
15
+
16
+ if ( !is_user_logged_in() )
17
+ die(__('Cheatin&#8217; uh?'));
18
+
19
+ if ( !current_user_can('NextGEN Manage gallery') )
20
+ die(__('Cheatin&#8217; uh?'));
21
+
22
+ global $wpdb;
23
+
24
+ $id = (int) $_GET['id'];
25
+
26
+ // let's get the image data
27
+ $picture = nggdb::find_image($id);
28
+
29
+ include_once( nggGallery::graphic_library() );
30
+ $ngg_options = get_option('ngg_options');
31
+
32
+ $thumb = new ngg_Thumbnail($picture->imagePath, TRUE);
33
+ $thumb->resize(350,350);
34
+
35
+ // we need the new dimension
36
+ $resizedPreviewInfo = $thumb->newDimensions;
37
+ $thumb->destruct();
38
+
39
+ $preview_image = trailingslashit( home_url() ) . 'index.php?callback=image&amp;pid=' . $picture->pid . '&amp;width=350&amp;height=350';
40
+
41
+ ?>
42
+
43
+ <script language="JavaScript">
44
+ <!--
45
+
46
+ function rotateImage() {
47
+
48
+ var rotate_angle = jQuery('input[name=ra]:checked').val();
49
+
50
+ jQuery.ajax({
51
+ url: ajaxurl,
52
+ type : "POST",
53
+ data: {action: 'rotateImage', id: <?php echo $id ?>, ra: rotate_angle},
54
+ cache: false,
55
+ success: function (msg) { showMessage('<?php _e('Image rotated', 'nggallery'); ?>') },
56
+ error: function (msg, status, errorThrown) { showMessage('<?php _e('Error rotating thumbnail', 'nggallery'); ?>') }
57
+ });
58
+
59
+ }
60
+
61
+ function showMessage(message) {
62
+ jQuery('#thumbMsg').html(message);
63
+ jQuery('#thumbMsg').css({'display':'block'});
64
+ setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
65
+
66
+ var d = new Date();
67
+ newUrl = jQuery("#imageToEdit").attr("src") + "?" + d.getTime();
68
+ jQuery("#imageToEdit").attr("src" , newUrl);
69
+
70
+ }
71
+
72
+ -->
73
+ </script>
74
+
75
+ <table width="98%" align="center" style="border:1px solid #DADADA">
76
+ <tr style="height : 360px;">
77
+ <td valign="middle" align="center" style="background-color:#DADADA; width : 370px;">
78
+ <img src="<?php echo esc_url( $preview_image ); ?>" alt="" id="imageToEdit" />
79
+ </td>
80
+ <td>
81
+ <input type="radio" name="ra" value="cw" /><?php esc_html_e('90&deg; clockwise', 'nggallery'); ?><br />
82
+ <input type="radio" name="ra" value="ccw" /><?php esc_html_e('90&deg; anticlockwise', 'nggallery'); ?><br />
83
+ <input type="radio" name="ra" value="fv" /><?php esc_html_e('Flip vertically', 'nggallery'); ?><br />
84
+ <input type="radio" name="ra" value="fh" /><?php esc_html_e('Flip horizontally', 'nggallery'); ?>
85
+ </td>
86
+ </tr>
87
+ <tr style="background-color:#DADADA;">
88
+
89
+ <td colspan="2">
90
+ <input type="button" name="update" value="<?php esc_attr_e('Update', 'nggallery'); ?>" onclick="rotateImage()" class="button-secondary" style="float:right; margin-left:4px;"/>
91
+ <div id="thumbMsg" style="color:#FF0000; display : none;font-size:11px; float:right; width:60%; height:2em; line-height:2em;"></div>
92
+ </td>
93
+ </tr>
94
+ </table>
admin/settings.php ADDED
@@ -0,0 +1,938 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ /**
5
+ * Rebuild slugs for albums, galleries and images via AJAX request
6
+ *
7
+ * @sine 1.7.0
8
+ * @access internal
9
+ */
10
+ class ngg_rebuild_unique_slugs {
11
+
12
+ function start_rebuild() {
13
+ global $wpdb;
14
+
15
+ $total = array();
16
+ // get the total number of images
17
+ $total['images'] = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggpictures") );
18
+ $total['gallery'] = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggallery") );
19
+ $total['album'] = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggalbum") );
20
+
21
+ $messages = array(
22
+ 'images' => __( 'Rebuild image structure : %s / %s images', 'nggallery' ),
23
+ 'gallery' => __( 'Rebuild gallery structure : %s / %s galleries', 'nggallery' ),
24
+ 'album' => __( 'Rebuild album structure : %s / %s albums', 'nggallery' ),
25
+ );
26
+
27
+ ?>
28
+ <?php
29
+
30
+ foreach ( array_keys( $messages ) as $key ) {
31
+
32
+ $message = sprintf( $messages[ $key ] ,
33
+ "<span class='ngg-count-current'>0</span>",
34
+ "<span class='ngg-count-total'>" . $total[ $key ] . "</span>"
35
+ );
36
+
37
+ echo "<div class='$key updated'><p class='ngg'>$message</p></div>";
38
+ }
39
+
40
+ $ajax_url = add_query_arg( 'action', 'ngg_rebuild_unique_slugs', admin_url( 'admin-ajax.php' ) );
41
+ ?>
42
+ <script type="text/javascript">
43
+ jQuery(document).ready(function($) {
44
+ var ajax_url = '<?php echo $ajax_url; ?>',
45
+ _action = 'images',
46
+ images = <?php echo $total['images']; ?>,
47
+ gallery = <?php echo $total['gallery']; ?>,
48
+ album = <?php echo $total['album']; ?>,
49
+ total = 0,
50
+ offset = 0,
51
+ count = 50;
52
+
53
+ var $display = $('.ngg-count-current');
54
+ $('.finished, .gallery, .album').hide();
55
+ total = images;
56
+
57
+ function call_again() {
58
+ if ( offset > total ) {
59
+ offset = 0;
60
+ // 1st run finished
61
+ if (_action == 'images') {
62
+ _action = 'gallery';
63
+ total = gallery;
64
+ $('.images, .gallery').toggle();
65
+ $display.html(offset);
66
+ call_again();
67
+ return;
68
+ }
69
+ // 2nd run finished
70
+ if (_action == 'gallery') {
71
+ _action = 'album';
72
+ total = album;
73
+ $('.gallery, .album').toggle();
74
+ $display.html(offset);
75
+ call_again();
76
+ return;
77
+ }
78
+ // 3rd run finished, exit now
79
+ if (_action == 'album') {
80
+ $('.ngg')
81
+ .html('<?php _e( 'Done.', 'nggallery' ); ?>')
82
+ .parent('div').hide();
83
+ $('.finished').show();
84
+ return;
85
+ }
86
+ }
87
+
88
+ $.post(ajax_url, {'_action': _action, 'offset': offset}, function(response) {
89
+ $display.html(offset);
90
+
91
+ offset += count;
92
+ call_again();
93
+ });
94
+ }
95
+
96
+ call_again();
97
+ });
98
+ </script>
99
+ <?php
100
+ }
101
+ }
102
+
103
+ class nggOptions {
104
+
105
+ /**
106
+ * PHP4 compatibility layer for calling the PHP5 constructor.
107
+ *
108
+ */
109
+ function nggOptions() {
110
+ return $this->__construct();
111
+ }
112
+
113
+ /**
114
+ * nggOptions::__construct()
115
+ *
116
+ * @return void
117
+ */
118
+ function __construct() {
119
+
120
+ // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
121
+ $this->filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
122
+
123
+ //Look for POST updates
124
+ if ( !empty($_POST) )
125
+ $this->processor();
126
+ }
127
+
128
+ /**
129
+ * Save/Load options and add a new hook for plugins
130
+ *
131
+ * @return void
132
+ */
133
+ function processor() {
134
+
135
+ global $ngg, $nggRewrite;
136
+
137
+ $old_state = $ngg->options['usePermalinks'];
138
+ $old_slug = $ngg->options['permalinkSlug'];
139
+
140
+ if ( isset($_POST['irDetect']) ) {
141
+ check_admin_referer('ngg_settings');
142
+ $ngg->options['irURL'] = ngg_search_imagerotator();
143
+ update_option('ngg_options', $ngg->options);
144
+ }
145
+
146
+ if ( isset($_POST['updateoption']) ) {
147
+ check_admin_referer('ngg_settings');
148
+ // get the hidden option fields, taken from WP core
149
+ if ( $_POST['page_options'] )
150
+ $options = explode(',', stripslashes($_POST['page_options']));
151
+
152
+ if ($options) {
153
+ foreach ($options as $option) {
154
+ $option = trim($option);
155
+ $value = isset($_POST[$option]) ? trim($_POST[$option]) : false;
156
+ // $value = sanitize_option($option, $value); // This does stripslashes on those that need it
157
+ $ngg->options[$option] = $value;
158
+ }
159
+
160
+ // do not allow a empty string
161
+ if ( empty ( $ngg->options['permalinkSlug'] ) )
162
+ $ngg->options['permalinkSlug'] = 'nggallery';
163
+
164
+ // the path should always end with a slash
165
+ $ngg->options['gallerypath'] = trailingslashit($ngg->options['gallerypath']);
166
+ $ngg->options['imageMagickDir'] = trailingslashit($ngg->options['imageMagickDir']);
167
+
168
+ // the custom sortorder must be ascending
169
+ $ngg->options['galSortDir'] = ($ngg->options['galSort'] == 'sortorder') ? 'ASC' : $ngg->options['galSortDir'];
170
+ }
171
+ // Save options
172
+ update_option('ngg_options', $ngg->options);
173
+
174
+ // Flush Rewrite rules
175
+ if ( $old_state != $ngg->options['usePermalinks'] || $old_slug != $ngg->options['permalinkSlug'] )
176
+ $nggRewrite->flush();
177
+
178
+ nggGallery::show_message(__('Update Successfully','nggallery'));
179
+ }
180
+
181
+ if ( isset($_POST['clearcache']) ) {
182
+ check_admin_referer('ngg_settings');
183
+
184
+ $path = WINABSPATH . $ngg->options['gallerypath'] . 'cache/';
185
+
186
+ if (is_dir($path))
187
+ if ($handle = opendir($path)) {
188
+ while (false !== ($file = readdir($handle))) {
189
+ if ($file != '.' && $file != '..') {
190
+ @unlink($path . '/' . $file);
191
+ }
192
+ }
193
+ closedir($handle);
194
+ }
195
+
196
+ nggGallery::show_message(__('Cache cleared','nggallery'));
197
+ }
198
+
199
+ if ( isset($_POST['createslugs']) ) {
200
+ check_admin_referer('ngg_settings');
201
+ ngg_rebuild_unique_slugs::start_rebuild();
202
+ }
203
+
204
+ do_action( 'ngg_update_options_page' );
205
+
206
+ }
207
+
208
+ /**
209
+ * Render the page content
210
+ *
211
+ * @return void
212
+ */
213
+ function controller() {
214
+
215
+ // get list of tabs
216
+ $tabs = $this->tabs_order();
217
+
218
+ ?>
219
+ <script type="text/javascript">
220
+ jQuery(document).ready(function(){
221
+ jQuery('html,body').scrollTop(0);
222
+ jQuery("a.switch-expert").hide();
223
+ /*
224
+ jQuery(".expert").hide();
225
+ jQuery("a.switch-expert").click(function(e) {
226
+ jQuery(".expert").toggle();
227
+ return false;
228
+ });
229
+ */
230
+ jQuery('#slider').tabs({ fxFade: true, fxSpeed: 'fast' });
231
+ jQuery('#slider').css('display', 'block');
232
+ /*
233
+ jQuery('.picker').ColorPicker({
234
+ onSubmit: function(hsb, hex, rgb, el) {
235
+ jQuery(el).val(hex);
236
+ jQuery(el).ColorPickerHide();
237
+ },
238
+ onBeforeShow: function () {
239
+ jQuery(this).ColorPickerSetColor(this.value);
240
+ }
241
+ })
242
+ .bind('keyup', function(){
243
+ jQuery(this).ColorPickerSetColor(this.value);
244
+ });
245
+ */
246
+ });
247
+
248
+ function insertcode(value) {
249
+ var effectcode;
250
+ switch (value) {
251
+ case "none":
252
+ effectcode = "";
253
+ jQuery('#tbImage').hide("slow");
254
+ break;
255
+ case "thickbox":
256
+ effectcode = 'class="thickbox" rel="%GALLERY_NAME%"';
257
+ jQuery('#tbImage').show("slow");
258
+ break;
259
+ case "lightbox":
260
+ effectcode = 'rel="lightbox[%GALLERY_NAME%]"';
261
+ jQuery('#tbImage').hide("slow");
262
+ break;
263
+ case "highslide":
264
+ effectcode = 'class="highslide" onclick="return hs.expand(this, { slideshowGroup: %GALLERY_NAME% })"';
265
+ jQuery('#tbImage').hide("slow");
266
+ break;
267
+ case "shutter":
268
+ effectcode = 'class="shutterset_%GALLERY_NAME%"';
269
+ jQuery('#tbImage').hide("slow");
270
+ break;
271
+ default:
272
+ break;
273
+ }
274
+ jQuery("#thumbCode").val(effectcode);
275
+ };
276
+
277
+ function setcolor(fileid, color) {
278
+ jQuery(fileid).css("background-color", '#' + color );
279
+ };
280
+ </script>
281
+ <?php include('templates/social_media_buttons.php'); ?>
282
+ <div id="slider" class="wrap" style="display: none;">
283
+ <ul id="tabs">
284
+ <?php
285
+ foreach($tabs as $tab_key => $tab_name) {
286
+ echo "\n\t\t<li><a href='#$tab_key'>$tab_name</a></li>";
287
+ }
288
+ ?>
289
+ </ul>
290
+ <?php
291
+ foreach($tabs as $tab_key => $tab_name) {
292
+ echo "\n\t<div id='$tab_key'>\n";
293
+ // Looks for the internal class function, otherwise enable a hook for plugins
294
+ if ( method_exists( $this, "tab_$tab_key" ))
295
+ call_user_func( array( &$this , "tab_$tab_key") );
296
+ else
297
+ do_action( 'ngg_tab_content_' . $tab_key );
298
+ echo "\n\t</div>";
299
+ }
300
+ ?>
301
+ </div>
302
+ <?php
303
+
304
+ }
305
+
306
+ /**
307
+ * Create array for tabs and add a filter for other plugins to inject more tabs
308
+ *
309
+ * @return array $tabs
310
+ */
311
+ function tabs_order() {
312
+
313
+ $tabs = array();
314
+
315
+ $tabs['generaloptions'] = __('General Options', 'nggallery');
316
+ $tabs['thumbnails'] = __('Thumbnails', 'nggallery');
317
+ $tabs['images'] = __('Images', 'nggallery');
318
+ $tabs['gallery'] = _n( 'Gallery', 'Galleries', 1, 'nggallery' );
319
+ $tabs['effects'] = __('Effects', 'nggallery');
320
+ $tabs['watermark'] = __('Watermark', 'nggallery');
321
+ $tabs['slideshow'] = __('Slideshow', 'nggallery');
322
+
323
+ $tabs = apply_filters('ngg_settings_tabs', $tabs);
324
+
325
+ return $tabs;
326
+
327
+ }
328
+
329
+ function tab_generaloptions() {
330
+ global $ngg;
331
+
332
+ ?>
333
+ <!-- General Options -->
334
+ <h2><?php _e('General Options','nggallery'); ?></h2>
335
+ <form name="generaloptions" method="post" action="<?php echo $this->filepath; ?>">
336
+ <?php wp_nonce_field('ngg_settings') ?>
337
+ <input type="hidden" name="page_options" value="gallerypath,deleteImg,useMediaRSS,usePicLens,usePermalinks,permalinkSlug,graphicLibrary,imageMagickDir,activateTags,appendType,maxImages" />
338
+ <table class="form-table ngg-options">
339
+ <tr valign="top">
340
+ <th align="left"><?php _e('Gallery path','nggallery'); ?></th>
341
+ <td><input <?php if (is_multisite()) echo 'readonly = "readonly"'; ?> type="text" size="35" name="gallerypath" value="<?php echo $ngg->options['gallerypath']; ?>" />
342
+ <span class="setting-description"><?php _e('This is the default path for all galleries','nggallery') ?></span></td>
343
+ </tr>
344
+ <tr class="expert" valign="top">
345
+ <th align="left"><?php _e('Delete image files','nggallery'); ?></th>
346
+ <td><input <?php if (is_multisite()) echo 'readonly = "readonly"'; ?> type="checkbox" name="deleteImg" value="1" <?php checked('1', $ngg->options['deleteImg']); ?> />
347
+ <?php _e('Delete files, when removing a gallery in the database','nggallery'); ?></td>
348
+ </tr>
349
+ <tr valign="top">
350
+ <th align="left"><?php _e('Activate permalinks','nggallery') ?></th>
351
+ <td><input type="checkbox" name="usePermalinks" value="1" <?php checked('1', $ngg->options['usePermalinks']); ?> />
352
+ <?php _e('When you activate this option, you need to update your permalink structure one time.','nggallery'); ?>
353
+ <?php _e('Gallery slug name :','nggallery'); ?>
354
+ <input type="text" size="15" name="permalinkSlug" value="<?php echo $ngg->options['permalinkSlug']; ?>" /></td>
355
+ </tr>
356
+ <tr class="expert">
357
+ <th valign="top"><?php _e('Create new URL friendly image slugs','nggallery'); ?></th>
358
+ <td><input type="submit" name="createslugs" class="button-secondary" value="<?php _e('Proceed now','nggallery') ;?> &raquo;"/></td>
359
+ </tr>
360
+ <tr class="expert">
361
+ <th valign="top"><?php _e('Select graphic library','nggallery'); ?></th>
362
+ <td><label><input name="graphicLibrary" type="radio" value="gd" <?php checked('gd', $ngg->options['graphicLibrary']); ?> /> <?php _e('GD Library', 'nggallery') ;?></label><br />
363
+ <label><input name="graphicLibrary" type="radio" value="im" <?php checked('im', $ngg->options['graphicLibrary']); ?> /> <?php _e('ImageMagick (Experimental). Path to the library :', 'nggallery') ;?>&nbsp;
364
+ <input <?php if (is_multisite()) echo 'readonly = "readonly"'; ?> type="text" size="35" name="imageMagickDir" value="<?php echo $ngg->options['imageMagickDir']; ?>" /></label>
365
+ </td>
366
+ </tr>
367
+ <tr>
368
+ <th align="left"><?php _e('Activate Media RSS feed','nggallery'); ?></th>
369
+ <td><input type="checkbox" name="useMediaRSS" value="1" <?php checked('1', $ngg->options['useMediaRSS']); ?> />
370
+ <span class="setting-description"><?php _e('A RSS feed will be added to you blog header. Useful for CoolIris/PicLens','nggallery') ?></span></td>
371
+ </tr>
372
+ <tr>
373
+ <th align="left"><?php _e('Activate PicLens/CoolIris support','nggallery'); ?> (<a href="http://www.cooliris.com">CoolIris</a>)</th>
374
+ <td><input type="checkbox" name="usePicLens" value="1" <?php checked('1', $ngg->options['usePicLens']); ?> />
375
+ <span class="setting-description"><?php _e('When you activate this option, some javascript is added to your site footer. Make sure that wp_footer is called in your theme.','nggallery') ?></span></td>
376
+ </tr>
377
+ </table>
378
+ <h3 class="expert"><?php _e('Tags / Categories','nggallery'); ?></h3>
379
+ <table class="expert form-table ngg-options">
380
+ <tr>
381
+ <th valign="top"><?php _e('Activate related images','nggallery'); ?></th>
382
+ <td><input name="activateTags" type="checkbox" value="1" <?php checked('1', $ngg->options['activateTags']); ?> />
383
+ <?php _e('This option will append related images to every post','nggallery'); ?>
384
+ </td>
385
+ </tr>
386
+ <tr>
387
+ <th valign="top"><?php _e('Match with','nggallery'); ?></th>
388
+ <td><label><input name="appendType" type="radio" value="category" <?php checked('category', $ngg->options['appendType']); ?> /> <?php _e('Categories', 'nggallery') ;?></label><br />
389
+ <label><input name="appendType" type="radio" value="tags" <?php checked('tags', $ngg->options['appendType']); ?> /> <?php _e('Tags', 'nggallery') ;?></label>
390
+ </td>
391
+ </tr>
392
+ <tr>
393
+ <th valign="top"><?php _e('Max. number of images','nggallery'); ?></th>
394
+ <td><input type="text" name="maxImages" value="<?php echo $ngg->options['maxImages']; ?>" size="3" maxlength="3" />
395
+ <span class="setting-description"><?php _e('0 will show all images','nggallery'); ?></span>
396
+ </td>
397
+ </tr>
398
+ </table>
399
+ <div class="alignright"><a href="" class="switch-expert" >[<?php _e('More settings','nggallery'); ?>]</a></div>
400
+ <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes'); ?>"/></div>
401
+ </form>
402
+ <?php
403
+ }
404
+
405
+ function tab_thumbnails() {
406
+ global $ngg;
407
+ ?>
408
+ <!-- Thumbnail settings -->
409
+ <h2><?php _e('Thumbnail settings','nggallery'); ?></h2>
410
+ <form name="thumbnailsettings" method="POST" action="<?php echo $this->filepath.'#thumbnails'; ?>" >
411
+ <?php wp_nonce_field('ngg_settings') ?>
412
+ <input type="hidden" name="page_options" value="thumbwidth,thumbheight,thumbfix,thumbquality" />
413
+ <p><?php _e('Please note : If you change the settings, you need to recreate the thumbnails under -> Manage Gallery .', 'nggallery') ?></p>
414
+ <table class="form-table ngg-options">
415
+ <tr valign="top">
416
+ <th align="left"><?php _e('Width x height (in pixel)','nggallery'); ?></th>
417
+ <td><input type="text" size="4" maxlength="4" name="thumbwidth" value="<?php echo $ngg->options['thumbwidth']; ?>" /> x <input type="text" size="4" maxlength="4" name="thumbheight" value="<?php echo $ngg->options['thumbheight']; ?>" />
418
+ <span class="setting-description"><?php _e('These values are maximum values ','nggallery'); ?></span></td>
419
+ </tr>
420
+ <tr valign="top">
421
+ <th align="left"><?php _e('Set fix dimension','nggallery'); ?></th>
422
+ <td><input type="checkbox" name="thumbfix" value="1" <?php checked('1', $ngg->options['thumbfix']); ?> />
423
+ <?php _e('Ignore the aspect ratio, no portrait thumbnails','nggallery') ?></td>
424
+ </tr>
425
+ <tr class="expert" valign="top">
426
+ <th align="left"><?php _e('Thumbnail quality','nggallery'); ?></th>
427
+ <td><input type="text" size="3" maxlength="3" name="thumbquality" value="<?php echo $ngg->options['thumbquality']; ?>" /> %</td>
428
+ </tr>
429
+ </table>
430
+ <div class="alignright"><a href="" class="switch-expert" >[<?php _e('More settings','nggallery'); ?>]</a></div>
431
+ <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes') ;?>"/></div>
432
+ </form>
433
+ <?php
434
+ }
435
+
436
+ function tab_images() {
437
+ global $ngg;
438
+ ?>
439
+ <!-- Image settings -->
440
+ <h2><?php _e('Image settings','nggallery'); ?></h2>
441
+ <form name="imagesettings" method="POST" action="<?php echo $this->filepath.'#images'; ?>" >
442
+ <?php wp_nonce_field('ngg_settings') ?>
443
+ <input type="hidden" name="page_options" value="imgResize,imgWidth,imgHeight,imgQuality,imgBackup,imgAutoResize" />
444
+ <table class="form-table ngg-options">
445
+ <tr valign="top">
446
+ <th valign="top"><label for="fixratio"><?php _e('Resize Images','nggallery') ?></label></th>
447
+ <td><input type="text" size="5" name="imgWidth" value="<?php echo $ngg->options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $ngg->options['imgHeight']; ?>" />
448
+ <span class="setting-description"><?php _e('Width x height (in pixel). NextCellent Gallery will keep ratio size','nggallery') ?></span></td>
449
+ </tr>
450
+ <tr valign="top">
451
+ <th valign="top"><?php _e('Image quality','nggallery'); ?></th>
452
+ <td><input type="text" size="3" maxlength="3" name="imgQuality" value="<?php echo $ngg->options['imgQuality']; ?>" /> %</td>
453
+ </tr>
454
+ <tr>
455
+ <th valign="top"><?php _e('Backup original images','nggallery'); ?></th>
456
+ <td><input type="checkbox" name="imgBackup" value="1"<?php echo ($ngg->options['imgBackup'] == 1) ? ' checked ="chechked"' : ''; ?>/>
457
+ <span class="setting-description"><?php _e('Creates a backup for inserted images','nggallery'); ?></span></td>
458
+ </tr>
459
+ <tr>
460
+ <th valign="top"><?php _e('Automatically resize','nggallery'); ?></th>
461
+ <td><input type="checkbox" name="imgAutoResize" value="1"<?php echo ($ngg->options['imgAutoResize'] == 1) ? ' checked ="chechked"' : ''; ?>/>
462
+ <span class="setting-description"><?php _e('Automatically resize images on upload.','nggallery') ?></span></td>
463
+ </tr>
464
+ </table>
465
+ <h3 class="expert"><?php _e('Single picture','nggallery') ?></h3>
466
+ <table class="expert form-table ngg-options">
467
+ <tr>
468
+ <th valign="top"><?php _e('Clear cache folder','nggallery'); ?></th>
469
+ <td><input type="submit" name="clearcache" class="button-secondary" value="<?php _e('Proceed now','nggallery') ;?> &raquo;"/></td>
470
+ </tr>
471
+ </table>
472
+ <div class="alignright"><a href="" class="switch-expert" >[<?php _e('More settings','nggallery'); ?>]</a></div>
473
+ <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes') ;?>"/></div>
474
+ </form>
475
+
476
+ <?php
477
+ }
478
+
479
+ function tab_gallery() {
480
+ global $ngg;
481
+ ?>
482
+ <!-- Gallery settings -->
483
+ <h2><?php _e('Gallery settings','nggallery'); ?></h2>
484
+ <form name="galleryform" method="POST" action="<?php echo $this->filepath.'#gallery'; ?>" >
485
+ <?php wp_nonce_field('ngg_settings') ?>
486
+ <input type="hidden" name="page_options" value="galNoPages,galImages,galColumns,galShowSlide,galTextSlide,galTextGallery,galShowOrder,galImgBrowser,galSort,galSortDir,galHiddenImg,galAjaxNav" />
487
+ <table class="form-table ngg-options">
488
+ <tr class="expert" >
489
+ <th valign="top"><?php _e('Deactivate gallery page link','nggallery') ?></th>
490
+ <td><input name="galNoPages" type="checkbox" value="1" <?php checked('1', $ngg->options['galNoPages']); ?> />
491
+ <?php _e('The album will not link to a gallery subpage. The gallery is shown on the same page.','nggallery') ?>
492
+ </td>
493
+ </tr>
494
+ <tr>
495
+ <th valign="top"><?php _e('Number of images per page','nggallery') ?></th>
496
+ <td><input type="text" name="galImages" value="<?php echo $ngg->options['galImages']; ?>" size="3" maxlength="3" />
497
+ <span class="setting-description"><?php _e('0 will disable pagination, all images on one page','nggallery') ?></span>
498
+ </td>
499
+ </tr>
500
+ <tr>
501
+ <th valign="top"><?php _e('Number of columns','nggallery'); ?></th>
502
+ <td><input type="text" name="galColumns" value="<?php echo $ngg->options['galColumns']; ?>" size="3" maxlength="3" />
503
+ <span class="setting-description"><?php _e('0 will display as much as possible based on the width of your theme. Setting normally only required for captions below the images','nggallery') ?></span>
504
+ </td>
505
+ </tr>
506
+ <tr>
507
+ <th valign="top"><?php _e('Integrate slideshow','nggallery'); ?></th>
508
+ <td><input name="galShowSlide" type="checkbox" value="1" <?php checked('1', $ngg->options['galShowSlide']); ?> />
509
+ <input type="text" name="galTextSlide" value="<?php echo $ngg->options['galTextSlide'] ?>" size="20" />
510
+ <input type="text" name="galTextGallery" value="<?php echo $ngg->options['galTextGallery'] ?>" size="20" />
511
+ </td>
512
+ </tr>
513
+ <tr class="expert" >
514
+ <th valign="top"><?php _e('Show first','nggallery'); ?></th>
515
+ <td><label><input name="galShowOrder" type="radio" value="gallery" <?php checked('gallery', $ngg->options['galShowOrder']); ?> /> <?php _e('Thumbnails', 'nggallery') ;?></label><br />
516
+ <label><input name="galShowOrder" type="radio" value="slide" <?php checked('slide', $ngg->options['galShowOrder']); ?> /> <?php _e('Slideshow', 'nggallery') ;?></label>
517
+ </td>
518
+ </tr>
519
+ <tr class="expert" >
520
+ <th valign="top"><?php _e('Show ImageBrowser','nggallery'); ?></th>
521
+ <td><input name="galImgBrowser" type="checkbox" value="1" <?php checked('1', $ngg->options['galImgBrowser']); ?> />
522
+ <?php _e('The gallery will open the ImageBrowser instead the effect.', 'nggallery'); ?>
523
+ </td>
524
+ </tr>
525
+ <tr class="expert" >
526
+ <th valign="top"><?php _e('Add hidden images','nggallery'); ?></th>
527
+ <td><input name="galHiddenImg" type="checkbox" value="1" <?php checked('1', $ngg->options['galHiddenImg']); ?> />
528
+ <?php _e('If pagination is used, this option will still show all images in the modal window (Thickbox, Lightbox etc.). Note : This increases the page load','nggallery'); ?>
529
+ </td>
530
+ </tr>
531
+ <tr class="expert" >
532
+ <th valign="top"><?php _e('Enable AJAX pagination','nggallery'); ?></th>
533
+ <td><input name="galAjaxNav" type="checkbox" value="1" <?php checked('1', $ngg->options['galAjaxNav']); ?> />
534
+ <?php _e('Browse images without reload the page. Note : Works only in combination with Shutter effect','nggallery'); ?>
535
+ </td>
536
+ </tr>
537
+ </table>
538
+ <h3 class="expert" ><?php _e('Sort options','nggallery') ?></h3>
539
+ <table class="expert form-table ngg-options">
540
+ <tr>
541
+ <th valign="top"><?php _e('Sort thumbnails','nggallery') ?></th>
542
+ <td>
543
+ <label><input name="galSort" type="radio" value="sortorder" <?php checked('sortorder', $ngg->options['galSort']); ?> /> <?php _e('Custom order', 'nggallery') ;?></label><br />
544
+ <label><input name="galSort" type="radio" value="pid" <?php checked('pid', $ngg->options['galSort']); ?> /> <?php _e('Image ID', 'nggallery') ;?></label><br />
545
+ <label><input name="galSort" type="radio" value="filename" <?php checked('filename', $ngg->options['galSort']); ?> /> <?php _e('File name', 'nggallery') ;?></label><br />
546
+ <label><input name="galSort" type="radio" value="alttext" <?php checked('alttext', $ngg->options['galSort']); ?> /> <?php _e('Alt / Title text', 'nggallery') ;?></label><br />
547
+ <label><input name="galSort" type="radio" value="imagedate" <?php checked('imagedate', $ngg->options['galSort']); ?> /> <?php _e('Date / Time', 'nggallery') ;?></label>
548
+ </td>
549
+ </tr>
550
+ <tr>
551
+ <th valign="top"><?php _e('Sort direction','nggallery') ?></th>
552
+ <td><label><input name="galSortDir" type="radio" value="ASC" <?php checked('ASC', $ngg->options['galSortDir']); ?> /> <?php _e('Ascending', 'nggallery') ;?></label><br />
553
+ <label><input name="galSortDir" type="radio" value="DESC" <?php checked('DESC', $ngg->options['galSortDir']); ?> /> <?php _e('Descending', 'nggallery') ;?></label>
554
+ </td>
555
+ </tr>
556
+ </table>
557
+ <div class="alignright"><a href="" class="switch-expert" >[<?php _e('More settings','nggallery'); ?>]</a></div>
558
+ <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes') ;?>"/></div>
559
+ </form>
560
+ <?php
561
+ }
562
+
563
+ function tab_effects() {
564
+ global $ngg;
565
+ ?>
566
+ <!-- Effects settings -->
567
+ <h2><?php _e('Effects','nggallery'); ?></h2>
568
+ <form name="effectsform" method="POST" action="<?php echo $this->filepath.'#effects'; ?>" >
569
+ <?php wp_nonce_field('ngg_settings') ?>
570
+ <input type="hidden" name="page_options" value="thumbEffect,thumbCode" />
571
+ <p><?php _e('Here you can select the thumbnail effect, NextCellent Gallery will integrate the required HTML code in the images. Please note that only the Shutter and Thickbox effect will automatic added to your theme.','nggallery'); ?>
572
+ <?php _e('With the placeholder','nggallery'); ?><strong> %GALLERY_NAME% </strong> <?php _e('you can activate a navigation through the images (depend on the effect). Change the code line only , when you use a different thumbnail effect or you know what you do.','nggallery'); ?></p>
573
+ <table class="form-table ngg-options">
574
+ <tr valign="top">
575
+ <th><?php _e('JavaScript Thumbnail effect','nggallery') ?></th>
576
+ <td>
577
+ <select size="1" id="thumbEffect" name="thumbEffect" onchange="insertcode(this.value)">
578
+ <option value="none" <?php selected('none', $ngg->options['thumbEffect']); ?> ><?php _e('None', 'nggallery') ;?></option>
579
+ <option value="thickbox" <?php selected('thickbox', $ngg->options['thumbEffect']); ?> ><?php _e('Thickbox', 'nggallery') ;?></option>
580
+ <option value="lightbox" <?php selected('lightbox', $ngg->options['thumbEffect']); ?> ><?php _e('Lightbox', 'nggallery') ;?></option>
581
+ <option value="highslide" <?php selected('highslide', $ngg->options['thumbEffect']); ?> ><?php _e('Highslide', 'nggallery') ;?></option>
582
+ <option value="shutter" <?php selected('shutter', $ngg->options['thumbEffect']); ?> ><?php _e('Shutter', 'nggallery') ;?></option>
583
+ <option value="custom" <?php selected('custom', $ngg->options['thumbEffect']); ?> ><?php _e('Custom', 'nggallery') ;?></option>
584
+ </select>
585
+ </td>
586
+ </tr>
587
+ <tr class="expert" valign="top">
588
+ <th><?php _e('Link Code line','nggallery') ?></th>
589
+ <td><textarea id="thumbCode" name="thumbCode" cols="50" rows="5"><?php echo htmlspecialchars(stripslashes($ngg->options['thumbCode'])); ?></textarea></td>
590
+ </tr>
591
+ </table>
592
+ <div class="alignright"><a href="" class="switch-expert" >[<?php _e('More settings','nggallery'); ?>]</a></div>
593
+ <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes') ;?>"/></div>
594
+ </form>
595
+
596
+ <?php
597
+ }
598
+
599
+ function tab_watermark() {
600
+
601
+ global $wpdb, $ngg;
602
+
603
+ // take the first image as sample
604
+ $imageID = $wpdb->get_var("SELECT MIN(pid) FROM $wpdb->nggpictures");
605
+ $imageURL = ($imageID) ? $imageURL = '<img src="'. home_url('index.php') . '?callback=image&amp;pid=' . intval ($imageID) . '&amp;mode=watermark&amp;width=300&amp;height=250" />' : '';
606
+
607
+ ?>
608
+ <!-- Watermark settings -->
609
+ <h2><?php _e('Watermark','nggallery'); ?></h2>
610
+ <p><?php _e('Please note : You can only activate the watermark under -> Manage Gallery . This action cannot be undone.', 'nggallery') ?></p>
611
+ <form name="watermarkform" method="POST" action="<?php echo $this->filepath.'#watermark'; ?>" >
612
+ <?php wp_nonce_field('ngg_settings') ?>
613
+ <input type="hidden" name="page_options" value="wmPos,wmXpos,wmYpos,wmType,wmPath,wmFont,wmSize,wmColor,wmText,wmOpaque" />
614
+ <div id="wm-preview">
615
+ <h3><?php _e('Preview','nggallery') ?></h3>
616
+ <p style="text-align:center;"><?php echo $imageURL; ?></p>
617
+ <h3><?php _e('Position','nggallery') ?></h3>
618
+ <div>
619
+ <table id="wm-position">
620
+ <tr>
621
+ <td valign="top">
622
+ <strong><?php _e('Position','nggallery') ?></strong>
623
+ <table border="1">
624
+ <tr>
625
+ <td><input type="radio" name="wmPos" value="topLeft" <?php checked('topLeft', $ngg->options['wmPos']); ?> /></td>
626
+ <td><input type="radio" name="wmPos" value="topCenter" <?php checked('topCenter', $ngg->options['wmPos']); ?> /></td>
627
+ <td><input type="radio" name="wmPos" value="topRight" <?php checked('topRight', $ngg->options['wmPos']); ?> /></td>
628
+ </tr>
629
+ <tr>
630
+ <td><input type="radio" name="wmPos" value="midLeft" <?php checked('midLeft', $ngg->options['wmPos']); ?> /></td>
631
+ <td><input type="radio" name="wmPos" value="midCenter" <?php checked('midCenter', $ngg->options['wmPos']); ?> /></td>
632
+ <td><input type="radio" name="wmPos" value="midRight" <?php checked('midRight', $ngg->options['wmPos']); ?> /></td>
633
+ </tr>
634
+ <tr>
635
+ <td><input type="radio" name="wmPos" value="botLeft" <?php checked('botLeft', $ngg->options['wmPos']); ?> /></td>
636
+ <td><input type="radio" name="wmPos" value="botCenter" <?php checked('botCenter', $ngg->options['wmPos']); ?> /></td>
637
+ <td><input type="radio" name="wmPos" value="botRight" <?php checked('botRight', $ngg->options['wmPos']); ?> /></td>
638
+ </tr>
639
+ </table>
640
+ </td>
641
+ <td valign="top">
642
+ <strong><?php _e('Offset','nggallery') ?></strong>
643
+ <table border="0">
644
+ <tr>
645
+ <td>x</td>
646
+ <td><input type="text" name="wmXpos" value="<?php echo $ngg->options['wmXpos'] ?>" size="4" /> px</td>
647
+ </tr>
648
+ <tr>
649
+ <td>y</td>
650
+ <td><input type="text" name="wmYpos" value="<?php echo $ngg->options['wmYpos'] ?>" size="4" /> px</td>
651
+ </tr>
652
+ </table>
653
+ </td>
654
+ </tr>
655
+ </table>
656
+ </div>
657
+ </div>
658
+ <h3><label><input type="radio" name="wmType" value="image" <?php checked('image', $ngg->options['wmType']); ?> /> <?php _e('Use image as watermark','nggallery') ?></label></h3>
659
+ <table class="wm-table form-table">
660
+ <tr>
661
+ <th><?php _e('URL to file','nggallery') ?></th>
662
+ <td><input type="text" size="40" name="wmPath" value="<?php echo $ngg->options['wmPath']; ?>" /><br />
663
+ <?php if(!ini_get('allow_url_fopen')) _e('The accessing of URL files is disabled at your server (allow_url_fopen)','nggallery') ?> </td>
664
+ </tr>
665
+ </table>
666
+ <h3><label><input type="radio" name="wmType" value="text" <?php checked('text', $ngg->options['wmType']); ?> /> <?php _e('Use text as watermark','nggallery') ?></label></h3>
667
+ <table class="wm-table form-table">
668
+ <tr>
669
+ <th><?php _e('Font','nggallery') ?></th>
670
+ <td><select name="wmFont" size="1"> <?php
671
+ $fontlist = ngg_get_TTFfont();
672
+ foreach ( $fontlist as $fontfile ) {
673
+ echo "\n".'<option value="'.$fontfile.'" '.ngg_input_selected($fontfile, $ngg->options['wmFont']).' >'.$fontfile.'</option>';
674
+ }
675
+ ?>
676
+ </select><br /><span class="setting-description">
677
+ <?php if ( !function_exists('ImageTTFBBox') )
678
+ _e('This function will not work, cause you need the FreeType library','nggallery');
679
+ else
680
+ _e('You can upload more fonts in the folder <strong>nggallery/fonts</strong>','nggallery'); ?>
681
+ </span>
682
+ </td>
683
+ </tr>
684
+ <tr>
685
+ <th><?php _e('Size','nggallery') ?></th>
686
+ <td><input type="text" name="wmSize" value="<?php echo $ngg->options['wmSize']; ?>" size="4" maxlength="2" /> px</td>
687
+ </tr>
688
+ <tr>
689
+ <th><?php _e('Color','nggallery') ?></th>
690
+ <td><input class="picker" type="text" size="6" maxlength="6" id="wmColor" name="wmColor" onchange="setcolor('#previewText', this.value)" value="<?php echo $ngg->options['wmColor'] ?>" />
691
+ <input type="text" size="1" readonly="readonly" id="previewText" style="background-color: #<?php echo $ngg->options['wmColor']; ?>" /> <?php _e('(hex w/o #)','nggallery') ?></td>
692
+ </tr>
693
+ <tr>
694
+ <th valign="top"><?php _e('Text','nggallery') ?></th>
695
+ <td><textarea name="wmText" cols="40" rows="4"><?php echo $ngg->options['wmText'] ?></textarea></td>
696
+ </tr>
697
+ <tr>
698
+ <th><?php _e('Opaque','nggallery') ?></th>
699
+ <td><input type="text" name="wmOpaque" value="<?php echo $ngg->options['wmOpaque'] ?>" size="3" maxlength="3" /> % </td>
700
+ </tr>
701
+ </table>
702
+ <div class="clear"> &nbsp; </div>
703
+ <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes') ;?>"/></div>
704
+ </form>
705
+ <?php
706
+ }
707
+
708
+ function tab_slideshow() {
709
+
710
+ global $ngg;
711
+ ?>
712
+ <!-- Slideshow settings -->
713
+ <form name="player_options" method="POST" action="<?php echo $this->filepath.'#slideshow'; ?>" >
714
+ <?php wp_nonce_field('ngg_settings'); ?>
715
+ <input type="hidden" name="page_options" value="slideFx,enableIR,irURL,irWidth,irHeight,irShuffle,irLinkfromdisplay,irShownavigation,irShowicons,irWatermark,irOverstretch,irRotatetime,irTransition,irKenburns,irBackcolor,irFrontcolor,irLightcolor,irScreencolor,irAudio,irXHTMLvalid" />
716
+ <h2><?php _e('Slideshow','nggallery'); ?></h2>
717
+ <table class="form-table ngg-options">
718
+ <tr>
719
+ <th><?php _e('Default size (W x H)','nggallery') ?></th>
720
+ <td><input type="text" size="3" maxlength="4" name="irWidth" value="<?php echo $ngg->options['irWidth']; ?>" /> x
721
+ <input type="text" size="3" maxlength="4" name="irHeight" value="<?php echo $ngg->options['irHeight']; ?>" /></td>
722
+ </tr>
723
+ <tr>
724
+ <th><?php _e('Duration time','nggallery') ?></th>
725
+ <td><input type="text" size="3" maxlength="3" name="irRotatetime" value="<?php echo $ngg->options['irRotatetime'] ?>" /> <?php _e('sec.', 'nggallery') ;?></td>
726
+ </tr>
727
+ <tr>
728
+ <th><?php _e('Transition / Fade effect','nggallery') ?></th>
729
+ <td>
730
+ <select size="1" name="slideFx">
731
+ <option value="fade" <?php selected('fade', $ngg->options['slideFx']); ?> ><?php _e('fade', 'nggallery') ;?></option>
732
+ <option value="blindX" <?php selected('blindX', $ngg->options['slideFx']); ?> ><?php _e('blindX', 'nggallery') ;?></option>
733
+ <option value="cover" <?php selected('cover', $ngg->options['slideFx']); ?> ><?php _e('cover', 'nggallery') ;?></option>
734
+ <option value="scrollUp" <?php selected('scrollUp', $ngg->options['slideFx']); ?> ><?php _e('scrollUp', 'nggallery') ;?></option>
735
+ <option value="scrollDown" <?php selected('scrollDown', $ngg->options['slideFx']); ?> ><?php _e('scrollDown', 'nggallery') ;?></option>
736
+ <option value="shuffle" <?php selected('shuffle', $ngg->options['slideFx']); ?> ><?php _e('shuffle', 'nggallery') ;?></option>
737
+ <option value="toss" <?php selected('toss', $ngg->options['slideFx']); ?> ><?php _e('toss', 'nggallery') ;?></option>
738
+ <option value="wipe" <?php selected('wipe', $ngg->options['slideFx']); ?> ><?php _e('wipe', 'nggallery') ;?></option>
739
+ </select>
740
+ <span class="description"><?php _e('See here for more information about the effects :', 'nggallery') ?> <a href="http://jquery.malsup.com/cycle/browser.html" target="_blank" >jQuery Cycle</a></span>
741
+ </td>
742
+ </tr>
743
+ </table>
744
+ <h3 class="expert" ><?php _e('Settings for the JW Image Rotator','nggallery') ?></h3>
745
+ <p>
746
+ NextCellent Gallery flash slideshows use the JW Image Rotator Version 3.17 by <a target='_blank' href='http://www.longtailvideo.com/players/jw-image-rotator/'>Long Tail Video</a>.
747
+ Press the button below to search for it automatically. For earlier versions of NextCellent Gallery, you'll need to
748
+ upload the file manually to the <a href='http://codex.wordpress.org/Uploading_Files' target='_blank'>WordPress Uploads directory</a>.
749
+ </p>
750
+ <?php if (empty($ngg->options['irURL']) && ($ngg->options['enableIR'] == '1')) { ?>
751
+ <div id="message" class="error inline">
752
+ <p>
753
+ <?php _e('The path to JW Image Rotator is not defined, the slideshow will not work.','nggallery'); ?><br />
754
+ Press the button below to search for the file.
755
+ </p>
756
+ </div>
757
+ <?php }?>
758
+ <table class="expert form-table ngg-options">
759
+ <tr>
760
+ <th><?php _e('Enable flash slideshow','nggallery') ?></th>
761
+ <td><input name="enableIR" type="checkbox" value="1" <?php checked('1', $ngg->options['enableIR']); ?> />
762
+ <span class="setting-description"><?php _e('Integrate the flash based slideshow for all flash supported devices','nggallery') ?></span></td>
763
+ </tr>
764
+ <tr>
765
+ <th><?php _e('Path to the JW Image Rotator (URL)','nggallery') ?></th>
766
+ <td>
767
+ <input type="text" size="50" id="irURL" name="irURL" value="<?php echo $ngg->options['irURL']; ?>" />
768
+ <input type="submit" name="irDetect" class="button-secondary" value="<?php _e('Search now','nggallery') ;?> &raquo;"/>
769
+ <br /><span class="setting-description"><?php _e('Press the button below to search for the JW Image Rotator','nggallery') ?></span>
770
+ </td>
771
+ </tr>
772
+ <tr>
773
+ <th><?php _e('Shuffle mode','nggallery') ?></th>
774
+ <td><input name="irShuffle" type="checkbox" value="1" <?php checked('1', $ngg->options['irShuffle']); ?> /></td>
775
+ </tr>
776
+ <tr class="expert">
777
+ <th><?php _e('Show next image on click','nggallery') ?></th>
778
+ <td><input name="irLinkfromdisplay" type="checkbox" value="1" <?php checked('1', $ngg->options['irLinkfromdisplay']); ?> /></td>
779
+ </tr>
780
+ <tr class="expert">
781
+ <th><?php _e('Show navigation bar','nggallery') ?></th>
782
+ <td><input name="irShownavigation" type="checkbox" value="1" <?php checked('1', $ngg->options['irShownavigation']); ?> /></td>
783
+ </tr>
784
+ <tr class="expert">
785
+ <th><?php _e('Show loading icon','nggallery') ?></th>
786
+ <td><input name="irShowicons" type="checkbox" value="1" <?php checked('1', $ngg->options['irShowicons']); ?> /></td>
787
+ </tr>
788
+ <tr class="expert">
789
+ <th><?php _e('Use watermark logo','nggallery') ?></th>
790
+ <td><input name="irWatermark" type="checkbox" value="1" <?php checked('1', $ngg->options['irWatermark']); ?> />
791
+ <span class="setting-description"><?php _e('You can change the logo at the watermark settings','nggallery') ?></span></td>
792
+ </tr>
793
+ <tr class="expert">
794
+ <th><?php _e('Stretch image','nggallery') ?></th>
795
+ <td>
796
+ <select size="1" name="irOverstretch">
797
+ <option value="true" <?php selected('true', $ngg->options['irOverstretch']); ?> ><?php _e('true', 'nggallery') ;?></option>
798
+ <option value="false" <?php selected('false', $ngg->options['irOverstretch']); ?> ><?php _e('false', 'nggallery') ;?></option>
799
+ <option value="fit" <?php selected('fit', $ngg->options['irOverstretch']); ?> ><?php _e('fit', 'nggallery') ;?></option>
800
+ <option value="none" <?php selected('none', $ngg->options['irOverstretch']); ?> ><?php _e('none', 'nggallery') ;?></option>
801
+ </select>
802
+ </td>
803
+ </tr>
804
+ <tr>
805
+ <th><?php _e('Transition / Fade effect','nggallery') ?></th>
806
+ <td>
807
+ <select size="1" name="irTransition">
808
+ <option value="fade" <?php selected('fade', $ngg->options['irTransition']); ?> ><?php _e('fade', 'nggallery') ;?></option>
809
+ <option value="bgfade" <?php selected('bgfade', $ngg->options['irTransition']); ?> ><?php _e('bgfade', 'nggallery') ;?></option>
810
+ <option value="slowfade" <?php selected('slowfade', $ngg->options['irTransition']); ?> ><?php _e('slowfade', 'nggallery') ;?></option>
811
+ <option value="circles" <?php selected('circles', $ngg->options['irTransition']); ?> ><?php _e('circles', 'nggallery') ;?></option>
812
+ <option value="bubbles" <?php selected('bubbles', $ngg->options['irTransition']); ?> ><?php _e('bubbles', 'nggallery') ;?></option>
813
+ <option value="blocks" <?php selected('blocks', $ngg->options['irTransition']); ?> ><?php _e('blocks', 'nggallery') ;?></option>
814
+ <option value="fluids" <?php selected('fluids', $ngg->options['irTransition']); ?> ><?php _e('fluids', 'nggallery') ;?></option>
815
+ <option value="flash" <?php selected('flash', $ngg->options['irTransition']); ?> ><?php _e('flash', 'nggallery') ;?></option>
816
+ <option value="lines" <?php selected('lines', $ngg->options['irTransition']); ?> ><?php _e('lines', 'nggallery') ;?></option>
817
+ <option value="random" <?php selected('random', $ngg->options['irTransition']); ?> ><?php _e('random', 'nggallery') ;?></option>
818
+ </select>
819
+ </td>
820
+ </tr>
821
+ <tr class="expert">
822
+ <th><?php _e('Use slow zooming effect','nggallery') ?></th>
823
+ <td><input name="irKenburns" type="checkbox" value="1" <?php checked('1', $ngg->options['irKenburns']); ?> /></td>
824
+ </tr>
825
+ <tr>
826
+ <th><?php _e('Background Color','nggallery') ?></th>
827
+ <td><input class="picker" type="text" size="6" maxlength="6" id="irBackcolor" name="irBackcolor" onchange="setcolor('#previewBack', this.value)" value="<?php echo $ngg->options['irBackcolor'] ?>" />
828
+ <input type="text" size="1" readonly="readonly" id="previewBack" style="background-color: #<?php echo $ngg->options['irBackcolor'] ?>" /></td>
829
+ </tr>
830
+ <tr>
831
+ <th><?php _e('Texts / Buttons Color','nggallery') ?></th>
832
+ <td><input class="picker" type="text" size="6" maxlength="6" id="irFrontcolor" name="irFrontcolor" onchange="setcolor('#previewFront', this.value)" value="<?php echo $ngg->options['irFrontcolor'] ?>" />
833
+ <input type="text" size="1" readonly="readonly" id="previewFront" style="background-color: #<?php echo $ngg->options['irFrontcolor'] ?>" /></td>
834
+ </tr>
835
+ <tr class="expert">
836
+ <th><?php _e('Rollover / Active Color','nggallery') ?></th>
837
+ <td><input class="picker" type="text" size="6" maxlength="6" id="irLightcolor" name="irLightcolor" onchange="setcolor('#previewLight', this.value)" value="<?php echo $ngg->options['irLightcolor'] ?>" />
838
+ <input type="text" size="1" readonly="readonly" id="previewLight" style="background-color: #<?php echo $ngg->options['irLightcolor'] ?>" /></td>
839
+ </tr>
840
+ <tr class="expert">
841
+ <th><?php _e('Screen Color','nggallery') ?></th>
842
+ <td><input class="picker" type="text" size="6" maxlength="6" id="irScreencolor" name="irScreencolor" onchange="setcolor('#previewScreen', this.value)" value="<?php echo $ngg->options['irScreencolor'] ?>" />
843
+ <input type="text" size="1" readonly="readonly" id="previewScreen" style="background-color: #<?php echo $ngg->options['irScreencolor'] ?>" /></td>
844
+ </tr>
845
+ <tr class="expert">
846
+ <th><?php _e('Background music (URL)','nggallery') ?></th>
847
+ <td><input type="text" size="50" id="irAudio" name="irAudio" value="<?php echo $ngg->options['irAudio'] ?>" /></td>
848
+ </tr>
849
+ <tr class="expert">
850
+ <th ><?php _e('Try XHTML validation (with CDATA)','nggallery') ?></th>
851
+ <td><input name="irXHTMLvalid" type="checkbox" value="1" <?php checked('1', $ngg->options['irXHTMLvalid']); ?> />
852
+ <span class="setting-description"><?php _e('Important : Could causes problem at some browser. Please recheck your page.','nggallery') ?></span></td>
853
+ </tr>
854
+ </table>
855
+ <div class="alignright"><a href="" class="switch-expert" >[<?php _e('More settings','nggallery'); ?>]</a></div>
856
+ <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes') ;?>"/></div>
857
+ </form>
858
+ <?php
859
+ }
860
+ }
861
+
862
+ function ngg_get_TTFfont() {
863
+
864
+ $ttf_fonts = array ();
865
+
866
+ // Files in wp-content/plugins/nggallery/fonts directory
867
+ $plugin_root = NGGALLERY_ABSPATH . 'fonts';
868
+
869
+ $plugins_dir = @ dir($plugin_root);
870
+ if ($plugins_dir) {
871
+ while (($file = $plugins_dir->read()) !== false) {
872
+ if (preg_match('|^\.+$|', $file))
873
+ continue;
874
+ if (is_dir($plugin_root.'/'.$file)) {
875
+ $plugins_subdir = @ dir($plugin_root.'/'.$file);
876
+ if ($plugins_subdir) {
877
+ while (($subfile = $plugins_subdir->read()) !== false) {
878
+ if (preg_match('|^\.+$|', $subfile))
879
+ continue;
880
+ if (preg_match('|\.ttf$|', $subfile))
881
+ $ttf_fonts[] = "$file/$subfile";
882
+ }
883
+ }
884
+ } else {
885
+ if (preg_match('|\.ttf$|', $file))
886
+ $ttf_fonts[] = $file;
887
+ }
888
+ }
889
+ }
890
+
891
+ return $ttf_fonts;
892
+ }
893
+
894
+ function ngg_search_imagerotator() {
895
+ global $wpdb;
896
+
897
+ $upload = wp_upload_dir();
898
+
899
+ // look first at the old place and move it to wp-content/uploads
900
+ if ( file_exists( NGGALLERY_ABSPATH . 'imagerotator.swf' ) )
901
+ @rename(NGGALLERY_ABSPATH . 'imagerotator.swf', $upload['basedir'] . '/imagerotator.swf');
902
+
903
+ // This should be the new place
904
+ if ( file_exists( $upload['basedir'] . '/imagerotator.swf' ) )
905
+ return $upload['baseurl'] . '/imagerotator.swf';
906
+
907
+ // Find the path to the imagerotator via the media library
908
+ if ( $path = $wpdb->get_var( "SELECT guid FROM {$wpdb->posts} WHERE guid LIKE '%imagerotator.swf%'" ) )
909
+ return $path;
910
+
911
+ // maybe it's located at wp-content
912
+ if ( file_exists( WP_CONTENT_DIR . '/imagerotator.swf' ) )
913
+ return WP_CONTENT_URL . '/imagerotator.swf';
914
+
915
+ // or in the plugin folder
916
+ if ( file_exists( WP_PLUGIN_DIR . '/imagerotator.swf' ) )
917
+ return WP_PLUGIN_URL . '/imagerotator.swf';
918
+
919
+ // this is deprecated and will be ereased during a automatic upgrade
920
+ if ( file_exists( NGGALLERY_ABSPATH . 'imagerotator.swf' ) )
921
+ return NGGALLERY_URLPATH . 'imagerotator.swf';
922
+
923
+ return '';
924
+ }
925
+
926
+ /**********************************************************/
927
+ // taken from WP Core
928
+
929
+ function ngg_input_selected( $selected, $current) {
930
+ if ( $selected == $current)
931
+ return ' selected="selected"';
932
+ }
933
+
934
+ function ngg_input_checked( $checked, $current) {
935
+ if ( $checked == $current)
936
+ return ' checked="checked"';
937
+ }
938
+ ?>
admin/setup.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ function nggallery_admin_setup() {
5
+ global $wpdb, $ngg;
6
+
7
+ if (isset($_POST['resetdefault'])) {
8
+ check_admin_referer('ngg_uninstall');
9
+
10
+ include_once ( dirname (__FILE__). '/install.php');
11
+
12
+ ngg_default_options();
13
+ $ngg->load_options();
14
+
15
+ nggGallery::show_message(__('Reset all settings to default parameter','nggallery'));
16
+ }
17
+
18
+ if (isset($_POST['uninstall'])) {
19
+
20
+ check_admin_referer('ngg_uninstall');
21
+
22
+ include_once ( dirname (__FILE__). '/install.php');
23
+
24
+ nggallery_uninstall();
25
+
26
+ nggGallery::show_message(__('Uninstall sucessful ! Now delete the plugin and enjoy your life ! Good luck !','nggallery'));
27
+ }
28
+ ?>
29
+ <div class="wrap">
30
+ <h2><?php _e('Reset options', 'nggallery') ;?></h2>
31
+ <form name="resetsettings" method="post">
32
+ <?php wp_nonce_field('ngg_uninstall') ?>
33
+ <p><?php _e('Reset all options/settings to the default installation.', 'nggallery') ;?></p>
34
+ <div align="center"><input type="submit" class="button" name="resetdefault" value="<?php _e('Reset settings', 'nggallery') ;?>" onclick="javascript:check=confirm('<?php _e('Reset all options to default settings ?\n\nChoose [Cancel] to Stop, [OK] to proceed.\n','nggallery'); ?>');if(check==false) return false;" /></div>
35
+ </form>
36
+ </div>
37
+ <?php if ( !is_multisite() || wpmu_site_admin() ) : ?>
38
+ <div class="wrap">
39
+ <h2><?php _e('Uninstall plugin tables', 'nggallery') ;?></h2>
40
+
41
+ <form name="resetsettings" method="post">
42
+ <div>
43
+ <?php wp_nonce_field('ngg_uninstall') ?>
44
+ <p><?php _e('You don\'t like NextCellent Gallery ?', 'nggallery') ;?></p>
45
+ <p><?php _e('No problem, before you deactivate this plugin press the Uninstall Button, because deactivating NextCellent Gallery does not remove any data that may have been created. ', 'nggallery') ;?>
46
+ </div>
47
+ <p><font color="red"><strong><?php _e('WARNING:', 'nggallery') ;?></strong><br />
48
+ <?php _e('Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to backup all the tables first. NextCellent gallery is stored in the tables', 'nggallery') ;?> <strong><?php echo $wpdb->nggpictures; ?></strong>, <strong><?php echo $wpdb->nggalbum; ?></strong> <?php _e('and', 'nggallery') ;?> <strong><?php echo $wpdb->nggalbum; ?></strong>.</font></p>
49
+ <div align="center">
50
+ <input type="submit" name="uninstall" class="button delete" value="<?php _e('Uninstall plugin', 'nggallery') ?>" onclick="javascript:check=confirm('<?php _e('You are about to Uninstall this plugin from WordPress.\nThis action is not reversible.\n\nChoose [Cancel] to Stop, [OK] to Uninstall.\n','nggallery'); ?>');if(check==false) return false;"/>
51
+ </div>
52
+ </form>
53
+ </div>
54
+ <?php endif; ?>
55
+
56
+ <?php
57
+ }
58
+ ?>
admin/showmeta.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // look up for the path
4
+ require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php');
5
+
6
+ require_once(NGGALLERY_ABSPATH . '/lib/meta.php');
7
+ require_once(NGGALLERY_ABSPATH . '/lib/image.php');
8
+
9
+ if ( !is_user_logged_in() )
10
+ die(__('Cheatin&#8217; uh?'));
11
+
12
+ if ( !current_user_can('NextGEN Manage gallery') )
13
+ die(__('Cheatin&#8217; uh?'));
14
+
15
+ global $wpdb;
16
+
17
+ $id = (int) $_GET['id'];
18
+ // let's get the meta data'
19
+ $meta = new nggMeta($id);
20
+ $dbdata = $meta->get_saved_meta();
21
+ $exifdata = $meta->get_EXIF();
22
+ $iptcdata = $meta->get_IPTC();
23
+ $xmpdata = $meta->get_XMP();
24
+ $class = '';
25
+
26
+ ?>
27
+ <!-- META DATA -->
28
+ <fieldset class="options nggallery">
29
+ <h3><?php _e('Meta Data','nggallery'); ?></h3>
30
+ <?php if ($dbdata) { ?>
31
+ <table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
32
+ <thead>
33
+ <tr>
34
+ <th scope="col"><?php _e('Tag','nggallery'); ?></th>
35
+ <th scope="col"><?php _e('Value','nggallery'); ?></th>
36
+ </tr>
37
+ </thead>
38
+ <?php
39
+ foreach ($dbdata as $key => $value){
40
+ if ( is_array($value) ) continue;
41
+ $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
42
+ echo '<tr '.$class.'>
43
+ <td style="width:230px">'. esc_html( $meta->i8n_name($key) ).'</td>
44
+ <td>' . esc_html( $value ) . '</td>
45
+ </tr>';
46
+ }
47
+ ?>
48
+ </table>
49
+ <?php } else echo "<strong>" . __('No meta data saved','nggallery') . "</strong>"; ?>
50
+ </fieldset>
51
+
52
+ <!-- EXIF DATA -->
53
+ <?php if ($exifdata) { ?>
54
+ <fieldset class="options nggallery">
55
+ <h3><?php _e('EXIF Data','nggallery'); ?></h3>
56
+ <?php if ($exifdata) { ?>
57
+ <table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
58
+ <thead>
59
+ <tr>
60
+ <th scope="col"><?php _e('Tag','nggallery'); ?></th>
61
+ <th scope="col"><?php _e('Value','nggallery'); ?></th>
62
+ </tr>
63
+ </thead>
64
+ <?php
65
+ foreach ($exifdata as $key => $value){
66
+ $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
67
+ echo '<tr '.$class.'>
68
+ <td style="width:230px">' . esc_html ( $meta->i8n_name($key) ) . '</td>
69
+ <td>' . esc_html( $value ) .'</td>
70
+ </tr>';
71
+ }
72
+ ?>
73
+ </table>
74
+ <?php } else echo "<strong>". __('No exif data','nggallery'). "</strong>"; ?>
75
+ </fieldset>
76
+ <?php } ?>
77
+
78
+ <!-- IPTC DATA -->
79
+ <?php if ($iptcdata) { ?>
80
+ <fieldset class="options nggallery">
81
+ <h3><?php _e('IPTC Data','nggallery'); ?></h3>
82
+ <table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
83
+ <thead>
84
+ <tr>
85
+ <th scope="col"><?php _e('Tag','nggallery'); ?></th>
86
+ <th scope="col"><?php _e('Value','nggallery'); ?></th>
87
+ </tr>
88
+ </thead>
89
+ <?php
90
+ foreach ($iptcdata as $key => $value){
91
+ $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
92
+ echo '<tr '.$class.'>
93
+ <td style="width:230px">' . esc_html( $meta->i8n_name($key) ) . '</td>
94
+ <td>' . esc_html( $value ) . '</td>
95
+ </tr>';
96
+ }
97
+ ?>
98
+ </table>
99
+ </fieldset>
100
+ <?php } ?>
101
+
102
+ <!-- XMP DATA -->
103
+ <?php if ($xmpdata) { ?>
104
+ <fieldset class="options nggallery">
105
+ <h3><?php _e('XMP Data','nggallery'); ?></h3>
106
+ <table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
107
+ <thead>
108
+ <tr>
109
+ <th scope="col"><?php _e('Tag','nggallery'); ?></th>
110
+ <th scope="col"><?php _e('Value','nggallery'); ?></th>
111
+ </tr>
112
+ </thead>
113
+ <?php
114
+ foreach ($xmpdata as $key => $value){
115
+ $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
116
+ echo '<tr '.$class.'>
117
+ <td style="width:230px">' . esc_html( $meta->i8n_name($key) ) . '</td>
118
+ <td>' . esc_html( $value ) . '</td>
119
+ </tr>';
120
+ }
121
+ ?>
122
+ </table>
123
+ </fieldset>
124
+ <?php } ?>
admin/style.php ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ function nggallery_admin_style() {
5
+
6
+ global $ngg;
7
+
8
+ if ( $theme_css_exists = file_exists (TEMPLATEPATH . "/nggallery.css") ) {
9
+
10
+ $real_file = TEMPLATEPATH . "/nggallery.css";
11
+ $file_show = 'nggallery.css ' . __('(From the theme folder)','nggallery');
12
+
13
+ } else {
14
+
15
+ if (isset($_POST['css'])) {
16
+ check_admin_referer('ngg_style');
17
+ $act_cssfile = $_POST['css'];
18
+
19
+ if ( isset( $_POST['activate'] ) ) {
20
+ // save option now
21
+ $ngg->options['activateCSS'] = $_POST['activateCSS'];
22
+ $ngg->options['CSSfile'] = $act_cssfile;
23
+ update_option('ngg_options', $ngg->options);
24
+ nggGallery::show_message(__('Update Successfully','nggallery'));
25
+ }
26
+ } else {
27
+ // get the options
28
+ if (isset($_POST['file']))
29
+ $act_cssfile = $_POST['file'];
30
+ else
31
+ $act_cssfile = $ngg->options['CSSfile'];
32
+ }
33
+
34
+ // set the path
35
+ $real_file = NGGALLERY_ABSPATH . "css/" . $act_cssfile;
36
+ }
37
+
38
+ if (isset($_POST['updatecss'])) {
39
+
40
+ check_admin_referer('ngg_style');
41
+
42
+ if ( !current_user_can('edit_themes') )
43
+ wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>');
44
+
45
+ $newcontent = stripslashes($_POST['newcontent']);
46
+
47
+ if (is_writeable($real_file)) {
48
+ $f = fopen($real_file, 'w+');
49
+ fwrite($f, $newcontent);
50
+
51
+ fclose($f);
52
+ nggGallery::show_message(__('CSS file successfully updated','nggallery'));
53
+ }
54
+ }
55
+
56
+ // get the content of the file
57
+ //TODO: BUG : Read failed after write a file, maybe a Cache problem
58
+ $error = ( !is_file($real_file) );
59
+
60
+ if (!$error && filesize($real_file) > 0) {
61
+ $f = fopen($real_file, 'r');
62
+ $content = fread($f, filesize($real_file));
63
+ $content = htmlspecialchars($content);
64
+ }
65
+
66
+ ?>
67
+ <script type="text/javascript">
68
+ jQuery(document).ready(function(){
69
+ jQuery('#colorSelector').ColorPicker({
70
+ color: '#0000ff',
71
+ onShow: function (colpkr) {
72
+ jQuery(colpkr).fadeIn(500);
73
+ return false;
74
+ },
75
+ onHide: function (colpkr) {
76
+ jQuery(colpkr).fadeOut(500);
77
+ return false;
78
+ },
79
+ onChange: function (hsb, hex, rgb) {
80
+ jQuery('#colorSelector div').css('backgroundColor', '#' + hex);
81
+ }
82
+ });
83
+ });
84
+ </script>
85
+ <div class="wrap">
86
+
87
+ <div class="bordertitle">
88
+ <?php screen_icon( 'nextgen-gallery' ); ?>
89
+ <h2><?php _e('Style Editor','nggallery') ?></h2>
90
+ <?php if (!$theme_css_exists) : ?>
91
+ <form id="themeselector" name="cssfiles" method="post">
92
+ <?php wp_nonce_field('ngg_style') ?>
93
+ <strong><?php _e('Activate and use style sheet:','nggallery') ?></strong>
94
+ <input type="checkbox" name="activateCSS" value="1" <?php checked('1', $ngg->options['activateCSS']); ?> />
95
+ <select name="css" id="theme" style="margin: 0pt; padding: 0pt;" onchange="this.form.submit();">
96
+ <?php
97
+ $csslist = ngg_get_cssfiles();
98
+ foreach ($csslist as $key =>$a_cssfile) {
99
+ $css_name = $a_cssfile['Name'];
100
+ if ($key == $act_cssfile) {
101
+ $file_show = $key;
102
+ $selected = " selected='selected'";
103
+ $act_css_description = $a_cssfile['Description'];
104
+ $act_css_author = $a_cssfile['Author'];
105
+ $act_css_version = $a_cssfile['Version'];
106
+ }
107
+ else $selected = '';
108
+ $css_name = esc_attr($css_name);
109
+ echo "\n\t<option value=\"$key\" $selected>$css_name</option>";
110
+ }
111
+ ?>
112
+ </select>
113
+ <input class="button" type="submit" name="activate" value="<?php _e('Activate','nggallery') ?> &raquo;" class="button" />
114
+ </form>
115
+ <?php endif; ?>
116
+ </div>
117
+ <br style="clear: both;"/>
118
+
119
+ <?php if (!is_multisite() || wpmu_site_admin() ) { ?>
120
+ <div class="tablenav">
121
+ <?php
122
+ if ( is_writeable($real_file) ) {
123
+ echo '<big>' . sprintf(__('Editing <strong>%s</strong>','nggallery'), $file_show) . '</big>';
124
+ } else {
125
+ echo '<big>' . sprintf(__('Browsing <strong>%s</strong>','nggallery'), $file_show) . '</big>';
126
+ }
127
+ ?>
128
+ </div>
129
+ <br style="clear: both;"/>
130
+
131
+ <div id="templateside">
132
+ <?php if (!$theme_css_exists) : ?>
133
+ <ul>
134
+ <li><strong><?php _e('Author','nggallery') ?> :</strong> <?php echo $act_css_author ?></li>
135
+ <li><strong><?php _e('Version','nggallery') ?> :</strong> <?php echo $act_css_version ?></li>
136
+ <li><strong><?php _e('Description','nggallery') ?> :<br /></strong> <?php echo $act_css_description ?></li>
137
+ </ul>
138
+ <p><?php _e('Tip : Copy your stylesheet (nggallery.css) to your theme folder, so it will be not lost during a upgrade','nggallery') ?></p>
139
+ <?php else: ?>
140
+ <p><?php _e('Your theme contain a NextCellent Gallery stylesheet (nggallery.css), this file will be used','nggallery') ?></p>
141
+ <?php endif; ?>
142
+ <p><?php _e('Tip No. 2: Use the color picker below to help you find the right color scheme for your gallery!','nggallery') ?></p>
143
+ <div id="colorSelector">
144
+ <div></div>
145
+ </div>
146
+ </div>
147
+ <?php
148
+ if (!$error) {
149
+ ?>
150
+ <form name="template" id="template" method="post">
151
+ <?php wp_nonce_field('ngg_style') ?>
152
+ <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress css"><?php echo $content ?></textarea>
153
+ <input type="hidden" name="updatecss" value="updatecss" />
154
+ <input type="hidden" name="file" value="<?php echo $file_show ?>" />
155
+ </div>
156
+ <?php if ( is_writeable($real_file) ) : ?>
157
+ <p class="submit">
158
+ <input class="button-primary action" type="submit" name="submit" value="<?php _e('Update File','nggallery') ?>" tabindex="2" />
159
+ </p>
160
+ <?php else : ?>
161
+ <p><em><?php _e('If this file were writable you could edit it.','nggallery'); ?></em></p>
162
+ <?php endif; ?>
163
+ </form>
164
+ <?php
165
+ } else {
166
+ echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.','nggallery') . '</p></div>';
167
+ }
168
+ ?>
169
+ <div class="clear"> &nbsp; </div>
170
+ </div> <!-- wrap-->
171
+
172
+ <?php
173
+ }
174
+
175
+ } // END nggallery_admin_style()
176
+
177
+ /**********************************************************/
178
+ // ### Code from wordpress plugin import
179
+ // read in the css files
180
+ function ngg_get_cssfiles() {
181
+ global $cssfiles;
182
+
183
+ if (isset ($cssfiles)) {
184
+ return $cssfiles;
185
+ }
186
+
187
+ $cssfiles = array ();
188
+
189
+ // Files in wp-content/plugins/nggallery/css directory
190
+ $plugin_root = NGGALLERY_ABSPATH . "css";
191
+
192
+ $plugins_dir = @ dir($plugin_root);
193
+ if ($plugins_dir) {
194
+ while (($file = $plugins_dir->read()) !== false) {
195
+ if (preg_match('|^\.+$|', $file))
196
+ continue;
197
+ if (is_dir($plugin_root.'/'.$file)) {
198
+ $plugins_subdir = @ dir($plugin_root.'/'.$file);
199
+ if ($plugins_subdir) {
200
+ while (($subfile = $plugins_subdir->read()) !== false) {
201
+ if (preg_match('|^\.+$|', $subfile))
202
+ continue;
203
+ if (preg_match('|\.css$|', $subfile))
204
+ $plugin_files[] = "$file/$subfile";
205
+ }
206
+ }
207
+ } else {
208
+ if (preg_match('|\.css$|', $file))
209
+ $plugin_files[] = $file;
210
+ }
211
+ }
212
+ }
213
+
214
+ if ( !$plugins_dir || !$plugin_files )
215
+ return $cssfiles;
216
+
217
+ foreach ( $plugin_files as $plugin_file ) {
218
+ if ( !is_readable("$plugin_root/$plugin_file"))
219
+ continue;
220
+
221
+ $plugin_data = ngg_get_cssfiles_data("$plugin_root/$plugin_file");
222
+
223
+ if ( empty ($plugin_data['Name']) )
224
+ continue;
225
+
226
+ $cssfiles[plugin_basename($plugin_file)] = $plugin_data;
227
+ }
228
+
229
+ uasort($cssfiles, create_function('$a, $b', 'return strnatcasecmp($a["Name"], $b["Name"]);'));
230
+
231
+ return $cssfiles;
232
+ }
233
+
234
+ // parse the Header information
235
+ function ngg_get_cssfiles_data($plugin_file) {
236
+ $plugin_data = implode('', file($plugin_file));
237
+ preg_match("|CSS Name:(.*)|i", $plugin_data, $plugin_name);
238
+ preg_match("|Description:(.*)|i", $plugin_data, $description);
239
+ preg_match("|Author:(.*)|i", $plugin_data, $author_name);
240
+ if (preg_match("|Version:(.*)|i", $plugin_data, $version))
241
+ $version = trim($version[1]);
242
+ else
243
+ $version = '';
244
+
245
+ $description = wptexturize(trim($description[1]));
246
+
247
+ $name = trim($plugin_name[1]);
248
+ $author = trim($author_name[1]);
249
+
250
+ return array ('Name' => $name, 'Description' => $description, 'Author' => $author, 'Version' => $version );
251
+ }
252
+ ?>
admin/tags.php ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Tag management page. Inspired from the Simple Tags plugin by Amaury Balmer.
4
+ * http://code.google.com/p/simple-tags/
5
+ */
6
+
7
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
8
+
9
+ $action_status = array('message' => '', 'status' => 'ok');
10
+
11
+ if ( isset($_POST['tag_action']) ) {
12
+
13
+ check_admin_referer('nggallery_admin_tags');
14
+
15
+ if ( $_POST['tag_action'] == 'renametag' ) {
16
+ $oldtag = (isset($_POST['renametag_old'])) ? $_POST['renametag_old'] : '';
17
+ $newtag = (isset($_POST['renametag_new'])) ? $_POST['renametag_new'] : '';
18
+ $action_status = nggTags::rename_tags( $oldtag, $newtag );
19
+ } elseif ( $_POST['tag_action'] == 'deletetag' ) {
20
+ $todelete = (isset($_POST['deletetag_name'])) ? $_POST['deletetag_name'] : '';
21
+ $action_status = nggTags::delete_tags( $todelete );
22
+ } elseif ( $_POST['tag_action'] == 'editslug' ) {
23
+ $matchtag = (isset($_POST['tagname_match'])) ? $_POST['tagname_match'] : '';
24
+ $newslug = (isset($_POST['tagslug_new'])) ? $_POST['tagslug_new'] : '';
25
+ $action_status = nggTags::edit_tag_slug( $matchtag, $newslug );
26
+ }
27
+ }
28
+
29
+ // Som useful variables
30
+ $admin_base_url = admin_url() . 'admin.php?page=nggallery-tags';
31
+ $nb_tags = 50; // Number of tags to show on a single page
32
+
33
+ // Manage URL
34
+
35
+ $sort_order = ( isset($_GET['tag_sortorder']) ) ? esc_attr( stripslashes($_GET['tag_sortorder']) ) : 'desc';
36
+ $search_url = ( isset($_GET['search']) ) ? '&amp;search=' . esc_attr ( stripslashes($_GET['search']) ) : '';
37
+ $action_url = $admin_base_url . '&amp;tag_sortorder=' . $sort_order. $search_url;
38
+
39
+ // Tags Filters
40
+ $order_array = array(
41
+ 'desc' => __('Most popular', 'nggallery'),
42
+ 'asc' => __('Least used', 'nggallery'),
43
+ 'natural' => __('Alphabetical', 'nggallery'));
44
+
45
+ // Build Tags Param
46
+ $param = 'hide_empty=false';
47
+ switch ($sort_order) {
48
+ case 'natural' :
49
+ $param .= '&number='.$nb_tags.'&orderby=name&order=asc';
50
+ break;
51
+ case 'asc' :
52
+ $param .= '&number='.$nb_tags.'&orderby=count&order=asc';
53
+ break;
54
+ default :
55
+ $param .= '&number='.$nb_tags.'&orderby=count&order=desc';
56
+ break;
57
+ }
58
+
59
+
60
+ // Search
61
+ if ( !empty($_GET['search']) ) {
62
+ $search = stripslashes($_GET['search']);
63
+ $param .= '&name__like=' . $search;
64
+ }
65
+
66
+ // Offset
67
+ if ( !empty($_GET['offset']) ) {
68
+ $param .= '&offset=' . intval( $_GET['offset'] );
69
+ }
70
+
71
+ // Navigation urls
72
+ if ( empty($_GET['offset']) ) {
73
+ $offset = 0;
74
+ } else {
75
+ $offset = intval( $_GET['offset'] );
76
+ }
77
+
78
+ $tag_count = (int)wp_count_terms('ngg_tag', 'ignore_empty=true');
79
+
80
+ if ($offset + $nb_tags < $tag_count) {
81
+ $next_offset = '' . min($offset + $nb_tags, $tag_count - $nb_tags);
82
+ } else {
83
+ $next_offset = '';
84
+ }
85
+
86
+ if ($nb_tags < $tag_count && $offset>0) {
87
+ $prev_offset = '' . max($offset - $nb_tags, 0);
88
+ } else {
89
+ $prev_offset = '';
90
+ }
91
+
92
+ ?>
93
+ <style>
94
+ .disabled, .disabled:hover { border-color: #E5E5E5; color: #999999; cursor: default; }
95
+ </style>
96
+
97
+ <div class="wrap ngg_wrap">
98
+ <?php include('templates/social_media_buttons.php'); ?>
99
+ <?php screen_icon( 'nextgen-gallery' ); ?>
100
+ <h2><?php _e('Manage image tags', 'nggallery'); ?></h2>
101
+
102
+ <?php if ($action_status['message']!='') : ?>
103
+ <div id="message" class="<?php echo ($action_status['status']=='ok' ? 'updated' : $action_status['status']); ?> fade">
104
+ <p><strong><?php echo $action_status['message']; ?></strong></p>
105
+ </div>
106
+ <?php endif; ?>
107
+
108
+ <table>
109
+ <tr>
110
+ <td class="list_tags">
111
+ <fieldset class="options" id="taglist">
112
+ <h3><?php _e('Existing Tags', 'nggallery'); ?></h3>
113
+
114
+ <form method="get">
115
+ <p>
116
+ <label for="search"><?php _e('Search tags', 'nggallery'); ?></label><br />
117
+ <input type="hidden" name="page" value="<?php echo esc_attr( stripslashes($_GET['page']) ); ?>" />
118
+ <input type="hidden" name="tag_sortorder" value="<?php echo $sort_order; ?>" />
119
+ <input type="text" name="search" id="search" size="10" value="<?php if (isset($_GET['search'])) echo esc_attr( stripslashes($_GET['search']) ); ?>" />
120
+ <input class="button" type="submit" value="<?php _e('Go', 'nggallery'); ?>" />
121
+ </p>
122
+ </form>
123
+
124
+ <div class="sort_order">
125
+ <h3><?php _e('Sort Order:', 'nggallery'); ?></h3>
126
+ <?php
127
+ $output = array();
128
+ foreach( $order_array as $sort => $title ) {
129
+ $output[] = ($sort == $sort_order) ? '<span style="color: red;">'.$title.'</span>' : '<a href="'. $admin_base_url . '&amp;tag_sortorder=' . $sort . $search_url .'">'.$title.'</a>';
130
+ }
131
+ echo implode('<br />', $output);
132
+ $output = array();
133
+ unset($output);
134
+ ?>
135
+ </div>
136
+
137
+ <div id="ajax_area_tagslist">
138
+ <ul>
139
+ <?php
140
+ $tags = (array) nggTags::find_tags($param, true);
141
+ foreach( $tags as $tag ) {
142
+ //TODO:Tag link should be call a list of images in manage gallery
143
+ //echo '<li><span>' . $tag->name . '</span>&nbsp;<a href="'.(ngg_get_tag_link( $tag->term_id )).'" title="'.sprintf(__('View all images tagged with %s', 'nggallery'), $tag->name).'">('.$tag->count.')</a></li>'."\n";
144
+ echo '<li><span>' . esc_html( $tag->name ). '</span>&nbsp;'.'('. esc_html( $tag->count ).')</li>'."\n";
145
+
146
+ }
147
+ unset($tags);
148
+ ?>
149
+ </ul>
150
+
151
+ <?php if ( $prev_offset!='' || $next_offset!='' ) : ?>
152
+ <div class="navigation">
153
+
154
+ <?php if ($prev_offset!='') { ?>
155
+ <form method="get" style="display: inline;">
156
+ <span>
157
+ <input type="hidden" name="page" value="<?php echo esc_attr( stripslashes($_GET['page']) ); ?>" />
158
+ <input type="hidden" name="tag_sortorder" value="<?php echo $sort_order; ?>" />
159
+ <input type="hidden" name="offset" value="<?php echo $prev_offset; ?>" />
160
+ <input class="button" type="submit" value="&laquo; <?php _e('Previous tags', 'nggallery'); ?>" />
161
+ </span>
162
+ </form>
163
+ <?php } else { ?>
164
+ <span><span class="button disabled">&laquo; <?php _e('Previous tags', 'nggallery'); ?></span></span>
165
+ <?php } ?>
166
+
167
+ <?php if ($next_offset!='') { ?>
168
+ <form method="get" style="display: inline;">
169
+ <span>
170
+ <input type="hidden" name="page" value="<?php echo esc_attr( stripslashes($_GET['page']) ); ?>" />
171
+ <input type="hidden" name="tag_sortorder" value="<?php echo $sort_order; ?>" />
172
+ <input type="hidden" name="offset" value="<?php echo $next_offset; ?>" />
173
+ <input class="button" type="submit" value="<?php _e('Next tags', 'nggallery'); ?> &raquo;" />
174
+ </span>
175
+ </form>
176
+ <?php } else { ?>
177
+ <span><span class="button disabled"><?php _e('Previous tags', 'nggallery'); ?> &raquo;</span></span>
178
+ <?php } ?>
179
+ </div>
180
+ <?php endif; ?>
181
+ </div>
182
+ </fieldset>
183
+ </td>
184
+ <td class="forms_manage">
185
+ <h3><?php _e('Rename Tag', 'nggallery'); ?></h3>
186
+ <form action="<?php echo $action_url; ?>" method="post">
187
+ <input type="hidden" name="tag_action" value="renametag" />
188
+ <?php wp_nonce_field('nggallery_admin_tags'); ?>
189
+
190
+ <table class="form-table">
191
+ <tr valign="top">
192
+ <td colspan="2">
193
+ <p><?php _e('Enter the tag to rename and its new value. You can use this feature to merge tags too. Click "Rename" and all posts which use this tag will be updated.', 'nggallery'); ?></p>
194
+ <p><?php _e('You can specify multiple tags to rename by separating them with commas.', 'nggallery'); ?></p>
195
+ </td>
196
+ </tr>
197
+ <tr valign="top">
198
+ <th scope="row"><label for="renametag_old"><?php _e('Tag(s) to rename:', 'nggallery'); ?></label></th>
199
+ <td><input type="text" id="renametag_old" name="renametag_old" value="" size="40" /></td>
200
+ </tr>
201
+ <tr valign="top">
202
+ <th scope="row"><label for="renametag_new"><?php _e('New tag name(s):', 'nggallery'); ?></label></th>
203
+ <td>
204
+ <input type="text" id="renametag_new" name="renametag_new" value="" size="40" />
205
+ <input class="button" type="submit" name="rename" value="<?php _e('Rename', 'nggallery'); ?>" />
206
+ </td>
207
+ </tr>
208
+ </table>
209
+ </form>
210
+
211
+ <h3><?php _e('Delete Tag', 'nggallery'); ?></h3>
212
+ <form action="<?php echo $action_url; ?>" method="post">
213
+ <input type="hidden" name="tag_action" value="deletetag" />
214
+ <?php wp_nonce_field('nggallery_admin_tags'); ?>
215
+
216
+ <table class="form-table">
217
+ <tr valign="top">
218
+ <td colspan="2">
219
+ <p><?php _e('Enter the name of the tag to delete. This tag will be removed from all posts.', 'nggallery'); ?></p>
220
+ <p><?php _e('You can specify multiple tags to delete by separating them with commas', 'nggallery'); ?>.</p>
221
+ </td>
222
+ </tr>
223
+ <tr valign="top">
224
+ <th scope="row"><label for="deletetag_name"><?php _e('Tag(s) to delete:', 'nggallery'); ?></label></th>
225
+ <td>
226
+ <input type="text" id="deletetag_name" name="deletetag_name" value="" size="40" />
227
+ <input class="button" type="submit" name="delete" value="<?php _e('Delete', 'nggallery'); ?>" />
228
+ </td>
229
+ </tr>
230
+ </table>
231
+ </form>
232
+
233
+ <h3><?php _e('Edit Tag Slug', 'nggallery'); ?></h3>
234
+ <form action="<?php echo $action_url; ?>" method="post">
235
+ <input type="hidden" name="tag_action" value="editslug" />
236
+ <?php wp_nonce_field('nggallery_admin_tags'); ?>
237
+
238
+ <table class="form-table">
239
+ <tr valign="top">
240
+ <td colspan="2">
241
+ <p><?php _e('Enter the tag name to edit and its new slug. <a href="http://codex.wordpress.org/Glossary#Slug">Slug definition</a>', 'nggallery'); ?></p>
242
+ <p><?php _e('You can specify multiple tags to rename by separating them with commas.', 'nggallery'); ?></p>
243
+ </td>
244
+ </tr>
245
+ <tr valign="top">
246
+ <th scope="row"><label for="tagname_match"><?php _e('Tag(s) to match:', 'nggallery'); ?></label></th>
247
+ <td><input type="text" id="tagname_match" name="tagname_match" value="" size="40" /></td>
248
+ </tr>
249
+ <tr valign="top">
250
+ <th scope="row"><label for="tagslug_new"><?php _e('Slug(s) to set:', 'nggallery'); ?></label></th>
251
+ <td>
252
+ <input type="text" id="tagslug_new" name="tagslug_new" value="" size="40" />
253
+ <input class="button" type="submit" name="edit" value="<?php _e('Edit', 'nggallery'); ?>" />
254
+ </td>
255
+ </tr>
256
+ </table>
257
+ </form>
258
+ </td>
259
+ </tr>
260
+ </table>
261
+ <script type="text/javascript">
262
+ // <![CDATA[
263
+ // Register onclick event
264
+ function registerClick() {
265
+ jQuery('#taglist ul li span').bind("click", function(){
266
+ addTag(this.innerHTML, "renametag_old");
267
+ addTag(this.innerHTML, "deletetag_name");
268
+ addTag(this.innerHTML, "tagname_match");
269
+ });
270
+ }
271
+
272
+ // Register initial event
273
+ jQuery(document).ready(function() {
274
+ registerClick();
275
+ });
276
+
277
+ // Add tag into input
278
+ function addTag( tag, name_element ) {
279
+ var input_element = document.getElementById( name_element );
280
+
281
+ if ( input_element.value.length > 0 && !input_element.value.match(/,\s*$/) )
282
+ input_element.value += ", ";
283
+
284
+ var re = new RegExp(tag + ",");
285
+ if ( !input_element.value.match(re) )
286
+ input_element.value += tag + ", ";
287
+
288
+ return true;
289
+ }
290
+ // ]]>
291
+ </script>
292
+ </div>
admin/templates/facebook_like_button.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <div id="fb-root"></div>
2
+ <div id="ngg_facebook_like" class="fb-like" data-href="http://www.facebook.com/nextgengallery" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
admin/templates/social_media_buttons.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <div id="ngg_social_media">
2
+ <?php include('twitter_follow_link.php'); ?>
3
+ <?php include('facebook_like_button.php'); ?>
4
+ </div>
admin/templates/twitter_follow_link.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <a
2
+ href='https://twitter.com/NextGENGallery'
3
+ id="ngg_twitter_follow"
4
+ class='twitter-follow-button'
5
+ data-show-count='false'
6
+ data-lang='en'>
7
+ Follow @NextGENGallery
8
+ </a>
admin/tinymce/editor_plugin.js ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Docu : http://wiki.moxiecode.com/index.php/TinyMCE:Create_plugin/3.x#Creating_your_own_plugins
2
+
3
+ (function() {
4
+ // Load plugin specific language pack
5
+ tinymce.PluginManager.requireLangPack('NextGEN');
6
+
7
+ tinymce.create('tinymce.plugins.NextGEN', {
8
+ /**
9
+ * Initializes the plugin, this will be executed after the plugin has been created.
10
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
11
+ * of the editor instance to intercept that event.
12
+ *
13
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
14
+ * @param {string} url Absolute URL to where the plugin is located.
15
+ */
16
+ init : function(ed, url) {
17
+ // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
18
+
19
+ ed.addCommand('mceNextGEN', function() {
20
+ ed.windowManager.open({
21
+ // call content via admin-ajax, no need to know the full plugin path
22
+ file : ajaxurl + '?action=ngg_tinymce',
23
+ width : 360 + ed.getLang('NextGEN.delta_width', 0),
24
+ height : 210 + ed.getLang('NextGEN.delta_height', 0),
25
+ inline : 1
26
+ }, {
27
+ plugin_url : url // Plugin absolute URL
28
+ });
29
+ });
30
+
31
+ // Register example button
32
+ ed.addButton('NextGEN', {
33
+ title : 'NextGEN.desc',
34
+ cmd : 'mceNextGEN',
35
+ image : url + '/nextgen.gif'
36
+ });
37
+
38
+ // Add a node change handler, selects the button in the UI when a image is selected
39
+ ed.onNodeChange.add(function(ed, cm, n) {
40
+ cm.setActive('NextGEN', n.nodeName == 'IMG');
41
+ });
42
+ },
43
+
44
+ /**
45
+ * Creates control instances based in the incomming name. This method is normally not
46
+ * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
47
+ * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
48
+ * method can be used to create those.
49
+ *
50
+ * @param {String} n Name of the control to create.
51
+ * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
52
+ * @return {tinymce.ui.Control} New control instance or null if no control was created.
53
+ */
54
+ createControl : function(n, cm) {
55
+ return null;
56
+ },
57
+
58
+ /**
59
+ * Returns information about the plugin as a name/value array.
60
+ * The current keys are longname, author, authorurl, infourl and version.
61
+ *
62
+ * @return {Object} Name/value array containing information about the plugin.
63
+ */
64
+ getInfo : function() {
65
+ return {
66
+ longname : 'NextGEN',
67
+ author : 'Photocrati',
68
+ authorurl : 'http://www.photocrati.com/',
69
+ infourl : 'http://www.nextgen-gallery.com/',
70
+ version : "2.0"
71
+ };
72
+ }
73
+ });
74
+
75
+ // Register plugin
76
+ tinymce.PluginManager.add('NextGEN', tinymce.plugins.NextGEN);
77
+ })();
admin/tinymce/langs/de.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ // German lang variables for WP2.5
2
+
3
+ tinyMCE.addI18n({de:{
4
+ NextGEN:{
5
+ desc : 'NextCellent Gallery hinzufuegen'
6
+ }}});
admin/tinymce/langs/de_de.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ // German lang variables for WP2.5
2
+
3
+ tinyMCE.addI18n({de:{
4
+ NextGEN:{
5
+ desc : 'NextCellent Gallery hinzufuegen'
6
+ }}});
admin/tinymce/langs/en.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ // English lang variables for WP2.5
2
+
3
+ tinyMCE.addI18n({en:{
4
+ NextGEN:{
5
+ desc : 'Add NextCellent Gallery'
6
+ }}});
admin/tinymce/langs/en_US.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ // English lang variables for WP2.5
2
+
3
+ tinyMCE.addI18n({en_US:{
4
+ NextGEN:{
5
+ desc : 'Add NextCellent Gallery'
6
+ }}});
admin/tinymce/nextgen.gif ADDED
Binary file
admin/tinymce/tinymce.js ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function init() {
2
+ tinyMCEPopup.resizeToInnerSize();
3
+ }
4
+
5
+ function getCheckedValue(radioObj) {
6
+ if(!radioObj)
7
+ return "";
8
+ var radioLength = radioObj.length;
9
+ if(radioLength == undefined)
10
+ if(radioObj.checked)
11
+ return radioObj.value;
12
+ else
13
+ return "";
14
+ for(var i = 0; i < radioLength; i++) {
15
+ if(radioObj[i].checked) {
16
+ return radioObj[i].value;
17
+ }
18
+ }
19
+ return "";
20
+ }
21
+
22
+ function insertNGGLink() {
23
+
24
+ var tagtext;
25
+
26
+ var gallery = document.getElementById('gallery_panel');
27
+ var album = document.getElementById('album_panel');
28
+ var singlepic = document.getElementById('singlepic_panel');
29
+
30
+ // who is active ?
31
+ if (gallery.className.indexOf('current') != -1) {
32
+ var galleryid = document.getElementById('gallerytag').value;
33
+ var showtype = getCheckedValue(document.getElementsByName('showtype'));
34
+ if (galleryid != 0 )
35
+ tagtext = "["+ showtype + " id=" + galleryid + "]";
36
+ else
37
+ tinyMCEPopup.close();
38
+ }
39
+
40
+ if (album.className.indexOf('current') != -1) {
41
+ var albumid = document.getElementById('albumtag').value;
42
+ var showtype = getCheckedValue(document.getElementsByName('albumtype'));
43
+ if (albumid != 0 )
44
+ tagtext = "[nggalbum id=" + albumid + " template=" + showtype + "]";
45
+ else
46
+ tinyMCEPopup.close();
47
+ }
48
+
49
+ if (singlepic.className.indexOf('current') != -1) {
50
+ var singlepicid = document.getElementById('singlepictag').value;
51
+ var imgWidth = document.getElementById('imgWidth').value;
52
+ var imgHeight = document.getElementById('imgHeight').value;
53
+ var imgeffect = document.getElementById('imgeffect').value;
54
+ var imgfloat = document.getElementById('imgfloat').value;
55
+
56
+ if (singlepicid != 0 ) {
57
+ if (imgeffect == "none")
58
+ tagtext = "[singlepic id=" + singlepicid + " w=" + imgWidth + " h=" + imgHeight + " float=" + imgfloat + "]";
59
+ else
60
+ tagtext = "[singlepic id=" + singlepicid + " w=" + imgWidth + " h=" + imgHeight + " mode=" + imgeffect + " float=" + imgfloat + "]";
61
+ } else {
62
+ tinyMCEPopup.close();
63
+ }
64
+ }
65
+
66
+ if(window.tinyMCE) {
67
+ window.tinyMCE.execInstanceCommand(window.tinyMCE.activeEditor.id, 'mceInsertContent', false, tagtext);
68
+ //Peforms a clean up of the current editor HTML.
69
+ //tinyMCEPopup.editor.execCommand('mceCleanup');
70
+ //Repaints the editor. Sometimes the browser has graphic glitches.
71
+ tinyMCEPopup.editor.execCommand('mceRepaint');
72
+ tinyMCEPopup.close();
73
+ }
74
+ return;
75
+ }
admin/tinymce/tinymce.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * add_nextgen_button
5
+ *
6
+ * @package NextGEN Gallery
7
+ * @title TinyMCE V3 Button Integration (for WP2.5 and higher)
8
+ * @author Alex Rabe
9
+ *
10
+ * @access public
11
+ */
12
+ class add_nextgen_button {
13
+
14
+ var $pluginname = 'NextGEN';
15
+ var $path = '';
16
+ var $internalVersion = 200;
17
+
18
+ /**
19
+ * add_nextgen_button::add_nextgen_button()
20
+ * the constructor
21
+ *
22
+ * @return void
23
+ */
24
+ function add_nextgen_button() {
25
+
26
+ // Set path to editor_plugin.js
27
+ $this->path = NGGALLERY_URLPATH . 'admin/tinymce/';
28
+
29
+ // Modify the version when tinyMCE plugins are changed.
30
+ add_filter('tiny_mce_version', array (&$this, 'change_tinymce_version') );
31
+
32
+ // init process for button control
33
+ add_action('init', array (&$this, 'addbuttons') );
34
+ }
35
+
36
+ /**
37
+ * add_nextgen_button::addbuttons()
38
+ *
39
+ * @return void
40
+ */
41
+ function addbuttons() {
42
+
43
+ // Don't bother doing this stuff if the current user lacks permissions
44
+ if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') )
45
+ return;
46
+
47
+ // Check for NextGEN capability
48
+ if ( !current_user_can('NextGEN Use TinyMCE') )
49
+ return;
50
+
51
+ // Add only in Rich Editor mode
52
+ if ( get_user_option('rich_editing') == 'true') {
53
+
54
+ // add the button for wp2.5 in a new way
55
+ add_filter("mce_external_plugins", array (&$this, 'add_tinymce_plugin' ), 5);
56
+ add_filter('mce_buttons', array (&$this, 'register_button' ), 5);
57
+ }
58
+ }
59
+
60
+ /**
61
+ * add_nextgen_button::register_button()
62
+ * used to insert button in wordpress 2.5x editor
63
+ *
64
+ * @return $buttons
65
+ */
66
+ function register_button($buttons) {
67
+
68
+ array_push($buttons, 'separator', $this->pluginname );
69
+
70
+ return $buttons;
71
+ }
72
+
73
+ /**
74
+ * add_nextgen_button::add_tinymce_plugin()
75
+ * Load the TinyMCE plugin : editor_plugin.js
76
+ *
77
+ * @return $plugin_array
78
+ */
79
+ function add_tinymce_plugin($plugin_array) {
80
+
81
+ $plugin_array[$this->pluginname] = $this->path . 'editor_plugin.js';
82
+
83
+ return $plugin_array;
84
+ }
85
+
86
+ /**
87
+ * add_nextgen_button::change_tinymce_version()
88
+ * A different version will rebuild the cache
89
+ *
90
+ * @return $versio
91
+ */
92
+ function change_tinymce_version($version) {
93
+ $version = $version + $this->internalVersion;
94
+ return $version;
95
+ }
96
+
97
+ }
98
+
99
+ // Call it now
100
+ $tinymce_button = new add_nextgen_button ();
101
+
102
+ ?>
admin/tinymce/window.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( !defined('ABSPATH') )
4
+ die('You are not allowed to call this page directly.');
5
+
6
+ global $wpdb, $nggdb;
7
+
8
+ @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
9
+
10
+ // Get WordPress scripts and styles
11
+ wp_enqueue_script('jquery-ui-core');
12
+ wp_enqueue_script('jquery-ui-widget');
13
+ wp_enqueue_script('jquery-ui-position');
14
+ global $wp_scripts;
15
+ if (!isset($wp_scripts->registered['jquery-ui-autocomplete'])) {
16
+ wp_register_script( 'jquery-ui-autocomplete', NGGALLERY_URLPATH .'admin/js/jquery.ui.autocomplete.min.js', array('jquery-ui-core'), '1.8.15');
17
+ }
18
+ wp_enqueue_script('jquery-ui-autocomplete');
19
+ ?>
20
+ <html xmlns="http://www.w3.org/1999/xhtml">
21
+ <head>
22
+ <title>NextCellent Gallery</title>
23
+ <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
24
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
25
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
26
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
27
+ <?php wp_print_scripts() ?>
28
+ <script language="javascript" type="text/javascript" src="<?php echo NGGALLERY_URLPATH ?>admin/js/ngg.autocomplete.js"></script>
29
+ <script language="javascript" type="text/javascript" src="<?php echo NGGALLERY_URLPATH ?>admin/tinymce/tinymce.js"></script>
30
+ <link rel="stylesheet" type="text/css" href="<?php echo NGGALLERY_URLPATH ?>admin/css/jquery.ui.css" media="all" />
31
+ <base target="_self" />
32
+ </head>
33
+ <script type="text/javascript">
34
+ jQuery(document).ready(function(){
35
+ jQuery("#gallerytag").nggAutocomplete( {
36
+ type: 'gallery',domain: "<?php echo home_url('index.php', is_ssl() ? 'https' : 'http'); ?>"
37
+ });
38
+ jQuery("#albumtag").nggAutocomplete( {
39
+ type: 'album',domain: "<?php echo home_url('index.php', is_ssl() ? 'https' : 'http'); ?>"
40
+ });
41
+ jQuery("#singlepictag").nggAutocomplete( {
42
+ type: 'image',domain: "<?php echo home_url('index.php', is_ssl() ? 'https' : 'http'); ?>"
43
+ });
44
+ });
45
+ </script>
46
+ <body class="nextgen_tinymce_window" id="link" onload="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';" style="display: none">
47
+ <!-- <form onsubmit="insertLink();return false;" action="#"> -->
48
+ <form name="NextGEN" action="#">
49
+ <div class="tabs">
50
+ <ul>
51
+ <li id="gallery_tab" class="current"><span><a href="javascript:mcTabs.displayTab('gallery_tab','gallery_panel');" onmousedown="return false;"><?php echo _n( 'Gallery', 'Galleries', 1, 'nggallery' ) ?></a></span></li>
52
+ <li id="album_tab"><span><a href="javascript:mcTabs.displayTab('album_tab','album_panel');" onmousedown="return false;"><?php echo _n( 'Album', 'Albums', 1, 'nggallery' ) ?></a></span></li>
53
+ <li id="singlepic_tab"><span><a href="javascript:mcTabs.displayTab('singlepic_tab','singlepic_panel');" onmousedown="return false;"><?php _e('Picture', 'nggallery'); ?></a></span></li>
54
+ </ul>
55
+ </div>
56
+
57
+ <div class="panel_wrapper">
58
+ <!-- gallery panel -->
59
+ <div id="gallery_panel" class="panel current">
60
+ <br />
61
+ <table border="0" cellpadding="4" cellspacing="0">
62
+ <tr>
63
+ <td nowrap="nowrap"><label for="gallerytag"><?php _e("Gallery", 'nggallery'); ?></label></td>
64
+ <td><select id="gallerytag" name="gallerytag" style="width: 200px">
65
+ <option value="0" selected="selected"><?php _e("Select or enter gallery", 'nggallery'); ?></option>
66
+ </select>
67
+ </td>
68
+ </tr>
69
+ <tr>
70
+ <td nowrap="nowrap" valign="top"><label for="showtype"><?php _e("Show as", 'nggallery'); ?></label></td>
71
+ <td><label><input name="showtype" type="radio" value="nggallery" checked="checked" /> <?php _e('Image list', 'nggallery') ;?></label><br />
72
+ <label><input name="showtype" type="radio" value="slideshow" /> <?php _e('Slideshow', 'nggallery') ;?></label><br />
73
+ <label><input name="showtype" type="radio" value="imagebrowser" /> <?php _e('Imagebrowser', 'nggallery') ;?></label></td>
74
+ </tr>
75
+ </table>
76
+ </div>
77
+ <!-- gallery panel -->
78
+
79
+ <!-- album panel -->
80
+ <div id="album_panel" class="panel">
81
+ <br />
82
+ <table border="0" cellpadding="4" cellspacing="0">
83
+ <tr>
84
+ <td nowrap="nowrap"><label for="albumtag"><?php _e("Album", 'nggallery'); ?></label></td>
85
+ <td><select id="albumtag" name="albumtag" style="width: 200px">
86
+ <option value="0" selected="selected"><?php _e("Select or enter album", 'nggallery'); ?></option>
87
+ </select>
88
+ </td>
89
+ </tr>
90
+ <tr>
91
+ <td nowrap="nowrap" valign="top"><label for="showtype"><?php _e("Show as", 'nggallery'); ?></label></td>
92
+ <td><label><input name="albumtype" type="radio" value="extend" checked="checked" /> <?php _e('Extended version', 'nggallery') ;?></label><br />
93
+ <label><input name="albumtype" type="radio" value="compact" /> <?php _e('Compact version', 'nggallery') ;?></label></td>
94
+ </tr>
95
+ </table>
96
+ </div>
97
+ <!-- album panel -->
98
+
99
+ <!-- single pic panel -->
100
+ <div id="singlepic_panel" class="panel">
101
+ <br />
102
+ <table border="0" cellpadding="4" cellspacing="0">
103
+ <tr>
104
+ <td nowrap="nowrap"><label for="singlepictag"><?php _e("Picture", 'nggallery'); ?></label></td>
105
+ <td><select id="singlepictag" name="singlepictag" style="width: 200px">
106
+ <option value="0" selected="selected"><?php _e("Select or enter picture", 'nggallery'); ?></option>
107
+ </select>
108
+ </td>
109
+ </tr>
110
+ <tr>
111
+ <td nowrap="nowrap"><?php _e("Width x Height", 'nggallery'); ?></td>
112
+ <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>
113
+ </tr>
114
+ <tr>
115
+ <td nowrap="nowrap" valign="top"><?php _e("Effect", 'nggallery'); ?></td>
116
+ <td>
117
+ <label><select id="imgeffect" name="imgeffect">
118
+ <option value="none"><?php _e("No effect", 'nggallery'); ?></option>
119
+ <option value="watermark"><?php _e("Watermark", 'nggallery'); ?></option>
120
+ <option value="web20"><?php _e("Web 2.0", 'nggallery'); ?></option>
121
+ </select></label>
122
+ </td>
123
+ </tr>
124
+ <tr>
125
+ <td nowrap="nowrap" valign="top"><?php _e("Float", 'nggallery'); ?></td>
126
+ <td>
127
+ <label><select id="imgfloat" name="imgfloat">
128
+ <option value=""><?php _e("No float", 'nggallery'); ?></option>
129
+ <option value="left"><?php _e("Left", 'nggallery'); ?></option>
130
+ <option value="center"><?php _e("Center", 'nggallery'); ?></option>
131
+ <option value="right"><?php _e("Right", 'nggallery'); ?></option>
132
+ </select></label>
133
+ </td>
134
+ </tr>
135
+
136
+ </table>
137
+ </div>
138
+ <!-- single pic panel -->
139
+ </div>
140
+
141
+ <div class="mceActionPanel">
142
+ <div style="float: left">
143
+ <input type="button" id="cancel" name="cancel" value="<?php _e("Cancel", 'nggallery'); ?>" onclick="tinyMCEPopup.close();" />
144
+ </div>
145
+
146
+ <div style="float: right">
147
+ <input type="submit" id="insert" name="insert" value="<?php _e("Insert", 'nggallery'); ?>" onclick="insertNGGLink();" />
148
+ </div>
149
+ </div>
150
+ </form>
151
+ </body>
152
+ </html>
admin/upload.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Accepts file uploads from swfupload.
4
+ *
5
+ * @package NextGEN-Gallery
6
+ * @subpackage Administration
7
+ */
8
+
9
+ // Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead
10
+ // We then have to validate the cookie manually. NOTE: WordPress functions, like
11
+ // get_current_user_id() and the like are NOT available in this file.
12
+ if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
13
+ $_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie'];
14
+ elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
15
+ $_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
16
+ if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) )
17
+ $_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie'];
18
+
19
+ header('Content-Type: text/plain; charset=' . get_option('blog_charset'));
20
+
21
+ $logged_in = FALSE;
22
+
23
+ if (wp_validate_auth_cookie()) {
24
+ $results = wp_parse_auth_cookie();
25
+ if (isset($results['username']) && isset($results['expiration'])) {
26
+ if (time() < floatval($results['expiration'])) {
27
+ if (($userdata = get_user_by('login', $results['username'])))
28
+ $logged_in = $userdata->ID;
29
+ }
30
+ }
31
+ }
32
+
33
+ if (!$logged_in)
34
+ die("Login failure. -1");
35
+ else if (!user_can($logged_in, 'NextGEN Upload images'))
36
+ die('You do not have permission to upload files. -2');
37
+
38
+ //check for nggallery
39
+ if ( !defined('NGGALLERY_ABSPATH') )
40
+ die('NextCellent Gallery not available. -3');
41
+
42
+ include_once (NGGALLERY_ABSPATH. 'admin/functions.php');
43
+
44
+ // get the gallery
45
+ $galleryID = (int) $_POST['galleryselect'];
46
+
47
+ echo nggAdmin::swfupload_image($galleryID);
48
+
49
+ ?>
admin/wpmu.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ function nggallery_wpmu_setup() {
5
+
6
+ //to be sure
7
+ if ( !is_super_admin() )
8
+ die('You are not allowed to call this page.');
9
+
10
+ $messagetext = '';
11
+
12
+ // get the options
13
+ $ngg_options = get_site_option('ngg_options');
14
+
15
+ if ( isset($_POST['updateoption']) ) {
16
+ check_admin_referer('ngg_wpmu_settings');
17
+ // get the hidden option fields, taken from WP core
18
+ if ( $_POST['page_options'] )
19
+ $options = explode(',', stripslashes($_POST['page_options']));
20
+ if ($options) {
21
+ foreach ($options as $option) {
22
+ $option = trim($option);
23
+ $value = isset($_POST[$option]) ? trim($_POST[$option]) : false;
24
+ // $value = sanitize_option($option, $value); // This does strip slashes on those that need it
25
+ $ngg_options[$option] = $value;
26
+ }
27
+ }
28
+
29
+ // the path should always end with a slash
30
+ $ngg_options['gallerypath'] = trailingslashit($ngg_options['gallerypath']);
31
+ update_site_option('ngg_options', $ngg_options);
32
+
33
+ $messagetext = __('Update successfully','nggallery');
34
+ }
35
+
36
+ // Show donation message only one time.
37
+ if (isset ( $_GET['hideSupportInfo']) ) {
38
+ $ngg_options['hideSupportInfo'] = true;
39
+ update_site_option('ngg_options', $ngg_options);
40
+ }
41
+
42
+ // message windows
43
+ if( !empty($messagetext) ) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$messagetext.'</p></div>'; }
44
+
45
+ ?>
46
+
47
+ <div class="wrap">
48
+ <h2><?php _e('Network Options','nggallery'); ?></h2>
49
+ <form name="generaloptions" method="post">
50
+ <?php wp_nonce_field('ngg_wpmu_settings') ?>
51
+ <input type="hidden" name="page_options" value="gallerypath,wpmuQuotaCheck,wpmuZipUpload,wpmuImportFolder,wpmuStyle,wpmuRoles,wpmuCSSfile" />
52
+ <table class="form-table">
53
+ <tr valign="top">
54
+ <th align="left"><?php _e('Gallery path','nggallery') ?></th>
55
+ <td><input type="text" size="50" name="gallerypath" value="<?php echo $ngg_options['gallerypath']; ?>" /><br />
56
+ <?php _e('This is the default path for all blogs. With the placeholder %BLOG_ID% you can organize the folder structure better.','nggallery') ?>
57
+ <?php echo str_replace('%s', '<code>wp-content/blogs.dir/%BLOG_ID%/files/</code>', __('The default setting should be %s', 'nggallery')); ?>
58
+ </td>
59
+ </tr>
60
+ <tr>
61
+ <th valign="top"><?php _e('Enable upload quota check','nggallery') ?>:</th>
62
+ <td><input name="wpmuQuotaCheck" type="checkbox" value="1" <?php checked('1', $ngg_options['wpmuQuotaCheck']); ?> />
63
+ <?php _e('Should work if the gallery is bellow the blog.dir','nggallery') ?>
64
+ </td>
65
+ </tr>
66
+ <tr>
67
+ <th valign="top"><?php _e('Enable zip upload option','nggallery') ?>:</th>
68
+ <td><input name="wpmuZipUpload" type="checkbox" value="1" <?php checked('1', $ngg_options['wpmuZipUpload']); ?> />
69
+ <?php _e('Allow users to upload zip folders.','nggallery') ?>
70
+ </td>
71
+ </tr>
72
+ <tr>
73
+ <th valign="top"><?php _e('Enable import function','nggallery') ?>:</th>
74
+ <td><input name="wpmuImportFolder" type="checkbox" value="1" <?php checked('1', $ngg_options['wpmuImportFolder']); ?> />
75
+ <?php _e('Allow users to import images folders from the server.','nggallery') ?>
76
+ </td>
77
+ </tr>
78
+ <tr>
79
+ <th valign="top"><?php _e('Enable style selection','nggallery') ?>:</th>
80
+ <td><input name="wpmuStyle" type="checkbox" value="1" <?php checked('1', $ngg_options['wpmuStyle']); ?> />
81
+ <?php _e('Allow users to choose a style for the gallery.','nggallery') ?>
82
+ </td>
83
+ </tr>
84
+ <tr>
85
+ <th valign="top"><?php _e('Enable roles/capabilities','nggallery') ?>:</th>
86
+ <td><input name="wpmuRoles" type="checkbox" value="1" <?php checked('1', $ngg_options['wpmuRoles']); ?> />
87
+ <?php _e('Allow users to change the roles for other blog authors.','nggallery') ?>
88
+ </td>
89
+ </tr>
90
+ <tr>
91
+ <th valign="top"><?php _e('Default style','nggallery') ?>:</th>
92
+ <td>
93
+ <select name="wpmuCSSfile">
94
+ <?php
95
+ $csslist = ngg_get_cssfiles();
96
+ foreach ($csslist as $key =>$a_cssfile) {
97
+ $css_name = $a_cssfile['Name'];
98
+ if ($key == $ngg_options['wpmuCSSfile']) {
99
+ $file_show = $key;
100
+ $selected = " selected='selected'";
101
+ }
102
+ else $selected = '';
103
+ $css_name = esc_attr($css_name);
104
+ echo "\n\t<option value=\"$key\" $selected>$css_name</option>";
105
+ }
106
+ ?>
107
+ </select><br />
108
+ <?php _e('Choose the default style for the galleries.','nggallery') ?>
109
+ </td>
110
+ </tr>
111
+ </table>
112
+ <div class="submit"><input type="submit" name="updateoption" value="<?php _e('Update') ;?>"/></div>
113
+ </form>
114
+ </div>
115
+
116
+ <?php
117
+ }
changelog.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ NextCellent Gallery
2
+ by WPReady
3
+
4
+ = V1.9.14 - 01.09.2013 =
5
+ * NEW: Deactivate if NextGen is installed and activated
css/Black_Minimalism.css ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ CSS Name: Black Minimalism Theme
3
+ Description: For Black Minimalism Theme
4
+ Author: Alex Rabe
5
+ Version: 1.60
6
+
7
+ This is a template stylesheet that can be used with NextGEN Gallery. I tested the
8
+ styles with a default theme Kubrick. Modify it when your theme struggle with it,
9
+ it's only a template design
10
+
11
+ */
12
+
13
+ /* ----------- Album Styles Extend -------------*/
14
+
15
+ .ngg-albumoverview {
16
+ margin-top: 10px;
17
+ width: 100%;
18
+ clear:both;
19
+ display:block !important;
20
+ }
21
+
22
+ .ngg-album {
23
+ /*height: 130px;*/
24
+ overflow:hidden;
25
+ padding: 5px;
26
+ margin-bottom: 5px;
27
+ border: 1px solid #cccccc;
28
+ }
29
+
30
+ .ngg-albumtitle {
31
+ text-align: left;
32
+ font-weight: bold;
33
+ margin:0px;
34
+ padding:0px;
35
+ font-size: 1.4em;
36
+ margin-bottom: 10px;
37
+ }
38
+
39
+ .ngg-thumbnail {
40
+ float: left;
41
+ margin: 0pt !important;
42
+ margin-right: 12px !important;
43
+ }
44
+
45
+ .ngg-thumbnail img {
46
+ background-color:#FFFFFF;
47
+ border:1px solid #A9A9A9;
48
+ margin:4px 0px 4px 5px;
49
+ padding:4px;
50
+ position:relative;
51
+ }
52
+
53
+ .ngg-thumbnail img:hover {
54
+ background-color: #A9A9A9;
55
+ }
56
+
57
+ .ngg-description {
58
+ text-align: left;
59
+ }
60
+
61
+ /* ----------- Album Styles Compact -------------*/
62
+
63
+ .ngg-album-compact {
64
+ float:left;
65
+ height:180px;
66
+ padding-right:6px !important;
67
+ margin:0px !important;
68
+ text-align:left;
69
+ width:120px;
70
+ }
71
+
72
+ .ngg-album-compactbox {
73
+ background:transparent url(albumset.gif) no-repeat scroll 0%;
74
+ height:86px;
75
+ margin:0pt 0pt 6px !important;
76
+ padding:12px 0pt 0pt 7px !important;
77
+ width:120px;
78
+ }
79
+
80
+
81
+ .ngg-album-compactbox .Thumb {
82
+ border:1px solid #000000;
83
+ margin:0px !important;
84
+ padding:0px !important;
85
+ width:91px;
86
+ height:68px;
87
+ }
88
+
89
+ .ngg-album-compact h4 {
90
+ font-size:15px;
91
+ font-weight:bold;
92
+ margin-bottom:0px;
93
+ margin-top:0px;
94
+ width:110px;
95
+ }
96
+
97
+ .ngg-album-compact p {
98
+ font-size:11px;
99
+ margin-top:2px;
100
+ }
101
+
102
+ /* ----------- Gallery style -------------*/
103
+
104
+ .ngg-galleryoverview {
105
+ overflow: hidden;
106
+ margin-top: 10px;
107
+ width: 100%;
108
+ clear:both;
109
+ display:block !important;
110
+ }
111
+
112
+ .ngg-gallery-thumbnail-box {
113
+ float: left;
114
+ width: 20%;
115
+ }
116
+
117
+ .ngg-gallery-thumbnail {
118
+ float: left;
119
+ background: url(shadowAlpha.png) no-repeat bottom right !important;
120
+ background: url(shadow.gif) no-repeat bottom right;
121
+ margin: 10px 0 0 10px !important;
122
+ }
123
+
124
+ .ngg-gallery-thumbnail img {
125
+ margin: -6px 6px 6px -6px;
126
+ background-color:#FFFFFF;
127
+ border:1px solid #A9A9A9;
128
+ display:block;
129
+ padding:4px;
130
+ position:relative;
131
+ }
132
+
133
+ .ngg-gallery-thumbnail img:hover {
134
+ background-color: #A9A9A9;
135
+ }
136
+
137
+ .ngg-gallery-thumbnail span {
138
+ /* Images description */
139
+ font-size:90%;
140
+ padding-left:5px;
141
+ display:block;
142
+ }
143
+
144
+ .ngg-clear {
145
+ clear: both;
146
+ }
147
+
148
+ /* ----------- Gallery navigation -------------*/
149
+
150
+ .ngg-navigation {
151
+ font-size:0.9em !important;
152
+ clear:both !important;
153
+ display:block !important;
154
+ padding-top:15px;
155
+ text-align:center;
156
+ }
157
+
158
+ .ngg-navigation span {
159
+ font-weight:bold;
160
+ margin:0pt 6px;
161
+ }
162
+
163
+ .ngg-navigation a.page-numbers,
164
+ .ngg-navigation a.next,
165
+ .ngg-navigation a.prev,
166
+ .ngg-navigation span.page-numbers,
167
+ .ngg-navigation span.next,
168
+ .ngg-navigation span.prev {
169
+ border:1px solid #660000;
170
+ margin-right:3px;
171
+ padding:3px 7px;
172
+ }
173
+
174
+ .ngg-navigation a.page-numbers:hover,
175
+ .ngg-navigation a.next:hover,
176
+ .ngg-navigation a.prev:hover,
177
+ .ngg-navigation span.page-numbers:hover,
178
+ .ngg-navigation span.next:hover,
179
+ .ngg-navigation span.prev:hover {
180
+ background-color: #660000;
181
+ color: #FFFFFF;
182
+ text-decoration: none;
183
+ }
184
+
185
+ /* ----------- Image browser style -------------*/
186
+
187
+ .ngg-imagebrowser {
188
+
189
+ }
190
+
191
+ .ngg-imagebrowser h3 {
192
+ text-align:center;
193
+ }
194
+
195
+ .ngg-imagebrowser img {
196
+ border:1px solid #A9A9A9;
197
+ margin-top: 10px;
198
+ margin-bottom: 10px;
199
+ width: 100%;
200
+ display:block !important;
201
+ padding:5px;
202
+ }
203
+
204
+ .ngg-imagebrowser-nav {
205
+ padding:5px;
206
+ margin-left:10px;
207
+ }
208
+
209
+ .ngg-imagebrowser-nav .back {
210
+ float:left;
211
+ border:1px solid #DDDDDD;
212
+ margin-right:3px;
213
+ padding:3px 7px;
214
+ }
215
+
216
+ .ngg-imagebrowser-nav .next {
217
+ float:right;
218
+ border:1px solid #DDDDDD;
219
+ margin-right:3px;
220
+ padding:3px 7px;
221
+ }
222
+
223
+ .ngg-imagebrowser-nav .counter {
224
+ text-align:center;
225
+ font-size:0.9em !important;
226
+ }
227
+
228
+ .exif-data {
229
+ margin-left: auto !important;
230
+ margin-right: auto !important;
231
+ }
232
+
233
+ /* ----------- Slideshow -------------*/
234
+ .slideshow {
235
+ margin-left: auto;
236
+ margin-right: auto;
237
+ text-align:center;
238
+ outline: none;
239
+ }
240
+
241
+ .slideshowlink {
242
+
243
+ }
244
+
245
+ /* ----------- JS Slideshow -------------*/
246
+ .ngg-slideshow {
247
+ overflow:hidden;
248
+ position: relative;
249
+ }
250
+
251
+ .ngg-slideshow * {
252
+ vertical-align:middle;
253
+ }
254
+
255
+ /* See also : http://www.brunildo.org/test/img_center.html */
256
+ .ngg-slideshow-loader{
257
+ display: table-cell;
258
+ text-align: center;
259
+ vertical-align:middle;
260
+ }
261
+
262
+ .ngg-slideshow-loader img{
263
+ background: none !important;
264
+ border: 0 none !important;
265
+ margin:auto !important;
266
+ }
267
+
268
+ /* ----------- Single picture -------------*/
269
+ .ngg-singlepic {
270
+ display:block;
271
+ padding:4px;
272
+ }
273
+
274
+ .ngg-left {
275
+ float: left;
276
+ margin-right:10px;
277
+ }
278
+
279
+ .ngg-right {
280
+ float: right;
281
+ margin-left:10px;
282
+ }
283
+
284
+ .ngg-center {
285
+ margin-left: auto !important;
286
+ margin-right: auto !important;
287
+ }
288
+
289
+ /* ----------- Sidebar widget -------------*/
290
+ .ngg-widget,
291
+ .ngg-widget-slideshow {
292
+ overflow: hidden;
293
+ margin:0pt;
294
+ padding:5px 0px 0px 0pt;
295
+ }
296
+
297
+ .ngg-widget img {
298
+ border:2px solid #A9A9A9;
299
+ margin:0pt 2px 2px 0px;
300
+ padding:1px;
301
+ }
302
+
303
+ /* ----------- Related images -------------*/
304
+ .ngg-related-gallery {
305
+ background:#F9F9F9;
306
+ border:1px solid #E0E0E0;
307
+ overflow:hidden;
308
+ margin-bottom:1em;
309
+ margin-top:1em;
310
+ padding:5px;
311
+ }
312
+ .ngg-related-gallery img {
313
+ border: 1px solid #DDDDDD;
314
+ float: left;
315
+ margin: 0pt 2px;
316
+ padding: 2px;
317
+ height: 50px;
318
+ width: 50px;
319
+ }
320
+
321
+ .ngg-related-gallery img:hover {
322
+ border: 1px solid #000000;
323
+ }
324
+
325
+ /* ----------- Gallery list -------------*/
326
+
327
+ .ngg-galleryoverview ul li:before {
328
+ content: '' !important;
329
+ }
330
+
331
+ .ngg-gallery-list {
332
+ list-style-type:none;
333
+ padding: 0px !important;
334
+ text-indent:0px !important;
335
+ }
336
+
337
+ .ngg-galleryoverview div.pic img{
338
+ width: 100%;
339
+ }
340
+
341
+ .ngg-gallery-list li {
342
+ float:left;
343
+ margin:0 2px 0px 2px !important;
344
+ overflow:hidden;
345
+ }
346
+
347
+ .ngg-gallery-list li a {
348
+ border:1px solid #CCCCCC;
349
+ display:block;
350
+ padding:2px;
351
+ }
352
+
353
+ .ngg-gallery-list li.selected a{
354
+ -moz-background-clip:border;
355
+ -moz-background-inline-policy:continuous;
356
+ -moz-background-origin:padding;
357
+ background:#000000 none repeat scroll 0 0;
358
+ }
359
+
360
+ .ngg-gallery-list li img {
361
+ height:40px;
362
+ width:40px;
363
+ }
364
+
365
+ li.ngg-next, li.ngg-prev {
366
+ height:40px;
367
+ width:40px;
368
+ font-size:3.5em;
369
+ }
370
+
371
+ li.ngg-next a, li.ngg-prev a {
372
+ padding-top: 10px;
373
+ border: none;
374
+ text-decoration: none;
375
+ }
css/albumset.gif ADDED
Binary file
css/hovereffect.css ADDED
@@ -0,0 +1,425 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ CSS Name: Hovereffect Styles
3
+ Description: Hover Stylesheet based on the idea of Hoverbox from http://host.sonspring.com/hoverbox/
4
+ Author: Alex Rabe - Orginal by Nathan Smith
5
+ Version: 1.60
6
+
7
+ This is a template stylesheet which doesn't support description below the thumbnails. It's a experimental version.
8
+
9
+ */
10
+
11
+ /* ----------- Album Styles Extend -------------*/
12
+
13
+ .ngg-albumoverview {
14
+ margin-top: 10px;
15
+ width: 100%;
16
+ clear:both;
17
+ display:block !important;
18
+ }
19
+
20
+ .ngg-album {
21
+ overflow: hidden;
22
+ padding: 5px;
23
+ margin-bottom: 5px;
24
+ }
25
+
26
+ .ngg-albumtitle {
27
+ border-bottom:1px dashed #AAAAAA;
28
+ text-align: left;
29
+ font-weight: bold;
30
+ margin:0px;
31
+ padding-bottom: 3px;
32
+ font-size: 1.4em;
33
+ margin-bottom: 10px;
34
+ }
35
+
36
+ .ngg-thumbnail {
37
+ float: left;
38
+ margin-right: 12px;
39
+ background:#EEEEEE none repeat scroll 0% 50%;
40
+ border-color:#DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204);
41
+ border-style:solid;
42
+ border-width:1px;
43
+ color:inherit;
44
+ margin-right: 5px;
45
+ padding:5px;
46
+ }
47
+
48
+ .ngg-thumbnail img {
49
+ filter: alpha(opacity=100);
50
+ -moz-opacity: .99;
51
+ opacity: .99;
52
+ background:#FFFFFF none repeat scroll 0%;
53
+ border-color:#AAAAAA rgb(204, 204, 204) rgb(221, 221, 221) rgb(187, 187, 187);
54
+ border-style:solid;
55
+ border-width:1px;
56
+ color:inherit;
57
+ padding:2px;
58
+ vertical-align:top;
59
+ }
60
+
61
+ .ngg-thumbnail img:hover {
62
+ filter: alpha(opacity=90);
63
+ -moz-opacity: .9;
64
+ opacity: .9;
65
+ border-color:#000000;
66
+ }
67
+
68
+ .ngg-description {
69
+ text-align: left;
70
+ }
71
+
72
+ /* ----------- Album Styles Compact -------------*/
73
+
74
+ .ngg-album-compact {
75
+ float:left;
76
+ height:180px;
77
+ padding-right:6px !important;
78
+ margin:0px !important;
79
+ text-align:left;
80
+ width:120px;
81
+ }
82
+
83
+ .ngg-album-compactbox {
84
+ background:transparent url(albumset.gif) no-repeat scroll 0%;
85
+ height:86px;
86
+ margin:0pt 0pt 6px !important;
87
+ padding:12px 0pt 0pt 7px !important;
88
+ width:120px;
89
+ }
90
+
91
+
92
+ .ngg-album-compactbox .Thumb {
93
+ border:1px solid #000000;
94
+ margin:0px !important;
95
+ padding:0px !important;
96
+ width:91px;
97
+ height:68px;
98
+ }
99
+
100
+ .ngg-album-compact h4 {
101
+ font-size:15px;
102
+ font-weight:bold;
103
+ margin-bottom:0px;
104
+ margin-top:0px;
105
+ width:110px;
106
+ }
107
+
108
+ .ngg-album-compact p {
109
+ font-size:11px;
110
+ margin-top:2px;
111
+ }
112
+
113
+ /* ----------- Gallery style -------------*/
114
+
115
+ .ngg-galleryoverview {
116
+ overflow: hidden;
117
+ margin-top: 10px;
118
+ width: 100%;
119
+ clear:both;
120
+ display:block !important;
121
+ }
122
+
123
+ .ngg-gallery-thumbnail-box {
124
+ float: left;
125
+ background:#EEEEEE none repeat scroll 0% 50%;
126
+ border-color:#DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204);
127
+ border-style:solid;
128
+ border-width:1px;
129
+ color:inherit;
130
+ display:inline;
131
+ margin:3px;
132
+ padding:5px;
133
+ position:relative;
134
+ }
135
+
136
+ .ngg-gallery-thumbnail {
137
+ float: left;
138
+ }
139
+
140
+ .ngg-gallery-thumbnail img {
141
+ filter: alpha(opacity=100);
142
+ -moz-opacity: .99;
143
+ opacity: .99;
144
+ background:#FFFFFF none repeat scroll 0%;
145
+ border-color:#AAAAAA rgb(204, 204, 204) rgb(221, 221, 221) rgb(187, 187, 187);
146
+ border-style:solid;
147
+ border-width:1px;
148
+ color:inherit;
149
+ padding:2px;
150
+ vertical-align:top;
151
+ }
152
+
153
+ .ngg-gallery-thumbnail img:hover {
154
+ filter: alpha(opacity=90);
155
+ -moz-opacity: .9;
156
+ opacity: .9;
157
+ border-color:#000000;
158
+ }
159
+
160
+ .ngg-gallery-thumbnail span {
161
+ /* Images description */
162
+ font-size:90%;
163
+ padding-left:5px;
164
+ display:block;
165
+ }
166
+
167
+ .ngg-clear {
168
+ clear: both;
169
+ }
170
+
171
+ /* ----------- Gallery navigation -------------*/
172
+
173
+ .ngg-navigation {
174
+ font-size:0.9em !important;
175
+ clear:both !important;
176
+ display:block !important;
177
+ padding-top:15px;
178
+ text-align:center;
179
+
180
+ }
181
+
182
+ .ngg-navigation span {
183
+ font-weight:bold;
184
+ margin:0pt 6px;
185
+ }
186
+
187
+ .ngg-navigation a.page-numbers,
188
+ .ngg-navigation a.next,
189
+ .ngg-navigation a.prev,
190
+ .ngg-navigation span.page-numbers,
191
+ .ngg-navigation span.next,
192
+ .ngg-navigation span.prev {
193
+ border:1px solid #DDDDDD;
194
+ margin-right:3px;
195
+ padding:3px 7px;
196
+ }
197
+
198
+ .ngg-navigation a.page-numbers:hover,
199
+ .ngg-navigation a.next:hover,
200
+ .ngg-navigation a.prev:hover,
201
+ .ngg-navigation span.page-numbers:hover,
202
+ .ngg-navigation span.next:hover,
203
+ .ngg-navigation span.prev:hover {
204
+ background-color: #0066CC;
205
+ color: #FFFFFF !important;
206
+ text-decoration: none !important;
207
+ }
208
+
209
+ /* ----------- Image browser style -------------*/
210
+
211
+ .ngg-imagebrowser {
212
+
213
+ }
214
+
215
+ .ngg-imagebrowser h3 {
216
+ text-align:center;
217
+ padding-bottom:10px;
218
+ }
219
+
220
+ .ngg-imagebrowser .pic {
221
+ background:#EEEEEE none repeat scroll 0% 50%;
222
+ border-color:#DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204);
223
+ border-style:solid;
224
+ border-width:1px;
225
+ color:inherit;
226
+ display:block;
227
+ padding:10px;
228
+ }
229
+
230
+ .ngg-imagebrowser img {
231
+ width: 100%;
232
+ margin: -3px;
233
+ background:#FFFFFF none repeat scroll 0%;
234
+ border-color:#AAAAAA rgb(204, 204, 204) rgb(221, 221, 221) rgb(187, 187, 187);
235
+ border-style:solid;
236
+ border-width:1px;
237
+ color:inherit;
238
+ padding:2px;
239
+ vertical-align:top;
240
+ }
241
+
242
+ .ngg-imagebrowser-nav {
243
+ padding:10px;
244
+ margin-left:10px;
245
+
246
+ }
247
+
248
+ .ngg-imagebrowser-nav .back {
249
+ float:left;
250
+ border:1px solid #DDDDDD;
251
+ margin-right:3px;
252
+ padding:3px 7px;
253
+ }
254
+
255
+ .ngg-imagebrowser-nav .next {
256
+ float:right;
257
+ border:1px solid #DDDDDD;
258
+ margin-right:3px;
259
+ padding:3px 7px;
260
+ }
261
+
262
+ .ngg-imagebrowser-nav .back:hover,
263
+ .ngg-imagebrowser-nav .next:hover {
264
+ border:1px solid #000000;
265
+ }
266
+
267
+ .ngg-imagebrowser-nav .back a:hover,
268
+ .ngg-imagebrowser-nav .next a:hover {
269
+ text-decoration: none !important;
270
+ }
271
+
272
+ .ngg-imagebrowser-nav .counter {
273
+ text-align:center;
274
+ font-size:0.9em !important;
275
+ }
276
+
277
+ .exif-data {
278
+ margin-left: auto !important;
279
+ margin-right: auto !important;
280
+ }
281
+
282
+ /* ----------- Slideshow -------------*/
283
+ .slideshow {
284
+ margin-left: auto;
285
+ margin-right: auto;
286
+ text-align:center;
287
+ outline: none;
288
+ }
289
+
290
+ .slideshowlink {
291
+
292
+ }
293
+
294
+ /* ----------- JS Slideshow -------------*/
295
+ .ngg-slideshow {
296
+ overflow:hidden;
297
+ position: relative;
298
+ }
299
+
300
+ .ngg-slideshow * {
301
+ vertical-align:middle;
302
+ }
303
+
304
+ /* See also : http://www.brunildo.org/test/img_center.html */
305
+ .ngg-slideshow-loader{
306
+ display: table-cell;
307
+ text-align: center;
308
+ vertical-align:middle;
309
+ }
310
+
311
+ .ngg-slideshow-loader img{
312
+ background: none !important;
313
+ border: 0 none !important;
314
+ margin:auto !important;
315
+ }
316
+
317
+ /* ----------- Single picture -------------*/
318
+ .ngg-singlepic {
319
+ background-color:#FFFFFF;
320
+ display:block;
321
+ padding:4px;
322
+ }
323
+
324
+ .ngg-left {
325
+ float: left;
326
+ margin-right:10px;
327
+ }
328
+
329
+ .ngg-right {
330
+ float: right;
331
+ margin-left:10px;
332
+ }
333
+
334
+ .ngg-center {
335
+ margin-left: auto !important;
336
+ margin-right: auto !important;
337
+ }
338
+
339
+ /* ----------- Sidebar widget -------------*/
340
+ .ngg-widget,
341
+ .ngg-widget-slideshow {
342
+ overflow: hidden;
343
+ margin:0pt;
344
+ padding:5px 0px 0px 0pt;
345
+ }
346
+
347
+ .ngg-widget img {
348
+ border:2px solid #A9A9A9;
349
+ margin:0pt 2px 2px 0px;
350
+ padding:1px;
351
+ }
352
+
353
+ /* ----------- Related images -------------*/
354
+ .ngg-related-gallery {
355
+ background:#F9F9F9;
356
+ border:1px solid #E0E0E0;
357
+ overflow:hidden;
358
+ margin-bottom:1em;
359
+ margin-top:1em;
360
+ padding:5px;
361
+ }
362
+ .ngg-related-gallery img {
363
+ border: 1px solid #DDDDDD;
364
+ float: left;
365
+ margin: 0pt 3px;
366
+ padding: 2px;
367
+ height: 50px;
368
+ width: 50px;
369
+ }
370
+
371
+ .ngg-related-gallery img:hover {
372
+ border: 1px solid #000000;
373
+ }
374
+
375
+ /* ----------- Gallery list -------------*/
376
+
377
+ .ngg-galleryoverview ul li:before {
378
+ content: '' !important;
379
+ }
380
+
381
+ .ngg-gallery-list {
382
+ list-style-type:none;
383
+ padding: 0px !important;
384
+ text-indent:0px !important;
385
+ }
386
+
387
+ .ngg-galleryoverview div.pic img{
388
+ width: 100%;
389
+ }
390
+
391
+ .ngg-gallery-list li {
392
+ float:left;
393
+ margin:0 2px 0px 2px !important;
394
+ overflow:hidden;
395
+ }
396
+
397
+ .ngg-gallery-list li a {
398
+ border:1px solid #CCCCCC;
399
+ display:block;
400
+ padding:2px;
401
+ }
402
+
403
+ .ngg-gallery-list li.selected a{
404
+ -moz-background-clip:border;
405
+ -moz-background-inline-policy:continuous;
406
+ -moz-background-origin:padding;
407
+ background:#000000 none repeat scroll 0 0;
408
+ }
409
+
410
+ .ngg-gallery-list li img {
411
+ height:40px;
412
+ width:40px;
413
+ }
414
+
415
+ li.ngg-next, li.ngg-prev {
416
+ height:40px;
417
+ width:40px;
418
+ font-size:3.5em;
419
+ }
420
+
421
+ li.ngg-next a, li.ngg-prev a {
422
+ padding-top: 10px;
423
+ border: none;
424
+ text-decoration: none;
425
+ }
css/ngg_dkret3.css ADDED
@@ -0,0 +1,318 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ CSS Name: dkret3 Theme
3
+ Description: NextGEN dkret3 style with a shadow effect
4
+ Author: Jörn Kretzschmar (based on Alex Rabes Default Style)
5
+ Version: 1.3
6
+
7
+ This is a template stylesheet that can be used with NextGEN Gallery. I tested the
8
+ styles with the theme dkret3. Modify it when your theme struggle with it,
9
+ it's only a template design
10
+
11
+ */
12
+
13
+ /* ----------- Album Styles Extend -------------*/
14
+
15
+ .ngg-albumoverview {
16
+ margin-top: 10px;
17
+ width: 100%;
18
+ clear:both;
19
+ display:block !important;
20
+ }
21
+
22
+ .ngg-album {
23
+ height: 100%;
24
+ padding: 5px;
25
+ margin-bottom: 5px;
26
+ border: 1px solid #cccccc;
27
+ overflow:hidden;
28
+ }
29
+
30
+ .ngg-albumtitle {
31
+ text-align: left;
32
+ font-weight: bold;
33
+ margin:0px;
34
+ padding:0px;
35
+ font-size: 1.4em;
36
+ margin-bottom: 10px;
37
+ }
38
+
39
+ .ngg-thumbnail {
40
+ float: left;
41
+ margin-right: 12px;
42
+ }
43
+
44
+ .ngg-thumbnail img {
45
+ background-color:#FFFFFF;
46
+ border:1px solid #A9A9A9;
47
+ margin:4px 0px 4px 5px;
48
+ padding:4px;
49
+ position:relative;
50
+ }
51
+
52
+ .ngg-thumbnail img:hover {
53
+ background-color: #A9A9A9;
54
+ }
55
+
56
+ .ngg-description {
57
+ text-align: left;
58
+ }
59
+
60
+ /* ----------- Album Styles Compact -------------*/
61
+
62
+ .ngg-album-compact {
63
+ float:left;
64
+ height:180px;
65
+ padding-right:6px !important;
66
+ margin:0px !important;
67
+ text-align:left;
68
+ width:120px;
69
+ }
70
+
71
+ .ngg-album-compactbox {
72
+ background:transparent url(albumset.gif) no-repeat scroll 0%;
73
+ height:86px;
74
+ margin:0pt 0pt 6px !important;
75
+ padding:12px 0pt 0pt 7px !important;
76
+ width:120px;
77
+ }
78
+
79
+
80
+ .ngg-album-compactbox .Thumb {
81
+ border:1px solid #000000;
82
+ margin:0px !important;
83
+ padding:0px !important;
84
+ width:91px;
85
+ height:68px;
86
+ }
87
+
88
+ .ngg-album-compact h4 {
89
+ font-size:15px;
90
+ font-weight:bold;
91
+ margin-bottom:0px;
92
+ margin-top:0px;
93
+ width:110px;
94
+ }
95
+
96
+ .ngg-album-compact p {
97
+ font-size:11px;
98
+ margin-top:2px;
99
+ }
100
+
101
+ /* ----------- Gallery style -------------*/
102
+
103
+ .ngg-galleryoverview {
104
+ margin-top: 10px;
105
+ width: 100%;
106
+ clear:both;
107
+ display:block !important;
108
+ }
109
+
110
+ .ngg-gallery-thumbnail-box {
111
+ float: left;
112
+ }
113
+
114
+ .ngg-gallery-thumbnail {
115
+ float: left;
116
+ background: url(shadowAlpha.png) no-repeat bottom right !important;
117
+ background: url(shadow.gif) no-repeat bottom right;
118
+ margin: 10px 0 0 10px !important;
119
+ }
120
+
121
+ .ngg-gallery-thumbnail img {
122
+ margin: -6px 6px 6px -6px;
123
+ background-color:#FFFFFF;
124
+ border:1px solid #A9A9A9;
125
+ display:block;
126
+ padding:4px;
127
+ position:relative;
128
+ }
129
+
130
+ .ngg-gallery-thumbnail img:hover {
131
+ background-color: #A9A9A9;
132
+ }
133
+
134
+ .ngg-gallery-thumbnail span {
135
+ display:none;
136
+ }
137
+
138
+ .ngg-clear {
139
+ clear: both;
140
+ }
141
+
142
+ /* ----------- Gallery navigation -------------*/
143
+
144
+ .ngg-navigation {
145
+ font-size:0.9em !important;
146
+ clear:both !important;
147
+ display:block !important;
148
+ padding-top:15px;
149
+ text-align:center;
150
+ }
151
+
152
+ .ngg-navigation span {
153
+ font-weight:bold;
154
+ margin:0pt 6px;
155
+ }
156
+
157
+ .ngg-navigation a.page-numbers,
158
+ .ngg-navigation a.next,
159
+ .ngg-navigation a.prev,
160
+ .ngg-navigation span.page-numbers,
161
+ .ngg-navigation span.next,
162
+ .ngg-navigation span.prev {
163
+ border:1px solid #DDDDDD;
164
+ margin-right:3px;
165
+ padding:3px 7px;
166
+ }
167
+
168
+ .ngg-navigation a.page-numbers:hover,
169
+ .ngg-navigation a.next:hover,
170
+ .ngg-navigation a.prev:hover,
171
+ .ngg-navigation span.page-numbers:hover,
172
+ .ngg-navigation span.next:hover,
173
+ .ngg-navigation span.prev:hover {
174
+ background-color: #0066CC;
175
+ color: #FFFFFF !important;
176
+ text-decoration: none !important;
177
+ }
178
+
179
+ /* ----------- Image browser style -------------*/
180
+
181
+ .ngg-imagebrowser {
182
+
183
+ }
184
+
185
+ .ngg-imagebrowser h3 {
186
+ text-align:center;
187
+ }
188
+
189
+ .ngg-imagebrowser img {
190
+ border:1px solid #A9A9A9;
191
+ margin-top: 10px;
192
+ margin-bottom: 10px;
193
+ width: 100%;
194
+ display:block !important;
195
+ padding:5px;
196
+ }
197
+
198
+ .ngg-imagebrowser-nav {
199
+ padding:5px;
200
+ margin-left:10px;
201
+ }
202
+
203
+ .ngg-imagebrowser-nav .back {
204
+ float:left;
205
+ border:1px solid #DDDDDD;
206
+ margin-right:3px;
207
+ padding:3px 7px;
208
+ }
209
+
210
+ .ngg-imagebrowser-nav .next {
211
+ float:right;
212
+ border:1px solid #DDDDDD;
213
+ margin-right:3px;
214
+ padding:3px 7px;
215
+ }
216
+
217
+ .ngg-imagebrowser-nav .counter {
218
+ text-align:center;
219
+ font-size:0.9em !important;
220
+ }
221
+
222
+ .exif-data {
223
+ margin-left: auto !important;
224
+ margin-right: auto !important;
225
+ }
226
+
227
+ /* ----------- Slideshow -------------*/
228
+ .slideshow {
229
+ margin-left: auto;
230
+ margin-right: auto;
231
+ text-align:center;
232
+ outline: none;
233
+ }
234
+
235
+ .slideshowlink {
236
+
237
+ }
238
+
239
+ /* ----------- JS Slideshow -------------*/
240
+ .ngg-slideshow {
241
+ overflow:hidden;
242
+ position: relative;
243
+ }
244
+
245
+ .ngg-slideshow * {
246
+ vertical-align:middle;
247
+ }
248
+
249
+ /* See also : http://www.brunildo.org/test/img_center.html */
250
+ .ngg-slideshow-loader{
251
+ display: table-cell;
252
+ text-align: center;
253
+ vertical-align:middle;
254
+ }
255
+
256
+ .ngg-slideshow-loader img{
257
+ background: none !important;
258
+ border: 0 none !important;
259
+ margin:auto !important;
260
+ }
261
+
262
+ /* ----------- Single picture -------------*/
263
+ .ngg-singlepic {
264
+ background-color:#FFFFFF;
265
+ display:block;
266
+ padding:4px;
267
+ }
268
+
269
+ .ngg-left {
270
+ float: left;
271
+ }
272
+
273
+ .ngg-right {
274
+ float: right;
275
+ }
276
+
277
+ .ngg-center {
278
+ margin-left: auto;
279
+ margin-right: auto;
280
+ }
281
+
282
+ /* ----------- Sidebar widget -------------*/
283
+
284
+ .ngg-widget,
285
+ .ngg-widget-slideshow {
286
+ overflow: hidden;
287
+ margin:0pt;
288
+ padding:5px 0px 0px 0pt;
289
+ text-align: center;
290
+ }
291
+
292
+ .ngg-widget img {
293
+ border:2px solid #A9A9A9;
294
+ margin:0pt 2px 2px 0px;
295
+ padding:1px;
296
+ }
297
+
298
+ /* ----------- Related images -------------*/
299
+ .ngg-related-gallery {
300
+ background:#F9F9F9;
301
+ border:1px solid #E0E0E0;
302
+ overflow:hidden;
303
+ margin-bottom:1em;
304
+ margin-top:1em;
305
+ padding:5px;
306
+ }
307
+ .ngg-related-gallery img {
308
+ border: 1px solid #DDDDDD;
309
+ float: left;
310
+ margin: 0pt 3px;
311
+ padding: 2px;
312
+ height: 50px;
313
+ width: 50px;
314
+ }
315
+
316
+ .ngg-related-gallery img:hover {
317
+ border: 1px solid #000000;
318
+ }
css/ngg_k2.css ADDED
@@ -0,0 +1,330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ CSS Name: K2 Theme
3
+ Description: NextGEN Style for K2 Theme
4
+ Author: Alex Rabe
5
+ Version: 1.60
6
+
7
+ This is a template stylesheet that can be used with NextGEN Gallery. I tested the
8
+ styles with a default theme Kubrick. Modify it when your theme struggle with it,
9
+ it's only a template design
10
+
11
+ */
12
+
13
+ /* ----------- Album Styles Extend -------------*/
14
+
15
+ .ngg-albumoverview {
16
+ margin: 10px 0px 0px 0px !important;
17
+ width: 100%;
18
+ clear:both;
19
+ display:block !important;
20
+ }
21
+
22
+ .ngg-album {
23
+ /*height: 130px;*/
24
+ overflow:hidden;
25
+ margin: 0px 0px 5px !important;
26
+ padding: 5px;
27
+ border: 1px solid #cccccc;
28
+ }
29
+
30
+ .ngg-albumtitle {
31
+ text-align: left;
32
+ font-weight: bold;
33
+ padding:0px;
34
+ font-size: 1.4em;
35
+ margin: 0px 0px 10px 0px !important;
36
+ }
37
+
38
+ .ngg-albumcontent {
39
+ margin: 0px !important;
40
+ }
41
+
42
+ .ngg-thumbnail {
43
+ margin:0px 12px 0px 0px !important;
44
+ float: left;
45
+ }
46
+
47
+ .ngg-thumbnail img {
48
+ background-color:#FFFFFF;
49
+ border:1px solid #A9A9A9;
50
+ margin:4px 0px 4px 5px !important;
51
+ padding:4px;
52
+ position:relative;
53
+ }
54
+
55
+ .ngg-thumbnail img:hover {
56
+ background-color: #A9A9A9;
57
+ }
58
+
59
+ .ngg-description {
60
+ text-align: left;
61
+ }
62
+
63
+ /* ----------- Album Styles Compact -------------*/
64
+
65
+ .ngg-album-compact {
66
+ float:left;
67
+ height:180px;
68
+ padding-right:6px !important;
69
+ margin:0px !important;
70
+ text-align:left;
71
+ width:120px;
72
+ }
73
+
74
+ .ngg-album-compactbox {
75
+ background:transparent url(albumset.gif) no-repeat scroll 0%;
76
+ height:86px;
77
+ margin:0pt 0pt 6px !important;
78
+ padding:12px 0pt 0pt 7px !important;
79
+ width:120px;
80
+ }
81
+
82
+ .ngg-album-link {
83
+ margin:0px !important;
84
+ }
85
+
86
+ .ngg-album-compactbox .Thumb {
87
+ border:1px solid #000000;
88
+ margin:0px !important;
89
+ padding:0px !important;
90
+ width:91px;
91
+ height:68px;
92
+ }
93
+
94
+ .ngg-album-compact h4 {
95
+ font-size:15px;
96
+ font-weight:bold;
97
+ margin-bottom:0px !important;
98
+ margin-top:0px !important;
99
+ width:110px;
100
+ padding:0px !important;
101
+ }
102
+
103
+ .ngg-album-compact p {
104
+ font-size:11px;
105
+ margin-top:2px;
106
+ }
107
+
108
+ /* ----------- Gallery style -------------*/
109
+
110
+ .ngg-galleryoverview {
111
+ margin-top: 10px;
112
+ width: 100%;
113
+ clear:both;
114
+ display:block !important;
115
+ }
116
+
117
+ .ngg-gallery-thumbnail-box {
118
+ margin:0px !important;
119
+ float: left;
120
+ }
121
+
122
+ .ngg-gallery-thumbnail {
123
+ float: left;
124
+ background: url(shadowAlpha.png) no-repeat bottom right !important;
125
+ background: url(shadow.gif) no-repeat bottom right;
126
+ margin: 10px 0 0 10px !important;
127
+ }
128
+
129
+ .ngg-gallery-thumbnail img {
130
+ margin: -6px 6px 6px -6px !important;
131
+ background-color:#FFFFFF;
132
+ border:1px solid #A9A9A9;
133
+ display:block;
134
+ padding:4px;
135
+ position:relative;
136
+ }
137
+
138
+ .ngg-gallery-thumbnail img:hover {
139
+ background-color: #A9A9A9;
140
+ }
141
+
142
+ .ngg-gallery-thumbnail span {
143
+ /* Images description */
144
+ font-size:90%;
145
+ padding-left:5px;
146
+ display:block;
147
+ }
148
+
149
+ .ngg-clear {
150
+ clear: both;
151
+ }
152
+
153
+ /* ----------- Gallery navigation -------------*/
154
+
155
+ .ngg-navigation {
156
+ font-size:0.9em !important;
157
+ clear:both !important;
158
+ display:block !important;
159
+ padding-top:15px;
160
+ text-align:center;
161
+ }
162
+
163
+ .ngg-navigation span {
164
+ font-weight:bold;
165
+ margin:0pt 6px;
166
+ }
167
+
168
+ .ngg-navigation a.page-numbers,
169
+ .ngg-navigation a.next,
170
+ .ngg-navigation a.prev,
171
+ .ngg-navigation span.page-numbers,
172
+ .ngg-navigation span.next,
173
+ .ngg-navigation span.prev {
174
+ border:1px solid #DDDDDD;
175
+ margin-right:3px;
176
+ padding:3px 7px;
177
+ }
178
+
179
+ .ngg-navigation a.page-numbers:hover,
180
+ .ngg-navigation a.next:hover,
181
+ .ngg-navigation a.prev:hover,
182
+ .ngg-navigation span.page-numbers:hover,
183
+ .ngg-navigation span.next:hover,
184
+ .ngg-navigation span.prev:hover {
185
+ background-color: #0066CC;
186
+ color: #FFFFFF;
187
+ text-decoration: none;
188
+ }
189
+
190
+ /* ----------- Image browser style -------------*/
191
+
192
+ .ngg-imagebrowser {
193
+
194
+ }
195
+
196
+ .ngg-imagebrowser h3 {
197
+ text-align:center;
198
+ }
199
+
200
+ .ngg-imagebrowser img {
201
+ border:1px solid #A9A9A9;
202
+ margin-top: 10px;
203
+ margin-bottom: 10px;
204
+ width: 100%;
205
+ display:block !important;
206
+ padding:5px;
207
+ }
208
+
209
+ .ngg-imagebrowser-nav {
210
+ padding:5px;
211
+ margin-left:10px;
212
+ }
213
+
214
+ .ngg-imagebrowser-nav .back {
215
+ float:left;
216
+ border:1px solid #DDDDDD;
217
+ margin-right:3px;
218
+ padding:3px 7px;
219
+ }
220
+
221
+ .ngg-imagebrowser-nav .next {
222
+ float:right;
223
+ border:1px solid #DDDDDD;
224
+ margin-right:3px;
225
+ padding:3px 7px;
226
+ }
227
+
228
+ .ngg-imagebrowser-nav .counter {
229
+ text-align:center;
230
+ font-size:0.9em !important;
231
+ }
232
+
233
+ .exif-data {
234
+ margin-left: auto !important;
235
+ margin-right: auto !important;
236
+ }
237
+
238
+ /* ----------- Slideshow -------------*/
239
+ .slideshow {
240
+ margin-left: auto;
241
+ margin-right: auto;
242
+ text-align:center;
243
+ outline: none;
244
+ }
245
+
246
+ .slideshowlink {
247
+
248
+ }
249
+
250
+ /* ----------- JS Slideshow -------------*/
251
+ .ngg-slideshow {
252
+ overflow:hidden;
253
+ position: relative;
254
+ }
255
+
256
+ .ngg-slideshow * {
257
+ vertical-align:middle;
258
+ }
259
+
260
+ /* See also : http://www.brunildo.org/test/img_center.html */
261
+ .ngg-slideshow-loader{
262
+ display: table-cell;
263
+ text-align: center;
264
+ vertical-align:middle;
265
+ }
266
+
267
+ .ngg-slideshow-loader img{
268
+ background: none !important;
269
+ border: 0 none !important;
270
+ margin:auto !important;
271
+ }
272
+
273
+ /* ----------- Single picture -------------*/
274
+ .ngg-singlepic {
275
+ background-color:#FFFFFF;
276
+ display:block;
277
+ padding:4px;
278
+ }
279
+
280
+ .ngg-left {
281
+ float: left;
282
+ margin-right:10px;
283
+ }
284
+
285
+ .ngg-right {
286
+ float: right;
287
+ margin-left:10px;
288
+ }
289
+
290
+ .ngg-center {
291
+ margin-left: auto !important;
292
+ margin-right: auto !important;
293
+ }
294
+
295
+ /* ----------- Sidebar widget -------------*/
296
+ .ngg-widget,
297
+ .ngg-widget-slideshow {
298
+ overflow: hidden;
299
+ margin:0pt;
300
+ padding:5px 0px 0px 0pt;
301
+ text-align:left;
302
+ }
303
+
304
+ .ngg-widget img {
305
+ border:2px solid #A9A9A9;
306
+ margin:0pt 2px 2px 0px;
307
+ padding:1px;
308
+ }
309
+
310
+ /* ----------- Related images -------------*/
311
+ .ngg-related-gallery {
312
+ background:#F9F9F9;
313
+ border:1px solid #E0E0E0;
314
+ overflow:hidden;
315
+ margin-bottom:1em;
316
+ margin-top:1em;
317
+ padding:5px;
318
+ }
319
+ .ngg-related-gallery img {
320
+ border: 1px solid #DDDDDD;
321
+ float: left;
322
+ margin: 0pt 2px;
323
+ padding: 2px;
324
+ height: 50px;
325
+ width: 50px;
326
+ }
327
+
328
+ .ngg-related-gallery img:hover {
329
+ border: 1px solid #000000;
330
+ }
css/ngg_shadow.css ADDED
@@ -0,0 +1,371 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ CSS Name: Shadow Effect
3
+ Description: NextGEN Default Style with a Shadow effect
4
+ Author: Alex Rabe
5
+ Version: 1.60
6
+
7
+ This is a template stylesheet that can be used with NextGEN Gallery. I tested the
8
+ styles with a default theme Kubrick. Modify it when your theme struggle with it,
9
+ it's only a template design
10
+
11
+ */
12
+
13
+ /* ----------- Album Styles Extend -------------*/
14
+
15
+ .ngg-albumoverview {
16
+ margin-top: 10px;
17
+ width: 100%;
18
+ clear:both;
19
+ display:block !important;
20
+ }
21
+
22
+ .ngg-album {
23
+ /*height: 130px;*/
24
+ padding: 5px;
25
+ margin-bottom: 5px;
26
+ border: 1px solid #cccccc;
27
+ overflow:hidden;
28
+ }
29
+
30
+ .ngg-albumtitle {
31
+ text-align: left;
32
+ font-weight: bold;
33
+ margin:0px;
34
+ padding:0px;
35
+ font-size: 1.4em;
36
+ margin-bottom: 10px;
37
+ }
38
+
39
+ .ngg-thumbnail {
40
+ float: left;
41
+ margin-right: 12px;
42
+ }
43
+
44
+ .ngg-thumbnail img {
45
+ background-color:#FFFFFF;
46
+ border:1px solid #A9A9A9;
47
+ margin:4px 0px 4px 5px;
48
+ padding:4px;
49
+ position:relative;
50
+ }
51
+
52
+ .ngg-thumbnail img:hover {
53
+ background-color: #A9A9A9;
54
+ }
55
+
56
+ .ngg-description {
57
+ text-align: left;
58
+ }
59
+
60
+ /* ----------- Album Styles Compact -------------*/
61
+
62
+ .ngg-album-compact {
63
+ float:left;
64
+ height:180px;
65
+ padding-right:6px !important;
66
+ margin:0px !important;
67
+ text-align:left;
68
+ width:120px;
69
+ }
70
+
71
+ .ngg-album-compactbox {
72
+ background:transparent url(albumset.gif) no-repeat scroll 0%;
73
+ height:86px;
74
+ margin:0pt 0pt 6px !important;
75
+ padding:12px 0pt 0pt 7px !important;
76
+ width:120px;
77
+ }
78
+
79
+
80
+ .ngg-album-compactbox .Thumb {
81
+ border:1px solid #000000;
82
+ margin:0px !important;
83
+ padding:0px !important;
84
+ width:91px;
85
+ height:68px;
86
+ }
87
+
88
+ .ngg-album-compact h4 {
89
+ font-size:15px;
90
+ font-weight:bold;
91
+ margin-bottom:0px;
92
+ margin-top:0px;
93
+ width:110px;
94
+ }
95
+
96
+ .ngg-album-compact p {
97
+ font-size:11px;
98
+ margin-top:2px;
99
+ }
100
+
101
+ /* ----------- Gallery style -------------*/
102
+
103
+ .ngg-galleryoverview {
104
+ margin-top: 10px;
105
+ width: 100%;
106
+ clear:both;
107
+ display:block !important;
108
+ }
109
+
110
+ .ngg-gallery-thumbnail-box {
111
+ float: left;
112
+ }
113
+
114
+ .ngg-gallery-thumbnail {
115
+ float: left;
116
+ background: url(shadowAlpha.png) no-repeat bottom right !important;
117
+ background: url(shadow.gif) no-repeat bottom right;
118
+ margin: 10px 0 0 10px !important;
119
+ }
120
+
121
+ .ngg-gallery-thumbnail img {
122
+ margin: -6px 6px 6px -6px;
123
+ background-color:#FFFFFF;
124
+ border:1px solid #A9A9A9;
125
+ display:block;
126
+ padding:4px;
127
+ position:relative;
128
+ }
129
+
130
+ .ngg-gallery-thumbnail img:hover {
131
+ background-color: #A9A9A9;
132
+ }
133
+
134
+ .ngg-gallery-thumbnail span {
135
+ display:none;
136
+ }
137
+
138
+ .ngg-clear {
139
+ clear: both;
140
+ }
141
+
142
+ /* ----------- Gallery navigation -------------*/
143
+
144
+ .ngg-navigation {
145
+ font-size:0.9em !important;
146
+ clear:both !important;
147
+ display:block !important;
148
+ padding-top:15px;
149
+ text-align:center;
150
+ }
151
+
152
+ .ngg-navigation span {
153
+ font-weight:bold;
154
+ margin:0pt 6px;
155
+ }
156
+
157
+ .ngg-navigation a.page-numbers,
158
+ .ngg-navigation a.next,
159
+ .ngg-navigation a.prev,
160
+ .ngg-navigation span.page-numbers,
161
+ .ngg-navigation span.next,
162
+ .ngg-navigation span.prev {
163
+ border:1px solid #DDDDDD;
164
+ margin-right:3px;
165
+ padding:3px 7px;
166
+ }
167
+
168
+ .ngg-navigation a.page-numbers:hover,
169
+ .ngg-navigation a.next:hover,
170
+ .ngg-navigation a.prev:hover,
171
+ .ngg-navigation span.page-numbers:hover,
172
+ .ngg-navigation span.next:hover,
173
+ .ngg-navigation span.prev:hover {
174
+ background-color: #0066CC;
175
+ color: #FFFFFF !important;
176
+ text-decoration: none !important;
177
+ }
178
+
179
+ /* ----------- Image browser style -------------*/
180
+
181
+ .ngg-imagebrowser {
182
+
183
+ }
184
+
185
+ .ngg-imagebrowser h3 {
186
+ text-align:center;
187
+ }
188
+
189
+ .ngg-imagebrowser img {
190
+ border:1px solid #A9A9A9;
191
+ margin-top: 10px;
192
+ margin-bottom: 10px;
193
+ width: 100%;
194
+ display:block !important;
195
+ padding:5px;
196
+ }
197
+
198
+ .ngg-imagebrowser-nav {
199
+ padding:5px;
200
+ margin-left:10px;
201
+ }
202
+
203
+ .ngg-imagebrowser-nav .back {
204
+ float:left;
205
+ border:1px solid #DDDDDD;
206
+ margin-right:3px;
207
+ padding:3px 7px;
208
+ }
209
+
210
+ .ngg-imagebrowser-nav .next {
211
+ float:right;
212
+ border:1px solid #DDDDDD;
213
+ margin-right:3px;
214
+ padding:3px 7px;
215
+ }
216
+
217
+ .ngg-imagebrowser-nav .counter {
218
+ text-align:center;
219
+ font-size:0.9em !important;
220
+ }
221
+
222
+ .exif-data {
223
+ margin-left: auto !important;
224
+ margin-right: auto !important;
225
+ }
226
+
227
+ /* ----------- Slideshow -------------*/
228
+ .slideshow {
229
+ margin-left: auto;
230
+ margin-right: auto;
231
+ text-align:center;
232
+ outline: none;
233
+ }
234
+
235
+ .slideshowlink {
236
+
237
+ }
238
+
239
+ /* ----------- JS Slideshow -------------*/
240
+ .ngg-slideshow {
241
+ overflow:hidden;
242
+ position: relative;
243
+ }
244
+
245
+ .ngg-slideshow * {
246
+ vertical-align:middle;
247
+ }
248
+
249
+ /* See also : http://www.brunildo.org/test/img_center.html */
250
+ .ngg-slideshow-loader{
251
+ display: table-cell;
252
+ text-align: center;
253
+ vertical-align:middle;
254
+ }
255
+
256
+ .ngg-slideshow-loader img{
257
+ background: none !important;
258
+ border: 0 none !important;
259
+ margin:auto !important;
260
+ }
261
+
262
+ /* ----------- Single picture -------------*/
263
+ .ngg-singlepic {
264
+ background-color:#FFFFFF;
265
+ display:block;
266
+ padding:4px;
267
+ }
268
+
269
+ .ngg-left {
270
+ float: left;
271
+ margin-right:10px;
272
+ }
273
+
274
+ .ngg-right {
275
+ float: right;
276
+ margin-left:10px;
277
+ }
278
+
279
+ .ngg-center {
280
+ margin-left: auto !important;
281
+ margin-right: auto !important;
282
+ }
283
+
284
+ /* ----------- Sidebar widget -------------*/
285
+
286
+ .ngg-widget,
287
+ .ngg-widget-slideshow {
288
+ overflow: hidden;
289
+ margin:0pt;
290
+ padding:5px 0px 0px 0pt;
291
+ }
292
+
293
+ .ngg-widget img {
294
+ border:2px solid #A9A9A9;
295
+ margin:0pt 2px 2px 0px;
296
+ padding:1px;
297
+ }
298
+
299
+ /* ----------- Related images -------------*/
300
+ .ngg-related-gallery {
301
+ background:#F9F9F9;
302
+ border:1px solid #E0E0E0;
303
+ overflow:hidden;
304
+ margin-bottom:1em;
305
+ margin-top:1em;
306
+ padding:5px;
307
+ }
308
+ .ngg-related-gallery img {
309
+ border: 1px solid #DDDDDD;
310
+ float: left;
311
+ margin: 0pt 3px;
312
+ padding: 2px;
313
+ height: 50px;
314
+ width: 50px;
315
+ }
316
+
317
+ .ngg-related-gallery img:hover {
318
+ border: 1px solid #000000;
319
+ }
320
+
321
+ /* ----------- Gallery list -------------*/
322
+
323
+ .ngg-galleryoverview ul li:before {
324
+ content: '' !important;
325
+ }
326
+
327
+ .ngg-gallery-list {
328
+ list-style-type:none;
329
+ padding: 0px !important;
330
+ text-indent:0px !important;
331
+ }
332
+
333
+ .ngg-galleryoverview div.pic img{
334
+ width: 100%;
335
+ }
336
+
337
+ .ngg-gallery-list li {
338
+ float:left;
339
+ margin:0 2px 0px 2px !important;
340
+ overflow:hidden;
341
+ }
342
+
343
+ .ngg-gallery-list li a {
344
+ border:1px solid #CCCCCC;
345
+ display:block;
346
+ padding:2px;
347
+ }
348
+
349
+ .ngg-gallery-list li.selected a{
350
+ -moz-background-clip:border;
351
+ -moz-background-inline-policy:continuous;
352
+ -moz-background-origin:padding;
353
+ background:#000000 none repeat scroll 0 0;
354
+ }
355
+
356
+ .ngg-gallery-list li img {
357
+ height:40px;
358
+ width:40px;
359
+ }
360
+
361
+ li.ngg-next, li.ngg-prev {
362
+ height:40px;
363
+ width:40px;
364
+ font-size:3.5em;
365
+ }
366
+
367
+ li.ngg-next a, li.ngg-prev a {
368
+ padding-top: 10px;
369
+ border: none;
370
+ text-decoration: none;
371
+ }
css/ngg_shadow2.css ADDED
@@ -0,0 +1,379 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ CSS Name: Shadow Effect with Description text
3
+ Description: NextGEN Default Style with a Shadow effect and description text below the thumbnail
4
+ Author: Alex Rabe
5
+ Version: 1.60
6
+
7
+ This is a template stylesheet that can be used with NextGEN Gallery. I tested the
8
+ styles with a default theme Kubrick. Modify it when your theme struggle with it,
9
+ it's only a template design
10
+
11
+ */
12
+
13
+ /* ----------- Album Styles Extend -------------*/
14
+
15
+ .ngg-albumoverview {
16
+ margin-top: 10px;
17
+ width: 100%;
18
+ clear:both;
19
+ display:block !important;
20
+ }
21
+
22
+ .ngg-album {
23
+ /*height: 130px;*/
24
+ padding: 5px;
25
+ margin-bottom: 5px;
26
+ border: 1px solid #cccccc;
27
+ overflow:hidden;
28
+ }
29
+
30
+ .ngg-albumtitle {
31
+ text-align: left;
32
+ font-weight: bold;
33
+ margin:0px;
34
+ padding:0px;
35
+ font-size: 1.4em;
36
+ margin-bottom: 10px;
37
+ }
38
+
39
+ .ngg-thumbnail {
40
+ float: left;
41
+ margin-right: 12px;
42
+ }
43
+
44
+ .ngg-thumbnail img {
45
+ background-color:#FFFFFF;
46
+ border:1px solid #A9A9A9;
47
+ margin:4px 0px 4px 5px;
48
+ padding:4px;
49
+ position:relative;
50
+ }
51
+
52
+ .ngg-thumbnail img:hover {
53
+ background-color: #A9A9A9;
54
+ }
55
+
56
+ .ngg-description {
57
+ text-align: left;
58
+ }
59
+
60
+ /* ----------- Album Styles Compact -------------*/
61
+
62
+ .ngg-album-compact {
63
+ float:left;
64
+ height:180px;
65
+ padding-right:6px !important;
66
+ margin:0px !important;
67
+ text-align:left;
68
+ width:120px;
69
+ }
70
+
71
+ .ngg-album-compactbox {
72
+ background:transparent url(albumset.gif) no-repeat scroll 0%;
73
+ height:86px;
74
+ margin:0pt 0pt 6px !important;
75
+ padding:12px 0pt 0pt 7px !important;
76
+ width:120px;
77
+ }
78
+
79
+
80
+ .ngg-album-compactbox .Thumb {
81
+ border:1px solid #000000;
82
+ margin:0px !important;
83
+ padding:0px !important;
84
+ width:91px;
85
+ height:68px;
86
+ }
87
+
88
+ .ngg-album-compact h4 {
89
+ font-size:15px;
90
+ font-weight:bold;
91
+ margin-bottom:0px;
92
+ margin-top:0px;
93
+ width:110px;
94
+ }
95
+
96
+ .ngg-album-compact p {
97
+ font-size:11px;
98
+ margin-top:2px;
99
+ }
100
+
101
+ /* ----------- Gallery style -------------*/
102
+
103
+ .ngg-galleryoverview {
104
+ margin-top: 10px;
105
+ width: 100%;
106
+ clear:both;
107
+ display:block !important;
108
+ }
109
+
110
+ .ngg-gallery-thumbnail-box {
111
+ float: left;
112
+ }
113
+
114
+ .ngg-gallery-thumbnail {
115
+ float: left;
116
+ background: url(shadowAlpha.png) no-repeat bottom right !important;
117
+ background: url(shadow.gif) no-repeat bottom right;
118
+ margin: 10px 0 0 10px !important;
119
+ padding:10px 15px 10px 15px;
120
+ border-color:#EEEEEE;
121
+ border-style:solid none none solid;
122
+ border-width:1px medium medium 1px;
123
+ }
124
+
125
+ .ngg-gallery-thumbnail img {
126
+ margin: -6px 6px 6px -6px;
127
+ background-color:#FFFFFF;
128
+ border:1px solid #A9A9A9;
129
+ display:block;
130
+ padding:4px;
131
+ position:relative;
132
+ }
133
+
134
+ .ngg-gallery-thumbnail img:hover {
135
+ background-color: #A9A9A9;
136
+ }
137
+
138
+ .ngg-gallery-thumbnail span {
139
+ margin: -6px 6px 6px -6px;
140
+ text-align:center;
141
+ font-size:90%;
142
+ color:#808080;
143
+ display:block;
144
+ }
145
+
146
+ .ngg-clear {
147
+ clear: both;
148
+ }
149
+
150
+ /* ----------- Gallery navigation -------------*/
151
+
152
+ .ngg-navigation {
153
+ font-size:0.9em !important;
154
+ clear:both !important;
155
+ display:block !important;
156
+ padding-top:15px;
157
+ text-align:center;
158
+ }
159
+
160
+ .ngg-navigation span {
161
+ font-weight:bold;
162
+ margin:0pt 6px;
163
+ }
164
+
165
+ .ngg-navigation a.page-numbers,
166
+ .ngg-navigation a.next,
167
+ .ngg-navigation a.prev,
168
+ .ngg-navigation span.page-numbers,
169
+ .ngg-navigation span.next,
170
+ .ngg-navigation span.prev {
171
+ border:1px solid #DDDDDD;
172
+ margin-right:3px;
173
+ padding:3px 7px;
174
+ }
175
+
176
+ .ngg-navigation a.page-numbers:hover,
177
+ .ngg-navigation a.next:hover,
178
+ .ngg-navigation a.prev:hover,
179
+ .ngg-navigation span.page-numbers:hover,
180
+ .ngg-navigation span.next:hover,
181
+ .ngg-navigation span.prev:hover {
182
+ background-color: #0066CC;
183
+ color: #FFFFFF !important;
184
+ text-decoration: none !important;
185
+ }
186
+
187
+ /* ----------- Image browser style -------------*/
188
+
189
+ .ngg-imagebrowser {
190
+
191
+ }
192
+
193
+ .ngg-imagebrowser h3 {
194
+ text-align:center;
195
+ }
196
+
197
+ .ngg-imagebrowser img {
198
+ border:1px solid #A9A9A9;
199
+ margin-top: 10px;
200
+ margin-bottom: 10px;
201
+ width: 100%;
202
+ display:block !important;
203
+ padding:5px;
204
+ }
205
+
206
+ .ngg-imagebrowser-nav {
207
+ padding:5px;
208
+ margin-left:10px;
209
+ }
210
+
211
+ .ngg-imagebrowser-nav .back {
212
+ float:left;
213
+ border:1px solid #DDDDDD;
214
+ margin-right:3px;
215
+ padding:3px 7px;
216
+ }
217
+
218
+ .ngg-imagebrowser-nav .next {
219
+ float:right;
220
+ border:1px solid #DDDDDD;
221
+ margin-right:3px;
222
+ padding:3px 7px;
223
+ }
224
+
225
+ .ngg-imagebrowser-nav .counter {
226
+ text-align:center;
227
+ font-size:0.9em !important;
228
+ }
229
+
230
+ .exif-data {
231
+ margin-left: auto !important;
232
+ margin-right: auto !important;
233
+ }
234
+
235
+ /* ----------- Slideshow -------------*/
236
+ .slideshow {
237
+ margin-left: auto;
238
+ margin-right: auto;
239
+ text-align:center;
240
+ outline: none;
241
+ }
242
+
243
+ .slideshowlink {
244
+
245
+ }
246
+
247
+ /* ----------- JS Slideshow -------------*/
248
+ .ngg-slideshow {
249
+ overflow:hidden;
250
+ position: relative;
251
+ }
252
+
253
+ .ngg-slideshow * {
254
+ vertical-align:middle;
255
+ }
256
+
257
+ /* See also : http://www.brunildo.org/test/img_center.html */
258
+ .ngg-slideshow-loader{
259
+ display: table-cell;
260
+ text-align: center;
261
+ vertical-align:middle;
262
+ }
263
+
264
+ .ngg-slideshow-loader img{
265
+ background: none !important;
266
+ border: 0 none !important;
267
+ margin:auto !important;
268
+ }
269
+
270
+ /* ----------- Single picture -------------*/
271
+ .ngg-singlepic {
272
+ background-color:#FFFFFF;
273
+ display:block;
274
+ padding:4px;
275
+ }
276
+
277
+ .ngg-left {
278
+ float: left;
279
+ margin-right:10px;
280
+ }
281
+
282
+ .ngg-right {
283
+ float: right;
284
+ margin-left:10px;
285
+ }
286
+
287
+ .ngg-center {
288
+ margin-left: auto !important;
289
+ margin-right: auto !important;
290
+ }
291
+
292
+ /* ----------- Sidebar widget -------------*/
293
+
294
+ .ngg-widget,
295
+ .ngg-widget-slideshow {
296
+ overflow: hidden;
297
+ margin:0pt;
298
+ padding:5px 0px 0px 0pt;
299
+ }
300
+
301
+ .ngg-widget img {
302
+ border:2px solid #A9A9A9;
303
+ margin:0pt 2px 2px 0px;
304
+ padding:1px;
305
+ }
306
+
307
+ /* ----------- Related images -------------*/
308
+ .ngg-related-gallery {
309
+ background:#F9F9F9;
310
+ border:1px solid #E0E0E0;
311
+ overflow:hidden;
312
+ margin-bottom:1em;
313
+ margin-top:1em;
314
+ padding:5px;
315
+ }
316
+ .ngg-related-gallery img {
317
+ border: 1px solid #DDDDDD;
318
+ float: left;
319
+ margin: 0pt 3px;
320
+ padding: 2px;
321
+ height: 50px;
322
+ width: 50px;
323
+ }
324
+
325
+ .ngg-related-gallery img:hover {
326
+ border: 1px solid #000000;
327
+ }
328
+
329
+ /* ----------- Gallery list -------------*/
330
+
331
+ .ngg-galleryoverview ul li:before {
332
+ content: '' !important;
333
+ }
334
+
335
+ .ngg-gallery-list {
336
+ list-style-type:none;
337
+ padding: 0px !important;
338
+ text-indent:0px !important;
339
+ }
340
+
341
+ .ngg-galleryoverview div.pic img{
342
+ width: 100%;
343
+ }
344
+
345
+ .ngg-gallery-list li {
346
+ float:left;
347
+ margin:0 2px 0px 2px !important;
348
+ overflow:hidden;
349
+ }
350
+
351
+ .ngg-gallery-list li a {
352
+ border:1px solid #CCCCCC;
353
+ display:block;
354
+ padding:2px;
355
+ }
356
+
357
+ .ngg-gallery-list li.selected a{
358
+ -moz-background-clip:border;
359
+ -moz-background-inline-policy:continuous;
360
+ -moz-background-origin:padding;
361
+ background:#000000 none repeat scroll 0 0;
362
+ }
363
+
364
+ .ngg-gallery-list li img {
365
+ height:40px;
366
+ width:40px;
367
+ }
368
+
369
+ li.ngg-next, li.ngg-prev {
370
+ height:40px;
371
+ width:40px;
372
+ font-size:3.5em;
373
+ }
374
+
375
+ li.ngg-next a, li.ngg-prev a {
376
+ padding-top: 10px;
377
+ border: none;
378
+ text-decoration: none;
379
+ }
css/nggallery.css ADDED
@@ -0,0 +1,403 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ CSS Name: Default Styles
3
+ Description: NextGEN Default Gallery Stylesheet
4
+ Author: Alex Rabe
5
+ Version: 2.11
6
+
7
+ This is a template stylesheet that can be used with NextGEN Gallery. I tested the
8
+ styles with a default theme Kubrick. Modify it when your theme struggle with it,
9
+ it's only a template design
10
+
11
+ */
12
+
13
+ /* ----------- Album Styles Extend -------------*/
14
+
15
+ .ngg-albumoverview {
16
+ margin-top: 10px;
17
+ width: 100%;
18
+ clear:both;
19
+ display:block !important;
20
+ }
21
+
22
+ .ngg-album {
23
+ height: 100%;
24
+ padding: 5px;
25
+ margin-bottom: 5px;
26
+ border: 1px solid #fff;
27
+ }
28
+
29
+ /* IE6 will ignore this , again I hate IE6 */
30
+ /* See also http://www.sitepoint.com/article/browser-specific-css-hacks */
31
+ html>body .ngg-album {
32
+ overflow:hidden;
33
+ padding: 5px;
34
+ margin-bottom: 5px;
35
+ border: 1px solid #cccccc;
36
+ }
37
+
38
+ .ngg-album {
39
+ overflow: hidden;
40
+ padding: 5px;
41
+ margin-bottom: 5px;
42
+ border: 1px solid #cccccc;
43
+ }
44
+
45
+ .ngg-albumtitle {
46
+ text-align: left;
47
+ font-weight: bold;
48
+ margin:0px;
49
+ padding:0px;
50
+ font-size: 1.4em;
51
+ margin-bottom: 10px;
52
+ }
53
+
54
+ .ngg-thumbnail {
55
+ float: left;
56
+ margin-right: 12px;
57
+ }
58
+
59
+ .ngg-thumbnail img {
60
+ background-color:#FFFFFF;
61
+ border:1px solid #A9A9A9;
62
+ margin:4px 0px 4px 5px;
63
+ padding:4px;
64
+ position:relative;
65
+ }
66
+
67
+ .ngg-thumbnail img:hover {
68
+ background-color: #A9A9A9;
69
+ }
70
+
71
+ .ngg-description {
72
+ text-align: left;
73
+ }
74
+
75
+ /* ----------- Album Styles Compact -------------*/
76
+
77
+ .ngg-album-compact {
78
+ float:left;
79
+ padding-right:6px !important;
80
+ margin:0px !important;
81
+ text-align:left;
82
+ width:120px;
83
+ }
84
+
85
+ .ngg-album-compactbox {
86
+ background:transparent url(albumset.gif) no-repeat scroll 0%;
87
+ height:86px;
88
+ margin:0pt 0pt 6px !important;
89
+ padding:12px 0pt 0pt 7px !important;
90
+ width:120px;
91
+ }
92
+
93
+
94
+ .ngg-album-compactbox .Thumb {
95
+ border:1px solid #000000;
96
+ margin:0px !important;
97
+ padding:0px !important;
98
+ width:91px;
99
+ height:68px;
100
+ }
101
+
102
+ .ngg-album-compact h4 {
103
+ font-size:15px;
104
+ font-weight:bold;
105
+ margin-bottom:0px;
106
+ margin-top:0px;
107
+ width:110px;
108
+ }
109
+
110
+ .ngg-album-compact p {
111
+ font-size:11px;
112
+ margin-top:2px;
113
+ }
114
+
115
+ /* ----------- Gallery style -------------*/
116
+
117
+ .ngg-galleryoverview {
118
+ overflow: hidden;
119
+ margin-top: 10px;
120
+ width: 100%;
121
+ clear:both;
122
+ display:block !important;
123
+ }
124
+
125
+ .ngg-galleryoverview .desc {
126
+ /* required for description */
127
+ margin:0px 10px 10px 0px;
128
+ padding:5px;
129
+ }
130
+
131
+ .ngg-gallery-thumbnail-box {
132
+ float: left;
133
+ }
134
+
135
+ .ngg-gallery-thumbnail {
136
+ float: left;
137
+ margin-right: 5px;
138
+ text-align: center;
139
+ }
140
+
141
+ .ngg-gallery-thumbnail img {
142
+ background-color:#FFFFFF;
143
+ border:1px solid #A9A9A9;
144
+ display:block;
145
+ margin:4px 0px 4px 5px;
146
+ padding:4px;
147
+ position:relative;
148
+ }
149
+
150
+ .ngg-gallery-thumbnail img:hover {
151
+ background-color: #A9A9A9;
152
+ }
153
+
154
+ .ngg-gallery-thumbnail span {
155
+ /* Images description */
156
+ font-size:90%;
157
+ padding-left:5px;
158
+ display:block;
159
+ }
160
+
161
+ .ngg-clear {
162
+ clear: both;
163
+ float: none;
164
+ }
165
+
166
+ /* ----------- Gallery navigation -------------*/
167
+
168
+ .ngg-navigation {
169
+ font-size:0.9em !important;
170
+ clear:both !important;
171
+ display:block !important;
172
+ padding-top: 15px;
173
+ padding-bottom: 2px;
174
+ text-align:center;
175
+ }
176
+
177
+ .ngg-navigation span {
178
+ font-weight:bold;
179
+ margin:0pt 6px;
180
+ }
181
+
182
+ .ngg-navigation a.page-numbers,
183
+ .ngg-navigation a.next,
184
+ .ngg-navigation a.prev,
185
+ .ngg-navigation span.page-numbers,
186
+ .ngg-navigation span.next,
187
+ .ngg-navigation span.prev {
188
+ border:1px solid #DDDDDD;
189
+ margin-right:3px;
190
+ padding:3px 8px;
191
+ text-decoration: none;
192
+ }
193
+
194
+ .ngg-navigation a.page-numbers:hover,
195
+ .ngg-navigation a.next:hover,
196
+ .ngg-navigation a.prev:hover,
197
+ .ngg-navigation span.page-numbers:hover,
198
+ .ngg-navigation span.next:hover,
199
+ .ngg-navigation span.prev:hover {
200
+ background-color: #0066CC;
201
+ color: #FFFFFF !important;
202
+ text-decoration: none !important;
203
+ }
204
+
205
+ /* ----------- Image browser style -------------*/
206
+
207
+ .ngg-imagebrowser {
208
+
209
+ }
210
+
211
+ .ngg-imagebrowser h3 {
212
+ text-align:center;
213
+ }
214
+
215
+ .ngg-imagebrowser img {
216
+ border:1px solid #A9A9A9;
217
+ margin-top: 10px;
218
+ margin-bottom: 10px;
219
+ width: 100%;
220
+ display:block !important;
221
+ padding:5px;
222
+ }
223
+
224
+ .ngg-imagebrowser-nav {
225
+ padding:5px;
226
+ margin-left:10px;
227
+ }
228
+
229
+ .ngg-imagebrowser-nav .back {
230
+ float:left;
231
+ border:1px solid #DDDDDD;
232
+ margin-right:3px;
233
+ padding:3px 7px;
234
+ }
235
+
236
+ .ngg-imagebrowser-nav .next {
237
+ float:right;
238
+ border:1px solid #DDDDDD;
239
+ margin-right:3px;
240
+ padding:3px 7px;
241
+ }
242
+
243
+ .ngg-imagebrowser-nav .counter {
244
+ text-align:center;
245
+ font-size:0.9em !important;
246
+ }
247
+
248
+ .exif-data {
249
+ margin-left: auto !important;
250
+ margin-right: auto !important;
251
+ }
252
+
253
+ /* ----------- Slideshow -------------*/
254
+ .slideshow {
255
+ margin-left: auto;
256
+ margin-right: auto;
257
+ text-align:center;
258
+ outline: none;
259
+ }
260
+
261
+ .slideshowlink {
262
+
263
+ }
264
+
265
+ /* ----------- JS Slideshow -------------*/
266
+ .ngg-slideshow {
267
+ overflow:hidden;
268
+ position: relative;
269
+ margin-left: auto;
270
+ margin-right: auto;
271
+ }
272
+
273
+ .ngg-slideshow * {
274
+ vertical-align:middle;
275
+ }
276
+
277
+ /* See also : http://www.brunildo.org/test/img_center.html */
278
+ .ngg-slideshow-loader{
279
+ display: table-cell;
280
+ text-align: center;
281
+ vertical-align:middle;
282
+ }
283
+
284
+ .ngg-slideshow-loader img{
285
+ background: none !important;
286
+ border: 0 none !important;
287
+ margin:auto !important;
288
+ }
289
+
290
+ /* ----------- Single picture -------------*/
291
+ .ngg-singlepic {
292
+ background-color:#FFFFFF;
293
+ display:block;
294
+ padding:4px;
295
+ }
296
+
297
+ .ngg-left {
298
+ float: left;
299
+ margin-right:10px;
300
+ }
301
+
302
+ .ngg-right {
303
+ float: right;
304
+ margin-left:10px;
305
+ }
306
+
307
+ .ngg-center {
308
+ margin-left: auto !important;
309
+ margin-right: auto !important;
310
+ }
311
+
312
+ /* ----------- Sidebar widget -------------*/
313
+ .ngg-widget,
314
+ .ngg-widget-slideshow {
315
+ overflow: hidden;
316
+ margin:0pt;
317
+ padding:5px 0px 0px 0pt;
318
+ text-align:left;
319
+ }
320
+
321
+ .ngg-widget img {
322
+ border:2px solid #A9A9A9;
323
+ margin:0pt 2px 2px 0px;
324
+ padding:1px;
325
+ }
326
+
327
+ /* ----------- Related images -------------*/
328
+ .ngg-related-gallery {
329
+ background:#F9F9F9;
330
+ border:1px solid #E0E0E0;
331
+ overflow:hidden;
332
+ margin-bottom:1em;
333
+ margin-top:1em;
334
+ padding:5px;
335
+ }
336
+ .ngg-related-gallery img {
337
+ border: 1px solid #DDDDDD;
338
+ float: left;
339
+ margin: 0pt 3px;
340
+ padding: 2px;
341
+ height: 50px;
342
+ width: 50px;
343
+ }
344
+
345
+ .ngg-related-gallery img:hover {
346
+ border: 1px solid #000000;
347
+ }
348
+
349
+ /* ----------- Gallery list -------------*/
350
+
351
+ .ngg-galleryoverview ul li:before {
352
+ content: '' !important;
353
+ }
354
+
355
+ .ngg-gallery-list {
356
+ list-style-type:none;
357
+ padding: 0px !important;
358
+ text-indent:0px !important;
359
+ }
360
+
361
+ .ngg-galleryoverview div.pic img{
362
+ width: 100%;
363
+ }
364
+
365
+ .ngg-gallery-list li {
366
+ float:left;
367
+ margin:0 2px 0px 2px !important;
368
+ overflow:hidden;
369
+ }
370
+
371
+ .ngg-gallery-list li a {
372
+ border:1px solid #CCCCCC;
373
+ display:block;
374
+ padding:2px;
375
+ }
376
+
377
+ .ngg-gallery-list li.selected a{
378
+ -moz-background-clip:border;
379
+ -moz-background-inline-policy:continuous;
380
+ -moz-background-origin:padding;
381
+ background:#000000 none repeat scroll 0 0;
382
+ }
383
+
384
+ .ngg-gallery-list li img {
385
+ height:40px;
386
+ width:40px;
387
+ }
388
+
389
+ li.ngg-next, li.ngg-prev {
390
+ height:40px;
391
+ width:40px;
392
+ font-size:3.5em;
393
+ }
394
+
395
+ li.ngg-next a, li.ngg-prev a {
396
+ padding-top: 10px;
397
+ border: none;
398
+ text-decoration: none;
399
+ }
400
+
401
+ #TB_window {
402
+ z-index: 9999 !important;
403
+ }
css/shadow.gif ADDED
Binary file
css/shadowAlpha.png ADDED
Binary file
fonts/arial.ttf ADDED
Binary file
images/ajax-loader.gif ADDED
Binary file
images/loader.gif ADDED
Binary file
images/mrss-icon.gif ADDED
Binary file
images/piclens.gif ADDED
Binary file
index.html ADDED
File without changes
js/jquery.cycle.all.js ADDED
@@ -0,0 +1,1491 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Cycle Plugin (with Transition Definitions)
3
+ * Examples and documentation at: http://jquery.malsup.com/cycle/
4
+ * Copyright (c) 2007-2010 M. Alsup
5
+ * Version: 2.9995 (09-AUG-2011)
6
+ * Dual licensed under the MIT and GPL licenses.
7
+ * http://jquery.malsup.com/license.html
8
+ * Requires: jQuery v1.3.2 or later
9
+ */
10
+ (function($) {
11
+
12
+ var ver = '2.9995';
13
+
14
+ // if $.support is not defined (pre jQuery 1.3) add what I need
15
+ if ($.support == undefined) {
16
+ $.support = {
17
+ opacity: !($.browser.msie)
18
+ };
19
+ }
20
+
21
+ function debug(s) {
22
+ $.fn.cycle.debug && log(s);
23
+ }
24
+ function log() {
25
+ window.console && console.log && console.log('[cycle] ' + Array.prototype.join.call(arguments,' '));
26
+ }
27
+ $.expr[':'].paused = function(el) {
28
+ return el.cyclePause;
29
+ }
30
+
31
+
32
+ // the options arg can be...
33
+ // a number - indicates an immediate transition should occur to the given slide index
34
+ // a string - 'pause', 'resume', 'toggle', 'next', 'prev', 'stop', 'destroy' or the name of a transition effect (ie, 'fade', 'zoom', etc)
35
+ // an object - properties to control the slideshow
36
+ //
37
+ // the arg2 arg can be...
38
+ // the name of an fx (only used in conjunction with a numeric value for 'options')
39
+ // the value true (only used in first arg == 'resume') and indicates
40
+ // that the resume should occur immediately (not wait for next timeout)
41
+
42
+ $.fn.cycle = function(options, arg2) {
43
+ var o = { s: this.selector, c: this.context };
44
+
45
+ // in 1.3+ we can fix mistakes with the ready state
46
+ if (this.length === 0 && options != 'stop') {
47
+ if (!$.isReady && o.s) {
48
+ log('DOM not ready, queuing slideshow');
49
+ $(function() {
50
+ $(o.s,o.c).cycle(options,arg2);
51
+ });
52
+ return this;
53
+ }
54
+ // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
55
+ log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
56
+ return this;
57
+ }
58
+
59
+ // iterate the matched nodeset
60
+ return this.each(function() {
61
+ var opts = handleArguments(this, options, arg2);
62
+ if (opts === false)
63
+ return;
64
+
65
+ opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.cycle.updateActivePagerLink;
66
+
67
+ // stop existing slideshow for this container (if there is one)
68
+ if (this.cycleTimeout)
69
+ clearTimeout(this.cycleTimeout);
70
+ this.cycleTimeout = this.cyclePause = 0;
71
+
72
+ var $cont = $(this);
73
+ var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children();
74
+ var els = $slides.get();
75
+
76
+ var opts2 = buildOptions($cont, $slides, els, opts, o);
77
+ if (opts2 === false)
78
+ return;
79
+
80
+ if (els.length < 2) {
81
+ log('terminating; too few slides: ' + els.length);
82
+ return;
83
+ }
84
+
85
+ var startTime = opts2.continuous ? 10 : getTimeout(els[opts2.currSlide], els[opts2.nextSlide], opts2, !opts2.backwards);
86
+
87
+ // if it's an auto slideshow, kick it off
88
+ if (startTime) {
89
+ startTime += (opts2.delay || 0);
90
+ if (startTime < 10)
91
+ startTime = 10;
92
+ debug('first timeout: ' + startTime);
93
+ this.cycleTimeout = setTimeout(function(){go(els,opts2,0,!opts.backwards)}, startTime);
94
+ }
95
+ });
96
+ };
97
+
98
+ function triggerPause(cont, byHover, onPager) {
99
+ var opts = $(cont).data('cycle.opts');
100
+ var paused = !!cont.cyclePause;
101
+ if (paused && opts.paused)
102
+ opts.paused(cont, opts, byHover, onPager);
103
+ else if (!paused && opts.resumed)
104
+ opts.resumed(cont, opts, byHover, onPager);
105
+ }
106
+
107
+ // process the args that were passed to the plugin fn
108
+ function handleArguments(cont, options, arg2) {
109
+ if (cont.cycleStop == undefined)
110
+ cont.cycleStop = 0;
111
+ if (options === undefined || options === null)
112
+ options = {};
113
+ if (options.constructor == String) {
114
+ switch(options) {
115
+ case 'destroy':
116
+ case 'stop':
117
+ var opts = $(cont).data('cycle.opts');
118
+ if (!opts)
119
+ return false;
120
+ cont.cycleStop++; // callbacks look for change
121
+ if (cont.cycleTimeout)
122
+ clearTimeout(cont.cycleTimeout);
123
+ cont.cycleTimeout = 0;
124
+ opts.elements && $(opts.elements).stop();
125
+ $(cont).removeData('cycle.opts');
126
+ if (options == 'destroy')
127
+ destroy(opts);
128
+ return false;
129
+ case 'toggle':
130
+ cont.cyclePause = (cont.cyclePause === 1) ? 0 : 1;
131
+ checkInstantResume(cont.cyclePause, arg2, cont);
132
+ triggerPause(cont);
133
+ return false;
134
+ case 'pause':
135
+ cont.cyclePause = 1;
136
+ triggerPause(cont);
137
+ return false;
138
+ case 'resume':
139
+ cont.cyclePause = 0;
140
+ checkInstantResume(false, arg2, cont);
141
+ triggerPause(cont);
142
+ return false;
143
+ case 'prev':
144
+ case 'next':
145
+ var opts = $(cont).data('cycle.opts');
146
+ if (!opts) {
147
+ log('options not found, "prev/next" ignored');
148
+ return false;
149
+ }
150
+ $.fn.cycle[options](opts);
151
+ return false;
152
+ default:
153
+ options = { fx: options };
154
+ };
155
+ return options;
156
+ }
157
+ else if (options.constructor == Number) {
158
+ // go to the requested slide
159
+ var num = options;
160
+ options = $(cont).data('cycle.opts');
161
+ if (!options) {
162
+ log('options not found, can not advance slide');
163
+ return false;
164
+ }
165
+ if (num < 0 || num >= options.elements.length) {
166
+ log('invalid slide index: ' + num);
167
+ return false;
168
+ }
169
+ options.nextSlide = num;
170
+ if (cont.cycleTimeout) {
171
+ clearTimeout(cont.cycleTimeout);
172
+ cont.cycleTimeout = 0;
173
+ }
174
+ if (typeof arg2 == 'string')
175
+ options.oneTimeFx = arg2;
176
+ go(options.elements, options, 1, num >= options.currSlide);
177
+ return false;
178
+ }
179
+ return options;
180
+
181
+ function checkInstantResume(isPaused, arg2, cont) {
182
+ if (!isPaused && arg2 === true) { // resume now!
183
+ var options = $(cont).data('cycle.opts');
184
+ if (!options) {
185
+ log('options not found, can not resume');
186
+ return false;
187
+ }
188
+ if (cont.cycleTimeout) {
189
+ clearTimeout(cont.cycleTimeout);
190
+ cont.cycleTimeout = 0;
191
+ }
192
+ go(options.elements, options, 1, !options.backwards);
193
+ }
194
+ }
195
+ };
196
+
197
+ function removeFilter(el, opts) {
198
+ if (!$.support.opacity && opts.cleartype && el.style.filter) {
199
+ try { el.style.removeAttribute('filter'); }
200
+ catch(smother) {} // handle old opera versions
201
+ }
202
+ };
203
+
204
+ // unbind event handlers
205
+ function destroy(opts) {
206
+ if (opts.next)
207
+ $(opts.next).unbind(opts.prevNextEvent);
208
+ if (opts.prev)
209
+ $(opts.prev).unbind(opts.prevNextEvent);
210
+
211
+ if (opts.pager || opts.pagerAnchorBuilder)
212
+ $.each(opts.pagerAnchors || [], function() {
213
+ this.unbind().remove();
214
+ });
215
+ opts.pagerAnchors = null;
216
+ if (opts.destroy) // callback
217
+ opts.destroy(opts);
218
+ };
219
+
220
+ // one-time initialization
221
+ function buildOptions($cont, $slides, els, options, o) {
222
+ // support metadata plugin (v1.0 and v2.0)
223
+ var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
224
+ var meta = $.isFunction($cont.data) ? $cont.data(opts.metaAttr) : null;
225
+ if (meta)
226
+ opts = $.extend(opts, meta);
227
+ if (opts.autostop)
228
+ opts.countdown = opts.autostopCount || els.length;
229
+
230
+ var cont = $cont[0];
231
+ $cont.data('cycle.opts', opts);
232
+ opts.$cont = $cont;
233
+ opts.stopCount = cont.cycleStop;
234
+ opts.elements = els;
235
+ opts.before = opts.before ? [opts.before] : [];
236
+ opts.after = opts.after ? [opts.after] : [];
237
+
238
+ // push some after callbacks
239
+ if (!$.support.opacity && opts.cleartype)
240
+ opts.after.push(function() { removeFilter(this, opts); });
241
+ if (opts.continuous)
242
+ opts.after.push(function() { go(els,opts,0,!opts.backwards); });
243
+
244
+ saveOriginalOpts(opts);
245
+
246
+ // clearType corrections
247
+ if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
248
+ clearTypeFix($slides);
249
+
250
+ // container requires non-static position so that slides can be position within
251
+ if ($cont.css('position') == 'static')
252
+ $cont.css('position', 'relative');
253
+ if (opts.width)
254
+ $cont.width(opts.width);
255
+ if (opts.height && opts.height != 'auto')
256
+ $cont.height(opts.height);
257
+
258
+ if (opts.startingSlide)
259
+ opts.startingSlide = parseInt(opts.startingSlide,10);
260
+ else if (opts.backwards)
261
+ opts.startingSlide = els.length - 1;
262
+
263
+ // if random, mix up the slide array
264
+ if (opts.random) {
265
+ opts.randomMap = [];
266
+ for (var i = 0; i < els.length; i++)
267
+ opts.randomMap.push(i);
268
+ opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
269
+ opts.randomIndex = 1;
270
+ opts.startingSlide = opts.randomMap[1];
271
+ }
272
+ else if (opts.startingSlide >= els.length)
273
+ opts.startingSlide = 0; // catch bogus input
274
+ opts.currSlide = opts.startingSlide || 0;
275
+ var first = opts.startingSlide;
276
+
277
+ // set position and zIndex on all the slides
278
+ $slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) {
279
+ var z;
280
+ if (opts.backwards)
281
+ z = first ? i <= first ? els.length + (i-first) : first-i : els.length-i;
282
+ else
283
+ z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i;
284
+ $(this).css('z-index', z)
285
+ });
286
+
287
+ // make sure first slide is visible
288
+ $(els[first]).css('opacity',1).show(); // opacity bit needed to handle restart use case
289
+ removeFilter(els[first], opts);
290
+
291
+ // stretch slides
292
+ if (opts.fit) {
293
+ if (!opts.aspect) {
294
+ if (opts.width)
295
+ $slides.width(opts.width);
296
+ if (opts.height && opts.height != 'auto')
297
+ $slides.height(opts.height);
298
+ } else {
299
+ $slides.each(function(){
300
+ var $slide = $(this);
301
+ var ratio = (opts.aspect === true) ? $slide.width()/$slide.height() : opts.aspect;
302
+ if( opts.width && $slide.width() != opts.width ) {
303
+ $slide.width( opts.width );
304
+ $slide.height( opts.width / ratio );
305
+ }
306
+
307
+ if( opts.height && $slide.height() < opts.height ) {
308
+ $slide.height( opts.height );
309
+ $slide.width( opts.height * ratio );
310
+ }
311
+ });
312
+ }
313
+ }
314
+
315
+ if (opts.center && ((!opts.fit) || opts.aspect)) {
316
+ $slides.each(function(){
317
+ var $slide = $(this);
318
+ $slide.css({
319
+ "margin-left": opts.width ?
320
+ ((opts.width - $slide.width()) / 2) + "px" :
321
+ 0,
322
+ "margin-top": opts.height ?
323
+ ((opts.height - $slide.height()) / 2) + "px" :
324
+ 0
325
+ });
326
+ });
327
+ }
328
+
329
+ if (opts.center && !opts.fit && !opts.slideResize) {
330
+ $slides.each(function(){
331
+ var $slide = $(this);
332
+ $slide.css({
333
+ "margin-left": opts.width ? ((opts.width - $slide.width()) / 2) + "px" : 0,
334
+ "margin-top": opts.height ? ((opts.height - $slide.height()) / 2) + "px" : 0
335
+ });
336
+ });
337
+ }
338
+
339
+ // stretch container
340
+ var reshape = opts.containerResize && !$cont.innerHeight();
341
+ if (reshape) { // do this only if container has no size http://tinyurl.com/da2oa9
342
+ var maxw = 0, maxh = 0;
343
+ for(var j=0; j < els.length; j++) {
344
+ var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight();
345
+ if (!w) w = e.offsetWidth || e.width || $e.attr('width');
346
+ if (!h) h = e.offsetHeight || e.height || $e.attr('height');
347
+ maxw = w > maxw ? w : maxw;
348
+ maxh = h > maxh ? h : maxh;
349
+ }
350
+ if (maxw > 0 && maxh > 0)
351
+ $cont.css({width:maxw+'px',height:maxh+'px'});
352
+ }
353
+
354
+ var pauseFlag = false; // https://github.com/malsup/cycle/issues/44
355
+ if (opts.pause)
356
+ $cont.hover(
357
+ function(){
358
+ pauseFlag = true;
359
+ this.cyclePause++;
360
+ triggerPause(cont, true);
361
+ },
362
+ function(){
363
+ pauseFlag && this.cyclePause--;
364
+ triggerPause(cont, true);
365
+ }
366
+ );
367
+
368
+ if (supportMultiTransitions(opts) === false)
369
+ return false;
370
+
371
+ // apparently a lot of people use image slideshows without height/width attributes on the images.
372
+ // Cycle 2.50+ requires the sizing info for every slide; this block tries to deal with that.
373
+ var requeue = false;
374
+ options.requeueAttempts = options.requeueAttempts || 0;
375
+ $slides.each(function() {
376
+ // try to get height/width of each slide
377
+ var $el = $(this);
378
+ this.cycleH = (opts.fit && opts.height) ? opts.height : ($el.height() || this.offsetHeight || this.height || $el.attr('height') || 0);
379
+ this.cycleW = (opts.fit && opts.width) ? opts.width : ($el.width() || this.offsetWidth || this.width || $el.attr('width') || 0);
380
+
381
+ if ( $el.is('img') ) {
382
+ // sigh.. sniffing, hacking, shrugging... this crappy hack tries to account for what browsers do when
383
+ // an image is being downloaded and the markup did not include sizing info (height/width attributes);
384
+ // there seems to be some "default" sizes used in this situation
385
+ var loadingIE = ($.browser.msie && this.cycleW == 28 && this.cycleH == 30 && !this.complete);
386
+ var loadingFF = ($.browser.mozilla && this.cycleW == 34 && this.cycleH == 19 && !this.complete);
387
+ var loadingOp = ($.browser.opera && ((this.cycleW == 42 && this.cycleH == 19) || (this.cycleW == 37 && this.cycleH == 17)) && !this.complete);
388
+ var loadingOther = (this.cycleH == 0 && this.cycleW == 0 && !this.complete);
389
+ // don't requeue for images that are still loading but have a valid size
390
+ if (loadingIE || loadingFF || loadingOp || loadingOther) {
391
+ if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever
392
+ log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH);
393
+ setTimeout(function() {$(o.s,o.c).cycle(options)}, opts.requeueTimeout);
394
+ requeue = true;
395
+ return false; // break each loop
396
+ }
397
+ else {
398
+ log('could not determine size of image: '+this.src, this.cycleW, this.cycleH);
399
+ }
400
+ }
401
+ }
402
+ return true;
403
+ });
404
+
405
+ if (requeue)
406
+ return false;
407
+
408
+ opts.cssBefore = opts.cssBefore || {};
409
+ opts.cssAfter = opts.cssAfter || {};
410
+ opts.cssFirst = opts.cssFirst || {};
411
+ opts.animIn = opts.animIn || {};
412
+ opts.animOut = opts.animOut || {};
413
+
414
+ $slides.not(':eq('+first+')').css(opts.cssBefore);
415
+ $($slides[first]).css(opts.cssFirst);
416
+
417
+ if (opts.timeout) {
418
+ opts.timeout = parseInt(opts.timeout,10);
419
+ // ensure that timeout and speed settings are sane
420
+ if (opts.speed.constructor == String)
421
+ opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed,10);
422
+ if (!opts.sync)
423
+ opts.speed = opts.speed / 2;
424
+
425
+ var buffer = opts.fx == 'none' ? 0 : opts.fx == 'shuffle' ? 500 : 250;
426
+ while((opts.timeout - opts.speed) < buffer) // sanitize timeout
427
+ opts.timeout += opts.speed;
428
+ }
429
+ if (opts.easing)
430
+ opts.easeIn = opts.easeOut = opts.easing;
431
+ if (!opts.speedIn)
432
+ opts.speedIn = opts.speed;
433
+ if (!opts.speedOut)
434
+ opts.speedOut = opts.speed;
435
+
436
+ opts.slideCount = els.length;
437
+ opts.currSlide = opts.lastSlide = first;
438
+ if (opts.random) {
439
+ if (++opts.randomIndex == els.length)
440
+ opts.randomIndex = 0;
441
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
442
+ }
443
+ else if (opts.backwards)
444
+ opts.nextSlide = opts.startingSlide == 0 ? (els.length-1) : opts.startingSlide-1;
445
+ else
446
+ opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1;
447
+
448
+ // run transition init fn
449
+ if (!opts.multiFx) {
450
+ var init = $.fn.cycle.transitions[opts.fx];
451
+ if ($.isFunction(init))
452
+ init($cont, $slides, opts);
453
+ else if (opts.fx != 'custom' && !opts.multiFx) {
454
+ log('unknown transition: ' + opts.fx,'; slideshow terminating');
455
+ return false;
456
+ }
457
+ }
458
+
459
+ // fire artificial events
460
+ var e0 = $slides[first];
461
+ if (!opts.skipInitializationCallbacks) {
462
+ if (opts.before.length)
463
+ opts.before[0].apply(e0, [e0, e0, opts, true]);
464
+ if (opts.after.length)
465
+ opts.after[0].apply(e0, [e0, e0, opts, true]);
466
+ }
467
+ if (opts.next)
468
+ $(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1)});
469
+ if (opts.prev)
470
+ $(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0)});
471
+ if (opts.pager || opts.pagerAnchorBuilder)
472
+ buildPager(els,opts);
473
+
474
+ exposeAddSlide(opts, els);
475
+
476
+ return opts;
477
+ };
478
+
479
+ // save off original opts so we can restore after clearing state
480
+ function saveOriginalOpts(opts) {
481
+ opts.original = { before: [], after: [] };
482
+ opts.original.cssBefore = $.extend({}, opts.cssBefore);
483
+ opts.original.cssAfter = $.extend({}, opts.cssAfter);
484
+ opts.original.animIn = $.extend({}, opts.animIn);
485
+ opts.original.animOut = $.extend({}, opts.animOut);
486
+ $.each(opts.before, function() { opts.original.before.push(this); });
487
+ $.each(opts.after, function() { opts.original.after.push(this); });
488
+ };
489
+
490
+ function supportMultiTransitions(opts) {
491
+ var i, tx, txs = $.fn.cycle.transitions;
492
+ // look for multiple effects
493
+ if (opts.fx.indexOf(',') > 0) {
494
+ opts.multiFx = true;
495
+ opts.fxs = opts.fx.replace(/\s*/g,'').split(',');
496
+ // discard any bogus effect names
497
+ for (i=0; i < opts.fxs.length; i++) {
498
+ var fx = opts.fxs[i];
499
+ tx = txs[fx];
500
+ if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) {
501
+ log('discarding unknown transition: ',fx);
502
+ opts.fxs.splice(i,1);
503
+ i--;
504
+ }
505
+ }
506
+ // if we have an empty list then we threw everything away!
507
+ if (!opts.fxs.length) {
508
+ log('No valid transitions named; slideshow terminating.');
509
+ return false;
510
+ }
511
+ }
512
+ else if (opts.fx == 'all') { // auto-gen the list of transitions
513
+ opts.multiFx = true;
514
+ opts.fxs = [];
515
+ for (p in txs) {
516
+ tx = txs[p];
517
+ if (txs.hasOwnProperty(p) && $.isFunction(tx))
518
+ opts.fxs.push(p);
519
+ }
520
+ }
521
+ if (opts.multiFx && opts.randomizeEffects) {
522
+ // munge the fxs array to make effect selection random
523
+ var r1 = Math.floor(Math.random() * 20) + 30;
524
+ for (i = 0; i < r1; i++) {
525
+ var r2 = Math.floor(Math.random() * opts.fxs.length);
526
+ opts.fxs.push(opts.fxs.splice(r2,1)[0]);
527
+ }
528
+ debug('randomized fx sequence: ',opts.fxs);
529
+ }
530
+ return true;
531
+ };
532
+
533
+ // provide a mechanism for adding slides after the slideshow has started
534
+ function exposeAddSlide(opts, els) {
535
+ opts.addSlide = function(newSlide, prepend) {
536
+ var $s = $(newSlide), s = $s[0];
537
+ if (!opts.autostopCount)
538
+ opts.countdown++;
539
+ els[prepend?'unshift':'push'](s);
540
+ if (opts.els)
541
+ opts.els[prepend?'unshift':'push'](s); // shuffle needs this
542
+ opts.slideCount = els.length;
543
+
544
+ $s.css('position','absolute');
545
+ $s[prepend?'prependTo':'appendTo'](opts.$cont);
546
+
547
+ if (prepend) {
548
+ opts.currSlide++;
549
+ opts.nextSlide++;
550
+ }
551
+
552
+ if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
553
+ clearTypeFix($s);
554
+
555
+ if (opts.fit && opts.width)
556
+ $s.width(opts.width);
557
+ if (opts.fit && opts.height && opts.height != 'auto')
558
+ $s.height(opts.height);
559
+ s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height();
560
+ s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width();
561
+
562
+ $s.css(opts.cssBefore);
563
+
564
+ if (opts.pager || opts.pagerAnchorBuilder)
565
+ $.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts);
566
+
567
+ if ($.isFunction(opts.onAddSlide))
568
+ opts.onAddSlide($s);
569
+ else
570
+ $s.hide(); // default behavior
571
+ };
572
+ }
573
+
574
+ // reset internal state; we do this on every pass in order to support multiple effects
575
+ $.fn.cycle.resetState = function(opts, fx) {
576
+ fx = fx || opts.fx;
577
+ opts.before = []; opts.after = [];
578
+ opts.cssBefore = $.extend({}, opts.original.cssBefore);
579
+ opts.cssAfter = $.extend({}, opts.original.cssAfter);
580
+ opts.animIn = $.extend({}, opts.original.animIn);
581
+ opts.animOut = $.extend({}, opts.original.animOut);
582
+ opts.fxFn = null;
583
+ $.each(opts.original.before, function() { opts.before.push(this); });
584
+ $.each(opts.original.after, function() { opts.after.push(this); });
585
+
586
+ // re-init
587
+ var init = $.fn.cycle.transitions[fx];
588
+ if ($.isFunction(init))
589
+ init(opts.$cont, $(opts.elements), opts);
590
+ };
591
+
592
+ // this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt
593
+ function go(els, opts, manual, fwd) {
594
+ // opts.busy is true if we're in the middle of an animation
595
+ if (manual && opts.busy && opts.manualTrump) {
596
+ // let manual transitions requests trump active ones
597
+ debug('manualTrump in go(), stopping active transition');
598
+ $(els).stop(true,true);
599
+ opts.busy = 0;
600
+ }
601
+ // don't begin another timeout-based transition if there is one active
602
+ if (opts.busy) {
603
+ debug('transition active, ignoring new tx request');
604
+ return;
605
+ }
606
+
607
+ var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide];
608
+
609
+ // stop cycling if we have an outstanding stop request
610
+ if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual)
611
+ return;
612
+
613
+ // check to see if we should stop cycling based on autostop options
614
+ if (!manual && !p.cyclePause && !opts.bounce &&
615
+ ((opts.autostop && (--opts.countdown <= 0)) ||
616
+ (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) {
617
+ if (opts.end)
618
+ opts.end(opts);
619
+ return;
620
+ }
621
+
622
+ // if slideshow is paused, only transition on a manual trigger
623
+ var changed = false;
624
+ if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) {
625
+ changed = true;
626
+ var fx = opts.fx;
627
+ // keep trying to get the slide size if we don't have it yet
628
+ curr.cycleH = curr.cycleH || $(curr).height();
629
+ curr.cycleW = curr.cycleW || $(curr).width();
630
+ next.cycleH = next.cycleH || $(next).height();
631
+ next.cycleW = next.cycleW || $(next).width();
632
+
633
+ // support multiple transition types
634
+ if (opts.multiFx) {
635
+ if (fwd && (opts.lastFx == undefined || ++opts.lastFx >= opts.fxs.length))
636
+ opts.lastFx = 0;
637
+ else if (!fwd && (opts.lastFx == undefined || --opts.lastFx < 0))
638
+ opts.lastFx = opts.fxs.length - 1;
639
+ fx = opts.fxs[opts.lastFx];
640
+ }
641
+
642
+ // one-time fx overrides apply to: $('div').cycle(3,'zoom');
643
+ if (opts.oneTimeFx) {
644
+ fx = opts.oneTimeFx;
645
+ opts.oneTimeFx = null;
646
+ }
647
+
648
+ $.fn.cycle.resetState(opts, fx);
649
+
650
+ // run the before callbacks
651
+ if (opts.before.length)
652
+ $.each(opts.before, function(i,o) {
653
+ if (p.cycleStop != opts.stopCount) return;
654
+ o.apply(next, [curr, next, opts, fwd]);
655
+ });
656
+
657
+ // stage the after callacks
658
+ var after = function() {
659
+ opts.busy = 0;
660
+ $.each(opts.after, function(i,o) {
661
+ if (p.cycleStop != opts.stopCount) return;
662
+ o.apply(next, [curr, next, opts, fwd]);
663
+ });
664
+ };
665
+
666
+ debug('tx firing('+fx+'); currSlide: ' + opts.currSlide + '; nextSlide: ' + opts.nextSlide);
667
+
668
+ // get ready to perform the transition
669
+ opts.busy = 1;
670
+ if (opts.fxFn) // fx function provided?
671
+ opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
672
+ else if ($.isFunction($.fn.cycle[opts.fx])) // fx plugin ?
673
+ $.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent);
674
+ else
675
+ $.fn.cycle.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
676
+ }
677
+
678
+ if (changed || opts.nextSlide == opts.currSlide) {
679
+ // calculate the next slide
680
+ opts.lastSlide = opts.currSlide;
681
+ if (opts.random) {
682
+ opts.currSlide = opts.nextSlide;
683
+ if (++opts.randomIndex == els.length)
684
+ opts.randomIndex = 0;
685
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
686
+ if (opts.nextSlide == opts.currSlide)
687
+ opts.nextSlide = (opts.currSlide == opts.slideCount - 1) ? 0 : opts.currSlide + 1;
688
+ }
689
+ else if (opts.backwards) {
690
+ var roll = (opts.nextSlide - 1) < 0;
691
+ if (roll && opts.bounce) {
692
+ opts.backwards = !opts.backwards;
693
+ opts.nextSlide = 1;
694
+ opts.currSlide = 0;
695
+ }
696
+ else {
697
+ opts.nextSlide = roll ? (els.length-1) : opts.nextSlide-1;
698
+ opts.currSlide = roll ? 0 : opts.nextSlide+1;
699
+ }
700
+ }
701
+ else { // sequence
702
+ var roll = (opts.nextSlide + 1) == els.length;
703
+ if (roll && opts.bounce) {
704
+ opts.backwards = !opts.backwards;
705
+ opts.nextSlide = els.length-2;
706
+ opts.currSlide = els.length-1;
707
+ }
708
+ else {
709
+ opts.nextSlide = roll ? 0 : opts.nextSlide+1;
710
+ opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
711
+ }
712
+ }
713
+ }
714
+ if (changed && opts.pager)
715
+ opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass);
716
+
717
+ // stage the next transition
718
+ var ms = 0;
719
+ if (opts.timeout && !opts.continuous)
720
+ ms = getTimeout(els[opts.currSlide], els[opts.nextSlide], opts, fwd);
721
+ else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic
722
+ ms = 10;
723
+ if (ms > 0)
724
+ p.cycleTimeout = setTimeout(function(){ go(els, opts, 0, !opts.backwards) }, ms);
725
+ };
726
+
727
+ // invoked after transition
728
+ $.fn.cycle.updateActivePagerLink = function(pager, currSlide, clsName) {
729
+ $(pager).each(function() {
730
+ $(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);
731
+ });
732
+ };
733
+
734
+ // calculate timeout value for current transition
735
+ function getTimeout(curr, next, opts, fwd) {
736
+ if (opts.timeoutFn) {
737
+ // call user provided calc fn
738
+ var t = opts.timeoutFn.call(curr,curr,next,opts,fwd);
739
+ while (opts.fx != 'none' && (t - opts.speed) < 250) // sanitize timeout
740
+ t += opts.speed;
741
+ debug('calculated timeout: ' + t + '; speed: ' + opts.speed);
742
+ if (t !== false)
743
+ return t;
744
+ }
745
+ return opts.timeout;
746
+ };
747
+
748
+ // expose next/prev function, caller must pass in state
749
+ $.fn.cycle.next = function(opts) { advance(opts,1); };
750
+ $.fn.cycle.prev = function(opts) { advance(opts,0);};
751
+
752
+ // advance slide forward or back
753
+ function advance(opts, moveForward) {
754
+ var val = moveForward ? 1 : -1;
755
+ var els = opts.elements;
756
+ var p = opts.$cont[0], timeout = p.cycleTimeout;
757
+ if (timeout) {
758
+ clearTimeout(timeout);
759
+ p.cycleTimeout = 0;
760
+ }
761
+ if (opts.random && val < 0) {
762
+ // move back to the previously display slide
763
+ opts.randomIndex--;
764
+ if (--opts.randomIndex == -2)
765
+ opts.randomIndex = els.length-2;
766
+ else if (opts.randomIndex == -1)
767
+ opts.randomIndex = els.length-1;
768
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
769
+ }
770
+ else if (opts.random) {
771
+ opts.nextSlide = opts.randomMap[opts.randomIndex];
772
+ }
773
+ else {
774
+ opts.nextSlide = opts.currSlide + val;
775
+ if (opts.nextSlide < 0) {
776
+ if (opts.nowrap) return false;
777
+ opts.nextSlide = els.length - 1;
778
+ }
779
+ else if (opts.nextSlide >= els.length) {
780
+ if (opts.nowrap) return false;
781
+ opts.nextSlide = 0;
782
+ }
783
+ }
784
+
785
+ var cb = opts.onPrevNextEvent || opts.prevNextClick; // prevNextClick is deprecated
786
+ if ($.isFunction(cb))
787
+ cb(val > 0, opts.nextSlide, els[opts.nextSlide]);
788
+ go(els, opts, 1, moveForward);
789
+ return false;
790
+ };
791
+
792
+ function buildPager(els, opts) {
793
+ var $p = $(opts.pager);
794
+ $.each(els, function(i,o) {
795
+ $.fn.cycle.createPagerAnchor(i,o,$p,els,opts);
796
+ });
797
+ opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass);
798
+ };
799
+
800
+ $.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) {
801
+ var a;
802
+ if ($.isFunction(opts.pagerAnchorBuilder)) {
803
+ a = opts.pagerAnchorBuilder(i,el);
804
+ debug('pagerAnchorBuilder('+i+', el) returned: ' + a);
805
+ }
806
+ else
807
+ a = '<a href="#">'+(i+1)+'</a>';
808
+
809
+ if (!a)
810
+ return;
811
+ var $a = $(a);
812
+ // don't reparent if anchor is in the dom
813
+ if ($a.parents('body').length === 0) {
814
+ var arr = [];
815
+ if ($p.length > 1) {
816
+ $p.each(function() {
817
+ var $clone = $a.clone(true);
818
+ $(this).append($clone);
819
+ arr.push($clone[0]);
820
+ });
821
+ $a = $(arr);
822
+ }
823
+ else {
824
+ $a.appendTo($p);
825
+ }
826
+ }
827
+
828
+ opts.pagerAnchors = opts.pagerAnchors || [];
829
+ opts.pagerAnchors.push($a);
830
+
831
+ var pagerFn = function(e) {
832
+ e.preventDefault();
833
+ opts.nextSlide = i;
834
+ var p = opts.$cont[0], timeout = p.cycleTimeout;
835
+ if (timeout) {
836
+ clearTimeout(timeout);
837
+ p.cycleTimeout = 0;
838
+ }
839
+ var cb = opts.onPagerEvent || opts.pagerClick; // pagerClick is deprecated
840
+ if ($.isFunction(cb))
841
+ cb(opts.nextSlide, els[opts.nextSlide]);
842
+ go(els,opts,1,opts.currSlide < i); // trigger the trans
843
+ // return false; // <== allow bubble
844
+ }
845
+
846
+ if ( /mouseenter|mouseover/i.test(opts.pagerEvent) ) {
847
+ $a.hover(pagerFn, function(){/* no-op */} );
848
+ }
849
+ else {
850
+ $a.bind(opts.pagerEvent, pagerFn);
851
+ }
852
+
853
+ if ( ! /^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble)
854
+ $a.bind('click.cycle', function(){return false;}); // suppress click
855
+
856
+ var cont = opts.$cont[0];
857
+ var pauseFlag = false; // https://github.com/malsup/cycle/issues/44
858
+ if (opts.pauseOnPagerHover) {
859
+ $a.hover(
860
+ function() {
861
+ pauseFlag = true;
862
+ cont.cyclePause++;
863
+ triggerPause(cont,true,true);
864
+ }, function() {
865
+ pauseFlag && cont.cyclePause--;
866
+ triggerPause(cont,true,true);
867
+ }
868
+ );
869
+ }
870
+ };
871
+
872
+ // helper fn to calculate the number of slides between the current and the next
873
+ $.fn.cycle.hopsFromLast = function(opts, fwd) {
874
+ var hops, l = opts.lastSlide, c = opts.currSlide;
875
+ if (fwd)
876
+ hops = c > l ? c - l : opts.slideCount - l;
877
+ else
878
+ hops = c < l ? l - c : l + opts.slideCount - c;
879
+ return hops;
880
+ };
881
+
882
+ // fix clearType problems in ie6 by setting an explicit bg color
883
+ // (otherwise text slides look horrible during a fade transition)
884
+ function clearTypeFix($slides) {
885
+ debug('applying clearType background-color hack');
886
+ function hex(s) {
887
+ s = parseInt(s,10).toString(16);
888
+ return s.length < 2 ? '0'+s : s;
889
+ };
890
+ function getBg(e) {
891
+ for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) {
892
+ var v = $.css(e,'background-color');
893
+ if (v && v.indexOf('rgb') >= 0 ) {
894
+ var rgb = v.match(/\d+/g);
895
+ return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
896
+ }
897
+ if (v && v != 'transparent')
898
+ return v;
899
+ }
900
+ return '#ffffff';
901
+ };
902
+ $slides.each(function() { $(this).css('background-color', getBg(this)); });
903
+ };
904
+
905
+ // reset common props before the next transition
906
+ $.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) {
907
+ $(opts.elements).not(curr).hide();
908
+ if (typeof opts.cssBefore.opacity == 'undefined')
909
+ opts.cssBefore.opacity = 1;
910
+ opts.cssBefore.display = 'block';
911
+ if (opts.slideResize && w !== false && next.cycleW > 0)
912
+ opts.cssBefore.width = next.cycleW;
913
+ if (opts.slideResize && h !== false && next.cycleH > 0)
914
+ opts.cssBefore.height = next.cycleH;
915
+ opts.cssAfter = opts.cssAfter || {};
916
+ opts.cssAfter.display = 'none';
917
+ $(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0));
918
+ $(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1));
919
+ };
920
+
921
+ // the actual fn for effecting a transition
922
+ $.fn.cycle.custom = function(curr, next, opts, cb, fwd, speedOverride) {
923
+ var $l = $(curr), $n = $(next);
924
+ var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut;
925
+ $n.css(opts.cssBefore);
926
+ if (speedOverride) {
927
+ if (typeof speedOverride == 'number')
928
+ speedIn = speedOut = speedOverride;
929
+ else
930
+ speedIn = speedOut = 1;
931
+ easeIn = easeOut = null;
932
+ }
933
+ var fn = function() {
934
+ $n.animate(opts.animIn, speedIn, easeIn, function() {
935
+ cb();
936
+ });
937
+ };
938
+ $l.animate(opts.animOut, speedOut, easeOut, function() {
939
+ $l.css(opts.cssAfter);
940
+ if (!opts.sync)
941
+ fn();
942
+ });
943
+ if (opts.sync) fn();
944
+ };
945
+
946
+ // transition definitions - only fade is defined here, transition pack defines the rest
947
+ $.fn.cycle.transitions = {
948
+ fade: function($cont, $slides, opts) {
949
+ $slides.not(':eq('+opts.currSlide+')').css('opacity',0);
950
+ opts.before.push(function(curr,next,opts) {
951
+ $.fn.cycle.commonReset(curr,next,opts);
952
+ opts.cssBefore.opacity = 0;
953
+ });
954
+ opts.animIn = { opacity: 1 };
955
+ opts.animOut = { opacity: 0 };
956
+ opts.cssBefore = { top: 0, left: 0 };
957
+ }
958
+ };
959
+
960
+ $.fn.cycle.ver = function() { return ver; };
961
+
962
+ // override these globally if you like (they are all optional)
963
+ $.fn.cycle.defaults = {
964
+ activePagerClass: 'activeSlide', // class name used for the active pager link
965
+ after: null, // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
966
+ allowPagerClickBubble: false, // allows or prevents click event on pager anchors from bubbling
967
+ animIn: null, // properties that define how the slide animates in
968
+ animOut: null, // properties that define how the slide animates out
969
+ aspect: false, // preserve aspect ratio during fit resizing, cropping if necessary (must be used with fit option)
970
+ autostop: 0, // true to end slideshow after X transitions (where X == slide count)
971
+ autostopCount: 0, // number of transitions (optionally used with autostop to define X)
972
+ backwards: false, // true to start slideshow at last slide and move backwards through the stack
973
+ before: null, // transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
974
+ center: null, // set to true to have cycle add top/left margin to each slide (use with width and height options)
975
+ cleartype: !$.support.opacity, // true if clearType corrections should be applied (for IE)
976
+ cleartypeNoBg: false, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
977
+ containerResize: 1, // resize container to fit largest slide
978
+ continuous: 0, // true to start next transition immediately after current one completes
979
+ cssAfter: null, // properties that defined the state of the slide after transitioning out
980
+ cssBefore: null, // properties that define the initial state of the slide before transitioning in
981
+ delay: 0, // additional delay (in ms) for first transition (hint: can be negative)
982
+ easeIn: null, // easing for "in" transition
983
+ easeOut: null, // easing for "out" transition
984
+ easing: null, // easing method for both in and out transitions
985
+ end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options)
986
+ fastOnEvent: 0, // force fast transitions when triggered manually (via pager or prev/next); value == time in ms
987
+ fit: 0, // force slides to fit container
988
+ fx: 'fade', // name of transition effect (or comma separated names, ex: 'fade,scrollUp,shuffle')
989
+ fxFn: null, // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag)
990
+ height: 'auto', // container height (if the 'fit' option is true, the slides will be set to this height as well)
991
+ manualTrump: true, // causes manual transition to stop an active transition instead of being ignored
992
+ metaAttr: 'cycle',// data- attribute that holds the option data for the slideshow
993
+ next: null, // element, jQuery object, or jQuery selector string for the element to use as event trigger for next slide
994
+ nowrap: 0, // true to prevent slideshow from wrapping
995
+ onPagerEvent: null, // callback fn for pager events: function(zeroBasedSlideIndex, slideElement)
996
+ onPrevNextEvent: null,// callback fn for prev/next events: function(isNext, zeroBasedSlideIndex, slideElement)
997
+ pager: null, // element, jQuery object, or jQuery selector string for the element to use as pager container
998
+ pagerAnchorBuilder: null, // callback fn for building anchor links: function(index, DOMelement)
999
+ pagerEvent: 'click.cycle', // name of event which drives the pager navigation
1000
+ pause: 0, // true to enable "pause on hover"
1001
+ pauseOnPagerHover: 0, // true to pause when hovering over pager link
1002
+ prev: null, // element, jQuery object, or jQuery selector string for the element to use as event trigger for previous slide
1003
+ prevNextEvent:'click.cycle',// event which drives the manual transition to the previous or next slide
1004
+ random: 0, // true for random, false for sequence (not applicable to shuffle fx)
1005
+ randomizeEffects: 1, // valid when multiple effects are used; true to make the effect sequence random
1006
+ requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded
1007
+ requeueTimeout: 250, // ms delay for requeue
1008
+ rev: 0, // causes animations to transition in reverse (for effects that support it such as scrollHorz/scrollVert/shuffle)
1009
+ shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 }
1010
+ skipInitializationCallbacks: false, // set to true to disable the first before/after callback that occurs prior to any transition
1011
+ slideExpr: null, // expression for selecting slides (if something other than all children is required)
1012
+ slideResize: 1, // force slide width/height to fixed size before every transition
1013
+ speed: 1000, // speed of the transition (any valid fx speed value)
1014
+ speedIn: null, // speed of the 'in' transition
1015
+ speedOut: null, // speed of the 'out' transition
1016
+ startingSlide: 0, // zero-based index of the first slide to be displayed
1017
+ sync: 1, // true if in/out transitions should occur simultaneously
1018
+ timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance)
1019
+ timeoutFn: null, // callback for determining per-slide timeout value: function(currSlideElement, nextSlideElement, options, forwardFlag)
1020
+ updateActivePagerLink: null, // callback fn invoked to update the active pager link (adds/removes activePagerClass style)
1021
+ width: null // container width (if the 'fit' option is true, the slides will be set to this width as well)
1022
+ };
1023
+
1024
+ })(jQuery);
1025
+
1026
+
1027
+ /*!
1028
+ * jQuery Cycle Plugin Transition Definitions
1029
+ * This script is a plugin for the jQuery Cycle Plugin
1030
+ * Examples and documentation at: http://malsup.com/jquery/cycle/
1031
+ * Copyright (c) 2007-2010 M. Alsup
1032
+ * Version: 2.73
1033
+ * Dual licensed under the MIT and GPL licenses:
1034
+ * http://www.opensource.org/licenses/mit-license.php
1035
+ * http://www.gnu.org/licenses/gpl.html
1036
+ */
1037
+ (function($) {
1038
+
1039
+ //
1040
+ // These functions define slide initialization and properties for the named
1041
+ // transitions. To save file size feel free to remove any of these that you
1042
+ // don't need.
1043
+ //
1044
+ $.fn.cycle.transitions.none = function($cont, $slides, opts) {
1045
+ opts.fxFn = function(curr,next,opts,after){
1046
+ $(next).show();
1047
+ $(curr).hide();
1048
+ after();
1049
+ };
1050
+ };
1051
+
1052
+ // not a cross-fade, fadeout only fades out the top slide
1053
+ $.fn.cycle.transitions.fadeout = function($cont, $slides, opts) {
1054
+ $slides.not(':eq('+opts.currSlide+')').css({ display: 'block', 'opacity': 1 });
1055
+ opts.before.push(function(curr,next,opts,w,h,rev) {
1056
+ $(curr).css('zIndex',opts.slideCount + (!rev === true ? 1 : 0));
1057
+ $(next).css('zIndex',opts.slideCount + (!rev === true ? 0 : 1));
1058
+ });
1059
+ opts.animIn.opacity = 1;
1060
+ opts.animOut.opacity = 0;
1061
+ opts.cssBefore.opacity = 1;
1062
+ opts.cssBefore.display = 'block';
1063
+ opts.cssAfter.zIndex = 0;
1064
+ };
1065
+
1066
+ // scrollUp/Down/Left/Right
1067
+ $.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) {
1068
+ $cont.css('overflow','hidden');
1069
+ opts.before.push($.fn.cycle.commonReset);
1070
+ var h = $cont.height();
1071
+ opts.cssBefore.top = h;
1072
+ opts.cssBefore.left = 0;
1073
+ opts.cssFirst.top = 0;
1074
+ opts.animIn.top = 0;
1075
+ opts.animOut.top = -h;
1076
+ };
1077
+ $.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) {
1078
+ $cont.css('overflow','hidden');
1079
+ opts.before.push($.fn.cycle.commonReset);
1080
+ var h = $cont.height();
1081
+ opts.cssFirst.top = 0;
1082
+ opts.cssBefore.top = -h;
1083
+ opts.cssBefore.left = 0;
1084
+ opts.animIn.top = 0;
1085
+ opts.animOut.top = h;
1086
+ };
1087
+ $.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) {
1088
+ $cont.css('overflow','hidden');
1089
+ opts.before.push($.fn.cycle.commonReset);
1090
+ var w = $cont.width();
1091
+ opts.cssFirst.left = 0;
1092
+ opts.cssBefore.left = w;
1093
+ opts.cssBefore.top = 0;
1094
+ opts.animIn.left = 0;
1095
+ opts.animOut.left = 0-w;
1096
+ };
1097
+ $.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) {
1098
+ $cont.css('overflow','hidden');
1099
+ opts.before.push($.fn.cycle.commonReset);
1100
+ var w = $cont.width();
1101
+ opts.cssFirst.left = 0;
1102
+ opts.cssBefore.left = -w;
1103
+ opts.cssBefore.top = 0;
1104
+ opts.animIn.left = 0;
1105
+ opts.animOut.left = w;
1106
+ };
1107
+ $.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) {
1108
+ $cont.css('overflow','hidden').width();
1109
+ opts.before.push(function(curr, next, opts, fwd) {
1110
+ if (opts.rev)
1111
+ fwd = !fwd;
1112
+ $.fn.cycle.commonReset(curr,next,opts);
1113
+ opts.cssBefore.left = fwd ? (next.cycleW-1) : (1-next.cycleW);
1114
+ opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW;
1115
+ });
1116
+ opts.cssFirst.left = 0;
1117
+ opts.cssBefore.top = 0;
1118
+ opts.animIn.left = 0;
1119
+ opts.animOut.top = 0;
1120
+ };
1121
+ $.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) {
1122
+ $cont.css('overflow','hidden');
1123
+ opts.before.push(function(curr, next, opts, fwd) {
1124
+ if (opts.rev)
1125
+ fwd = !fwd;
1126
+ $.fn.cycle.commonReset(curr,next,opts);
1127
+ opts.cssBefore.top = fwd ? (1-next.cycleH) : (next.cycleH-1);
1128
+ opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH;
1129
+ });
1130
+ opts.cssFirst.top = 0;
1131
+ opts.cssBefore.left = 0;
1132
+ opts.animIn.top = 0;
1133
+ opts.animOut.left = 0;
1134
+ };
1135
+
1136
+ // slideX/slideY
1137
+ $.fn.cycle.transitions.slideX = function($cont, $slides, opts) {
1138
+ opts.before.push(function(curr, next, opts) {
1139
+ $(opts.elements).not(curr).hide();
1140
+ $.fn.cycle.commonReset(curr,next,opts,false,true);
1141
+ opts.animIn.width = next.cycleW;
1142
+ });
1143
+ opts.cssBefore.left = 0;
1144
+ opts.cssBefore.top = 0;
1145
+ opts.cssBefore.width = 0;
1146
+ opts.animIn.width = 'show';
1147
+ opts.animOut.width = 0;
1148
+ };
1149
+ $.fn.cycle.transitions.slideY = function($cont, $slides, opts) {
1150
+ opts.before.push(function(curr, next, opts) {
1151
+ $(opts.elements).not(curr).hide();
1152
+ $.fn.cycle.commonReset(curr,next,opts,true,false);
1153
+ opts.animIn.height = next.cycleH;
1154
+ });
1155
+ opts.cssBefore.left = 0;
1156
+ opts.cssBefore.top = 0;
1157
+ opts.cssBefore.height = 0;
1158
+ opts.animIn.height = 'show';
1159
+ opts.animOut.height = 0;
1160
+ };
1161
+
1162
+ // shuffle
1163
+ $.fn.cycle.transitions.shuffle = function($cont, $slides, opts) {
1164
+ var i, w = $cont.css('overflow', 'visible').width();
1165
+ $slides.css({left: 0, top: 0});
1166
+ opts.before.push(function(curr,next,opts) {
1167
+ $.fn.cycle.commonReset(curr,next,opts,true,true,true);
1168
+ });
1169
+ // only adjust speed once!
1170
+ if (!opts.speedAdjusted) {
1171
+ opts.speed = opts.speed / 2; // shuffle has 2 transitions
1172
+ opts.speedAdjusted = true;
1173
+ }
1174
+ opts.random = 0;
1175
+ opts.shuffle = opts.shuffle || {left:-w, top:15};
1176
+ opts.els = [];
1177
+ for (i=0; i < $slides.length; i++)
1178
+ opts.els.push($slides[i]);
1179
+
1180
+ for (i=0; i < opts.currSlide; i++)
1181
+ opts.els.push(opts.els.shift());
1182
+
1183
+ // custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!)
1184
+ opts.fxFn = function(curr, next, opts, cb, fwd) {
1185
+ if (opts.rev)
1186
+ fwd = !fwd;
1187
+ var $el = fwd ? $(curr) : $(next);
1188
+ $(next).css(opts.cssBefore);
1189
+ var count = opts.slideCount;
1190
+ $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() {
1191
+ var hops = $.fn.cycle.hopsFromLast(opts, fwd);
1192
+ for (var k=0; k < hops; k++)
1193
+ fwd ? opts.els.push(opts.els.shift()) : opts.els.unshift(opts.els.pop());
1194
+ if (fwd) {
1195
+ for (var i=0, len=opts.els.length; i < len; i++)
1196
+ $(opts.els[i]).css('z-index', len-i+count);
1197
+ }
1198
+ else {
1199
+ var z = $(curr).css('z-index');
1200
+ $el.css('z-index', parseInt(z,10)+1+count);
1201
+ }
1202
+ $el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() {
1203
+ $(fwd ? this : curr).hide();
1204
+ if (cb) cb();
1205
+ });
1206
+ });
1207
+ };
1208
+ $.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 });
1209
+ };
1210
+
1211
+ // turnUp/Down/Left/Right
1212
+ $.fn.cycle.transitions.turnUp = function($cont, $slides, opts) {
1213
+ opts.before.push(function(curr, next, opts) {
1214
+ $.fn.cycle.commonReset(curr,next,opts,true,false);
1215
+ opts.cssBefore.top = next.cycleH;
1216
+ opts.animIn.height = next.cycleH;
1217
+ opts.animOut.width = next.cycleW;
1218
+ });
1219
+ opts.cssFirst.top = 0;
1220
+ opts.cssBefore.left = 0;
1221
+ opts.cssBefore.height = 0;
1222
+ opts.animIn.top = 0;
1223
+ opts.animOut.height = 0;
1224
+ };
1225
+ $.fn.cycle.transitions.turnDown = function($cont, $slides, opts) {
1226
+ opts.before.push(function(curr, next, opts) {
1227
+ $.fn.cycle.commonReset(curr,next,opts,true,false);
1228
+ opts.animIn.height = next.cycleH;
1229
+ opts.animOut.top = curr.cycleH;
1230
+ });
1231
+ opts.cssFirst.top = 0;
1232
+ opts.cssBefore.left = 0;
1233
+ opts.cssBefore.top = 0;
1234
+ opts.cssBefore.height = 0;
1235
+ opts.animOut.height = 0;
1236
+ };
1237
+ $.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) {
1238
+ opts.before.push(function(curr, next, opts) {
1239
+ $.fn.cycle.commonReset(curr,next,opts,false,true);
1240
+ opts.cssBefore.left = next.cycleW;
1241
+ opts.animIn.width = next.cycleW;
1242
+ });
1243
+ opts.cssBefore.top = 0;
1244
+ opts.cssBefore.width = 0;
1245
+ opts.animIn.left = 0;
1246
+ opts.animOut.width = 0;
1247
+ };
1248
+ $.fn.cycle.transitions.turnRight = function($cont, $slides, opts) {
1249
+ opts.before.push(function(curr, next, opts) {
1250
+ $.fn.cycle.commonReset(curr,next,opts,false,true);
1251
+ opts.animIn.width = next.cycleW;
1252
+ opts.animOut.left = curr.cycleW;
1253
+ });
1254
+ $.extend(opts.cssBefore, { top: 0, left: 0, width: 0 });
1255
+ opts.animIn.left = 0;
1256
+ opts.animOut.width = 0;
1257
+ };
1258
+
1259
+ // zoom
1260
+ $.fn.cycle.transitions.zoom = function($cont, $slides, opts) {
1261
+ opts.before.push(function(curr, next, opts) {
1262
+ $.fn.cycle.commonReset(curr,next,opts,false,false,true);
1263
+ opts.cssBefore.top = next.cycleH/2;
1264
+ opts.cssBefore.left = next.cycleW/2;
1265
+ $.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH });
1266
+ $.extend(opts.animOut, { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 });
1267
+ });
1268
+ opts.cssFirst.top = 0;
1269
+ opts.cssFirst.left = 0;
1270
+ opts.cssBefore.width = 0;
1271
+ opts.cssBefore.height = 0;
1272
+ };
1273
+
1274
+ // fadeZoom
1275
+ $.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) {
1276
+ opts.before.push(function(curr, next, opts) {
1277
+ $.fn.cycle.commonReset(curr,next,opts,false,false);
1278
+ opts.cssBefore.left = next.cycleW/2;
1279
+ opts.cssBefore.top = next.cycleH/2;
1280
+ $.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH });
1281
+ });
1282
+ opts.cssBefore.width = 0;
1283
+ opts.cssBefore.height = 0;
1284
+ opts.animOut.opacity = 0;
1285
+ };
1286
+
1287
+ // blindX
1288
+ $.fn.cycle.transitions.blindX = function($cont, $slides, opts) {
1289
+ var w = $cont.css('overflow','hidden').width();
1290
+ opts.before.push(function(curr, next, opts) {
1291
+ $.fn.cycle.commonReset(curr,next,opts);
1292
+ opts.animIn.width = next.cycleW;
1293
+ opts.animOut.left = curr.cycleW;
1294
+ });
1295
+ opts.cssBefore.left = w;
1296
+ opts.cssBefore.top = 0;
1297
+ opts.animIn.left = 0;
1298
+ opts.animOut.left = w;
1299
+ };
1300
+ // blindY
1301
+ $.fn.cycle.transitions.blindY = function($cont, $slides, opts) {
1302
+ var h = $cont.css('overflow','hidden').height();
1303
+ opts.before.push(function(curr, next, opts) {
1304
+ $.fn.cycle.commonReset(curr,next,opts);
1305
+ opts.animIn.height = next.cycleH;
1306
+ opts.animOut.top = curr.cycleH;
1307
+ });
1308
+ opts.cssBefore.top = h;
1309
+ opts.cssBefore.left = 0;
1310
+ opts.animIn.top = 0;
1311
+ opts.animOut.top = h;
1312
+ };
1313
+ // blindZ
1314
+ $.fn.cycle.transitions.blindZ = function($cont, $slides, opts) {
1315
+ var h = $cont.css('overflow','hidden').height();
1316
+ var w = $cont.width();
1317
+ opts.before.push(function(curr, next, opts) {
1318
+ $.fn.cycle.commonReset(curr,next,opts);
1319
+ opts.animIn.height = next.cycleH;
1320
+ opts.animOut.top = curr.cycleH;
1321
+ });
1322
+ opts.cssBefore.top = h;
1323
+ opts.cssBefore.left = w;
1324
+ opts.animIn.top = 0;
1325
+ opts.animIn.left = 0;
1326
+ opts.animOut.top = h;
1327
+ opts.animOut.left = w;
1328
+ };
1329
+
1330
+ // growX - grow horizontally from centered 0 width
1331
+ $.fn.cycle.transitions.growX = function($cont, $slides, opts) {
1332
+ opts.before.push(function(curr, next, opts) {
1333
+ $.fn.cycle.commonReset(curr,next,opts,false,true);
1334
+ opts.cssBefore.left = this.cycleW/2;
1335
+ opts.animIn.left = 0;
1336
+ opts.animIn.width = this.cycleW;
1337
+ opts.animOut.left = 0;
1338
+ });
1339
+ opts.cssBefore.top = 0;
1340
+ opts.cssBefore.width = 0;
1341
+ };
1342
+ // growY - grow vertically from centered 0 height
1343
+ $.fn.cycle.transitions.growY = function($cont, $slides, opts) {
1344
+ opts.before.push(function(curr, next, opts) {
1345
+ $.fn.cycle.commonReset(curr,next,opts,true,false);
1346
+ opts.cssBefore.top = this.cycleH/2;
1347
+ opts.animIn.top = 0;
1348
+ opts.animIn.height = this.cycleH;
1349
+ opts.animOut.top = 0;
1350
+ });
1351
+ opts.cssBefore.height = 0;
1352
+ opts.cssBefore.left = 0;
1353
+ };
1354
+
1355
+ // curtainX - squeeze in both edges horizontally
1356
+ $.fn.cycle.transitions.curtainX = function($cont, $slides, opts) {
1357
+ opts.before.push(function(curr, next, opts) {
1358
+ $.fn.cycle.commonReset(curr,next,opts,false,true,true);
1359
+ opts.cssBefore.left = next.cycleW/2;
1360
+ opts.animIn.left = 0;
1361
+ opts.animIn.width = this.cycleW;
1362
+ opts.animOut.left = curr.cycleW/2;
1363
+ opts.animOut.width = 0;
1364
+ });
1365
+ opts.cssBefore.top = 0;
1366
+ opts.cssBefore.width = 0;
1367
+ };
1368
+ // curtainY - squeeze in both edges vertically
1369
+ $.fn.cycle.transitions.curtainY = function($cont, $slides, opts) {
1370
+ opts.before.push(function(curr, next, opts) {
1371
+ $.fn.cycle.commonReset(curr,next,opts,true,false,true);
1372
+ opts.cssBefore.top = next.cycleH/2;
1373
+ opts.animIn.top = 0;
1374
+ opts.animIn.height = next.cycleH;
1375
+ opts.animOut.top = curr.cycleH/2;
1376
+ opts.animOut.height = 0;
1377
+ });
1378
+ opts.cssBefore.height = 0;
1379
+ opts.cssBefore.left = 0;
1380
+ };
1381
+
1382
+ // cover - curr slide covered by next slide
1383
+ $.fn.cycle.transitions.cover = function($cont, $slides, opts) {
1384
+ var d = opts.direction || 'left';
1385
+ var w = $cont.css('overflow','hidden').width();
1386
+ var h = $cont.height();
1387
+ opts.before.push(function(curr, next, opts) {
1388
+ $.fn.cycle.commonReset(curr,next,opts);
1389
+ if (d == 'right')
1390
+ opts.cssBefore.left = -w;
1391
+ else if (d == 'up')
1392
+ opts.cssBefore.top = h;
1393
+ else if (d == 'down')
1394
+ opts.cssBefore.top = -h;
1395
+ else
1396
+ opts.cssBefore.left = w;
1397
+ });
1398
+ opts.animIn.left = 0;
1399
+ opts.animIn.top = 0;
1400
+ opts.cssBefore.top = 0;
1401
+ opts.cssBefore.left = 0;
1402
+ };
1403
+
1404
+ // uncover - curr slide moves off next slide
1405
+ $.fn.cycle.transitions.uncover = function($cont, $slides, opts) {
1406
+ var d = opts.direction || 'left';
1407
+ var w = $cont.css('overflow','hidden').width();
1408
+ var h = $cont.height();
1409
+ opts.before.push(function(curr, next, opts) {
1410
+ $.fn.cycle.commonReset(curr,next,opts,true,true,true);
1411
+ if (d == 'right')
1412
+ opts.animOut.left = w;
1413
+ else if (d == 'up')
1414
+ opts.animOut.top = -h;
1415
+ else if (d == 'down')
1416
+ opts.animOut.top = h;
1417
+ else
1418
+ opts.animOut.left = -w;
1419
+ });
1420
+ opts.animIn.left = 0;
1421
+ opts.animIn.top = 0;
1422
+ opts.cssBefore.top = 0;
1423
+ opts.cssBefore.left = 0;
1424
+ };
1425
+
1426
+ // toss - move top slide and fade away
1427
+ $.fn.cycle.transitions.toss = function($cont, $slides, opts) {
1428
+ var w = $cont.css('overflow','visible').width();
1429
+ var h = $cont.height();
1430
+ opts.before.push(function(curr, next, opts) {
1431
+ $.fn.cycle.commonReset(curr,next,opts,true,true,true);
1432
+ // provide default toss settings if animOut not provided
1433
+ if (!opts.animOut.left && !opts.animOut.top)
1434
+ $.extend(opts.animOut, { left: w*2, top: -h/2, opacity: 0 });
1435
+ else
1436
+ opts.animOut.opacity = 0;
1437
+ });
1438
+ opts.cssBefore.left = 0;
1439
+ opts.cssBefore.top = 0;
1440
+ opts.animIn.left = 0;
1441
+ };
1442
+
1443
+ // wipe - clip animation
1444
+ $.fn.cycle.transitions.wipe = function($cont, $slides, opts) {
1445
+ var w = $cont.css('overflow','hidden').width();
1446
+ var h = $cont.height();
1447
+ opts.cssBefore = opts.cssBefore || {};
1448
+ var clip;
1449
+ if (opts.clip) {
1450
+ if (/l2r/.test(opts.clip))
1451
+ clip = 'rect(0px 0px '+h+'px 0px)';
1452
+ else if (/r2l/.test(opts.clip))
1453
+ clip = 'rect(0px '+w+'px '+h+'px '+w+'px)';
1454
+ else if (/t2b/.test(opts.clip))
1455
+ clip = 'rect(0px '+w+'px 0px 0px)';
1456
+ else if (/b2t/.test(opts.clip))
1457
+ clip = 'rect('+h+'px '+w+'px '+h+'px 0px)';
1458
+ else if (/zoom/.test(opts.clip)) {
1459
+ var top = parseInt(h/2,10);
1460
+ var left = parseInt(w/2,10);
1461
+ clip = 'rect('+top+'px '+left+'px '+top+'px '+left+'px)';
1462
+ }
1463
+ }
1464
+
1465
+ opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)';
1466
+
1467
+ var d = opts.cssBefore.clip.match(/(\d+)/g);
1468
+ var t = parseInt(d[0],10), r = parseInt(d[1],10), b = parseInt(d[2],10), l = parseInt(d[3],10);
1469
+
1470
+ opts.before.push(function(curr, next, opts) {
1471
+ if (curr == next) return;
1472
+ var $curr = $(curr), $next = $(next);
1473
+ $.fn.cycle.commonReset(curr,next,opts,true,true,false);
1474
+ opts.cssAfter.display = 'block';
1475
+
1476
+ var step = 1, count = parseInt((opts.speedIn / 13),10) - 1;
1477
+ (function f() {
1478
+ var tt = t ? t - parseInt(step * (t/count),10) : 0;
1479
+ var ll = l ? l - parseInt(step * (l/count),10) : 0;
1480
+ var bb = b < h ? b + parseInt(step * ((h-b)/count || 1),10) : h;
1481
+ var rr = r < w ? r + parseInt(step * ((w-r)/count || 1),10) : w;
1482
+ $next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' });
1483
+ (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none');
1484
+ })();
1485
+ });
1486
+ $.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 });
1487
+ opts.animIn = { left: 0 };
1488
+ opts.animOut = { left: 0 };
1489
+ };
1490
+
1491
+ })(jQuery);
js/jquery.cycle.all.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(a){function r(b){function e(b){for(;b&&b.nodeName.toLowerCase()!="html";b=b.parentNode){var c=a.css(b,"background-color");if(c&&c.indexOf("rgb")>=0){var e=c.match(/\d+/g);return"#"+d(e[0])+d(e[1])+d(e[2])}if(c&&c!="transparent")return c}return"#ffffff"}function d(a){a=parseInt(a,10).toString(16);return a.length<2?"0"+a:a}c("applying clearType background-color hack");b.each(function(){a(this).css("background-color",e(this))})}function q(b,c){var d=a(c.pager);a.each(b,function(e,f){a.fn.cycle.createPagerAnchor(e,f,d,b,c)});c.updateActivePagerLink(c.pager,c.startingSlide,c.activePagerClass)}function o(b,c){var d=c?1:-1;var e=b.elements;var f=b.$cont[0],g=f.cycleTimeout;if(g){clearTimeout(g);f.cycleTimeout=0}if(b.random&&d<0){b.randomIndex--;if(--b.randomIndex==-2)b.randomIndex=e.length-2;else if(b.randomIndex==-1)b.randomIndex=e.length-1;b.nextSlide=b.randomMap[b.randomIndex]}else if(b.random){b.nextSlide=b.randomMap[b.randomIndex]}else{b.nextSlide=b.currSlide+d;if(b.nextSlide<0){if(b.nowrap)return false;b.nextSlide=e.length-1}else if(b.nextSlide>=e.length){if(b.nowrap)return false;b.nextSlide=0}}var h=b.onPrevNextEvent||b.prevNextClick;if(a.isFunction(h))h(d>0,b.nextSlide,e[b.nextSlide]);m(e,b,1,c);return false}function n(a,b,d,e){if(d.timeoutFn){var f=d.timeoutFn.call(a,a,b,d,e);while(d.fx!="none"&&f-d.speed<250)f+=d.speed;c("calculated timeout: "+f+"; speed: "+d.speed);if(f!==false)return f}return d.timeout}function m(b,d,e,f){if(e&&d.busy&&d.manualTrump){c("manualTrump in go(), stopping active transition");a(b).stop(true,true);d.busy=0}if(d.busy){c("transition active, ignoring new tx request");return}var g=d.$cont[0],h=b[d.currSlide],i=b[d.nextSlide];if(g.cycleStop!=d.stopCount||g.cycleTimeout===0&&!e)return;if(!e&&!g.cyclePause&&!d.bounce&&(d.autostop&&--d.countdown<=0||d.nowrap&&!d.random&&d.nextSlide<d.currSlide)){if(d.end)d.end(d);return}var j=false;if((e||!g.cyclePause)&&d.nextSlide!=d.currSlide){j=true;var k=d.fx;h.cycleH=h.cycleH||a(h).height();h.cycleW=h.cycleW||a(h).width();i.cycleH=i.cycleH||a(i).height();i.cycleW=i.cycleW||a(i).width();if(d.multiFx){if(f&&(d.lastFx==undefined||++d.lastFx>=d.fxs.length))d.lastFx=0;else if(!f&&(d.lastFx==undefined||--d.lastFx<0))d.lastFx=d.fxs.length-1;k=d.fxs[d.lastFx]}if(d.oneTimeFx){k=d.oneTimeFx;d.oneTimeFx=null}a.fn.cycle.resetState(d,k);if(d.before.length)a.each(d.before,function(a,b){if(g.cycleStop!=d.stopCount)return;b.apply(i,[h,i,d,f])});var l=function(){d.busy=0;a.each(d.after,function(a,b){if(g.cycleStop!=d.stopCount)return;b.apply(i,[h,i,d,f])})};c("tx firing("+k+"); currSlide: "+d.currSlide+"; nextSlide: "+d.nextSlide);d.busy=1;if(d.fxFn)d.fxFn(h,i,d,l,f,e&&d.fastOnEvent);else if(a.isFunction(a.fn.cycle[d.fx]))a.fn.cycle[d.fx](h,i,d,l,f,e&&d.fastOnEvent);else a.fn.cycle.custom(h,i,d,l,f,e&&d.fastOnEvent)}if(j||d.nextSlide==d.currSlide){d.lastSlide=d.currSlide;if(d.random){d.currSlide=d.nextSlide;if(++d.randomIndex==b.length)d.randomIndex=0;d.nextSlide=d.randomMap[d.randomIndex];if(d.nextSlide==d.currSlide)d.nextSlide=d.currSlide==d.slideCount-1?0:d.currSlide+1}else if(d.backwards){var o=d.nextSlide-1<0;if(o&&d.bounce){d.backwards=!d.backwards;d.nextSlide=1;d.currSlide=0}else{d.nextSlide=o?b.length-1:d.nextSlide-1;d.currSlide=o?0:d.nextSlide+1}}else{var o=d.nextSlide+1==b.length;if(o&&d.bounce){d.backwards=!d.backwards;d.nextSlide=b.length-2;d.currSlide=b.length-1}else{d.nextSlide=o?0:d.nextSlide+1;d.currSlide=o?b.length-1:d.nextSlide-1}}}if(j&&d.pager)d.updateActivePagerLink(d.pager,d.currSlide,d.activePagerClass);var p=0;if(d.timeout&&!d.continuous)p=n(b[d.currSlide],b[d.nextSlide],d,f);else if(d.continuous&&g.cyclePause)p=10;if(p>0)g.cycleTimeout=setTimeout(function(){m(b,d,0,!d.backwards)},p)}function l(b,c){b.addSlide=function(d,e){var f=a(d),g=f[0];if(!b.autostopCount)b.countdown++;c[e?"unshift":"push"](g);if(b.els)b.els[e?"unshift":"push"](g);b.slideCount=c.length;f.css("position","absolute");f[e?"prependTo":"appendTo"](b.$cont);if(e){b.currSlide++;b.nextSlide++}if(!a.support.opacity&&b.cleartype&&!b.cleartypeNoBg)r(f);if(b.fit&&b.width)f.width(b.width);if(b.fit&&b.height&&b.height!="auto")f.height(b.height);g.cycleH=b.fit&&b.height?b.height:f.height();g.cycleW=b.fit&&b.width?b.width:f.width();f.css(b.cssBefore);if(b.pager||b.pagerAnchorBuilder)a.fn.cycle.createPagerAnchor(c.length-1,g,a(b.pager),c,b);if(a.isFunction(b.onAddSlide))b.onAddSlide(f);else f.hide()}}function k(b){var e,f,g=a.fn.cycle.transitions;if(b.fx.indexOf(",")>0){b.multiFx=true;b.fxs=b.fx.replace(/\s*/g,"").split(",");for(e=0;e<b.fxs.length;e++){var h=b.fxs[e];f=g[h];if(!f||!g.hasOwnProperty(h)||!a.isFunction(f)){d("discarding unknown transition: ",h);b.fxs.splice(e,1);e--}}if(!b.fxs.length){d("No valid transitions named; slideshow terminating.");return false}}else if(b.fx=="all"){b.multiFx=true;b.fxs=[];for(p in g){f=g[p];if(g.hasOwnProperty(p)&&a.isFunction(f))b.fxs.push(p)}}if(b.multiFx&&b.randomizeEffects){var i=Math.floor(Math.random()*20)+30;for(e=0;e<i;e++){var j=Math.floor(Math.random()*b.fxs.length);b.fxs.push(b.fxs.splice(j,1)[0])}c("randomized fx sequence: ",b.fxs)}return true}function j(b){b.original={before:[],after:[]};b.original.cssBefore=a.extend({},b.cssBefore);b.original.cssAfter=a.extend({},b.cssAfter);b.original.animIn=a.extend({},b.animIn);b.original.animOut=a.extend({},b.animOut);a.each(b.before,function(){b.original.before.push(this)});a.each(b.after,function(){b.original.after.push(this)})}function i(b,c,f,h,i){var n=a.extend({},a.fn.cycle.defaults,h||{},a.metadata?b.metadata():a.meta?b.data():{});var p=a.isFunction(b.data)?b.data(n.metaAttr):null;if(p)n=a.extend(n,p);if(n.autostop)n.countdown=n.autostopCount||f.length;var s=b[0];b.data("cycle.opts",n);n.$cont=b;n.stopCount=s.cycleStop;n.elements=f;n.before=n.before?[n.before]:[];n.after=n.after?[n.after]:[];if(!a.support.opacity&&n.cleartype)n.after.push(function(){g(this,n)});if(n.continuous)n.after.push(function(){m(f,n,0,!n.backwards)});j(n);if(!a.support.opacity&&n.cleartype&&!n.cleartypeNoBg)r(c);if(b.css("position")=="static")b.css("position","relative");if(n.width)b.width(n.width);if(n.height&&n.height!="auto")b.height(n.height);if(n.startingSlide)n.startingSlide=parseInt(n.startingSlide,10);else if(n.backwards)n.startingSlide=f.length-1;if(n.random){n.randomMap=[];for(var t=0;t<f.length;t++)n.randomMap.push(t);n.randomMap.sort(function(a,b){return Math.random()-.5});n.randomIndex=1;n.startingSlide=n.randomMap[1]}else if(n.startingSlide>=f.length)n.startingSlide=0;n.currSlide=n.startingSlide||0;var u=n.startingSlide;c.css({position:"absolute",top:0,left:0}).hide().each(function(b){var c;if(n.backwards)c=u?b<=u?f.length+(b-u):u-b:f.length-b;else c=u?b>=u?f.length-(b-u):u-b:f.length-b;a(this).css("z-index",c)});a(f[u]).css("opacity",1).show();g(f[u],n);if(n.fit){if(!n.aspect){if(n.width)c.width(n.width);if(n.height&&n.height!="auto")c.height(n.height)}else{c.each(function(){var b=a(this);var c=n.aspect===true?b.width()/b.height():n.aspect;if(n.width&&b.width()!=n.width){b.width(n.width);b.height(n.width/c)}if(n.height&&b.height()<n.height){b.height(n.height);b.width(n.height*c)}})}}if(n.center&&(!n.fit||n.aspect)){c.each(function(){var b=a(this);b.css({"margin-left":n.width?(n.width-b.width())/2+"px":0,"margin-top":n.height?(n.height-b.height())/2+"px":0})})}if(n.center&&!n.fit&&!n.slideResize){c.each(function(){var b=a(this);b.css({"margin-left":n.width?(n.width-b.width())/2+"px":0,"margin-top":n.height?(n.height-b.height())/2+"px":0})})}var v=n.containerResize&&!b.innerHeight();if(v){var w=0,x=0;for(var y=0;y<f.length;y++){var z=a(f[y]),A=z[0],B=z.outerWidth(),C=z.outerHeight();if(!B)B=A.offsetWidth||A.width||z.attr("width");if(!C)C=A.offsetHeight||A.height||z.attr("height");w=B>w?B:w;x=C>x?C:x}if(w>0&&x>0)b.css({width:w+"px",height:x+"px"})}var D=false;if(n.pause)b.hover(function(){D=true;this.cyclePause++;e(s,true)},function(){D&&this.cyclePause--;e(s,true)});if(k(n)===false)return false;var E=false;h.requeueAttempts=h.requeueAttempts||0;c.each(function(){var b=a(this);this.cycleH=n.fit&&n.height?n.height:b.height()||this.offsetHeight||this.height||b.attr("height")||0;this.cycleW=n.fit&&n.width?n.width:b.width()||this.offsetWidth||this.width||b.attr("width")||0;if(b.is("img")){var c=a.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete;var e=a.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete;var f=a.browser.opera&&(this.cycleW==42&&this.cycleH==19||this.cycleW==37&&this.cycleH==17)&&!this.complete;var g=this.cycleH==0&&this.cycleW==0&&!this.complete;if(c||e||f||g){if(i.s&&n.requeueOnImageNotLoaded&&++h.requeueAttempts<100){d(h.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){a(i.s,i.c).cycle(h)},n.requeueTimeout);E=true;return false}else{d("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}}return true});if(E)return false;n.cssBefore=n.cssBefore||{};n.cssAfter=n.cssAfter||{};n.cssFirst=n.cssFirst||{};n.animIn=n.animIn||{};n.animOut=n.animOut||{};c.not(":eq("+u+")").css(n.cssBefore);a(c[u]).css(n.cssFirst);if(n.timeout){n.timeout=parseInt(n.timeout,10);if(n.speed.constructor==String)n.speed=a.fx.speeds[n.speed]||parseInt(n.speed,10);if(!n.sync)n.speed=n.speed/2;var F=n.fx=="none"?0:n.fx=="shuffle"?500:250;while(n.timeout-n.speed<F)n.timeout+=n.speed}if(n.easing)n.easeIn=n.easeOut=n.easing;if(!n.speedIn)n.speedIn=n.speed;if(!n.speedOut)n.speedOut=n.speed;n.slideCount=f.length;n.currSlide=n.lastSlide=u;if(n.random){if(++n.randomIndex==f.length)n.randomIndex=0;n.nextSlide=n.randomMap[n.randomIndex]}else if(n.backwards)n.nextSlide=n.startingSlide==0?f.length-1:n.startingSlide-1;else n.nextSlide=n.startingSlide>=f.length-1?0:n.startingSlide+1;if(!n.multiFx){var G=a.fn.cycle.transitions[n.fx];if(a.isFunction(G))G(b,c,n);else if(n.fx!="custom"&&!n.multiFx){d("unknown transition: "+n.fx,"; slideshow terminating");return false}}var H=c[u];if(!n.skipInitializationCallbacks){if(n.before.length)n.before[0].apply(H,[H,H,n,true]);if(n.after.length)n.after[0].apply(H,[H,H,n,true])}if(n.next)a(n.next).bind(n.prevNextEvent,function(){return o(n,1)});if(n.prev)a(n.prev).bind(n.prevNextEvent,function(){return o(n,0)});if(n.pager||n.pagerAnchorBuilder)q(f,n);l(n,f);return n}function h(b){if(b.next)a(b.next).unbind(b.prevNextEvent);if(b.prev)a(b.prev).unbind(b.prevNextEvent);if(b.pager||b.pagerAnchorBuilder)a.each(b.pagerAnchors||[],function(){this.unbind().remove()});b.pagerAnchors=null;if(b.destroy)b.destroy(b)}function g(b,c){if(!a.support.opacity&&c.cleartype&&b.style.filter){try{b.style.removeAttribute("filter")}catch(d){}}}function f(b,c,f){function j(b,c,e){if(!b&&c===true){var f=a(e).data("cycle.opts");if(!f){d("options not found, can not resume");return false}if(e.cycleTimeout){clearTimeout(e.cycleTimeout);e.cycleTimeout=0}m(f.elements,f,1,!f.backwards)}}if(b.cycleStop==undefined)b.cycleStop=0;if(c===undefined||c===null)c={};if(c.constructor==String){switch(c){case"destroy":case"stop":var g=a(b).data("cycle.opts");if(!g)return false;b.cycleStop++;if(b.cycleTimeout)clearTimeout(b.cycleTimeout);b.cycleTimeout=0;g.elements&&a(g.elements).stop();a(b).removeData("cycle.opts");if(c=="destroy")h(g);return false;case"toggle":b.cyclePause=b.cyclePause===1?0:1;j(b.cyclePause,f,b);e(b);return false;case"pause":b.cyclePause=1;e(b);return false;case"resume":b.cyclePause=0;j(false,f,b);e(b);return false;case"prev":case"next":var g=a(b).data("cycle.opts");if(!g){d('options not found, "prev/next" ignored');return false}a.fn.cycle[c](g);return false;default:c={fx:c}}return c}else if(c.constructor==Number){var i=c;c=a(b).data("cycle.opts");if(!c){d("options not found, can not advance slide");return false}if(i<0||i>=c.elements.length){d("invalid slide index: "+i);return false}c.nextSlide=i;if(b.cycleTimeout){clearTimeout(b.cycleTimeout);b.cycleTimeout=0}if(typeof f=="string")c.oneTimeFx=f;m(c.elements,c,1,i>=c.currSlide);return false}return c}function e(b,c,d){var e=a(b).data("cycle.opts");var f=!!b.cyclePause;if(f&&e.paused)e.paused(b,e,c,d);else if(!f&&e.resumed)e.resumed(b,e,c,d)}function d(){window.console&&console.log&&console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function c(b){a.fn.cycle.debug&&d(b)}var b="2.9995";if(a.support==undefined){a.support={opacity:!a.browser.msie}}a.expr[":"].paused=function(a){return a.cyclePause};a.fn.cycle=function(b,e){var g={s:this.selector,c:this.context};if(this.length===0&&b!="stop"){if(!a.isReady&&g.s){d("DOM not ready, queuing slideshow");a(function(){a(g.s,g.c).cycle(b,e)});return this}d("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var h=f(this,b,e);if(h===false)return;h.updateActivePagerLink=h.updateActivePagerLink||a.fn.cycle.updateActivePagerLink;if(this.cycleTimeout)clearTimeout(this.cycleTimeout);this.cycleTimeout=this.cyclePause=0;var j=a(this);var k=h.slideExpr?a(h.slideExpr,this):j.children();var l=k.get();var o=i(j,k,l,h,g);if(o===false)return;if(l.length<2){d("terminating; too few slides: "+l.length);return}var p=o.continuous?10:n(l[o.currSlide],l[o.nextSlide],o,!o.backwards);if(p){p+=o.delay||0;if(p<10)p=10;c("first timeout: "+p);this.cycleTimeout=setTimeout(function(){m(l,o,0,!h.backwards)},p)}})};a.fn.cycle.resetState=function(b,c){c=c||b.fx;b.before=[];b.after=[];b.cssBefore=a.extend({},b.original.cssBefore);b.cssAfter=a.extend({},b.original.cssAfter);b.animIn=a.extend({},b.original.animIn);b.animOut=a.extend({},b.original.animOut);b.fxFn=null;a.each(b.original.before,function(){b.before.push(this)});a.each(b.original.after,function(){b.after.push(this)});var d=a.fn.cycle.transitions[c];if(a.isFunction(d))d(b.$cont,a(b.elements),b)};a.fn.cycle.updateActivePagerLink=function(b,c,d){a(b).each(function(){a(this).children().removeClass(d).eq(c).addClass(d)})};a.fn.cycle.next=function(a){o(a,1)};a.fn.cycle.prev=function(a){o(a,0)};a.fn.cycle.createPagerAnchor=function(b,d,f,g,h){var i;if(a.isFunction(h.pagerAnchorBuilder)){i=h.pagerAnchorBuilder(b,d);c("pagerAnchorBuilder("+b+", el) returned: "+i)}else i='<a href="#">'+(b+1)+"</a>";if(!i)return;var j=a(i);if(j.parents("body").length===0){var k=[];if(f.length>1){f.each(function(){var b=j.clone(true);a(this).append(b);k.push(b[0])});j=a(k)}else{j.appendTo(f)}}h.pagerAnchors=h.pagerAnchors||[];h.pagerAnchors.push(j);var l=function(c){c.preventDefault();h.nextSlide=b;var d=h.$cont[0],e=d.cycleTimeout;if(e){clearTimeout(e);d.cycleTimeout=0}var f=h.onPagerEvent||h.pagerClick;if(a.isFunction(f))f(h.nextSlide,g[h.nextSlide]);m(g,h,1,h.currSlide<b)};if(/mouseenter|mouseover/i.test(h.pagerEvent)){j.hover(l,function(){})}else{j.bind(h.pagerEvent,l)}if(!/^click/.test(h.pagerEvent)&&!h.allowPagerClickBubble)j.bind("click.cycle",function(){return false});var n=h.$cont[0];var o=false;if(h.pauseOnPagerHover){j.hover(function(){o=true;n.cyclePause++;e(n,true,true)},function(){o&&n.cyclePause--;e(n,true,true)})}};a.fn.cycle.hopsFromLast=function(a,b){var c,d=a.lastSlide,e=a.currSlide;if(b)c=e>d?e-d:a.slideCount-d;else c=e<d?d-e:d+a.slideCount-e;return c};a.fn.cycle.commonReset=function(b,c,d,e,f,g){a(d.elements).not(b).hide();if(typeof d.cssBefore.opacity=="undefined")d.cssBefore.opacity=1;d.cssBefore.display="block";if(d.slideResize&&e!==false&&c.cycleW>0)d.cssBefore.width=c.cycleW;if(d.slideResize&&f!==false&&c.cycleH>0)d.cssBefore.height=c.cycleH;d.cssAfter=d.cssAfter||{};d.cssAfter.display="none";a(b).css("zIndex",d.slideCount+(g===true?1:0));a(c).css("zIndex",d.slideCount+(g===true?0:1))};a.fn.cycle.custom=function(b,c,d,e,f,g){var h=a(b),i=a(c);var j=d.speedIn,k=d.speedOut,l=d.easeIn,m=d.easeOut;i.css(d.cssBefore);if(g){if(typeof g=="number")j=k=g;else j=k=1;l=m=null}var n=function(){i.animate(d.animIn,j,l,function(){e()})};h.animate(d.animOut,k,m,function(){h.css(d.cssAfter);if(!d.sync)n()});if(d.sync)n()};a.fn.cycle.transitions={fade:function(b,c,d){c.not(":eq("+d.currSlide+")").css("opacity",0);d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);d.cssBefore.opacity=0});d.animIn={opacity:1};d.animOut={opacity:0};d.cssBefore={top:0,left:0}}};a.fn.cycle.ver=function(){return b};a.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:false,animIn:null,animOut:null,aspect:false,autostop:0,autostopCount:0,backwards:false,before:null,center:null,cleartype:!a.support.opacity,cleartypeNoBg:false,containerResize:1,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:true,metaAttr:"cycle",next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",random:0,randomizeEffects:1,requeueOnImageNotLoaded:true,requeueTimeout:250,rev:0,shuffle:null,skipInitializationCallbacks:false,slideExpr:null,slideResize:1,speed:1e3,speedIn:null,speedOut:null,startingSlide:0,sync:1,timeout:4e3,timeoutFn:null,updateActivePagerLink:null,width:null}})(jQuery);(function(a){a.fn.cycle.transitions.none=function(b,c,d){d.fxFn=function(b,c,d,e){a(c).show();a(b).hide();e()}};a.fn.cycle.transitions.fadeout=function(b,c,d){c.not(":eq("+d.currSlide+")").css({display:"block",opacity:1});d.before.push(function(b,c,d,e,f,g){a(b).css("zIndex",d.slideCount+(!g===true?1:0));a(c).css("zIndex",d.slideCount+(!g===true?0:1))});d.animIn.opacity=1;d.animOut.opacity=0;d.cssBefore.opacity=1;d.cssBefore.display="block";d.cssAfter.zIndex=0};a.fn.cycle.transitions.scrollUp=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.height();d.cssBefore.top=e;d.cssBefore.left=0;d.cssFirst.top=0;d.animIn.top=0;d.animOut.top=-e};a.fn.cycle.transitions.scrollDown=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.height();d.cssFirst.top=0;d.cssBefore.top=-e;d.cssBefore.left=0;d.animIn.top=0;d.animOut.top=e};a.fn.cycle.transitions.scrollLeft=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0;d.cssBefore.left=e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=0-e};a.fn.cycle.transitions.scrollRight=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0;d.cssBefore.left=-e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=e};a.fn.cycle.transitions.scrollHorz=function(b,c,d){b.css("overflow","hidden").width();d.before.push(function(b,c,d,e){if(d.rev)e=!e;a.fn.cycle.commonReset(b,c,d);d.cssBefore.left=e?c.cycleW-1:1-c.cycleW;d.animOut.left=e?-b.cycleW:b.cycleW});d.cssFirst.left=0;d.cssBefore.top=0;d.animIn.left=0;d.animOut.top=0};a.fn.cycle.transitions.scrollVert=function(b,c,d){b.css("overflow","hidden");d.before.push(function(b,c,d,e){if(d.rev)e=!e;a.fn.cycle.commonReset(b,c,d);d.cssBefore.top=e?1-c.cycleH:c.cycleH-1;d.animOut.top=e?b.cycleH:-b.cycleH});d.cssFirst.top=0;d.cssBefore.left=0;d.animIn.top=0;d.animOut.left=0};a.fn.cycle.transitions.slideX=function(b,c,d){d.before.push(function(b,c,d){a(d.elements).not(b).hide();a.fn.cycle.commonReset(b,c,d,false,true);d.animIn.width=c.cycleW});d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.width=0;d.animIn.width="show";d.animOut.width=0};a.fn.cycle.transitions.slideY=function(b,c,d){d.before.push(function(b,c,d){a(d.elements).not(b).hide();a.fn.cycle.commonReset(b,c,d,true,false);d.animIn.height=c.cycleH});d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.height=0;d.animIn.height="show";d.animOut.height=0};a.fn.cycle.transitions.shuffle=function(b,c,d){var e,f=b.css("overflow","visible").width();c.css({left:0,top:0});d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,true,true)});if(!d.speedAdjusted){d.speed=d.speed/2;d.speedAdjusted=true}d.random=0;d.shuffle=d.shuffle||{left:-f,top:15};d.els=[];for(e=0;e<c.length;e++)d.els.push(c[e]);for(e=0;e<d.currSlide;e++)d.els.push(d.els.shift());d.fxFn=function(b,c,d,e,f){if(d.rev)f=!f;var g=f?a(b):a(c);a(c).css(d.cssBefore);var h=d.slideCount;g.animate(d.shuffle,d.speedIn,d.easeIn,function(){var c=a.fn.cycle.hopsFromLast(d,f);for(var i=0;i<c;i++)f?d.els.push(d.els.shift()):d.els.unshift(d.els.pop());if(f){for(var j=0,k=d.els.length;j<k;j++)a(d.els[j]).css("z-index",k-j+h)}else{var l=a(b).css("z-index");g.css("z-index",parseInt(l,10)+1+h)}g.animate({left:0,top:0},d.speedOut,d.easeOut,function(){a(f?this:b).hide();if(e)e()})})};a.extend(d.cssBefore,{display:"block",opacity:1,top:0,left:0})};a.fn.cycle.transitions.turnUp=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,false);d.cssBefore.top=c.cycleH;d.animIn.height=c.cycleH;d.animOut.width=c.cycleW});d.cssFirst.top=0;d.cssBefore.left=0;d.cssBefore.height=0;d.animIn.top=0;d.animOut.height=0};a.fn.cycle.transitions.turnDown=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,false);d.animIn.height=c.cycleH;d.animOut.top=b.cycleH});d.cssFirst.top=0;d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.height=0;d.animOut.height=0};a.fn.cycle.transitions.turnLeft=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,true);d.cssBefore.left=c.cycleW;d.animIn.width=c.cycleW});d.cssBefore.top=0;d.cssBefore.width=0;d.animIn.left=0;d.animOut.width=0};a.fn.cycle.transitions.turnRight=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,true);d.animIn.width=c.cycleW;d.animOut.left=b.cycleW});a.extend(d.cssBefore,{top:0,left:0,width:0});d.animIn.left=0;d.animOut.width=0};a.fn.cycle.transitions.zoom=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,false,true);d.cssBefore.top=c.cycleH/2;d.cssBefore.left=c.cycleW/2;a.extend(d.animIn,{top:0,left:0,width:c.cycleW,height:c.cycleH});a.extend(d.animOut,{width:0,height:0,top:b.cycleH/2,left:b.cycleW/2})});d.cssFirst.top=0;d.cssFirst.left=0;d.cssBefore.width=0;d.cssBefore.height=0};a.fn.cycle.transitions.fadeZoom=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,false);d.cssBefore.left=c.cycleW/2;d.cssBefore.top=c.cycleH/2;a.extend(d.animIn,{top:0,left:0,width:c.cycleW,height:c.cycleH})});d.cssBefore.width=0;d.cssBefore.height=0;d.animOut.opacity=0};a.fn.cycle.transitions.blindX=function(b,c,d){var e=b.css("overflow","hidden").width();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);d.animIn.width=c.cycleW;d.animOut.left=b.cycleW});d.cssBefore.left=e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=e};a.fn.cycle.transitions.blindY=function(b,c,d){var e=b.css("overflow","hidden").height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);d.animIn.height=c.cycleH;d.animOut.top=b.cycleH});d.cssBefore.top=e;d.cssBefore.left=0;d.animIn.top=0;d.animOut.top=e};a.fn.cycle.transitions.blindZ=function(b,c,d){var e=b.css("overflow","hidden").height();var f=b.width();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);d.animIn.height=c.cycleH;d.animOut.top=b.cycleH});d.cssBefore.top=e;d.cssBefore.left=f;d.animIn.top=0;d.animIn.left=0;d.animOut.top=e;d.animOut.left=f};a.fn.cycle.transitions.growX=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,true);d.cssBefore.left=this.cycleW/2;d.animIn.left=0;d.animIn.width=this.cycleW;d.animOut.left=0});d.cssBefore.top=0;d.cssBefore.width=0};a.fn.cycle.transitions.growY=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,false);d.cssBefore.top=this.cycleH/2;d.animIn.top=0;d.animIn.height=this.cycleH;d.animOut.top=0});d.cssBefore.height=0;d.cssBefore.left=0};a.fn.cycle.transitions.curtainX=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,true,true);d.cssBefore.left=c.cycleW/2;d.animIn.left=0;d.animIn.width=this.cycleW;d.animOut.left=b.cycleW/2;d.animOut.width=0});d.cssBefore.top=0;d.cssBefore.width=0};a.fn.cycle.transitions.curtainY=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,false,true);d.cssBefore.top=c.cycleH/2;d.animIn.top=0;d.animIn.height=c.cycleH;d.animOut.top=b.cycleH/2;d.animOut.height=0});d.cssBefore.height=0;d.cssBefore.left=0};a.fn.cycle.transitions.cover=function(b,c,d){var e=d.direction||"left";var f=b.css("overflow","hidden").width();var g=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);if(e=="right")d.cssBefore.left=-f;else if(e=="up")d.cssBefore.top=g;else if(e=="down")d.cssBefore.top=-g;else d.cssBefore.left=f});d.animIn.left=0;d.animIn.top=0;d.cssBefore.top=0;d.cssBefore.left=0};a.fn.cycle.transitions.uncover=function(b,c,d){var e=d.direction||"left";var f=b.css("overflow","hidden").width();var g=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,true,true);if(e=="right")d.animOut.left=f;else if(e=="up")d.animOut.top=-g;else if(e=="down")d.animOut.top=g;else d.animOut.left=-f});d.animIn.left=0;d.animIn.top=0;d.cssBefore.top=0;d.cssBefore.left=0};a.fn.cycle.transitions.toss=function(b,c,d){var e=b.css("overflow","visible").width();var f=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,true,true);if(!d.animOut.left&&!d.animOut.top)a.extend(d.animOut,{left:e*2,top:-f/2,opacity:0});else d.animOut.opacity=0});d.cssBefore.left=0;d.cssBefore.top=0;d.animIn.left=0};a.fn.cycle.transitions.wipe=function(b,c,d){var e=b.css("overflow","hidden").width();var f=b.height();d.cssBefore=d.cssBefore||{};var g;if(d.clip){if(/l2r/.test(d.clip))g="rect(0px 0px "+f+"px 0px)";else if(/r2l/.test(d.clip))g="rect(0px "+e+"px "+f+"px "+e+"px)";else if(/t2b/.test(d.clip))g="rect(0px "+e+"px 0px 0px)";else if(/b2t/.test(d.clip))g="rect("+f+"px "+e+"px "+f+"px 0px)";else if(/zoom/.test(d.clip)){var h=parseInt(f/2,10);var i=parseInt(e/2,10);g="rect("+h+"px "+i+"px "+h+"px "+i+"px)"}}d.cssBefore.clip=d.cssBefore.clip||g||"rect(0px 0px 0px 0px)";var j=d.cssBefore.clip.match(/(\d+)/g);var k=parseInt(j[0],10),l=parseInt(j[1],10),m=parseInt(j[2],10),n=parseInt(j[3],10);d.before.push(function(b,c,d){if(b==c)return;var g=a(b),h=a(c);a.fn.cycle.commonReset(b,c,d,true,true,false);d.cssAfter.display="block";var i=1,j=parseInt(d.speedIn/13,10)-1;(function o(){var a=k?k-parseInt(i*(k/j),10):0;var b=n?n-parseInt(i*(n/j),10):0;var c=m<f?m+parseInt(i*((f-m)/j||1),10):f;var d=l<e?l+parseInt(i*((e-l)/j||1),10):e;h.css({clip:"rect("+a+"px "+d+"px "+c+"px "+b+"px)"});i++<=j?setTimeout(o,13):g.css("display","none")})()});a.extend(d.cssBefore,{display:"block",opacity:1,top:0,left:0});d.animIn={left:0};d.animOut={left:0}}})(jQuery)
js/ngg.js ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery("document").ready(function(){
2
+ // register ajax gallery-navigation listeners
3
+ jQuery("a.page-numbers").click(function(e) {
4
+ return ngg_ajax_navigation(e, this);
5
+ });
6
+ jQuery("a.prev").click(function(e) {
7
+ return ngg_ajax_navigation(e, this);
8
+ });
9
+ jQuery("a.next").click(function(e) {
10
+ return ngg_ajax_navigation(e, this);
11
+ });
12
+
13
+ // register ajax browser-navigation listeners
14
+ jQuery("a.ngg-browser-next").click(function(e) {
15
+ return ngg_ajax_browser_navigation(e, this);
16
+ });
17
+ jQuery("a.ngg-browser-prev").click(function(e) {
18
+ return ngg_ajax_browser_navigation(e, this);
19
+ });
20
+ });
21
+
22
+ function ngg_ajax_navigation(e, obj) {
23
+ // try to find page number
24
+ var pageNumber = 0;
25
+ if (jQuery(obj).hasClass("page-numbers")) {
26
+ pageNumber = jQuery(obj).contents()[0].data;
27
+ } else if (jQuery(obj).hasClass("prev")) {
28
+ pageNumber = jQuery(obj).attr("id").substr(9);
29
+ } else if (jQuery(obj).hasClass("next")) {
30
+ pageNumber = jQuery(obj).attr("id").substr(9);
31
+ }
32
+
33
+ // try to find gallery number by checking the parents ID until we find a matching one
34
+ var currentNode = obj.parentNode;
35
+ while (null != currentNode.parentNode && !jQuery.nodeName(currentNode.parentNode, "body") && "ngg-gallery-" != jQuery(currentNode.parentNode).attr("id").substring(0, 12)) {
36
+ currentNode = currentNode.parentNode;
37
+ }
38
+
39
+ if (jQuery(currentNode.parentNode).attr("id")) {
40
+ var gallery = jQuery(currentNode.parentNode);
41
+
42
+ // we found a gallery, let's extract the post id & gallery id
43
+ var payload = gallery.attr("id").substring(12);
44
+ var separatorPosition = parseInt(payload.indexOf("-"));
45
+
46
+ var galleryId = payload.substr(0, separatorPosition);
47
+ var postId = payload.substr(separatorPosition + 1);
48
+
49
+ if ( (galleryId.length == 0) || (postId.length == 0) ) {
50
+ return true;
51
+ }
52
+
53
+ ngg_show_loading(e);
54
+
55
+ // load gallery content
56
+ jQuery.get(ngg_ajax.callback, {p: postId, galleryid: galleryId, nggpage: pageNumber, type: "gallery"}, function (data, textStatus) {
57
+
58
+ // delete old content
59
+ gallery.children().remove();
60
+
61
+ // add new content
62
+ gallery.replaceWith(data);
63
+
64
+ // add ajax-navigation, again
65
+ jQuery("document").ready(function(){
66
+ // remove old listeners to avoid double-clicks
67
+ jQuery("a.page-numbers").unbind("click");
68
+ jQuery("a.prev").unbind("click");
69
+ jQuery("a.next").unbind("click");
70
+
71
+ // add shutter-listeners again
72
+ shutterReloaded.init('sh');
73
+
74
+ jQuery("a.page-numbers").click(function(e) {
75
+ return ngg_ajax_navigation(e, this);
76
+ });
77
+ jQuery("a.prev").click(function(e) {
78
+ return ngg_ajax_navigation(e, this);
79
+ });
80
+ jQuery("a.next").click(function(e) {
81
+ return ngg_ajax_navigation(e, this);
82
+ });
83
+
84
+ ngg_remove_loading();
85
+ });
86
+ });
87
+
88
+ // deactivate HTML link
89
+ return false;
90
+ }
91
+
92
+ // an error occurred, use traditional HTML link
93
+ return true;
94
+ };
95
+
96
+ function ngg_ajax_browser_navigation(e, obj) {
97
+
98
+
99
+ // try to find gallery number
100
+ if ("ngg-prev-" == jQuery(obj).attr("id").substr(0, 9) || "ngg-next-" == jQuery(obj).attr("id").substr(0, 9)) {
101
+
102
+ // extract the image-id
103
+ var imageNumber = jQuery(obj).attr("id").substr(9);
104
+
105
+ // find the image-browser-container
106
+ var currentNode = obj;
107
+ while (null != currentNode.parentNode && !jQuery.nodeName(currentNode.parentNode, "body") && !jQuery(currentNode.parentNode).hasClass("ngg-imagebrowser")) {
108
+ currentNode = currentNode.parentNode;
109
+ }
110
+
111
+ if (jQuery(currentNode.parentNode).hasClass("ngg-imagebrowser")) {
112
+ var gallery = jQuery(currentNode.parentNode);
113
+
114
+ // let's extract the post id & gallery id
115
+ var payload = gallery.attr("id").substring(17);
116
+ var separatorPosition = parseInt(payload.indexOf("-"));
117
+
118
+ var galleryId = payload.substr(0, separatorPosition);
119
+ var postId = payload.substr(separatorPosition + 1);
120
+
121
+ if ( (galleryId.length == 0) || (postId.length == 0) ) {
122
+ return true;
123
+ }
124
+
125
+ ngg_show_loading(e);
126
+
127
+ // get content
128
+ jQuery.get(ngg_ajax.callback, {p: postId, galleryid: galleryId, pid: imageNumber, type: "browser"}, function (data, textStatus) {
129
+ // delete old content
130
+ gallery.children().remove();
131
+
132
+ // add new content
133
+ gallery.replaceWith(data);
134
+
135
+ // add ajax-navigation, again
136
+ jQuery("document").ready(function(){
137
+ // remove old listeners to avoid double-clicks
138
+ jQuery("a.ngg-browser-next").unbind("click");
139
+ jQuery("a.ngg-browser-prev").unbind("click");
140
+
141
+ // add shutter-listeners again
142
+ shutterReloaded.init('sh');
143
+
144
+ // register ajax browser-navigation listeners
145
+ jQuery("a.ngg-browser-next").click(function(e) {
146
+ return ngg_ajax_browser_navigation(e, this);
147
+ });
148
+ jQuery("a.ngg-browser-prev").click(function(e) {
149
+ return ngg_ajax_browser_navigation(e, this);
150
+ });
151
+
152
+ ngg_remove_loading();
153
+ });
154
+ });
155
+
156
+ // deactivate HTML link
157
+ return false;
158
+ }
159
+ }
160
+
161
+ return true;
162
+ }
163
+
164
+ var loadingImage;
165
+ function ngg_show_loading(obj) {
166
+ loadingImage = jQuery(document.createElement("img")).attr("src", ngg_ajax.path + "images/ajax-loader.gif").attr("alt", ngg_ajax.loading);
167
+
168
+ jQuery("body").append(loadingImage);
169
+
170
+ jQuery(loadingImage).css({
171
+ position: "absolute",
172
+ top: (obj.pageY + 15) + "px",
173
+ left: (obj.pageX + 15) + "px"
174
+ });
175
+
176
+ jQuery(document).mousemove(function(e) {
177
+ loadingImage.css({
178
+ top: (e.pageY + 15) + "px",
179
+ left: (e.pageX + 15) + "px"
180
+ });
181
+ });
182
+ }
183
+
184
+ function ngg_remove_loading() {
185
+ jQuery(document).unbind("mousemove");
186
+
187
+ jQuery(loadingImage).remove();
188
+ }
js/ngg.slideshow.js ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * NextGEN Slideshow based on jQuery Cycle Plugin
3
+ * Copyright (c) 2010-2012 Alex Rabe
4
+ * Version: 1.0.6
5
+ * Requires: jQuery v1.2.6 or later
6
+ */
7
+ jQuery.fn.nggSlideshow = function ( args ) {
8
+
9
+ var defaults = { id: 1,
10
+ width: 320,
11
+ height: 240,
12
+ fx: 'fade',
13
+ domain: '',
14
+ timeout: 5000 };
15
+
16
+ var s = jQuery.extend( {}, defaults, args);
17
+
18
+ var obj = this.selector;
19
+ var stack = [];
20
+ var url = s.domain + 'index.php?callback=json&api_key=true&format=json&method=gallery&id=' + s.id;
21
+ /*
22
+ the stackLength var will store stack length for ref - it is quicker to ref memory than make a call to find an obj property
23
+ stack length is first collected in jQuery.getJSON(); stack length is auto-decremented in loadImage() + jCycle_onBefore()
24
+ */
25
+ var stackLength = 0;
26
+
27
+ jQuery.getJSON(url, function(r){
28
+
29
+ if (r.stat == "ok"){
30
+
31
+ for (img in r.images) {
32
+ var photo = r.images[img];
33
+ //populate images into an array
34
+ stack.push( decodeURI( photo['imageURL'] ) );
35
+ }
36
+ stackLength = stack.length;
37
+ // init loading first 3 images (param 1 in func is first pass)
38
+ loadImage(1);
39
+ }
40
+ });
41
+
42
+ // load image and bind appendImage() to the img load - here we are making sure the loads do not get displaced
43
+ function loadImage(num){
44
+ // check that stack is not empty and we haven't alreay loaded 3 images
45
+ if(stackLength > 0 && num <= 3) {
46
+ var img = new Image();
47
+ img.src = stack.shift();
48
+ stackLength--;
49
+ // wait to append image until the load is complete
50
+ jQuery( img ).one('load', function() { appendImage(img, num); }).each(function(){
51
+ // IE browser : in case it's already cached
52
+ if(this.complete) jQuery(this).trigger('load');
53
+ });
54
+ }
55
+ }
56
+
57
+ // append image to obj
58
+ function appendImage(img, num){
59
+ // Hide them first, Cycle plugin will show them
60
+ jQuery( img ).hide();
61
+ // Add the image now and resize after loaded
62
+ jQuery( obj ).append( imageResize(img, s.width , s.height) );
63
+ // start slideshow with third image, load next image if not
64
+ if (num == 3 || stackLength == 0 ) {
65
+ startSlideshow();
66
+ } else {
67
+ loadImage(++num); // increase index and load next image
68
+ }
69
+
70
+ }
71
+
72
+ function startSlideshow() {
73
+
74
+ // hide the loader icon
75
+ jQuery( obj + '-loader' ).empty().remove();
76
+ // Start the slideshow
77
+ jQuery(obj + ' img:first').fadeIn(1000, function() {
78
+ // Start the cycle plugin
79
+ jQuery( obj ).cycle( {
80
+ fx: s.fx,
81
+ containerResize: 1,
82
+ fit: 1,
83
+ timeout: s.timeout,
84
+ next: obj,
85
+ before: jCycle_onBefore
86
+ });
87
+ });
88
+
89
+ }
90
+
91
+ //Resize Image and keep ratio on client side, better move to server side later
92
+ function imageResize(img, maxWidth , maxHeight) {
93
+
94
+ // we need to wait until the image is loaded
95
+ if ( !img.complete )
96
+ jQuery( img ).bind('load', function() { imageResize(img, maxWidth , maxHeight) });
97
+
98
+ // in some cases the image is not loaded, we can't resize them
99
+ if (img.height == 0 || img.width == 0)
100
+ return img;
101
+
102
+ var width, height;
103
+
104
+ if (img.width * maxHeight > img.height * maxWidth) {
105
+ // img has a wider ratio than target size, make width fit
106
+ if (img.width > maxWidth) {
107
+ width = maxWidth;
108
+ height = Math.round(img.height / img.width * maxWidth);
109
+ }
110
+ } else {
111
+ // img has a less wide ratio than target size, make height fit
112
+ if (img.height > maxHeight) {
113
+ height = maxHeight;
114
+ width = Math.round(img.width / img.height * maxHeight);
115
+ }
116
+ }
117
+
118
+ jQuery( img ).css({
119
+ 'height': height,
120
+ 'width': width
121
+ });
122
+
123
+ return img;
124
+ };
125
+
126
+ // add images to slideshow step by step
127
+ function jCycle_onBefore(curr, next, opts) {
128
+ if (opts.addSlide)
129
+ if (stackLength > 0){ // check that stack is not empty
130
+ var img = new Image();
131
+ img.src = stack.shift();
132
+ stackLength--;
133
+ jQuery( img ).bind('load', function() {
134
+ opts.addSlide( imageResize(this, s.width , s.height) );
135
+ });
136
+ }
137
+ };
138
+ }
js/ngg.slideshow.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.fn.nggSlideshow=function(args){var defaults={id:1,width:320,height:240,fx:'fade',domain:'',timeout:5000};var s=jQuery.extend({},defaults,args);var obj=this.selector;var stack=[];var url=s.domain+'index.php?callback=json&api_key=true&format=json&method=gallery&id='+s.id;var stackLength=0;jQuery.getJSON(url,function(r){if(r.stat=="ok"){for(img in r.images){var photo=r.images[img];stack.push(decodeURI(photo['imageURL']))}stackLength=stack.length;loadImage(1)}});function loadImage(num){if(stackLength>0&&num<=3){var img=new Image();img.src=stack.shift();stackLength--;jQuery(img).one('load',function(){appendImage(img,num)}).each(function(){if(this.complete)jQuery(this).trigger('load')})}}function appendImage(img,num){jQuery(img).hide();jQuery(obj).append(imageResize(img,s.width,s.height));if(num==3||stackLength==0){startSlideshow()}else{loadImage(++num)}}function startSlideshow(){jQuery(obj+'-loader').empty().remove();jQuery(obj+' img:first').fadeIn(1000,function(){jQuery(obj).cycle({fx:s.fx,containerResize:1,fit:1,timeout:s.timeout,next:obj,before:jCycle_onBefore})})}function imageResize(img,maxWidth,maxHeight){if(!img.complete)jQuery(img).bind('load',function(){imageResize(img,maxWidth,maxHeight)});if(img.height==0||img.width==0)return img;var width,height;if(img.width*maxHeight>img.height*maxWidth){if(img.width>maxWidth){width=maxWidth;height=Math.round(img.height/img.width*maxWidth)}}else{if(img.height>maxHeight){height=maxHeight;width=Math.round(img.width/img.height*maxHeight)}}jQuery(img).css({'height':height,'width':width});return img};function jCycle_onBefore(curr,next,opts){if(opts.addSlide)if(stackLength>0){var img=new Image();img.src=stack.shift();stackLength--;jQuery(img).bind('load',function(){opts.addSlide(imageResize(this,s.width,s.height))})}}}
lang/nggallery-de_DE.mo ADDED
Binary file
lang/nggallery-de_DE.po ADDED
@@ -0,0 +1,3956 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: NextGEN Gallery\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2011-10-23 18:03+0100\n"
6
+ "PO-Revision-Date: 2012-02-17 17:07+0100\n"
7
+ "Last-Translator: Alex Rabe\n"
8
+ "Language-Team: Alex Rabe\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;esc_html_e;esc_attr_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-Country: GERMANY\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
+ "X-Poedit-Language: German\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+ "X-Poedit-SearchPath-1: ..\n"
20
+
21
+ #: ../nggallery.php:100
22
+ msgid "<strong>Translation by : </strong><a target=\"_blank\" href=\"http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/\">See here</a>"
23
+ msgstr "<strong>Übersetzt von : </strong><a target=\"_blank\" href=\"http://alexrabe.de/wordpress-plugins/wordtube/translation-of-plugins/\">Alex Rabe</a>"
24
+
25
+ #: ../nggallery.php:101
26
+ msgid "<strong>This translation is not yet updated for Version 1.9.0</strong>. If you would like to help with translation, download the current po from the plugin folder and read <a href=\"http://alexrabe.de/wordpress-plugins/wordtube/translation-of-plugins/\">here</a> how you can translate the plugin."
27
+ msgstr "Sollten jemand Rechtschreibfehler, Deppenapostrophe oder andere deutsche Ungereimtheiten finden, freue ich mich jederzeit über einen kurzen Hinweis</p>"
28
+
29
+ #: ../nggallery.php:205
30
+ msgid "Sorry, NextGEN Gallery works only with a Memory Limit of 16 MB or higher"
31
+ msgstr "Tut mir leid, aber NextGEN-Galerie benötigt mindestens 16MB Speicher (Memory Limit) oder mehr"
32
+
33
+ #: ../nggallery.php:225
34
+ msgid "Please update the database of NextGEN Gallery."
35
+ msgstr "Bitte aktualisiere die Datenbank von NextGEN Gallery."
36
+
37
+ #: ../nggallery.php:225
38
+ msgid "Click here to proceed."
39
+ msgstr "Hier klicken um fortzufahren."
40
+
41
+ #: ../nggallery.php:248
42
+ msgid "Picture tag"
43
+ msgstr "Bilder-Stichwort"
44
+
45
+ #: ../nggallery.php:249
46
+ msgid "Picture tag: %2$l."
47
+ msgstr "Bilder-Stichwort: %2$l."
48
+
49
+ #: ../nggallery.php:250
50
+ msgid "Separate picture tags with commas."
51
+ msgstr "Trenne Stichwörter mittels Komma"
52
+
53
+ #: ../nggallery.php:357
54
+ #: ../admin/admin.php:256
55
+ msgid "L O A D I N G"
56
+ msgstr "B I T T E &nbsp;&nbsp;W A R T E N"
57
+
58
+ #: ../nggallery.php:358
59
+ #: ../admin/admin.php:257
60
+ msgid "Click to Close"
61
+ msgstr "Klicken zum Schliessen "
62
+
63
+ #: ../nggallery.php:379
64
+ msgid "loading"
65
+ msgstr "lade..."
66
+
67
+ #: ../nggallery.php:517
68
+ #: ../nggfunctions.php:941
69
+ #: ../admin/admin.php:37
70
+ #: ../admin/admin.php:79
71
+ msgid "Overview"
72
+ msgstr "Übersicht"
73
+
74
+ #: ../nggallery.php:518
75
+ msgid "Get help"
76
+ msgstr "Hilfe"
77
+
78
+ #: ../nggallery.php:519
79
+ msgid "Contribute"
80
+ msgstr "Mithelfen"
81
+
82
+ #: ../nggallery.php:520
83
+ msgid "Donate"
84
+ msgstr "Spenden"
85
+
86
+ #: ../nggfunctions.php:42
87
+ msgid "The <a href=\"http://www.macromedia.com/go/getflashplayer\">Flash Player</a> and <a href=\"http://www.mozilla.com/firefox/\">a browser with Javascript support</a> are needed."
88
+ msgstr "Es wird der <a href=\"http://www.macromedia.com/go/getflashplayer\">Adobe Flash Player</a> benötigt und <a href=\"http://www.mozilla.com/firefox/\">im Browser muss Javascript</a> aktiviert sein."
89
+
90
+ #: ../nggfunctions.php:164
91
+ #: ../nggfunctions.php:642
92
+ msgid "[Gallery not found]"
93
+ msgstr "[Galerie nicht gefunden]"
94
+
95
+ #: ../nggfunctions.php:450
96
+ msgid "[Album not found]"
97
+ msgstr "[Album nicht gefunden]"
98
+
99
+ #: ../nggfunctions.php:771
100
+ msgid "[SinglePic not found]"
101
+ msgstr "[Bild nicht gefunden]"
102
+
103
+ #: ../nggfunctions.php:906
104
+ msgid "Related images for"
105
+ msgstr "Verwandte Bilder von"
106
+
107
+ #: ../admin/about.php:10
108
+ msgid "Copyright notes / Credits"
109
+ msgstr "Copyright Hinweise / Credits"
110
+
111
+ #: ../admin/about.php:13
112
+ msgid "NextGEN DEV Team"
113
+ msgstr "NextGEN-DEV-Team"
114
+
115
+ #: ../admin/about.php:15
116
+ msgid "This plugin is primarily developed, maintained, supported, documented by"
117
+ msgstr "Dieses Plugin wird hauptsächlich entwickelt, dokumentiert und supported von"
118
+
119
+ #: ../admin/about.php:15
120
+ msgid "There are many other folks who have made contributions to this project :"
121
+ msgstr "Folgende Personen haben die Entwicklung unterstützt :"
122
+
123
+ #: ../admin/about.php:20
124
+ msgid "Contributors / Tribute to"
125
+ msgstr "Anerkennung / Hinweise"
126
+
127
+ #: ../admin/about.php:22
128
+ msgid "If you study the code of this plugin, you will find out that we mixed a lot of good already existing code and ideas together."
129
+ msgstr "Falls Du Dir den Sourcecode dieses Plugins ansiehst, wirst Du merken, dass wir verschiedene gute Scripte sowie Ideen verwendet haben."
130
+
131
+ #: ../admin/about.php:23
132
+ msgid "So, we would like to thank the following people for their pioneer work (without this work it's impossible to create such a plugin so fast)"
133
+ msgstr "Wir möchten folgenden Menschen für Ihre Pionier-Arbeit danken (ohne diese Vorleistung wäre es unmöglich, ein Plugin so schnell zu entwickeln)"
134
+
135
+ #: ../admin/about.php:25
136
+ msgid "for their great documented code"
137
+ msgstr "für ihren großartig dokumentierten Code"
138
+
139
+ #: ../admin/about.php:26
140
+ msgid "for jQuery, which is the best Web2.0 framework"
141
+ msgstr "für jQuery, das Beste Web 2.0 Framework"
142
+
143
+ #: ../admin/about.php:27
144
+ msgid "for the fantastic PHP Thumbnail Class"
145
+ msgstr "für die fantastische PHP-Thumbnail-Klasse"
146
+
147
+ #: ../admin/about.php:28
148
+ msgid "for a lot of very useful plugins and ideas"
149
+ msgstr "für viele nützliche Plugins und Ideen"
150
+
151
+ #: ../admin/about.php:29
152
+ msgid "for Shutter Reloaded, a real lightweight image effect"
153
+ msgstr "für Shutter Reloaded, ein wirklich smarten Bildeffekt"
154
+
155
+ #: ../admin/about.php:30
156
+ msgid "for the best Media Flash Scripts on earth"
157
+ msgstr "für die besten Media-Flash-Scripte"
158
+
159
+ #: ../admin/about.php:31
160
+ msgid "for the Gallery Icon"
161
+ msgstr "für das Galerie Icon"
162
+
163
+ #: ../admin/about.php:32
164
+ msgid "for the Watermark plugin"
165
+ msgstr "für das Wasserzeichen-Plugin"
166
+
167
+ #: ../admin/about.php:34
168
+ msgid "If you didn't find your name on this list and there is some code which I integrate in my plugin, don't hesitate to send me a mail."
169
+ msgstr "Falls Du Deinen Namen nicht auf dieser Liste findest und es aber Code gibt, den ich in meinem Plugin verwendet habe, so schicken mir bitte sofort eine E-Mail."
170
+
171
+ #: ../admin/about.php:38
172
+ msgid "How to support ?"
173
+ msgstr "Unterstützung / Hilfe"
174
+
175
+ #: ../admin/about.php:40
176
+ msgid "There exist several ways to contribute, help or support us in this work. Non of them are mandatory."
177
+ msgstr "Es existieren verschiedene Möglichkeiten, diese Arbeit zu unterstützen."
178
+
179
+ #: ../admin/about.php:42
180
+ msgid "Send us bugfixes / code changes"
181
+ msgstr "Schicke uns Verbesserungen / Bugfixes"
182
+
183
+ #: ../admin/about.php:42
184
+ msgid "The most motivated support for this plugin are your ideas and brain work"
185
+ msgstr "Der beste Support für dieses Plugin sind Deine Ideen und Gedanken"
186
+
187
+ #: ../admin/about.php:43
188
+ msgid "Translate the plugin"
189
+ msgstr "Übersetze das Plugin"
190
+
191
+ #: ../admin/about.php:43
192
+ msgid "To help people to work with this plugin, I would like to have it in all available languages"
193
+ msgstr "Um jedem das Arbeiten mit diesem Plugin zu vereinfachen, würde ich es gerne in allen möglichen Sprachen anbieten"
194
+
195
+ #: ../admin/about.php:44
196
+ msgid "Donate the work via paypal"
197
+ msgstr "Zeig Dich für diese Arbeit per PayPal dankbar"
198
+
199
+ #: ../admin/about.php:57
200
+ msgid "No doubt a very useful and easy motivation :-)"
201
+ msgstr "Kein Zweifel, eine schöne und einfache Motivationshilfe"
202
+
203
+ #: ../admin/about.php:59
204
+ msgid "Place a link to the plugin in your blog/webpage"
205
+ msgstr "Setze einen Link zu diesem Plugin auf Deinen Blog"
206
+
207
+ #: ../admin/about.php:59
208
+ msgid "Yes, share and trackback is also a good support for this work "
209
+ msgstr "Natürlich sind Trackbacks und Links auch ein guter Support für diese Arbeit"
210
+
211
+ #: ../admin/about.php:64
212
+ msgid "Thanks!"
213
+ msgstr "Vielen Dank!"
214
+
215
+ #: ../admin/about.php:66
216
+ msgid "We would like to thank this people which support us in the work :"
217
+ msgstr "Ich möchte mich bei diesen Menschen für Ihre Unterstützung bedanken:"
218
+
219
+ #: ../admin/about.php:166
220
+ msgid "and all donators..."
221
+ msgstr "und allen anderen Spendern..."
222
+
223
+ #: ../admin/addgallery.php:46
224
+ #: ../admin/addgallery.php:57
225
+ #: ../admin/addgallery.php:69
226
+ #: ../admin/addgallery.php:80
227
+ #: ../admin/album.php:96
228
+ #: ../admin/album.php:124
229
+ #: ../admin/album.php:142
230
+ #: ../admin/edit-thumbnail.php:19
231
+ #: ../admin/edit-thumbnail.php:22
232
+ #: ../admin/manage.php:186
233
+ msgid "Cheatin&#8217; uh?"
234
+ msgstr "Cheatin&#8217; uh?"
235
+
236
+ #: ../admin/addgallery.php:62
237
+ msgid "Upload failed!"
238
+ msgstr "Upload fehlgeschlagen!"
239
+
240
+ #: ../admin/addgallery.php:85
241
+ #: ../admin/addgallery.php:93
242
+ msgid "Upload failed! "
243
+ msgstr "Upload fehlgeschlagen!"
244
+
245
+ #: ../admin/addgallery.php:90
246
+ #: ../admin/functions.php:943
247
+ #: ../admin/functions.php:1043
248
+ msgid "No gallery selected !"
249
+ msgstr "Keine Galerie ausgewählt !"
250
+
251
+ #: ../admin/addgallery.php:180
252
+ #: ../admin/addgallery.php:263
253
+ msgid "Image Files"
254
+ msgstr "Bilder"
255
+
256
+ #: ../admin/addgallery.php:195
257
+ #: ../admin/addgallery.php:284
258
+ #: ../admin/addgallery.php:312
259
+ msgid "remove"
260
+ msgstr "Entfernen"
261
+
262
+ #: ../admin/addgallery.php:196
263
+ #: ../admin/addgallery.php:285
264
+ #: ../admin/addgallery.php:466
265
+ msgid "Browse..."
266
+ msgstr "Durchsuche..."
267
+
268
+ #: ../admin/addgallery.php:197
269
+ #: ../admin/addgallery.php:235
270
+ #: ../admin/addgallery.php:286
271
+ #: ../admin/addgallery.php:298
272
+ #: ../admin/addgallery.php:537
273
+ msgid "Upload images"
274
+ msgstr "Bilder hochladen"
275
+
276
+ #: ../admin/addgallery.php:376
277
+ #: ../admin/addgallery.php:484
278
+ msgid "Upload Images"
279
+ msgstr "Bilder hochladen"
280
+
281
+ #: ../admin/addgallery.php:379
282
+ #: ../admin/addgallery.php:396
283
+ #: ../admin/manage-galleries.php:119
284
+ #: ../admin/manage-galleries.php:156
285
+ msgid "Add new gallery"
286
+ msgstr "Neue Galerie erstellen"
287
+
288
+ #: ../admin/addgallery.php:382
289
+ #: ../admin/addgallery.php:418
290
+ msgid "Upload a Zip-File"
291
+ msgstr "Zip-Datei hochladen"
292
+
293
+ #: ../admin/addgallery.php:385
294
+ #: ../admin/addgallery.php:460
295
+ msgid "Import image folder"
296
+ msgstr "Bilder-Verzeichnis importieren"
297
+
298
+ #: ../admin/addgallery.php:401
299
+ #: ../admin/manage-galleries.php:279
300
+ msgid "New Gallery"
301
+ msgstr "Neue Galerie"
302
+
303
+ #: ../admin/addgallery.php:404
304
+ #: ../admin/manage-galleries.php:281
305
+ msgid "Create a new , empty gallery below the folder"
306
+ msgstr "Erstelle eine neue, leere Galerie unter dem Verzeichnis"
307
+
308
+ #: ../admin/addgallery.php:406
309
+ #: ../admin/manage-galleries.php:283
310
+ msgid "Allowed characters for file and folder names are"
311
+ msgstr "Erlaubte Zeichen für die Datei- und Verzeichnisnamen sind"
312
+
313
+ #: ../admin/addgallery.php:410
314
+ msgid "Add gallery"
315
+ msgstr "Galerie hinzufügen"
316
+
317
+ #: ../admin/addgallery.php:423
318
+ msgid "Select Zip-File"
319
+ msgstr "Wähle Zip-Datei"
320
+
321
+ #: ../admin/addgallery.php:425
322
+ msgid "Upload a zip file with images"
323
+ msgstr "Lade eine Zip-Datei mit Bildern hoch"
324
+
325
+ #: ../admin/addgallery.php:429
326
+ msgid "or enter a Zip-File URL"
327
+ msgstr "oder gib eine URL zur ZIP-Datei an"
328
+
329
+ #: ../admin/addgallery.php:431
330
+ msgid "Import a zip file with images from a url"
331
+ msgstr "Lade eine Zip-Datei mit Bildern über ein URL hoch"
332
+
333
+ #: ../admin/addgallery.php:435
334
+ #: ../admin/addgallery.php:512
335
+ msgid "in to"
336
+ msgstr "in"
337
+
338
+ #: ../admin/addgallery.php:437
339
+ msgid "a new gallery"
340
+ msgstr "eine neue Galerie"
341
+
342
+ #: ../admin/addgallery.php:448
343
+ msgid "Note : The upload limit on your server is "
344
+ msgstr "Hinweis : Das Upload-Limit auf dem Server beträgt "
345
+
346
+ #: ../admin/addgallery.php:452
347
+ msgid "Start upload"
348
+ msgstr "Upload starten"
349
+
350
+ #: ../admin/addgallery.php:465
351
+ msgid "Import from Server path:"
352
+ msgstr "Importieren aus Server-Pfad:"
353
+
354
+ #: ../admin/addgallery.php:468
355
+ msgid "Note : Change the default path in the gallery settings"
356
+ msgstr "Hinweis : Der Standard-Pfad kann in den Einstellungen angepasst werden"
357
+
358
+ #: ../admin/addgallery.php:470
359
+ msgid " Please note : For safe-mode = ON you need to add the subfolder thumbs manually"
360
+ msgstr "Achtung : Da der Safe-Mode (PHP.INI) eingeschaltet ist, mußt Du das Unterverzeichnis für die Vorschaubilder (\"thumbs\") manuell (per FTP) anlegen"
361
+
362
+ #: ../admin/addgallery.php:473
363
+ msgid "Import folder"
364
+ msgstr "Verzeichnis importieren"
365
+
366
+ #: ../admin/addgallery.php:490
367
+ msgid "Upload image"
368
+ msgstr "Bild hochladen"
369
+
370
+ #: ../admin/addgallery.php:495
371
+ msgid "Choose files to upload"
372
+ msgstr "Wähle die Bilder zum Upload aus"
373
+
374
+ #: ../admin/addgallery.php:496
375
+ msgid "Select Files"
376
+ msgstr "Wähle Datei"
377
+
378
+ #: ../admin/addgallery.php:498
379
+ msgid "Or you can drop the files into this window."
380
+ msgstr "Du kannst auch die Bilder per Drag & Drop in den Browser schieben."
381
+
382
+ #: ../admin/addgallery.php:501
383
+ #, php-format
384
+ msgid "Scale images to max width %1$dpx or max height %2$dpx"
385
+ msgstr "Skaliere die Bilder mit einer max. Breite von %1$dpx oder max. Höhe von %2$dpx"
386
+
387
+ #: ../admin/addgallery.php:514
388
+ msgid "Choose gallery"
389
+ msgstr "Wähle Galerie"
390
+
391
+ #: ../admin/addgallery.php:533
392
+ msgid "The batch upload requires Adobe Flash 10, disable it if you have problems"
393
+ msgstr "Das Batch-Upload benötigt Adbode Flash 10, wenn es Probleme gibt deaktiviere es besser."
394
+
395
+ #: ../admin/addgallery.php:533
396
+ msgid "Disable flash upload"
397
+ msgstr "Deaktiviere Batch-Upload"
398
+
399
+ #: ../admin/addgallery.php:535
400
+ msgid "Upload multiple files at once by ctrl/shift-selecting in dialog"
401
+ msgstr "Wähle im Dialog mit Ctrl/Shift mehrere Bilder gleichzeitig aus."
402
+
403
+ #: ../admin/addgallery.php:535
404
+ msgid "Enable flash based upload"
405
+ msgstr "Aktiviere Flash Batch Upload"
406
+
407
+ #: ../admin/admin.php:36
408
+ #: ../admin/admin.php:59
409
+ #: ../admin/admin.php:78
410
+ #: ../admin/admin.php:352
411
+ #: ../admin/admin.php:444
412
+ #: ../admin/functions.php:178
413
+ #: ../admin/manage-galleries.php:127
414
+ #: ../admin/manage-galleries.php:407
415
+ #: ../admin/manage-images.php:239
416
+ msgid "Gallery"
417
+ msgid_plural "Galleries"
418
+ msgstr[0] "Galerie"
419
+ msgstr[1] "Galerien"
420
+
421
+ #: ../admin/admin.php:38
422
+ #: ../admin/admin.php:81
423
+ msgid "Add Gallery / Images"
424
+ msgstr "Galerie / Bilder hinzufügen"
425
+
426
+ #: ../admin/admin.php:39
427
+ #: ../admin/admin.php:83
428
+ msgid "Manage Gallery"
429
+ msgstr "Galerie verwalten"
430
+
431
+ #: ../admin/admin.php:40
432
+ #: ../admin/admin.php:85
433
+ msgid "Album"
434
+ msgid_plural "Albums"
435
+ msgstr[0] "Album"
436
+ msgstr[1] "Alben"
437
+
438
+ #: ../admin/admin.php:41
439
+ #: ../admin/admin.php:87
440
+ msgid "Tags"
441
+ msgstr "Stichwörter"
442
+
443
+ #: ../admin/admin.php:42
444
+ #: ../admin/admin.php:89
445
+ msgid "Options"
446
+ msgstr "Optionen"
447
+
448
+ #: ../admin/admin.php:44
449
+ #: ../admin/admin.php:91
450
+ msgid "Style"
451
+ msgstr "Style"
452
+
453
+ #: ../admin/admin.php:46
454
+ msgid "Roles"
455
+ msgstr "Zugriff"
456
+
457
+ #: ../admin/admin.php:47
458
+ msgid "About this Gallery"
459
+ msgstr "Über diese Galerie"
460
+
461
+ #: ../admin/admin.php:47
462
+ #: ../admin/admin.php:92
463
+ msgid "About"
464
+ msgstr "Über"
465
+
466
+ #: ../admin/admin.php:50
467
+ #: ../admin/admin.php:61
468
+ msgid "Reset / Uninstall"
469
+ msgstr "Rücksetzen"
470
+
471
+ #: ../admin/admin.php:60
472
+ msgid "Network settings"
473
+ msgstr "Netzwerk Einstellungen"
474
+
475
+ #: ../admin/admin.php:131
476
+ #, php-format
477
+ msgid "Thanks for using this plugin, I hope you are satisfied ! If you would like to support the further development, please consider a <strong><a href=\"%s\">donation</a></strong>! If you still need some help, please post your questions <a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\">here</a> ."
478
+ msgstr "Vielen Dank, dass Du dieses Plugin nutzt. Ich hoffe, Du bist soweit zufrieden! Wenn Du die Weiterentwicklung unterstützen möchtest, würde ich mich über eine kleine <strong><a href=\"%s\">Spende</a></strong> freuen! Wenn Du Fragen oder Problem hast, schreib sie doch <a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\">hier</a> ins Forum."
479
+
480
+ #: ../admin/admin.php:134
481
+ msgid "OK, hide this message now !"
482
+ msgstr "OK, danke für die Info !"
483
+
484
+ #: ../admin/admin.php:213
485
+ msgid "You do not have the correct permission"
486
+ msgstr "Du hast keine Zugriffsrechte"
487
+
488
+ #: ../admin/admin.php:214
489
+ msgid "Unexpected Error"
490
+ msgstr "Unerwarteter Fehler"
491
+
492
+ #: ../admin/admin.php:215
493
+ msgid "A failure occurred"
494
+ msgstr "Ein Fehler ist aufgetreten"
495
+
496
+ #: ../admin/admin.php:219
497
+ msgid "You have attempted to queue too many files."
498
+ msgstr "Du hast zu viele Bilder versucht zu laden."
499
+
500
+ #: ../admin/admin.php:220
501
+ msgid "This file exceeds the maximum upload size for this site."
502
+ msgstr "Diese Datei übersteigt die zugelassene Uploadmenge."
503
+
504
+ #: ../admin/admin.php:221
505
+ msgid "This file is empty. Please try another."
506
+ msgstr "Diese Datei ist leer."
507
+
508
+ #: ../admin/admin.php:222
509
+ msgid "This file type is not allowed. Please try another."
510
+ msgstr "Dieser Dateityp ist nicht erlaubt."
511
+
512
+ #: ../admin/admin.php:223
513
+ msgid "This file is not an image. Please try another."
514
+ msgstr "Diese Datei ist kein Bild. Bitte versuche es mit einer anderen Datei."
515
+
516
+ #: ../admin/admin.php:224
517
+ msgid "Memory exceeded. Please try another smaller file."
518
+ msgstr "Speicher überschritten. Bitte verkleinere das Bild zuerst"
519
+
520
+ #: ../admin/admin.php:225
521
+ msgid "This is larger than the maximum size. Please try another."
522
+ msgstr "Die Datei ist zu groß. "
523
+
524
+ #: ../admin/admin.php:226
525
+ msgid "An error occurred in the upload. Please try again later."
526
+ msgstr "Währende dem upload trat ein Fehler. Bitte verusche es später nochmal."
527
+
528
+ #: ../admin/admin.php:227
529
+ msgid "There was a configuration error. Please contact the server administrator."
530
+ msgstr "Es besteht ein Konfigurationsfehler."
531
+
532
+ #: ../admin/admin.php:228
533
+ msgid "You may only upload 1 file."
534
+ msgstr "Du kannst nur ein Bild uploaden."
535
+
536
+ #: ../admin/admin.php:229
537
+ msgid "HTTP error."
538
+ msgstr "HTTP Fehler."
539
+
540
+ #: ../admin/admin.php:230
541
+ msgid "Upload failed."
542
+ msgstr "Upload fehlgeschlagen!"
543
+
544
+ #: ../admin/admin.php:231
545
+ msgid "IO error."
546
+ msgstr "IO Fehler."
547
+
548
+ #: ../admin/admin.php:232
549
+ msgid "Security error."
550
+ msgstr "Sicherheitsfehler."
551
+
552
+ #: ../admin/admin.php:233
553
+ msgid "File canceled."
554
+ msgstr "Datei abbgebrochen."
555
+
556
+ #: ../admin/admin.php:234
557
+ msgid "Upload stopped."
558
+ msgstr "Upload angehalten."
559
+
560
+ #: ../admin/admin.php:235
561
+ msgid "Dismiss"
562
+ msgstr "Verwerfen"
563
+
564
+ #: ../admin/admin.php:236
565
+ msgid "Crunching&hellip;"
566
+ msgstr "Bearbeiten&hellip;"
567
+
568
+ #: ../admin/admin.php:237
569
+ msgid "moved to the trash."
570
+ msgstr "in den Papierkorb geschoben."
571
+
572
+ #: ../admin/admin.php:238
573
+ #, php-format
574
+ msgid "&#8220;%s&#8221; has failed to upload due to an error"
575
+ msgstr "&#8220;%s&#8221; konnte auf Grund eines Fehler nicht geladen werden."
576
+
577
+ #: ../admin/admin.php:356
578
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Introduction</a>"
579
+ msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Einführung</a>"
580
+
581
+ #: ../admin/admin.php:359
582
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Setup</a>"
583
+ msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Setup</a>"
584
+
585
+ #: ../admin/admin.php:362
586
+ msgid "<a href=\"http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/\" target=\"_blank\">Translation by alex rabe</a>"
587
+ msgstr "<a href=\"http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/\" target=\"_blank\">Unterstütze bei der Übersetzung</a>"
588
+
589
+ #: ../admin/admin.php:365
590
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Roles / Capabilities</a>"
591
+ msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Einführung</a>"
592
+
593
+ #: ../admin/admin.php:368
594
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Styles</a>"
595
+ msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Einführung</a>"
596
+
597
+ #: ../admin/admin.php:369
598
+ msgid "Templates"
599
+ msgstr "Vorlagen"
600
+
601
+ #: ../admin/admin.php:372
602
+ #: ../admin/admin.php:378
603
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Gallery management</a>"
604
+ msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Einführung</a>"
605
+
606
+ #: ../admin/admin.php:373
607
+ msgid "Gallery example"
608
+ msgstr "Galerie Beispiel"
609
+
610
+ #: ../admin/admin.php:379
611
+ #: ../admin/admin.php:389
612
+ msgid "Gallery tags"
613
+ msgstr "Galerie Stichwörter"
614
+
615
+ #: ../admin/admin.php:382
616
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Album management</a>"
617
+ msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Einführung</a>"
618
+
619
+ #: ../admin/admin.php:383
620
+ msgid "Album example"
621
+ msgstr "Album Beispiel"
622
+
623
+ #: ../admin/admin.php:384
624
+ #: ../admin/admin.php:390
625
+ msgid "Album tags"
626
+ msgstr "Album Stichwörter"
627
+
628
+ #: ../admin/admin.php:387
629
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Gallery tags</a>"
630
+ msgstr "<a href=\"http://www.curlyrob.de/curlyrob/?page_id=129\" target=\"_blank\">Einführung</a>"
631
+
632
+ #: ../admin/admin.php:388
633
+ msgid "Related images"
634
+ msgstr "Verwandte Bilder"
635
+
636
+ #: ../admin/admin.php:393
637
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-image-management/\" target=\"_blank\">Image management</a>"
638
+ msgstr "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-image-management/\" target=\"_blank\">Bilderverwaltung (englisch)</a>"
639
+
640
+ #: ../admin/admin.php:394
641
+ msgid "Custom fields"
642
+ msgstr "Spezialfelder"
643
+
644
+ #: ../admin/admin.php:399
645
+ msgid "Get help with NextGEN Gallery"
646
+ msgstr "Weitere Hilfe zu NextGEN Gallery"
647
+
648
+ #: ../admin/admin.php:403
649
+ msgid "More Help & Info"
650
+ msgstr "Weitere Hilfe & Informationen"
651
+
652
+ #: ../admin/admin.php:405
653
+ msgid "<a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\" target=\"_blank\">Support Forums</a>"
654
+ msgstr "<a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\" target=\"_blank\">Support Forum (englisch)</a>"
655
+
656
+ #: ../admin/admin.php:406
657
+ msgid "FAQ"
658
+ msgstr "FAQ (englisch)"
659
+
660
+ #: ../admin/admin.php:407
661
+ msgid "Feature request"
662
+ msgstr "Wünsch Dir was"
663
+
664
+ #: ../admin/admin.php:408
665
+ msgid "Get your language pack"
666
+ msgstr "Lade Deine Sprachdatei"
667
+
668
+ #: ../admin/admin.php:409
669
+ msgid "Contribute development"
670
+ msgstr "Bei der Entwicklung helfen"
671
+
672
+ #: ../admin/admin.php:410
673
+ msgid "Download latest version"
674
+ msgstr "Aktuelle Version downloaden"
675
+
676
+ #: ../admin/ajax.php:312
677
+ msgid "You are not allowed to be here"
678
+ msgstr "Keine Zugangsberechtigung"
679
+
680
+ #: ../admin/ajax.php:410
681
+ #, php-format
682
+ msgid "Could create image with %s x %s pixel"
683
+ msgstr "Konnte ein Bild mit %s x %s Pixel erstellen"
684
+
685
+ #: ../admin/album.php:102
686
+ #: ../admin/album.php:117
687
+ #: ../admin/album.php:158
688
+ msgid "Update Successfully"
689
+ msgstr "Update erfolgreich"
690
+
691
+ #: ../admin/album.php:131
692
+ msgid "Album deleted"
693
+ msgstr "Album gelöscht"
694
+
695
+ #: ../admin/album.php:269
696
+ msgid "Edit Album"
697
+ msgstr "Album erstellen"
698
+
699
+ #: ../admin/album.php:278
700
+ msgid "Manage Albums"
701
+ msgstr "Verwalte Alben"
702
+
703
+ #: ../admin/album.php:284
704
+ #: ../admin/album.php:333
705
+ msgid "Select album"
706
+ msgstr "Wähle Album"
707
+
708
+ #: ../admin/album.php:286
709
+ msgid "No album selected"
710
+ msgstr "Kein Album ausgewählt"
711
+
712
+ #: ../admin/album.php:297
713
+ #: ../admin/edit-thumbnail.php:155
714
+ msgid "Update"
715
+ msgstr "Aktualisiere"
716
+
717
+ #: ../admin/album.php:299
718
+ msgid "Edit album"
719
+ msgstr "Album ändern"
720
+
721
+ #: ../admin/album.php:302
722
+ #: ../admin/manage-galleries.php:146
723
+ #: ../admin/manage-images.php:448
724
+ msgid "Delete"
725
+ msgstr "Lösche"
726
+
727
+ #: ../admin/album.php:306
728
+ msgid "Add new album"
729
+ msgstr "Album hinzufügen"
730
+
731
+ #: ../admin/album.php:308
732
+ msgid "Add"
733
+ msgstr "Hinzufügen"
734
+
735
+ #: ../admin/album.php:319
736
+ msgid "Show / hide used galleries"
737
+ msgstr "Zeige / Verstecke verwendete Galerien"
738
+
739
+ #: ../admin/album.php:319
740
+ msgid "[Show all]"
741
+ msgstr "[Alle zeigen]"
742
+
743
+ #: ../admin/album.php:320
744
+ msgid "Maximize the widget content"
745
+ msgstr "Maximiere die Widgets"
746
+
747
+ #: ../admin/album.php:320
748
+ msgid "[Maximize]"
749
+ msgstr "[Vergrößern]"
750
+
751
+ #: ../admin/album.php:321
752
+ msgid "Minimize the widget content"
753
+ msgstr "Minimiere die Widgets"
754
+
755
+ #: ../admin/album.php:321
756
+ msgid "[Minimize]"
757
+ msgstr "[Verkleinern]"
758
+
759
+ #: ../admin/album.php:323
760
+ msgid "After you create and select a album, you can drag and drop a gallery or another album into your new album below"
761
+ msgstr "Nachdem Du ein Album erstellt und ausgewählt hast, kannst Du per Drag & Drop eine Galerie oder ein anderes Album in das neue Album ziehen"
762
+
763
+ #: ../admin/album.php:349
764
+ msgid "Select gallery"
765
+ msgstr "Wähle Galerie"
766
+
767
+ #: ../admin/album.php:378
768
+ msgid "Album ID"
769
+ msgstr "Album ID"
770
+
771
+ #: ../admin/album.php:391
772
+ msgid "No album selected!"
773
+ msgstr "Kein Album ausgewählt"
774
+
775
+ #: ../admin/album.php:411
776
+ msgid "Album name:"
777
+ msgstr "Album Name :"
778
+
779
+ #: ../admin/album.php:417
780
+ msgid "Album description:"
781
+ msgstr "Beschreibung:"
782
+
783
+ #: ../admin/album.php:423
784
+ msgid "Select a preview image:"
785
+ msgstr "Wähle Vorschaubild:"
786
+
787
+ #: ../admin/album.php:426
788
+ #: ../admin/album.php:429
789
+ msgid "No picture"
790
+ msgstr "Kein Bild"
791
+
792
+ #: ../admin/album.php:440
793
+ #: ../admin/manage-images.php:257
794
+ msgid "Page Link to"
795
+ msgstr "Seite verlinkt zu"
796
+
797
+ #: ../admin/album.php:442
798
+ #: ../admin/manage-images.php:260
799
+ msgid "Not linked"
800
+ msgstr "Nicht verlinkt"
801
+
802
+ #: ../admin/album.php:455
803
+ #: ../admin/manage-galleries.php:288
804
+ #: ../admin/manage-galleries.php:317
805
+ #: ../admin/manage-galleries.php:347
806
+ #: ../admin/manage-images.php:533
807
+ #: ../admin/manage-images.php:569
808
+ #: ../admin/manage-images.php:598
809
+ #: ../admin/manage-images.php:628
810
+ msgid "OK"
811
+ msgstr "OK"
812
+
813
+ #: ../admin/album.php:457
814
+ #: ../admin/manage-galleries.php:290
815
+ #: ../admin/manage-galleries.php:319
816
+ #: ../admin/manage-galleries.php:349
817
+ #: ../admin/manage-images.php:535
818
+ #: ../admin/manage-images.php:571
819
+ #: ../admin/manage-images.php:600
820
+ #: ../admin/manage-images.php:630
821
+ msgid "Cancel"
822
+ msgstr "Abbrechen"
823
+
824
+ #: ../admin/album.php:543
825
+ msgid "Name"
826
+ msgstr "Name"
827
+
828
+ #: ../admin/album.php:544
829
+ #: ../admin/manage-images.php:255
830
+ msgid "Title"
831
+ msgstr "Titel"
832
+
833
+ #: ../admin/album.php:545
834
+ msgid "Page"
835
+ msgstr "Seite"
836
+
837
+ #: ../admin/edit-thumbnail.php:105
838
+ msgid "Select with the mouse the area for the new thumbnail"
839
+ msgstr "Wähle mit der Maus den Bereich für das neue Thumbnail"
840
+
841
+ #: ../admin/edit-thumbnail.php:119
842
+ msgid "Thumbnail updated"
843
+ msgstr "Thumbnail geändert"
844
+
845
+ #: ../admin/edit-thumbnail.php:124
846
+ msgid "Error updating thumbnail"
847
+ msgstr "Konnte Vorschaubild nicht erzeugen"
848
+
849
+ #: ../admin/edit-thumbnail.php:140
850
+ msgid "Select the area for the thumbnail from the picture on the left."
851
+ msgstr "Wähle den Ausschnitt für das Vorschaubild innerhalb des Bildes"
852
+
853
+ #: ../admin/functions.php:39
854
+ msgid "No valid gallery name!"
855
+ msgstr "Kein gültiger Galerie-Name!"
856
+
857
+ #: ../admin/functions.php:46
858
+ #: ../admin/functions.php:55
859
+ #: ../admin/functions.php:80
860
+ #: ../admin/functions.php:149
861
+ #: ../admin/functions.php:157
862
+ msgid "Directory"
863
+ msgstr "Verzeichnis"
864
+
865
+ #: ../admin/functions.php:46
866
+ msgid "didn't exist. Please create first the main gallery folder "
867
+ msgstr "nicht gefunden. Bitte erstelle zuerst das Hauptverzeichnis."
868
+
869
+ #: ../admin/functions.php:47
870
+ #: ../admin/functions.php:56
871
+ msgid "Check this link, if you didn't know how to set the permission :"
872
+ msgstr "Dieser Link zeigt Dir, wie man Verzeichnisrechte ändert :"
873
+
874
+ #: ../admin/functions.php:55
875
+ #: ../admin/functions.php:80
876
+ msgid "is not writeable !"
877
+ msgstr "ist schreibgeschützt !"
878
+
879
+ #: ../admin/functions.php:76
880
+ #: ../admin/functions.php:85
881
+ #: ../admin/functions.php:902
882
+ msgid "Unable to create directory "
883
+ msgstr "Kann Verzeichnis nicht erstellen "
884
+
885
+ #: ../admin/functions.php:89
886
+ msgid "The server setting Safe-Mode is on !"
887
+ msgstr "Auf dem Server ist Safe-Mode aktiviert (PHP.INI)"
888
+
889
+ #: ../admin/functions.php:90
890
+ msgid "If you have problems, please create directory"
891
+ msgstr "Wenn Probleme auftreten, erstelle bitte das Verzeichnis"
892
+
893
+ #: ../admin/functions.php:91
894
+ msgid "and the thumbnails directory"
895
+ msgstr "und das Thumbnails-Verzeichnis"
896
+
897
+ #: ../admin/functions.php:91
898
+ msgid "with permission 777 manually !"
899
+ msgstr "mit den Berechtigungen 777 manuell !"
900
+
901
+ #: ../admin/functions.php:116
902
+ #, php-format
903
+ msgid "Gallery ID %1$s successfully created. You can show this gallery in your post or page with the shortcode %2$s.<br/>"
904
+ msgstr "Galerie ID %1$s erstellt..<br/>Du kannst diese Galerie jetzt mit dem Stichwort %2$s in einen Artikel einbinden.<br/>"
905
+
906
+ #: ../admin/functions.php:119
907
+ #: ../admin/functions.php:217
908
+ msgid "Edit gallery"
909
+ msgstr "Galerie ändern"
910
+
911
+ #: ../admin/functions.php:149
912
+ msgid "doesn&#96;t exist!"
913
+ msgstr "gibt es nicht !"
914
+
915
+ #: ../admin/functions.php:157
916
+ msgid "contains no pictures"
917
+ msgstr "enthält keine Bilder"
918
+
919
+ #: ../admin/functions.php:175
920
+ msgid "Database error. Could not add gallery!"
921
+ msgstr "Datenbank-Fehler. Kann Galerie nicht hinzufügen!"
922
+
923
+ #: ../admin/functions.php:178
924
+ msgid "successfully created!"
925
+ msgstr "erfolgreich erstellt!"
926
+
927
+ #: ../admin/functions.php:212
928
+ #: ../admin/functions.php:1019
929
+ #: ../admin/manage-galleries.php:81
930
+ #: ../admin/manage-galleries.php:148
931
+ #: ../admin/manage-images.php:203
932
+ #: ../admin/manage-images.php:342
933
+ #: ../admin/manage.php:223
934
+ #: ../admin/manage.php:299
935
+ msgid "Create new thumbnails"
936
+ msgstr "Neue Vorschaubilder erstellen"
937
+
938
+ #: ../admin/functions.php:215
939
+ msgid " picture(s) successfully added"
940
+ msgstr " Bild(er) erfolgreich hinzugefügt"
941
+
942
+ #: ../admin/functions.php:270
943
+ #: ../admin/functions.php:350
944
+ #: ../admin/functions.php:405
945
+ #: ../admin/functions.php:502
946
+ #: ../admin/functions.php:556
947
+ msgid "Object didn't contain correct data"
948
+ msgstr "Das Objekt enhält nicht die notwendigen Daten"
949
+
950
+ #: ../admin/functions.php:278
951
+ msgid " is not writeable "
952
+ msgstr "ist schreibgeschützt !"
953
+
954
+ #: ../admin/functions.php:360
955
+ #: ../admin/functions.php:408
956
+ #: ../admin/functions.php:508
957
+ #: ../admin/functions.php:559
958
+ msgid " is not writeable"
959
+ msgstr "ist schreibgeschützt !"
960
+
961
+ #: ../admin/functions.php:562
962
+ msgid "File do not exists"
963
+ msgstr "Datei existiert nicht"
964
+
965
+ #: ../admin/functions.php:566
966
+ msgid "Couldn't restore original image"
967
+ msgstr "Konnte Originalbild nicht wiederherstellen"
968
+
969
+ #: ../admin/functions.php:682
970
+ msgid "(Error : Couldn't not update data base)"
971
+ msgstr "(Fehler : Konnte Datenbank nicht aktualisieren)"
972
+
973
+ #: ../admin/functions.php:689
974
+ msgid "(Error : Couldn't not update meta data)"
975
+ msgstr "(Fehler : Konnte Metadaten nicht speichern)"
976
+
977
+ #: ../admin/functions.php:698
978
+ msgid "(Error : Couldn't not find image)"
979
+ msgstr "(Fehler : Konnte das Bild nicht finden)"
980
+
981
+ #: ../admin/functions.php:836
982
+ msgid "No valid URL path "
983
+ msgstr "Kein gültiger URL-Pfad"
984
+
985
+ #: ../admin/functions.php:852
986
+ msgid "Import via cURL failed."
987
+ msgstr "Import via cURL abgebrochen"
988
+
989
+ #: ../admin/functions.php:869
990
+ msgid "Uploaded file was no or a faulty zip file ! The server recognized : "
991
+ msgstr "Die hochgeladene Datei war keine korrekte Zip-Datei. Servermeldung :"
992
+
993
+ #: ../admin/functions.php:886
994
+ msgid "Could not get a valid foldername"
995
+ msgstr "Konnte keinen gültigen Verzeichnisnamen finden"
996
+
997
+ #: ../admin/functions.php:897
998
+ #, php-format
999
+ msgid "Unable to create directory %s. Is its parent directory writable by the server?"
1000
+ msgstr "Kann das Verzeichnis %s nicht erstellen. Ist das Hauptverzeichnis vielleicht schreibgeschützt ?"
1001
+
1002
+ #: ../admin/functions.php:912
1003
+ msgid "Zip-File successfully unpacked"
1004
+ msgstr "Zip-Datei erfolgreich entpackt"
1005
+
1006
+ #: ../admin/functions.php:951
1007
+ #: ../admin/functions.php:1068
1008
+ msgid "Failure in database, no gallery path set !"
1009
+ msgstr "Datenbankfehler! Kein Galerie-Pfad gesetzt !"
1010
+
1011
+ #: ../admin/functions.php:975
1012
+ #: ../admin/functions.php:1062
1013
+ msgid "is no valid image file!"
1014
+ msgstr "ist keine zulässige Bilddatei !"
1015
+
1016
+ #: ../admin/functions.php:989
1017
+ #: ../admin/functions.php:1187
1018
+ #: ../admin/functions.php:1264
1019
+ #, php-format
1020
+ msgid "Unable to write to directory %s. Is this directory writable by the server?"
1021
+ msgstr "Kann das Verzeichnis %s nicht erstellen. Ist das Hauptverzeichnis vielleicht schreibgeschützt ?"
1022
+
1023
+ #: ../admin/functions.php:996
1024
+ #: ../admin/functions.php:1085
1025
+ msgid "Error, the file could not be moved to : "
1026
+ msgstr "Fehler: Diese Datei kann nicht verschoben werden zu :"
1027
+
1028
+ #: ../admin/functions.php:1001
1029
+ #: ../admin/functions.php:1089
1030
+ msgid "Error, the file permissions could not be set"
1031
+ msgstr "Fehler: Die Berechtigungen für diese Datei können nicht gesetzt werden"
1032
+
1033
+ #: ../admin/functions.php:1024
1034
+ msgid " Image(s) successfully added"
1035
+ msgstr " Bild(er) erfolgreich hinzugefügt"
1036
+
1037
+ #: ../admin/functions.php:1051
1038
+ msgid "Invalid upload. Error Code : "
1039
+ msgstr "Ungültiger Upload. Fehler Code :"
1040
+
1041
+ #: ../admin/functions.php:1127
1042
+ #, php-format
1043
+ msgid "SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually"
1044
+ msgstr "SAFE MODE Einschränkungen ist aktiv. Du musst das Verzeichnis <strong>%s</strong> manuell anlegen."
1045
+
1046
+ #: ../admin/functions.php:1128
1047
+ #, php-format
1048
+ msgid "When safe_mode is on, PHP checks to see if the owner (%s) of the current script matches the owner (%s) of the file to be operated on by a file function or its directory"
1049
+ msgstr "Wenn der Safe-Mode eingeschaltet ist, überprüft PHP, ob der Besitzer (%s) des Skript mit dem Besitzer (%s) der Datei/Verzeichnis übereinstimmt."
1050
+
1051
+ #: ../admin/functions.php:1181
1052
+ #: ../admin/functions.php:1258
1053
+ msgid "The destination gallery does not exist"
1054
+ msgstr "Die ausgewählte Galerie existiert nicht"
1055
+
1056
+ #: ../admin/functions.php:1212
1057
+ #, php-format
1058
+ msgid "Failed to move image %1$s to %2$s"
1059
+ msgstr "Konnte das Bild %1$s nicht nach %2$s verschieben"
1060
+
1061
+ #: ../admin/functions.php:1232
1062
+ #, php-format
1063
+ msgid "Moved %1$s picture(s) to gallery : %2$s ."
1064
+ msgstr " %1$s Bild(er) in Galerie : %2$s verschoben."
1065
+
1066
+ #: ../admin/functions.php:1291
1067
+ #, php-format
1068
+ msgid "Failed to copy image %1$s to %2$s"
1069
+ msgstr "Konnte das Bild %1$s nicht nach %2$s kopieren"
1070
+
1071
+ #: ../admin/functions.php:1305
1072
+ #, php-format
1073
+ msgid "Failed to copy database row for picture %s"
1074
+ msgstr "Fehler bei der Datenbank-Operation für Bild %s"
1075
+
1076
+ #: ../admin/functions.php:1317
1077
+ #, php-format
1078
+ msgid "Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery."
1079
+ msgstr "Bild %1$s (%2$s) als Bild %3$s (%4$s) kopiert &raquo; Die Datei existierte bereits."
1080
+
1081
+ #: ../admin/functions.php:1320
1082
+ #, php-format
1083
+ msgid "Image %1$s (%2$s) copied as image %3$s (%4$s)"
1084
+ msgstr "Bild %1$s (%2$s) kopiert als Bild %3$s (%4$s)"
1085
+
1086
+ #: ../admin/functions.php:1329
1087
+ #, php-format
1088
+ msgid "Copied %1$s picture(s) to gallery: %2$s ."
1089
+ msgstr "Kopiere %1$s Bild(er) in die Galerie : %2$s ."
1090
+
1091
+ #: ../admin/functions.php:1437
1092
+ msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini"
1093
+ msgstr "Die Datei überschreitet die erlaubte Grösse (upload_max_filesize) in der php.ini"
1094
+
1095
+ #: ../admin/functions.php:1440
1096
+ msgid "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"
1097
+ msgstr "Die Datei ist zu gross"
1098
+
1099
+ #: ../admin/functions.php:1443
1100
+ msgid "The uploaded file was only partially uploaded"
1101
+ msgstr "Die Datei wurde nur teilweise hochgeladen"
1102
+
1103
+ #: ../admin/functions.php:1446
1104
+ msgid "No file was uploaded"
1105
+ msgstr "Keinen Datei wurde geladen"
1106
+
1107
+ #: ../admin/functions.php:1449
1108
+ msgid "Missing a temporary folder"
1109
+ msgstr "Konnte temporäres Verzeichnis nicht finden"
1110
+
1111
+ #: ../admin/functions.php:1452
1112
+ msgid "Failed to write file to disk"
1113
+ msgstr "Konnte Datei nicht speichern"
1114
+
1115
+ #: ../admin/functions.php:1455
1116
+ msgid "File upload stopped by extension"
1117
+ msgstr "Upload dieser Dateierweiterung nicht erlaubt"
1118
+
1119
+ #: ../admin/functions.php:1458
1120
+ msgid "Unknown upload error"
1121
+ msgstr "Unbekannter Uploadfehler"
1122
+
1123
+ #: ../admin/install.php:23
1124
+ msgid "Sorry, NextGEN Gallery works only with a role called administrator"
1125
+ msgstr "Tut mir leid, aber NextGEN Gallery benötigt zwingend die Rolle \"Administrator\""
1126
+
1127
+ #: ../admin/install.php:112
1128
+ msgid "NextGEN Gallery : Tables could not created, please check your database settings"
1129
+ msgstr "NextGEN Gallery : Tabellen konnten nicht erstellt werden, überprüfe Deine Datenbank"
1130
+
1131
+ #: ../admin/install.php:170
1132
+ msgid "[Show as slideshow]"
1133
+ msgstr "[Zeige als Diashow]"
1134
+
1135
+ #: ../admin/install.php:171
1136
+ msgid "[Show picture list]"
1137
+ msgstr "[Zeige Bilder-Liste]"
1138
+
1139
+ #: ../admin/manage-galleries.php:69
1140
+ #: ../admin/manage-images.php:171
1141
+ msgid "No images selected"
1142
+ msgstr "Keine Bilder ausgewählt"
1143
+
1144
+ #: ../admin/manage-galleries.php:77
1145
+ #: ../admin/manage-galleries.php:149
1146
+ #: ../admin/manage-images.php:199
1147
+ #: ../admin/manage-images.php:343
1148
+ #: ../admin/manage.php:207
1149
+ #: ../admin/manage.php:285
1150
+ msgid "Resize images"
1151
+ msgstr "Bilder verkleinern"
1152
+
1153
+ #: ../admin/manage-galleries.php:86
1154
+ #, php-format
1155
+ msgid ""
1156
+ "You are about to start the bulk edit for %s galleries \n"
1157
+ " \n"
1158
+ " 'Cancel' to stop, 'OK' to proceed."
1159
+ msgstr ""
1160
+ "Du startest die Bearbeitung von %s Galerien \n"
1161
+ " \n"
1162
+ " 'Abbrechen' um zu stoppen, 'OK' um die Bearbeitung durchzuführen."
1163
+
1164
+ #: ../admin/manage-galleries.php:130
1165
+ #: ../admin/manage-galleries.php:133
1166
+ #: ../admin/manage-images.php:225
1167
+ #: ../admin/manage-images.php:228
1168
+ msgid "Search Images"
1169
+ msgstr "Suche Bilder"
1170
+
1171
+ #: ../admin/manage-galleries.php:145
1172
+ #: ../admin/manage-images.php:340
1173
+ msgid "Bulk actions"
1174
+ msgstr "Aktion wählen"
1175
+
1176
+ #: ../admin/manage-galleries.php:147
1177
+ #: ../admin/manage-images.php:341
1178
+ #: ../admin/manage.php:140
1179
+ #: ../admin/manage.php:249
1180
+ msgid "Set watermark"
1181
+ msgstr "Wasserzeichen setzen"
1182
+
1183
+ #: ../admin/manage-galleries.php:150
1184
+ #: ../admin/manage-images.php:346
1185
+ #: ../admin/manage.php:145
1186
+ #: ../admin/manage.php:269
1187
+ msgid "Import metadata"
1188
+ msgstr "Metadaten importieren"
1189
+
1190
+ #: ../admin/manage-galleries.php:151
1191
+ #: ../admin/manage-images.php:344
1192
+ #: ../admin/manage.php:135
1193
+ #: ../admin/manage.php:246
1194
+ msgid "Recover from backup"
1195
+ msgstr "Original wiederherstellen"
1196
+
1197
+ #: ../admin/manage-galleries.php:153
1198
+ #: ../admin/manage-images.php:355
1199
+ msgid "Apply"
1200
+ msgstr "Übernehmen"
1201
+
1202
+ #: ../admin/manage-galleries.php:220
1203
+ msgid "Edit"
1204
+ msgstr "Bearbeiten"
1205
+
1206
+ #: ../admin/manage-galleries.php:261
1207
+ #: ../admin/manage-images.php:506
1208
+ msgid "No entries found"
1209
+ msgstr "Keine Einträge gefunden"
1210
+
1211
+ #: ../admin/manage-galleries.php:308
1212
+ #: ../admin/manage-images.php:589
1213
+ msgid "Resize Images to"
1214
+ msgstr "Verkleinere Bilder auf"
1215
+
1216
+ #: ../admin/manage-galleries.php:312
1217
+ #: ../admin/manage-images.php:593
1218
+ msgid "Width x height (in pixel). NextGEN Gallery will keep ratio size"
1219
+ msgstr "Breite x Höhe (in Pixel). Das Seitenverhältnis wird berücksichtigt."
1220
+
1221
+ #: ../admin/manage-galleries.php:336
1222
+ #: ../admin/manage-images.php:617
1223
+ msgid "Width x height (in pixel)"
1224
+ msgstr "Breite x Höhe (in Pixel)"
1225
+
1226
+ #: ../admin/manage-galleries.php:338
1227
+ #: ../admin/manage-images.php:619
1228
+ msgid "These values are maximum values "
1229
+ msgstr "Diese Angaben sind maximale Angaben."
1230
+
1231
+ #: ../admin/manage-galleries.php:341
1232
+ #: ../admin/manage-images.php:622
1233
+ msgid "Set fix dimension"
1234
+ msgstr "Setze feste Größe"
1235
+
1236
+ #: ../admin/manage-galleries.php:343
1237
+ #: ../admin/manage-images.php:624
1238
+ msgid "Ignore the aspect ratio, no portrait thumbnails"
1239
+ msgstr "Ignoriere Bildseitenverhältnis"
1240
+
1241
+ #: ../admin/manage-galleries.php:406
1242
+ #: ../admin/manage-images.php:694
1243
+ msgid "ID"
1244
+ msgstr "ID"
1245
+
1246
+ #: ../admin/manage-galleries.php:408
1247
+ #: ../admin/manage-images.php:266
1248
+ #: ../admin/manage-images.php:697
1249
+ msgid "Description"
1250
+ msgstr "Beschreibung"
1251
+
1252
+ #: ../admin/manage-galleries.php:409
1253
+ #: ../admin/manage-images.php:295
1254
+ msgid "Author"
1255
+ msgstr "Autor"
1256
+
1257
+ #: ../admin/manage-galleries.php:410
1258
+ msgid "Page ID"
1259
+ msgstr "Seiten-ID"
1260
+
1261
+ #: ../admin/manage-galleries.php:411
1262
+ msgid "Image"
1263
+ msgid_plural "Images"
1264
+ msgstr[0] "Bild"
1265
+ msgstr[1] "Bilder"
1266
+
1267
+ #: ../admin/manage-images.php:34
1268
+ msgid "Gallery not found."
1269
+ msgstr "Galerie nicht gefunden"
1270
+
1271
+ #: ../admin/manage-images.php:40
1272
+ msgid "Sorry, you have no access here"
1273
+ msgstr "Sorry, Du hast nicht genügend Rechte"
1274
+
1275
+ #: ../admin/manage-images.php:179
1276
+ msgid "Copy image to..."
1277
+ msgstr "Kopiere nach..."
1278
+
1279
+ #: ../admin/manage-images.php:183
1280
+ msgid "Move image to..."
1281
+ msgstr "Verschiebe nach..."
1282
+
1283
+ #: ../admin/manage-images.php:187
1284
+ msgid "Add new tags"
1285
+ msgstr "Stichwörter hinzufügen"
1286
+
1287
+ #: ../admin/manage-images.php:191
1288
+ #: ../admin/manage-images.php:352
1289
+ msgid "Delete tags"
1290
+ msgstr "Stichwörter löschen"
1291
+
1292
+ #: ../admin/manage-images.php:195
1293
+ msgid "Overwrite"
1294
+ msgstr "Überschreiben"
1295
+
1296
+ #: ../admin/manage-images.php:208
1297
+ #, php-format
1298
+ msgid ""
1299
+ "You are about to start the bulk edit for %s images \n"
1300
+ " \n"
1301
+ " 'Cancel' to stop, 'OK' to proceed."
1302
+ msgstr ""
1303
+ "Du startest die Bearbeitung von %s Bildern \n"
1304
+ " \n"
1305
+ " 'Abbrechen' um zu stoppen, 'OK' um die Bearbeitung durchzuführen."
1306
+
1307
+ #: ../admin/manage-images.php:222
1308
+ #, php-format
1309
+ msgid "Search results for &#8220;%s&#8221;"
1310
+ msgstr "Suchergebinsse für &#8220;%s&#8221;"
1311
+
1312
+ #: ../admin/manage-images.php:251
1313
+ msgid "Gallery settings"
1314
+ msgstr "Galerie Einstellungen"
1315
+
1316
+ #: ../admin/manage-images.php:251
1317
+ msgid "Click here for more settings"
1318
+ msgstr "Hier klicken für weitere Einstellungen"
1319
+
1320
+ #: ../admin/manage-images.php:268
1321
+ msgid "Preview image"
1322
+ msgstr "Vorschau-Bild"
1323
+
1324
+ #: ../admin/manage-images.php:271
1325
+ msgid "No Picture"
1326
+ msgstr "Kein Bild"
1327
+
1328
+ #: ../admin/manage-images.php:293
1329
+ msgid "Path"
1330
+ msgstr "Pfad"
1331
+
1332
+ #: ../admin/manage-images.php:310
1333
+ msgid "Create new page"
1334
+ msgstr "Neue Seite erstellen"
1335
+
1336
+ #: ../admin/manage-images.php:313
1337
+ msgid "Main page (No parent)"
1338
+ msgstr "Hauptseite (keine Unterseite)"
1339
+
1340
+ #: ../admin/manage-images.php:316
1341
+ msgid "Add page"
1342
+ msgstr "Seite hinzufügen"
1343
+
1344
+ #: ../admin/manage-images.php:325
1345
+ msgid "Scan Folder for new images"
1346
+ msgstr "Überprüfe Verzeichnis nach neuen Bildern"
1347
+
1348
+ #: ../admin/manage-images.php:326
1349
+ #: ../admin/manage-images.php:361
1350
+ #: ../admin/manage-images.php:513
1351
+ msgid "Save Changes"
1352
+ msgstr "Änderungen speichern"
1353
+
1354
+ #: ../admin/manage-images.php:345
1355
+ msgid "Delete images"
1356
+ msgstr "Bilder löschen"
1357
+
1358
+ #: ../admin/manage-images.php:347
1359
+ msgid "Rotate images clockwise"
1360
+ msgstr "Rechts drehen"
1361
+
1362
+ #: ../admin/manage-images.php:348
1363
+ msgid "Rotate images counter-clockwise"
1364
+ msgstr "Links drehen"
1365
+
1366
+ #: ../admin/manage-images.php:349
1367
+ msgid "Copy to..."
1368
+ msgstr "Kopiere nach..."
1369
+
1370
+ #: ../admin/manage-images.php:350
1371
+ msgid "Move to..."
1372
+ msgstr "Verschiebe nach..."
1373
+
1374
+ #: ../admin/manage-images.php:351
1375
+ msgid "Add tags"
1376
+ msgstr "Stichwörter hinzufügen"
1377
+
1378
+ #: ../admin/manage-images.php:353
1379
+ msgid "Overwrite tags"
1380
+ msgstr "Stichwörter überschreiben"
1381
+
1382
+ #: ../admin/manage-images.php:358
1383
+ msgid "Sort gallery"
1384
+ msgstr "Sortiere Bilder"
1385
+
1386
+ #: ../admin/manage-images.php:434
1387
+ msgid "pixel"
1388
+ msgstr "pixel"
1389
+
1390
+ #: ../admin/manage-images.php:440
1391
+ #, php-format
1392
+ msgid "View \"%s\""
1393
+ msgstr "Anzeigen \"%s\""
1394
+
1395
+ #: ../admin/manage-images.php:440
1396
+ msgid "View"
1397
+ msgstr "Ansehen"
1398
+
1399
+ #: ../admin/manage-images.php:441
1400
+ msgid "Show Meta data"
1401
+ msgstr "Zeige Metadaten"
1402
+
1403
+ #: ../admin/manage-images.php:441
1404
+ msgid "Meta"
1405
+ msgstr "Meta"
1406
+
1407
+ #: ../admin/manage-images.php:442
1408
+ msgid "Customize thumbnail"
1409
+ msgstr "Thumbnails anpassen"
1410
+
1411
+ #: ../admin/manage-images.php:442
1412
+ msgid "Edit thumb"
1413
+ msgstr "Thumbnail ändern"
1414
+
1415
+ #: ../admin/manage-images.php:443
1416
+ msgid "Rotate"
1417
+ msgstr "Drehen"
1418
+
1419
+ #: ../admin/manage-images.php:445
1420
+ msgid "Publish this image"
1421
+ msgstr "Bild veröffentlichen"
1422
+
1423
+ #: ../admin/manage-images.php:445
1424
+ msgid "Publish"
1425
+ msgstr "Veröffentlichen"
1426
+
1427
+ #: ../admin/manage-images.php:447
1428
+ msgid "Recover"
1429
+ msgstr "Rücksetzen"
1430
+
1431
+ #: ../admin/manage-images.php:447
1432
+ #, php-format
1433
+ msgid "Recover \"%s\" ?"
1434
+ msgstr " \"%s\" wiederherstellen ?"
1435
+
1436
+ #: ../admin/manage-images.php:448
1437
+ #, php-format
1438
+ msgid "Delete \"%s\" ?"
1439
+ msgstr "Lösche \"%s\" ?"
1440
+
1441
+ #: ../admin/manage-images.php:529
1442
+ msgid "Enter the tags"
1443
+ msgstr "Stichwörter angeben"
1444
+
1445
+ #: ../admin/manage-images.php:553
1446
+ msgid "Select the destination gallery:"
1447
+ msgstr "Galerie auswählen:"
1448
+
1449
+ #: ../admin/manage-images.php:695
1450
+ msgid "Thumbnail"
1451
+ msgstr "Thumbnail"
1452
+
1453
+ #: ../admin/manage-images.php:696
1454
+ #: ../admin/manage-sort.php:77
1455
+ msgid "Filename"
1456
+ msgstr "Dateiname"
1457
+
1458
+ #: ../admin/manage-images.php:697
1459
+ msgid "Alt &amp; Title Text"
1460
+ msgstr "Alt &amp; Titel Text"
1461
+
1462
+ #: ../admin/manage-images.php:698
1463
+ msgid "Tags (comma separated list)"
1464
+ msgstr "Stichwörter (Tags)"
1465
+
1466
+ #: ../admin/manage-images.php:699
1467
+ msgid "exclude"
1468
+ msgstr "ausschließen"
1469
+
1470
+ #: ../admin/manage-sort.php:33
1471
+ msgid "Sort order changed"
1472
+ msgstr "Reihenfolge aktualisiert"
1473
+
1474
+ #: ../admin/manage-sort.php:62
1475
+ msgid "Sort Gallery"
1476
+ msgstr "Sortiere Bilder"
1477
+
1478
+ #: ../admin/manage-sort.php:66
1479
+ msgid "Update Sort Order"
1480
+ msgstr "Sortierung speichern"
1481
+
1482
+ #: ../admin/manage-sort.php:69
1483
+ msgid "Back to gallery"
1484
+ msgstr "Zurueck zur Galerie"
1485
+
1486
+ #: ../admin/manage-sort.php:74
1487
+ msgid "Presort"
1488
+ msgstr "Vorsortieren"
1489
+
1490
+ #: ../admin/manage-sort.php:75
1491
+ msgid "Unsorted"
1492
+ msgstr "Unsortiert"
1493
+
1494
+ #: ../admin/manage-sort.php:76
1495
+ msgid "Image ID"
1496
+ msgstr "Bilder ID"
1497
+
1498
+ #: ../admin/manage-sort.php:78
1499
+ msgid "Alt/Title text"
1500
+ msgstr "Alt / Titel Text"
1501
+
1502
+ #: ../admin/manage-sort.php:79
1503
+ msgid "Date/Time"
1504
+ msgstr "Datum/Zeit"
1505
+
1506
+ #: ../admin/manage-sort.php:80
1507
+ msgid "Ascending"
1508
+ msgstr "Aufsteigend"
1509
+
1510
+ #: ../admin/manage-sort.php:81
1511
+ msgid "Descending"
1512
+ msgstr "Absteigend"
1513
+
1514
+ #: ../admin/manage.php:84
1515
+ msgid "Picture"
1516
+ msgstr "Bild"
1517
+
1518
+ #: ../admin/manage.php:84
1519
+ msgid "deleted successfully"
1520
+ msgstr "erfolgreich gelöscht"
1521
+
1522
+ #: ../admin/manage.php:99
1523
+ #: ../admin/manage.php:108
1524
+ msgid "Operation successful. Please clear your browser cache."
1525
+ msgstr "Thumbnails erfolgreich erstellt. Bitte Browser-Cache löschen."
1526
+
1527
+ #: ../admin/manage.php:175
1528
+ msgid "Gallery deleted successfully "
1529
+ msgstr "Galerie gelöscht"
1530
+
1531
+ #: ../admin/manage.php:240
1532
+ #: ../admin/manage.php:243
1533
+ msgid "Rotate images"
1534
+ msgstr "Bild drehen"
1535
+
1536
+ #: ../admin/manage.php:265
1537
+ msgid "Pictures deleted successfully "
1538
+ msgstr "Bilder erfolgreich gelöscht"
1539
+
1540
+ #: ../admin/manage.php:361
1541
+ msgid "Tags changed"
1542
+ msgstr "Stichwörter geändert"
1543
+
1544
+ #: ../admin/manage.php:397
1545
+ msgid "Update successful"
1546
+ msgstr "Aktualisierung erfolgreich"
1547
+
1548
+ #: ../admin/manage.php:432
1549
+ msgid "New gallery page ID"
1550
+ msgstr "Neue Galerie Seiten ID"
1551
+
1552
+ #: ../admin/manage.php:432
1553
+ msgid "created"
1554
+ msgstr "erstellt"
1555
+
1556
+ #: ../admin/manage.php:468
1557
+ msgid "Published a new post"
1558
+ msgstr "Veröffentliche einen neuen Beitrag"
1559
+
1560
+ #: ../admin/manage.php:582
1561
+ #, php-format
1562
+ msgid "1 item"
1563
+ msgid_plural "%s items"
1564
+ msgstr[0] "1 Element"
1565
+ msgstr[1] "%s Elemente"
1566
+
1567
+ #: ../admin/media-upload.php:11
1568
+ msgid "NextGEN Gallery"
1569
+ msgstr "NextGEN Gallery"
1570
+
1571
+ #: ../admin/media-upload.php:166
1572
+ msgid "No gallery"
1573
+ msgstr "Keine Galerie"
1574
+
1575
+ #: ../admin/media-upload.php:178
1576
+ msgid "Select &#187;"
1577
+ msgstr "Wähle &#187;"
1578
+
1579
+ #: ../admin/media-upload.php:209
1580
+ msgid "Show"
1581
+ msgstr "Zeige"
1582
+
1583
+ #: ../admin/media-upload.php:210
1584
+ msgid "Hide"
1585
+ msgstr "Verstecke"
1586
+
1587
+ #: ../admin/media-upload.php:215
1588
+ msgid "Image ID:"
1589
+ msgstr "Bild ID:"
1590
+
1591
+ #: ../admin/media-upload.php:229
1592
+ #: ../admin/publish.php:55
1593
+ msgid "Alignment"
1594
+ msgstr "Ausrichtung"
1595
+
1596
+ #: ../admin/media-upload.php:232
1597
+ #: ../admin/publish.php:57
1598
+ #: ../admin/settings.php:480
1599
+ msgid "None"
1600
+ msgstr "Keiner"
1601
+
1602
+ #: ../admin/media-upload.php:234
1603
+ #: ../admin/publish.php:59
1604
+ #: ../admin/tinymce/window.php:120
1605
+ msgid "Left"
1606
+ msgstr "Links"
1607
+
1608
+ #: ../admin/media-upload.php:236
1609
+ #: ../admin/publish.php:61
1610
+ #: ../admin/tinymce/window.php:121
1611
+ msgid "Center"
1612
+ msgstr "Zentrieren"
1613
+
1614
+ #: ../admin/media-upload.php:238
1615
+ #: ../admin/publish.php:63
1616
+ #: ../admin/tinymce/window.php:122
1617
+ msgid "Right"
1618
+ msgstr "Rechts"
1619
+
1620
+ #: ../admin/media-upload.php:242
1621
+ #: ../admin/settings.php:587
1622
+ msgid "Size"
1623
+ msgstr "Größe"
1624
+
1625
+ #: ../admin/media-upload.php:248
1626
+ msgid "Full size"
1627
+ msgstr "Volle Größe"
1628
+
1629
+ #: ../admin/media-upload.php:250
1630
+ msgid "Singlepic"
1631
+ msgstr "Einzelbilder"
1632
+
1633
+ #: ../admin/media-upload.php:263
1634
+ msgid "Insert into Post"
1635
+ msgstr "In den Beitrag einfügen"
1636
+
1637
+ #: ../admin/media-upload.php:274
1638
+ msgid "Save all changes"
1639
+ msgstr "Änderungen speichern"
1640
+
1641
+ #: ../admin/overview.php:14
1642
+ msgid "NextGEN Gallery Overview"
1643
+ msgstr "NextGEN Gallery Übersicht"
1644
+
1645
+ #: ../admin/overview.php:86
1646
+ msgid "Welcome to NextGEN Gallery !"
1647
+ msgstr "Willkomen bei NextGEN Gallery"
1648
+
1649
+ #: ../admin/overview.php:87
1650
+ msgid "Do you like this Plugin?"
1651
+ msgstr "Bist Du mit dem Plugin zufrieden ?"
1652
+
1653
+ #: ../admin/overview.php:89
1654
+ msgid "Translation"
1655
+ msgstr "Übersetzung"
1656
+
1657
+ #: ../admin/overview.php:90
1658
+ msgid "Latest News"
1659
+ msgstr "Letzte Informationen"
1660
+
1661
+ #: ../admin/overview.php:91
1662
+ msgid "Recent donators"
1663
+ msgstr "Neueste Spender"
1664
+
1665
+ #: ../admin/overview.php:93
1666
+ msgid "Plugin Check"
1667
+ msgstr "Plugin prüfen"
1668
+
1669
+ #: ../admin/overview.php:94
1670
+ msgid "Server Settings"
1671
+ msgstr "Server- Einstellungen"
1672
+
1673
+ #: ../admin/overview.php:95
1674
+ msgid "Related plugins"
1675
+ msgstr "Verwandte Plugins"
1676
+
1677
+ #: ../admin/overview.php:101
1678
+ #, php-format
1679
+ msgid "This plugin is primarily developed, maintained, supported and documented by <a href=\"%s\">Alex Rabe</a> with a lot of love & effort. Any kind of contribution would be highly appreciated. Thanks!"
1680
+ msgstr "Dieses Plugin wird mit viel Mühe & Leidenschaft entwickelt, dokumentiert und supported von <a href=\"%s\">Alex Rabe</a>. Vielleicht möchtest Du dich ja dankbar zeigen. "
1681
+
1682
+ #: ../admin/overview.php:106
1683
+ msgid "Give it a good rating on WordPress.org."
1684
+ msgstr "Bitte bewerte das Plugin bei WordPress.org."
1685
+
1686
+ #: ../admin/overview.php:111
1687
+ msgid "Donate the work via paypal."
1688
+ msgstr "Zeig Dich für diese Arbeit per PayPal dankbar"
1689
+
1690
+ #: ../admin/overview.php:116
1691
+ msgid "Help translating it."
1692
+ msgstr "Hilf das Plugin zu übersetzen."
1693
+
1694
+ #: ../admin/overview.php:252
1695
+ msgid "Running..."
1696
+ msgstr "Läuft... Bitte warten"
1697
+
1698
+ #: ../admin/overview.php:299
1699
+ msgid "Check plugin/theme conflict"
1700
+ msgstr "Plugin/Theme Konflikt prüfen"
1701
+
1702
+ #: ../admin/overview.php:300
1703
+ #: ../admin/overview.php:306
1704
+ #: ../admin/overview.php:312
1705
+ msgid "Not tested"
1706
+ msgstr "Nicht getested"
1707
+
1708
+ #: ../admin/overview.php:301
1709
+ msgid "No conflict could be detected"
1710
+ msgstr "Es konnte kein Konflikt festgestellt werden"
1711
+
1712
+ #: ../admin/overview.php:302
1713
+ msgid "Test failed, disable other plugins & switch to default theme"
1714
+ msgstr "Test fehlgeschlagen, deaktiviere andere Plugins & aktiviere das Default Theme"
1715
+
1716
+ #: ../admin/overview.php:305
1717
+ msgid "Test image function"
1718
+ msgstr "Teste Bildbearbeitung"
1719
+
1720
+ #: ../admin/overview.php:307
1721
+ msgid "The plugin could create images"
1722
+ msgstr "Es konnte ein Bild erstellt werden"
1723
+
1724
+ #: ../admin/overview.php:308
1725
+ msgid "Couldn't create image, check your memory limit"
1726
+ msgstr "Konnte kein Bild erzeugen, überprüfe dein Speicherlimit (Server)"
1727
+
1728
+ #: ../admin/overview.php:311
1729
+ msgid "Check theme compatibility"
1730
+ msgstr "Theme Kompatibilität prüfen"
1731
+
1732
+ #: ../admin/overview.php:313
1733
+ msgid "Your theme should work fine with NextGEN Gallery"
1734
+ msgstr "Dein Theme sollte mit NextGEN Gallery funktionieren"
1735
+
1736
+ #: ../admin/overview.php:314
1737
+ msgid "wp_head()/wp_footer() is missing, contact the theme author"
1738
+ msgstr "wp_head()/wp_footer() wurde nicht gefunden, kontaktiere den Theme Author"
1739
+
1740
+ #: ../admin/overview.php:318
1741
+ msgid "Check plugin"
1742
+ msgstr "Plugin prüfen"
1743
+
1744
+ #: ../admin/overview.php:339
1745
+ msgid "Graphic Library"
1746
+ msgstr "Grafik-Bibliothek"
1747
+
1748
+ #: ../admin/overview.php:355
1749
+ #: ../admin/overview.php:404
1750
+ #: ../admin/overview.php:591
1751
+ #: ../admin/overview.php:781
1752
+ msgid "Loading&#8230;"
1753
+ msgstr "Lade&#8230;"
1754
+
1755
+ #: ../admin/overview.php:355
1756
+ #: ../admin/overview.php:404
1757
+ #: ../admin/overview.php:591
1758
+ #: ../admin/overview.php:781
1759
+ msgid "This widget requires JavaScript."
1760
+ msgstr "Dieses Widget braucht JavaScript."
1761
+
1762
+ #: ../admin/overview.php:368
1763
+ msgid "Thanks to all donators..."
1764
+ msgstr "Danke an alle Spender..."
1765
+
1766
+ #: ../admin/overview.php:390
1767
+ msgid "View all"
1768
+ msgstr "Alle ansehen"
1769
+
1770
+ #: ../admin/overview.php:416
1771
+ #, php-format
1772
+ msgid "Newsfeed could not be loaded. Check the <a href=\"%s\">front page</a> to check for updates."
1773
+ msgstr "Der Newsfeed kann nicht geladen werden. Schaue auf die <a href=\"%s\">Hauptseite</a>, um Updates mitzubekommen."
1774
+
1775
+ #: ../admin/overview.php:428
1776
+ msgid "Untitled"
1777
+ msgstr "Kein Titel"
1778
+
1779
+ #: ../admin/overview.php:478
1780
+ msgid "At a Glance"
1781
+ msgstr "Übersicht"
1782
+
1783
+ #: ../admin/overview.php:504
1784
+ msgid "Upload pictures"
1785
+ msgstr "Bilder hochladen"
1786
+
1787
+ #: ../admin/overview.php:505
1788
+ msgid "Here you can control your images, galleries and albums."
1789
+ msgstr "Hier kannst Du die Bilder, Galerien und Alben verwalten."
1790
+
1791
+ #: ../admin/overview.php:535
1792
+ msgid "Storage Space"
1793
+ msgstr "Speicherplatz"
1794
+
1795
+ #: ../admin/overview.php:539
1796
+ #, php-format
1797
+ msgid "<a href=\"%1$s\" title=\"Manage Uploads\" class=\"musublink\">%2$sMB</a>"
1798
+ msgstr "<a href=\"%1$s\" title=\"Verwalte Uploads\" class=\"musublink\">%2$sMB</a>"
1799
+
1800
+ #: ../admin/overview.php:540
1801
+ msgid "Space Allowed"
1802
+ msgstr "Speicher verfügbar"
1803
+
1804
+ #: ../admin/overview.php:547
1805
+ #, php-format
1806
+ msgid "<a href=\"%1$s\" title=\"Manage Uploads\" class=\"musublink\">%2$sMB (%3$s%%)</a>"
1807
+ msgstr "<a href=\"%1$s\" title=\"Verwalte Uploads\" class=\"musublink\">%2$sMB (%3$s%%)</a>"
1808
+
1809
+ #: ../admin/overview.php:548
1810
+ msgid "Space Used"
1811
+ msgstr "Verbrauchter Uploadspeicher"
1812
+
1813
+ #: ../admin/overview.php:577
1814
+ msgid "Translation file successful updated. Please reload page."
1815
+ msgstr "Übersetzungsdatei aktualisiert. Bitte Seite neu laden."
1816
+
1817
+ #: ../admin/overview.php:579
1818
+ msgid "Reload page"
1819
+ msgstr "Seite neu laden"
1820
+
1821
+ #: ../admin/overview.php:584
1822
+ msgid "Translation file couldn't be updated"
1823
+ msgstr "Übersetzung konnte nicht aktualisiert werden"
1824
+
1825
+ #: ../admin/overview.php:621
1826
+ msgid "Download"
1827
+ msgstr "Jetzt updaten"
1828
+
1829
+ #: ../admin/overview.php:650
1830
+ msgid "No GD support"
1831
+ msgstr "Keine GD Unterstützung"
1832
+
1833
+ #: ../admin/overview.php:662
1834
+ #: ../admin/overview.php:708
1835
+ #: ../admin/overview.php:711
1836
+ #: ../admin/overview.php:714
1837
+ msgid "Yes"
1838
+ msgstr "Ja"
1839
+
1840
+ #: ../admin/overview.php:664
1841
+ #: ../admin/overview.php:709
1842
+ #: ../admin/overview.php:712
1843
+ #: ../admin/overview.php:715
1844
+ msgid "No"
1845
+ msgstr "Nein"
1846
+
1847
+ #: ../admin/overview.php:682
1848
+ msgid "Not set"
1849
+ msgstr "Nicht gesetzt"
1850
+
1851
+ #: ../admin/overview.php:684
1852
+ #: ../admin/overview.php:687
1853
+ msgid "On"
1854
+ msgstr "An"
1855
+
1856
+ #: ../admin/overview.php:685
1857
+ #: ../admin/overview.php:688
1858
+ msgid "Off"
1859
+ msgstr "Aus"
1860
+
1861
+ #: ../admin/overview.php:691
1862
+ #: ../admin/overview.php:694
1863
+ #: ../admin/overview.php:697
1864
+ #: ../admin/overview.php:700
1865
+ #: ../admin/overview.php:703
1866
+ #: ../admin/overview.php:706
1867
+ msgid "N/A"
1868
+ msgstr "N/A"
1869
+
1870
+ #: ../admin/overview.php:705
1871
+ msgid " MByte"
1872
+ msgstr " MByte"
1873
+
1874
+ #: ../admin/overview.php:718
1875
+ msgid "Operating System"
1876
+ msgstr "Betriebssystem"
1877
+
1878
+ #: ../admin/overview.php:719
1879
+ msgid "Server"
1880
+ msgstr "Server"
1881
+
1882
+ #: ../admin/overview.php:720
1883
+ msgid "Memory usage"
1884
+ msgstr "Speicherverbrauch"
1885
+
1886
+ #: ../admin/overview.php:721
1887
+ msgid "MYSQL Version"
1888
+ msgstr "MySQL Version"
1889
+
1890
+ #: ../admin/overview.php:722
1891
+ msgid "SQL Mode"
1892
+ msgstr "SQL Modus"
1893
+
1894
+ #: ../admin/overview.php:723
1895
+ msgid "PHP Version"
1896
+ msgstr "PHP Version"
1897
+
1898
+ #: ../admin/overview.php:724
1899
+ msgid "PHP Safe Mode"
1900
+ msgstr "PHP Safe Mode"
1901
+
1902
+ #: ../admin/overview.php:725
1903
+ msgid "PHP Allow URL fopen"
1904
+ msgstr "PHP Allow URL fopen"
1905
+
1906
+ #: ../admin/overview.php:726
1907
+ msgid "PHP Memory Limit"
1908
+ msgstr "PHP Memory Limit"
1909
+
1910
+ #: ../admin/overview.php:727
1911
+ msgid "PHP Max Upload Size"
1912
+ msgstr "PHP Max Upload Größe"
1913
+
1914
+ #: ../admin/overview.php:728
1915
+ msgid "PHP Max Post Size"
1916
+ msgstr "PHP Max Post Größe"
1917
+
1918
+ #: ../admin/overview.php:729
1919
+ msgid "PCRE Backtracking Limit"
1920
+ msgstr "PCRE Backtracking Limit"
1921
+
1922
+ #: ../admin/overview.php:730
1923
+ msgid "PHP Max Script Execute Time"
1924
+ msgstr "PHP Max Script Execute Time"
1925
+
1926
+ #: ../admin/overview.php:731
1927
+ msgid "PHP Exif support"
1928
+ msgstr "PHP Exif Modul"
1929
+
1930
+ #: ../admin/overview.php:732
1931
+ msgid "PHP IPTC support"
1932
+ msgstr "PHP IPTC Modul"
1933
+
1934
+ #: ../admin/overview.php:733
1935
+ msgid "PHP XML support"
1936
+ msgstr "PHP XML Modul"
1937
+
1938
+ #: ../admin/overview.php:745
1939
+ msgid "NextGEN Gallery contains some functions which are only available under PHP 5.2. You are using the old PHP 4 version, upgrade now! It's no longer supported by the PHP group. Many shared hosting providers offer both PHP 4 and PHP 5, running simultaneously. Ask your provider if they can do this."
1940
+ msgstr "NextGEN Gallery enthält einige Funktionen, die nur unter PHP 5.2 verfügbar sind. Du nutzt immer noch die alte PHP 4 Version. Bitte aktualisiere so bald wie möglich diese Version, sie wird nicht mehr gepflegt und weiterentwicklelt. Die meisten Hoster bieten bereits PHP5 an. Bitte kontaktiere Deinen Provider und frag kurz nach, ob sie ein Update durchführen können."
1941
+
1942
+ #: ../admin/overview.php:841
1943
+ msgid "Install"
1944
+ msgstr "Installieren"
1945
+
1946
+ #: ../admin/pointer.php:22
1947
+ msgid "<h3>Client side resize</h3><p>You can now resize the images before you start with the upload.</p>"
1948
+ msgstr "<h3>Neue Funktion</h3><p>Du kannst nun die Bilder bereits vor dem Upload beschneiden.</p>"
1949
+
1950
+ #: ../admin/publish.php:45
1951
+ msgid "Post title"
1952
+ msgstr "Beitragstitel"
1953
+
1954
+ #: ../admin/publish.php:47
1955
+ msgid "Enter the post title "
1956
+ msgstr "Artikelüberschrift "
1957
+
1958
+ #: ../admin/publish.php:52
1959
+ msgid "Size of the image"
1960
+ msgstr "Größe des Bildes"
1961
+
1962
+ #: ../admin/publish.php:70
1963
+ msgid "Draft"
1964
+ msgstr "Entwurf"
1965
+
1966
+ #: ../admin/roles.php:22
1967
+ msgid "Updated capabilities"
1968
+ msgstr "Zugriffsrechte geändert"
1969
+
1970
+ #: ../admin/roles.php:28
1971
+ msgid "Roles / capabilities"
1972
+ msgstr "Rollen / Zugriffsrechte"
1973
+
1974
+ #: ../admin/roles.php:29
1975
+ msgid "Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress."
1976
+ msgstr "Wähle die niedrigste Rolle aus, die Zugriff haben soll. NextGEN Gallery unterstützt nur die Standard-Wordpress-Rollen-Fähigkeiten von WordPress."
1977
+
1978
+ #: ../admin/roles.php:30
1979
+ msgid "For a more flexible user management you can use the"
1980
+ msgstr "Nutze für eine flexiblere Rechteverwaltung den "
1981
+
1982
+ #: ../admin/roles.php:35
1983
+ msgid "Main NextGEN Gallery overview"
1984
+ msgstr "NextGEN Galerie Übersicht"
1985
+
1986
+ #: ../admin/roles.php:39
1987
+ msgid "Use TinyMCE Button / Upload tab"
1988
+ msgstr "TinyMCE Button / Upload Tab"
1989
+
1990
+ #: ../admin/roles.php:43
1991
+ msgid "Add gallery / Upload images"
1992
+ msgstr "Galerie einrichten / Bilder hochladen"
1993
+
1994
+ #: ../admin/roles.php:47
1995
+ msgid "Manage gallery"
1996
+ msgstr "Galerie verwalten"
1997
+
1998
+ #: ../admin/roles.php:51
1999
+ msgid "Manage others gallery"
2000
+ msgstr "Alle Galerien verwalten"
2001
+
2002
+ #: ../admin/roles.php:55
2003
+ msgid "Manage tags"
2004
+ msgstr "Verwalte Stichwörter"
2005
+
2006
+ #: ../admin/roles.php:63
2007
+ msgid "Change style"
2008
+ msgstr "Style anpassen"
2009
+
2010
+ #: ../admin/roles.php:67
2011
+ msgid "Change options"
2012
+ msgstr "Optionen änderen"
2013
+
2014
+ #: ../admin/roles.php:71
2015
+ msgid "Update capabilities"
2016
+ msgstr "Rechte aktualisieren"
2017
+
2018
+ #: ../admin/rotate.php:55
2019
+ msgid "Image rotated"
2020
+ msgstr "Bild gedreht"
2021
+
2022
+ #: ../admin/rotate.php:56
2023
+ msgid "Error rotating thumbnail"
2024
+ msgstr "Konnte Bild nicht bearbeiten"
2025
+
2026
+ #: ../admin/rotate.php:81
2027
+ msgid "90&deg; clockwise"
2028
+ msgstr "90° rechts drehen"
2029
+
2030
+ #: ../admin/rotate.php:82
2031
+ msgid "90&deg; anticlockwise"
2032
+ msgstr "90° links drehen"
2033
+
2034
+ #: ../admin/rotate.php:83
2035
+ msgid "Flip vertically"
2036
+ msgstr "Vertikal spiegeln"
2037
+
2038
+ #: ../admin/rotate.php:84
2039
+ msgid "Flip horizontally"
2040
+ msgstr "Horizontal spiegeln"
2041
+
2042
+ #: ../admin/settings.php:97
2043
+ msgid "Cache cleared"
2044
+ msgstr "Cache löschen"
2045
+
2046
+ #: ../admin/settings.php:217
2047
+ #: ../admin/settings.php:236
2048
+ msgid "General Options"
2049
+ msgstr "Allg. Optionen"
2050
+
2051
+ #: ../admin/settings.php:218
2052
+ #: ../admin/settings.php:417
2053
+ msgid "Thumbnails"
2054
+ msgstr "Thumbnails"
2055
+
2056
+ #: ../admin/settings.php:219
2057
+ msgid "Images"
2058
+ msgstr "Bilder"
2059
+
2060
+ #: ../admin/settings.php:221
2061
+ #: ../admin/settings.php:469
2062
+ msgid "Effects"
2063
+ msgstr "Effekte"
2064
+
2065
+ #: ../admin/settings.php:222
2066
+ #: ../admin/settings.php:511
2067
+ #: ../admin/tinymce/window.php:110
2068
+ msgid "Watermark"
2069
+ msgstr "Wasserzeichen"
2070
+
2071
+ #: ../admin/settings.php:223
2072
+ #: ../admin/settings.php:418
2073
+ #: ../admin/settings.php:618
2074
+ #: ../admin/tinymce/window.php:63
2075
+ msgid "Slideshow"
2076
+ msgstr "Slideshow"
2077
+
2078
+ #: ../admin/settings.php:242
2079
+ #: ../admin/wpmu.php:68
2080
+ msgid "Gallery path"
2081
+ msgstr "Galerie-Pfad"
2082
+
2083
+ #: ../admin/settings.php:244
2084
+ msgid "This is the default path for all galleries"
2085
+ msgstr "Dies ist der Standard-Pfad für alle Galerien"
2086
+
2087
+ #: ../admin/settings.php:247
2088
+ msgid "Delete image files"
2089
+ msgstr "Lösche Bilddateien"
2090
+
2091
+ #: ../admin/settings.php:249
2092
+ msgid "Delete files, when removing a gallery in the database"
2093
+ msgstr "Löscht auch die Dateien, falls die Galerie aus der Datenbank entfernt wird"
2094
+
2095
+ #: ../admin/settings.php:252
2096
+ msgid "Activate permalinks"
2097
+ msgstr "Aktiviere Permalinks"
2098
+
2099
+ #: ../admin/settings.php:254
2100
+ msgid "When you activate this option, you need to update your permalink structure one time."
2101
+ msgstr "Wenn Du diese Option aktivierst, muss Du einmal die Permalink Struktur aktualisieren."
2102
+
2103
+ #: ../admin/settings.php:255
2104
+ msgid "Gallery slug name :"
2105
+ msgstr "Galerie Schlagwort :"
2106
+
2107
+ #: ../admin/settings.php:259
2108
+ msgid "Create new URL friendly image slugs"
2109
+ msgstr "Erstelle neue URL lesbare Schlagwörter "
2110
+
2111
+ #: ../admin/settings.php:260
2112
+ #: ../admin/settings.php:371
2113
+ msgid "Proceed now"
2114
+ msgstr "Jetzt durchführen"
2115
+
2116
+ #: ../admin/settings.php:263
2117
+ msgid "Select graphic library"
2118
+ msgstr "Wähle Grafik-Bibliothek"
2119
+
2120
+ #: ../admin/settings.php:264
2121
+ msgid "GD Library"
2122
+ msgstr "GD Bibliothek"
2123
+
2124
+ #: ../admin/settings.php:265
2125
+ msgid "ImageMagick (Experimental). Path to the library :"
2126
+ msgstr "ImageMagick (Experimental). Pfad zur Bibliothek :"
2127
+
2128
+ #: ../admin/settings.php:270
2129
+ msgid "Activate Media RSS feed"
2130
+ msgstr "Aktiviere Media-RSS-Feed"
2131
+
2132
+ #: ../admin/settings.php:272
2133
+ msgid "A RSS feed will be added to you blog header. Useful for CoolIris/PicLens"
2134
+ msgstr "Ein Bilder-RSS Feed wird zum Blog hinzugefügt"
2135
+
2136
+ #: ../admin/settings.php:275
2137
+ msgid "Activate PicLens/CoolIris support"
2138
+ msgstr "Aktiviere PicLens/CoolIris"
2139
+
2140
+ #: ../admin/settings.php:277
2141
+ msgid "When you activate this option, some javascript is added to your site footer. Make sure that wp_footer is called in your theme."
2142
+ msgstr "Dieser Effekt fügt ein neues Javascript zu Deinem Theme hinzu. Beachte, dass wp_footer() in Deinen Vorlagen aufgerufen wird."
2143
+
2144
+ #: ../admin/settings.php:280
2145
+ msgid "Tags / Categories"
2146
+ msgstr "Stichwörter / Kategorien"
2147
+
2148
+ #: ../admin/settings.php:283
2149
+ msgid "Activate related images"
2150
+ msgstr "Verwandte Bilder anzeigen"
2151
+
2152
+ #: ../admin/settings.php:285
2153
+ msgid "This option will append related images to every post"
2154
+ msgstr "Diese Option hängt verwandte Bilder an jeden Beitrag"
2155
+
2156
+ #: ../admin/settings.php:289
2157
+ msgid "Match with"
2158
+ msgstr "Vergleiche mit"
2159
+
2160
+ #: ../admin/settings.php:290
2161
+ msgid "Categories"
2162
+ msgstr "Kategorien"
2163
+
2164
+ #: ../admin/settings.php:295
2165
+ msgid "Max. number of images"
2166
+ msgstr "Max. Anzahl der Bilder"
2167
+
2168
+ #: ../admin/settings.php:297
2169
+ msgid "0 will show all images"
2170
+ msgstr "0 zeige alle verwandten Bilder"
2171
+
2172
+ #: ../admin/settings.php:301
2173
+ #: ../admin/settings.php:332
2174
+ #: ../admin/settings.php:374
2175
+ #: ../admin/settings.php:459
2176
+ #: ../admin/settings.php:494
2177
+ #: ../admin/settings.php:755
2178
+ msgid "More settings"
2179
+ msgstr "Mehr Einstellungen"
2180
+
2181
+ #: ../admin/settings.php:311
2182
+ msgid "Thumbnail settings"
2183
+ msgstr "Thumbnail-Einstellungen"
2184
+
2185
+ #: ../admin/settings.php:315
2186
+ msgid "Please note : If you change the settings, you need to recreate the thumbnails under -> Manage Gallery ."
2187
+ msgstr "Bitte beachten : Änderungen der Einstellungen werden erst übernommen, wenn Du neue Thumbnails unter -> \"Gallery verwalten\" erstellst"
2188
+
2189
+ #: ../admin/settings.php:328
2190
+ msgid "Thumbnail quality"
2191
+ msgstr "Thumbnail Qualität"
2192
+
2193
+ #: ../admin/settings.php:342
2194
+ msgid "Image settings"
2195
+ msgstr "Bild-Einstellungen"
2196
+
2197
+ #: ../admin/settings.php:348
2198
+ msgid "Resize Images"
2199
+ msgstr "Bilder verkleinern"
2200
+
2201
+ #: ../admin/settings.php:353
2202
+ msgid "Image quality"
2203
+ msgstr "Bild Qualität"
2204
+
2205
+ #: ../admin/settings.php:357
2206
+ msgid "Backup original images"
2207
+ msgstr "Backup von Original-Bildern "
2208
+
2209
+ #: ../admin/settings.php:359
2210
+ msgid "Creates a backup for inserted images"
2211
+ msgstr "Backup der Bilder anlegen"
2212
+
2213
+ #: ../admin/settings.php:362
2214
+ msgid "Automatically resize"
2215
+ msgstr "Grösse automatisch anpassen"
2216
+
2217
+ #: ../admin/settings.php:364
2218
+ msgid "Automatically resize images on upload."
2219
+ msgstr "Passt die Grösse automatisch beim Upload an"
2220
+
2221
+ #: ../admin/settings.php:367
2222
+ msgid "Single picture"
2223
+ msgstr "Einzelbilder"
2224
+
2225
+ #: ../admin/settings.php:370
2226
+ msgid "Clear cache folder"
2227
+ msgstr "Lösche Cache-Verzeichnis"
2228
+
2229
+ #: ../admin/settings.php:391
2230
+ msgid "Deactivate gallery page link"
2231
+ msgstr "Keine Seitenverzweigung"
2232
+
2233
+ #: ../admin/settings.php:393
2234
+ msgid "The album will not link to a gallery subpage. The gallery is shown on the same page."
2235
+ msgstr "Ein Album benötigt dann keinen Link zur Seite. Die Galerie wird direkt angezeigt."
2236
+
2237
+ #: ../admin/settings.php:397
2238
+ msgid "Number of images per page"
2239
+ msgstr "Anzahl der Bilder pro Seite"
2240
+
2241
+ #: ../admin/settings.php:399
2242
+ msgid "0 will disable pagination, all images on one page"
2243
+ msgstr "0 schaltet Blätterfunktion ab ( = alle Bilder auf einer Seite )"
2244
+
2245
+ #: ../admin/settings.php:403
2246
+ msgid "Number of columns"
2247
+ msgstr "Anzahl der Spalten"
2248
+
2249
+ #: ../admin/settings.php:405
2250
+ msgid "0 will display as much as possible based on the width of your theme. Setting normally only required for captions below the images"
2251
+ msgstr "Mit \"0\" werden soviele Bilder wie möglich in einer Reihe dargestellt. Die Einstellung ist normalerweise nur für Beschriftungen unterhalb der Bilder sinnvoll."
2252
+
2253
+ #: ../admin/settings.php:409
2254
+ msgid "Integrate slideshow"
2255
+ msgstr "Slideshow verwenden"
2256
+
2257
+ #: ../admin/settings.php:416
2258
+ msgid "Show first"
2259
+ msgstr "Zeige als Erstes"
2260
+
2261
+ #: ../admin/settings.php:422
2262
+ msgid "Show ImageBrowser"
2263
+ msgstr "Zeige Bilder-Browser"
2264
+
2265
+ #: ../admin/settings.php:424
2266
+ msgid "The gallery will open the ImageBrowser instead the effect."
2267
+ msgstr "Es wird der Bilder-Browser angezeigt (Kein JavaScript Effekt)"
2268
+
2269
+ #: ../admin/settings.php:428
2270
+ msgid "Add hidden images"
2271
+ msgstr "Versteckte Bilder hinzufügen"
2272
+
2273
+ #: ../admin/settings.php:430
2274
+ msgid "If pagination is used, this option will still show all images in the modal window (Thickbox, Lightbox etc.). Note : This increases the page load"
2275
+ msgstr "Wenn Du die Blätterfunktion nutzt, dann kannst Du mit dieser Option alle Bilder im Modal-Fenster (Thickbox,Lightbox etc.) anzeigen. Berücksichtige, dass die Ladezeit der Seite erhöht wird."
2276
+
2277
+ #: ../admin/settings.php:434
2278
+ msgid "Enable AJAX pagination"
2279
+ msgstr "Aktiviere AJAX-Navigation"
2280
+
2281
+ #: ../admin/settings.php:436
2282
+ msgid "Browse images without reload the page. Note : Works only in combination with Shutter effect"
2283
+ msgstr "Ermöglicht das Blättern zwischen den Bildern ohne die Seite neu zu laden. Hinweis : Funktioniert nur mit dem Shutter-Effekt."
2284
+
2285
+ #: ../admin/settings.php:440
2286
+ msgid "Sort options"
2287
+ msgstr "Sortierung"
2288
+
2289
+ #: ../admin/settings.php:443
2290
+ msgid "Sort thumbnails"
2291
+ msgstr "Thumbnails sortieren"
2292
+
2293
+ #: ../admin/settings.php:445
2294
+ msgid "Custom order"
2295
+ msgstr "Benutzerdefiniert"
2296
+
2297
+ #: ../admin/settings.php:447
2298
+ msgid "File name"
2299
+ msgstr "Dateiname"
2300
+
2301
+ #: ../admin/settings.php:448
2302
+ msgid "Alt / Title text"
2303
+ msgstr "Alt / Titel Text"
2304
+
2305
+ #: ../admin/settings.php:449
2306
+ msgid "Date / Time"
2307
+ msgstr "Datum/Zeit"
2308
+
2309
+ #: ../admin/settings.php:453
2310
+ msgid "Sort direction"
2311
+ msgstr "Sortierreihenfolge"
2312
+
2313
+ #: ../admin/settings.php:473
2314
+ msgid "Here you can select the thumbnail effect, NextGEN Gallery will integrate the required HTML code in the images. Please note that only the Shutter and Thickbox effect will automatic added to your theme."
2315
+ msgstr "Hier kannst Du den Effekt für die Thumbnails auswählen. NextGEN Galerie wird den benötigten HTML-Code verwenden. Bitte beachte, dass nur Shutter und der Thickbox Effekt automatisch in Dein Theme von Wordpress integriert wird. Alle anderen Effekte mußt Du selbst in die header.php eintragen (JS)."
2316
+
2317
+ #: ../admin/settings.php:474
2318
+ msgid "With the placeholder"
2319
+ msgstr "Mit Platzhalter"
2320
+
2321
+ #: ../admin/settings.php:474
2322
+ msgid "you can activate a navigation through the images (depend on the effect). Change the code line only , when you use a different thumbnail effect or you know what you do."
2323
+ msgstr "Du kannst eine Navigation durch die Bilder aktivieren (hängt vom Effekt ab). Ändere nur die Codezeile, falls Du einen anderen Effekt für die Thumbnails verwendest oder einfach weißt, was Du tust."
2324
+
2325
+ #: ../admin/settings.php:477
2326
+ msgid "JavaScript Thumbnail effect"
2327
+ msgstr "JavaScript Thumbnail Effekt"
2328
+
2329
+ #: ../admin/settings.php:481
2330
+ msgid "Thickbox"
2331
+ msgstr "Thickbox"
2332
+
2333
+ #: ../admin/settings.php:482
2334
+ msgid "Lightbox"
2335
+ msgstr "Lightbox"
2336
+
2337
+ #: ../admin/settings.php:483
2338
+ msgid "Highslide"
2339
+ msgstr "Highslide"
2340
+
2341
+ #: ../admin/settings.php:484
2342
+ msgid "Shutter"
2343
+ msgstr "Shutter"
2344
+
2345
+ #: ../admin/settings.php:485
2346
+ msgid "Custom"
2347
+ msgstr "Eigener"
2348
+
2349
+ #: ../admin/settings.php:490
2350
+ msgid "Link Code line"
2351
+ msgstr "Link-Code-Zeile"
2352
+
2353
+ #: ../admin/settings.php:512
2354
+ msgid "Please note : You can only activate the watermark under -> Manage Gallery . This action cannot be undone."
2355
+ msgstr "Bitte beachten : Das Wasserzeichen kann nur unter der Galerieverwaltung gesetzt werden. "
2356
+
2357
+ #: ../admin/settings.php:517
2358
+ msgid "Preview"
2359
+ msgstr "Vorschau"
2360
+
2361
+ #: ../admin/settings.php:519
2362
+ #: ../admin/settings.php:524
2363
+ msgid "Position"
2364
+ msgstr "Position"
2365
+
2366
+ #: ../admin/settings.php:544
2367
+ msgid "Offset"
2368
+ msgstr "Abstand"
2369
+
2370
+ #: ../admin/settings.php:560
2371
+ msgid "Use image as watermark"
2372
+ msgstr "Benutze das Bild als Wasserzeichen"
2373
+
2374
+ #: ../admin/settings.php:563
2375
+ msgid "URL to file"
2376
+ msgstr "URL zur Datei"
2377
+
2378
+ #: ../admin/settings.php:565
2379
+ msgid "The accessing of URL files is disabled at your server (allow_url_fopen)"
2380
+ msgstr "Der Dateizugriff von URLs ist auf diesem Server deaktiviert (allow_url_fopen)"
2381
+
2382
+ #: ../admin/settings.php:568
2383
+ msgid "Use text as watermark"
2384
+ msgstr "Benutze Text als Wasserzeichen"
2385
+
2386
+ #: ../admin/settings.php:571
2387
+ msgid "Font"
2388
+ msgstr "Schriftart"
2389
+
2390
+ #: ../admin/settings.php:580
2391
+ msgid "This function will not work, cause you need the FreeType library"
2392
+ msgstr "Diese Funktion benötigt die FreeType-Bibliothek"
2393
+
2394
+ #: ../admin/settings.php:582
2395
+ msgid "You can upload more fonts in the folder <strong>nggallery/fonts</strong>"
2396
+ msgstr "Du kannst mehr Schriftarten in das Verzeichniss <strong>nggallery/fonts</strong> hochladen."
2397
+
2398
+ #: ../admin/settings.php:591
2399
+ msgid "Color"
2400
+ msgstr "Farbe"
2401
+
2402
+ #: ../admin/settings.php:593
2403
+ msgid "(hex w/o #)"
2404
+ msgstr "(hex w/o #)"
2405
+
2406
+ #: ../admin/settings.php:596
2407
+ msgid "Text"
2408
+ msgstr "Text"
2409
+
2410
+ #: ../admin/settings.php:600
2411
+ msgid "Opaque"
2412
+ msgstr "Transparenz"
2413
+
2414
+ #: ../admin/settings.php:621
2415
+ msgid "Default size (W x H)"
2416
+ msgstr "Standard Größe (B x H)"
2417
+
2418
+ #: ../admin/settings.php:626
2419
+ msgid "Duration time"
2420
+ msgstr "Dauer"
2421
+
2422
+ #: ../admin/settings.php:627
2423
+ msgid "sec."
2424
+ msgstr "Sek."
2425
+
2426
+ #: ../admin/settings.php:630
2427
+ #: ../admin/settings.php:705
2428
+ msgid "Transition / Fade effect"
2429
+ msgstr "Fade Effekt"
2430
+
2431
+ #: ../admin/settings.php:633
2432
+ #: ../admin/settings.php:708
2433
+ msgid "fade"
2434
+ msgstr "Fade"
2435
+
2436
+ #: ../admin/settings.php:634
2437
+ msgid "blindX"
2438
+ msgstr "blindX"
2439
+
2440
+ #: ../admin/settings.php:635
2441
+ msgid "cover"
2442
+ msgstr "Blenden"
2443
+
2444
+ #: ../admin/settings.php:636
2445
+ msgid "scrollUp"
2446
+ msgstr "ScrollUp"
2447
+
2448
+ #: ../admin/settings.php:637
2449
+ msgid "scrollDown"
2450
+ msgstr "ScrollDown"
2451
+
2452
+ #: ../admin/settings.php:638
2453
+ msgid "shuffle"
2454
+ msgstr "Shuffle"
2455
+
2456
+ #: ../admin/settings.php:639
2457
+ msgid "toss"
2458
+ msgstr "Schüttel"
2459
+
2460
+ #: ../admin/settings.php:640
2461
+ msgid "wipe"
2462
+ msgstr "wischen"
2463
+
2464
+ #: ../admin/settings.php:642
2465
+ msgid "See here for more information about the effects :"
2466
+ msgstr "Hier bekommst du mehr Informationen über die Effekte :"
2467
+
2468
+ #: ../admin/settings.php:646
2469
+ msgid "Settings for the JW Image Rotator"
2470
+ msgstr "JW-Image-Rotator Einstellungen"
2471
+
2472
+ #: ../admin/settings.php:647
2473
+ msgid "The settings are only used in the JW Image Rotator Version"
2474
+ msgstr "Die Einstellungen werden im JW-Image-Rotator benutzt, in der Version"
2475
+
2476
+ #: ../admin/settings.php:648
2477
+ msgid "See more information for the Flash Player on the web page"
2478
+ msgstr "Weitere Informationen auf der Flash-Player-Homepage"
2479
+
2480
+ #: ../admin/settings.php:653
2481
+ msgid "The path to imagerotator.swf is not defined, the slideshow will not work."
2482
+ msgstr "Der Pfad zu imagerotator.swf ist nicht gesetzt, die Flash-Diaschau kann dann nicht angezeigt werden"
2483
+
2484
+ #: ../admin/settings.php:654
2485
+ msgid "If you would like to use the JW Image Rotatator, please download the player <a href=\"http://www.longtailvideo.com/players/jw-image-rotator/\" target=\"_blank\" >here</a> and upload it to your Upload folder (Default is wp-content/uploads)."
2486
+ msgstr "Wenn Du den JW-Image-Rotator (Slideshow) nutzen möchtest, lade Dir die aktuelle Version <a href=\"http://www.longtailvideo.com/players/jw-image-rotator/\" target=\"_blank\" >hier</a> herunter und übertrage sie dann in Dein WordPress-Upload-Verzeichnis (normalerweise wp-content/uploads),"
2487
+
2488
+ #: ../admin/settings.php:660
2489
+ msgid "Enable flash slideshow"
2490
+ msgstr "Aktiviere Flash Slideshow"
2491
+
2492
+ #: ../admin/settings.php:662
2493
+ msgid "Integrate the flash based slideshow for all flash supported devices"
2494
+ msgstr "Verwende die Flash Slideshow für alle Flash-unterstützte Geräte"
2495
+
2496
+ #: ../admin/settings.php:665
2497
+ msgid "Path to the Imagerotator (URL)"
2498
+ msgstr "Pfad zum JW-Image-Rotator (URL)"
2499
+
2500
+ #: ../admin/settings.php:668
2501
+ msgid "Search now"
2502
+ msgstr "Suche jetzt"
2503
+
2504
+ #: ../admin/settings.php:669
2505
+ msgid "Press the button to search automatically for the imagerotator, if you uploaded it to wp-content/uploads or a subfolder"
2506
+ msgstr "Drücke 'Suche jetzt' um automatisch den Pfad zum Image-Rotator zu ermitteln, sofern Du den Player in wp-content/uploads oder ein Unterverzeichnis hochgeladen hast."
2507
+
2508
+ #: ../admin/settings.php:673
2509
+ msgid "Shuffle mode"
2510
+ msgstr "Shuffle Modus"
2511
+
2512
+ #: ../admin/settings.php:677
2513
+ msgid "Show next image on click"
2514
+ msgstr "Zeige nächstes Bild bei Klick"
2515
+
2516
+ #: ../admin/settings.php:681
2517
+ msgid "Show navigation bar"
2518
+ msgstr "Zeige Navigations-Leiste"
2519
+
2520
+ #: ../admin/settings.php:685
2521
+ msgid "Show loading icon"
2522
+ msgstr "Zeige Lade-Bildchen"
2523
+
2524
+ #: ../admin/settings.php:689
2525
+ msgid "Use watermark logo"
2526
+ msgstr "Wasserzeichen anzeigen"
2527
+
2528
+ #: ../admin/settings.php:691
2529
+ msgid "You can change the logo at the watermark settings"
2530
+ msgstr "Du kannst den Pfad in Einstellungen für das Wasserzeichen angeben"
2531
+
2532
+ #: ../admin/settings.php:694
2533
+ msgid "Stretch image"
2534
+ msgstr "Bild dehnen"
2535
+
2536
+ #: ../admin/settings.php:697
2537
+ msgid "true"
2538
+ msgstr "Ja"
2539
+
2540
+ #: ../admin/settings.php:698
2541
+ msgid "false"
2542
+ msgstr "Nein"
2543
+
2544
+ #: ../admin/settings.php:699
2545
+ msgid "fit"
2546
+ msgstr "Passend"
2547
+
2548
+ #: ../admin/settings.php:700
2549
+ msgid "none"
2550
+ msgstr "keiner"
2551
+
2552
+ #: ../admin/settings.php:709
2553
+ msgid "bgfade"
2554
+ msgstr "BGFade"
2555
+
2556
+ #: ../admin/settings.php:710
2557
+ msgid "slowfade"
2558
+ msgstr "Slowfade"
2559
+
2560
+ #: ../admin/settings.php:711
2561
+ msgid "circles"
2562
+ msgstr "Kreise"
2563
+
2564
+ #: ../admin/settings.php:712
2565
+ msgid "bubbles"
2566
+ msgstr "Blasen"
2567
+
2568
+ #: ../admin/settings.php:713
2569
+ msgid "blocks"
2570
+ msgstr "Blöcke"
2571
+
2572
+ #: ../admin/settings.php:714
2573
+ msgid "fluids"
2574
+ msgstr "Fluids"
2575
+
2576
+ #: ../admin/settings.php:715
2577
+ msgid "flash"
2578
+ msgstr "Flash"
2579
+
2580
+ #: ../admin/settings.php:716
2581
+ msgid "lines"
2582
+ msgstr "Linien"
2583
+
2584
+ #: ../admin/settings.php:717
2585
+ msgid "random"
2586
+ msgstr "Zufall"
2587
+
2588
+ #: ../admin/settings.php:722
2589
+ msgid "Use slow zooming effect"
2590
+ msgstr "nutze Zoom-Effekt"
2591
+
2592
+ #: ../admin/settings.php:726
2593
+ msgid "Background Color"
2594
+ msgstr "Hintergrund (BG) Farbe"
2595
+
2596
+ #: ../admin/settings.php:731
2597
+ msgid "Texts / Buttons Color"
2598
+ msgstr "Text- / Button Farbe"
2599
+
2600
+ #: ../admin/settings.php:736
2601
+ msgid "Rollover / Active Color"
2602
+ msgstr "Rollover / Aktiv (Link) Farbe"
2603
+
2604
+ #: ../admin/settings.php:741
2605
+ msgid "Screen Color"
2606
+ msgstr "Seiten-Farbe"
2607
+
2608
+ #: ../admin/settings.php:746
2609
+ msgid "Background music (URL)"
2610
+ msgstr "Hintergrundmusik (URL)"
2611
+
2612
+ #: ../admin/settings.php:750
2613
+ msgid "Try XHTML validation (with CDATA)"
2614
+ msgstr "Integriere XHTML-Validierung (mittels CDATA)"
2615
+
2616
+ #: ../admin/settings.php:752
2617
+ msgid "Important : Could causes problem at some browser. Please recheck your page."
2618
+ msgstr "Wichtig : Es könnten Probleme bei einigen Browser entstehen. Unbedingt Seite danach prüfen."
2619
+
2620
+ #: ../admin/setup.php:15
2621
+ msgid "Reset all settings to default parameter"
2622
+ msgstr "Stelle alle Einstellungen auf Anfangswerte zurück"
2623
+
2624
+ #: ../admin/setup.php:26
2625
+ msgid "Uninstall sucessful ! Now delete the plugin and enjoy your life ! Good luck !"
2626
+ msgstr "Deinstallation erfolgreich! Nun kannst Du das Plugin löschen und Dein Leben weiterhin genießen! Stay geeky! Viel Glück!"
2627
+
2628
+ #: ../admin/setup.php:30
2629
+ msgid "Reset options"
2630
+ msgstr "Optionen zurücksetzen"
2631
+
2632
+ #: ../admin/setup.php:33
2633
+ msgid "Reset all options/settings to the default installation."
2634
+ msgstr "Alle Optionen/Einstellungen zurücksetzen"
2635
+
2636
+ #: ../admin/setup.php:34
2637
+ msgid "Reset settings"
2638
+ msgstr "Einstellungen zurücksetzen"
2639
+
2640
+ #: ../admin/setup.php:34
2641
+ msgid ""
2642
+ "Reset all options to default settings ?\\n"
2643
+ "\\n"
2644
+ "Choose [Cancel] to Stop, [OK] to proceed.\\n"
2645
+ msgstr ""
2646
+ "Alle Optionen zu Standard zurücksetzen ?\\n"
2647
+ "\\n"
2648
+ "Wähle [Cancel] um abzubrechen, [OK] zum Fortfahren.\\n"
2649
+
2650
+ #: ../admin/setup.php:39
2651
+ msgid "Uninstall plugin tables"
2652
+ msgstr "Plugin Tabellen (DB) entfernen"
2653
+
2654
+ #: ../admin/setup.php:44
2655
+ msgid "You don't like NextGEN Gallery ?"
2656
+ msgstr "Du magst die NextGEN Gallery nicht ?"
2657
+
2658
+ #: ../admin/setup.php:45
2659
+ msgid "No problem, before you deactivate this plugin press the Uninstall Button, because deactivating NextGEN Gallery does not remove any data that may have been created. "
2660
+ msgstr "Null Problemo. Einfach nur vor dem Deaktivieren dieses Plugins den Uninstall-Button betätigen, damit alle Tabellen der Galerie entfernt werden."
2661
+
2662
+ #: ../admin/setup.php:47
2663
+ msgid "WARNING:"
2664
+ msgstr "WARNUNG:"
2665
+
2666
+ #: ../admin/setup.php:48
2667
+ msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to backup all the tables first. NextGEN gallery is stored in the tables"
2668
+ msgstr "Eine einmalig durchgeführte Deinstallation kann nicht mehr rückgängig gemacht werden, da alle Tabellen der Galerie aus der Datenbank entfernt werden und KEIN Backup dieser Galerie-Tabellen angelegt wird."
2669
+
2670
+ #: ../admin/setup.php:48
2671
+ msgid "and"
2672
+ msgstr "und"
2673
+
2674
+ #: ../admin/setup.php:50
2675
+ msgid "Uninstall plugin"
2676
+ msgstr "Plugin deinstallieren"
2677
+
2678
+ #: ../admin/setup.php:50
2679
+ msgid ""
2680
+ "You are about to Uninstall this plugin from WordPress.\\n"
2681
+ "This action is not reversible.\\n"
2682
+ "\\n"
2683
+ "Choose [Cancel] to Stop, [OK] to Uninstall.\\n"
2684
+ msgstr ""
2685
+ "Du bist dabei, das Plugin zu deinstallieren.\\n"
2686
+ "Diese Aktion kann NICHT rückgängig gemacht werden.\\n"
2687
+ "\\n"
2688
+ "Wähle [Cancel] zum Abbrechen, [OK] zum Deinstallieren.\\n"
2689
+
2690
+ #: ../admin/showmeta.php:29
2691
+ msgid "Meta Data"
2692
+ msgstr "Metadaten"
2693
+
2694
+ #: ../admin/showmeta.php:34
2695
+ #: ../admin/showmeta.php:60
2696
+ #: ../admin/showmeta.php:85
2697
+ #: ../admin/showmeta.php:109
2698
+ msgid "Tag"
2699
+ msgstr "Stichwort"
2700
+
2701
+ #: ../admin/showmeta.php:35
2702
+ #: ../admin/showmeta.php:61
2703
+ #: ../admin/showmeta.php:86
2704
+ #: ../admin/showmeta.php:110
2705
+ msgid "Value"
2706
+ msgstr "Wert"
2707
+
2708
+ #: ../admin/showmeta.php:49
2709
+ msgid "No meta data saved"
2710
+ msgstr "Keine Metadaten gespeichert"
2711
+
2712
+ #: ../admin/showmeta.php:55
2713
+ msgid "EXIF Data"
2714
+ msgstr "EXIF-Daten"
2715
+
2716
+ #: ../admin/showmeta.php:74
2717
+ msgid "No exif data"
2718
+ msgstr "Keine Exif-Daten"
2719
+
2720
+ #: ../admin/showmeta.php:81
2721
+ msgid "IPTC Data"
2722
+ msgstr "IPTC-Daten"
2723
+
2724
+ #: ../admin/showmeta.php:105
2725
+ msgid "XMP Data"
2726
+ msgstr "XMP-Daten"
2727
+
2728
+ #: ../admin/style.php:11
2729
+ msgid "(From the theme folder)"
2730
+ msgstr "(Aus dem Theme Verzeichnis)"
2731
+
2732
+ #: ../admin/style.php:43
2733
+ msgid "You do not have sufficient permissions to edit templates for this blog."
2734
+ msgstr "Du hast nicht die benötigten Rechte, um Vorlagen in diesem Blog zu bearbeiten."
2735
+
2736
+ #: ../admin/style.php:52
2737
+ msgid "CSS file successfully updated"
2738
+ msgstr "CSS-Datei erfolgreich aktualisiert"
2739
+
2740
+ #: ../admin/style.php:89
2741
+ msgid "Style Editor"
2742
+ msgstr "CSS-Editor"
2743
+
2744
+ #: ../admin/style.php:93
2745
+ msgid "Activate and use style sheet:"
2746
+ msgstr "Aktiviere und nutze Stylesheet:"
2747
+
2748
+ #: ../admin/style.php:113
2749
+ msgid "Activate"
2750
+ msgstr "Aktiviere"
2751
+
2752
+ #: ../admin/style.php:123
2753
+ #, php-format
2754
+ msgid "Editing <strong>%s</strong>"
2755
+ msgstr "Bearbeite <strong>%s</strong>"
2756
+
2757
+ #: ../admin/style.php:125
2758
+ #, php-format
2759
+ msgid "Browsing <strong>%s</strong>"
2760
+ msgstr "Durchsuche <strong>%s</strong>"
2761
+
2762
+ #: ../admin/style.php:135
2763
+ msgid "Version"
2764
+ msgstr "Version"
2765
+
2766
+ #: ../admin/style.php:138
2767
+ msgid "Tip : Copy your stylesheet (nggallery.css) to your theme folder, so it will be not lost during a upgrade"
2768
+ msgstr "Kleiner Tipp: Kopiere das Stylesheet (nggallery.css) in Dein Theme-Verzeichnis, dadurch wird es beim nächsten Update nicht überschrieben."
2769
+
2770
+ #: ../admin/style.php:140
2771
+ msgid "Your theme contain a NextGEN Gallery stylesheet (nggallery.css), this file will be used"
2772
+ msgstr "Dein Theme-Paket enthält ein NextGEN-Gallery-Stylesheet (nggallery.css), dieses Sheet wird automatisch eingebunden"
2773
+
2774
+ #: ../admin/style.php:142
2775
+ msgid "Tip No. 2: Use the color picker below to help you find the right color scheme for your gallery!"
2776
+ msgstr "2.Tipp : Benutze die Farbauswahl, um den zugehörigen HTML-Farbcode zu erhalten"
2777
+
2778
+ #: ../admin/style.php:158
2779
+ msgid "Update File"
2780
+ msgstr "Datei aktualisieren"
2781
+
2782
+ #: ../admin/style.php:161
2783
+ msgid "If this file were writable you could edit it."
2784
+ msgstr "Wenn diese Datei beschreibbar wäre, könntest Du sie bearbeiten."
2785
+
2786
+ #: ../admin/style.php:166
2787
+ msgid "Oops, no such file exists! Double check the name and try again, merci."
2788
+ msgstr "Oha, eine solche Datei existiert nicht! Bitte überprüfe den Namen und probiere es erneut. Danke."
2789
+
2790
+ #: ../admin/tags.php:38
2791
+ msgid "Most popular"
2792
+ msgstr "Beliebteste Stichwörter"
2793
+
2794
+ #: ../admin/tags.php:39
2795
+ msgid "Least used"
2796
+ msgstr "Zuletzt benutzt"
2797
+
2798
+ #: ../admin/tags.php:40
2799
+ msgid "Alphabetical"
2800
+ msgstr "Alphabetisch"
2801
+
2802
+ #: ../admin/tags.php:96
2803
+ msgid "Manage image tags"
2804
+ msgstr "Verwalte Bilder-Stichwörter"
2805
+
2806
+ #: ../admin/tags.php:108
2807
+ msgid "Existing Tags"
2808
+ msgstr "Vorhandene Stichwörter"
2809
+
2810
+ #: ../admin/tags.php:112
2811
+ msgid "Search tags"
2812
+ msgstr "Suche nach Stichwörter"
2813
+
2814
+ #: ../admin/tags.php:116
2815
+ msgid "Go"
2816
+ msgstr "Start"
2817
+
2818
+ #: ../admin/tags.php:121
2819
+ msgid "Sort Order:"
2820
+ msgstr "Sortierung :"
2821
+
2822
+ #: ../admin/tags.php:156
2823
+ #: ../admin/tags.php:160
2824
+ #: ../admin/tags.php:173
2825
+ msgid "Previous tags"
2826
+ msgstr "Vorheriges Stichwort"
2827
+
2828
+ #: ../admin/tags.php:169
2829
+ msgid "Next tags"
2830
+ msgstr "Nächstes Stichwort"
2831
+
2832
+ #: ../admin/tags.php:181
2833
+ msgid "Rename Tag"
2834
+ msgstr "Schlagwort umbenennen"
2835
+
2836
+ #: ../admin/tags.php:189
2837
+ msgid "Enter the tag to rename and its new value. You can use this feature to merge tags too. Click \"Rename\" and all posts which use this tag will be updated."
2838
+ msgstr "Trage das Stichwort ein, das Du umbenennen willst und seinen neuen Wert/Namen. Du kannst diese Funktion auch nutzen, um Stichwörter zusammenzuführen. Klicke auf \"Umbenennen\" und alle Bilder, die das Stichwort verwenden, werden aktualisiert."
2839
+
2840
+ #: ../admin/tags.php:190
2841
+ #: ../admin/tags.php:238
2842
+ msgid "You can specify multiple tags to rename by separating them with commas."
2843
+ msgstr "Mehrere Stichwörter zum Umbenennen durch Komma trennen"
2844
+
2845
+ #: ../admin/tags.php:194
2846
+ msgid "Tag(s) to rename:"
2847
+ msgstr "Stichwörter umbennenen:"
2848
+
2849
+ #: ../admin/tags.php:198
2850
+ msgid "New tag name(s):"
2851
+ msgstr "Neuer Name für das Stichwort"
2852
+
2853
+ #: ../admin/tags.php:201
2854
+ msgid "Rename"
2855
+ msgstr "Umbenennen"
2856
+
2857
+ #: ../admin/tags.php:207
2858
+ msgid "Delete Tag"
2859
+ msgstr "Stichwort löschen"
2860
+
2861
+ #: ../admin/tags.php:215
2862
+ msgid "Enter the name of the tag to delete. This tag will be removed from all posts."
2863
+ msgstr "Trage das zu löschende Stichwort ein. Das Stichwort wird aus allen Bildern entfernt."
2864
+
2865
+ #: ../admin/tags.php:216
2866
+ msgid "You can specify multiple tags to delete by separating them with commas"
2867
+ msgstr "Du kannst mehrere Stichwörter zum Löschen markieren, indem Du sie mit Kommas trennst"
2868
+
2869
+ #: ../admin/tags.php:220
2870
+ msgid "Tag(s) to delete:"
2871
+ msgstr "Folgede Stichwörter löschen:"
2872
+
2873
+ #: ../admin/tags.php:229
2874
+ msgid "Edit Tag Slug"
2875
+ msgstr "Ändere Schlagwort"
2876
+
2877
+ #: ../admin/tags.php:237
2878
+ msgid "Enter the tag name to edit and its new slug. <a href=\"http://codex.wordpress.org/Glossary#Slug\">Slug definition</a>"
2879
+ msgstr "Trage den Namen des zu ändernden Stichworts und seinen neuen \"Slug\" ein. <a href=\"http://codex.wordpress.org/Glossary#Slug\">Was ist ein Slug?</a>"
2880
+
2881
+ #: ../admin/tags.php:242
2882
+ msgid "Tag(s) to match:"
2883
+ msgstr "Stichwörter vergleichen :"
2884
+
2885
+ #: ../admin/tags.php:246
2886
+ msgid "Slug(s) to set:"
2887
+ msgstr "Schlagwörter setzen:"
2888
+
2889
+ #: ../admin/upgrade.php:22
2890
+ msgid "Upgrade database structure..."
2891
+ msgstr "Aktualisiere die Datenbank-Strukturen..."
2892
+
2893
+ #: ../admin/upgrade.php:108
2894
+ #: ../admin/upgrade.php:119
2895
+ #: ../admin/upgrade.php:126
2896
+ #: ../admin/upgrade.php:137
2897
+ #: ../admin/upgrade.php:151
2898
+ msgid "finished"
2899
+ msgstr "beendet"
2900
+
2901
+ #: ../admin/upgrade.php:117
2902
+ msgid "Update file structure..."
2903
+ msgstr "Aktualisiere Verzeichnisse..."
2904
+
2905
+ #: ../admin/upgrade.php:124
2906
+ msgid "Import date and time information..."
2907
+ msgstr "Importiere Datum/Uhrzeit..."
2908
+
2909
+ #: ../admin/upgrade.php:132
2910
+ msgid "Move imagerotator to new location..."
2911
+ msgstr "Verschiebe den Image-Rotator in ein neues Verzeichnis..."
2912
+
2913
+ #: ../admin/upgrade.php:143
2914
+ msgid "Update settings..."
2915
+ msgstr "Einstellungen gespeichert..."
2916
+
2917
+ #: ../admin/upgrade.php:157
2918
+ msgid "Updated widget structure. If you used NextGEN Widgets, you need to setup them again..."
2919
+ msgstr "Die Widgets wurden überarbeitet. Wenn Du NextGEN Widgets nutzt, musst du Sie nun neu einfügen..."
2920
+
2921
+ #: ../admin/upgrade.php:165
2922
+ #: ../admin/upgrade.php:187
2923
+ msgid "Updated options."
2924
+ msgstr "Einstellungen gespeichert."
2925
+
2926
+ #: ../admin/upgrade.php:172
2927
+ msgid "Create unique slug"
2928
+ msgstr "Permalinks erstellen"
2929
+
2930
+ #: ../admin/upgrade.php:173
2931
+ msgid "One of the upcomming features are a reworked permalinks structure."
2932
+ msgstr "Die Permalinkstruktur wird in einer kommenden Version überarbeitet."
2933
+
2934
+ #: ../admin/upgrade.php:174
2935
+ msgid "Therefore it's needed to have a unique identifier for each image, gallery and album."
2936
+ msgstr "Deshalb ist es notwendig ein eindeutiges Schlagwort für jedes Bild, Galerie und Album zu erzeugen."
2937
+
2938
+ #: ../admin/upgrade.php:175
2939
+ msgid "Depend on the amount of database entries this will take a while, don't reload this page."
2940
+ msgstr "Diese Operation kann je nach Anzahl der Bilder eine Weile daueren, bitte die Seite nicht neu laden."
2941
+
2942
+ #: ../admin/upgrade.php:195
2943
+ msgid "Could not find NextGEN Gallery database tables, upgrade failed !"
2944
+ msgstr "Konnte die NextGEN Gallery Tabellen nicht finden, Upgrade fehlgeschlagen !"
2945
+
2946
+ #: ../admin/upgrade.php:258
2947
+ msgid "Some folders/files could not renamed, please recheck the permission and rescan the folder in the manage gallery section."
2948
+ msgstr "Einige Verzeichnisse / Bilder konnten nicht umbenannt werden, bitte überprüfe die Zugriffsrechte und scanne dann das Verzeichnis neu ein."
2949
+
2950
+ #: ../admin/upgrade.php:260
2951
+ msgid "Rename failed"
2952
+ msgstr "Konnte nicht umbenannt werden"
2953
+
2954
+ #: ../admin/upgrade.php:356
2955
+ #: ../admin/upgrade.php:375
2956
+ msgid "Upgrade NextGEN Gallery"
2957
+ msgstr "NextGEN-Gallery aktualisieren"
2958
+
2959
+ #: ../admin/upgrade.php:357
2960
+ msgid "The script detect that you upgrade from a older version."
2961
+ msgstr "Es wurde eine ältere NextGEN-Datenbank erkannt."
2962
+
2963
+ #: ../admin/upgrade.php:358
2964
+ msgid "Your database tables for NextGEN Gallery is out-of-date, and must be upgraded before you can continue."
2965
+ msgstr "Deine Datenbanktabellen für NextGEN-Gallery sind nicht auf dem aktuellen Stand, sie müssen jetzt aktualisiert werden."
2966
+
2967
+ #: ../admin/upgrade.php:359
2968
+ msgid "If you would like to downgrade later, please make first a complete backup of your database and the images."
2969
+ msgstr "Wenn Du wieder auf eine ältere Version zurückgehen möchtest, solltest Du vorher die Datenbank sichern."
2970
+
2971
+ #: ../admin/upgrade.php:360
2972
+ msgid "The upgrade process may take a while, so please be patient."
2973
+ msgstr "Der Upgrade-Prozess kann etwas dauern, bitte sei geduldig..."
2974
+
2975
+ #: ../admin/upgrade.php:361
2976
+ msgid "Start upgrade now"
2977
+ msgstr "Aktualisierung starten"
2978
+
2979
+ #: ../admin/upgrade.php:377
2980
+ msgid "Upgrade finished..."
2981
+ msgstr "Upgrade beendet..."
2982
+
2983
+ #: ../admin/upgrade.php:378
2984
+ msgid "Continue"
2985
+ msgstr "Weiter"
2986
+
2987
+ #: ../admin/upgrade.php:401
2988
+ #, php-format
2989
+ msgid "Rebuild image structure : %s / %s images"
2990
+ msgstr "Erzeuge Permalinks für Bilder : %s / %s Bilder"
2991
+
2992
+ #: ../admin/upgrade.php:402
2993
+ #, php-format
2994
+ msgid "Rebuild gallery structure : %s / %s galleries"
2995
+ msgstr "Erzeuge Permalinks für Galerien : %s / %s Galerien"
2996
+
2997
+ #: ../admin/upgrade.php:403
2998
+ #, php-format
2999
+ msgid "Rebuild album structure : %s / %s albums"
3000
+ msgstr "Erzeuge Permalinks für Alben : %s / %s Alben"
3001
+
3002
+ #: ../admin/upgrade.php:460
3003
+ msgid "Done."
3004
+ msgstr "Fertig."
3005
+
3006
+ #: ../admin/wpmu.php:33
3007
+ msgid "Update successfully"
3008
+ msgstr "Aktualisierung erfolgreich"
3009
+
3010
+ #: ../admin/wpmu.php:45
3011
+ #, php-format
3012
+ msgid "Thanks for using this plugin, NextGEN Gallery is initially developed for self hosted blogs. A multisite setup is possible, but cannot currently fully supported, as it can have several special condition ( i.e. Domain mapping).<br /> If you would like to support the further development, please consider a <strong><a href=\"%s\">donation</a></strong>! If you still need some help, please post your questions <a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\">here</a> ."
3013
+ msgstr "Vielen Dank, dass Du dieses Plugin nutzt. NextGEN Gallery wurde für einfache Blogs entwickelt. Die Nutzung im Netzwerk (Multisite) ist möglich, aber wird nicht vollständig unterstützt (z.B. Domain Mapping).<br /> Wenn Du die Weiterentwicklung unterstützen möchtest, würde ich mich über eine kleine <strong><a href=\"%s\">Spende</a></strong> freuen! Wenn Du Fragen oder Problem hast, schreib sie doch <a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\">hier</a> ins Forum."
3014
+
3015
+ #: ../admin/wpmu.php:62
3016
+ msgid "Network Options"
3017
+ msgstr "Netzwerk Optionen"
3018
+
3019
+ #: ../admin/wpmu.php:70
3020
+ msgid "This is the default path for all blogs. With the placeholder %BLOG_ID% you can organize the folder structure better."
3021
+ msgstr "Dieses ist der Default-Pfad für alle Blogs. Mit dem Platzhalter %BLOG_ID% wird die Ordnerstruktur gesteuert. Der Pfad muss mit / enden."
3022
+
3023
+ #: ../admin/wpmu.php:71
3024
+ #, php-format
3025
+ msgid "The default setting should be %s"
3026
+ msgstr "Grundeinstellung ist %s"
3027
+
3028
+ #: ../admin/wpmu.php:75
3029
+ msgid "Enable upload quota check"
3030
+ msgstr "Schalte die Uploadbegrenzung ein"
3031
+
3032
+ #: ../admin/wpmu.php:77
3033
+ msgid "Should work if the gallery is bellow the blog.dir"
3034
+ msgstr "Sollte funktionieren, wenn die Galerien sich unterhalb blog.dir befinden"
3035
+
3036
+ #: ../admin/wpmu.php:81
3037
+ msgid "Enable zip upload option"
3038
+ msgstr "Erlaube ZIP-Upload"
3039
+
3040
+ #: ../admin/wpmu.php:83
3041
+ msgid "Allow users to upload zip folders."
3042
+ msgstr "Erlaubt die Nutzung des ZIP-Upload"
3043
+
3044
+ #: ../admin/wpmu.php:87
3045
+ msgid "Enable import function"
3046
+ msgstr "Erlaube Import Funktion"
3047
+
3048
+ #: ../admin/wpmu.php:89
3049
+ msgid "Allow users to import images folders from the server."
3050
+ msgstr "Erlaube dem User Bilder direkt aus den Server Verzeichnissen zu importieren."
3051
+
3052
+ #: ../admin/wpmu.php:93
3053
+ msgid "Enable style selection"
3054
+ msgstr "Freie CSS-Style-Auswahl"
3055
+
3056
+ #: ../admin/wpmu.php:95
3057
+ msgid "Allow users to choose a style for the gallery."
3058
+ msgstr "Erlaube dem User, ein CSS für die Galerie zu wählen"
3059
+
3060
+ #: ../admin/wpmu.php:99
3061
+ msgid "Enable roles/capabilities"
3062
+ msgstr "Rollen / Zugriffsrechte freischalten"
3063
+
3064
+ #: ../admin/wpmu.php:101
3065
+ msgid "Allow users to change the roles for other blog authors."
3066
+ msgstr "Erlaube dem User die Anpassung der Zugangsberechtigung"
3067
+
3068
+ #: ../admin/wpmu.php:105
3069
+ msgid "Default style"
3070
+ msgstr "Standard-CSS-Style"
3071
+
3072
+ #: ../admin/wpmu.php:122
3073
+ msgid "Choose the default style for the galleries."
3074
+ msgstr "Wähle das Default-Stylesheet für die Galerien"
3075
+
3076
+ #: ../admin/tinymce/window.php:56
3077
+ msgid "Select or enter gallery"
3078
+ msgstr "Wähle oder Suche Galerie"
3079
+
3080
+ #: ../admin/tinymce/window.php:61
3081
+ #: ../admin/tinymce/window.php:82
3082
+ msgid "Show as"
3083
+ msgstr "Zeige als"
3084
+
3085
+ #: ../admin/tinymce/window.php:62
3086
+ msgid "Image list"
3087
+ msgstr "Bilder-Liste"
3088
+
3089
+ #: ../admin/tinymce/window.php:64
3090
+ msgid "Imagebrowser"
3091
+ msgstr "Bilder-Browser"
3092
+
3093
+ #: ../admin/tinymce/window.php:77
3094
+ msgid "Select or enter album"
3095
+ msgstr "Wähle oder Suche Album"
3096
+
3097
+ #: ../admin/tinymce/window.php:83
3098
+ msgid "Extended version"
3099
+ msgstr "Erweiterte Version"
3100
+
3101
+ #: ../admin/tinymce/window.php:84
3102
+ msgid "Compact version"
3103
+ msgstr "Kompakte Version"
3104
+
3105
+ #: ../admin/tinymce/window.php:97
3106
+ msgid "Select or enter picture"
3107
+ msgstr "Wähle oder Suche Bild"
3108
+
3109
+ #: ../admin/tinymce/window.php:102
3110
+ msgid "Width x Height"
3111
+ msgstr "Breite x Höhe"
3112
+
3113
+ #: ../admin/tinymce/window.php:106
3114
+ msgid "Effect"
3115
+ msgstr "Effekt"
3116
+
3117
+ #: ../admin/tinymce/window.php:109
3118
+ msgid "No effect"
3119
+ msgstr "Kein Effekt"
3120
+
3121
+ #: ../admin/tinymce/window.php:111
3122
+ msgid "Web 2.0"
3123
+ msgstr "Web 2.0"
3124
+
3125
+ #: ../admin/tinymce/window.php:116
3126
+ msgid "Float"
3127
+ msgstr "Float"
3128
+
3129
+ #: ../admin/tinymce/window.php:119
3130
+ msgid "No float"
3131
+ msgstr "Kein Float"
3132
+
3133
+ #: ../admin/tinymce/window.php:138
3134
+ msgid "Insert"
3135
+ msgstr "Einfügen"
3136
+
3137
+ #: ../lib/core.php:407
3138
+ #, php-format
3139
+ msgid "Note : Based on your server memory limit you should not upload larger images then <strong>%d x %d</strong> pixel"
3140
+ msgstr "Hinweis: Basierend auf der Speicherbegrenzung auf dem Server, solltest Du keine Bilder grösser als <strong>%d x %d</strong> Pixel hochladen"
3141
+
3142
+ #: ../lib/locale.php:120
3143
+ msgid "Invalid URL Provided."
3144
+ msgstr "Ungültige URL"
3145
+
3146
+ #: ../lib/locale.php:124
3147
+ #: ../lib/locale.php:128
3148
+ msgid "Could not create Temporary file."
3149
+ msgstr "Konnte temporäre Datei nicht erstellen"
3150
+
3151
+ #: ../lib/meta.php:124
3152
+ msgid " mm"
3153
+ msgstr " mm"
3154
+
3155
+ #: ../lib/meta.php:130
3156
+ msgid " sec"
3157
+ msgstr " Sek."
3158
+
3159
+ #: ../lib/meta.php:134
3160
+ msgid "Fired"
3161
+ msgstr "ausgelöst"
3162
+
3163
+ #: ../lib/meta.php:134
3164
+ msgid "Not fired"
3165
+ msgstr "Nicht ausgelöst"
3166
+
3167
+ #: ../lib/meta.php:430
3168
+ msgid "Aperture"
3169
+ msgstr "Blende"
3170
+
3171
+ #: ../lib/meta.php:431
3172
+ #: ../lib/meta.php:456
3173
+ msgid "Credit"
3174
+ msgstr "Autor"
3175
+
3176
+ #: ../lib/meta.php:432
3177
+ msgid "Camera"
3178
+ msgstr "Kamera"
3179
+
3180
+ #: ../lib/meta.php:433
3181
+ msgid "Caption"
3182
+ msgstr "Beschreibung"
3183
+
3184
+ #: ../lib/meta.php:435
3185
+ msgid "Copyright"
3186
+ msgstr "Rechte"
3187
+
3188
+ #: ../lib/meta.php:436
3189
+ msgid "Focal length"
3190
+ msgstr "Brennweite"
3191
+
3192
+ #: ../lib/meta.php:437
3193
+ msgid "ISO"
3194
+ msgstr "ISO"
3195
+
3196
+ #: ../lib/meta.php:438
3197
+ msgid "Shutter speed"
3198
+ msgstr "Belichtungszeit"
3199
+
3200
+ #: ../lib/meta.php:442
3201
+ msgid "Subject"
3202
+ msgstr "Betreff"
3203
+
3204
+ #: ../lib/meta.php:443
3205
+ msgid "Make"
3206
+ msgstr "Hersteller"
3207
+
3208
+ #: ../lib/meta.php:444
3209
+ msgid "Edit Status"
3210
+ msgstr "Ändere Status"
3211
+
3212
+ #: ../lib/meta.php:445
3213
+ msgid "Category"
3214
+ msgstr "Kategorie"
3215
+
3216
+ #: ../lib/meta.php:446
3217
+ msgid "Keywords"
3218
+ msgstr "Schlüsselwörter"
3219
+
3220
+ #: ../lib/meta.php:447
3221
+ msgid "Date Created"
3222
+ msgstr "erstellt (Datum)"
3223
+
3224
+ #: ../lib/meta.php:448
3225
+ msgid "Time Created"
3226
+ msgstr "erstellt (Zeit)"
3227
+
3228
+ #: ../lib/meta.php:449
3229
+ msgid "Author Position"
3230
+ msgstr "Autor Position"
3231
+
3232
+ #: ../lib/meta.php:450
3233
+ msgid "City"
3234
+ msgstr "Stadt"
3235
+
3236
+ #: ../lib/meta.php:451
3237
+ msgid "Location"
3238
+ msgstr "Ort"
3239
+
3240
+ #: ../lib/meta.php:452
3241
+ msgid "Province/State"
3242
+ msgstr "Staat / PLZ"
3243
+
3244
+ #: ../lib/meta.php:453
3245
+ msgid "Country code"
3246
+ msgstr "Landescode"
3247
+
3248
+ #: ../lib/meta.php:454
3249
+ msgid "Country"
3250
+ msgstr "Land"
3251
+
3252
+ #: ../lib/meta.php:455
3253
+ msgid "Headline"
3254
+ msgstr "Kopfzeile"
3255
+
3256
+ #: ../lib/meta.php:457
3257
+ msgid "Source"
3258
+ msgstr "Quelle"
3259
+
3260
+ #: ../lib/meta.php:458
3261
+ msgid "Copyright Notice"
3262
+ msgstr "Copyright Hinweise / Credits"
3263
+
3264
+ #: ../lib/meta.php:459
3265
+ msgid "Contact"
3266
+ msgstr "Kontakt"
3267
+
3268
+ #: ../lib/meta.php:460
3269
+ msgid "Last modified"
3270
+ msgstr "Zuletzt geändert"
3271
+
3272
+ #: ../lib/meta.php:461
3273
+ msgid "Program tool"
3274
+ msgstr "Programm"
3275
+
3276
+ #: ../lib/meta.php:462
3277
+ msgid "Format"
3278
+ msgstr "Format"
3279
+
3280
+ #: ../lib/meta.php:463
3281
+ msgid "Image Width"
3282
+ msgstr "Breite"
3283
+
3284
+ #: ../lib/meta.php:464
3285
+ msgid "Image Height"
3286
+ msgstr "Höhe"
3287
+
3288
+ #: ../lib/meta.php:465
3289
+ msgid "Flash"
3290
+ msgstr "Blitz"
3291
+
3292
+ #: ../lib/multisite.php:23
3293
+ msgid "Sorry, you have used your space allocation. Please delete some files to upload more files."
3294
+ msgstr "Schade, Dein freier Speicher scheint aufgebraucht zu sein. Bitte lösche zuerst ein paar Bilder."
3295
+
3296
+ #: ../lib/ngg-db.php:331
3297
+ #: ../lib/ngg-db.php:332
3298
+ msgid "Album overview"
3299
+ msgstr "Album Übersicht"
3300
+
3301
+ #: ../lib/shortcodes.php:311
3302
+ msgid "[Pictures not found]"
3303
+ msgstr "[Bilder nicht gefunden]"
3304
+
3305
+ #: ../lib/tags.php:35
3306
+ msgid "No new tag specified!"
3307
+ msgstr "Kein neues Stichwort definiert!"
3308
+
3309
+ #: ../lib/tags.php:50
3310
+ msgid "No new/old valid tag specified!"
3311
+ msgstr "Kein neues Stichwort definiert!"
3312
+
3313
+ #: ../lib/tags.php:86
3314
+ msgid "No tag renamed."
3315
+ msgstr "Kein Stichwort umbenannt."
3316
+
3317
+ #: ../lib/tags.php:88
3318
+ #, php-format
3319
+ msgid "Renamed tag(s) &laquo;%1$s&raquo; to &laquo;%2$s&raquo;"
3320
+ msgstr "Es wurden die Stichwörter &laquo;%1$s&raquo; bis &laquo;%2$s&raquo; umbenannt"
3321
+
3322
+ #: ../lib/tags.php:95
3323
+ msgid "No valid new tag."
3324
+ msgstr "Kein gültiges Stichwort"
3325
+
3326
+ #: ../lib/tags.php:112
3327
+ msgid "No objects (post/page) found for specified old tags."
3328
+ msgstr "Keine Objekte (Seite/Beitrag) enthält das ausgewählte Stichwort"
3329
+
3330
+ #: ../lib/tags.php:141
3331
+ msgid "No tag merged."
3332
+ msgstr "Keine Stichwörter zusammengeführt."
3333
+
3334
+ #: ../lib/tags.php:143
3335
+ #, php-format
3336
+ msgid "Merge tag(s) &laquo;%1$s&raquo; to &laquo;%2$s&raquo;. %3$s objects edited."
3337
+ msgstr "Stichwörter &laquo;%1$s&raquo; bis &laquo;%2$s&raquo; zusammengeführt. %3$s Objekte geändert."
3338
+
3339
+ #: ../lib/tags.php:146
3340
+ msgid "Error. No enough tags for rename. Too for merge. Choose !"
3341
+ msgstr "Fehler. Es wurden nicht genug Stichwörter ausgewählt."
3342
+
3343
+ #: ../lib/tags.php:163
3344
+ msgid "No tag specified!"
3345
+ msgstr "Kein Stichwort angegeben"
3346
+
3347
+ #: ../lib/tags.php:186
3348
+ msgid "No tag deleted."
3349
+ msgstr "Kein Stichwort gelöscht"
3350
+
3351
+ #: ../lib/tags.php:188
3352
+ #, php-format
3353
+ msgid "%1s tag(s) deleted."
3354
+ msgstr "%1s Stichwörter gelöscht"
3355
+
3356
+ #: ../lib/tags.php:202
3357
+ msgid "No new slug(s) specified!"
3358
+ msgstr "Keine neuen Stichwörter ausgewählt"
3359
+
3360
+ #: ../lib/tags.php:214
3361
+ msgid "Tags number and slugs number isn't the same!"
3362
+ msgstr "Stichwort und Schlagwort ist nicht das Gleiche!"
3363
+
3364
+ #: ../lib/tags.php:241
3365
+ msgid "No slug edited."
3366
+ msgstr "Kein Stichwort geändert"
3367
+
3368
+ #: ../lib/tags.php:243
3369
+ #, php-format
3370
+ msgid "%s slug(s) edited."
3371
+ msgstr "%s Stichwörter geändert"
3372
+
3373
+ #: ../lib/xmlrpc.php:66
3374
+ #, php-format
3375
+ msgid "XML-RPC services are disabled on this blog. An admin user can enable them at %s"
3376
+ msgstr "XML-RPC Service ist ausgeschaltet. Der Administrator kann es hier %s einschalten"
3377
+
3378
+ #: ../lib/xmlrpc.php:73
3379
+ msgid "Bad login/pass combination."
3380
+ msgstr "Username/Password falsch"
3381
+
3382
+ #: ../lib/xmlrpc.php:129
3383
+ msgid "You are not allowed to upload files to this site."
3384
+ msgstr "Du hast keine Berechtigung, Bilder hochzuladen"
3385
+
3386
+ #: ../lib/xmlrpc.php:135
3387
+ #: ../lib/xmlrpc.php:680
3388
+ msgid "Could not find gallery "
3389
+ msgstr "Konnte Galerie nicht finden"
3390
+
3391
+ #: ../lib/xmlrpc.php:140
3392
+ #: ../lib/xmlrpc.php:685
3393
+ msgid "You are not allowed to upload files to this gallery."
3394
+ msgstr "Du hast keine Berechtigung, Bilder in diese Galerie zuladen"
3395
+
3396
+ #: ../lib/xmlrpc.php:152
3397
+ msgid "This is no valid image file."
3398
+ msgstr "Das ist keine zulässige Bilddatei!"
3399
+
3400
+ #: ../lib/xmlrpc.php:164
3401
+ msgid "Could not find image id "
3402
+ msgstr "Konnte die Bild-ID nicht finden"
3403
+
3404
+ #: ../lib/xmlrpc.php:171
3405
+ #, php-format
3406
+ msgid "Failed to delete image %1$s "
3407
+ msgstr "Konnte das Bild %1$s nicht löschen"
3408
+
3409
+ #: ../lib/xmlrpc.php:180
3410
+ #, php-format
3411
+ msgid "Could not write file %1$s (%2$s)"
3412
+ msgstr "Konnte die Datei %1$s (%2$s) nicht schreiben "
3413
+
3414
+ #: ../lib/xmlrpc.php:247
3415
+ #: ../lib/xmlrpc.php:299
3416
+ msgid "Invalid image ID"
3417
+ msgstr "Keine gültige Bilder ID"
3418
+
3419
+ #: ../lib/xmlrpc.php:250
3420
+ #: ../lib/xmlrpc.php:302
3421
+ msgid "Sorry, you must be able to edit this image"
3422
+ msgstr "Sorry, Du hast nicht das Recht, dieses Bild zu bearbeiten"
3423
+
3424
+ #: ../lib/xmlrpc.php:308
3425
+ msgid "Sorry, could not update the image"
3426
+ msgstr "Konnte das Bild nicht aktualisieren"
3427
+
3428
+ #: ../lib/xmlrpc.php:344
3429
+ #: ../lib/xmlrpc.php:576
3430
+ #: ../lib/xmlrpc.php:642
3431
+ msgid "Sorry, you must be able to manage galleries"
3432
+ msgstr "Sorry, Du hast nicht das Recht, diese Galerie zu bearbeiten"
3433
+
3434
+ #: ../lib/xmlrpc.php:350
3435
+ msgid "Sorry, could not create the gallery"
3436
+ msgstr "Konnte die Galerie nicht anlegen"
3437
+
3438
+ #: ../lib/xmlrpc.php:393
3439
+ #: ../lib/xmlrpc.php:573
3440
+ msgid "Invalid gallery ID"
3441
+ msgstr "Keine gültige Galerie ID"
3442
+
3443
+ #: ../lib/xmlrpc.php:396
3444
+ msgid "Sorry, you must be able to manage this gallery"
3445
+ msgstr "Sorry, Du hast nicht das Recht, diese Galerie zu bearbeiten"
3446
+
3447
+ #: ../lib/xmlrpc.php:402
3448
+ msgid "Sorry, could not update the gallery"
3449
+ msgstr "Konnte die Galerie nicht aktualisieren"
3450
+
3451
+ #: ../lib/xmlrpc.php:442
3452
+ #: ../lib/xmlrpc.php:494
3453
+ #: ../lib/xmlrpc.php:536
3454
+ #: ../lib/xmlrpc.php:609
3455
+ msgid "Sorry, you must be able to manage albums"
3456
+ msgstr "Sorry, Du hast nicht das Recht, dieses Album zu bearbeiten"
3457
+
3458
+ #: ../lib/xmlrpc.php:448
3459
+ msgid "Sorry, could not create the album"
3460
+ msgstr "Konnte das Album nicht anlegen"
3461
+
3462
+ #: ../lib/xmlrpc.php:491
3463
+ #: ../lib/xmlrpc.php:533
3464
+ msgid "Invalid album ID"
3465
+ msgstr "Ungültige Album ID"
3466
+
3467
+ #: ../lib/xmlrpc.php:500
3468
+ msgid "Sorry, could not update the album"
3469
+ msgstr "Konnte das Album nicht aktualisieren"
3470
+
3471
+ #: ../view/album-compact.php:32
3472
+ #: ../view/album-extend.php:30
3473
+ msgid "Photos"
3474
+ msgstr "Fotos"
3475
+
3476
+ #: ../view/gallery-caption.php:32
3477
+ #: ../view/gallery.php:32
3478
+ #: ../widgets/media-rss-widget.php:122
3479
+ msgid "[View with PicLens]"
3480
+ msgstr "[Mit PicLens anzeigen]"
3481
+
3482
+ #: ../view/imagebrowser-caption.php:26
3483
+ #: ../view/imagebrowser-exif.php:30
3484
+ #: ../view/imagebrowser.php:26
3485
+ msgid "Back"
3486
+ msgstr "Zurueck"
3487
+
3488
+ #: ../view/imagebrowser-caption.php:29
3489
+ #: ../view/imagebrowser-exif.php:33
3490
+ #: ../view/imagebrowser.php:29
3491
+ msgid "Next"
3492
+ msgstr "Vor"
3493
+
3494
+ #: ../view/imagebrowser-caption.php:31
3495
+ #: ../view/imagebrowser-exif.php:35
3496
+ #: ../view/imagebrowser.php:31
3497
+ msgid "of"
3498
+ msgstr "von"
3499
+
3500
+ #: ../view/imagebrowser-exif.php:38
3501
+ msgid "Meta data"
3502
+ msgstr "Metadaten"
3503
+
3504
+ #: ../view/imagebrowser-exif.php:42
3505
+ msgid "Camera / Type"
3506
+ msgstr "Kameratyp"
3507
+
3508
+ #: ../view/imagebrowser-exif.php:50
3509
+ msgid "Focal Length"
3510
+ msgstr "Brennweite"
3511
+
3512
+ #: ../widgets/media-rss-widget.php:19
3513
+ msgid "Widget that displays Media RSS links for NextGEN Gallery."
3514
+ msgstr "Hiermit können NextGEN-Bilder als Media RSS eingebunden werden"
3515
+
3516
+ #: ../widgets/media-rss-widget.php:20
3517
+ msgid "NextGEN Media RSS"
3518
+ msgstr "NextGEN Media RSS"
3519
+
3520
+ #: ../widgets/media-rss-widget.php:68
3521
+ msgid "Media RSS"
3522
+ msgstr "Media RSS"
3523
+
3524
+ #: ../widgets/media-rss-widget.php:69
3525
+ msgid "Link to the main image feed"
3526
+ msgstr "Link zum Bilder-Feed"
3527
+
3528
+ #: ../widgets/media-rss-widget.php:79
3529
+ #: ../widgets/widgets.php:201
3530
+ msgid "Title :"
3531
+ msgstr "Titel :"
3532
+
3533
+ #: ../widgets/media-rss-widget.php:87
3534
+ msgid "Show Media RSS icon"
3535
+ msgstr "Zeige Media RSS Icon"
3536
+
3537
+ #: ../widgets/media-rss-widget.php:93
3538
+ msgid "Show the Media RSS link"
3539
+ msgstr "Zeige den globalen Media RSS Link"
3540
+
3541
+ #: ../widgets/media-rss-widget.php:98
3542
+ msgid "Text for Media RSS link:"
3543
+ msgstr "Text für den globalen Media RSS Link:"
3544
+
3545
+ #: ../widgets/media-rss-widget.php:104
3546
+ msgid "Tooltip text for Media RSS link:"
3547
+ msgstr "Tooltipp-Text für den globalen Media RSS Link."
3548
+
3549
+ #: ../widgets/widgets.php:22
3550
+ msgid "Show a NextGEN Gallery Slideshow"
3551
+ msgstr "Binde eine NextGEN-Gallery-Slideshow ein"
3552
+
3553
+ #: ../widgets/widgets.php:23
3554
+ msgid "NextGEN Slideshow"
3555
+ msgstr "NextGEN-Diashow"
3556
+
3557
+ #: ../widgets/widgets.php:64
3558
+ msgid "<a href=\"http://www.macromedia.com/go/getflashplayer\">Get the Flash Player</a> to see the slideshow."
3559
+ msgstr "<a href=\"http://www.macromedia.com/go/getflashplayer\">Lade Dir den Flash Player</a>, um die Diashow zu sehen."
3560
+
3561
+ #: ../widgets/widgets.php:121
3562
+ msgid "Title:"
3563
+ msgstr "Titel:"
3564
+
3565
+ #: ../widgets/widgets.php:123
3566
+ msgid "Select Gallery:"
3567
+ msgstr "Wähle Galerie"
3568
+
3569
+ #: ../widgets/widgets.php:125
3570
+ msgid "All images"
3571
+ msgstr "Alle Bilder"
3572
+
3573
+ #: ../widgets/widgets.php:137
3574
+ msgid "Height:"
3575
+ msgstr "Höhe:"
3576
+
3577
+ #: ../widgets/widgets.php:138
3578
+ msgid "Width:"
3579
+ msgstr "Breite:"
3580
+
3581
+ #: ../widgets/widgets.php:160
3582
+ msgid "Add recent or random images from the galleries"
3583
+ msgstr "Füge die neusten Bilder oder Zufallsbilder aus NextGEN-Gallery ein"
3584
+
3585
+ #: ../widgets/widgets.php:161
3586
+ msgid "NextGEN Widget"
3587
+ msgstr "NextGEN-Widget"
3588
+
3589
+ #: ../widgets/widgets.php:207
3590
+ msgid "Show :"
3591
+ msgstr "Zeige als :"
3592
+
3593
+ #: ../widgets/widgets.php:213
3594
+ msgid "Original images"
3595
+ msgstr "Original Bilder"
3596
+
3597
+ #: ../widgets/widgets.php:222
3598
+ msgid "recent added "
3599
+ msgstr "zuletzt hinzugefügt"
3600
+
3601
+ #: ../widgets/widgets.php:228
3602
+ msgid "Enable IE8 Web Slices"
3603
+ msgstr "IE8 Web Slices aktivieren"
3604
+
3605
+ #: ../widgets/widgets.php:233
3606
+ msgid "Width x Height :"
3607
+ msgstr "Breite x Höhe :"
3608
+
3609
+ #: ../widgets/widgets.php:239
3610
+ msgid "Select :"
3611
+ msgstr "Wähle :"
3612
+
3613
+ #: ../widgets/widgets.php:241
3614
+ msgid "All galleries"
3615
+ msgstr "Alle Galerien"
3616
+
3617
+ #: ../widgets/widgets.php:242
3618
+ msgid "Only which are not listed"
3619
+ msgstr "Nur ungelistete"
3620
+
3621
+ #: ../widgets/widgets.php:243
3622
+ msgid "Only which are listed"
3623
+ msgstr "Nur gelistete"
3624
+
3625
+ #: ../widgets/widgets.php:249
3626
+ msgid "Gallery ID :"
3627
+ msgstr "Galerie-ID :"
3628
+
3629
+ #: ../widgets/widgets.php:251
3630
+ msgid "Gallery IDs, separated by commas."
3631
+ msgstr "Galerie-IDs, mit Kommas getrennt"
3632
+
3633
+ #: ../xml/media-rss.php:50
3634
+ msgid "No galleries have been yet created."
3635
+ msgstr "Keine Galerie wurde derzeit erstellt."
3636
+
3637
+ #: ../xml/media-rss.php:69
3638
+ #, php-format
3639
+ msgid "The gallery ID=%s does not exist."
3640
+ msgstr "Die Galerie ID=%s existiert nicht."
3641
+
3642
+ #: ../xml/media-rss.php:100
3643
+ msgid "No album ID has been provided as parameter"
3644
+ msgstr "Es wurde kein Album als Parameter übergeben"
3645
+
3646
+ #: ../xml/media-rss.php:108
3647
+ #, php-format
3648
+ msgid "The album ID=%s does not exist."
3649
+ msgstr "Album-ID %s existiert nicht"
3650
+
3651
+ #: ../xml/media-rss.php:115
3652
+ msgid "Invalid MediaRSS command"
3653
+ msgstr "Ungültiger Media-RSS-Befehl"
3654
+
3655
+ #~ msgid "Cache single pictures"
3656
+ #~ msgstr "Nutze Cache für Einzelbilder"
3657
+
3658
+ #~ msgid "Creates a file for each singlepic settings. Reduce the CPU load"
3659
+ #~ msgstr ""
3660
+ #~ "Erstellt ein Cache-Bild für jedes Einzelbild (singlepic). Reduziert die "
3661
+ #~ "CPU Belastung."
3662
+
3663
+ #~ msgid "Currently not used, prepare database for upcoming version"
3664
+ #~ msgstr "Derzeit nicht genutzt, Vorbereitung für kommende Versionen"
3665
+
3666
+ #~ msgid "Send a gift to show your appreciation."
3667
+ #~ msgstr "Schau doch einfach auf meinen Wunschzettel."
3668
+
3669
+ #~ msgid "&laquo;"
3670
+ #~ msgstr "&laquo;"
3671
+
3672
+ #~ msgid "&raquo;"
3673
+ #~ msgstr "&raquo;"
3674
+
3675
+ #~ msgid "Displaying %s&#8211;%s of %s"
3676
+ #~ msgstr "Zeige %s&#8211;%s von %s"
3677
+
3678
+ #~ msgid "Delete album ?"
3679
+ #~ msgstr "Album löschen ?"
3680
+
3681
+ #~ msgid "A new version of NextGEN Gallery is available !"
3682
+ #~ msgstr "Eine neue Version von NextGEN Gallery ist jetzt verfügbar"
3683
+
3684
+ #~ msgid "Download here"
3685
+ #~ msgstr "Hier downloaden"
3686
+
3687
+ #~ msgid "already exists"
3688
+ #~ msgstr "gibt es bereits"
3689
+
3690
+ #~ msgid "Gallery Overview"
3691
+ #~ msgstr "Galerie Übersicht"
3692
+
3693
+ #~ msgid "Quantity"
3694
+ #~ msgstr "Anzahl"
3695
+
3696
+ #~ msgid "Action"
3697
+ #~ msgstr "Aktion"
3698
+
3699
+ #~ msgid "Delete this gallery ?"
3700
+ #~ msgstr "Diese Galerie löschen ?"
3701
+
3702
+ #~ msgid "General WordPress MU Settings"
3703
+ #~ msgstr "WordPress-MU-Einstellungen"
3704
+
3705
+ #~ msgid "No album"
3706
+ #~ msgstr "Kein Album"
3707
+
3708
+ #~ msgid "for the Fugue Iconset"
3709
+ #~ msgstr "für das Fugue-Iconset"
3710
+
3711
+ #~ msgid "Gallery Administrator"
3712
+ #~ msgstr "Galerie-Administrator"
3713
+
3714
+ #~ msgid "Gallery Editor"
3715
+ #~ msgstr "Galerie-Mitarbeiter"
3716
+
3717
+ #~ msgid "You currently have %s rights."
3718
+ #~ msgstr "Du hast derzeit %s Rechte."
3719
+
3720
+ #~ msgid "Upload Space Remaining:"
3721
+ #~ msgstr "Verbleibender Speicher:"
3722
+
3723
+ #~ msgid "View all images tagged with %s"
3724
+ #~ msgstr "Zeige alle Bilder, die mit dem Stichwort %s markiert sind"
3725
+
3726
+ #~ msgid "Upgrade sucessful"
3727
+ #~ msgstr "Aktualisierung erfolgreich"
3728
+
3729
+ #~ msgid ""
3730
+ #~ "<strong>Would you like to help to translate this plugin ?</strong> <a "
3731
+ #~ "target=\"_blank\" href=\"%s\">Download</a> the current pot file and read "
3732
+ #~ "<a href=\"http://alexrabe.de/wordpress-plugins/wordtube/translation-of-"
3733
+ #~ "plugins/\">here</a> how you can translate the plugin."
3734
+ #~ msgstr ""
3735
+ #~ "<strong>Would you like to help to translate this plugin ?</strong> <a "
3736
+ #~ "target=\"_blank\" href=\"%s\">Download</a> the current pot file and read "
3737
+ #~ "<a href=\"http://alexrabe.de/wordpress-plugins/wordtube/translation-of-"
3738
+ #~ "plugins/\">here</a> how you can translate the plugin."
3739
+
3740
+ #~ msgid ""
3741
+ #~ "<strong>Translation by : </strong><a target=\"_blank\" href=\"\">N/A</a>"
3742
+ #~ msgstr ""
3743
+ #~ "<strong>Übersetzt von : </strong><a target=\"_blank\" href=\"\">Alex "
3744
+ #~ "Rabe</a>"
3745
+
3746
+ #~ msgid "Setup Gallery"
3747
+ #~ msgstr "Galerie Setup"
3748
+
3749
+ #~ msgid "Setup"
3750
+ #~ msgstr "Setup"
3751
+
3752
+ #~ msgid "PHP Output Buffer Size"
3753
+ #~ msgstr "PHP Output Buffer Größe"
3754
+
3755
+ #~ msgid "for PclZip , a PHP library that manage ZIP archives"
3756
+ #~ msgstr "für PclZip, eine ZIP PHP Library"
3757
+
3758
+ #~ msgid "Crop square thumbnail from image"
3759
+ #~ msgstr "Mittige Thumbnails aus Bildern ausschneiden"
3760
+
3761
+ #~ msgid "Create square thumbnails, use only the width setting :"
3762
+ #~ msgstr "Erstellt viereckige Thumbnails, nutzt nur den Wert der Breite :"
3763
+
3764
+ #, fuzzy
3765
+ #~ msgid "Search Media"
3766
+ #~ msgstr "Suche nach Stichwörter"
3767
+
3768
+ #~ msgid "Select Gallery"
3769
+ #~ msgstr "Wähle Galerie"
3770
+
3771
+ #~ msgid "Album Page ID"
3772
+ #~ msgstr "Album Seiten ID (Page ID)"
3773
+
3774
+ #~ msgid "Import a folder with all images."
3775
+ #~ msgstr "Importiere ein Verzeichnis mit Bildern."
3776
+
3777
+ #~ msgid "Show tags"
3778
+ #~ msgstr "Zeige Tags"
3779
+
3780
+ #~ msgid "Hide tags"
3781
+ #~ msgstr "Verstecke Tags"
3782
+
3783
+ #~ msgid "Delete this file ?"
3784
+ #~ msgstr "Diese Datei löschen ?"
3785
+
3786
+ #~ msgid ""
3787
+ #~ "You are about to copy or move %s images \n"
3788
+ #~ " \n"
3789
+ #~ " 'Cancel' to stop, 'OK' to proceed."
3790
+ #~ msgstr ""
3791
+ #~ "Willst du wirklich %s Bild(er) verschieben \n"
3792
+ #~ " \n"
3793
+ #~ " 'Abbrechen' um zu stoppen, 'OK' um die Bearbeitung durchzuführen."
3794
+
3795
+ #~ msgid "Show thumbnails "
3796
+ #~ msgstr "Thumbnails zeigen"
3797
+
3798
+ #~ msgid "Add Gallery"
3799
+ #~ msgstr "Bilder/Galerie hinzufügen"
3800
+
3801
+ #~ msgid "Manage galleries"
3802
+ #~ msgstr "Galerie verwalten"
3803
+
3804
+ #~ msgid ""
3805
+ #~ "There are totally %1$s pictures in %2$s galleries, which are spread "
3806
+ #~ "across %3$s albums."
3807
+ #~ msgstr ""
3808
+ #~ "Es gibt insgesamt %1$s Bilder in %2$s Galerien - verteilt in %3$s Alben."
3809
+
3810
+ #~ msgid "GD support"
3811
+ #~ msgstr "GD Unterstützung"
3812
+
3813
+ #~ msgid "ImageMagick"
3814
+ #~ msgstr "ImageMagick"
3815
+
3816
+ #~ msgid "Add Metadata :"
3817
+ #~ msgstr "Metadaten hinzufügen :"
3818
+
3819
+ #~ msgid "Import EXIF, IPTC or XMP data (if available)"
3820
+ #~ msgstr "EXIF, IPTC oder XMP Daten importieren (wenn verfügbar)"
3821
+
3822
+ #~ msgid "New Version available"
3823
+ #~ msgstr "Neue Version verfügbar !!"
3824
+
3825
+ #~ msgid ""
3826
+ #~ "The server reports that a new NextGEN Gallery Version is now available. "
3827
+ #~ "Please visit the plugin homepage for more information."
3828
+ #~ msgstr ""
3829
+ #~ "Der Server benachrichtigt Dich über eine neu verfügbare Version der "
3830
+ #~ "NextGEN Galerie. Bitte besuche die Plugin Homepage um weitere "
3831
+ #~ "Informationen zu erhalten."
3832
+
3833
+ #~ msgid "Resample Mode"
3834
+ #~ msgstr "Resample Modus"
3835
+
3836
+ #~ msgid "Value between 1-5 (higher value, more CPU load)"
3837
+ #~ msgstr "Wähle zwischen 1-5 (je höhere desto länger braucht der Server)"
3838
+
3839
+ #~ msgid "NextGEN Gallery %d"
3840
+ #~ msgstr "NextGEN Gallery %d"
3841
+
3842
+ #~ msgid "How many NextGEN Gallery widgets would you like?"
3843
+ #~ msgstr "Wie viele NextGEN Gallery Widgets möchtest du haben ?"
3844
+
3845
+ #~ msgid "Save"
3846
+ #~ msgstr "Speichern"
3847
+
3848
+ #~ msgid "for Simple:Press Forum, it saved me a lot of time"
3849
+ #~ msgstr "für das Simple:Press Forum, welches mir viel Zeit sparte"
3850
+
3851
+ #~ msgid "Sorry, NextGEN Gallery works only under WordPress 2.5 or higher"
3852
+ #~ msgstr ""
3853
+ #~ "Tut mir leid aber NextGEN Gallery arbeitet nur ab WordPress 2.5 und "
3854
+ #~ "aufwärts"
3855
+
3856
+ #~ msgid "Watch gallery"
3857
+ #~ msgstr "Galerie ansehen"
3858
+
3859
+ #~ msgid "from"
3860
+ #~ msgstr "von"
3861
+
3862
+ #~ msgid " : Image resized..."
3863
+ #~ msgstr " : Bild angepasst..."
3864
+
3865
+ #~ msgid "Some pictures are not writeable :"
3866
+ #~ msgstr "Einige Bilder sind schreibgeschützt :"
3867
+
3868
+ #~ msgid " : Watermark created..."
3869
+ #~ msgstr " : Wasserzeichen gesetzt..."
3870
+
3871
+ #~ msgid " : Thumbnail created..."
3872
+ #~ msgstr ": Thumbnail erstellt..."
3873
+
3874
+ #~ msgid "Follow thumbnails could not created."
3875
+ #~ msgstr "Folgende Thumbnails konnten nicht erstellt werden :"
3876
+
3877
+ #~ msgid "Some thumbnails are not writeable :"
3878
+ #~ msgstr "Einige Thumbnails sind schreibgeschützt :"
3879
+
3880
+ #~ msgid "Watermark successfully added"
3881
+ #~ msgstr "Wasserzeichen erfolgreich erstellt"
3882
+
3883
+ #~ msgid "Images successfully resized"
3884
+ #~ msgstr "Bilder erfolgreich verkleinert"
3885
+
3886
+ #~ msgid " (require WordPress 2.3 or higher)"
3887
+ #~ msgstr " (benötigt WordPress 2.3 oder höher)"
3888
+
3889
+ #~ msgid "Show thumbnail description"
3890
+ #~ msgstr "Zeige Bildbeschreibung"
3891
+
3892
+ #~ msgid "Description text"
3893
+ #~ msgstr "Beschreibung"
3894
+
3895
+ #~ msgid "Import a folder with images. Please note :"
3896
+ #~ msgstr "Importiere ein Verzeichnis mit Bildern. Bitte beachte:"
3897
+
3898
+ #~ msgid "For safe-mode = ON you need to add the subfolder thumbs manually"
3899
+ #~ msgstr ""
3900
+ #~ "Da der Safe-Mode (PHP.INI) eingeschaltet ist, mußt Du das "
3901
+ #~ "Unterverzeichnis für die Vorschaubilder (\"thumbs\") manuell (per FTP) "
3902
+ #~ "anlegen"
3903
+
3904
+ #~ msgid "The Zip-file is too large. Exceed Memory limit !"
3905
+ #~ msgstr "Das Zip-File ist zu groß. Speicherlimit überschritten !"
3906
+
3907
+ #~ msgid "Summary"
3908
+ #~ msgstr "Zusammenfassung"
3909
+
3910
+ #~ msgid "Welcome"
3911
+ #~ msgstr "Willkommen"
3912
+
3913
+ #~ msgid ""
3914
+ #~ "Welcome to NextGEN Gallery. Here you can control your images, galleries "
3915
+ #~ "and albums. You currently have %s rights."
3916
+ #~ msgstr ""
3917
+ #~ "Willkommen zur NextGEN Galerie. Hier kannst Du Deine Bilder, Galerien und "
3918
+ #~ "Alben verwalten. Du hast im Moment %s Rechte."
3919
+
3920
+ #~ msgid "Add a new gallery or import pictures"
3921
+ #~ msgstr "Neue Galerie erstellen oder Bilder importieren"
3922
+
3923
+ #~ msgid "Manage galleries and images"
3924
+ #~ msgstr "Verwalte Galerien und Bilder"
3925
+
3926
+ #~ msgid "URL"
3927
+ #~ msgstr "URL"
3928
+
3929
+ #~ msgid "Delete File"
3930
+ #~ msgstr "Datei löschen"
3931
+
3932
+ #~ msgid "Delete image ?"
3933
+ #~ msgstr "Bilder löschen ?"
3934
+
3935
+ #~ msgid "Browse your files"
3936
+ #~ msgstr "Durchsuche deine Dateien"
3937
+
3938
+ #~ msgid "Direct link to file"
3939
+ #~ msgstr "Link zur Datei"
3940
+
3941
+ #~ msgid "Show:"
3942
+ #~ msgstr "Zeige als:"
3943
+
3944
+ #~ msgid "Link to:"
3945
+ #~ msgstr "Link zu:"
3946
+
3947
+ #~ msgid "Send to editor &raquo;"
3948
+ #~ msgstr "Zum Editor schicken &raquo;"
3949
+
3950
+ #~ msgid ""
3951
+ #~ "Are you sure you want to delete the file '%s'?\n"
3952
+ #~ "Click ok to delete or cancel to go back."
3953
+ #~ msgstr "Bist du sicher das Du diese Datei '%s' löschen willst ?"
3954
+
3955
+ #~ msgid "Alt/Titel text"
3956
+ #~ msgstr "Alt / Titel Text"
lang/nggallery.pot ADDED
@@ -0,0 +1,3640 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: NextGEN Gallery\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2011-10-23 18:02+0100\n"
6
+ "PO-Revision-Date: 2011-10-23 18:03+0100\n"
7
+ "Last-Translator: Alex Rabe\n"
8
+ "Language-Team: Alex Rabe\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: _n:1,2;__;_e;esc_attr_e;esc_html_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-Country: GERMANY\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+ "X-Poedit-SearchPath-1: ..\n"
19
+
20
+ #: ../nggallery.php:100
21
+ msgid "<strong>Translation by : </strong><a target=\"_blank\" href=\"http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/\">See here</a>"
22
+ msgstr ""
23
+
24
+ #: ../nggallery.php:101
25
+ msgid "<strong>This translation is not yet updated for Version 1.9.0</strong>. If you would like to help with translation, download the current po from the plugin folder and read <a href=\"http://alexrabe.de/wordpress-plugins/wordtube/translation-of-plugins/\">here</a> how you can translate the plugin."
26
+ msgstr ""
27
+
28
+ #: ../nggallery.php:205
29
+ msgid "Sorry, NextGEN Gallery works only with a Memory Limit of 16 MB or higher"
30
+ msgstr ""
31
+
32
+ #: ../nggallery.php:225
33
+ msgid "Please update the database of NextGEN Gallery."
34
+ msgstr ""
35
+
36
+ #: ../nggallery.php:225
37
+ msgid "Click here to proceed."
38
+ msgstr ""
39
+
40
+ #: ../nggallery.php:248
41
+ msgid "Picture tag"
42
+ msgstr ""
43
+
44
+ #: ../nggallery.php:249
45
+ msgid "Picture tag: %2$l."
46
+ msgstr ""
47
+
48
+ #: ../nggallery.php:250
49
+ msgid "Separate picture tags with commas."
50
+ msgstr ""
51
+
52
+ #: ../nggallery.php:357
53
+ #: ../admin/admin.php:256
54
+ msgid "L O A D I N G"
55
+ msgstr ""
56
+
57
+ #: ../nggallery.php:358
58
+ #: ../admin/admin.php:257
59
+ msgid "Click to Close"
60
+ msgstr ""
61
+
62
+ #: ../nggallery.php:379
63
+ msgid "loading"
64
+ msgstr ""
65
+
66
+ #: ../nggallery.php:517
67
+ #: ../nggfunctions.php:941
68
+ #: ../admin/admin.php:37
69
+ #: ../admin/admin.php:79
70
+ msgid "Overview"
71
+ msgstr ""
72
+
73
+ #: ../nggallery.php:518
74
+ msgid "Get help"
75
+ msgstr ""
76
+
77
+ #: ../nggallery.php:519
78
+ msgid "Contribute"
79
+ msgstr ""
80
+
81
+ #: ../nggallery.php:520
82
+ msgid "Donate"
83
+ msgstr ""
84
+
85
+ #: ../nggfunctions.php:42
86
+ msgid "The <a href=\"http://www.macromedia.com/go/getflashplayer\">Flash Player</a> and <a href=\"http://www.mozilla.com/firefox/\">a browser with Javascript support</a> are needed."
87
+ msgstr ""
88
+
89
+ #: ../nggfunctions.php:164
90
+ #: ../nggfunctions.php:642
91
+ msgid "[Gallery not found]"
92
+ msgstr ""
93
+
94
+ #: ../nggfunctions.php:450
95
+ msgid "[Album not found]"
96
+ msgstr ""
97
+
98
+ #: ../nggfunctions.php:771
99
+ msgid "[SinglePic not found]"
100
+ msgstr ""
101
+
102
+ #: ../nggfunctions.php:906
103
+ msgid "Related images for"
104
+ msgstr ""
105
+
106
+ #: ../admin/about.php:10
107
+ msgid "Copyright notes / Credits"
108
+ msgstr ""
109
+
110
+ #: ../admin/about.php:13
111
+ msgid "NextGEN DEV Team"
112
+ msgstr ""
113
+
114
+ #: ../admin/about.php:15
115
+ msgid "This plugin is primarily developed, maintained, supported, documented by"
116
+ msgstr ""
117
+
118
+ #: ../admin/about.php:15
119
+ msgid "There are many other folks who have made contributions to this project :"
120
+ msgstr ""
121
+
122
+ #: ../admin/about.php:20
123
+ msgid "Contributors / Tribute to"
124
+ msgstr ""
125
+
126
+ #: ../admin/about.php:22
127
+ msgid "If you study the code of this plugin, you will find out that we mixed a lot of good already existing code and ideas together."
128
+ msgstr ""
129
+
130
+ #: ../admin/about.php:23
131
+ msgid "So, we would like to thank the following people for their pioneer work (without this work it's impossible to create such a plugin so fast)"
132
+ msgstr ""
133
+
134
+ #: ../admin/about.php:25
135
+ msgid "for their great documented code"
136
+ msgstr ""
137
+
138
+ #: ../admin/about.php:26
139
+ msgid "for jQuery, which is the best Web2.0 framework"
140
+ msgstr ""
141
+
142
+ #: ../admin/about.php:27
143
+ msgid "for the fantastic PHP Thumbnail Class"
144
+ msgstr ""
145
+
146
+ #: ../admin/about.php:28
147
+ msgid "for a lot of very useful plugins and ideas"
148
+ msgstr ""
149
+
150
+ #: ../admin/about.php:29
151
+ msgid "for Shutter Reloaded, a real lightweight image effect"
152
+ msgstr ""
153
+
154
+ #: ../admin/about.php:30
155
+ msgid "for the best Media Flash Scripts on earth"
156
+ msgstr ""
157
+
158
+ #: ../admin/about.php:31
159
+ msgid "for the Gallery Icon"
160
+ msgstr ""
161
+
162
+ #: ../admin/about.php:32
163
+ msgid "for the Watermark plugin"
164
+ msgstr ""
165
+
166
+ #: ../admin/about.php:34
167
+ msgid "If you didn't find your name on this list and there is some code which I integrate in my plugin, don't hesitate to send me a mail."
168
+ msgstr ""
169
+
170
+ #: ../admin/about.php:38
171
+ msgid "How to support ?"
172
+ msgstr ""
173
+
174
+ #: ../admin/about.php:40
175
+ msgid "There exist several ways to contribute, help or support us in this work. Non of them are mandatory."
176
+ msgstr ""
177
+
178
+ #: ../admin/about.php:42
179
+ msgid "Send us bugfixes / code changes"
180
+ msgstr ""
181
+
182
+ #: ../admin/about.php:42
183
+ msgid "The most motivated support for this plugin are your ideas and brain work"
184
+ msgstr ""
185
+
186
+ #: ../admin/about.php:43
187
+ msgid "Translate the plugin"
188
+ msgstr ""
189
+
190
+ #: ../admin/about.php:43
191
+ msgid "To help people to work with this plugin, I would like to have it in all available languages"
192
+ msgstr ""
193
+
194
+ #: ../admin/about.php:44
195
+ msgid "Donate the work via paypal"
196
+ msgstr ""
197
+
198
+ #: ../admin/about.php:57
199
+ msgid "No doubt a very useful and easy motivation :-)"
200
+ msgstr ""
201
+
202
+ #: ../admin/about.php:59
203
+ msgid "Place a link to the plugin in your blog/webpage"
204
+ msgstr ""
205
+
206
+ #: ../admin/about.php:59
207
+ msgid "Yes, share and trackback is also a good support for this work "
208
+ msgstr ""
209
+
210
+ #: ../admin/about.php:64
211
+ msgid "Thanks!"
212
+ msgstr ""
213
+
214
+ #: ../admin/about.php:66
215
+ msgid "We would like to thank this people which support us in the work :"
216
+ msgstr ""
217
+
218
+ #: ../admin/about.php:166
219
+ msgid "and all donators..."
220
+ msgstr ""
221
+
222
+ #: ../admin/addgallery.php:46
223
+ #: ../admin/addgallery.php:57
224
+ #: ../admin/addgallery.php:69
225
+ #: ../admin/addgallery.php:80
226
+ #: ../admin/album.php:96
227
+ #: ../admin/album.php:124
228
+ #: ../admin/album.php:142
229
+ #: ../admin/edit-thumbnail.php:19
230
+ #: ../admin/edit-thumbnail.php:22
231
+ #: ../admin/manage.php:186
232
+ msgid "Cheatin&#8217; uh?"
233
+ msgstr ""
234
+
235
+ #: ../admin/addgallery.php:62
236
+ msgid "Upload failed!"
237
+ msgstr ""
238
+
239
+ #: ../admin/addgallery.php:85
240
+ #: ../admin/addgallery.php:93
241
+ msgid "Upload failed! "
242
+ msgstr ""
243
+
244
+ #: ../admin/addgallery.php:90
245
+ #: ../admin/functions.php:943
246
+ #: ../admin/functions.php:1043
247
+ msgid "No gallery selected !"
248
+ msgstr ""
249
+
250
+ #: ../admin/addgallery.php:180
251
+ #: ../admin/addgallery.php:263
252
+ msgid "Image Files"
253
+ msgstr ""
254
+
255
+ #: ../admin/addgallery.php:195
256
+ #: ../admin/addgallery.php:284
257
+ #: ../admin/addgallery.php:312
258
+ msgid "remove"
259
+ msgstr ""
260
+
261
+ #: ../admin/addgallery.php:196
262
+ #: ../admin/addgallery.php:285
263
+ #: ../admin/addgallery.php:466
264
+ msgid "Browse..."
265
+ msgstr ""
266
+
267
+ #: ../admin/addgallery.php:197
268
+ #: ../admin/addgallery.php:235
269
+ #: ../admin/addgallery.php:286
270
+ #: ../admin/addgallery.php:298
271
+ #: ../admin/addgallery.php:537
272
+ msgid "Upload images"
273
+ msgstr ""
274
+
275
+ #: ../admin/addgallery.php:376
276
+ #: ../admin/addgallery.php:484
277
+ msgid "Upload Images"
278
+ msgstr ""
279
+
280
+ #: ../admin/addgallery.php:379
281
+ #: ../admin/addgallery.php:396
282
+ #: ../admin/manage-galleries.php:119
283
+ #: ../admin/manage-galleries.php:156
284
+ msgid "Add new gallery"
285
+ msgstr ""
286
+
287
+ #: ../admin/addgallery.php:382
288
+ #: ../admin/addgallery.php:418
289
+ msgid "Upload a Zip-File"
290
+ msgstr ""
291
+
292
+ #: ../admin/addgallery.php:385
293
+ #: ../admin/addgallery.php:460
294
+ msgid "Import image folder"
295
+ msgstr ""
296
+
297
+ #: ../admin/addgallery.php:401
298
+ #: ../admin/manage-galleries.php:279
299
+ msgid "New Gallery"
300
+ msgstr ""
301
+
302
+ #: ../admin/addgallery.php:404
303
+ #: ../admin/manage-galleries.php:281
304
+ msgid "Create a new , empty gallery below the folder"
305
+ msgstr ""
306
+
307
+ #: ../admin/addgallery.php:406
308
+ #: ../admin/manage-galleries.php:283
309
+ msgid "Allowed characters for file and folder names are"
310
+ msgstr ""
311
+
312
+ #: ../admin/addgallery.php:410
313
+ msgid "Add gallery"
314
+ msgstr ""
315
+
316
+ #: ../admin/addgallery.php:423
317
+ msgid "Select Zip-File"
318
+ msgstr ""
319
+
320
+ #: ../admin/addgallery.php:425
321
+ msgid "Upload a zip file with images"
322
+ msgstr ""
323
+
324
+ #: ../admin/addgallery.php:429
325
+ msgid "or enter a Zip-File URL"
326
+ msgstr ""
327
+
328
+ #: ../admin/addgallery.php:431
329
+ msgid "Import a zip file with images from a url"
330
+ msgstr ""
331
+
332
+ #: ../admin/addgallery.php:435
333
+ #: ../admin/addgallery.php:512
334
+ msgid "in to"
335
+ msgstr ""
336
+
337
+ #: ../admin/addgallery.php:437
338
+ msgid "a new gallery"
339
+ msgstr ""
340
+
341
+ #: ../admin/addgallery.php:448
342
+ msgid "Note : The upload limit on your server is "
343
+ msgstr ""
344
+
345
+ #: ../admin/addgallery.php:452
346
+ msgid "Start upload"
347
+ msgstr ""
348
+
349
+ #: ../admin/addgallery.php:465
350
+ msgid "Import from Server path:"
351
+ msgstr ""
352
+
353
+ #: ../admin/addgallery.php:468
354
+ msgid "Note : Change the default path in the gallery settings"
355
+ msgstr ""
356
+
357
+ #: ../admin/addgallery.php:470
358
+ msgid " Please note : For safe-mode = ON you need to add the subfolder thumbs manually"
359
+ msgstr ""
360
+
361
+ #: ../admin/addgallery.php:473
362
+ msgid "Import folder"
363
+ msgstr ""
364
+
365
+ #: ../admin/addgallery.php:490
366
+ msgid "Upload image"
367
+ msgstr ""
368
+
369
+ #: ../admin/addgallery.php:495
370
+ msgid "Choose files to upload"
371
+ msgstr ""
372
+
373
+ #: ../admin/addgallery.php:496
374
+ msgid "Select Files"
375
+ msgstr ""
376
+
377
+ #: ../admin/addgallery.php:498
378
+ msgid "Or you can drop the files into this window."
379
+ msgstr ""
380
+
381
+ #: ../admin/addgallery.php:501
382
+ #, php-format
383
+ msgid "Scale images to max width %1$dpx or max height %2$dpx"
384
+ msgstr ""
385
+
386
+ #: ../admin/addgallery.php:514
387
+ msgid "Choose gallery"
388
+ msgstr ""
389
+
390
+ #: ../admin/addgallery.php:533
391
+ msgid "The batch upload requires Adobe Flash 10, disable it if you have problems"
392
+ msgstr ""
393
+
394
+ #: ../admin/addgallery.php:533
395
+ msgid "Disable flash upload"
396
+ msgstr ""
397
+
398
+ #: ../admin/addgallery.php:535
399
+ msgid "Upload multiple files at once by ctrl/shift-selecting in dialog"
400
+ msgstr ""
401
+
402
+ #: ../admin/addgallery.php:535
403
+ msgid "Enable flash based upload"
404
+ msgstr ""
405
+
406
+ #: ../admin/admin.php:36
407
+ #: ../admin/admin.php:59
408
+ #: ../admin/admin.php:78
409
+ #: ../admin/admin.php:352
410
+ #: ../admin/admin.php:444
411
+ #: ../admin/functions.php:178
412
+ #: ../admin/manage-galleries.php:127
413
+ #: ../admin/manage-galleries.php:407
414
+ #: ../admin/manage-images.php:239
415
+ msgid "Gallery"
416
+ msgid_plural "Galleries"
417
+ msgstr[0] ""
418
+ msgstr[1] ""
419
+
420
+ #: ../admin/admin.php:38
421
+ #: ../admin/admin.php:81
422
+ msgid "Add Gallery / Images"
423
+ msgstr ""
424
+
425
+ #: ../admin/admin.php:39
426
+ #: ../admin/admin.php:83
427
+ msgid "Manage Gallery"
428
+ msgstr ""
429
+
430
+ #: ../admin/admin.php:40
431
+ #: ../admin/admin.php:85
432
+ msgid "Album"
433
+ msgid_plural "Albums"
434
+ msgstr[0] ""
435
+ msgstr[1] ""
436
+
437
+ #: ../admin/admin.php:41
438
+ #: ../admin/admin.php:87
439
+ msgid "Tags"
440
+ msgstr ""
441
+
442
+ #: ../admin/admin.php:42
443
+ #: ../admin/admin.php:89
444
+ msgid "Options"
445
+ msgstr ""
446
+
447
+ #: ../admin/admin.php:44
448
+ #: ../admin/admin.php:91
449
+ msgid "Style"
450
+ msgstr ""
451
+
452
+ #: ../admin/admin.php:46
453
+ msgid "Roles"
454
+ msgstr ""
455
+
456
+ #: ../admin/admin.php:47
457
+ msgid "About this Gallery"
458
+ msgstr ""
459
+
460
+ #: ../admin/admin.php:47
461
+ #: ../admin/admin.php:92
462
+ msgid "About"
463
+ msgstr ""
464
+
465
+ #: ../admin/admin.php:50
466
+ #: ../admin/admin.php:61
467
+ msgid "Reset / Uninstall"
468
+ msgstr ""
469
+
470
+ #: ../admin/admin.php:60
471
+ msgid "Network settings"
472
+ msgstr ""
473
+
474
+ #: ../admin/admin.php:131
475
+ #, php-format
476
+ msgid "Thanks for using this plugin, I hope you are satisfied ! If you would like to support the further development, please consider a <strong><a href=\"%s\">donation</a></strong>! If you still need some help, please post your questions <a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\">here</a> ."
477
+ msgstr ""
478
+
479
+ #: ../admin/admin.php:134
480
+ msgid "OK, hide this message now !"
481
+ msgstr ""
482
+
483
+ #: ../admin/admin.php:213
484
+ msgid "You do not have the correct permission"
485
+ msgstr ""
486
+
487
+ #: ../admin/admin.php:214
488
+ msgid "Unexpected Error"
489
+ msgstr ""
490
+
491
+ #: ../admin/admin.php:215
492
+ msgid "A failure occurred"
493
+ msgstr ""
494
+
495
+ #: ../admin/admin.php:219
496
+ msgid "You have attempted to queue too many files."
497
+ msgstr ""
498
+
499
+ #: ../admin/admin.php:220
500
+ msgid "This file exceeds the maximum upload size for this site."
501
+ msgstr ""
502
+
503
+ #: ../admin/admin.php:221
504
+ msgid "This file is empty. Please try another."
505
+ msgstr ""
506
+
507
+ #: ../admin/admin.php:222
508
+ msgid "This file type is not allowed. Please try another."
509
+ msgstr ""
510
+
511
+ #: ../admin/admin.php:223
512
+ msgid "This file is not an image. Please try another."
513
+ msgstr ""
514
+
515
+ #: ../admin/admin.php:224
516
+ msgid "Memory exceeded. Please try another smaller file."
517
+ msgstr ""
518
+
519
+ #: ../admin/admin.php:225
520
+ msgid "This is larger than the maximum size. Please try another."
521
+ msgstr ""
522
+
523
+ #: ../admin/admin.php:226
524
+ msgid "An error occurred in the upload. Please try again later."
525
+ msgstr ""
526
+
527
+ #: ../admin/admin.php:227
528
+ msgid "There was a configuration error. Please contact the server administrator."
529
+ msgstr ""
530
+
531
+ #: ../admin/admin.php:228
532
+ msgid "You may only upload 1 file."
533
+ msgstr ""
534
+
535
+ #: ../admin/admin.php:229
536
+ msgid "HTTP error."
537
+ msgstr ""
538
+
539
+ #: ../admin/admin.php:230
540
+ msgid "Upload failed."
541
+ msgstr ""
542
+
543
+ #: ../admin/admin.php:231
544
+ msgid "IO error."
545
+ msgstr ""
546
+
547
+ #: ../admin/admin.php:232
548
+ msgid "Security error."
549
+ msgstr ""
550
+
551
+ #: ../admin/admin.php:233
552
+ msgid "File canceled."
553
+ msgstr ""
554
+
555
+ #: ../admin/admin.php:234
556
+ msgid "Upload stopped."
557
+ msgstr ""
558
+
559
+ #: ../admin/admin.php:235
560
+ msgid "Dismiss"
561
+ msgstr ""
562
+
563
+ #: ../admin/admin.php:236
564
+ msgid "Crunching&hellip;"
565
+ msgstr ""
566
+
567
+ #: ../admin/admin.php:237
568
+ msgid "moved to the trash."
569
+ msgstr ""
570
+
571
+ #: ../admin/admin.php:238
572
+ #, php-format
573
+ msgid "&#8220;%s&#8221; has failed to upload due to an error"
574
+ msgstr ""
575
+
576
+ #: ../admin/admin.php:356
577
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Introduction</a>"
578
+ msgstr ""
579
+
580
+ #: ../admin/admin.php:359
581
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Setup</a>"
582
+ msgstr ""
583
+
584
+ #: ../admin/admin.php:362
585
+ msgid "<a href=\"http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/\" target=\"_blank\">Translation by alex rabe</a>"
586
+ msgstr ""
587
+
588
+ #: ../admin/admin.php:365
589
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Roles / Capabilities</a>"
590
+ msgstr ""
591
+
592
+ #: ../admin/admin.php:368
593
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Styles</a>"
594
+ msgstr ""
595
+
596
+ #: ../admin/admin.php:369
597
+ msgid "Templates"
598
+ msgstr ""
599
+
600
+ #: ../admin/admin.php:372
601
+ #: ../admin/admin.php:378
602
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Gallery management</a>"
603
+ msgstr ""
604
+
605
+ #: ../admin/admin.php:373
606
+ msgid "Gallery example"
607
+ msgstr ""
608
+
609
+ #: ../admin/admin.php:379
610
+ #: ../admin/admin.php:389
611
+ msgid "Gallery tags"
612
+ msgstr ""
613
+
614
+ #: ../admin/admin.php:382
615
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Album management</a>"
616
+ msgstr ""
617
+
618
+ #: ../admin/admin.php:383
619
+ msgid "Album example"
620
+ msgstr ""
621
+
622
+ #: ../admin/admin.php:384
623
+ #: ../admin/admin.php:390
624
+ msgid "Album tags"
625
+ msgstr ""
626
+
627
+ #: ../admin/admin.php:387
628
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-introduction/\" target=\"_blank\">Gallery tags</a>"
629
+ msgstr ""
630
+
631
+ #: ../admin/admin.php:388
632
+ msgid "Related images"
633
+ msgstr ""
634
+
635
+ #: ../admin/admin.php:393
636
+ msgid "<a href=\"http://dpotter.net/Technical/2008/03/nextgen-gallery-review-image-management/\" target=\"_blank\">Image management</a>"
637
+ msgstr ""
638
+
639
+ #: ../admin/admin.php:394
640
+ msgid "Custom fields"
641
+ msgstr ""
642
+
643
+ #: ../admin/admin.php:399
644
+ msgid "Get help with NextGEN Gallery"
645
+ msgstr ""
646
+
647
+ #: ../admin/admin.php:403
648
+ msgid "More Help & Info"
649
+ msgstr ""
650
+
651
+ #: ../admin/admin.php:405
652
+ msgid "<a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\" target=\"_blank\">Support Forums</a>"
653
+ msgstr ""
654
+
655
+ #: ../admin/admin.php:406
656
+ msgid "FAQ"
657
+ msgstr ""
658
+
659
+ #: ../admin/admin.php:407
660
+ msgid "Feature request"
661
+ msgstr ""
662
+
663
+ #: ../admin/admin.php:408
664
+ msgid "Get your language pack"
665
+ msgstr ""
666
+
667
+ #: ../admin/admin.php:409
668
+ msgid "Contribute development"
669
+ msgstr ""
670
+
671
+ #: ../admin/admin.php:410
672
+ msgid "Download latest version"
673
+ msgstr ""
674
+
675
+ #: ../admin/ajax.php:312
676
+ msgid "You are not allowed to be here"
677
+ msgstr ""
678
+
679
+ #: ../admin/ajax.php:410
680
+ #, php-format
681
+ msgid "Could create image with %s x %s pixel"
682
+ msgstr ""
683
+
684
+ #: ../admin/album.php:102
685
+ #: ../admin/album.php:117
686
+ #: ../admin/album.php:158
687
+ msgid "Update Successfully"
688
+ msgstr ""
689
+
690
+ #: ../admin/album.php:131
691
+ msgid "Album deleted"
692
+ msgstr ""
693
+
694
+ #: ../admin/album.php:269
695
+ msgid "Edit Album"
696
+ msgstr ""
697
+
698
+ #: ../admin/album.php:278
699
+ msgid "Manage Albums"
700
+ msgstr ""
701
+
702
+ #: ../admin/album.php:284
703
+ #: ../admin/album.php:333
704
+ msgid "Select album"
705
+ msgstr ""
706
+
707
+ #: ../admin/album.php:286
708
+ msgid "No album selected"
709
+ msgstr ""
710
+
711
+ #: ../admin/album.php:297
712
+ #: ../admin/edit-thumbnail.php:155
713
+ msgid "Update"
714
+ msgstr ""
715
+
716
+ #: ../admin/album.php:299
717
+ msgid "Edit album"
718
+ msgstr ""
719
+
720
+ #: ../admin/album.php:302
721
+ #: ../admin/manage-galleries.php:146
722
+ #: ../admin/manage-images.php:448
723
+ msgid "Delete"
724
+ msgstr ""
725
+
726
+ #: ../admin/album.php:306
727
+ msgid "Add new album"
728
+ msgstr ""
729
+
730
+ #: ../admin/album.php:308
731
+ msgid "Add"
732
+ msgstr ""
733
+
734
+ #: ../admin/album.php:319
735
+ msgid "Show / hide used galleries"
736
+ msgstr ""
737
+
738
+ #: ../admin/album.php:319
739
+ msgid "[Show all]"
740
+ msgstr ""
741
+
742
+ #: ../admin/album.php:320
743
+ msgid "Maximize the widget content"
744
+ msgstr ""
745
+
746
+ #: ../admin/album.php:320
747
+ msgid "[Maximize]"
748
+ msgstr ""
749
+
750
+ #: ../admin/album.php:321
751
+ msgid "Minimize the widget content"
752
+ msgstr ""
753
+
754
+ #: ../admin/album.php:321
755
+ msgid "[Minimize]"
756
+ msgstr ""
757
+
758
+ #: ../admin/album.php:323
759
+ msgid "After you create and select a album, you can drag and drop a gallery or another album into your new album below"
760
+ msgstr ""
761
+
762
+ #: ../admin/album.php:349
763
+ msgid "Select gallery"
764
+ msgstr ""
765
+
766
+ #: ../admin/album.php:378
767
+ msgid "Album ID"
768
+ msgstr ""
769
+
770
+ #: ../admin/album.php:391
771
+ msgid "No album selected!"
772
+ msgstr ""
773
+
774
+ #: ../admin/album.php:411
775
+ msgid "Album name:"
776
+ msgstr ""
777
+
778
+ #: ../admin/album.php:417
779
+ msgid "Album description:"
780
+ msgstr ""
781
+
782
+ #: ../admin/album.php:423
783
+ msgid "Select a preview image:"
784
+ msgstr ""
785
+
786
+ #: ../admin/album.php:426
787
+ #: ../admin/album.php:429
788
+ msgid "No picture"
789
+ msgstr ""
790
+
791
+ #: ../admin/album.php:440
792
+ #: ../admin/manage-images.php:257
793
+ msgid "Page Link to"
794
+ msgstr ""
795
+
796
+ #: ../admin/album.php:442
797
+ #: ../admin/manage-images.php:260
798
+ msgid "Not linked"
799
+ msgstr ""
800
+
801
+ #: ../admin/album.php:455
802
+ #: ../admin/manage-galleries.php:288
803
+ #: ../admin/manage-galleries.php:317
804
+ #: ../admin/manage-galleries.php:347
805
+ #: ../admin/manage-images.php:533
806
+ #: ../admin/manage-images.php:569
807
+ #: ../admin/manage-images.php:598
808
+ #: ../admin/manage-images.php:628
809
+ msgid "OK"
810
+ msgstr ""
811
+
812
+ #: ../admin/album.php:457
813
+ #: ../admin/manage-galleries.php:290
814
+ #: ../admin/manage-galleries.php:319
815
+ #: ../admin/manage-galleries.php:349
816
+ #: ../admin/manage-images.php:535
817
+ #: ../admin/manage-images.php:571
818
+ #: ../admin/manage-images.php:600
819
+ #: ../admin/manage-images.php:630
820
+ msgid "Cancel"
821
+ msgstr ""
822
+
823
+ #: ../admin/album.php:543
824
+ msgid "Name"
825
+ msgstr ""
826
+
827
+ #: ../admin/album.php:544
828
+ #: ../admin/manage-images.php:255
829
+ msgid "Title"
830
+ msgstr ""
831
+
832
+ #: ../admin/album.php:545
833
+ msgid "Page"
834
+ msgstr ""
835
+
836
+ #: ../admin/edit-thumbnail.php:105
837
+ msgid "Select with the mouse the area for the new thumbnail"
838
+ msgstr ""
839
+
840
+ #: ../admin/edit-thumbnail.php:119
841
+ msgid "Thumbnail updated"
842
+ msgstr ""
843
+
844
+ #: ../admin/edit-thumbnail.php:124
845
+ msgid "Error updating thumbnail"
846
+ msgstr ""
847
+
848
+ #: ../admin/edit-thumbnail.php:140
849
+ msgid "Select the area for the thumbnail from the picture on the left."
850
+ msgstr ""
851
+
852
+ #: ../admin/functions.php:39
853
+ msgid "No valid gallery name!"
854
+ msgstr ""
855
+
856
+ #: ../admin/functions.php:46
857
+ #: ../admin/functions.php:55
858
+ #: ../admin/functions.php:80
859
+ #: ../admin/functions.php:149
860
+ #: ../admin/functions.php:157
861
+ msgid "Directory"
862
+ msgstr ""
863
+
864
+ #: ../admin/functions.php:46
865
+ msgid "didn't exist. Please create first the main gallery folder "
866
+ msgstr ""
867
+
868
+ #: ../admin/functions.php:47
869
+ #: ../admin/functions.php:56
870
+ msgid "Check this link, if you didn't know how to set the permission :"
871
+ msgstr ""
872
+
873
+ #: ../admin/functions.php:55
874
+ #: ../admin/functions.php:80
875
+ msgid "is not writeable !"
876
+ msgstr ""
877
+
878
+ #: ../admin/functions.php:76
879
+ #: ../admin/functions.php:85
880
+ #: ../admin/functions.php:902
881
+ msgid "Unable to create directory "
882
+ msgstr ""
883
+
884
+ #: ../admin/functions.php:89
885
+ msgid "The server setting Safe-Mode is on !"
886
+ msgstr ""
887
+
888
+ #: ../admin/functions.php:90
889
+ msgid "If you have problems, please create directory"
890
+ msgstr ""
891
+
892
+ #: ../admin/functions.php:91
893
+ msgid "and the thumbnails directory"
894
+ msgstr ""
895
+
896
+ #: ../admin/functions.php:91
897
+ msgid "with permission 777 manually !"
898
+ msgstr ""
899
+
900
+ #: ../admin/functions.php:116
901
+ #, php-format
902
+ msgid "Gallery ID %1$s successfully created. You can show this gallery in your post or page with the shortcode %2$s.<br/>"
903
+ msgstr ""
904
+
905
+ #: ../admin/functions.php:119
906
+ #: ../admin/functions.php:217
907
+ msgid "Edit gallery"
908
+ msgstr ""
909
+
910
+ #: ../admin/functions.php:149
911
+ msgid "doesn&#96;t exist!"
912
+ msgstr ""
913
+
914
+ #: ../admin/functions.php:157
915
+ msgid "contains no pictures"
916
+ msgstr ""
917
+
918
+ #: ../admin/functions.php:175
919
+ msgid "Database error. Could not add gallery!"
920
+ msgstr ""
921
+
922
+ #: ../admin/functions.php:178
923
+ msgid "successfully created!"
924
+ msgstr ""
925
+
926
+ #: ../admin/functions.php:212
927
+ #: ../admin/functions.php:1019
928
+ #: ../admin/manage-galleries.php:81
929
+ #: ../admin/manage-galleries.php:148
930
+ #: ../admin/manage-images.php:203
931
+ #: ../admin/manage-images.php:342
932
+ #: ../admin/manage.php:223
933
+ #: ../admin/manage.php:299
934
+ msgid "Create new thumbnails"
935
+ msgstr ""
936
+
937
+ #: ../admin/functions.php:215
938
+ msgid " picture(s) successfully added"
939
+ msgstr ""
940
+
941
+ #: ../admin/functions.php:270
942
+ #: ../admin/functions.php:350
943
+ #: ../admin/functions.php:405
944
+ #: ../admin/functions.php:502
945
+ #: ../admin/functions.php:556
946
+ msgid "Object didn't contain correct data"
947
+ msgstr ""
948
+
949
+ #: ../admin/functions.php:278
950
+ msgid " is not writeable "
951
+ msgstr ""
952
+
953
+ #: ../admin/functions.php:360
954
+ #: ../admin/functions.php:408
955
+ #: ../admin/functions.php:508
956
+ #: ../admin/functions.php:559
957
+ msgid " is not writeable"
958
+ msgstr ""
959
+
960
+ #: ../admin/functions.php:562
961
+ msgid "File do not exists"
962
+ msgstr ""
963
+
964
+ #: ../admin/functions.php:566
965
+ msgid "Couldn't restore original image"
966
+ msgstr ""
967
+
968
+ #: ../admin/functions.php:682
969
+ msgid "(Error : Couldn't not update data base)"
970
+ msgstr ""
971
+
972
+ #: ../admin/functions.php:689
973
+ msgid "(Error : Couldn't not update meta data)"
974
+ msgstr ""
975
+
976
+ #: ../admin/functions.php:698
977
+ msgid "(Error : Couldn't not find image)"
978
+ msgstr ""
979
+
980
+ #: ../admin/functions.php:836
981
+ msgid "No valid URL path "
982
+ msgstr ""
983
+
984
+ #: ../admin/functions.php:852
985
+ msgid "Import via cURL failed."
986
+ msgstr ""
987
+
988
+ #: ../admin/functions.php:869
989
+ msgid "Uploaded file was no or a faulty zip file ! The server recognized : "
990
+ msgstr ""
991
+
992
+ #: ../admin/functions.php:886
993
+ msgid "Could not get a valid foldername"
994
+ msgstr ""
995
+
996
+ #: ../admin/functions.php:897
997
+ #, php-format
998
+ msgid "Unable to create directory %s. Is its parent directory writable by the server?"
999
+ msgstr ""
1000
+
1001
+ #: ../admin/functions.php:912
1002
+ msgid "Zip-File successfully unpacked"
1003
+ msgstr ""
1004
+
1005
+ #: ../admin/functions.php:951
1006
+ #: ../admin/functions.php:1068
1007
+ msgid "Failure in database, no gallery path set !"
1008
+ msgstr ""
1009
+
1010
+ #: ../admin/functions.php:975
1011
+ #: ../admin/functions.php:1062
1012
+ msgid "is no valid image file!"
1013
+ msgstr ""
1014
+
1015
+ #: ../admin/functions.php:989
1016
+ #: ../admin/functions.php:1187
1017
+ #: ../admin/functions.php:1264
1018
+ #, php-format
1019
+ msgid "Unable to write to directory %s. Is this directory writable by the server?"
1020
+ msgstr ""
1021
+
1022
+ #: ../admin/functions.php:996
1023
+ #: ../admin/functions.php:1085
1024
+ msgid "Error, the file could not be moved to : "
1025
+ msgstr ""
1026
+
1027
+ #: ../admin/functions.php:1001
1028
+ #: ../admin/functions.php:1089
1029
+ msgid "Error, the file permissions could not be set"
1030
+ msgstr ""
1031
+
1032
+ #: ../admin/functions.php:1024
1033
+ msgid " Image(s) successfully added"
1034
+ msgstr ""
1035
+
1036
+ #: ../admin/functions.php:1051
1037
+ msgid "Invalid upload. Error Code : "
1038
+ msgstr ""
1039
+
1040
+ #: ../admin/functions.php:1127
1041
+ #, php-format
1042
+ msgid "SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually"
1043
+ msgstr ""
1044
+
1045
+ #: ../admin/functions.php:1128
1046
+ #, php-format
1047
+ msgid "When safe_mode is on, PHP checks to see if the owner (%s) of the current script matches the owner (%s) of the file to be operated on by a file function or its directory"
1048
+ msgstr ""
1049
+
1050
+ #: ../admin/functions.php:1181
1051
+ #: ../admin/functions.php:1258
1052
+ msgid "The destination gallery does not exist"
1053
+ msgstr ""
1054
+
1055
+ #: ../admin/functions.php:1212
1056
+ #, php-format
1057
+ msgid "Failed to move image %1$s to %2$s"
1058
+ msgstr ""
1059
+
1060
+ #: ../admin/functions.php:1232
1061
+ #, php-format
1062
+ msgid "Moved %1$s picture(s) to gallery : %2$s ."
1063
+ msgstr ""
1064
+
1065
+ #: ../admin/functions.php:1291
1066
+ #, php-format
1067
+ msgid "Failed to copy image %1$s to %2$s"
1068
+ msgstr ""
1069
+
1070
+ #: ../admin/functions.php:1305
1071
+ #, php-format
1072
+ msgid "Failed to copy database row for picture %s"
1073
+ msgstr ""
1074
+
1075
+ #: ../admin/functions.php:1317
1076
+ #, php-format
1077
+ msgid "Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery."
1078
+ msgstr ""
1079
+
1080
+ #: ../admin/functions.php:1320
1081
+ #, php-format
1082
+ msgid "Image %1$s (%2$s) copied as image %3$s (%4$s)"
1083
+ msgstr ""
1084
+
1085
+ #: ../admin/functions.php:1329
1086
+ #, php-format
1087
+ msgid "Copied %1$s picture(s) to gallery: %2$s ."
1088
+ msgstr ""
1089
+
1090
+ #: ../admin/functions.php:1437
1091
+ msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini"
1092
+ msgstr ""
1093
+
1094
+ #: ../admin/functions.php:1440
1095
+ msgid "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"
1096
+ msgstr ""
1097
+
1098
+ #: ../admin/functions.php:1443
1099
+ msgid "The uploaded file was only partially uploaded"
1100
+ msgstr ""
1101
+
1102
+ #: ../admin/functions.php:1446
1103
+ msgid "No file was uploaded"
1104
+ msgstr ""
1105
+
1106
+ #: ../admin/functions.php:1449
1107
+ msgid "Missing a temporary folder"
1108
+ msgstr ""
1109
+
1110
+ #: ../admin/functions.php:1452
1111
+ msgid "Failed to write file to disk"
1112
+ msgstr ""
1113
+
1114
+ #: ../admin/functions.php:1455
1115
+ msgid "File upload stopped by extension"
1116
+ msgstr ""
1117
+
1118
+ #: ../admin/functions.php:1458
1119
+ msgid "Unknown upload error"
1120
+ msgstr ""
1121
+
1122
+ #: ../admin/install.php:23
1123
+ msgid "Sorry, NextGEN Gallery works only with a role called administrator"
1124
+ msgstr ""
1125
+
1126
+ #: ../admin/install.php:112
1127
+ msgid "NextGEN Gallery : Tables could not created, please check your database settings"
1128
+ msgstr ""
1129
+
1130
+ #: ../admin/install.php:170
1131
+ msgid "[Show as slideshow]"
1132
+ msgstr ""
1133
+
1134
+ #: ../admin/install.php:171
1135
+ msgid "[Show picture list]"
1136
+ msgstr ""
1137
+
1138
+ #: ../admin/manage-galleries.php:69
1139
+ #: ../admin/manage-images.php:171
1140
+ msgid "No images selected"
1141
+ msgstr ""
1142
+
1143
+ #: ../admin/manage-galleries.php:77
1144
+ #: ../admin/manage-galleries.php:149
1145
+ #: ../admin/manage-images.php:199
1146
+ #: ../admin/manage-images.php:343
1147
+ #: ../admin/manage.php:207
1148
+ #: ../admin/manage.php:285
1149
+ msgid "Resize images"
1150
+ msgstr ""
1151
+
1152
+ #: ../admin/manage-galleries.php:86
1153
+ #, php-format
1154
+ msgid ""
1155
+ "You are about to start the bulk edit for %s galleries \n"
1156
+ " \n"
1157
+ " 'Cancel' to stop, 'OK' to proceed."
1158
+ msgstr ""
1159
+
1160
+ #: ../admin/manage-galleries.php:130
1161
+ #: ../admin/manage-galleries.php:133
1162
+ #: ../admin/manage-images.php:225
1163
+ #: ../admin/manage-images.php:228
1164
+ msgid "Search Images"
1165
+ msgstr ""
1166
+
1167
+ #: ../admin/manage-galleries.php:145
1168
+ #: ../admin/manage-images.php:340
1169
+ msgid "Bulk actions"
1170
+ msgstr ""
1171
+
1172
+ #: ../admin/manage-galleries.php:147
1173
+ #: ../admin/manage-images.php:341
1174
+ #: ../admin/manage.php:140
1175
+ #: ../admin/manage.php:249
1176
+ msgid "Set watermark"
1177
+ msgstr ""
1178
+
1179
+ #: ../admin/manage-galleries.php:150
1180
+ #: ../admin/manage-images.php:346
1181
+ #: ../admin/manage.php:145
1182
+ #: ../admin/manage.php:269
1183
+ msgid "Import metadata"
1184
+ msgstr ""
1185
+
1186
+ #: ../admin/manage-galleries.php:151
1187
+ #: ../admin/manage-images.php:344
1188
+ #: ../admin/manage.php:135
1189
+ #: ../admin/manage.php:246
1190
+ msgid "Recover from backup"
1191
+ msgstr ""
1192
+
1193
+ #: ../admin/manage-galleries.php:153
1194
+ #: ../admin/manage-images.php:355
1195
+ msgid "Apply"
1196
+ msgstr ""
1197
+
1198
+ #: ../admin/manage-galleries.php:220
1199
+ msgid "Edit"
1200
+ msgstr ""
1201
+
1202
+ #: ../admin/manage-galleries.php:261
1203
+ #: ../admin/manage-images.php:506
1204
+ msgid "No entries found"
1205
+ msgstr ""
1206
+
1207
+ #: ../admin/manage-galleries.php:308
1208
+ #: ../admin/manage-images.php:589
1209
+ msgid "Resize Images to"
1210
+ msgstr ""
1211
+
1212
+ #: ../admin/manage-galleries.php:312
1213
+ #: ../admin/manage-images.php:593
1214
+ msgid "Width x height (in pixel). NextGEN Gallery will keep ratio size"
1215
+ msgstr ""
1216
+
1217
+ #: ../admin/manage-galleries.php:336
1218
+ #: ../admin/manage-images.php:617
1219
+ msgid "Width x height (in pixel)"
1220
+ msgstr ""
1221
+
1222
+ #: ../admin/manage-galleries.php:338
1223
+ #: ../admin/manage-images.php:619
1224
+ msgid "These values are maximum values "
1225
+ msgstr ""
1226
+
1227
+ #: ../admin/manage-galleries.php:341
1228
+ #: ../admin/manage-images.php:622
1229
+ msgid "Set fix dimension"
1230
+ msgstr ""
1231
+
1232
+ #: ../admin/manage-galleries.php:343
1233
+ #: ../admin/manage-images.php:624
1234
+ msgid "Ignore the aspect ratio, no portrait thumbnails"
1235
+ msgstr ""
1236
+
1237
+ #: ../admin/manage-galleries.php:406
1238
+ #: ../admin/manage-images.php:694
1239
+ msgid "ID"
1240
+ msgstr ""
1241
+
1242
+ #: ../admin/manage-galleries.php:408
1243
+ #: ../admin/manage-images.php:266
1244
+ #: ../admin/manage-images.php:697
1245
+ msgid "Description"
1246
+ msgstr ""
1247
+
1248
+ #: ../admin/manage-galleries.php:409
1249
+ #: ../admin/manage-images.php:295
1250
+ msgid "Author"
1251
+ msgstr ""
1252
+
1253
+ #: ../admin/manage-galleries.php:410
1254
+ msgid "Page ID"
1255
+ msgstr ""
1256
+
1257
+ #: ../admin/manage-galleries.php:411
1258
+ msgid "Image"
1259
+ msgid_plural "Images"
1260
+ msgstr[0] ""
1261
+ msgstr[1] ""
1262
+
1263
+ #: ../admin/manage-images.php:34
1264
+ msgid "Gallery not found."
1265
+ msgstr ""
1266
+
1267
+ #: ../admin/manage-images.php:40
1268
+ msgid "Sorry, you have no access here"
1269
+ msgstr ""
1270
+
1271
+ #: ../admin/manage-images.php:179
1272
+ msgid "Copy image to..."
1273
+ msgstr ""
1274
+
1275
+ #: ../admin/manage-images.php:183
1276
+ msgid "Move image to..."
1277
+ msgstr ""
1278
+
1279
+ #: ../admin/manage-images.php:187
1280
+ msgid "Add new tags"
1281
+ msgstr ""
1282
+
1283
+ #: ../admin/manage-images.php:191
1284
+ #: ../admin/manage-images.php:352
1285
+ msgid "Delete tags"
1286
+ msgstr ""
1287
+
1288
+ #: ../admin/manage-images.php:195
1289
+ msgid "Overwrite"
1290
+ msgstr ""
1291
+
1292
+ #: ../admin/manage-images.php:208
1293
+ #, php-format
1294
+ msgid ""
1295
+ "You are about to start the bulk edit for %s images \n"
1296
+ " \n"
1297
+ " 'Cancel' to stop, 'OK' to proceed."
1298
+ msgstr ""
1299
+
1300
+ #: ../admin/manage-images.php:222
1301
+ #, php-format
1302
+ msgid "Search results for &#8220;%s&#8221;"
1303
+ msgstr ""
1304
+
1305
+ #: ../admin/manage-images.php:251
1306
+ msgid "Gallery settings"
1307
+ msgstr ""
1308
+
1309
+ #: ../admin/manage-images.php:251
1310
+ msgid "Click here for more settings"
1311
+ msgstr ""
1312
+
1313
+ #: ../admin/manage-images.php:268
1314
+ msgid "Preview image"
1315
+ msgstr ""
1316
+
1317
+ #: ../admin/manage-images.php:271
1318
+ msgid "No Picture"
1319
+ msgstr ""
1320
+
1321
+ #: ../admin/manage-images.php:293
1322
+ msgid "Path"
1323
+ msgstr ""
1324
+
1325
+ #: ../admin/manage-images.php:310
1326
+ msgid "Create new page"
1327
+ msgstr ""
1328
+
1329
+ #: ../admin/manage-images.php:313
1330
+ msgid "Main page (No parent)"
1331
+ msgstr ""
1332
+
1333
+ #: ../admin/manage-images.php:316
1334
+ msgid "Add page"
1335
+ msgstr ""
1336
+
1337
+ #: ../admin/manage-images.php:325
1338
+ msgid "Scan Folder for new images"
1339
+ msgstr ""
1340
+
1341
+ #: ../admin/manage-images.php:326
1342
+ #: ../admin/manage-images.php:361
1343
+ #: ../admin/manage-images.php:513
1344
+ msgid "Save Changes"
1345
+ msgstr ""
1346
+
1347
+ #: ../admin/manage-images.php:345
1348
+ msgid "Delete images"
1349
+ msgstr ""
1350
+
1351
+ #: ../admin/manage-images.php:347
1352
+ msgid "Rotate images clockwise"
1353
+ msgstr ""
1354
+
1355
+ #: ../admin/manage-images.php:348
1356
+ msgid "Rotate images counter-clockwise"
1357
+ msgstr ""
1358
+
1359
+ #: ../admin/manage-images.php:349
1360
+ msgid "Copy to..."
1361
+ msgstr ""
1362
+
1363
+ #: ../admin/manage-images.php:350
1364
+ msgid "Move to..."
1365
+ msgstr ""
1366
+
1367
+ #: ../admin/manage-images.php:351
1368
+ msgid "Add tags"
1369
+ msgstr ""
1370
+
1371
+ #: ../admin/manage-images.php:353
1372
+ msgid "Overwrite tags"
1373
+ msgstr ""
1374
+
1375
+ #: ../admin/manage-images.php:358
1376
+ msgid "Sort gallery"
1377
+ msgstr ""
1378
+
1379
+ #: ../admin/manage-images.php:434
1380
+ msgid "pixel"
1381
+ msgstr ""
1382
+
1383
+ #: ../admin/manage-images.php:440
1384
+ #, php-format
1385
+ msgid "View \"%s\""
1386
+ msgstr ""
1387
+
1388
+ #: ../admin/manage-images.php:440
1389
+ msgid "View"
1390
+ msgstr ""
1391
+
1392
+ #: ../admin/manage-images.php:441
1393
+ msgid "Show Meta data"
1394
+ msgstr ""
1395
+
1396
+ #: ../admin/manage-images.php:441
1397
+ msgid "Meta"
1398
+ msgstr ""
1399
+
1400
+ #: ../admin/manage-images.php:442
1401
+ msgid "Customize thumbnail"
1402
+ msgstr ""
1403
+
1404
+ #: ../admin/manage-images.php:442
1405
+ msgid "Edit thumb"
1406
+ msgstr ""
1407
+
1408
+ #: ../admin/manage-images.php:443
1409
+ msgid "Rotate"
1410
+ msgstr ""
1411
+
1412
+ #: ../admin/manage-images.php:445
1413
+ msgid "Publish this image"
1414
+ msgstr ""
1415
+
1416
+ #: ../admin/manage-images.php:445
1417
+ msgid "Publish"
1418
+ msgstr ""
1419
+
1420
+ #: ../admin/manage-images.php:447
1421
+ msgid "Recover"
1422
+ msgstr ""
1423
+
1424
+ #: ../admin/manage-images.php:447
1425
+ #, php-format
1426
+ msgid "Recover \"%s\" ?"
1427
+ msgstr ""
1428
+
1429
+ #: ../admin/manage-images.php:448
1430
+ #, php-format
1431
+ msgid "Delete \"%s\" ?"
1432
+ msgstr ""
1433
+
1434
+ #: ../admin/manage-images.php:529
1435
+ msgid "Enter the tags"
1436
+ msgstr ""
1437
+
1438
+ #: ../admin/manage-images.php:553
1439
+ msgid "Select the destination gallery:"
1440
+ msgstr ""
1441
+
1442
+ #: ../admin/manage-images.php:695
1443
+ msgid "Thumbnail"
1444
+ msgstr ""
1445
+
1446
+ #: ../admin/manage-images.php:696
1447
+ #: ../admin/manage-sort.php:77
1448
+ msgid "Filename"
1449
+ msgstr ""
1450
+
1451
+ #: ../admin/manage-images.php:697
1452
+ msgid "Alt &amp; Title Text"
1453
+ msgstr ""
1454
+
1455
+ #: ../admin/manage-images.php:698
1456
+ msgid "Tags (comma separated list)"
1457
+ msgstr ""
1458
+
1459
+ #: ../admin/manage-images.php:699
1460
+ msgid "exclude"
1461
+ msgstr ""
1462
+
1463
+ #: ../admin/manage-sort.php:33
1464
+ msgid "Sort order changed"
1465
+ msgstr ""
1466
+
1467
+ #: ../admin/manage-sort.php:62
1468
+ msgid "Sort Gallery"
1469
+ msgstr ""
1470
+
1471
+ #: ../admin/manage-sort.php:66
1472
+ msgid "Update Sort Order"
1473
+ msgstr ""
1474
+
1475
+ #: ../admin/manage-sort.php:69
1476
+ msgid "Back to gallery"
1477
+ msgstr ""
1478
+
1479
+ #: ../admin/manage-sort.php:74
1480
+ msgid "Presort"
1481
+ msgstr ""
1482
+
1483
+ #: ../admin/manage-sort.php:75
1484
+ msgid "Unsorted"
1485
+ msgstr ""
1486
+
1487
+ #: ../admin/manage-sort.php:76
1488
+ msgid "Image ID"
1489
+ msgstr ""
1490
+
1491
+ #: ../admin/manage-sort.php:78
1492
+ msgid "Alt/Title text"
1493
+ msgstr ""
1494
+
1495
+ #: ../admin/manage-sort.php:79
1496
+ msgid "Date/Time"
1497
+ msgstr ""
1498
+
1499
+ #: ../admin/manage-sort.php:80
1500
+ msgid "Ascending"
1501
+ msgstr ""
1502
+
1503
+ #: ../admin/manage-sort.php:81
1504
+ msgid "Descending"
1505
+ msgstr ""
1506
+
1507
+ #: ../admin/manage.php:84
1508
+ msgid "Picture"
1509
+ msgstr ""
1510
+
1511
+ #: ../admin/manage.php:84
1512
+ msgid "deleted successfully"
1513
+ msgstr ""
1514
+
1515
+ #: ../admin/manage.php:99
1516
+ #: ../admin/manage.php:108
1517
+ msgid "Operation successful. Please clear your browser cache."
1518
+ msgstr ""
1519
+
1520
+ #: ../admin/manage.php:175
1521
+ msgid "Gallery deleted successfully "
1522
+ msgstr ""
1523
+
1524
+ #: ../admin/manage.php:240
1525
+ #: ../admin/manage.php:243
1526
+ msgid "Rotate images"
1527
+ msgstr ""
1528
+
1529
+ #: ../admin/manage.php:265
1530
+ msgid "Pictures deleted successfully "
1531
+ msgstr ""
1532
+
1533
+ #: ../admin/manage.php:361
1534
+ msgid "Tags changed"
1535
+ msgstr ""
1536
+
1537
+ #: ../admin/manage.php:397
1538
+ msgid "Update successful"
1539
+ msgstr ""
1540
+
1541
+ #: ../admin/manage.php:432
1542
+ msgid "New gallery page ID"
1543
+ msgstr ""
1544
+
1545
+ #: ../admin/manage.php:432
1546
+ msgid "created"
1547
+ msgstr ""
1548
+
1549
+ #: ../admin/manage.php:468
1550
+ msgid "Published a new post"
1551
+ msgstr ""
1552
+
1553
+ #: ../admin/manage.php:582
1554
+ #, php-format
1555
+ msgid "1 item"
1556
+ msgid_plural "%s items"
1557
+ msgstr[0] ""
1558
+ msgstr[1] ""
1559
+
1560
+ #: ../admin/media-upload.php:11
1561
+ msgid "NextGEN Gallery"
1562
+ msgstr ""
1563
+
1564
+ #: ../admin/media-upload.php:166
1565
+ msgid "No gallery"
1566
+ msgstr ""
1567
+
1568
+ #: ../admin/media-upload.php:178
1569
+ msgid "Select &#187;"
1570
+ msgstr ""
1571
+
1572
+ #: ../admin/media-upload.php:209
1573
+ msgid "Show"
1574
+ msgstr ""
1575
+
1576
+ #: ../admin/media-upload.php:210
1577
+ msgid "Hide"
1578
+ msgstr ""
1579
+
1580
+ #: ../admin/media-upload.php:215
1581
+ msgid "Image ID:"
1582
+ msgstr ""
1583
+
1584
+ #: ../admin/media-upload.php:229
1585
+ #: ../admin/publish.php:55
1586
+ msgid "Alignment"
1587
+ msgstr ""
1588
+
1589
+ #: ../admin/media-upload.php:232
1590
+ #: ../admin/publish.php:57
1591
+ #: ../admin/settings.php:480
1592
+ msgid "None"
1593
+ msgstr ""
1594
+
1595
+ #: ../admin/media-upload.php:234
1596
+ #: ../admin/publish.php:59
1597
+ #: ../admin/tinymce/window.php:120
1598
+ msgid "Left"
1599
+ msgstr ""
1600
+
1601
+ #: ../admin/media-upload.php:236
1602
+ #: ../admin/publish.php:61
1603
+ #: ../admin/tinymce/window.php:121
1604
+ msgid "Center"
1605
+ msgstr ""
1606
+
1607
+ #: ../admin/media-upload.php:238
1608
+ #: ../admin/publish.php:63
1609
+ #: ../admin/tinymce/window.php:122
1610
+ msgid "Right"
1611
+ msgstr ""
1612
+
1613
+ #: ../admin/media-upload.php:242
1614
+ #: ../admin/settings.php:587
1615
+ msgid "Size"
1616
+ msgstr ""
1617
+
1618
+ #: ../admin/media-upload.php:248
1619
+ msgid "Full size"
1620
+ msgstr ""
1621
+
1622
+ #: ../admin/media-upload.php:250
1623
+ msgid "Singlepic"
1624
+ msgstr ""
1625
+
1626
+ #: ../admin/media-upload.php:263
1627
+ msgid "Insert into Post"
1628
+ msgstr ""
1629
+
1630
+ #: ../admin/media-upload.php:274
1631
+ msgid "Save all changes"
1632
+ msgstr ""
1633
+
1634
+ #: ../admin/overview.php:14
1635
+ msgid "NextGEN Gallery Overview"
1636
+ msgstr ""
1637
+
1638
+ #: ../admin/overview.php:86
1639
+ msgid "Welcome to NextGEN Gallery !"
1640
+ msgstr ""
1641
+
1642
+ #: ../admin/overview.php:87
1643
+ msgid "Do you like this Plugin?"
1644
+ msgstr ""
1645
+
1646
+ #: ../admin/overview.php:89
1647
+ msgid "Translation"
1648
+ msgstr ""
1649
+
1650
+ #: ../admin/overview.php:90
1651
+ msgid "Latest News"
1652
+ msgstr ""
1653
+
1654
+ #: ../admin/overview.php:91
1655
+ msgid "Recent donators"
1656
+ msgstr ""
1657
+
1658
+ #: ../admin/overview.php:93
1659
+ msgid "Plugin Check"
1660
+ msgstr ""
1661
+
1662
+ #: ../admin/overview.php:94
1663
+ msgid "Server Settings"
1664
+ msgstr ""
1665
+
1666
+ #: ../admin/overview.php:95
1667
+ msgid "Related plugins"
1668
+ msgstr ""
1669
+
1670
+ #: ../admin/overview.php:101
1671
+ #, php-format
1672
+ msgid "This plugin is primarily developed, maintained, supported and documented by <a href=\"%s\">Alex Rabe</a> with a lot of love & effort. Any kind of contribution would be highly appreciated. Thanks!"
1673
+ msgstr ""
1674
+
1675
+ #: ../admin/overview.php:106
1676
+ msgid "Give it a good rating on WordPress.org."
1677
+ msgstr ""
1678
+
1679
+ #: ../admin/overview.php:111
1680
+ msgid "Donate the work via paypal."
1681
+ msgstr ""
1682
+
1683
+ #: ../admin/overview.php:116
1684
+ msgid "Help translating it."
1685
+ msgstr ""
1686
+
1687
+ #: ../admin/overview.php:252
1688
+ msgid "Running..."
1689
+ msgstr ""
1690
+
1691
+ #: ../admin/overview.php:299
1692
+ msgid "Check plugin/theme conflict"
1693
+ msgstr ""
1694
+
1695
+ #: ../admin/overview.php:300
1696
+ #: ../admin/overview.php:306
1697
+ #: ../admin/overview.php:312
1698
+ msgid "Not tested"
1699
+ msgstr ""
1700
+
1701
+ #: ../admin/overview.php:301
1702
+ msgid "No conflict could be detected"
1703
+ msgstr ""
1704
+
1705
+ #: ../admin/overview.php:302
1706
+ msgid "Test failed, disable other plugins & switch to default theme"
1707
+ msgstr ""
1708
+
1709
+ #: ../admin/overview.php:305
1710
+ msgid "Test image function"
1711
+ msgstr ""
1712
+
1713
+ #: ../admin/overview.php:307
1714
+ msgid "The plugin could create images"
1715
+ msgstr ""
1716
+
1717
+ #: ../admin/overview.php:308
1718
+ msgid "Couldn't create image, check your memory limit"
1719
+ msgstr ""
1720
+
1721
+ #: ../admin/overview.php:311
1722
+ msgid "Check theme compatibility"
1723
+ msgstr ""
1724
+
1725
+ #: ../admin/overview.php:313
1726
+ msgid "Your theme should work fine with NextGEN Gallery"
1727
+ msgstr ""
1728
+
1729
+ #: ../admin/overview.php:314
1730
+ msgid "wp_head()/wp_footer() is missing, contact the theme author"
1731
+ msgstr ""
1732
+
1733
+ #: ../admin/overview.php:318
1734
+ msgid "Check plugin"
1735
+ msgstr ""
1736
+
1737
+ #: ../admin/overview.php:339
1738
+ msgid "Graphic Library"
1739
+ msgstr ""
1740
+
1741
+ #: ../admin/overview.php:355
1742
+ #: ../admin/overview.php:404
1743
+ #: ../admin/overview.php:591
1744
+ #: ../admin/overview.php:781
1745
+ msgid "Loading&#8230;"
1746
+ msgstr ""
1747
+
1748
+ #: ../admin/overview.php:355
1749
+ #: ../admin/overview.php:404
1750
+ #: ../admin/overview.php:591
1751
+ #: ../admin/overview.php:781
1752
+ msgid "This widget requires JavaScript."
1753
+ msgstr ""
1754
+
1755
+ #: ../admin/overview.php:368
1756
+ msgid "Thanks to all donators..."
1757
+ msgstr ""
1758
+
1759
+ #: ../admin/overview.php:390
1760
+ msgid "View all"
1761
+ msgstr ""
1762
+
1763
+ #: ../admin/overview.php:416
1764
+ #, php-format
1765
+ msgid "Newsfeed could not be loaded. Check the <a href=\"%s\">front page</a> to check for updates."
1766
+ msgstr ""
1767
+
1768
+ #: ../admin/overview.php:428
1769
+ msgid "Untitled"
1770
+ msgstr ""
1771
+
1772
+ #: ../admin/overview.php:478
1773
+ msgid "At a Glance"
1774
+ msgstr ""
1775
+
1776
+ #: ../admin/overview.php:504
1777
+ msgid "Upload pictures"
1778
+ msgstr ""
1779
+
1780
+ #: ../admin/overview.php:505
1781
+ msgid "Here you can control your images, galleries and albums."
1782
+ msgstr ""
1783
+
1784
+ #: ../admin/overview.php:535
1785
+ msgid "Storage Space"
1786
+ msgstr ""
1787
+
1788
+ #: ../admin/overview.php:539
1789
+ #, php-format
1790
+ msgid "<a href=\"%1$s\" title=\"Manage Uploads\" class=\"musublink\">%2$sMB</a>"
1791
+ msgstr ""
1792
+
1793
+ #: ../admin/overview.php:540
1794
+ msgid "Space Allowed"
1795
+ msgstr ""
1796
+
1797
+ #: ../admin/overview.php:547
1798
+ #, php-format
1799
+ msgid "<a href=\"%1$s\" title=\"Manage Uploads\" class=\"musublink\">%2$sMB (%3$s%%)</a>"
1800
+ msgstr ""
1801
+
1802
+ #: ../admin/overview.php:548
1803
+ msgid "Space Used"
1804
+ msgstr ""
1805
+
1806
+ #: ../admin/overview.php:577
1807
+ msgid "Translation file successful updated. Please reload page."
1808
+ msgstr ""
1809
+
1810
+ #: ../admin/overview.php:579
1811
+ msgid "Reload page"
1812
+ msgstr ""
1813
+
1814
+ #: ../admin/overview.php:584
1815
+ msgid "Translation file couldn't be updated"
1816
+ msgstr ""
1817
+
1818
+ #: ../admin/overview.php:621
1819
+ msgid "Download"
1820
+ msgstr ""
1821
+
1822
+ #: ../admin/overview.php:650
1823
+ msgid "No GD support"
1824
+ msgstr ""
1825
+
1826
+ #: ../admin/overview.php:662
1827
+ #: ../admin/overview.php:708
1828
+ #: ../admin/overview.php:711
1829
+ #: ../admin/overview.php:714
1830
+ msgid "Yes"
1831
+ msgstr ""
1832
+
1833
+ #: ../admin/overview.php:664
1834
+ #: ../admin/overview.php:709
1835
+ #: ../admin/overview.php:712
1836
+ #: ../admin/overview.php:715
1837
+ msgid "No"
1838
+ msgstr ""
1839
+
1840
+ #: ../admin/overview.php:682
1841
+ msgid "Not set"
1842
+ msgstr ""
1843
+
1844
+ #: ../admin/overview.php:684
1845
+ #: ../admin/overview.php:687
1846
+ msgid "On"
1847
+ msgstr ""
1848
+
1849
+ #: ../admin/overview.php:685
1850
+ #: ../admin/overview.php:688
1851
+ msgid "Off"
1852
+ msgstr ""
1853
+
1854
+ #: ../admin/overview.php:691
1855
+ #: ../admin/overview.php:694
1856
+ #: ../admin/overview.php:697
1857
+ #: ../admin/overview.php:700
1858
+ #: ../admin/overview.php:703
1859
+ #: ../admin/overview.php:706
1860
+ msgid "N/A"
1861
+ msgstr ""
1862
+
1863
+ #: ../admin/overview.php:705
1864
+ msgid " MByte"
1865
+ msgstr ""
1866
+
1867
+ #: ../admin/overview.php:718
1868
+ msgid "Operating System"
1869
+ msgstr ""
1870
+
1871
+ #: ../admin/overview.php:719
1872
+ msgid "Server"
1873
+ msgstr ""
1874
+
1875
+ #: ../admin/overview.php:720
1876
+ msgid "Memory usage"
1877
+ msgstr ""
1878
+
1879
+ #: ../admin/overview.php:721
1880
+ msgid "MYSQL Version"
1881
+ msgstr ""
1882
+
1883
+ #: ../admin/overview.php:722
1884
+ msgid "SQL Mode"
1885
+ msgstr ""
1886
+
1887
+ #: ../admin/overview.php:723
1888
+ msgid "PHP Version"
1889
+ msgstr ""
1890
+
1891
+ #: ../admin/overview.php:724
1892
+ msgid "PHP Safe Mode"
1893
+ msgstr ""
1894
+
1895
+ #: ../admin/overview.php:725
1896
+ msgid "PHP Allow URL fopen"
1897
+ msgstr ""
1898
+
1899
+ #: ../admin/overview.php:726
1900
+ msgid "PHP Memory Limit"
1901
+ msgstr ""
1902
+
1903
+ #: ../admin/overview.php:727
1904
+ msgid "PHP Max Upload Size"
1905
+ msgstr ""
1906
+
1907
+ #: ../admin/overview.php:728
1908
+ msgid "PHP Max Post Size"
1909
+ msgstr ""
1910
+
1911
+ #: ../admin/overview.php:729
1912
+ msgid "PCRE Backtracking Limit"
1913
+ msgstr ""
1914
+
1915
+ #: ../admin/overview.php:730
1916
+ msgid "PHP Max Script Execute Time"
1917
+ msgstr ""
1918
+
1919
+ #: ../admin/overview.php:731
1920
+ msgid "PHP Exif support"
1921
+ msgstr ""
1922
+
1923
+ #: ../admin/overview.php:732
1924
+ msgid "PHP IPTC support"
1925
+ msgstr ""
1926
+
1927
+ #: ../admin/overview.php:733
1928
+ msgid "PHP XML support"
1929
+ msgstr ""
1930
+
1931
+ #: ../admin/overview.php:745
1932
+ msgid "NextGEN Gallery contains some functions which are only available under PHP 5.2. You are using the old PHP 4 version, upgrade now! It's no longer supported by the PHP group. Many shared hosting providers offer both PHP 4 and PHP 5, running simultaneously. Ask your provider if they can do this."
1933
+ msgstr ""
1934
+
1935
+ #: ../admin/overview.php:841
1936
+ msgid "Install"
1937
+ msgstr ""
1938
+
1939
+ #: ../admin/pointer.php:22
1940
+ msgid "<h3>Client side resize</h3><p>You can now resize the images before you start with the upload.</p>"
1941
+ msgstr ""
1942
+
1943
+ #: ../admin/publish.php:45
1944
+ msgid "Post title"
1945
+ msgstr ""
1946
+
1947
+ #: ../admin/publish.php:47
1948
+ msgid "Enter the post title "
1949
+ msgstr ""
1950
+
1951
+ #: ../admin/publish.php:52
1952
+ msgid "Size of the image"
1953
+ msgstr ""
1954
+
1955
+ #: ../admin/publish.php:70
1956
+ msgid "Draft"
1957
+ msgstr ""
1958
+
1959
+ #: ../admin/roles.php:22
1960
+ msgid "Updated capabilities"
1961
+ msgstr ""
1962
+
1963
+ #: ../admin/roles.php:28
1964
+ msgid "Roles / capabilities"
1965
+ msgstr ""
1966
+
1967
+ #: ../admin/roles.php:29
1968
+ msgid "Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress."
1969
+ msgstr ""
1970
+
1971
+ #: ../admin/roles.php:30
1972
+ msgid "For a more flexible user management you can use the"
1973
+ msgstr ""
1974
+
1975
+ #: ../admin/roles.php:35
1976
+ msgid "Main NextGEN Gallery overview"
1977
+ msgstr ""
1978
+
1979
+ #: ../admin/roles.php:39
1980
+ msgid "Use TinyMCE Button / Upload tab"
1981
+ msgstr ""
1982
+
1983
+ #: ../admin/roles.php:43
1984
+ msgid "Add gallery / Upload images"
1985
+ msgstr ""
1986
+
1987
+ #: ../admin/roles.php:47
1988
+ msgid "Manage gallery"
1989
+ msgstr ""
1990
+
1991
+ #: ../admin/roles.php:51
1992
+ msgid "Manage others gallery"
1993
+ msgstr ""
1994
+
1995
+ #: ../admin/roles.php:55
1996
+ msgid "Manage tags"
1997
+ msgstr ""
1998
+
1999
+ #: ../admin/roles.php:63
2000
+ msgid "Change style"
2001
+ msgstr ""
2002
+
2003
+ #: ../admin/roles.php:67
2004
+ msgid "Change options"
2005
+ msgstr ""
2006
+
2007
+ #: ../admin/roles.php:71
2008
+ msgid "Update capabilities"
2009
+ msgstr ""
2010
+
2011
+ #: ../admin/rotate.php:55
2012
+ msgid "Image rotated"
2013
+ msgstr ""
2014
+
2015
+ #: ../admin/rotate.php:56
2016
+ msgid "Error rotating thumbnail"
2017
+ msgstr ""
2018
+
2019
+ #: ../admin/rotate.php:81
2020
+ msgid "90&deg; clockwise"
2021
+ msgstr ""
2022
+
2023
+ #: ../admin/rotate.php:82
2024
+ msgid "90&deg; anticlockwise"
2025
+ msgstr ""
2026
+
2027
+ #: ../admin/rotate.php:83
2028
+ msgid "Flip vertically"
2029
+ msgstr ""
2030
+
2031
+ #: ../admin/rotate.php:84
2032
+ msgid "Flip horizontally"
2033
+ msgstr ""
2034
+
2035
+ #: ../admin/settings.php:97
2036
+ msgid "Cache cleared"
2037
+ msgstr ""
2038
+
2039
+ #: ../admin/settings.php:217
2040
+ #: ../admin/settings.php:236
2041
+ msgid "General Options"
2042
+ msgstr ""
2043
+
2044
+ #: ../admin/settings.php:218
2045
+ #: ../admin/settings.php:417
2046
+ msgid "Thumbnails"
2047
+ msgstr ""
2048
+
2049
+ #: ../admin/settings.php:219
2050
+ msgid "Images"
2051
+ msgstr ""
2052
+
2053
+ #: ../admin/settings.php:221
2054
+ #: ../admin/settings.php:469
2055
+ msgid "Effects"
2056
+ msgstr ""
2057
+
2058
+ #: ../admin/settings.php:222
2059
+ #: ../admin/settings.php:511
2060
+ #: ../admin/tinymce/window.php:110
2061
+ msgid "Watermark"
2062
+ msgstr ""
2063
+
2064
+ #: ../admin/settings.php:223
2065
+ #: ../admin/settings.php:418
2066
+ #: ../admin/settings.php:618
2067
+ #: ../admin/tinymce/window.php:63
2068
+ msgid "Slideshow"
2069
+ msgstr ""
2070
+
2071
+ #: ../admin/settings.php:242
2072
+ #: ../admin/wpmu.php:68
2073
+ msgid "Gallery path"
2074
+ msgstr ""
2075
+
2076
+ #: ../admin/settings.php:244
2077
+ msgid "This is the default path for all galleries"
2078
+ msgstr ""
2079
+
2080
+ #: ../admin/settings.php:247
2081
+ msgid "Delete image files"
2082
+ msgstr ""
2083
+
2084
+ #: ../admin/settings.php:249
2085
+ msgid "Delete files, when removing a gallery in the database"
2086
+ msgstr ""
2087
+
2088
+ #: ../admin/settings.php:252
2089
+ msgid "Activate permalinks"
2090
+ msgstr ""
2091
+
2092
+ #: ../admin/settings.php:254
2093
+ msgid "When you activate this option, you need to update your permalink structure one time."
2094
+ msgstr ""
2095
+
2096
+ #: ../admin/settings.php:255
2097
+ msgid "Gallery slug name :"
2098
+ msgstr ""
2099
+
2100
+ #: ../admin/settings.php:259
2101
+ msgid "Create new URL friendly image slugs"
2102
+ msgstr ""
2103
+
2104
+ #: ../admin/settings.php:260
2105
+ #: ../admin/settings.php:371
2106
+ msgid "Proceed now"
2107
+ msgstr ""
2108
+
2109
+ #: ../admin/settings.php:263
2110
+ msgid "Select graphic library"
2111
+ msgstr ""
2112
+
2113
+ #: ../admin/settings.php:264
2114
+ msgid "GD Library"
2115
+ msgstr ""
2116
+
2117
+ #: ../admin/settings.php:265
2118
+ msgid "ImageMagick (Experimental). Path to the library :"
2119
+ msgstr ""
2120
+
2121
+ #: ../admin/settings.php:270
2122
+ msgid "Activate Media RSS feed"
2123
+ msgstr ""
2124
+
2125
+ #: ../admin/settings.php:272
2126
+ msgid "A RSS feed will be added to you blog header. Useful for CoolIris/PicLens"
2127
+ msgstr ""
2128
+
2129
+ #: ../admin/settings.php:275
2130
+ msgid "Activate PicLens/CoolIris support"
2131
+ msgstr ""
2132
+
2133
+ #: ../admin/settings.php:277
2134
+ msgid "When you activate this option, some javascript is added to your site footer. Make sure that wp_footer is called in your theme."
2135
+ msgstr ""
2136
+
2137
+ #: ../admin/settings.php:280
2138
+ msgid "Tags / Categories"
2139
+ msgstr ""
2140
+
2141
+ #: ../admin/settings.php:283
2142
+ msgid "Activate related images"
2143
+ msgstr ""
2144
+
2145
+ #: ../admin/settings.php:285
2146
+ msgid "This option will append related images to every post"
2147
+ msgstr ""
2148
+
2149
+ #: ../admin/settings.php:289
2150
+ msgid "Match with"
2151
+ msgstr ""
2152
+
2153
+ #: ../admin/settings.php:290
2154
+ msgid "Categories"
2155
+ msgstr ""
2156
+
2157
+ #: ../admin/settings.php:295
2158
+ msgid "Max. number of images"
2159
+ msgstr ""
2160
+
2161
+ #: ../admin/settings.php:297
2162
+ msgid "0 will show all images"
2163
+ msgstr ""
2164
+
2165
+ #: ../admin/settings.php:301
2166
+ #: ../admin/settings.php:332
2167
+ #: ../admin/settings.php:374
2168
+ #: ../admin/settings.php:459
2169
+ #: ../admin/settings.php:494
2170
+ #: ../admin/settings.php:755
2171
+ msgid "More settings"
2172
+ msgstr ""
2173
+
2174
+ #: ../admin/settings.php:311
2175
+ msgid "Thumbnail settings"
2176
+ msgstr ""
2177
+
2178
+ #: ../admin/settings.php:315
2179
+ msgid "Please note : If you change the settings, you need to recreate the thumbnails under -> Manage Gallery ."
2180
+ msgstr ""
2181
+
2182
+ #: ../admin/settings.php:328
2183
+ msgid "Thumbnail quality"
2184
+ msgstr ""
2185
+
2186
+ #: ../admin/settings.php:342
2187
+ msgid "Image settings"
2188
+ msgstr ""
2189
+
2190
+ #: ../admin/settings.php:348
2191
+ msgid "Resize Images"
2192
+ msgstr ""
2193
+
2194
+ #: ../admin/settings.php:353
2195
+ msgid "Image quality"
2196
+ msgstr ""
2197
+
2198
+ #: ../admin/settings.php:357
2199
+ msgid "Backup original images"
2200
+ msgstr ""
2201
+
2202
+ #: ../admin/settings.php:359
2203
+ msgid "Creates a backup for inserted images"
2204
+ msgstr ""
2205
+
2206
+ #: ../admin/settings.php:362
2207
+ msgid "Automatically resize"
2208
+ msgstr ""
2209
+
2210
+ #: ../admin/settings.php:364
2211
+ msgid "Automatically resize images on upload."
2212
+ msgstr ""
2213
+
2214
+ #: ../admin/settings.php:367
2215
+ msgid "Single picture"
2216
+ msgstr ""
2217
+
2218
+ #: ../admin/settings.php:370
2219
+ msgid "Clear cache folder"
2220
+ msgstr ""
2221
+
2222
+ #: ../admin/settings.php:391
2223
+ msgid "Deactivate gallery page link"
2224
+ msgstr ""
2225
+
2226
+ #: ../admin/settings.php:393
2227
+ msgid "The album will not link to a gallery subpage. The gallery is shown on the same page."
2228
+ msgstr ""
2229
+
2230
+ #: ../admin/settings.php:397
2231
+ msgid "Number of images per page"
2232
+ msgstr ""
2233
+
2234
+ #: ../admin/settings.php:399
2235
+ msgid "0 will disable pagination, all images on one page"
2236
+ msgstr ""
2237
+
2238
+ #: ../admin/settings.php:403
2239
+ msgid "Number of columns"
2240
+ msgstr ""
2241
+
2242
+ #: ../admin/settings.php:405
2243
+ msgid "0 will display as much as possible based on the width of your theme. Setting normally only required for captions below the images"
2244
+ msgstr ""
2245
+
2246
+ #: ../admin/settings.php:409
2247
+ msgid "Integrate slideshow"
2248
+ msgstr ""
2249
+
2250
+ #: ../admin/settings.php:416
2251
+ msgid "Show first"
2252
+ msgstr ""
2253
+
2254
+ #: ../admin/settings.php:422
2255
+ msgid "Show ImageBrowser"
2256
+ msgstr ""
2257
+
2258
+ #: ../admin/settings.php:424
2259
+ msgid "The gallery will open the ImageBrowser instead the effect."
2260
+ msgstr ""
2261
+
2262
+ #: ../admin/settings.php:428
2263
+ msgid "Add hidden images"
2264
+ msgstr ""
2265
+
2266
+ #: ../admin/settings.php:430
2267
+ msgid "If pagination is used, this option will still show all images in the modal window (Thickbox, Lightbox etc.). Note : This increases the page load"
2268
+ msgstr ""
2269
+
2270
+ #: ../admin/settings.php:434
2271
+ msgid "Enable AJAX pagination"
2272
+ msgstr ""
2273
+
2274
+ #: ../admin/settings.php:436
2275
+ msgid "Browse images without reload the page. Note : Works only in combination with Shutter effect"
2276
+ msgstr ""
2277
+
2278
+ #: ../admin/settings.php:440
2279
+ msgid "Sort options"
2280
+ msgstr ""
2281
+
2282
+ #: ../admin/settings.php:443
2283
+ msgid "Sort thumbnails"
2284
+ msgstr ""
2285
+
2286
+ #: ../admin/settings.php:445
2287
+ msgid "Custom order"
2288
+ msgstr ""
2289
+
2290
+ #: ../admin/settings.php:447
2291
+ msgid "File name"
2292
+ msgstr ""
2293
+
2294
+ #: ../admin/settings.php:448
2295
+ msgid "Alt / Title text"
2296
+ msgstr ""
2297
+
2298
+ #: ../admin/settings.php:449
2299
+ msgid "Date / Time"
2300
+ msgstr ""
2301
+
2302
+ #: ../admin/settings.php:453
2303
+ msgid "Sort direction"
2304
+ msgstr ""
2305
+
2306
+ #: ../admin/settings.php:473
2307
+ msgid "Here you can select the thumbnail effect, NextGEN Gallery will integrate the required HTML code in the images. Please note that only the Shutter and Thickbox effect will automatic added to your theme."
2308
+ msgstr ""
2309
+
2310
+ #: ../admin/settings.php:474
2311
+ msgid "With the placeholder"
2312
+ msgstr ""
2313
+
2314
+ #: ../admin/settings.php:474
2315
+ msgid "you can activate a navigation through the images (depend on the effect). Change the code line only , when you use a different thumbnail effect or you know what you do."
2316
+ msgstr ""
2317
+
2318
+ #: ../admin/settings.php:477
2319
+ msgid "JavaScript Thumbnail effect"
2320
+ msgstr ""
2321
+
2322
+ #: ../admin/settings.php:481
2323
+ msgid "Thickbox"
2324
+ msgstr ""
2325
+
2326
+ #: ../admin/settings.php:482
2327
+ msgid "Lightbox"
2328
+ msgstr ""
2329
+
2330
+ #: ../admin/settings.php:483
2331
+ msgid "Highslide"
2332
+ msgstr ""
2333
+
2334
+ #: ../admin/settings.php:484
2335
+ msgid "Shutter"
2336
+ msgstr ""
2337
+
2338
+ #: ../admin/settings.php:485
2339
+ msgid "Custom"
2340
+ msgstr ""
2341
+
2342
+ #: ../admin/settings.php:490
2343
+ msgid "Link Code line"
2344
+ msgstr ""
2345
+
2346
+ #: ../admin/settings.php:512
2347
+ msgid "Please note : You can only activate the watermark under -> Manage Gallery . This action cannot be undone."
2348
+ msgstr ""
2349
+
2350
+ #: ../admin/settings.php:517
2351
+ msgid "Preview"
2352
+ msgstr ""
2353
+
2354
+ #: ../admin/settings.php:519
2355
+ #: ../admin/settings.php:524
2356
+ msgid "Position"
2357
+ msgstr ""
2358
+
2359
+ #: ../admin/settings.php:544
2360
+ msgid "Offset"
2361
+ msgstr ""
2362
+
2363
+ #: ../admin/settings.php:560
2364
+ msgid "Use image as watermark"
2365
+ msgstr ""
2366
+
2367
+ #: ../admin/settings.php:563
2368
+ msgid "URL to file"
2369
+ msgstr ""
2370
+
2371
+ #: ../admin/settings.php:565
2372
+ msgid "The accessing of URL files is disabled at your server (allow_url_fopen)"
2373
+ msgstr ""
2374
+
2375
+ #: ../admin/settings.php:568
2376
+ msgid "Use text as watermark"
2377
+ msgstr ""
2378
+
2379
+ #: ../admin/settings.php:571
2380
+ msgid "Font"
2381
+ msgstr ""
2382
+
2383
+ #: ../admin/settings.php:580
2384
+ msgid "This function will not work, cause you need the FreeType library"
2385
+ msgstr ""
2386
+
2387
+ #: ../admin/settings.php:582
2388
+ msgid "You can upload more fonts in the folder <strong>nggallery/fonts</strong>"
2389
+ msgstr ""
2390
+
2391
+ #: ../admin/settings.php:591
2392
+ msgid "Color"
2393
+ msgstr ""
2394
+
2395
+ #: ../admin/settings.php:593
2396
+ msgid "(hex w/o #)"
2397
+ msgstr ""
2398
+
2399
+ #: ../admin/settings.php:596
2400
+ msgid "Text"
2401
+ msgstr ""
2402
+
2403
+ #: ../admin/settings.php:600
2404
+ msgid "Opaque"
2405
+ msgstr ""
2406
+
2407
+ #: ../admin/settings.php:621
2408
+ msgid "Default size (W x H)"
2409
+ msgstr ""
2410
+
2411
+ #: ../admin/settings.php:626
2412
+ msgid "Duration time"
2413
+ msgstr ""
2414
+
2415
+ #: ../admin/settings.php:627
2416
+ msgid "sec."
2417
+ msgstr ""
2418
+
2419
+ #: ../admin/settings.php:630
2420
+ #: ../admin/settings.php:705
2421
+ msgid "Transition / Fade effect"
2422
+ msgstr ""
2423
+
2424
+ #: ../admin/settings.php:633
2425
+ #: ../admin/settings.php:708
2426
+ msgid "fade"
2427
+ msgstr ""
2428
+
2429
+ #: ../admin/settings.php:634
2430
+ msgid "blindX"
2431
+ msgstr ""
2432
+
2433
+ #: ../admin/settings.php:635
2434
+ msgid "cover"
2435
+ msgstr ""
2436
+
2437
+ #: ../admin/settings.php:636
2438
+ msgid "scrollUp"
2439
+ msgstr ""
2440
+
2441
+ #: ../admin/settings.php:637
2442
+ msgid "scrollDown"
2443
+ msgstr ""
2444
+
2445
+ #: ../admin/settings.php:638
2446
+ msgid "shuffle"
2447
+ msgstr ""
2448
+
2449
+ #: ../admin/settings.php:639
2450
+ msgid "toss"
2451
+ msgstr ""
2452
+
2453
+ #: ../admin/settings.php:640
2454
+ msgid "wipe"
2455
+ msgstr ""
2456
+
2457
+ #: ../admin/settings.php:642
2458
+ msgid "See here for more information about the effects :"
2459
+ msgstr ""
2460
+
2461
+ #: ../admin/settings.php:646
2462
+ msgid "Settings for the JW Image Rotator"
2463
+ msgstr ""
2464
+
2465
+ #: ../admin/settings.php:647
2466
+ msgid "The settings are only used in the JW Image Rotator Version"
2467
+ msgstr ""
2468
+
2469
+ #: ../admin/settings.php:648
2470
+ msgid "See more information for the Flash Player on the web page"
2471
+ msgstr ""
2472
+
2473
+ #: ../admin/settings.php:653
2474
+ msgid "The path to imagerotator.swf is not defined, the slideshow will not work."
2475
+ msgstr ""
2476
+
2477
+ #: ../admin/settings.php:654
2478
+ msgid "If you would like to use the JW Image Rotatator, please download the player <a href=\"http://www.longtailvideo.com/players/jw-image-rotator/\" target=\"_blank\" >here</a> and upload it to your Upload folder (Default is wp-content/uploads)."
2479
+ msgstr ""
2480
+
2481
+ #: ../admin/settings.php:660
2482
+ msgid "Enable flash slideshow"
2483
+ msgstr ""
2484
+
2485
+ #: ../admin/settings.php:662
2486
+ msgid "Integrate the flash based slideshow for all flash supported devices"
2487
+ msgstr ""
2488
+
2489
+ #: ../admin/settings.php:665
2490
+ msgid "Path to the Imagerotator (URL)"
2491
+ msgstr ""
2492
+
2493
+ #: ../admin/settings.php:668
2494
+ msgid "Search now"
2495
+ msgstr ""
2496
+
2497
+ #: ../admin/settings.php:669
2498
+ msgid "Press the button to search automatically for the imagerotator, if you uploaded it to wp-content/uploads or a subfolder"
2499
+ msgstr ""
2500
+
2501
+ #: ../admin/settings.php:673
2502
+ msgid "Shuffle mode"
2503
+ msgstr ""
2504
+
2505
+ #: ../admin/settings.php:677
2506
+ msgid "Show next image on click"
2507
+ msgstr ""
2508
+
2509
+ #: ../admin/settings.php:681
2510
+ msgid "Show navigation bar"
2511
+ msgstr ""
2512
+
2513
+ #: ../admin/settings.php:685
2514
+ msgid "Show loading icon"
2515
+ msgstr ""
2516
+
2517
+ #: ../admin/settings.php:689
2518
+ msgid "Use watermark logo"
2519
+ msgstr ""
2520
+
2521
+ #: ../admin/settings.php:691
2522
+ msgid "You can change the logo at the watermark settings"
2523
+ msgstr ""
2524
+
2525
+ #: ../admin/settings.php:694
2526
+ msgid "Stretch image"
2527
+ msgstr ""
2528
+
2529
+ #: ../admin/settings.php:697
2530
+ msgid "true"
2531
+ msgstr ""
2532
+
2533
+ #: ../admin/settings.php:698
2534
+ msgid "false"
2535
+ msgstr ""
2536
+
2537
+ #: ../admin/settings.php:699
2538
+ msgid "fit"
2539
+ msgstr ""
2540
+
2541
+ #: ../admin/settings.php:700
2542
+ msgid "none"
2543
+ msgstr ""
2544
+
2545
+ #: ../admin/settings.php:709
2546
+ msgid "bgfade"
2547
+ msgstr ""
2548
+
2549
+ #: ../admin/settings.php:710
2550
+ msgid "slowfade"
2551
+ msgstr ""
2552
+
2553
+ #: ../admin/settings.php:711
2554
+ msgid "circles"
2555
+ msgstr ""
2556
+
2557
+ #: ../admin/settings.php:712
2558
+ msgid "bubbles"
2559
+ msgstr ""
2560
+
2561
+ #: ../admin/settings.php:713
2562
+ msgid "blocks"
2563
+ msgstr ""
2564
+
2565
+ #: ../admin/settings.php:714
2566
+ msgid "fluids"
2567
+ msgstr ""
2568
+
2569
+ #: ../admin/settings.php:715
2570
+ msgid "flash"
2571
+ msgstr ""
2572
+
2573
+ #: ../admin/settings.php:716
2574
+ msgid "lines"
2575
+ msgstr ""
2576
+
2577
+ #: ../admin/settings.php:717
2578
+ msgid "random"
2579
+ msgstr ""
2580
+
2581
+ #: ../admin/settings.php:722
2582
+ msgid "Use slow zooming effect"
2583
+ msgstr ""
2584
+
2585
+ #: ../admin/settings.php:726
2586
+ msgid "Background Color"
2587
+ msgstr ""
2588
+
2589
+ #: ../admin/settings.php:731
2590
+ msgid "Texts / Buttons Color"
2591
+ msgstr ""
2592
+
2593
+ #: ../admin/settings.php:736
2594
+ msgid "Rollover / Active Color"
2595
+ msgstr ""
2596
+
2597
+ #: ../admin/settings.php:741
2598
+ msgid "Screen Color"
2599
+ msgstr ""
2600
+
2601
+ #: ../admin/settings.php:746
2602
+ msgid "Background music (URL)"
2603
+ msgstr ""
2604
+
2605
+ #: ../admin/settings.php:750
2606
+ msgid "Try XHTML validation (with CDATA)"
2607
+ msgstr ""
2608
+
2609
+ #: ../admin/settings.php:752
2610
+ msgid "Important : Could causes problem at some browser. Please recheck your page."
2611
+ msgstr ""
2612
+
2613
+ #: ../admin/setup.php:15
2614
+ msgid "Reset all settings to default parameter"
2615
+ msgstr ""
2616
+
2617
+ #: ../admin/setup.php:26
2618
+ msgid "Uninstall sucessful ! Now delete the plugin and enjoy your life ! Good luck !"
2619
+ msgstr ""
2620
+
2621
+ #: ../admin/setup.php:30
2622
+ msgid "Reset options"
2623
+ msgstr ""
2624
+
2625
+ #: ../admin/setup.php:33
2626
+ msgid "Reset all options/settings to the default installation."
2627
+ msgstr ""
2628
+
2629
+ #: ../admin/setup.php:34
2630
+ msgid "Reset settings"
2631
+ msgstr ""
2632
+
2633
+ #: ../admin/setup.php:34
2634
+ msgid ""
2635
+ "Reset all options to default settings ?\\n"
2636
+ "\\n"
2637
+ "Choose [Cancel] to Stop, [OK] to proceed.\\n"
2638
+ msgstr ""
2639
+
2640
+ #: ../admin/setup.php:39
2641
+ msgid "Uninstall plugin tables"
2642
+ msgstr ""
2643
+
2644
+ #: ../admin/setup.php:44
2645
+ msgid "You don't like NextGEN Gallery ?"
2646
+ msgstr ""
2647
+
2648
+ #: ../admin/setup.php:45
2649
+ msgid "No problem, before you deactivate this plugin press the Uninstall Button, because deactivating NextGEN Gallery does not remove any data that may have been created. "
2650
+ msgstr ""
2651
+
2652
+ #: ../admin/setup.php:47
2653
+ msgid "WARNING:"
2654
+ msgstr ""
2655
+
2656
+ #: ../admin/setup.php:48
2657
+ msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to backup all the tables first. NextGEN gallery is stored in the tables"
2658
+ msgstr ""
2659
+
2660
+ #: ../admin/setup.php:48
2661
+ msgid "and"
2662
+ msgstr ""
2663
+
2664
+ #: ../admin/setup.php:50
2665
+ msgid "Uninstall plugin"
2666
+ msgstr ""
2667
+
2668
+ #: ../admin/setup.php:50
2669
+ msgid ""
2670
+ "You are about to Uninstall this plugin from WordPress.\\n"
2671
+ "This action is not reversible.\\n"
2672
+ "\\n"
2673
+ "Choose [Cancel] to Stop, [OK] to Uninstall.\\n"
2674
+ msgstr ""
2675
+
2676
+ #: ../admin/showmeta.php:29
2677
+ msgid "Meta Data"
2678
+ msgstr ""
2679
+
2680
+ #: ../admin/showmeta.php:34
2681
+ #: ../admin/showmeta.php:60
2682
+ #: ../admin/showmeta.php:85
2683
+ #: ../admin/showmeta.php:109
2684
+ msgid "Tag"
2685
+ msgstr ""
2686
+
2687
+ #: ../admin/showmeta.php:35
2688
+ #: ../admin/showmeta.php:61
2689
+ #: ../admin/showmeta.php:86
2690
+ #: ../admin/showmeta.php:110
2691
+ msgid "Value"
2692
+ msgstr ""
2693
+
2694
+ #: ../admin/showmeta.php:49
2695
+ msgid "No meta data saved"
2696
+ msgstr ""
2697
+
2698
+ #: ../admin/showmeta.php:55
2699
+ msgid "EXIF Data"
2700
+ msgstr ""
2701
+
2702
+ #: ../admin/showmeta.php:74
2703
+ msgid "No exif data"
2704
+ msgstr ""
2705
+
2706
+ #: ../admin/showmeta.php:81
2707
+ msgid "IPTC Data"
2708
+ msgstr ""
2709
+
2710
+ #: ../admin/showmeta.php:105
2711
+ msgid "XMP Data"
2712
+ msgstr ""
2713
+
2714
+ #: ../admin/style.php:11
2715
+ msgid "(From the theme folder)"
2716
+ msgstr ""
2717
+
2718
+ #: ../admin/style.php:43
2719
+ msgid "You do not have sufficient permissions to edit templates for this blog."
2720
+ msgstr ""
2721
+
2722
+ #: ../admin/style.php:52
2723
+ msgid "CSS file successfully updated"
2724
+ msgstr ""
2725
+
2726
+ #: ../admin/style.php:89
2727
+ msgid "Style Editor"
2728
+ msgstr ""
2729
+
2730
+ #: ../admin/style.php:93
2731
+ msgid "Activate and use style sheet:"
2732
+ msgstr ""
2733
+
2734
+ #: ../admin/style.php:113
2735
+ msgid "Activate"
2736
+ msgstr ""
2737
+
2738
+ #: ../admin/style.php:123
2739
+ #, php-format
2740
+ msgid "Editing <strong>%s</strong>"
2741
+ msgstr ""
2742
+
2743
+ #: ../admin/style.php:125
2744
+ #, php-format
2745
+ msgid "Browsing <strong>%s</strong>"
2746
+ msgstr ""
2747
+
2748
+ #: ../admin/style.php:135
2749
+ msgid "Version"
2750
+ msgstr ""
2751
+
2752
+ #: ../admin/style.php:138
2753
+ msgid "Tip : Copy your stylesheet (nggallery.css) to your theme folder, so it will be not lost during a upgrade"
2754
+ msgstr ""
2755
+
2756
+ #: ../admin/style.php:140
2757
+ msgid "Your theme contain a NextGEN Gallery stylesheet (nggallery.css), this file will be used"
2758
+ msgstr ""
2759
+
2760
+ #: ../admin/style.php:142
2761
+ msgid "Tip No. 2: Use the color picker below to help you find the right color scheme for your gallery!"
2762
+ msgstr ""
2763
+
2764
+ #: ../admin/style.php:158
2765
+ msgid "Update File"
2766
+ msgstr ""
2767
+
2768
+ #: ../admin/style.php:161
2769
+ msgid "If this file were writable you could edit it."
2770
+ msgstr ""
2771
+
2772
+ #: ../admin/style.php:166
2773
+ msgid "Oops, no such file exists! Double check the name and try again, merci."
2774
+ msgstr ""
2775
+
2776
+ #: ../admin/tags.php:38
2777
+ msgid "Most popular"
2778
+ msgstr ""
2779
+
2780
+ #: ../admin/tags.php:39
2781
+ msgid "Least used"
2782
+ msgstr ""
2783
+
2784
+ #: ../admin/tags.php:40
2785
+ msgid "Alphabetical"
2786
+ msgstr ""
2787
+
2788
+ #: ../admin/tags.php:96
2789
+ msgid "Manage image tags"
2790
+ msgstr ""
2791
+
2792
+ #: ../admin/tags.php:108
2793
+ msgid "Existing Tags"
2794
+ msgstr ""
2795
+
2796
+ #: ../admin/tags.php:112
2797
+ msgid "Search tags"
2798
+ msgstr ""
2799
+
2800
+ #: ../admin/tags.php:116
2801
+ msgid "Go"
2802
+ msgstr ""
2803
+
2804
+ #: ../admin/tags.php:121
2805
+ msgid "Sort Order:"
2806
+ msgstr ""
2807
+
2808
+ #: ../admin/tags.php:156
2809
+ #: ../admin/tags.php:160
2810
+ #: ../admin/tags.php:173
2811
+ msgid "Previous tags"
2812
+ msgstr ""
2813
+
2814
+ #: ../admin/tags.php:169
2815
+ msgid "Next tags"
2816
+ msgstr ""
2817
+
2818
+ #: ../admin/tags.php:181
2819
+ msgid "Rename Tag"
2820
+ msgstr ""
2821
+
2822
+ #: ../admin/tags.php:189
2823
+ msgid "Enter the tag to rename and its new value. You can use this feature to merge tags too. Click \"Rename\" and all posts which use this tag will be updated."
2824
+ msgstr ""
2825
+
2826
+ #: ../admin/tags.php:190
2827
+ #: ../admin/tags.php:238
2828
+ msgid "You can specify multiple tags to rename by separating them with commas."
2829
+ msgstr ""
2830
+
2831
+ #: ../admin/tags.php:194
2832
+ msgid "Tag(s) to rename:"
2833
+ msgstr ""
2834
+
2835
+ #: ../admin/tags.php:198
2836
+ msgid "New tag name(s):"
2837
+ msgstr ""
2838
+
2839
+ #: ../admin/tags.php:201
2840
+ msgid "Rename"
2841
+ msgstr ""
2842
+
2843
+ #: ../admin/tags.php:207
2844
+ msgid "Delete Tag"
2845
+ msgstr ""
2846
+
2847
+ #: ../admin/tags.php:215
2848
+ msgid "Enter the name of the tag to delete. This tag will be removed from all posts."
2849
+ msgstr ""
2850
+
2851
+ #: ../admin/tags.php:216
2852
+ msgid "You can specify multiple tags to delete by separating them with commas"
2853
+ msgstr ""
2854
+
2855
+ #: ../admin/tags.php:220
2856
+ msgid "Tag(s) to delete:"
2857
+ msgstr ""
2858
+
2859
+ #: ../admin/tags.php:229
2860
+ msgid "Edit Tag Slug"
2861
+ msgstr ""
2862
+
2863
+ #: ../admin/tags.php:237
2864
+ msgid "Enter the tag name to edit and its new slug. <a href=\"http://codex.wordpress.org/Glossary#Slug\">Slug definition</a>"
2865
+ msgstr ""
2866
+
2867
+ #: ../admin/tags.php:242
2868
+ msgid "Tag(s) to match:"
2869
+ msgstr ""
2870
+
2871
+ #: ../admin/tags.php:246
2872
+ msgid "Slug(s) to set:"
2873
+ msgstr ""
2874
+
2875
+ #: ../admin/upgrade.php:22
2876
+ msgid "Upgrade database structure..."
2877
+ msgstr ""
2878
+
2879
+ #: ../admin/upgrade.php:108
2880
+ #: ../admin/upgrade.php:119
2881
+ #: ../admin/upgrade.php:126
2882
+ #: ../admin/upgrade.php:137
2883
+ #: ../admin/upgrade.php:151
2884
+ msgid "finished"
2885
+ msgstr ""
2886
+
2887
+ #: ../admin/upgrade.php:117
2888
+ msgid "Update file structure..."
2889
+ msgstr ""
2890
+
2891
+ #: ../admin/upgrade.php:124
2892
+ msgid "Import date and time information..."
2893
+ msgstr ""
2894
+
2895
+ #: ../admin/upgrade.php:132
2896
+ msgid "Move imagerotator to new location..."
2897
+ msgstr ""
2898
+
2899
+ #: ../admin/upgrade.php:143
2900
+ msgid "Update settings..."
2901
+ msgstr ""
2902
+
2903
+ #: ../admin/upgrade.php:157
2904
+ msgid "Updated widget structure. If you used NextGEN Widgets, you need to setup them again..."
2905
+ msgstr ""
2906
+
2907
+ #: ../admin/upgrade.php:165
2908
+ #: ../admin/upgrade.php:187
2909
+ msgid "Updated options."
2910
+ msgstr ""
2911
+
2912
+ #: ../admin/upgrade.php:172
2913
+ msgid "Create unique slug"
2914
+ msgstr ""
2915
+
2916
+ #: ../admin/upgrade.php:173
2917
+ msgid "One of the upcomming features are a reworked permalinks structure."
2918
+ msgstr ""
2919
+
2920
+ #: ../admin/upgrade.php:174
2921
+ msgid "Therefore it's needed to have a unique identifier for each image, gallery and album."
2922
+ msgstr ""
2923
+
2924
+ #: ../admin/upgrade.php:175
2925
+ msgid "Depend on the amount of database entries this will take a while, don't reload this page."
2926
+ msgstr ""
2927
+
2928
+ #: ../admin/upgrade.php:195
2929
+ msgid "Could not find NextGEN Gallery database tables, upgrade failed !"
2930
+ msgstr ""
2931
+
2932
+ #: ../admin/upgrade.php:258
2933
+ msgid "Some folders/files could not renamed, please recheck the permission and rescan the folder in the manage gallery section."
2934
+ msgstr ""
2935
+
2936
+ #: ../admin/upgrade.php:260
2937
+ msgid "Rename failed"
2938
+ msgstr ""
2939
+
2940
+ #: ../admin/upgrade.php:356
2941
+ #: ../admin/upgrade.php:375
2942
+ msgid "Upgrade NextGEN Gallery"
2943
+ msgstr ""
2944
+
2945
+ #: ../admin/upgrade.php:357
2946
+ msgid "The script detect that you upgrade from a older version."
2947
+ msgstr ""
2948
+
2949
+ #: ../admin/upgrade.php:358
2950
+ msgid "Your database tables for NextGEN Gallery is out-of-date, and must be upgraded before you can continue."
2951
+ msgstr ""
2952
+
2953
+ #: ../admin/upgrade.php:359
2954
+ msgid "If you would like to downgrade later, please make first a complete backup of your database and the images."
2955
+ msgstr ""
2956
+
2957
+ #: ../admin/upgrade.php:360
2958
+ msgid "The upgrade process may take a while, so please be patient."
2959
+ msgstr ""
2960
+
2961
+ #: ../admin/upgrade.php:361
2962
+ msgid "Start upgrade now"
2963
+ msgstr ""
2964
+
2965
+ #: ../admin/upgrade.php:377
2966
+ msgid "Upgrade finished..."
2967
+ msgstr ""
2968
+
2969
+ #: ../admin/upgrade.php:378
2970
+ msgid "Continue"
2971
+ msgstr ""
2972
+
2973
+ #: ../admin/upgrade.php:401
2974
+ #, php-format
2975
+ msgid "Rebuild image structure : %s / %s images"
2976
+ msgstr ""
2977
+
2978
+ #: ../admin/upgrade.php:402
2979
+ #, php-format
2980
+ msgid "Rebuild gallery structure : %s / %s galleries"
2981
+ msgstr ""
2982
+
2983
+ #: ../admin/upgrade.php:403
2984
+ #, php-format
2985
+ msgid "Rebuild album structure : %s / %s albums"
2986
+ msgstr ""
2987
+
2988
+ #: ../admin/upgrade.php:460
2989
+ msgid "Done."
2990
+ msgstr ""
2991
+
2992
+ #: ../admin/wpmu.php:33
2993
+ msgid "Update successfully"
2994
+ msgstr ""
2995
+
2996
+ #: ../admin/wpmu.php:45
2997
+ #, php-format
2998
+ msgid "Thanks for using this plugin, NextGEN Gallery is initially developed for self hosted blogs. A multisite setup is possible, but cannot currently fully supported, as it can have several special condition ( i.e. Domain mapping).<br /> If you would like to support the further development, please consider a <strong><a href=\"%s\">donation</a></strong>! If you still need some help, please post your questions <a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\">here</a> ."
2999
+ msgstr ""
3000
+
3001
+ #: ../admin/wpmu.php:62
3002
+ msgid "Network Options"
3003
+ msgstr ""
3004
+
3005
+ #: ../admin/wpmu.php:70
3006
+ msgid "This is the default path for all blogs. With the placeholder %BLOG_ID% you can organize the folder structure better."
3007
+ msgstr ""
3008
+
3009
+ #: ../admin/wpmu.php:71
3010
+ #, php-format
3011
+ msgid "The default setting should be %s"
3012
+ msgstr ""
3013
+
3014
+ #: ../admin/wpmu.php:75
3015
+ msgid "Enable upload quota check"
3016
+ msgstr ""
3017
+
3018
+ #: ../admin/wpmu.php:77
3019
+ msgid "Should work if the gallery is bellow the blog.dir"
3020
+ msgstr ""
3021
+
3022
+ #: ../admin/wpmu.php:81
3023
+ msgid "Enable zip upload option"
3024
+ msgstr ""
3025
+
3026
+ #: ../admin/wpmu.php:83
3027
+ msgid "Allow users to upload zip folders."
3028
+ msgstr ""
3029
+
3030
+ #: ../admin/wpmu.php:87
3031
+ msgid "Enable import function"
3032
+ msgstr ""
3033
+
3034
+ #: ../admin/wpmu.php:89
3035
+ msgid "Allow users to import images folders from the server."
3036
+ msgstr ""
3037
+
3038
+ #: ../admin/wpmu.php:93
3039
+ msgid "Enable style selection"
3040
+ msgstr ""
3041
+
3042
+ #: ../admin/wpmu.php:95
3043
+ msgid "Allow users to choose a style for the gallery."
3044
+ msgstr ""
3045
+
3046
+ #: ../admin/wpmu.php:99
3047
+ msgid "Enable roles/capabilities"
3048
+ msgstr ""
3049
+
3050
+ #: ../admin/wpmu.php:101
3051
+ msgid "Allow users to change the roles for other blog authors."
3052
+ msgstr ""
3053
+
3054
+ #: ../admin/wpmu.php:105
3055
+ msgid "Default style"
3056
+ msgstr ""
3057
+
3058
+ #: ../admin/wpmu.php:122
3059
+ msgid "Choose the default style for the galleries."
3060
+ msgstr ""
3061
+
3062
+ #: ../admin/tinymce/window.php:56
3063
+ msgid "Select or enter gallery"
3064
+ msgstr ""
3065
+
3066
+ #: ../admin/tinymce/window.php:61
3067
+ #: ../admin/tinymce/window.php:82
3068
+ msgid "Show as"
3069
+ msgstr ""
3070
+
3071
+ #: ../admin/tinymce/window.php:62
3072
+ msgid "Image list"
3073
+ msgstr ""
3074
+
3075
+ #: ../admin/tinymce/window.php:64
3076
+ msgid "Imagebrowser"
3077
+ msgstr ""
3078
+
3079
+ #: ../admin/tinymce/window.php:77
3080
+ msgid "Select or enter album"
3081
+ msgstr ""
3082
+
3083
+ #: ../admin/tinymce/window.php:83
3084
+ msgid "Extended version"
3085
+ msgstr ""
3086
+
3087
+ #: ../admin/tinymce/window.php:84
3088
+ msgid "Compact version"
3089
+ msgstr ""
3090
+
3091
+ #: ../admin/tinymce/window.php:97
3092
+ msgid "Select or enter picture"
3093
+ msgstr ""
3094
+
3095
+ #: ../admin/tinymce/window.php:102
3096
+ msgid "Width x Height"
3097
+ msgstr ""
3098
+
3099
+ #: ../admin/tinymce/window.php:106
3100
+ msgid "Effect"
3101
+ msgstr ""
3102
+
3103
+ #: ../admin/tinymce/window.php:109
3104
+ msgid "No effect"
3105
+ msgstr ""
3106
+
3107
+ #: ../admin/tinymce/window.php:111
3108
+ msgid "Web 2.0"
3109
+ msgstr ""
3110
+
3111
+ #: ../admin/tinymce/window.php:116
3112
+ msgid "Float"
3113
+ msgstr ""
3114
+
3115
+ #: ../admin/tinymce/window.php:119
3116
+ msgid "No float"
3117
+ msgstr ""
3118
+
3119
+ #: ../admin/tinymce/window.php:138
3120
+ msgid "Insert"
3121
+ msgstr ""
3122
+
3123
+ #: ../lib/core.php:407
3124
+ #, php-format
3125
+ msgid "Note : Based on your server memory limit you should not upload larger images then <strong>%d x %d</strong> pixel"
3126
+ msgstr ""
3127
+
3128
+ #: ../lib/locale.php:120
3129
+ msgid "Invalid URL Provided."
3130
+ msgstr ""
3131
+
3132
+ #: ../lib/locale.php:124
3133
+ #: ../lib/locale.php:128
3134
+ msgid "Could not create Temporary file."
3135
+ msgstr ""
3136
+
3137
+ #: ../lib/meta.php:124
3138
+ msgid " mm"
3139
+ msgstr ""
3140
+
3141
+ #: ../lib/meta.php:130
3142
+ msgid " sec"
3143
+ msgstr ""
3144
+
3145
+ #: ../lib/meta.php:134
3146
+ msgid "Fired"
3147
+ msgstr ""
3148
+
3149
+ #: ../lib/meta.php:134
3150
+ msgid "Not fired"
3151
+ msgstr ""
3152
+
3153
+ #: ../lib/meta.php:430
3154
+ msgid "Aperture"
3155
+ msgstr ""
3156
+
3157
+ #: ../lib/meta.php:431
3158
+ #: ../lib/meta.php:456
3159
+ msgid "Credit"
3160
+ msgstr ""
3161
+
3162
+ #: ../lib/meta.php:432
3163
+ msgid "Camera"
3164
+ msgstr ""
3165
+
3166
+ #: ../lib/meta.php:433
3167
+ msgid "Caption"
3168
+ msgstr ""
3169
+
3170
+ #: ../lib/meta.php:435
3171
+ msgid "Copyright"
3172
+ msgstr ""
3173
+
3174
+ #: ../lib/meta.php:436
3175
+ msgid "Focal length"
3176
+ msgstr ""
3177
+
3178
+ #: ../lib/meta.php:437
3179
+ msgid "ISO"
3180
+ msgstr ""
3181
+
3182
+ #: ../lib/meta.php:438
3183
+ msgid "Shutter speed"
3184
+ msgstr ""
3185
+
3186
+ #: ../lib/meta.php:442
3187
+ msgid "Subject"
3188
+ msgstr ""
3189
+
3190
+ #: ../lib/meta.php:443
3191
+ msgid "Make"
3192
+ msgstr ""
3193
+
3194
+ #: ../lib/meta.php:444
3195
+ msgid "Edit Status"
3196
+ msgstr ""
3197
+
3198
+ #: ../lib/meta.php:445
3199
+ msgid "Category"
3200
+ msgstr ""
3201
+
3202
+ #: ../lib/meta.php:446
3203
+ msgid "Keywords"
3204
+ msgstr ""
3205
+
3206
+ #: ../lib/meta.php:447
3207
+ msgid "Date Created"
3208
+ msgstr ""
3209
+
3210
+ #: ../lib/meta.php:448
3211
+ msgid "Time Created"
3212
+ msgstr ""
3213
+
3214
+ #: ../lib/meta.php:449
3215
+ msgid "Author Position"
3216
+ msgstr ""
3217
+
3218
+ #: ../lib/meta.php:450
3219
+ msgid "City"
3220
+ msgstr ""
3221
+
3222
+ #: ../lib/meta.php:451
3223
+ msgid "Location"
3224
+ msgstr ""
3225
+
3226
+ #: ../lib/meta.php:452
3227
+ msgid "Province/State"
3228
+ msgstr ""
3229
+
3230
+ #: ../lib/meta.php:453
3231
+ msgid "Country code"
3232
+ msgstr ""
3233
+
3234
+ #: ../lib/meta.php:454
3235
+ msgid "Country"
3236
+ msgstr ""
3237
+
3238
+ #: ../lib/meta.php:455
3239
+ msgid "Headline"
3240
+ msgstr ""
3241
+
3242
+ #: ../lib/meta.php:457
3243
+ msgid "Source"
3244
+ msgstr ""
3245
+
3246
+ #: ../lib/meta.php:458
3247
+ msgid "Copyright Notice"
3248
+ msgstr ""
3249
+
3250
+ #: ../lib/meta.php:459
3251
+ msgid "Contact"
3252
+ msgstr ""
3253
+
3254
+ #: ../lib/meta.php:460
3255
+ msgid "Last modified"
3256
+ msgstr ""
3257
+
3258
+ #: ../lib/meta.php:461
3259
+ msgid "Program tool"
3260
+ msgstr ""
3261
+
3262
+ #: ../lib/meta.php:462
3263
+ msgid "Format"
3264
+ msgstr ""
3265
+
3266
+ #: ../lib/meta.php:463
3267
+ msgid "Image Width"
3268
+ msgstr ""
3269
+
3270
+ #: ../lib/meta.php:464
3271
+ msgid "Image Height"
3272
+ msgstr ""
3273
+
3274
+ #: ../lib/meta.php:465
3275
+ msgid "Flash"
3276
+ msgstr ""
3277
+
3278
+ #: ../lib/multisite.php:23
3279
+ msgid "Sorry, you have used your space allocation. Please delete some files to upload more files."
3280
+ msgstr ""
3281
+
3282
+ #: ../lib/ngg-db.php:331
3283
+ #: ../lib/ngg-db.php:332
3284
+ msgid "Album overview"
3285
+ msgstr ""
3286
+
3287
+ #: ../lib/shortcodes.php:311
3288
+ msgid "[Pictures not found]"
3289
+ msgstr ""
3290
+
3291
+ #: ../lib/tags.php:35
3292
+ msgid "No new tag specified!"
3293
+ msgstr ""
3294
+
3295
+ #: ../lib/tags.php:50
3296
+ msgid "No new/old valid tag specified!"
3297
+ msgstr ""
3298
+
3299
+ #: ../lib/tags.php:86
3300
+ msgid "No tag renamed."
3301
+ msgstr ""
3302
+
3303
+ #: ../lib/tags.php:88
3304
+ #, php-format
3305
+ msgid "Renamed tag(s) &laquo;%1$s&raquo; to &laquo;%2$s&raquo;"
3306
+ msgstr ""
3307
+
3308
+ #: ../lib/tags.php:95
3309
+ msgid "No valid new tag."
3310
+ msgstr ""
3311
+
3312
+ #: ../lib/tags.php:112
3313
+ msgid "No objects (post/page) found for specified old tags."
3314
+ msgstr ""
3315
+
3316
+ #: ../lib/tags.php:141
3317
+ msgid "No tag merged."
3318
+ msgstr ""
3319
+
3320
+ #: ../lib/tags.php:143
3321
+ #, php-format
3322
+ msgid "Merge tag(s) &laquo;%1$s&raquo; to &laquo;%2$s&raquo;. %3$s objects edited."
3323
+ msgstr ""
3324
+
3325
+ #: ../lib/tags.php:146
3326
+ msgid "Error. No enough tags for rename. Too for merge. Choose !"
3327
+ msgstr ""
3328
+
3329
+ #: ../lib/tags.php:163
3330
+ msgid "No tag specified!"
3331
+ msgstr ""
3332
+
3333
+ #: ../lib/tags.php:186
3334
+ msgid "No tag deleted."
3335
+ msgstr ""
3336
+
3337
+ #: ../lib/tags.php:188
3338
+ #, php-format
3339
+ msgid "%1s tag(s) deleted."
3340
+ msgstr ""
3341
+
3342
+ #: ../lib/tags.php:202
3343
+ msgid "No new slug(s) specified!"
3344
+ msgstr ""
3345
+
3346
+ #: ../lib/tags.php:214
3347
+ msgid "Tags number and slugs number isn't the same!"
3348
+ msgstr ""
3349
+
3350
+ #: ../lib/tags.php:241
3351
+ msgid "No slug edited."
3352
+ msgstr ""
3353
+
3354
+ #: ../lib/tags.php:243
3355
+ #, php-format
3356
+ msgid "%s slug(s) edited."
3357
+ msgstr ""
3358
+
3359
+ #: ../lib/xmlrpc.php:66
3360
+ #, php-format
3361
+ msgid "XML-RPC services are disabled on this blog. An admin user can enable them at %s"
3362
+ msgstr ""
3363
+
3364
+ #: ../lib/xmlrpc.php:73
3365
+ msgid "Bad login/pass combination."
3366
+ msgstr ""
3367
+
3368
+ #: ../lib/xmlrpc.php:129
3369
+ msgid "You are not allowed to upload files to this site."
3370
+ msgstr ""
3371
+
3372
+ #: ../lib/xmlrpc.php:135
3373
+ #: ../lib/xmlrpc.php:680
3374
+ msgid "Could not find gallery "
3375
+ msgstr ""
3376
+
3377
+ #: ../lib/xmlrpc.php:140
3378
+ #: ../lib/xmlrpc.php:685
3379
+ msgid "You are not allowed to upload files to this gallery."
3380
+ msgstr ""
3381
+
3382
+ #: ../lib/xmlrpc.php:152
3383
+ msgid "This is no valid image file."
3384
+ msgstr ""
3385
+
3386
+ #: ../lib/xmlrpc.php:164
3387
+ msgid "Could not find image id "
3388
+ msgstr ""
3389
+
3390
+ #: ../lib/xmlrpc.php:171
3391
+ #, php-format
3392
+ msgid "Failed to delete image %1$s "
3393
+ msgstr ""
3394
+
3395
+ #: ../lib/xmlrpc.php:180
3396
+ #, php-format
3397
+ msgid "Could not write file %1$s (%2$s)"
3398
+ msgstr ""
3399
+
3400
+ #: ../lib/xmlrpc.php:247
3401
+ #: ../lib/xmlrpc.php:299
3402
+ msgid "Invalid image ID"
3403
+ msgstr ""
3404
+
3405
+ #: ../lib/xmlrpc.php:250
3406
+ #: ../lib/xmlrpc.php:302
3407
+ msgid "Sorry, you must be able to edit this image"
3408
+ msgstr ""
3409
+
3410
+ #: ../lib/xmlrpc.php:308
3411
+ msgid "Sorry, could not update the image"
3412
+ msgstr ""
3413
+
3414
+ #: ../lib/xmlrpc.php:344
3415
+ #: ../lib/xmlrpc.php:576
3416
+ #: ../lib/xmlrpc.php:642
3417
+ msgid "Sorry, you must be able to manage galleries"
3418
+ msgstr ""
3419
+
3420
+ #: ../lib/xmlrpc.php:350
3421
+ msgid "Sorry, could not create the gallery"
3422
+ msgstr ""
3423
+
3424
+ #: ../lib/xmlrpc.php:393
3425
+ #: ../lib/xmlrpc.php:573
3426
+ msgid "Invalid gallery ID"
3427
+ msgstr ""
3428
+
3429
+ #: ../lib/xmlrpc.php:396
3430
+ msgid "Sorry, you must be able to manage this gallery"
3431
+ msgstr ""
3432
+
3433
+ #: ../lib/xmlrpc.php:402
3434
+ msgid "Sorry, could not update the gallery"
3435
+ msgstr ""
3436
+
3437
+ #: ../lib/xmlrpc.php:442
3438
+ #: ../lib/xmlrpc.php:494
3439
+ #: ../lib/xmlrpc.php:536
3440
+ #: ../lib/xmlrpc.php:609
3441
+ msgid "Sorry, you must be able to manage albums"
3442
+ msgstr ""
3443
+
3444
+ #: ../lib/xmlrpc.php:448
3445
+ msgid "Sorry, could not create the album"
3446
+ msgstr ""
3447
+
3448
+ #: ../lib/xmlrpc.php:491
3449
+ #: ../lib/xmlrpc.php:533
3450
+ msgid "Invalid album ID"
3451
+ msgstr ""
3452
+
3453
+ #: ../lib/xmlrpc.php:500
3454
+ msgid "Sorry, could not update the album"
3455
+ msgstr ""
3456
+
3457
+ #: ../view/album-compact.php:32
3458
+ #: ../view/album-extend.php:30
3459
+ msgid "Photos"
3460
+ msgstr ""
3461
+
3462
+ #: ../view/gallery-caption.php:32
3463
+ #: ../view/gallery.php:32
3464
+ #: ../widgets/media-rss-widget.php:122
3465
+ msgid "[View with PicLens]"
3466
+ msgstr ""
3467
+
3468
+ #: ../view/imagebrowser-caption.php:26
3469
+ #: ../view/imagebrowser-exif.php:30
3470
+ #: ../view/imagebrowser.php:26
3471
+ msgid "Back"
3472
+ msgstr ""
3473
+
3474
+ #: ../view/imagebrowser-caption.php:29
3475
+ #: ../view/imagebrowser-exif.php:33
3476
+ #: ../view/imagebrowser.php:29
3477
+ msgid "Next"
3478
+ msgstr ""
3479
+
3480
+ #: ../view/imagebrowser-caption.php:31
3481
+ #: ../view/imagebrowser-exif.php:35
3482
+ #: ../view/imagebrowser.php:31
3483
+ msgid "of"
3484
+ msgstr ""
3485
+
3486
+ #: ../view/imagebrowser-exif.php:38
3487
+ msgid "Meta data"
3488
+ msgstr ""
3489
+
3490
+ #: ../view/imagebrowser-exif.php:42
3491
+ msgid "Camera / Type"
3492
+ msgstr ""
3493
+
3494
+ #: ../view/imagebrowser-exif.php:50
3495
+ msgid "Focal Length"
3496
+ msgstr ""
3497
+
3498
+ #: ../widgets/media-rss-widget.php:19
3499
+ msgid "Widget that displays Media RSS links for NextGEN Gallery."
3500
+ msgstr ""
3501
+
3502
+ #: ../widgets/media-rss-widget.php:20
3503
+ msgid "NextGEN Media RSS"
3504
+ msgstr ""
3505
+
3506
+ #: ../widgets/media-rss-widget.php:68
3507
+ msgid "Media RSS"
3508
+ msgstr ""
3509
+
3510
+ #: ../widgets/media-rss-widget.php:69
3511
+ msgid "Link to the main image feed"
3512
+ msgstr ""
3513
+
3514
+ #: ../widgets/media-rss-widget.php:79
3515
+ #: ../widgets/widgets.php:201
3516
+ msgid "Title :"
3517
+ msgstr ""
3518
+
3519
+ #: ../widgets/media-rss-widget.php:87
3520
+ msgid "Show Media RSS icon"
3521
+ msgstr ""
3522
+
3523
+ #: ../widgets/media-rss-widget.php:93
3524
+ msgid "Show the Media RSS link"
3525
+ msgstr ""
3526
+
3527
+ #: ../widgets/media-rss-widget.php:98
3528
+ msgid "Text for Media RSS link:"
3529
+ msgstr ""
3530
+
3531
+ #: ../widgets/media-rss-widget.php:104
3532
+ msgid "Tooltip text for Media RSS link:"
3533
+ msgstr ""
3534
+
3535
+ #: ../widgets/widgets.php:22
3536
+ msgid "Show a NextGEN Gallery Slideshow"
3537
+ msgstr ""
3538
+
3539
+ #: ../widgets/widgets.php:23
3540
+ msgid "NextGEN Slideshow"
3541
+ msgstr ""
3542
+
3543
+ #: ../widgets/widgets.php:64
3544
+ msgid "<a href=\"http://www.macromedia.com/go/getflashplayer\">Get the Flash Player</a> to see the slideshow."
3545
+ msgstr ""
3546
+
3547
+ #: ../widgets/widgets.php:121
3548
+ msgid "Title:"
3549
+ msgstr ""
3550
+
3551
+ #: ../widgets/widgets.php:123
3552
+ msgid "Select Gallery:"
3553
+ msgstr ""
3554
+
3555
+ #: ../widgets/widgets.php:125
3556
+ msgid "All images"
3557
+ msgstr ""
3558
+
3559
+ #: ../widgets/widgets.php:137
3560
+ msgid "Height:"
3561
+ msgstr ""
3562
+
3563
+ #: ../widgets/widgets.php:138
3564
+ msgid "Width:"
3565
+ msgstr ""
3566
+
3567
+ #: ../widgets/widgets.php:160
3568
+ msgid "Add recent or random images from the galleries"
3569
+ msgstr ""
3570
+
3571
+ #: ../widgets/widgets.php:161
3572
+ msgid "NextGEN Widget"
3573
+ msgstr ""
3574
+
3575
+ #: ../widgets/widgets.php:207
3576
+ msgid "Show :"
3577
+ msgstr ""
3578
+
3579
+ #: ../widgets/widgets.php:213
3580
+ msgid "Original images"
3581
+ msgstr ""
3582
+
3583
+ #: ../widgets/widgets.php:222
3584
+ msgid "recent added "
3585
+ msgstr ""
3586
+
3587
+ #: ../widgets/widgets.php:228
3588
+ msgid "Enable IE8 Web Slices"
3589
+ msgstr ""
3590
+
3591
+ #: ../widgets/widgets.php:233
3592
+ msgid "Width x Height :"
3593
+ msgstr ""
3594
+
3595
+ #: ../widgets/widgets.php:239
3596
+ msgid "Select :"
3597
+ msgstr ""
3598
+
3599
+ #: ../widgets/widgets.php:241
3600
+ msgid "All galleries"
3601
+ msgstr ""
3602
+
3603
+ #: ../widgets/widgets.php:242
3604
+ msgid "Only which are not listed"
3605
+ msgstr ""
3606
+
3607
+ #: ../widgets/widgets.php:243
3608
+ msgid "Only which are listed"
3609
+ msgstr ""
3610
+
3611
+ #: ../widgets/widgets.php:249
3612
+ msgid "Gallery ID :"
3613
+ msgstr ""
3614
+
3615
+ #: ../widgets/widgets.php:251
3616
+ msgid "Gallery IDs, separated by commas."
3617
+ msgstr ""
3618
+
3619
+ #: ../xml/media-rss.php:50
3620
+ msgid "No galleries have been yet created."
3621
+ msgstr ""
3622
+
3623
+ #: ../xml/media-rss.php:69
3624
+ #, php-format
3625
+ msgid "The gallery ID=%s does not exist."
3626
+ msgstr ""
3627
+
3628
+ #: ../xml/media-rss.php:100
3629
+ msgid "No album ID has been provided as parameter"
3630
+ msgstr ""
3631
+
3632
+ #: ../xml/media-rss.php:108
3633
+ #, php-format
3634
+ msgid "The album ID=%s does not exist."
3635
+ msgstr ""
3636
+
3637
+ #: ../xml/media-rss.php:115
3638
+ msgid "Invalid MediaRSS command"
3639
+ msgstr ""
3640
+
lib/core.php ADDED
@@ -0,0 +1,591 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Main PHP class for the WordPress plugin NextGEN Gallery
4
+ *
5
+ * @author Alex Rabe
6
+ *
7
+ *
8
+ */
9
+ class nggGallery {
10
+
11
+ /**
12
+ * Show a error messages
13
+ */
14
+ static function show_error($message) {
15
+ echo '<div class="wrap"><h2></h2><div class="error" id="error"><p>' . $message . '</p></div></div>' . "\n";
16
+ }
17
+
18
+ /**
19
+ * Show a system messages
20
+ */
21
+ static function show_message($message) {
22
+ echo '<div class="wrap"><h2></h2><div class="updated fade" id="message"><p>' . $message . '</p></div></div>' . "\n";
23
+ }
24
+
25
+ /**
26
+ * get the thumbnail url to the image
27
+ */
28
+ static function get_thumbnail_url($imageID, $picturepath = '', $fileName = ''){
29
+
30
+ // get the complete url to the thumbnail
31
+ global $wpdb;
32
+
33
+ // safety first
34
+ $imageID = (int) $imageID;
35
+
36
+ // get gallery values
37
+ if ( empty($fileName) ) {
38
+ list($fileName, $picturepath ) = $wpdb->get_row("SELECT p.filename, g.path FROM $wpdb->nggpictures AS p INNER JOIN $wpdb->nggallery AS g ON (p.galleryid = g.gid) WHERE p.pid = '$imageID' ", ARRAY_N);
39
+ }
40
+
41
+ if ( empty($picturepath) ) {
42
+ $picturepath = $wpdb->get_var("SELECT g.path FROM $wpdb->nggpictures AS p INNER JOIN $wpdb->nggallery AS g ON (p.galleryid = g.gid) WHERE p.pid = '$imageID' ");
43
+ }
44
+
45
+ // set gallery url
46
+ $folder_url = site_url() . '/' . $picturepath.nggGallery::get_thumbnail_folder($picturepath, FALSE);
47
+ $thumbnailURL = $folder_url . 'thumbs_' . $fileName;
48
+
49
+ return $thumbnailURL;
50
+ }
51
+
52
+ /**
53
+ * get the complete url to the image
54
+ */
55
+ static function get_image_url($imageID, $picturepath = '', $fileName = '') {
56
+ global $wpdb;
57
+
58
+ // safety first
59
+ $imageID = (int) $imageID;
60
+
61
+ // get gallery values
62
+ if (empty($fileName)) {
63
+ list($fileName, $picturepath ) = $wpdb->get_row("SELECT p.filename, g.path FROM $wpdb->nggpictures AS p INNER JOIN $wpdb->nggallery AS g ON (p.galleryid = g.gid) WHERE p.pid = '$imageID' ", ARRAY_N);
64
+ }
65
+
66
+ if (empty($picturepath)) {
67
+ $picturepath = $wpdb->get_var("SELECT g.path FROM $wpdb->nggpictures AS p INNER JOIN $wpdb->nggallery AS g ON (p.galleryid = g.gid) WHERE p.pid = '$imageID' ");
68
+ }
69
+
70
+ // set gallery url
71
+ $imageURL = site_url() . '/' . $picturepath . '/' . $fileName;
72
+
73
+ return $imageURL;
74
+ }
75
+
76
+ /**
77
+ * nggGallery::get_thumbnail_folder()
78
+ *
79
+ * @param mixed $gallerypath
80
+ * @param bool $include_Abspath
81
+ * @return string $foldername
82
+ */
83
+ static function create_thumbnail_folder($gallerypath, $include_Abspath = TRUE) {
84
+ if (!$include_Abspath) {
85
+ $gallerypath = WINABSPATH . $gallerypath;
86
+ }
87
+
88
+ if (!file_exists($gallerypath)) {
89
+ return FALSE;
90
+ }
91
+
92
+ if (is_dir($gallerypath . '/thumbs/')) {
93
+ return '/thumbs/';
94
+ }
95
+
96
+ if (is_admin()) {
97
+ if (!is_dir($gallerypath . '/thumbs/')) {
98
+ if ( !wp_mkdir_p($gallerypath . '/thumbs/') ) {
99
+ if (SAFE_MODE) {
100
+ nggAdmin::check_safemode($gallerypath . '/thumbs/');
101
+ } else {
102
+ nggGallery::show_error(__('Unable to create directory ', 'nggallery') . $gallerypath . '/thumbs !');
103
+ }
104
+ return FALSE;
105
+ }
106
+ return '/thumbs/';
107
+ }
108
+ }
109
+
110
+ return FALSE;
111
+
112
+ }
113
+
114
+ /**
115
+ * nggGallery::get_thumbnail_folder()
116
+ *
117
+ * @param mixed $gallerypath
118
+ * @param bool $include_Abspath
119
+ * @deprecated use create_thumbnail_folder() if needed;
120
+ * @return string $foldername
121
+ */
122
+ static function get_thumbnail_folder($gallerypath, $include_Abspath = TRUE) {
123
+ return nggGallery::create_thumbnail_folder($gallerypath, $include_Abspath);
124
+ }
125
+
126
+ /**
127
+ * nggGallery::get_thumbnail_prefix() - obsolete
128
+ *
129
+ * @param string $gallerypath
130
+ * @param bool $include_Abspath
131
+ * @deprecated prefix is now fixed to "thumbs_";
132
+ * @return string "thumbs_";
133
+ */
134
+ static function get_thumbnail_prefix($gallerypath, $include_Abspath = TRUE) {
135
+ return 'thumbs_';
136
+ }
137
+
138
+ /**
139
+ * nggGallery::get_option() - get the options and overwrite them with custom meta settings
140
+ *
141
+ * @param string $key
142
+ * @return array $options
143
+ */
144
+ static function get_option($key) {
145
+ global $post;
146
+
147
+ // get first the options from the database
148
+ $options = get_option($key);
149
+
150
+ if ( $post == null )
151
+ return $options;
152
+
153
+ // Get all key/value data for the current post.
154
+ $meta_array = get_post_custom();
155
+
156
+ // Ensure that this is a array
157
+ if ( !is_array($meta_array) )
158
+ $meta_array = array($meta_array);
159
+
160
+ // assign meta key to db setting key
161
+ $meta_tags = array(
162
+ 'string' => array(
163
+ 'ngg_gal_ShowOrder' => 'galShowOrder',
164
+ 'ngg_gal_Sort' => 'galSort',
165
+ 'ngg_gal_SortDirection' => 'galSortDir',
166
+ 'ngg_gal_ShowDescription' => 'galShowDesc',
167
+ 'ngg_ir_Audio' => 'irAudio',
168
+ 'ngg_ir_Overstretch' => 'irOverstretch',
169
+ 'ngg_ir_Transition' => 'irTransition',
170
+ 'ngg_ir_Backcolor' => 'irBackcolor',
171
+ 'ngg_ir_Frontcolor' => 'irFrontcolor',
172
+ 'ngg_ir_Lightcolor' => 'irLightcolor',
173
+ 'ngg_slideshowFX' => 'slideFx',
174
+ ),
175
+
176
+ 'int' => array(
177
+ 'ngg_gal_Images' => 'galImages',
178
+ 'ngg_gal_Columns' => 'galColumns',
179
+ 'ngg_paged_Galleries' => 'galPagedGalleries',
180
+ 'ngg_ir_Width' => 'irWidth',
181
+ 'ngg_ir_Height' => 'irHeight',
182
+ 'ngg_ir_Rotatetime' => 'irRotatetime'
183
+ ),
184
+
185
+ 'bool' => array(
186
+ 'ngg_gal_ShowSlide' => 'galShowSlide',
187
+ 'ngg_gal_ShowPiclense' => 'usePicLens',
188
+ 'ngg_gal_ImageBrowser' => 'galImgBrowser',
189
+ 'ngg_gal_HideImages' => 'galHiddenImg',
190
+ 'ngg_ir_Shuffle' => 'irShuffle',
191
+ 'ngg_ir_LinkFromDisplay' => 'irLinkfromdisplay',
192
+ 'ngg_ir_ShowNavigation' => 'irShownavigation',
193
+ 'ngg_ir_ShowWatermark' => 'irWatermark',
194
+ 'ngg_ir_Kenburns' => 'irKenburns'
195
+ )
196
+ );
197
+
198
+ foreach ($meta_tags as $typ => $meta_keys){
199
+ foreach ($meta_keys as $key => $db_value){
200
+ // if the kex exist overwrite it with the custom field
201
+ if (array_key_exists($key, $meta_array)){
202
+ switch ($typ) {
203
+ case 'string':
204
+ $options[$db_value] = (string) esc_attr($meta_array[$key][0]);
205
+ break;
206
+ case 'int':
207
+ $options[$db_value] = (int) $meta_array[$key][0];
208
+ break;
209
+ case 'bool':
210
+ $options[$db_value] = (bool) $meta_array[$key][0];
211
+ break;
212
+ }
213
+ }
214
+ }
215
+ }
216
+
217
+ return $options;
218
+ }
219
+
220
+ /**
221
+ * nggGallery::scale_image() - Scale down a image
222
+ *
223
+ * @param mixed $location (filename)
224
+ * @param int $maxw - max width
225
+ * @param int $maxh - max height
226
+ * @return array (width, heigth)
227
+ */
228
+ static function scale_image($location, $maxw = 0, $maxh = 0){
229
+ $img = @getimagesize($location);
230
+ if ($img){
231
+ $w = $img[0];
232
+ $h = $img[1];
233
+
234
+ $dim = array('w','h');
235
+ foreach($dim AS $val) {
236
+ $max = "max{$val}";
237
+ if(${$val} > ${$max} && ${$max}){
238
+ $alt = ($val == 'w') ? 'h' : 'w';
239
+ $ratio = ${$alt} / ${$val};
240
+ ${$val} = ${$max};
241
+ ${$alt} = ${$val} * $ratio;
242
+ }
243
+ }
244
+
245
+ return array( $w, $h );
246
+ }
247
+ return false;
248
+ }
249
+
250
+ /**
251
+ * Renders a section of user display code. The code is first checked for in the current theme display directory
252
+ * before defaulting to the plugin
253
+ * Call the function : nggGallery::render ('template_name', array ('var1' => $var1, 'var2' => $var2));
254
+ *
255
+ * @autor John Godley
256
+ * @param string $template_name Name of the template file (without extension)
257
+ * @param string $vars Array of variable name=>value that is available to the display code (optional)
258
+ * @param bool $callback In case we check we didn't find template we tested it one time more (optional)
259
+ * @return void
260
+ **/
261
+ static function render($template_name, $vars = array (), $callback = false) {
262
+ foreach ($vars AS $key => $val) {
263
+ $$key = $val;
264
+ }
265
+
266
+ // hook into the render feature to allow other plugins to include templates
267
+ $custom_template = apply_filters( 'ngg_render_template', false, $template_name );
268
+
269
+ if ( ( $custom_template != false ) && file_exists ($custom_template) ) {
270
+ include ( $custom_template );
271
+ } else if (file_exists (STYLESHEETPATH . "/nggallery/$template_name.php")) {
272
+ include (STYLESHEETPATH . "/nggallery/$template_name.php");
273
+ } else if (file_exists (NGGALLERY_ABSPATH . "/view/$template_name.php")) {
274
+ include (NGGALLERY_ABSPATH . "/view/$template_name.php");
275
+ } else if ( $callback === true ) {
276
+ echo "<p>Rendering of template $template_name.php failed</p>";
277
+ } else {
278
+ //test without the "-template" name one time more
279
+ $template_name = array_shift( explode('-', $template_name , 2) );
280
+ nggGallery::render ($template_name, $vars , true);
281
+ }
282
+ }
283
+
284
+ /**
285
+ * Captures an section of user display code.
286
+ *
287
+ * @autor John Godley
288
+ * @param string $template_name Name of the template file (without extension)
289
+ * @param string $vars Array of variable name=>value that is available to the display code (optional)
290
+ * @return void
291
+ **/
292
+ static function capture ($template_name, $vars = array ()) {
293
+ ob_start ();
294
+ nggGallery::render ($template_name, $vars);
295
+ $output = ob_get_contents ();
296
+ ob_end_clean ();
297
+
298
+ return $output;
299
+ }
300
+
301
+ /**
302
+ * nggGallery::graphic_library() - switch between GD and ImageMagick
303
+ *
304
+ * @return path to the selected library
305
+ */
306
+ static function graphic_library() {
307
+
308
+ $ngg_options = get_option('ngg_options');
309
+
310
+ if ( $ngg_options['graphicLibrary'] == 'im')
311
+ return NGGALLERY_ABSPATH . '/lib/imagemagick.inc.php';
312
+ else
313
+ return NGGALLERY_ABSPATH . '/lib/gd.thumbnail.inc.php';
314
+
315
+ }
316
+
317
+ /**
318
+ * Look for the stylesheet in the theme folder
319
+ *
320
+ * @return string path to stylesheet
321
+ */
322
+ static function get_theme_css_file() {
323
+
324
+ // allow other plugins to include a custom stylesheet
325
+ $stylesheet = apply_filters( 'ngg_load_stylesheet', false );
326
+
327
+ if ( $stylesheet !== false )
328
+ return ( $stylesheet );
329
+ elseif ( file_exists (STYLESHEETPATH . '/nggallery.css') )
330
+ return get_stylesheet_directory_uri() . '/nggallery.css';
331
+ else
332
+ return false;
333
+ }
334
+
335
+ /**
336
+ * Support for i18n with wpml, polyglot or qtrans
337
+ *
338
+ * @param string $in
339
+ * @param string $name (optional) required for wpml to determine the type of translation
340
+ * @return string $in localized
341
+ */
342
+ static function i18n($in, $name = null) {
343
+
344
+ if ( function_exists( 'langswitch_filter_langs_with_message' ) )
345
+ $in = langswitch_filter_langs_with_message($in);
346
+
347
+ if ( function_exists( 'polyglot_filter' ))
348
+ $in = polyglot_filter($in);
349
+
350
+ if ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ))
351
+ $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
352
+
353
+ if (is_string($name) && !empty($name) && function_exists('icl_translate'))
354
+ $in = icl_translate('plugin_ngg', $name, $in, true);
355
+
356
+ $in = apply_filters('localization', $in);
357
+
358
+ return $in;
359
+ }
360
+
361
+ /**
362
+ * This function register strings for the use with WPML plugin (see http://wpml.org/ )
363
+ *
364
+ * @param object $image
365
+ * @return void
366
+ */
367
+ static function RegisterString($image) {
368
+ if (function_exists('icl_register_string')) {
369
+ global $wpdb;
370
+ icl_register_string('plugin_ngg', 'pic_' . $image->pid . '_description', $image->description, TRUE);
371
+ icl_register_string('plugin_ngg', 'pic_' . $image->pid . '_alttext', $image->alttext, TRUE);
372
+ }
373
+ }
374
+
375
+ /**
376
+ * Check the memory_limit and calculate a recommended memory size
377
+ *
378
+ * @since V1.2.0
379
+ * @return string message about recommended image size
380
+ */
381
+ static function check_memory_limit() {
382
+
383
+ if ( (function_exists('memory_get_usage')) && (ini_get('memory_limit')) ) {
384
+
385
+ // get memory limit
386
+ $memory_limit = ini_get('memory_limit');
387
+ if ($memory_limit != '')
388
+ $memory_limit = substr($memory_limit, 0, -1) * 1024 * 1024;
389
+
390
+ // calculate the free memory
391
+ $freeMemory = $memory_limit - memory_get_usage();
392
+
393
+ // build the test sizes
394
+ $sizes = array();
395
+ $sizes[] = array ( 'width' => 800, 'height' => 600);
396
+ $sizes[] = array ( 'width' => 1024, 'height' => 768);
397
+ $sizes[] = array ( 'width' => 1280, 'height' => 960); // 1MP
398
+ $sizes[] = array ( 'width' => 1600, 'height' => 1200); // 2MP
399
+ $sizes[] = array ( 'width' => 2016, 'height' => 1512); // 3MP
400
+ $sizes[] = array ( 'width' => 2272, 'height' => 1704); // 4MP
401
+ $sizes[] = array ( 'width' => 2560, 'height' => 1920); // 5MP
402
+
403
+ // test the classic sizes
404
+ foreach ($sizes as $size){
405
+ // very, very rough estimation
406
+ if ($freeMemory < round( $size['width'] * $size['height'] * 5.09 )) {
407
+ $result = sprintf( __( 'Note : Based on your server memory limit you should not upload larger images then <strong>%d x %d</strong> pixel', 'nggallery' ), $size['width'], $size['height']);
408
+ return $result;
409
+ }
410
+ }
411
+ }
412
+ return;
413
+ }
414
+
415
+ /**
416
+ * Slightly modfifed version of pathinfo(), clean up filename & rename jpeg to jpg
417
+ *
418
+ * @param string $name The name being checked.
419
+ * @return array containing information about file
420
+ */
421
+ static function fileinfo( $name ) {
422
+
423
+ //Sanitizes a filename replacing whitespace with dashes
424
+ $name = sanitize_file_name($name);
425
+
426
+ //get the parts of the name
427
+ $filepart = pathinfo ( strtolower($name) );
428
+
429
+ if ( empty($filepart) )
430
+ return false;
431
+
432
+ // required until PHP 5.2.0
433
+ if ( empty($filepart['filename']) )
434
+ $filepart['filename'] = substr($filepart['basename'],0 ,strlen($filepart['basename']) - (strlen($filepart['extension']) + 1) );
435
+
436
+ $filepart['filename'] = sanitize_title_with_dashes( $filepart['filename'] );
437
+
438
+ //extension jpeg will not be recognized by the slideshow, so we rename it
439
+ $filepart['extension'] = ($filepart['extension'] == 'jpeg') ? 'jpg' : $filepart['extension'];
440
+
441
+ //combine the new file name
442
+ $filepart['basename'] = $filepart['filename'] . '.' . $filepart['extension'];
443
+
444
+ return $filepart;
445
+ }
446
+
447
+ /**
448
+ * Check for extended capabilites. Must previously registers with add_ngg_capabilites()
449
+ *
450
+ * @since 1.5.0
451
+ * @param string $capability
452
+ * @return bool $result of capability check
453
+ */
454
+ static function current_user_can( $capability ) {
455
+
456
+ global $_ngg_capabilites;
457
+
458
+ if ( is_array($_ngg_capabilites) )
459
+ if ( in_array($capability , $_ngg_capabilites) )
460
+ return current_user_can( $capability );
461
+
462
+ return true;
463
+ }
464
+
465
+ /**
466
+ * Check for extended capabilites and echo disabled="disabled" for input form
467
+ *
468
+ * @since 1.5.0
469
+ * @param string $capability
470
+ * @return void
471
+ */
472
+ static function current_user_can_form( $capability ) {
473
+
474
+ if ( !nggGallery::current_user_can( $capability ))
475
+ echo 'disabled="disabled"';
476
+ }
477
+
478
+ /**
479
+ * Register more capabilities for custom use and add it to the administrator
480
+ *
481
+ * @since 1.5.0
482
+ * @param string $capability
483
+ * @param bool $register the new capability automatic to the admin role
484
+ * @return void
485
+ */
486
+ static function add_capabilites( $capability , $register = true ) {
487
+ global $_ngg_capabilites;
488
+
489
+ if ( !is_array($_ngg_capabilites) )
490
+ $_ngg_capabilites = array();
491
+
492
+ $_ngg_capabilites[] = $capability;
493
+
494
+ if ( $register ) {
495
+ $role = get_role('administrator');
496
+ if ( !empty($role) )
497
+ $role->add_cap( $capability );
498
+ }
499
+
500
+ }
501
+
502
+ /**
503
+ * Check for mobile user agent
504
+ *
505
+ * @since 1.6.0
506
+ * @author Part taken from WPtouch plugin (http://www.bravenewcode.com)
507
+ * @return bool $result of check
508
+ */
509
+ static function detect_mobile_phone() {
510
+
511
+ $useragents = array();
512
+
513
+ // Check if WPtouch is running
514
+ if ( function_exists('bnc_wptouch_get_user_agents') )
515
+ $useragents = bnc_wptouch_get_user_agents();
516
+ else {
517
+ $useragents = array(
518
+ "iPhone", // Apple iPhone
519
+ "iPod", // Apple iPod touch
520
+ "Android", // 1.5+ Android
521
+ "dream", // Pre 1.5 Android
522
+ "CUPCAKE", // 1.5+ Android
523
+ "blackberry9500", // Storm
524
+ "blackberry9530", // Storm
525
+ "blackberry9520", // Storm v2
526
+ "blackberry9550", // Storm v2
527
+ "blackberry9800", // Torch
528
+ "webOS", // Palm Pre Experimental
529
+ "incognito", // Other iPhone browser
530
+ "webmate" // Other iPhone browser
531
+ );
532
+
533
+ asort( $useragents );
534
+ }
535
+
536
+ // Godfather Steve says no to flash
537
+ if ( is_array($useragents) )
538
+ $useragents[] = "iPad"; // Apple iPad;
539
+
540
+ // WPtouch User Agent Filter
541
+ $useragents = apply_filters( 'wptouch_user_agents', $useragents );
542
+
543
+ foreach ( $useragents as $useragent ) {
544
+ if ( preg_match( "#$useragent#i", $_SERVER['HTTP_USER_AGENT'] ) )
545
+ return true;
546
+ }
547
+
548
+ return false;
549
+ }
550
+
551
+ /**
552
+ * get_memory_usage
553
+ *
554
+ * @access only for debug purpose
555
+ * @since 1.8.3
556
+ * @param string $text
557
+ * @return void
558
+ */
559
+ static function get_memory( $text = '' ) {
560
+ global $memory;
561
+
562
+ $memory_peak = memory_get_usage();
563
+ $diff = 0;
564
+
565
+ if ( isset($memory) )
566
+ $diff = $memory_peak - $memory;
567
+
568
+ $exp = ($diff < 0) ? '-' : '';
569
+ $diff = ($exp == '-') ? 0 - $diff : $diff;
570
+
571
+ $memory = $memory_peak;
572
+
573
+ $unit = array('b','kb','mb','gb','tb','pb');
574
+ $rounded = @round($diff/pow(1024,($i=floor(log($diff,1024)))),2).' '.$unit[$i];
575
+
576
+ echo $text . ': ' . $exp . $rounded .'<br />';
577
+
578
+ }
579
+
580
+ /**
581
+ * Show NextGEN Version in header
582
+ * @since 1.9.0
583
+ *
584
+ * @return void
585
+ */
586
+ static function nextgen_version() {
587
+ global $ngg;
588
+ echo apply_filters('show_nextgen_version', '<!-- <meta name="NextGEN" version="'. $ngg->version . '" /> -->' . "\n");
589
+ }
590
+ }
591
+ ?>
lib/gd.thumbnail.inc.php ADDED
@@ -0,0 +1,944 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * gd.thumbnail.inc.php
4
+ *
5
+ * @author Ian Selby (ian@gen-x-design.com)
6
+ * @copyright Copyright 2006-2011
7
+ * @version 1.3.0 (based on 1.1.3)
8
+ * @modded by Alex Rabe
9
+ *
10
+ */
11
+
12
+ /**
13
+ * PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them.
14
+ *
15
+ */
16
+ class ngg_Thumbnail {
17
+ /**
18
+ * Error message to display, if any
19
+ *
20
+ * @var string
21
+ */
22
+ var $errmsg;
23
+ /**
24
+ * Whether or not there is an error
25
+ *
26
+ * @var boolean
27
+ */
28
+ var $error;
29
+ /**
30
+ * Format of the image file
31
+ *
32
+ * @var string
33
+ */
34
+ var $format;
35
+ /**
36
+ * File name and path of the image file
37
+ *
38
+ * @var string
39
+ */
40
+ var $fileName;
41
+ /**
42
+ * Current dimensions of working image
43
+ *
44
+ * @var array
45
+ */
46
+ var $currentDimensions;
47
+ /**
48
+ * New dimensions of working image
49
+ *
50
+ * @var array
51
+ */
52
+ var $newDimensions;
53
+ /**
54
+ * Image resource for newly manipulated image
55
+ *
56
+ * @var resource
57
+ * @access private
58
+ */
59
+ var $newImage;
60
+ /**
61
+ * Image resource for image before previous manipulation
62
+ *
63
+ * @var resource
64
+ * @access private
65
+ */
66
+ var $oldImage;
67
+ /**
68
+ * Image resource for image being currently manipulated
69
+ *
70
+ * @var resource
71
+ * @access private
72
+ */
73
+ var $workingImage;
74
+ /**
75
+ * Percentage to resize image by
76
+ *
77
+ * @var int
78
+ * @access private
79
+ */
80
+ var $percent;
81
+ /**
82
+ * Maximum width of image during resize
83
+ *
84
+ * @var int
85
+ * @access private
86
+ */
87
+ var $maxWidth;
88
+ /**
89
+ * Maximum height of image during resize
90
+ *
91
+ * @var int
92
+ * @access private
93
+ */
94
+ var $maxHeight;
95
+ /**
96
+ * Image for Watermark
97
+ *
98
+ * @var string
99
+ *
100
+ */
101
+ var $watermarkImgPath;
102
+ /**
103
+ * Text for Watermark
104
+ *
105
+ * @var string
106
+ *
107
+ */
108
+ var $watermarkText;
109
+ /**
110
+ * Image Resource ID for Watermark
111
+ *
112
+ * @var string
113
+ *
114
+ */
115
+ function ngg_Thumbnail($fileName,$no_ErrorImage = false) {
116
+ //make sure the GD library is installed
117
+ if(!function_exists("gd_info")) {
118
+ echo 'You do not have the GD Library installed. This class requires the GD library to function properly.' . "\n";
119
+ echo 'visit http://us2.php.net/manual/en/ref.image.php for more information';
120
+ exit;
121
+ }
122
+ //initialize variables
123
+ $this->errmsg = '';
124
+ $this->error = false;
125
+ $this->currentDimensions = array();
126
+ $this->newDimensions = array();
127
+ $this->fileName = $fileName;
128
+ $this->percent = 100;
129
+ $this->maxWidth = 0;
130
+ $this->maxHeight = 0;
131
+ $this->watermarkImgPath = '';
132
+ $this->watermarkText = '';
133
+
134
+ //check to see if file exists
135
+ if(!file_exists($this->fileName)) {
136
+ $this->errmsg = 'File not found';
137
+ $this->error = true;
138
+ }
139
+ //check to see if file is readable
140
+ elseif(!is_readable($this->fileName)) {
141
+ $this->errmsg = 'File is not readable';
142
+ $this->error = true;
143
+ }
144
+
145
+ //if there are no errors, determine the file format
146
+ if($this->error == false) {
147
+ $data = @getimagesize($this->fileName);
148
+ if (isset($data) && is_array($data)) {
149
+ $extensions = array('1' => 'GIF', '2' => 'JPG', '3' => 'PNG');
150
+ $extension = array_key_exists($data[2], $extensions) ? $extensions[$data[2]] : '';
151
+ if($extension) {
152
+ $this->format = $extension;
153
+ } else {
154
+ $this->errmsg = 'Unknown file format';
155
+ $this->error = true;
156
+ }
157
+ } else {
158
+ $this->errmsg = 'File is not an image';
159
+ $this->error = true;
160
+ }
161
+ }
162
+
163
+ // increase memory-limit if possible, GD needs this for large images
164
+ // @ini_set('memory_limit', '128M');
165
+
166
+ if($this->error == false) {
167
+ // Check memory consumption if file exists
168
+ $this->checkMemoryForImage($this->fileName);
169
+ }
170
+
171
+ //initialize resources if no errors
172
+ if($this->error == false) {
173
+
174
+ switch($this->format) {
175
+ case 'GIF':
176
+ $this->oldImage = ImageCreateFromGif($this->fileName);
177
+ break;
178
+ case 'JPG':
179
+ $this->oldImage = ImageCreateFromJpeg($this->fileName);
180
+ break;
181
+ case 'PNG':
182
+ $this->oldImage = ImageCreateFromPng($this->fileName);
183
+ break;
184
+ }
185
+ if (!$this->oldImage) {
186
+ $this->errmsg = 'Create Image failed. Check memory limit';
187
+ $this->error = true;
188
+ } else {
189
+ $size = GetImageSize($this->fileName);
190
+ $this->currentDimensions = array('width'=>$size[0],'height'=>$size[1]);
191
+ $this->newImage = $this->oldImage;
192
+ }
193
+ }
194
+
195
+
196
+ if($this->error == true) {
197
+ if(!$no_ErrorImage)
198
+ $this->showErrorImage();
199
+ return;
200
+ }
201
+ }
202
+
203
+ /**
204
+ * Calculate the memory limit
205
+ *
206
+ */
207
+ function checkMemoryForImage( $filename ){
208
+
209
+ if ( (function_exists('memory_get_usage')) && (ini_get('memory_limit')) ) {
210
+ $imageInfo = getimagesize($filename);
211
+ switch($this->format) {
212
+ case 'GIF':
213
+ // measured factor 1 is better
214
+ $CHANNEL = 1;
215
+ break;
216
+ case 'JPG':
217
+ $CHANNEL = $imageInfo['channels'];
218
+ break;
219
+ case 'PNG':
220
+ // didn't get the channel for png
221
+ $CHANNEL = 3;
222
+ break;
223
+ }
224
+ $MB = 1048576; // number of bytes in 1M
225
+ $K64 = 65536; // number of bytes in 64K
226
+ $TWEAKFACTOR = 1.68; // Or whatever works for you
227
+ $memoryNeeded = round( ( $imageInfo[0] * $imageInfo[1]
228
+ * $imageInfo['bits']
229
+ * $CHANNEL / 8
230
+ + $K64
231
+ ) * $TWEAKFACTOR
232
+ );
233
+ $memoryNeeded = memory_get_usage() + $memoryNeeded;
234
+ // get memory limit
235
+ $memory_limit = ini_get('memory_limit');
236
+
237
+ // PHP docs : Note that to have no memory limit, set this directive to -1.
238
+ if ($memory_limit == -1 ) return;
239
+
240
+ // Just check megabyte limits, not higher
241
+ if ( strtolower(substr($memory_limit, -1)) == 'm' ) {
242
+
243
+ if ($memory_limit != '') {
244
+ $memory_limit = substr($memory_limit, 0, -1) * 1024 * 1024;
245
+ }
246
+
247
+ if ($memoryNeeded > $memory_limit) {
248
+ $memoryNeeded = round ($memoryNeeded / 1024 / 1024, 2);
249
+ $this->errmsg = 'Exceed Memory limit. Require : '.$memoryNeeded. " MByte" ;
250
+ $this->error = true;
251
+ }
252
+ }
253
+ }
254
+ return;
255
+ }
256
+
257
+ /**
258
+ * Must be called to free up allocated memory after all manipulations are done
259
+ *
260
+ */
261
+ function destruct() {
262
+ if(is_resource($this->newImage)) @ImageDestroy($this->newImage);
263
+ if(is_resource($this->oldImage)) @ImageDestroy($this->oldImage);
264
+ if(is_resource($this->workingImage)) @ImageDestroy($this->workingImage);
265
+ }
266
+
267
+ /**
268
+ * Returns the current width of the image
269
+ *
270
+ * @return int
271
+ */
272
+ function getCurrentWidth() {
273
+ return $this->currentDimensions['width'];
274
+ }
275
+
276
+ /**
277
+ * Returns the current height of the image
278
+ *
279
+ * @return int
280
+ */
281
+ function getCurrentHeight() {
282
+ return $this->currentDimensions['height'];
283
+ }
284
+
285
+ /**
286
+ * Calculates new image width
287
+ *
288
+ * @param int $width
289
+ * @param int $height
290
+ * @return array
291
+ */
292
+ function calcWidth($width,$height) {
293
+ $newWp = (100 * $this->maxWidth) / $width;
294
+ $newHeight = ($height * $newWp) / 100;
295
+ return array('newWidth'=>intval($this->maxWidth),'newHeight'=>intval($newHeight));
296
+ }
297
+
298
+ /**
299
+ * Calculates new image height
300
+ *
301
+ * @param int $width
302
+ * @param int $height
303
+ * @return array
304
+ */
305
+ function calcHeight($width,$height) {
306
+ $newHp = (100 * $this->maxHeight) / $height;
307
+ $newWidth = ($width * $newHp) / 100;
308
+ return array('newWidth'=>intval($newWidth),'newHeight'=>intval($this->maxHeight));
309
+ }
310
+
311
+ /**
312
+ * Calculates new image size based on percentage
313
+ *
314
+ * @param int $width
315
+ * @param int $height
316
+ * @return array
317
+ */
318
+ function calcPercent($width,$height) {
319
+ $newWidth = ($width * $this->percent) / 100;
320
+ $newHeight = ($height * $this->percent) / 100;
321
+ return array('newWidth'=>intval($newWidth),'newHeight'=>intval($newHeight));
322
+ }
323
+
324
+ /**
325
+ * Calculates new image size based on width and height, while constraining to maxWidth and maxHeight
326
+ *
327
+ * @param int $width
328
+ * @param int $height
329
+ */
330
+ function calcImageSize($width,$height) {
331
+ $newSize = array('newWidth'=>$width,'newHeight'=>$height);
332
+
333
+ if($this->maxWidth > 0) {
334
+
335
+ $newSize = $this->calcWidth($width,$height);
336
+
337
+ if($this->maxHeight > 0 && $newSize['newHeight'] > $this->maxHeight) {
338
+ $newSize = $this->calcHeight($newSize['newWidth'],$newSize['newHeight']);
339
+ }
340
+
341
+ //$this->newDimensions = $newSize;
342
+ }
343
+
344
+ if($this->maxHeight > 0) {
345
+ $newSize = $this->calcHeight($width,$height);
346
+
347
+ if($this->maxWidth > 0 && $newSize['newWidth'] > $this->maxWidth) {
348
+ $newSize = $this->calcWidth($newSize['newWidth'],$newSize['newHeight']);
349
+ }
350
+
351
+ //$this->newDimensions = $newSize;
352
+ }
353
+
354
+ $this->newDimensions = $newSize;
355
+ }
356
+
357
+ /**
358
+ * Calculates new image size based percentage
359
+ *
360
+ * @param int $width
361
+ * @param int $height
362
+ */
363
+ function calcImageSizePercent($width,$height) {
364
+ if($this->percent > 0) {
365
+ $this->newDimensions = $this->calcPercent($width,$height);
366
+ }
367
+ }
368
+
369
+ /**
370
+ * Displays error image
371
+ *
372
+ */
373
+ function showErrorImage() {
374
+ header('Content-type: image/png');
375
+ $errImg = ImageCreate(220,25);
376
+ $bgColor = imagecolorallocate($errImg,0,0,0);
377
+ $fgColor1 = imagecolorallocate($errImg,255,255,255);
378
+ $fgColor2 = imagecolorallocate($errImg,255,0,0);
379
+ imagestring($errImg,3,6,6,'Error:',$fgColor2);
380
+ imagestring($errImg,3,55,6,$this->errmsg,$fgColor1);
381
+ imagepng($errImg);
382
+ imagedestroy($errImg);
383
+ }
384
+
385
+ /**
386
+ * Resizes image to fixed Width x Height
387
+ *
388
+ * @param int $Width
389
+ * @param int $Height
390
+ */
391
+ function resizeFix($Width = 0, $Height = 0, $deprecated = 3) {
392
+ $this->newWidth = $Width;
393
+ $this->newHeight = $Height;
394
+
395
+ if(function_exists("ImageCreateTrueColor")) {
396
+ $this->workingImage = ImageCreateTrueColor($this->newWidth,$this->newHeight);
397
+ }
398
+ else {
399
+ $this->workingImage = ImageCreate($this->newWidth,$this->newHeight);
400
+ }
401
+
402
+ // ImageCopyResampled(
403
+ $this->imagecopyresampled(
404
+ $this->workingImage,
405
+ $this->oldImage,
406
+ 0,
407
+ 0,
408
+ 0,
409
+ 0,
410
+ $this->newWidth,
411
+ $this->newHeight,
412
+ $this->currentDimensions['width'],
413
+ $this->currentDimensions['height']
414
+ );
415
+
416
+ $this->oldImage = $this->workingImage;
417
+ $this->newImage = $this->workingImage;
418
+ $this->currentDimensions['width'] = $this->newWidth;
419
+ $this->currentDimensions['height'] = $this->newHeight;
420
+ }
421
+
422
+
423
+ /**
424
+ * Resizes image to maxWidth x maxHeight
425
+ *
426
+ * @param int $maxWidth
427
+ * @param int $maxHeight
428
+ */
429
+ function resize($maxWidth = 0, $maxHeight = 0, $deprecated = 3) {
430
+ $this->maxWidth = $maxWidth;
431
+ $this->maxHeight = $maxHeight;
432
+
433
+ $this->calcImageSize($this->currentDimensions['width'],$this->currentDimensions['height']);
434
+
435
+ if(function_exists("ImageCreateTrueColor")) {
436
+ $this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
437
+ }
438
+ else {
439
+ $this->workingImage = ImageCreate($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
440
+ }
441
+
442
+ // ImageCopyResampled(
443
+ $this->imagecopyresampled(
444
+ $this->workingImage,
445
+ $this->oldImage,
446
+ 0,
447
+ 0,
448
+ 0,
449
+ 0,
450
+ $this->newDimensions['newWidth'],
451
+ $this->newDimensions['newHeight'],
452
+ $this->currentDimensions['width'],
453
+ $this->currentDimensions['height']
454
+ );
455
+
456
+ $this->oldImage = $this->workingImage;
457
+ $this->newImage = $this->workingImage;
458
+ $this->currentDimensions['width'] = $this->newDimensions['newWidth'];
459
+ $this->currentDimensions['height'] = $this->newDimensions['newHeight'];
460
+ }
461
+
462
+ /**
463
+ * Resizes the image by $percent percent
464
+ *
465
+ * @param int $percent
466
+ */
467
+ function resizePercent($percent = 0) {
468
+ $this->percent = $percent;
469
+
470
+ $this->calcImageSizePercent($this->currentDimensions['width'],$this->currentDimensions['height']);
471
+
472
+ if(function_exists("ImageCreateTrueColor")) {
473
+ $this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
474
+ }
475
+ else {
476
+ $this->workingImage = ImageCreate($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
477
+ }
478
+
479
+ $this->ImageCopyResampled(
480
+ $this->workingImage,
481
+ $this->oldImage,
482
+ 0,
483
+ 0,
484
+ 0,
485
+ 0,
486
+ $this->newDimensions['newWidth'],
487
+ $this->newDimensions['newHeight'],
488
+ $this->currentDimensions['width'],
489
+ $this->currentDimensions['height']
490
+ );
491
+
492
+ $this->oldImage = $this->workingImage;
493
+ $this->newImage = $this->workingImage;
494
+ $this->currentDimensions['width'] = $this->newDimensions['newWidth'];
495
+ $this->currentDimensions['height'] = $this->newDimensions['newHeight'];
496
+ }
497
+
498
+ /**
499
+ * Crops the image from calculated center in a square of $cropSize pixels
500
+ *
501
+ * @param int $cropSize
502
+ */
503
+ function cropFromCenter($cropSize) {
504
+ if($cropSize > $this->currentDimensions['width']) $cropSize = $this->currentDimensions['width'];
505
+ if($cropSize > $this->currentDimensions['height']) $cropSize = $this->currentDimensions['height'];
506
+
507
+ $cropX = intval(($this->currentDimensions['width'] - $cropSize) / 2);
508
+ $cropY = intval(($this->currentDimensions['height'] - $cropSize) / 2);
509
+
510
+ if(function_exists("ImageCreateTrueColor")) {
511
+ $this->workingImage = ImageCreateTrueColor($cropSize,$cropSize);
512
+ }
513
+ else {
514
+ $this->workingImage = ImageCreate($cropSize,$cropSize);
515
+ }
516
+
517
+ $this->imagecopyresampled(
518
+ $this->workingImage,
519
+ $this->oldImage,
520
+ 0,
521
+ 0,
522
+ $cropX,
523
+ $cropY,
524
+ $cropSize,
525
+ $cropSize,
526
+ $cropSize,
527
+ $cropSize
528
+ );
529
+
530
+ $this->oldImage = $this->workingImage;
531
+ $this->newImage = $this->workingImage;
532
+ $this->currentDimensions['width'] = $cropSize;
533
+ $this->currentDimensions['height'] = $cropSize;
534
+ }
535
+
536
+ /**
537
+ * Advanced cropping function that crops an image using $startX and $startY as the upper-left hand corner.
538
+ *
539
+ * @param int $startX
540
+ * @param int $startY
541
+ * @param int $width
542
+ * @param int $height
543
+ */
544
+ function crop($startX, $startY, $width, $height) {
545
+ //make sure the cropped area is not greater than the size of the image
546
+ if($width > $this->currentDimensions['width']) $width = $this->currentDimensions['width'];
547
+ if($height > $this->currentDimensions['height']) $height = $this->currentDimensions['height'];
548
+ //make sure not starting outside the image
549
+ if(($startX + $width) > $this->currentDimensions['width']) $startX = ($this->currentDimensions['width'] - $width);
550
+ if(($startY + $height) > $this->currentDimensions['height']) $startY = ($this->currentDimensions['height'] - $height);
551
+ if($startX < 0) $startX = 0;
552
+ if($startY < 0) $startY = 0;
553
+
554
+ if(function_exists("ImageCreateTrueColor")) {
555
+ $this->workingImage = ImageCreateTrueColor($width,$height);
556
+ }
557
+ else {
558
+ $this->workingImage = ImageCreate($width,$height);
559
+ }
560
+
561
+ $this->imagecopyresampled(
562
+ $this->workingImage,
563
+ $this->oldImage,
564
+ 0,
565
+ 0,
566
+ $startX,
567
+ $startY,
568
+ $width,
569
+ $height,
570
+ $width,
571
+ $height
572
+ );
573
+
574
+ $this->oldImage = $this->workingImage;
575
+ $this->newImage = $this->workingImage;
576
+ $this->currentDimensions['width'] = $width;
577
+ $this->currentDimensions['height'] = $height;
578
+ }
579
+
580
+ /**
581
+ * Outputs the image to the screen, or saves to $name if supplied. Quality of JPEG images can be controlled with the $quality variable
582
+ *
583
+ * @param int $quality
584
+ * @param string $name
585
+ */
586
+ function show($quality=100,$name = '') {
587
+ switch($this->format) {
588
+ case 'GIF':
589
+ if($name != '') {
590
+ @ImageGif($this->newImage,$name) or $this->error = true;
591
+ }
592
+ else {
593
+ header('Content-type: image/gif');
594
+ ImageGif($this->newImage);
595
+ }
596
+ break;
597
+ case 'JPG':
598
+ if($name != '') {
599
+ @ImageJpeg($this->newImage,$name,$quality) or $this->error = true;
600
+ }
601
+ else {
602
+ header('Content-type: image/jpeg');
603
+ ImageJpeg($this->newImage,NULL,$quality);
604
+ }
605
+ break;
606
+ case 'PNG':
607
+ if($name != '') {
608
+ @ImagePng($this->newImage,$name) or $this->error = true;
609
+ }
610
+ else {
611
+ header('Content-type: image/png');
612
+ ImagePng($this->newImage);
613
+ }
614
+ break;
615
+ }
616
+ }
617
+
618
+ /**
619
+ * Saves image as $name (can include file path), with quality of # percent if file is a jpeg
620
+ *
621
+ * @param string $name
622
+ * @param int $quality
623
+ * @return bool errorstate
624
+ */
625
+ function save($name,$quality=100) {
626
+ $this->show($quality,$name);
627
+ if ($this->error == true) {
628
+ $this->errmsg = 'Create Image failed. Check safe mode settings';
629
+ return false;
630
+ }
631
+
632
+ if( function_exists('do_action') )
633
+ do_action('ngg_ajax_image_save', $name);
634
+
635
+ return true;
636
+ }
637
+
638
+ /**
639
+ * Creates Apple-style reflection under image, optionally adding a border to main image
640
+ *
641
+ * @param int $percent
642
+ * @param int $reflection
643
+ * @param int $white
644
+ * @param bool $border
645
+ * @param string $borderColor
646
+ */
647
+ function createReflection($percent,$reflection,$white,$border = true,$borderColor = '#a4a4a4') {
648
+ $width = $this->currentDimensions['width'];
649
+ $height = $this->currentDimensions['height'];
650
+
651
+ $reflectionHeight = intval($height * ($reflection / 100));
652
+ $newHeight = $height + $reflectionHeight;
653
+ $reflectedPart = $height * ($percent / 100);
654
+
655
+ $this->workingImage = ImageCreateTrueColor($width,$newHeight);
656
+
657
+ ImageAlphaBlending($this->workingImage,true);
658
+
659
+ $colorToPaint = ImageColorAllocateAlpha($this->workingImage,255,255,255,0);
660
+ ImageFilledRectangle($this->workingImage,0,0,$width,$newHeight,$colorToPaint);
661
+
662
+ imagecopyresampled(
663
+ $this->workingImage,
664
+ $this->newImage,
665
+ 0,
666
+ 0,
667
+ 0,
668
+ $reflectedPart,
669
+ $width,
670
+ $reflectionHeight,
671
+ $width,
672
+ ($height - $reflectedPart));
673
+ $this->imageFlipVertical();
674
+
675
+ imagecopy($this->workingImage,$this->newImage,0,0,0,0,$width,$height);
676
+
677
+ imagealphablending($this->workingImage,true);
678
+
679
+ for($i=0;$i<$reflectionHeight;$i++) {
680
+ $colorToPaint = imagecolorallocatealpha($this->workingImage,255,255,255,($i/$reflectionHeight*-1+1)*$white);
681
+ imagefilledrectangle($this->workingImage,0,$height+$i,$width,$height+$i,$colorToPaint);
682
+ }
683
+
684
+ if($border == true) {
685
+ $rgb = $this->hex2rgb($borderColor,false);
686
+ $colorToPaint = imagecolorallocate($this->workingImage,$rgb[0],$rgb[1],$rgb[2]);
687
+ imageline($this->workingImage,0,0,$width,0,$colorToPaint); //top line
688
+ imageline($this->workingImage,0,$height,$width,$height,$colorToPaint); //bottom line
689
+ imageline($this->workingImage,0,0,0,$height,$colorToPaint); //left line
690
+ imageline($this->workingImage,$width-1,0,$width-1,$height,$colorToPaint); //right line
691
+ }
692
+
693
+ $this->oldImage = $this->workingImage;
694
+ $this->newImage = $this->workingImage;
695
+ $this->currentDimensions['width'] = $width;
696
+ $this->currentDimensions['height'] = $newHeight;
697
+ }
698
+
699
+ /**
700
+ * Flip an image.
701
+ *
702
+ * @param bool $horz flip the image in horizontal mode
703
+ * @param bool $vert flip the image in vertical mode
704
+ */
705
+ function flipImage( $horz = false, $vert = false ) {
706
+
707
+ $sx = $vert ? ($this->currentDimensions['width'] - 1) : 0;
708
+ $sy = $horz ? ($this->currentDimensions['height'] - 1) : 0;
709
+ $sw = $vert ? -$this->currentDimensions['width'] : $this->currentDimensions['width'];
710
+ $sh = $horz ? -$this->currentDimensions['height'] : $this->currentDimensions['height'];
711
+
712
+ $this->workingImage = imagecreatetruecolor( $this->currentDimensions['width'], $this->currentDimensions['height'] );
713
+
714
+ $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $sx, $sy, $this->currentDimensions['width'], $this->currentDimensions['height'], $sw, $sh) ;
715
+ $this->oldImage = $this->workingImage;
716
+ $this->newImage = $this->workingImage;
717
+
718
+ return true;
719
+ }
720
+
721
+ /**
722
+ * Rotate an image clockwise or counter clockwise
723
+ *
724
+ * @param string $direction could be CW or CCW
725
+ */
726
+ function rotateImage( $dir = 'CW' ) {
727
+
728
+ $angle = ($dir == 'CW') ? 90 : -90;
729
+
730
+ if ( function_exists('imagerotate') ) {
731
+ $this->workingImage = imagerotate($this->oldImage, 360 - $angle, 0); // imagerotate() rotates CCW
732
+ $this->currentDimensions['width'] = imagesx($this->workingImage);
733
+ $this->currentDimensions['height'] = imagesy($this->workingImage);
734
+ $this->oldImage = $this->workingImage;
735
+ $this->newImage = $this->workingImage;
736
+ return true;
737
+ }
738
+
739
+ $this->workingImage = imagecreatetruecolor( $this->currentDimensions['height'], $this->currentDimensions['width'] );
740
+
741
+ imagealphablending($this->workingImage, false);
742
+ imagesavealpha($this->workingImage, true);
743
+
744
+ switch ($angle) {
745
+
746
+ case 90 :
747
+ for( $x = 0; $x < $this->currentDimensions['width']; $x++ ) {
748
+ for( $y = 0; $y < $this->currentDimensions['height']; $y++ ) {
749
+ if ( !imagecopy($this->workingImage, $this->oldImage, $this->currentDimensions['height'] - $y - 1, $x, $x, $y, 1, 1) )
750
+ return false;
751
+ }
752
+ }
753
+ break;
754
+
755
+ case -90 :
756
+ for( $x = 0; $x < $this->currentDimensions['width']; $x++ ) {
757
+ for( $y = 0; $y < $this->currentDimensions['height']; $y++ ) {
758
+ if ( !imagecopy($this->workingImage, $this->oldImage, $y, $this->currentDimensions['width'] - $x - 1, $x, $y, 1, 1) )
759
+ return false;
760
+ }
761
+ }
762
+ break;
763
+
764
+ default :
765
+ return false;
766
+ }
767
+
768
+ $this->currentDimensions['width'] = imagesx($this->workingImage);
769
+ $this->currentDimensions['height'] = imagesy($this->workingImage);
770
+ $this->oldImage = $this->workingImage;
771
+ $this->newImage = $this->workingImage;
772
+
773
+ return true;
774
+
775
+ }
776
+
777
+ /**
778
+ * Inverts working image, used by reflection function
779
+ *
780
+ * @access private
781
+ */
782
+ function imageFlipVertical() {
783
+ $x_i = imagesx($this->workingImage);
784
+ $y_i = imagesy($this->workingImage);
785
+
786
+ for($x = 0; $x < $x_i; $x++) {
787
+ for($y = 0; $y < $y_i; $y++) {
788
+ imagecopy($this->workingImage,$this->workingImage,$x,$y_i - $y - 1, $x, $y, 1, 1);
789
+ }
790
+ }
791
+ }
792
+
793
+ /**
794
+ * Converts hexidecimal color value to rgb values and returns as array/string
795
+ *
796
+ * @param string $hex
797
+ * @param bool $asString
798
+ * @return array|string
799
+ */
800
+ function hex2rgb($hex, $asString = false) {
801
+ // strip off any leading #
802
+ if (0 === strpos($hex, '#')) {
803
+ $hex = substr($hex, 1);
804
+ } else if (0 === strpos($hex, '&H')) {
805
+ $hex = substr($hex, 2);
806
+ }
807
+
808
+ // break into hex 3-tuple
809
+ $cutpoint = ceil(strlen($hex) / 2)-1;
810
+ $rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3);
811
+
812
+ // convert each tuple to decimal
813
+ $rgb[0] = (isset($rgb[0]) ? hexdec($rgb[0]) : 0);
814
+ $rgb[1] = (isset($rgb[1]) ? hexdec($rgb[1]) : 0);
815
+ $rgb[2] = (isset($rgb[2]) ? hexdec($rgb[2]) : 0);
816
+
817
+ return ($asString ? "{$rgb[0]} {$rgb[1]} {$rgb[2]}" : $rgb);
818
+ }
819
+
820
+ /**
821
+ * Based on the Watermark function by Marek Malcherek
822
+ * http://www.malcherek.de
823
+ *
824
+ * @param string $color
825
+ * @param string $wmFont
826
+ * @param int $wmSize
827
+ * @param int $wmOpaque
828
+ */
829
+ function watermarkCreateText($color = '000000',$wmFont, $wmSize = 10, $wmOpaque = 90 ){
830
+ // set font path
831
+ $wmFontPath = NGGALLERY_ABSPATH."fonts/".$wmFont;
832
+ if ( !is_readable($wmFontPath))
833
+ return;
834
+
835
+ // This function requires both the GD library and the FreeType library.
836
+ if ( !function_exists('ImageTTFBBox') )
837
+ return;
838
+
839
+ $TextSize = @ImageTTFBBox($wmSize, 0, $wmFontPath, $this->watermarkText) or die;
840
+ $TextWidth = abs($TextSize[2]) + abs($TextSize[0]);
841
+ $TextHeight = abs($TextSize[7]) + abs($TextSize[1]);
842
+ // Create Image for Text
843
+ $this->workingImage = ImageCreateTrueColor($TextWidth, $TextHeight);
844
+ ImageSaveAlpha($this->workingImage, true);
845
+ ImageAlphaBlending($this->workingImage, false);
846
+ $bgText = imagecolorallocatealpha($this->workingImage, 255, 255, 255, 127);
847
+ imagefill($this->workingImage, 0, 0, $bgText);
848
+ $wmTransp = 127 -( $wmOpaque * 1.27 );
849
+ $rgb = $this->hex2rgb($color,false);
850
+ $TextColor = imagecolorallocatealpha($this->workingImage, $rgb[0], $rgb[1], $rgb[2], $wmTransp);
851
+
852
+ // Create Text on image
853
+ imagettftext($this->workingImage, $wmSize, 0, 0, abs($TextSize[5]), $TextColor, $wmFontPath, $this->watermarkText);
854
+ $this->watermarkImgPath = $this->workingImage;
855
+
856
+ return;
857
+ }
858
+
859
+ /**
860
+ * Modfied Watermark function by Steve Peart
861
+ * http://parasitehosting.com/
862
+ *
863
+ * @param string $relPOS
864
+ * @param int $xPOS
865
+ * @param int $yPOS
866
+ */
867
+ function watermarkImage( $relPOS = 'botRight', $xPOS = 0, $yPOS = 0) {
868
+
869
+ // if it's a resource ID take it as watermark text image
870
+ if(is_resource($this->watermarkImgPath)) {
871
+ $this->workingImage = $this->watermarkImgPath;
872
+ } else {
873
+ // Would you really want to use anything other than a png?
874
+ $this->workingImage = @imagecreatefrompng($this->watermarkImgPath);
875
+ // if it's not a valid file die...
876
+ if (empty($this->workingImage) or (!$this->workingImage))
877
+ return;
878
+ }
879
+
880
+ imagealphablending($this->workingImage, false);
881
+ imagesavealpha($this->workingImage, true);
882
+ $sourcefile_width=imageSX($this->oldImage);
883
+ $sourcefile_height=imageSY($this->oldImage);
884
+ $watermarkfile_width=imageSX($this->workingImage);
885
+ $watermarkfile_height=imageSY($this->workingImage);
886
+ switch(substr($relPOS, 0, 3)){
887
+ case 'top': $dest_y = 0 + $yPOS; break;
888
+ case 'mid': $dest_y = ($sourcefile_height / 2) - ($watermarkfile_height / 2); break;
889
+ case 'bot': $dest_y = $sourcefile_height - $watermarkfile_height - $yPOS; break;
890
+ default : $dest_y = 0; break;
891
+ }
892
+ switch(substr($relPOS, 3)){
893
+ case 'Left' : $dest_x = 0 + $xPOS; break;
894
+ case 'Center': $dest_x = ($sourcefile_width / 2) - ($watermarkfile_width / 2); break;
895
+ case 'Right': $dest_x = $sourcefile_width - $watermarkfile_width - $xPOS; break;
896
+ default : $dest_x = 0; break;
897
+ }
898
+
899
+ // debug
900
+ // $this->errmsg = 'X '.$dest_x.' Y '.$dest_y;
901
+ // $this->showErrorImage();
902
+
903
+ // if a gif, we have to upsample it to a truecolor image
904
+ if($this->format == 'GIF') {
905
+ $tempimage = imagecreatetruecolor($sourcefile_width,$sourcefile_height);
906
+ imagecopy($tempimage, $this->oldImage, 0, 0, 0, 0,$sourcefile_width, $sourcefile_height);
907
+ $this->newImage = $tempimage;
908
+ }
909
+
910
+ imagecopy($this->newImage, $this->workingImage, $dest_x, $dest_y, 0, 0,$watermarkfile_width, $watermarkfile_height);
911
+ }
912
+
913
+ /**
914
+ * Modfied imagecopyresampled function to save transparent images
915
+ * See : http://www.akemapa.com/2008/07/10/php-gd-resize-transparent-image-png-gif/
916
+ * @since 1.9.0
917
+ *
918
+ * @param resource $dst_image
919
+ * @param resource $src_image
920
+ * @param int $dst_x
921
+ * @param int $dst_y
922
+ * @param int $src_x
923
+ * @param int $src_y
924
+ * @param int $dst_w
925
+ * @param int $dst_h
926
+ * @param int $src_w
927
+ * @param int $src_h
928
+ * @return bool
929
+ */
930
+ function imagecopyresampled( &$dst_image , $src_image , $dst_x , $dst_y , $src_x , $src_y , $dst_w , $dst_h , $src_w , $src_h) {
931
+
932
+ // Check if this image is PNG or GIF, then set if Transparent
933
+ if( $this->format == 'GIF' || $this->format == 'PNG'){
934
+ imagealphablending($dst_image, false);
935
+ imagesavealpha($dst_image, true);
936
+ $transparent = imagecolorallocatealpha($dst_image, 255, 255, 255, 127);
937
+ imagefilledrectangle($dst_image, 0, 0, $dst_w, $dst_h, $transparent);
938
+ }
939
+
940
+ imagecopyresampled($dst_image , $src_image , $dst_x , $dst_y , $src_x , $src_y , $dst_w , $dst_h , $src_w , $src_h);
941
+ return true;
942
+ }
943
+ }
944
+ ?>
lib/image.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !class_exists('nggImage') ) :
3
+ /**
4
+ * Image PHP class for the WordPress plugin NextGEN Gallery
5
+ *
6
+ * @author Alex Rabe
7
+ *
8
+ */
9
+ class nggImage{
10
+
11
+ /**** Public variables ****/
12
+ var $errmsg = ''; // Error message to display, if any
13
+ var $error = FALSE; // Error state
14
+ var $imageURL = ''; // URL Path to the image
15
+ var $thumbURL = ''; // URL Path to the thumbnail
16
+ var $imagePath = ''; // Server Path to the image
17
+ var $thumbPath = ''; // Server Path to the thumbnail
18
+ var $href = ''; // A href link code
19
+
20
+ // TODO: remove thumbPrefix and thumbFolder (constants)
21
+ var $thumbPrefix = 'thumbs_'; // FolderPrefix to the thumbnail
22
+ var $thumbFolder = '/thumbs/'; // Foldername to the thumbnail
23
+
24
+ /**** Image Data ****/
25
+ var $galleryid = 0; // Gallery ID
26
+ var $pid = 0; // Image ID
27
+ var $filename = ''; // Image filename
28
+ var $description = ''; // Image description
29
+ var $alttext = ''; // Image alttext
30
+ var $imagedate = ''; // Image date/time
31
+ var $exclude = ''; // Image exclude
32
+ var $thumbcode = ''; // Image effect code
33
+
34
+ /**** Gallery Data ****/
35
+ var $name = ''; // Gallery name
36
+ var $path = ''; // Gallery path
37
+ var $title = ''; // Gallery title
38
+ var $pageid = 0; // Gallery page ID
39
+ var $previewpic = 0; // Gallery preview pic
40
+
41
+ var $permalink = '';
42
+ var $tags = '';
43
+
44
+ /**
45
+ * Constructor
46
+ *
47
+ * @param object $gallery The nggGallery object representing the gallery containing this image
48
+ * @return void
49
+ */
50
+ function nggImage($gallery) {
51
+
52
+ //This must be an object
53
+ $gallery = (object) $gallery;
54
+
55
+ // Build up the object
56
+ foreach ($gallery as $key => $value)
57
+ $this->$key = $value ;
58
+
59
+ // Finish initialisation
60
+ $this->name = $gallery->name;
61
+ $this->path = $gallery->path;
62
+ $this->title = stripslashes($gallery->title);
63
+ $this->pageid = $gallery->pageid;
64
+ $this->previewpic = $gallery->previewpic;
65
+
66
+ // set urls and paths
67
+ $this->imageURL = site_url() . '/' . $this->path . '/' . $this->filename;
68
+ $this->thumbURL = site_url() . '/' . $this->path . '/thumbs/thumbs_' . $this->filename;
69
+ $this->imagePath = WINABSPATH.$this->path . '/' . $this->filename;
70
+ $this->thumbPath = WINABSPATH.$this->path . '/thumbs/thumbs_' . $this->filename;
71
+ $this->meta_data = unserialize($this->meta_data);
72
+ $this->imageHTML = $this->get_href_link();
73
+ $this->thumbHTML = $this->get_href_thumb_link();
74
+
75
+ do_action_ref_array('ngg_get_image', array(&$this));
76
+
77
+ // Note wp_cache_add will increase memory needs (4-8 kb)
78
+ //wp_cache_add($this->pid, $this, 'ngg_image');
79
+ // Get tags only if necessary
80
+ unset($this->tags);
81
+ }
82
+
83
+ /**
84
+ * Get the thumbnail code (to add effects on thumbnail click)
85
+ *
86
+ * Applies the filter 'ngg_get_thumbcode'
87
+ */
88
+ function get_thumbcode($galleryname = '') {
89
+
90
+ // clean up the name
91
+ $galleryname = sanitize_title( $galleryname );
92
+
93
+ // read the option setting
94
+ $ngg_options = get_option('ngg_options');
95
+
96
+ // get the effect code
97
+ if ($ngg_options['thumbEffect'] != "none")
98
+ $this->thumbcode = stripslashes($ngg_options['thumbCode']);
99
+
100
+ // for highslide to a different approach
101
+ if ($ngg_options['thumbEffect'] == "highslide")
102
+ $this->thumbcode = str_replace("%GALLERY_NAME%", "'".$galleryname."'", $this->thumbcode);
103
+ else
104
+ $this->thumbcode = str_replace("%GALLERY_NAME%", $galleryname, $this->thumbcode);
105
+
106
+ return apply_filters('ngg_get_thumbcode', $this->thumbcode, $this);
107
+ }
108
+
109
+ function get_href_link() {
110
+ // create the a href link from the picture
111
+ $this->href = "\n".'<a href="'.$this->imageURL.'" title="'.htmlspecialchars( stripslashes( nggGallery::i18n($this->description, 'pic_' . $this->pid . '_description') ) ).'" '.$this->get_thumbcode($this->name).'>'."\n\t";
112
+ $this->href .= '<img alt="'.$this->alttext.'" src="'.$this->imageURL.'"/>'."\n".'</a>'."\n";
113
+
114
+ return $this->href;
115
+ }
116
+
117
+ function get_href_thumb_link() {
118
+ // create the a href link with the thumbanil
119
+ $this->href = "\n".'<a href="'.$this->imageURL.'" title="'.htmlspecialchars( stripslashes( nggGallery::i18n($this->description, 'pic_' . $this->pid . '_description') ) ).'" '.$this->get_thumbcode($this->name).'>'."\n\t";
120
+ $this->href .= '<img alt="'.$this->alttext.'" src="'.$this->thumbURL.'"/>'."\n".'</a>'."\n";
121
+
122
+ return $this->href;
123
+ }
124
+
125
+ /**
126
+ * This function creates a cache for all singlepics to reduce the CPU load
127
+ *
128
+ * @param int $width
129
+ * @param int $height
130
+ * @param string $mode could be watermark | web20 | crop
131
+ * @return the url for the image or false if failed
132
+ */
133
+ function cached_singlepic_file($width = '', $height = '', $mode = '' ) {
134
+
135
+ $ngg_options = get_option('ngg_options');
136
+
137
+ include_once( nggGallery::graphic_library() );
138
+
139
+ // cache filename should be unique
140
+ $cachename = $this->pid . '_' . $mode . '_'. $width . 'x' . $height . '_' . $this->filename;
141
+ $cachefolder = WINABSPATH .$ngg_options['gallerypath'] . 'cache/';
142
+ $cached_url = site_url() . '/' . $ngg_options['gallerypath'] . 'cache/' . $cachename;
143
+ $cached_file = $cachefolder . $cachename;
144
+
145
+ // check first for the file
146
+ if ( file_exists($cached_file) )
147
+ return $cached_url;
148
+
149
+ // create folder if needed
150
+ if ( !file_exists($cachefolder) )
151
+ if ( !wp_mkdir_p($cachefolder) )
152
+ return false;
153
+
154
+ $thumb = new ngg_Thumbnail($this->imagePath, TRUE);
155
+ // echo $thumb->errmsg;
156
+
157
+ if (!$thumb->error) {
158
+ if ($mode == 'crop') {
159
+ // calculates the new dimentions for a downsampled image
160
+ list ( $ratio_w, $ratio_h ) = wp_constrain_dimensions($thumb->currentDimensions['width'], $thumb->currentDimensions['height'], $width, $height);
161
+ // check ratio to decide which side should be resized
162
+ ( $ratio_h < $height || $ratio_w == $width ) ? $thumb->resize(0, $height) : $thumb->resize($width, 0);
163
+ // get the best start postion to crop from the middle
164
+ $ypos = ($thumb->currentDimensions['height'] - $height) / 2;
165
+ $thumb->crop(0, $ypos, $width, $height);
166
+ } else
167
+ $thumb->resize($width , $height);
168
+
169
+ if ($mode == 'watermark') {
170
+ if ($ngg_options['wmType'] == 'image') {
171
+ $thumb->watermarkImgPath = $ngg_options['wmPath'];
172
+ $thumb->watermarkImage($ngg_options['wmPos'], $ngg_options['wmXpos'], $ngg_options['wmYpos']);
173
+ }
174
+ if ($ngg_options['wmType'] == 'text') {
175
+ $thumb->watermarkText = $ngg_options['wmText'];
176
+ $thumb->watermarkCreateText($ngg_options['wmColor'], $ngg_options['wmFont'], $ngg_options['wmSize'], $ngg_options['wmOpaque']);
177
+ $thumb->watermarkImage($ngg_options['wmPos'], $ngg_options['wmXpos'], $ngg_options['wmYpos']);
178
+ }
179
+ }
180
+
181
+ if ($mode == 'web20') {
182
+ $thumb->createReflection(40,40,50,false,'#a4a4a4');
183
+ }
184
+
185
+ // save the new cache picture
186
+ $thumb->save($cached_file,$ngg_options['imgQuality']);
187
+ }
188
+ $thumb->destruct();
189
+
190
+ // check again for the file
191
+ if (file_exists($cached_file))
192
+ return $cached_url;
193
+
194
+ return false;
195
+ }
196
+
197
+ /**
198
+ * Get the tags associated to this image
199
+ */
200
+ function get_tags() {
201
+ if ( !isset($this->tags) )
202
+ $this->tags = wp_get_object_terms($this->pid, 'ngg_tag', 'fields=all');
203
+
204
+ return $this->tags;
205
+ }
206
+
207
+ /**
208
+ * Get the permalink to the image
209
+ * TODO Get a permalink to a page presenting the image
210
+ */
211
+ function get_permalink() {
212
+ if ($this->permalink == '')
213
+ $this->permalink = $this->imageURL;
214
+
215
+ return $this->permalink;
216
+ }
217
+
218
+ function __destruct() {
219
+
220
+ }
221
+ }
222
+ endif;
223
+ ?>
lib/imagemagick.inc.php ADDED
@@ -0,0 +1,598 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * imagemagick.inc.php
4
+ *
5
+ * @author Frederic De Ranter
6
+ * @copyright Copyright 2008
7
+ * @version 0.4 (PHP4)
8
+ * @based on thumbnail.inc.php by Ian Selby (gen-x-design.com)
9
+ * @since NextGEN V1.0.0
10
+ *
11
+ */
12
+ /**
13
+ * PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them.
14
+ * with ImageMagick
15
+ */
16
+
17
+ class ngg_Thumbnail {
18
+ /**
19
+ * Error message to display, if any
20
+ * @var string
21
+ */
22
+ var $errmsg;
23
+ /**
24
+ * Whether or not there is an error
25
+ * @var boolean
26
+ */
27
+ var $error;
28
+ /**
29
+ * File name and path of the image file
30
+ * @var string
31
+ */
32
+ var $fileName;
33
+ /**
34
+ * Image meta data if any is available (jpeg/tiff) via the exif library
35
+ * @var array
36
+ */
37
+ var $imageMeta;
38
+ /**
39
+ * Current dimensions of working image
40
+ * @var array
41
+ */
42
+ var $currentDimensions;
43
+ /**
44
+ * New dimensions of working image
45
+ * @var array
46
+ */
47
+ var $newDimensions;
48
+ /**
49
+ * Percentage to resize image b
50
+ * @var int
51
+ * @access private
52
+ */
53
+ var $percent;
54
+ /**
55
+ * Maximum width of image during resize
56
+ * @var int
57
+ * @access private
58
+ */
59
+ var $maxWidth;
60
+ /**
61
+ * Maximum height of image during resize
62
+ * @var int
63
+ * @access private
64
+ */
65
+ var $maxHeight;
66
+ /**
67
+ * Image for Watermark
68
+ * @var string
69
+ */
70
+ var $watermarkImgPath;
71
+ /**
72
+ * Text for Watermark
73
+ * @var string
74
+ */
75
+ var $watermarkText;
76
+ /**
77
+ * Path to ImageMagick convert
78
+ * @var string
79
+ */
80
+ var $imageMagickDir;
81
+ /**
82
+ * String to execute ImageMagick convert.
83
+ * @var string
84
+ */
85
+ var $imageMagickExec;
86
+ /**
87
+ * String to execute ImageMagick composite.
88
+ * @var string
89
+ */
90
+ var $imageMagickComp;
91
+ /**
92
+ * String to execute ImageMagick (before the filename).
93
+ * @var string
94
+ */
95
+ var $imageMagickBefore;
96
+
97
+ /*
98
+ * in: filename, error
99
+ * out: nothing
100
+ * init of class: init of variables, detect needed memory (gd), image format (gd), detect image size (GetImageSize is general PHP, not GD), Image Meta?
101
+ */
102
+
103
+ function ngg_Thumbnail($fileName, $no_ErrorImage = false) {
104
+
105
+ //initialize variables
106
+ $this->errmsg = '';
107
+ $this->error = false;
108
+ $this->currentDimensions = array();
109
+ $this->newDimensions = array();
110
+ $this->fileName = $fileName;
111
+ $this->imageMeta = array();
112
+ $this->percent = 100;
113
+ $this->maxWidth = 0;
114
+ $this->maxHeight = 0;
115
+ $this->watermarkImgPath = '';
116
+ $this->watermarkText = '';
117
+ $this->imageMagickExec = '';
118
+ $this->imageMagickComp = '';
119
+ $this->imageMagickBefore = '';
120
+
121
+ //make sure ImageMagick is installed
122
+ $this->checkVersion();
123
+
124
+ //check to see if file exists
125
+ if(!file_exists($this->fileName)) {
126
+ $this->errmsg = 'File not found';
127
+ $this->error = true;
128
+ }
129
+ //check to see if file is readable
130
+ elseif(!is_readable($this->fileName)) {
131
+ $this->errmsg = 'File is not readable';
132
+ $this->error = true;
133
+ }
134
+
135
+ if($this->error == false) {
136
+ $size = GetImageSize($this->fileName);
137
+ $this->currentDimensions = array('width'=>$size[0],'height'=>$size[1]);
138
+ }
139
+
140
+ if($this->error == true) {
141
+ // for SinglePic send the error message out
142
+ if(!$no_ErrorImage)
143
+ echo $this->errmsg;
144
+ return;
145
+ }
146
+ }
147
+
148
+ function checkVersion() {
149
+
150
+ // very often exec()or passthru() is disabled. No chance for Imagick
151
+ if ( ini_get('disable_functions') ) {
152
+ $not_allowed = ini_get('disable_functions');
153
+ if ( stristr($not_allowed, 'exec') || stristr($not_allowed, 'passthru') ) {
154
+ $this->errmsg = 'exec() or passthru() is not allowed. Could not execute Imagick';
155
+ $this->error = true;
156
+ return false;
157
+ }
158
+ }
159
+
160
+ // get the path to imageMagick
161
+ $ngg_options = get_option('ngg_options');
162
+ $this->imageMagickDir = trim( $ngg_options['imageMagickDir']);
163
+ $this->imageMagickDir = str_replace( "\\", "/", $this->imageMagickDir );
164
+
165
+ // Try to get the ImageMagick version
166
+ $magickv = $this->execute('convert', '-version');
167
+
168
+ if ( empty($magickv) ) {
169
+ $this->errmsg = 'Could not execute ImageMagick. Check path ';
170
+ $this->error = true;
171
+ return false;
172
+ }
173
+
174
+ // We need as least version 6 or higher
175
+ $helper = preg_match('/Version: ImageMagick ([0-9])/', $magickv[0], $magickversion);
176
+ if ( !$magickversion[0] > '5' ) {
177
+ $this->errmsg = 'Require ImageMagick Version 6 or higher';
178
+ $this->error = true;
179
+ return false;
180
+ }
181
+
182
+ return true;
183
+ }
184
+
185
+
186
+ /**
187
+ * Execute ImageMagick/GraphicsMagick commands
188
+ *
189
+ * @param string $cmd an ImageMagick command (eg. "convert")
190
+ * @param string $args the arguments which should be passed
191
+ * @param bool �passthru(optional) output the result to the webserver instead
192
+ * @return void | if passthru return the image
193
+ */
194
+ function execute( $cmd, $args, $passthru = false) {
195
+
196
+ // in error case we do not continue
197
+ if($this->error == true)
198
+ return;
199
+
200
+ //if path is not empty
201
+ if ($this->imageMagickDir != '') {
202
+ // the path must have a slash at the end
203
+ if ( $this->imageMagickDir{strlen($this->imageMagickDir)-1} != '/')
204
+ $this->imageMagickDir .= '/';
205
+ }
206
+
207
+ //$args = escapeshellarg($args);
208
+ //var_dump( escapeshellcmd ( "{$this->imageMagickDir}/{$cmd} {$args}" ) ); return;
209
+ //$this->errmsg = escapeshellcmd( "{$this->imageMagickDir}{$cmd} {$args}" );
210
+
211
+ if ( !$passthru ) {
212
+ exec( "{$this->imageMagickDir}{$cmd} {$args}", $result );
213
+ //var_dump( "{$this->imageMagickDir}/{$cmd} {$args}" );
214
+ return $result;
215
+
216
+ }
217
+ //var_dump( escapeshellcmd ( "{$this->imageMagickDir}/{$cmd} {$args}" ) ); return;
218
+
219
+ // for single pic we need the direct output
220
+ header('Content-type: image/jpeg');
221
+ $this->errmsg = "{$this->imageMagickDir}{$cmd} {$args}";
222
+ passthru( "{$this->imageMagickDir}{$cmd} {$args}" );
223
+ }
224
+
225
+
226
+ /**
227
+ * Must be called to free up allocated memory after all manipulations are done
228
+ */
229
+ function destruct() {
230
+ //not needed for ImageMagick
231
+ return;
232
+ }
233
+
234
+ /**
235
+ * Returns the current width of the image
236
+ * @return int
237
+ */
238
+ function getCurrentWidth() {
239
+ return $this->currentDimensions['width'];
240
+ }
241
+
242
+ /**
243
+ * Returns the current height of the image
244
+ * @return int
245
+ */
246
+ function getCurrentHeight() {
247
+ return $this->currentDimensions['height'];
248
+ }
249
+
250
+ /**
251
+ * Calculates new image width
252
+ * @param int $width
253
+ * @param int $height
254
+ * @return array
255
+ */
256
+ function calcWidth($width, $height) {
257
+ $newWp = (100 * $this->maxWidth) / $width;
258
+ $newHeight = ($height * $newWp) / 100;
259
+ return array('newWidth'=>intval($this->maxWidth), 'newHeight'=>intval($newHeight));
260
+ }
261
+
262
+ /**
263
+ * Calculates new image height
264
+ * @param int $width
265
+ * @param int $height
266
+ * @return array
267
+ */
268
+ function calcHeight($width, $height) {
269
+ $newHp = (100 * $this->maxHeight) / $height;
270
+ $newWidth = ($width * $newHp) / 100;
271
+ return array('newWidth'=>intval($newWidth), 'newHeight'=>intval($this->maxHeight));
272
+ }
273
+
274
+ /**
275
+ * Calculates new image size based on percentage
276
+ * @param int $width
277
+ * @param int $height
278
+ * @return array
279
+ */
280
+ function calcPercent($width, $height) {
281
+ $newWidth = ($width * $this->percent) / 100;
282
+ $newHeight = ($height * $this->percent) / 100;
283
+ return array('newWidth'=>intval($newWidth), 'newHeight'=>intval($newHeight));
284
+ }
285
+
286
+ /**
287
+ * Calculates new image size based on width and height, while constraining to maxWidth and maxHeight
288
+ * @param int $width
289
+ * @param int $height
290
+ */
291
+ function calcImageSize($width,$height) {
292
+ $newSize = array('newWidth'=>$width,'newHeight'=>$height);
293
+
294
+ if($this->maxWidth > 0) {
295
+
296
+ $newSize = $this->calcWidth($width,$height);
297
+
298
+ if($this->maxHeight > 0 && $newSize['newHeight'] > $this->maxHeight) {
299
+ $newSize = $this->calcHeight($newSize['newWidth'],$newSize['newHeight']);
300
+ }
301
+
302
+ //$this->newDimensions = $newSize;
303
+ }
304
+
305
+ if($this->maxHeight > 0) {
306
+ $newSize = $this->calcHeight($width,$height);
307
+
308
+ if($this->maxWidth > 0 && $newSize['newWidth'] > $this->maxWidth) {
309
+ $newSize = $this->calcWidth($newSize['newWidth'],$newSize['newHeight']);
310
+ }
311
+
312
+ //$this->newDimensions = $newSize;
313
+ }
314
+
315
+ $this->newDimensions = $newSize;
316
+ }
317
+
318
+ /**
319
+ * Calculates new image size based percentage
320
+ * @param int $width
321
+ * @param int $height
322
+ */
323
+ function calcImageSizePercent($width,$height) {
324
+ if($this->percent > 0) {
325
+ $this->newDimensions = $this->calcPercent($width,$height);
326
+ }
327
+ }
328
+
329
+ /**
330
+ * Resizes image to maxWidth x maxHeight
331
+ *
332
+ * @param int $maxWidth
333
+ * @param int $maxHeight
334
+ */
335
+
336
+ function resize($maxWidth = 0, $maxHeight = 0, $resampleMode = 3) {
337
+ $this->maxWidth = $maxWidth;
338
+ $this->maxHeight = $maxHeight;
339
+
340
+ $this->calcImageSize($this->currentDimensions['width'],$this->currentDimensions['height']);
341
+
342
+ //string to resize the picture to $this->newDimensions['newWidth'],$this->newDimensions['newHeight']
343
+ //should result in: -thumbnail $this->newDimensions['newWidth']x$this->newDimensions['newHeight']
344
+ if($maxWidth=='0')
345
+ $this->imageMagickExec .= " -resize x".$maxHeight;
346
+ elseif($maxHeight=='0')
347
+ $this->imageMagickExec .= " -resize ".$maxWidth."x";
348
+ elseif($maxHeight!='0' && $maxWidth!='0')
349
+ $this->imageMagickExec .= " -resize ".$maxWidth."x".$maxHeight;
350
+
351
+ // next calculations should be done with the 'new' dimensions
352
+ $this->currentDimensions['width'] = $this->newDimensions['newWidth'];
353
+ $this->currentDimensions['height'] = $this->newDimensions['newHeight'];
354
+
355
+ }
356
+
357
+ /**
358
+ * Flip an image.
359
+ *
360
+ * @param bool $horz flip the image in horizontal mode
361
+ * @param bool $vert flip the image in vertical mode
362
+ */
363
+ function flipImage( $horz = false, $vert = false ) {
364
+
365
+ //TODO: need to be added
366
+
367
+ }
368
+
369
+ /**
370
+ * Rotates image either 90 degrees clockwise or counter-clockwise
371
+ *
372
+ * @param string $direction
373
+ */
374
+ function rotateImage($dir = 'CW') {
375
+
376
+ $angle = ($dir == 'CW') ? 90 : -90;
377
+
378
+ $this->imageMagickExec .= " -rotate $angle ";
379
+
380
+ $newWidth = $this->currentDimensions['height'];
381
+ $newHeight = $this->currentDimensions['width'];
382
+ $this->currentDimensions['width'] = $newWidth;
383
+ $this->currentDimensions['height'] = $newHeight;
384
+ }
385
+
386
+ /**
387
+ * Crops the image from calculated center in a square of $cropSize pixels
388
+ *
389
+ * @param int $cropSize
390
+ */
391
+ function cropFromCenter($cropSize, $resampleMode = 3) {
392
+ if($cropSize > $this->currentDimensions['width']) $cropSize = $this->currentDimensions['width'];
393
+ if($cropSize > $this->currentDimensions['height']) $cropSize = $this->currentDimensions['height'];
394
+
395
+ //$cropX = intval(($this->currentDimensions['width'] - $cropSize) / 2);
396
+ //$cropY = intval(($this->currentDimensions['height'] - $cropSize) / 2);
397
+
398
+ //string to crop the picture to $cropSize,$cropSize (from center)
399
+ //result: -gravity Center -crop $cropSizex$cropSize+0+0
400
+ $this->imageMagickExec .= ' -gravity Center -crop ' . $cropSize . 'x' . $cropSize . '+0+0';
401
+
402
+ // next calculations should be done with the 'new' dimensions
403
+ $this->currentDimensions['width'] = $cropSize;
404
+ $this->currentDimensions['height'] = $cropSize;
405
+ }
406
+
407
+ /**
408
+ * Advanced cropping function that crops an image using $startX and $startY as the upper-left hand corner.
409
+ *
410
+ * @param int $startX
411
+ * @param int $startY
412
+ * @param int $width
413
+ * @param int $height
414
+ */
415
+ function crop($startX,$startY,$width,$height) {
416
+ //make sure the cropped area is not greater than the size of the image
417
+ if($width > $this->currentDimensions['width']) $width = $this->currentDimensions['width'];
418
+ if($height > $this->currentDimensions['height']) $height = $this->currentDimensions['height'];
419
+ //make sure not starting outside the image
420
+ if(($startX + $width) > $this->currentDimensions['width']) $startX = ($this->currentDimensions['width'] - $width);
421
+ if(($startY + $height) > $this->currentDimensions['height']) $startY = ($this->currentDimensions['height'] - $height);
422
+ if($startX < 0) $startX = 0;
423
+ if($startY < 0) $startY = 0;
424
+
425
+ //string to crop the picture to $width,$height (from $startX,$startY)
426
+ //result: -crop $widthx$height+$startX+$startY
427
+ $this->imageMagickExec .= ' -crop ' . $width . 'x' . $height . '+' . $startX .'+' . $startY;
428
+
429
+ $this->currentDimensions['width'] = $width;
430
+ $this->currentDimensions['height'] = $height;
431
+ }
432
+
433
+ /**
434
+ * Creates Apple-style reflection under image, optionally adding a border to main image
435
+ *
436
+ * @param int $percent
437
+ * @param int $reflection
438
+ * @param int $white
439
+ * @param bool $border
440
+ * @param string $borderColor
441
+ */
442
+ function createReflection($percent, $reflection, $white, $border = true, $borderColor = '#a4a4a4') {
443
+
444
+ $width = $this->currentDimensions['width'];
445
+ $height = $this->currentDimensions['height'];
446
+
447
+ $reflectionHeight = intval($height * ($reflection / 100));
448
+ $newHeight = $height + $reflectionHeight;
449
+ //$reflectedPart = $height * ((100-$percent) / 100);
450
+ $reflectedsize = intval($height * ((100 - (100 - $percent) + $reflection) / 100));
451
+
452
+ $this->imageMagickBefore = "-size $width" . "x" ."$newHeight xc:white ";
453
+
454
+ if($border == true) {
455
+ $this->imageMagickBefore .= " \( ";
456
+ $this->imageMagickExec = " -bordercolor '$borderColor' -border 1 \) ";
457
+ }
458
+
459
+ $this->imageMagickExec .= " -geometry +0+0 -composite ";
460
+ $gradientWhite = 100-$white;
461
+ $this->imageMagickExec .= " \( '$this->fileName' -flip -resize $width"."x"."$reflectedsize\! \( -size $width"."x"."$reflectionHeight gradient: -fill black -colorize $gradientWhite \) +matte -compose copy_opacity -composite \) -geometry +0+$height -composite ";
462
+
463
+ $this->currentDimensions['width'] = $width;
464
+ $this->currentDimensions['height'] = $newHeight;
465
+ }
466
+
467
+ /**
468
+ * @param string $color
469
+ * @param string $wmFont
470
+ * @param int $wmSize
471
+ * @param int $wmOpaque
472
+ */
473
+ function watermarkCreateText($color = '000000', $wmFont, $wmSize = 10, $wmOpaque = 90 ){
474
+ //create a watermark.png image with the requested text.
475
+
476
+ // set font path
477
+ $wmFontPath = NGGALLERY_ABSPATH . 'fonts/' . $wmFont;
478
+ if ( !is_readable($wmFontPath) )
479
+ return;
480
+
481
+ /*
482
+ $exec = "convert -size 800x500 xc:grey30 -font $wmFontPath -pointsize $wmSize -gravity center -draw \"fill '#$color$wmOpaque' text 0,0 '$this->watermarkText'\" stamp_fgnd.png";
483
+ $make_magick = system($exec);
484
+ $exec = "convert -size 800x500 xc:black -font $wmFontPath -pointsize $wmSize -gravity center -draw \"fill white text 1,1 '$this->watermarkText' text 0,0 '$this->watermarkText' fill black text -1,-1 '$this->watermarkText'\" +matte stamp_mask.png";
485
+ $make_magick = system($exec);
486
+ $exec = "composite -compose CopyOpacity stamp_mask.png stamp_fgnd.png watermark.png";*/
487
+
488
+ //convert the opacity between FF or 00; 100->0 and 0->FF (256)
489
+ $opacity = dechex( round( (100-$wmOpaque) * 256/100 ) );
490
+ if ($opacity == "0") {$opacity = "00";}
491
+
492
+ $cmd = "-size 800x500 xc:none -fill '#{$color}{$opacity}' -font {$wmFontPath} -pointsize {$wmSize} -gravity center -annotate 0 '{$this->watermarkText}' watermark_text.png";
493
+ $this->execute('convert', $cmd);
494
+
495
+ $cmd = "-trim +repage watermark_text.png";
496
+ $this->execute('mogrify', $cmd);
497
+
498
+ $this->watermarkImgPath = NGGALLERY_ABSPATH . 'watermark_text.png';
499
+
500
+ return;
501
+ }
502
+
503
+ /**
504
+ *
505
+ * @param string $relPOS
506
+ * @param int $xPOS
507
+ * @param int $yPOS
508
+ */
509
+ function watermarkImage( $relPOS = 'botRight', $xPOS = 0, $yPOS = 0) {
510
+
511
+ // if it's not a valid file die...
512
+ /*if ( !is_readable($this->watermarkImgPath))
513
+ {
514
+ echo $this->watermarkImgPath;
515
+ return;
516
+ } */
517
+
518
+ $size = GetImageSize($this->watermarkImgPath);
519
+ $watermarkDimensions = array('width'=>$size[0],'height'=>$size[1]);
520
+
521
+ $sourcefile_width=$this->currentDimensions['width'];
522
+ $sourcefile_height=$this->currentDimensions['height'];
523
+
524
+ $watermarkfile_width=$watermarkDimensions['width'];
525
+ $watermarkfile_height=$watermarkDimensions['height'];
526
+
527
+ switch( substr($relPOS, 0, 3) ){
528
+ case 'top': $dest_y = 0 + $yPOS; break;
529
+ case 'mid': $dest_y = ($sourcefile_height / 2) - ($watermarkfile_height / 2); break;
530
+ case 'bot': $dest_y = $sourcefile_height - $watermarkfile_height - $yPOS; break;
531
+ default : $dest_y = 0; break;
532
+ }
533
+ switch( substr($relPOS, 3) ){
534
+ case 'Left' : $dest_x = 0 + $xPOS; break;
535
+ case 'Center': $dest_x = ($sourcefile_width / 2) - ($watermarkfile_width / 2); break;
536
+ case 'Right': $dest_x = $sourcefile_width - $watermarkfile_width - $xPOS; break;
537
+ default : $dest_x = 0; break;
538
+ }
539
+ if ($dest_y<0) {
540
+ $dest_y = $dest_y;
541
+ } else {
542
+ $dest_y = '+' . $dest_y;
543
+ }
544
+ if ($dest_x<0) {
545
+ $dest_x = $dest_x;
546
+ } else {
547
+ $dest_x = '+' . $dest_x;
548
+ }
549
+
550
+ $this->imageMagickComp .= "'$this->watermarkImgPath' -geometry $dest_x$dest_y -composite";
551
+ //" -dissolve 80% -geometry +$dest_x+$dest_y $this->watermarkImgPath";
552
+ }
553
+
554
+ /**
555
+ * Saves image as $name (can include file path), with quality of # percent if file is a jpeg
556
+ *
557
+ * @param string $name
558
+ * @param int $quality
559
+ * @return bool errorstate
560
+ */
561
+ function save( $name, $quality = 85 ) {
562
+ $this->show($quality,$name);
563
+ if ($this->error == true) {
564
+ //$this->errmsg = 'Create Image failed. Check safe mode settings';
565
+ return false;
566
+ }
567
+
568
+ if( function_exists('do_action') )
569
+ do_action('ngg_ajax_image_save', $name);
570
+
571
+ return true;
572
+ }
573
+
574
+ /**
575
+ * Outputs the image to the screen, or saves to $name if supplied. Quality of JPEG images can be controlled with the $quality variable
576
+ *
577
+ * @param int $quality
578
+ * @param string $name
579
+ */
580
+ function show( $quality = 85, $name = '') {
581
+ //save the image if we get a filename
582
+ if( $name != '' ) {
583
+ $args = "{$this->imageMagickBefore} ";
584
+ $args .= escapeshellarg("$this->fileName");
585
+ $args .= " $this->imageMagickExec $this->imageMagickComp -quality '$quality' ";
586
+ $args .= escapeshellarg("$name");
587
+ //$args = "{$this->imageMagickBefore} '$this->fileName' $this->imageMagickExec $this->imageMagickComp -quality $quality '$name'";
588
+ $this->execute('convert', $args);
589
+ //$this->error = true;
590
+ } else {
591
+ //return a raw image stream
592
+ $args = "{$this->imageMagickBefore} '$this->fileName' $this->imageMagickExec $this->imageMagickComp -quality $quality JPG:-";
593
+ $this->execute('convert', $args, true);
594
+ $this->error = true;
595
+ }
596
+ }
597
+ }
598
+ ?>
lib/locale.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !class_exists('ngg_locale') ) :
3
+ /**
4
+ * Install locale files from WordPress.org plugin repository
5
+ *
6
+ * @version 1.0.0
7
+ * @author Alex Rabe
8
+ *
9
+ * @package NextGEN Gallery
10
+ * @since 1.5.0
11
+ */
12
+
13
+ class ngg_locale {
14
+
15
+ /**
16
+ * Current locale
17
+ *
18
+ * @var string
19
+ */
20
+ var $locale = '';
21
+
22
+ /**
23
+ * Plugin domain name
24
+ *
25
+ * @var string
26
+ */
27
+ var $domain = 'nggallery';
28
+
29
+ /**
30
+ * URL to the translation files
31
+ *
32
+ * @var string
33
+ */
34
+ var $remote_locale_url = 'http://nextgen-gallery.googlecode.com/files/';
35
+
36
+ /**
37
+ * Plugin path to the langauage files
38
+ *
39
+ * @var string
40
+ */
41
+ var $plugin_locale_path = 'lang';
42
+
43
+ /**
44
+ * Server path to the locale file on the server
45
+ *
46
+ * @var string
47
+ */
48
+ var $mo_file = '';
49
+
50
+ /**
51
+ * URL to the locale file from the remote server
52
+ *
53
+ * @var string
54
+ */
55
+ var $mo_url = '';
56
+
57
+ /**
58
+ * Repsonse code for request
59
+ *
60
+ * @var array
61
+ */
62
+ var $repsonse = '';
63
+
64
+ /**
65
+ * PHP4 compatibility layer for calling the PHP5 constructor.
66
+ *
67
+ */
68
+ function install_locale() {
69
+ return $this->__construct();
70
+ }
71
+
72
+ /**
73
+ * Init the Database Abstraction layer for NextGEN Gallery
74
+ *
75
+ */
76
+ function __construct() {
77
+ $this->plugin_locale_path = NGGALLERY_ABSPATH . 'lang/';
78
+ $this->locale = get_locale();
79
+
80
+ $this->mo_file = trailingslashit($this->plugin_locale_path) . $this->domain . '-' . $this->locale . '.mo';
81
+ $this->mo_url = trailingslashit($this->remote_locale_url) . $this->domain . '-' . $this->locale . '.mo';
82
+ }
83
+
84
+ /**
85
+ * This functions checks if a translation is at wp.org available
86
+ * Please note, if a language file is already loaded it exits as well
87
+ *
88
+ * @return string result of check ( default | installed | not_exist | available )
89
+ */
90
+ function check() {
91
+
92
+ // we do not need to check for translation if you use english
93
+ if ( ($this->locale == 'en_US') )
94
+ return 'default';
95
+
96
+ $this->response = wp_remote_get($this->mo_url, array('timeout' => 300));
97
+
98
+ // if a language file exist, do not load it again
99
+ if ( is_readable( $this->mo_file ) )
100
+ return 'installed';
101
+
102
+ // if no translation file exists exit the check
103
+ if ( is_wp_error($this->response) || $this->response['response']['code'] != '200' )
104
+ return 'not_exist';
105
+
106
+ return 'available';
107
+ }
108
+
109
+ /**
110
+ * Downloads a locale to the plugin folder using the WordPress HTTP Class.
111
+ *
112
+ * @author taken from WP core
113
+ * @return mixed WP_Error on failure, true on success.
114
+ */
115
+ function download_locale() {
116
+
117
+ $url = $this->mo_url;
118
+
119
+ if ( ! $url )
120
+ return new WP_Error('http_no_url', __('Invalid URL Provided.'));
121
+
122
+ $filename = $this->mo_file;
123
+ if ( ! $filename )
124
+ return new WP_Error('http_no_file', __('Could not create Temporary file.'));
125
+
126
+ $handle = @fopen($filename, 'wb');
127
+ if ( ! $handle )
128
+ return new WP_Error('http_no_file', __('Could not create Temporary file.'));
129
+
130
+ $response = wp_remote_get($url, array('timeout' => 300));
131
+
132
+ if ( is_wp_error($response) ) {
133
+ fclose($handle);
134
+ unlink($filename);
135
+ return $response;
136
+ }
137
+
138
+ if ( $response['response']['code'] != '200' ){
139
+ fclose($handle);
140
+ unlink($filename);
141
+ return new WP_Error('http_404', trim($response['response']['message']));
142
+ }
143
+
144
+ fwrite($handle, $response['body']);
145
+ fclose($handle);
146
+
147
+ return true;
148
+ }
149
+
150
+ }
151
+ endif;
152
+ ?>
lib/media-rss.php ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class to produce Media RSS nodes
4
+ *
5
+ * @author Vincent Prat
6
+ * @copyright Copyright 2008-2011
7
+ */
8
+ class nggMediaRss {
9
+
10
+ /**
11
+ * Function called by the wp_head action to output the RSS link for medias
12
+ */
13
+ function add_mrss_alternate_link() {
14
+ echo "<link id='MediaRSS' rel='alternate' type='application/rss+xml' title='NextGEN Gallery RSS Feed' href='" . nggMediaRss::get_mrss_url() . "' />\n";
15
+ }
16
+
17
+ /**
18
+ * Add the javascript required to enable PicLens/CoolIris support
19
+ */
20
+ function add_piclens_javascript() {
21
+ if (is_ssl())
22
+ wp_enqueue_script( 'piclens', 'https://lite.piclens.com/current/piclens_optimized.js', array(), false, true);
23
+ else
24
+ wp_enqueue_script( 'piclens', 'http://lite.piclens.com/current/piclens_optimized.js', array(), false, true);
25
+ }
26
+
27
+ /**
28
+ * Get the URL of the general media RSS
29
+ */
30
+ function get_mrss_url() {
31
+ return NGGALLERY_URLPATH . 'xml/media-rss.php';
32
+ }
33
+
34
+ /**
35
+ * Get the URL of a gallery media RSS
36
+ */
37
+ function get_gallery_mrss_url($gid, $prev_next = false) {
38
+ return nggMediaRss::get_mrss_url() . '?' . ('gid=' . $gid . ($prev_next ? '&prev_next=true' : '') . '&mode=gallery');
39
+ }
40
+
41
+ /**
42
+ * Get the URL of an album media RSS
43
+ */
44
+ function get_album_mrss_url($aid) {
45
+ return nggMediaRss::get_mrss_url() . '?' . ('aid=' . $aid . '&mode=album');
46
+ }
47
+
48
+ /**
49
+ * Get the URL of the media RSS for last pictures
50
+ */
51
+ function get_last_pictures_mrss_url($page = 0, $show = 30) {
52
+ return nggMediaRss::get_mrss_url() . '?' . ('show=' . $show . '&page=' . $page . '&mode=last_pictures');
53
+ }
54
+
55
+ /**
56
+ * Get the XML <rss> node corresponding to the last pictures registered
57
+ *
58
+ * @param page The current page (defaults to 0)
59
+ * @param show The number of pictures to include in one field (default 30)
60
+ */
61
+ function get_last_pictures_mrss($page = 0, $show = 30) {
62
+ $images = nggdb::find_last_images($page, $show);
63
+
64
+ $title = stripslashes(get_option('blogname'));
65
+ $description = stripslashes(get_option('blogdescription'));
66
+ $link = site_url();
67
+ $prev_link = ($page > 0) ? nggMediaRss::get_last_pictures_mrss_url($page-1, $show) : '';
68
+ $next_link = count($images)!=0 ? nggMediaRss::get_last_pictures_mrss_url($page+1, $show) : '';
69
+
70
+ return nggMediaRss::get_mrss_root_node($title, $description, $link, $prev_link, $next_link, $images);
71
+ }
72
+
73
+ /**
74
+ * Get the XML <rss> node corresponding to a gallery
75
+ *
76
+ * @param $gallery (object) The gallery to include in RSS
77
+ * @param $prev_gallery (object) The previous gallery to link in RSS (null if none)
78
+ * @param $next_gallery (object) The next gallery to link in RSS (null if none)
79
+ */
80
+ function get_gallery_mrss($gallery, $prev_gallery = null, $next_gallery = null) {
81
+
82
+ $ngg_options = nggGallery::get_option('ngg_options');
83
+ //Set sort order value, if not used (upgrade issue)
84
+ $ngg_options['galSort'] = ($ngg_options['galSort']) ? $ngg_options['galSort'] : 'pid';
85
+ $ngg_options['galSortDir'] = ($ngg_options['galSortDir'] == 'DESC') ? 'DESC' : 'ASC';
86
+
87
+ $title = stripslashes(nggGallery::i18n($gallery->title));
88
+ $description = stripslashes(nggGallery::i18n($gallery->galdesc));
89
+ $link = nggMediaRss::get_permalink($gallery->pageid);
90
+ $prev_link = ( $prev_gallery != null) ? nggMediaRss::get_gallery_mrss_url($prev_gallery->gid, true) : '';
91
+ $next_link = ( $next_gallery != null) ? nggMediaRss::get_gallery_mrss_url($next_gallery->gid, true) : '';
92
+ $images = nggdb::get_gallery($gallery->gid, $ngg_options['galSort'], $ngg_options['galSortDir']);
93
+
94
+ return nggMediaRss::get_mrss_root_node($title, $description, $link, $prev_link, $next_link, $images);
95
+ }
96
+
97
+ /**
98
+ * Get the XML <rss> node corresponding to an album
99
+ *
100
+ * @param $album The album to include in RSS
101
+ */
102
+ function get_album_mrss($album) {
103
+
104
+ $title = stripslashes(nggGallery::i18n($album->name));
105
+ $description = '';
106
+ $link = nggMediaRss::get_permalink(0);
107
+ $prev_link = '';
108
+ $next_link = '';
109
+ $images = nggdb::find_images_in_album($album->id);
110
+
111
+ return nggMediaRss::get_mrss_root_node($title, $description, $link, $prev_link, $next_link, $images);
112
+ }
113
+
114
+ /**
115
+ * Get the XML <rss> node
116
+ */
117
+ function get_mrss_root_node($title, $description, $link, $prev_link, $next_link, $images) {
118
+
119
+ if ($prev_link != '' || $next_link != '')
120
+ $out = "<rss version='2.0' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom='http://www.w3.org/2005/Atom'>\n" ;
121
+ else
122
+ $out = "<rss version='2.0' xmlns:media='http://search.yahoo.com/mrss/'>\n";
123
+
124
+ $out .= "\t<channel>\n";
125
+
126
+ $out .= nggMediaRss::get_generator_mrss_node();
127
+ $out .= nggMediaRss::get_title_mrss_node($title);
128
+ $out .= nggMediaRss::get_description_mrss_node($description);
129
+ $out .= nggMediaRss::get_link_mrss_node($link);
130
+
131
+ if ($prev_link != '' || $next_link != '')
132
+ $out .= nggMediaRss::get_self_node(nggMediaRss::get_mrss_url());
133
+ if ($prev_link!='') {
134
+ $out .= nggMediaRss::get_previous_link_mrss_node($prev_link);
135
+ }
136
+ if ($next_link!='') {
137
+ $out .= nggMediaRss::get_next_link_mrss_node($next_link);
138
+ }
139
+
140
+ foreach ($images as $image) {
141
+ $out .= nggMediaRss::get_image_mrss_node($image);
142
+ }
143
+
144
+ $out .= "\t</channel>\n";
145
+ $out .= "</rss>\n";
146
+
147
+ return $out;
148
+ }
149
+
150
+ /**
151
+ * Get the XML <generator> node
152
+ */
153
+ function get_generator_mrss_node($indent = "\t\t") {
154
+ return $indent . "<generator><![CDATA[NextGEN Gallery [http://nextgen-gallery.com]]]></generator>\n";
155
+ }
156
+
157
+ /**
158
+ * Get the XML <title> node
159
+ */
160
+ function get_title_mrss_node($title, $indent = "\t\t") {
161
+ return $indent . "<title>" . $title . "</title>\n";
162
+ }
163
+
164
+ /**
165
+ * Get the XML <description> node
166
+ */
167
+ function get_description_mrss_node($description, $indent = "\t\t") {
168
+ return $indent . "<description>" . $description . "</description>\n";
169
+ }
170
+
171
+ /**
172
+ * Get the XML <link> node
173
+ */
174
+ function get_link_mrss_node($link, $indent = "\t\t") {
175
+ return $indent . "<link><![CDATA[" . htmlspecialchars($link) . "]]></link>\n";
176
+ }
177
+
178
+ /**
179
+ * Get the XML <atom:link self> node
180
+ */
181
+ function get_self_node($link, $indent = "\t\t") {
182
+ return $indent . "<atom:link rel='self' href='" . htmlspecialchars($link) . "' type='application/rss+xml' />\n";
183
+ }
184
+
185
+ /**
186
+ * Get the XML <atom:link previous> node
187
+ */
188
+ function get_previous_link_mrss_node($link, $indent = "\t\t") {
189
+ return $indent . "<atom:link rel='previous' href='" . htmlspecialchars($link) . "' />\n";
190
+ }
191
+
192
+ /**
193
+ * Get the XML <atom:link next> node
194
+ */
195
+ function get_next_link_mrss_node($link, $indent = "\t\t") {
196
+ return $indent . "<atom:link rel='next' href='" . htmlspecialchars($link) . "' />\n";
197
+ }
198
+
199
+ /**
200
+ * Get the XML <item> node corresponding to one single image
201
+ *
202
+ * @param $image The image object
203
+ */
204
+ function get_image_mrss_node($image, $indent = "\t\t" ) {
205
+ $ngg_options = nggGallery::get_option('ngg_options');
206
+
207
+ $tags = $image->get_tags();
208
+ $tag_names = '';
209
+ foreach ($tags as $tag) {
210
+ $tag_names .= ($tag_names=='' ? $tag->name : ', ' . $tag->name);
211
+ }
212
+
213
+ $title = html_entity_decode(stripslashes($image->alttext));
214
+ $desc = html_entity_decode(stripslashes($image->description));
215
+
216
+ $thumbwidth = $ngg_options['thumbwidth'];
217
+ $thumbheight = ($ngg_options['thumbfix'] ? $ngg_options['thumbheight'] : $thumbwidth);
218
+
219
+ $out = $indent . "<item>\n";
220
+ $out .= $indent . "\t<title><![CDATA[" . nggGallery::i18n($title, 'pic_' . $image->pid . '_alttext') . "]]></title>\n";
221
+ $out .= $indent . "\t<description><![CDATA[" . nggGallery::i18n($desc, 'pic_' . $image->pid . '_description') . "]]></description>\n";
222
+ $out .= $indent . "\t<link><![CDATA[" . $image->get_permalink() . "]]></link>\n";
223
+ $out .= $indent . "\t<guid>image-id:" . $image->pid . "</guid>\n";
224
+ $out .= $indent . "\t<media:content url='" . esc_url($image->imageURL) . "' medium='image' />\n";
225
+ $out .= $indent . "\t<media:title><![CDATA[" . nggGallery::i18n($title, 'pic_' . $image->pid . '_alttext') . "]]></media:title>\n";
226
+ $out .= $indent . "\t<media:description><![CDATA[" . nggGallery::i18n($desc, 'pic_' . $image->pid . '_description') . "]]></media:description>\n";
227
+ $out .= $indent . "\t<media:thumbnail url='" . esc_url($image->thumbURL) . "' width='" . $thumbwidth . "' height='" . $thumbheight . "' />\n";
228
+ $out .= $indent . "\t<media:keywords><![CDATA[" . nggGallery::i18n($tag_names) . "]]></media:keywords>\n";
229
+ $out .= $indent . "\t<media:copyright><![CDATA[Copyright (c) " . get_option("blogname") . " (" . site_url() . ")]]></media:copyright>\n";
230
+ $out .= $indent . "</item>\n";
231
+
232
+ return $out;
233
+ }
234
+
235
+ function get_permalink($page_id) {
236
+ if ($page_id == 0)
237
+ $permalink = site_url();
238
+ else
239
+ $permalink = get_permalink($page_id);
240
+
241
+ return $permalink;
242
+ }
243
+
244
+ }
245
+
246
+ ?>
lib/meta.php ADDED
@@ -0,0 +1,574 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Image METADATA PHP class for the WordPress plugin NextGEN Gallery
5
+ * nggmeta.lib.php
6
+ *
7
+ * @author Alex Rabe
8
+ *
9
+ *
10
+ */
11
+
12
+ class nggMeta{
13
+
14
+ /**** Image Data ****/
15
+ var $image = ''; // The image object
16
+ var $size = false; // The image size
17
+ var $exif_data = false; // EXIF data array
18
+ var $iptc_data = false; // IPTC data array
19
+ var $xmp_data = false; // XMP data array
20
+ /**** Filtered Data ****/
21
+ var $exif_array = false; // EXIF data array
22
+ var $iptc_array = false; // IPTC data array
23
+ var $xmp_array = false; // XMP data array
24
+
25
+ var $sanitize = false; // sanitize meta data on request
26
+
27
+ /**
28
+ * Parses the nggMeta data only if needed
29
+ * @param int $image path to a image
30
+ * @param bool $onlyEXIF parse only exif if needed
31
+ * @return
32
+ */
33
+ function nggMeta($pic_id, $onlyEXIF = false) {
34
+
35
+ //get the path and other data about the image
36
+ $this->image = nggdb::find_image( $pic_id );
37
+
38
+ $this->image = apply_filters( 'ngg_find_image_meta', $this->image );
39
+
40
+ if ( !file_exists( $this->image->imagePath ) )
41
+ return false;
42
+
43
+ $this->size = @getimagesize ( $this->image->imagePath , $metadata );
44
+
45
+ if ($this->size && is_array($metadata)) {
46
+
47
+ // get exif - data
48
+ if ( is_callable('exif_read_data'))
49
+ $this->exif_data = @exif_read_data($this->image->imagePath , 0, true );
50
+
51
+ // stop here if we didn't need other meta data
52
+ if ($onlyEXIF)
53
+ return true;
54
+
55
+ // get the iptc data - should be in APP13
56
+ if ( is_callable('iptcparse') && isset($metadata['APP13']) )
57
+ $this->iptc_data = @iptcparse($metadata['APP13']);
58
+
59
+ // get the xmp data in a XML format
60
+ if ( is_callable('xml_parser_create'))
61
+ $this->xmp_data = $this->extract_XMP($this->image->imagePath );
62
+
63
+ return true;
64
+ }
65
+
66
+ return false;
67
+ }
68
+
69
+ /**
70
+ * return the saved meta data from the database
71
+ *
72
+ * @since 1.4.0
73
+ * @param string $object (optional)
74
+ * @return array|mixed return either the complete array or the single object
75
+ */
76
+ function get_saved_meta($object = false) {
77
+
78
+ $meta = $this->image->meta_data;
79
+
80
+ //check if we already import the meta data to the database
81
+ if (!is_array($meta) || ($meta['saved'] != true))
82
+ return false;
83
+
84
+ // return one element if requested
85
+ if ($object)
86
+ return $meta[$object];
87
+
88
+ //removed saved parameter we don't need that to show
89
+ unset($meta['saved']);
90
+
91
+ // and remove empty tags or arrays
92
+ foreach ($meta as $key => $value) {
93
+ if ( empty($value) OR is_array($value))
94
+ unset($meta[$key]);
95
+ }
96
+
97
+ // on request sanitize the output
98
+ if ( $this->sanitize == true )
99
+ array_walk( $meta , create_function('&$value', '$value = esc_html($value);'));
100
+
101
+ return $meta;
102
+ }
103
+
104
+ /**
105
+ * nggMeta::get_EXIF()
106
+ * See also http://trac.wordpress.org/changeset/6313
107
+ *
108
+ * @return structured EXIF data
109
+ */
110
+ function get_EXIF($object = false) {
111
+
112
+ if ( !$this->exif_data )
113
+ return false;
114
+
115
+ if (!is_array($this->exif_array)){
116
+
117
+ $meta= array();
118
+
119
+ if ( isset($this->exif_data['EXIF']) ) {
120
+ $exif = $this->exif_data['EXIF'];
121
+
122
+ if (!empty($exif['FNumber']))
123
+ $meta['aperture'] = 'F ' . round( $this->exif_frac2dec( $exif['FNumber'] ), 2 );
124
+ if (!empty($exif['Model']))
125
+ $meta['camera'] = trim( $exif['Model'] );
126
+ if (!empty($exif['DateTimeDigitized']))
127
+ $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeDigitized']));
128
+ else if (!empty($exif['DateTimeOriginal']))
129
+ $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeOriginal']));
130
+ if (!empty($exif['FocalLength']))
131
+ $meta['focal_length'] = $this->exif_frac2dec( $exif['FocalLength'] ) . __(' mm','nggallery');
132
+ if (!empty($exif['ISOSpeedRatings']))
133
+ $meta['iso'] = $exif['ISOSpeedRatings'];
134
+ if (!empty($exif['ExposureTime'])) {
135
+ $meta['shutter_speed'] = $this->exif_frac2dec ($exif['ExposureTime']);
136
+ $meta['shutter_speed'] =($meta['shutter_speed'] > 0.0 and $meta['shutter_speed'] < 1.0) ? ( '1/' . round( 1 / $meta['shutter_speed'], -1) ) : ($meta['shutter_speed']);
137
+ $meta['shutter_speed'] .= __(' sec','nggallery');
138
+ }
139
+ //Bit 0 indicates the flash firing status
140
+ if (!empty($exif['Flash']))
141
+ $meta['flash'] = ( $exif['Flash'] & 1 ) ? __('Fired', 'nggallery') : __('Not fired',' nggallery');
142
+ }
143
+
144
+ // additional information
145
+ if ( isset($this->exif_data['IFD0']) ) {
146
+ $exif = $this->exif_data['IFD0'];
147
+
148
+ if (!empty($exif['Model']))
149
+ $meta['camera'] = $exif['Model'];
150
+ if (!empty($exif['Make']))
151
+ $meta['make'] = $exif['Make'];
152
+ if (!empty($exif['ImageDescription']))
153
+ $meta['title'] = utf8_encode($exif['ImageDescription']);
154
+ if (!empty($exif['Orientation']))
155
+ $meta['Orientation'] = $exif['Orientation'];
156
+ }
157
+
158
+ // this is done by Windows
159
+ if ( isset($this->exif_data['WINXP']) ) {
160
+ $exif = $this->exif_data['WINXP'];
161
+
162
+ if (!empty($exif['Title']) && empty($meta['title']))
163
+ $meta['title'] = utf8_encode($exif['Title']);
164
+ if (!empty($exif['Author']))
165
+ $meta['author'] = utf8_encode($exif['Author']);
166
+ if (!empty($exif['Keywords']))
167
+ $meta['tags'] = utf8_encode($exif['Keywords']);
168
+ if (!empty($exif['Subject']))
169
+ $meta['subject'] = utf8_encode($exif['Subject']);
170
+ if (!empty($exif['Comments']))
171
+ $meta['caption'] = utf8_encode($exif['Comments']);
172
+ }
173
+
174
+ $this->exif_array = $meta;
175
+ }
176
+
177
+ // return one element if requested
178
+ if ( $object == true ) {
179
+ $value = isset($this->exif_array[$object]) ? $this->exif_array[$object] : false;
180
+ return $value;
181
+ }
182
+
183
+ // on request sanitize the output
184
+ if ( $this->sanitize == true )
185
+ array_walk( $this->exif_array , create_function('&$value', '$value = esc_html($value);'));
186
+
187
+ return $this->exif_array;
188
+
189
+ }
190
+
191
+ // convert a fraction string to a decimal
192
+ function exif_frac2dec($str) {
193
+ @list( $n, $d ) = explode( '/', $str );
194
+ if ( !empty($d) )
195
+ return $n / $d;
196
+ return $str;
197
+ }
198
+
199
+ // convert the exif date format to a unix timestamp
200
+ function exif_date2ts($str) {
201
+ // seriously, who formats a date like 'YYYY:MM:DD hh:mm:ss'?
202
+ @list( $date, $time ) = explode( ' ', trim($str) );
203
+ @list( $y, $m, $d ) = explode( ':', $date );
204
+
205
+ return strtotime( "{$y}-{$m}-{$d} {$time}" );
206
+ }
207
+
208
+ /**
209
+ * nggMeta::readIPTC() - IPTC Data Information for EXIF Display
210
+ *
211
+ * @param mixed $output_tag
212
+ * @return IPTC-tags
213
+ */
214
+ function get_IPTC($object = false) {
215
+
216
+ if (!$this->iptc_data)
217
+ return false;
218
+
219
+ if (!is_array($this->iptc_array)){
220
+
221
+ // --------- Set up Array Functions --------- //
222
+ $iptcTags = array (
223
+ "2#005" => 'title',
224
+ "2#007" => 'status',
225
+ "2#012" => 'subject',
226
+ "2#015" => 'category',
227
+ "2#025" => 'keywords',
228
+ "2#055" => 'created_date',
229
+ "2#060" => 'created_time',
230
+ "2#080" => 'author',
231
+ "2#085" => 'position',
232
+ "2#090" => 'city',
233
+ "2#092" => 'location',
234
+ "2#095" => 'state',
235
+ "2#100" => 'country_code',
236
+ "2#101" => 'country',
237
+ "2#105" => 'headline',
238
+ "2#110" => 'credit',
239
+ "2#115" => 'source',
240
+ "2#116" => 'copyright',
241
+ "2#118" => 'contact',
242
+ "2#120" => 'caption'
243
+ );
244
+
245
+ $meta = array();
246
+ foreach ($iptcTags as $key => $value) {
247
+ if (isset ( $this->iptc_data[$key] ) )
248
+ $meta[$value] = trim(utf8_encode(implode(", ", $this->iptc_data[$key])));
249
+
250
+ }
251
+ $this->iptc_array = $meta;
252
+ }
253
+
254
+ // return one element if requested
255
+ if ($object)
256
+ return (isset($this->iptc_array[$object])) ? $this->iptc_array[$object] : NULL;
257
+
258
+ // on request sanitize the output
259
+ if ( $this->sanitize == true )
260
+ array_walk( $this->iptc_array , create_function('&$value', '$value = esc_html($value);'));
261
+
262
+ return $this->iptc_array;
263
+ }
264
+
265
+ /**
266
+ * nggMeta::extract_XMP()
267
+ * get XMP DATA
268
+ * code by Pekka Saarinen http://photography-on-the.net
269
+ *
270
+ * @param mixed $filename
271
+ * @return XML data
272
+ */
273
+ function extract_XMP( $filename ) {
274
+
275
+ //TODO:Require a lot of memory, could be better
276
+ ob_start();
277
+ @readfile($filename);
278
+ $source = ob_get_contents();
279
+ ob_end_clean();
280
+
281
+ $start = strpos( $source, "<x:xmpmeta" );
282
+ $end = strpos( $source, "</x:xmpmeta>" );
283
+ if ((!$start === false) && (!$end === false)) {
284
+ $lenght = $end - $start;
285
+ $xmp_data = substr($source, $start, $lenght+12 );
286
+ unset($source);
287
+ return $xmp_data;
288
+ }
289
+
290
+ unset($source);
291
+ return false;
292
+ }
293
+
294
+ /**
295
+ * nggMeta::get_XMP()
296
+ *
297
+ * @package Taken from http://php.net/manual/en/function.xml-parse-into-struct.php
298
+ * @author Alf Marius Foss Olsen & Alex Rabe
299
+ * @return XML Array or object
300
+ *
301
+ */
302
+ function get_XMP($object = false) {
303
+
304
+ if(!$this->xmp_data)
305
+ return false;
306
+
307
+ if (!is_array($this->xmp_array)){
308
+
309
+ $parser = xml_parser_create();
310
+ xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); // Dont mess with my cAsE sEtTings
311
+ xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); // Dont bother with empty info
312
+ xml_parse_into_struct($parser, $this->xmp_data, $values);
313
+ xml_parser_free($parser);
314
+
315
+ $xmlarray = array(); // The XML array
316
+ $this->xmp_array = array(); // The returned array
317
+ $stack = array(); // tmp array used for stacking
318
+ $list_array = array(); // tmp array for list elements
319
+ $list_element = false; // rdf:li indicator
320
+
321
+ foreach($values as $val) {
322
+
323
+ if($val['type'] == "open") {
324
+ array_push($stack, $val['tag']);
325
+
326
+ } elseif($val['type'] == "close") {
327
+ // reset the compared stack
328
+ if ($list_element == false)
329
+ array_pop($stack);
330
+ // reset the rdf:li indicator & array
331
+ $list_element = false;
332
+ $list_array = array();
333
+
334
+ } elseif($val['type'] == "complete") {
335
+ if ($val['tag'] == "rdf:li") {
336
+ // first go one element back
337
+ if ($list_element == false)
338
+ array_pop($stack);
339
+ $list_element = true;
340
+ // do not parse empty tags
341
+ if ( empty($val['value']) ) continue;
342
+ // save it in our temp array
343
+ $list_array[] = $val['value'];
344
+ // in the case it's a list element we seralize it
345
+ $value = implode(",", $list_array);
346
+ $this->setArrayValue($xmlarray, $stack, $value);
347
+ } else {
348
+ array_push($stack, $val['tag']);
349
+ // do not parse empty tags
350
+ if ( !empty($val['value']) )
351
+ $this->setArrayValue($xmlarray, $stack, $val['value']);
352
+ array_pop($stack);
353
+ }
354
+ }
355
+
356
+ } // foreach
357
+
358
+ // don't parse a empty array
359
+ if( empty($xmlarray) || empty($xmlarray['x:xmpmeta']) )
360
+ return false;
361
+
362
+ // cut off the useless tags
363
+ $xmlarray = $xmlarray['x:xmpmeta']['rdf:RDF']['rdf:Description'];
364
+
365
+ // --------- Some values from the XMP format--------- //
366
+ $xmpTags = array (
367
+ 'xap:CreateDate' => 'created_timestamp',
368
+ 'xap:ModifyDate' => 'last_modfied',
369
+ 'xap:CreatorTool' => 'tool',
370
+ 'dc:format' => 'format',
371
+ 'dc:title' => 'title',
372
+ 'dc:creator' => 'author',
373
+ 'dc:subject' => 'keywords',
374
+ 'dc:description' => 'caption',
375
+ 'photoshop:AuthorsPosition' => 'position',
376
+ 'photoshop:City' => 'city',
377
+ 'photoshop:Country' => 'country'
378
+ );
379
+
380
+ foreach ($xmpTags as $key => $value) {
381
+ // if the kex exist
382
+ if ( isset($xmlarray[$key]) ) {
383
+ switch ($key) {
384
+ case 'xap:CreateDate':
385
+ case 'xap:ModifyDate':
386
+ $this->xmp_array[$value] = date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($xmlarray[$key]));
387
+ break;
388
+ default :
389
+ $this->xmp_array[$value] = $xmlarray[$key];
390
+ }
391
+ }
392
+ }
393
+
394
+ }
395
+
396
+ // return one element if requested
397
+ if ($object != false )
398
+ return isset($this->xmp_array[$object]) ? $this->xmp_array[$object] : false;
399
+
400
+ // on request sanitize the output
401
+ if ( $this->sanitize == true )
402
+ array_walk( $this->xmp_array , create_function('&$value', '$value = esc_html($value);'));
403
+
404
+ return $this->xmp_array;
405
+ }
406
+
407
+ function setArrayValue(&$array, $stack, $value) {
408
+ if ($stack) {
409
+ $key = array_shift($stack);
410
+ $this->setArrayValue($array[$key], $stack, $value);
411
+ return $array;
412
+ } else {
413
+ $array = $value;
414
+ }
415
+ }
416
+
417
+ /**
418
+ * nggMeta::get_META() - return a meta value form the available list
419
+ *
420
+ * @param string $object
421
+ * @return mixed $value
422
+ */
423
+ function get_META($object = false) {
424
+
425
+ // defined order first look into database, then XMP, IPTC and EXIF.
426
+ if ($value = $this->get_saved_meta($object))
427
+ return $value;
428
+ if ($value = $this->get_XMP($object))
429
+ return $value;
430
+ if ($value = $this->get_IPTC($object))
431
+ return $value;
432
+ if ($value = $this->get_EXIF($object))
433
+ return $value;
434
+
435
+ // nothing found ?
436
+ return false;
437
+ }
438
+
439
+ /**
440
+ * nggMeta::i8n_name() - localize the tag name
441
+ *
442
+ * @param mixed $key
443
+ * @return translated $key
444
+ */
445
+ function i8n_name($key) {
446
+
447
+ $tagnames = array(
448
+ 'aperture' => __('Aperture','nggallery'),
449
+ 'credit' => __('Credit','nggallery'),
450
+ 'camera' => __('Camera','nggallery'),
451
+ 'caption' => __('Caption','nggallery'),
452
+ 'created_timestamp' => __('Date/Time','nggallery'),
453
+ 'copyright' => __('Copyright','nggallery'),
454
+ 'focal_length' => __('Focal length','nggallery'),
455
+ 'iso' => __('ISO','nggallery'),
456
+ 'shutter_speed' => __('Shutter speed','nggallery'),
457
+ 'title' => __('Title','nggallery'),
458
+ 'author' => __('Author','nggallery'),
459
+ 'tags' => __('Tags','nggallery'),
460
+ 'subject' => __('Subject','nggallery'),
461
+ 'make' => __('Make','nggallery'),
462
+ 'status' => __('Edit Status','nggallery'),
463
+ 'category' => __('Category','nggallery'),
464
+ 'keywords' => __('Keywords','nggallery'),
465
+ 'created_date' => __('Date Created','nggallery'),
466
+ 'created_time' => __('Time Created','nggallery'),
467
+ 'position' => __('Author Position','nggallery'),
468
+ 'city' => __('City','nggallery'),
469
+ 'location' => __('Location','nggallery'),
470
+ 'state' => __('Province/State','nggallery'),
471
+ 'country_code' => __('Country code','nggallery'),
472
+ 'country' => __('Country','nggallery'),
473
+ 'headline' => __('Headline','nggallery'),
474
+ 'credit' => __('Credit','nggallery'),
475
+ 'source' => __('Source','nggallery'),
476
+ 'copyright' => __('Copyright Notice','nggallery'),
477
+ 'contact' => __('Contact','nggallery'),
478
+ 'last_modfied' => __('Last modified','nggallery'),
479
+ 'tool' => __('Program tool','nggallery'),
480
+ 'format' => __('Format','nggallery'),
481
+ 'width' => __('Image Width','nggallery'),
482
+ 'height' => __('Image Height','nggallery'),
483
+ 'flash' => __('Flash','nggallery')
484
+ );
485
+
486
+ if ( isset($tagnames[$key]) )
487
+ $key = $tagnames[$key];
488
+
489
+ return($key);
490
+
491
+ }
492
+
493
+ /**
494
+ * Return the Timestamp from the image , if possible it's read from exif data
495
+ *
496
+ * @return
497
+ */
498
+ function get_date_time() {
499
+
500
+ $date_time = time();
501
+
502
+ // get exif - data
503
+ if ( isset( $this->exif_data['EXIF']) ) {
504
+
505
+ // try to read the date / time from the exif
506
+ foreach (array('DateTimeDigitized', 'DateTimeOriginal', 'FileDateTime') as $key) {
507
+ if (isset($this->exif_data['EXIF'][$key])) {
508
+ $date_time = strtotime($this->exif_data['EXIF'][$key]);
509
+ break;
510
+ }
511
+ }
512
+ } else {
513
+ // if no other date available, get the filetime
514
+ $date_time = @filectime($this->image->imagePath );
515
+ }
516
+
517
+ // Return the MySQL format
518
+ $date_time = date( 'Y-m-d H:i:s', $date_time );
519
+
520
+ return $date_time;
521
+ }
522
+
523
+ /**
524
+ * This function return the most common metadata, via a filter we can add more
525
+ * Reason : GD manipulation removes that options
526
+ *
527
+ * @since V1.4.0
528
+ * @return void
529
+ */
530
+ function get_common_meta() {
531
+ global $wpdb;
532
+
533
+ $meta = array(
534
+ 'aperture' => 0,
535
+ 'credit' => '',
536
+ 'camera' => '',
537
+ 'caption' => '',
538
+ 'created_timestamp' => 0,
539
+ 'copyright' => '',
540
+ 'focal_length' => 0,
541
+ 'iso' => 0,
542
+ 'shutter_speed' => 0,
543
+ 'flash' => 0,
544
+ 'title' => '',
545
+ 'keywords' => ''
546
+ );
547
+
548
+ $meta = apply_filters( 'ngg_read_image_metadata', $meta );
549
+
550
+ // meta should be still an array
551
+ if ( !is_array($meta) )
552
+ return false;
553
+
554
+ foreach ($meta as $key => $value) {
555
+ $meta[$key] = $this->get_META($key);
556
+ }
557
+
558
+ //let's add now the size of the image
559
+ $meta['width'] = $this->size[0];
560
+ $meta['height'] = $this->size[1];
561
+
562
+ return $meta;
563
+ }
564
+
565
+ /**
566
+ * If needed sanitize each value before output
567
+ *
568
+ * @return void
569
+ */
570
+ function sanitize () {
571
+ $this->sanitize = true;
572
+ }
573
+
574
+ }
lib/multisite.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Main PHP Class for Multisite setup
4
+ *
5
+ * @author Alex Rabe
6
+ *
7
+ *
8
+ */
9
+ class nggWPMU{
10
+
11
+ /**
12
+ * Check the Quota under WPMU. Only needed for this case
13
+ *
14
+ * @class nggWPMU
15
+ * @return bool $result
16
+ */
17
+ function check_quota() {
18
+ if ( get_site_option( 'upload_space_check_disabled' ) )
19
+ return false;
20
+
21
+ if ( (is_multisite()) && nggWPMU::wpmu_enable_function('wpmuQuotaCheck'))
22
+ if( $error = upload_is_user_over_quota( false ) ) {
23
+ nggGallery::show_error( __( 'Sorry, you have used your space allocation. Please delete some files to upload more files.','nggallery' ) );
24
+ return true;
25
+ }
26
+ return false;
27
+ }
28
+
29
+ /**
30
+ * Check for site admin
31
+ *
32
+ * @return
33
+ */
34
+ function wpmu_site_admin() {
35
+
36
+ if ( function_exists('is_super_admin') )
37
+ if ( is_super_admin() )
38
+ return true;
39
+
40
+ return false;
41
+ }
42
+
43
+ /**
44
+ * Check for site wide options
45
+ *
46
+ * @param string $value
47
+ * @return value
48
+ */
49
+ function wpmu_enable_function($value) {
50
+ if (is_multisite()) {
51
+ $ngg_options = get_site_option('ngg_options');
52
+ return $ngg_options[$value];
53
+ }
54
+ // if this is not WPMU, enable it !
55
+ return true;
56
+ }
57
+ }
lib/navigation.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * nggNavigation - PHP class for the pagination
4
+ *
5
+ * @package NextGEN Gallery
6
+ * @author Alex Rabe
7
+ *
8
+ * @version 1.0.1
9
+ * @access public
10
+ */
11
+ class nggNavigation {
12
+
13
+ /**
14
+ * Return the navigation output
15
+ *
16
+ * @access public
17
+ * @var string
18
+ */
19
+ var $output = false;
20
+
21
+ /**
22
+ * Link to previous page
23
+ *
24
+ * @access public
25
+ * @var string
26
+ */
27
+ var $prev = false;
28
+
29
+ /**
30
+ * Link to next page
31
+ *
32
+ * @access public
33
+ * @var string
34
+ */
35
+ var $next = false;
36
+
37
+ /**
38
+ * PHP4 compatibility layer for calling the PHP5 constructor.
39
+ *
40
+ */
41
+ function nggNavigation() {
42
+ return $this->__construct();
43
+ }
44
+
45
+ /**
46
+ * Main constructor - Does nothing.
47
+ * Call create_navigation() method when you need a navigation.
48
+ *
49
+ */
50
+ function __construct() {
51
+ return;
52
+ }
53
+
54
+ /**
55
+ * nggNavigation::create_navigation()
56
+ *
57
+ * @param mixed $page
58
+ * @param integer $totalElement
59
+ * @param integer $maxElement
60
+ * @return string pagination content
61
+ */
62
+ function create_navigation($page, $totalElement, $maxElement = 0) {
63
+ global $nggRewrite;
64
+
65
+ $prev_symbol = apply_filters('ngg_prev_symbol', '&#9668;');
66
+ $next_symbol = apply_filters('ngg_prev_symbol', '&#9658;');
67
+
68
+ if ($maxElement > 0) {
69
+ $total = $totalElement;
70
+
71
+ // create navigation
72
+ if ( $total > $maxElement ) {
73
+ $total_pages = ceil( $total / $maxElement );
74
+ $r = '';
75
+ if ( 1 < $page ) {
76
+ $args['nggpage'] = ( 1 == $page - 1 ) ? FALSE : $page - 1;
77
+ $previous = $args['nggpage'];
78
+ if (FALSE == $args['nggpage']) {
79
+ $previous = 1;
80
+ }
81
+ $this->prev = $nggRewrite->get_permalink ( $args );
82
+ $r .= '<a class="prev" id="ngg-prev-' . $previous . '" href="' . $this->prev . '">' . $prev_symbol . '</a>';
83
+ }
84
+
85
+ $total_pages = ceil( $total / $maxElement );
86
+
87
+ if ( $total_pages > 1 ) {
88
+ for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) {
89
+ if ( $page == $page_num ) {
90
+ $r .= '<span class="current">' . $page_num . '</span>';
91
+ } else {
92
+ $p = false;
93
+ if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) {
94
+ $args['nggpage'] = ( 1 == $page_num ) ? FALSE : $page_num;
95
+ $r .= '<a class="page-numbers" href="' . $nggRewrite->get_permalink( $args ) . '">' . ( $page_num ) . '</a>';
96
+ $in = true;
97
+ } elseif ( $in == true ) {
98
+ $r .= '<span class="more">...</span>';
99
+ $in = false;
100
+ }
101
+ }
102
+ }
103
+ }
104
+
105
+ if ( ( $page ) * $maxElement < $total || -1 == $total ) {
106
+ $args['nggpage'] = $page + 1;
107
+ $this->next = $nggRewrite->get_permalink ( $args );
108
+ $r .= '<a class="next" id="ngg-next-' . $args['nggpage'] . '" href="' . $this->next . '">' . $next_symbol . '</a>';
109
+ }
110
+
111
+ $this->output = "<div class='ngg-navigation'>$r</div>";
112
+ } else {
113
+ $this->output = "<div class='ngg-clear'></div>"."\n";
114
+ }
115
+ }
116
+
117
+ return $this->output;
118
+ }
119
+ }
120
+ ?>
lib/ngg-db.php ADDED
@@ -0,0 +1,1113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !class_exists('nggdb') ) :
3
+ /**
4
+ * NextGEN Gallery Database Class
5
+ *
6
+ * @author Alex Rabe, Vincent Prat
7
+ *
8
+ * @since 1.0.0
9
+ */
10
+ class nggdb {
11
+
12
+ /**
13
+ * Holds the list of all galleries
14
+ *
15
+ * @since 1.1.0
16
+ * @access public
17
+ * @var object|array
18
+ */
19
+ var $galleries = false;
20
+
21
+ /**
22
+ * Holds the list of all images
23
+ *
24
+ * @since 1.3.0
25
+ * @access public
26
+ * @var object|array
27
+ */
28
+ var $images = false;
29
+
30
+ /**
31
+ * Holds the list of all albums
32
+ *
33
+ * @since 1.3.0
34
+ * @access public
35
+ * @var object|array
36
+ */
37
+ var $albums = false;
38
+
39
+ /**
40
+ * The array for the pagination
41
+ *
42
+ * @since 1.1.0
43
+ * @access public
44
+ * @var array
45
+ */
46
+ var $paged = false;
47
+
48
+ /**
49
+ * PHP4 compatibility layer for calling the PHP5 constructor.
50
+ *
51
+ */
52
+ function nggdb() {
53
+ return $this->__construct();
54
+ }
55
+
56
+ /**
57
+ * Init the Database Abstraction layer for NextGEN Gallery
58
+ *
59
+ */
60
+ function __construct() {
61
+ global $wpdb;
62
+
63
+ $this->galleries = array();
64
+ $this->images = array();
65
+ $this->albums = array();
66
+ $this->paged = array();
67
+
68
+ register_shutdown_function(array(&$this, '__destruct'));
69
+
70
+ }
71
+
72
+ /**
73
+ * PHP5 style destructor and will run when database object is destroyed.
74
+ *
75
+ * @return bool Always true
76
+ */
77
+ function __destruct() {
78
+ return true;
79
+ }
80
+
81
+ /**
82
+ * Get all the album and unserialize the content
83
+ *
84
+ * @since 1.3.0
85
+ * @param string $order_by
86
+ * @param string $order_dir
87
+ * @param int $limit number of albums, 0 shows all albums
88
+ * @param int $start the start index for paged albums
89
+ * @return array $album
90
+ */
91
+ function find_all_album( $order_by = 'id', $order_dir = 'ASC', $limit = 0, $start = 0) {
92
+ global $wpdb;
93
+
94
+ $order_dir = ( $order_dir == 'DESC') ? 'DESC' : 'ASC';
95
+ $limit_by = ( $limit > 0 ) ? 'LIMIT ' . intval($start) . ',' . intval($limit) : '';
96
+ $this->albums = $wpdb->get_results("SELECT * FROM $wpdb->nggalbum ORDER BY {$order_by} {$order_dir} {$limit_by}" , OBJECT_K );
97
+
98
+ if ( !$this->albums )
99
+ return array();
100
+
101
+ foreach ($this->albums as $key => $value) {
102
+ $this->albums[$key]->galleries = empty ($this->albums[$key]->sortorder) ? array() : (array) unserialize($this->albums[$key]->sortorder) ;
103
+ $this->albums[$key]->name = stripslashes( $this->albums[$key]->name );
104
+ $this->albums[$key]->albumdesc = stripslashes( $this->albums[$key]->albumdesc );
105
+ wp_cache_add($key, $this->albums[$key], 'ngg_album');
106
+ }
107
+
108
+ return $this->albums;
109
+ }
110
+
111
+ /**
112
+ * Get all the galleries
113
+ *
114
+ * @param string $order_by
115
+ * @param string $order_dir
116
+ * @param bool $counter (optional) Select true when you need to count the images
117
+ * @param int $limit number of paged galleries, 0 shows all galleries
118
+ * @param int $start the start index for paged galleries
119
+ * @param bool $exclude
120
+ * @return array $galleries
121
+ */
122
+ function find_all_galleries($order_by = 'gid', $order_dir = 'ASC', $counter = false, $limit = 0, $start = 0, $exclude = true) {
123
+ global $wpdb;
124
+
125
+ // Check for the exclude setting
126
+ $exclude_clause = ($exclude) ? ' AND exclude<>1 ' : '';
127
+ $order_dir = ( $order_dir == 'DESC') ? 'DESC' : 'ASC';
128
+ $limit_by = ( $limit > 0 ) ? 'LIMIT ' . intval($start) . ',' . intval($limit) : '';
129
+ $this->galleries = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->nggallery ORDER BY {$order_by} {$order_dir} {$limit_by}", OBJECT_K );
130
+
131
+ // Count the number of galleries and calculate the pagination
132
+ if ($limit > 0) {
133
+ $this->paged['total_objects'] = intval ( $wpdb->get_var( "SELECT FOUND_ROWS()" ) );
134
+ $this->paged['objects_per_page'] = max ( count( $this->galleries ), $limit );
135
+ $this->paged['max_objects_per_page'] = ( $limit > 0 ) ? ceil( $this->paged['total_objects'] / intval($limit)) : 1;
136
+ }
137
+
138
+ if ( !$this->galleries )
139
+ return array();
140
+
141
+ // get the galleries information
142
+ foreach ($this->galleries as $key => $value) {
143
+ $galleriesID[] = $key;
144
+ // init the counter values
145
+ $this->galleries[$key]->counter = 0;
146
+ $this->galleries[$key]->title = stripslashes($this->galleries[$key]->title);
147
+ $this->galleries[$key]->galdesc = stripslashes($this->galleries[$key]->galdesc);
148
+ $this->galleries[$key]->abspath = WINABSPATH . $this->galleries[$key]->path;
149
+ wp_cache_add($key, $this->galleries[$key], 'ngg_gallery');
150
+ }
151
+
152
+ // if we didn't need to count the images then stop here
153
+ if ( !$counter )
154
+ return $this->galleries;
155
+
156
+ // get the counter values
157
+ $picturesCounter = $wpdb->get_results('SELECT galleryid, COUNT(*) as counter FROM '.$wpdb->nggpictures.' WHERE galleryid IN (\''.implode('\',\'', $galleriesID).'\') ' . $exclude_clause . ' GROUP BY galleryid', OBJECT_K);
158
+
159
+ if ( !$picturesCounter )
160
+ return $this->galleries;
161
+
162
+ // add the counter to the gallery objekt
163
+ foreach ($picturesCounter as $key => $value) {
164
+ $this->galleries[$value->galleryid]->counter = $value->counter;
165
+ wp_cache_set($value->galleryid, $this->galleries[$value->galleryid], 'ngg_gallery');
166
+ }
167
+
168
+ return $this->galleries;
169
+ }
170
+
171
+ /**
172
+ * Get a gallery given its ID
173
+ *
174
+ * @param int|string $id or $slug
175
+ * @return A nggGallery object (null if not found)
176
+ */
177
+ function find_gallery( $id ) {
178
+ global $wpdb;
179
+
180
+ if( is_numeric($id) ) {
181
+
182
+ if ( $gallery = wp_cache_get($id, 'ngg_gallery') )
183
+ return $gallery;
184
+
185
+ $gallery = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->nggallery WHERE gid = %d", $id ) );
186
+
187
+ } else
188
+ $gallery = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->nggallery WHERE slug = %s", $id ) );
189
+
190
+ // Build the object from the query result
191
+ if ($gallery) {
192
+ // it was a bad idea to use a object, stripslashes_deep() could not used here, learn from it
193
+ $gallery->title = stripslashes($gallery->title);
194
+ $gallery->galdesc = stripslashes($gallery->galdesc);
195
+
196
+ $gallery->abspath = WINABSPATH . $gallery->path;
197
+ //TODO:Possible failure , $id could be a number or name
198
+ wp_cache_add($id, $gallery, 'ngg_gallery');
199
+
200
+ return $gallery;
201
+ } else
202
+ return false;
203
+ }
204
+
205
+ /**
206
+ * This function return all information about the gallery and the images inside
207
+ *
208
+ * @param int|string $id or $name
209
+ * @param string $order_by
210
+ * @param string $order_dir (ASC |DESC)
211
+ * @param bool $exclude
212
+ * @param int $limit number of paged galleries, 0 shows all galleries
213
+ * @param int $start the start index for paged galleries
214
+ * @param bool $json remove the key for associative array in json request
215
+ * @return An array containing the nggImage objects representing the images in the gallery.
216
+ */
217
+ function get_gallery($id, $order_by = 'sortorder', $order_dir = 'ASC', $exclude = true, $limit = 0, $start = 0, $json = false) {
218
+
219
+ global $wpdb;
220
+
221
+ // init the gallery as empty array
222
+ $gallery = array();
223
+ $i = 0;
224
+
225
+ // Check for the exclude setting
226
+ $exclude_clause = ($exclude) ? ' AND tt.exclude<>1 ' : '';
227
+
228
+ // Say no to any other value
229
+ $order_dir = ( $order_dir == 'DESC') ? 'DESC' : 'ASC';
230
+ $order_by = ( empty($order_by) ) ? 'sortorder' : $order_by;
231
+ $order_clause = "ABS(tt.{$order_by}) {$order_dir}, tt.{$order_by} {$order_dir}";
232
+ // $order_clause = "LENGTH(tt.{$order_by}) {$order_dir}, tt.{$order_by} {$order_dir}";
233
+
234
+ // Should we limit this query ?
235
+ $limit_by = ( $limit > 0 ) ? 'LIMIT ' . intval($start) . ',' . intval($limit) : '';
236
+
237
+ // Query database
238
+ if( is_numeric($id) )
239
+ $result = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS tt.*, t.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid = %d {$exclude_clause} ORDER BY {$order_clause} {$limit_by}", $id ), OBJECT_K );
240
+ else
241
+ $result = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS tt.*, t.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.slug = %s {$exclude_clause} ORDER BY {$order_clause} {$limit_by}", $id ), OBJECT_K );
242
+
243
+ // Count the number of images and calculate the pagination
244
+ if ($limit > 0) {
245
+ $this->paged['total_objects'] = intval ( $wpdb->get_var( "SELECT FOUND_ROWS()" ) );
246
+ $this->paged['objects_per_page'] = max ( count( $result ), $limit );
247
+ $this->paged['max_objects_per_page'] = ( $limit > 0 ) ? ceil( $this->paged['total_objects'] / intval($limit)) : 1;
248
+ }
249
+
250
+ // Build the object
251
+ if ($result) {
252
+
253
+ // Now added all image data
254
+ foreach ($result as $key => $value) {
255
+ // due to a browser bug we need to remove the key for associative array for json request
256
+ // (see http://code.google.com/p/chromium/issues/detail?id=883)
257
+ if ($json) $key = $i++;
258
+ $gallery[$key] = new nggImage( $value ); // keep in mind each request require 8-16 kb memory usage
259
+
260
+ }
261
+ }
262
+
263
+ // Could not add to cache, the structure is different to find_gallery() cache_add, need rework
264
+ //wp_cache_add($id, $gallery, 'ngg_gallery');
265
+
266
+ return $gallery;
267
+ }
268
+
269
+ /**
270
+ * This function return all information about the gallery and the images inside
271
+ *
272
+ * @param int|string $id or $name
273
+ * @param string $orderby
274
+ * @param string $order (ASC |DESC)
275
+ * @param bool $exclude
276
+ * @return An array containing the nggImage objects representing the images in the gallery.
277
+ */
278
+ function get_ids_from_gallery($id, $order_by = 'sortorder', $order_dir = 'ASC', $exclude = true) {
279
+
280
+ global $wpdb;
281
+
282
+ // Check for the exclude setting
283
+ $exclude_clause = ($exclude) ? ' AND tt.exclude<>1 ' : '';
284
+
285
+ // Say no to any other value
286
+ $order_dir = ( $order_dir == 'DESC') ? 'DESC' : 'ASC';
287
+ $order_by = ( empty($order_by) ) ? 'sortorder' : $order_by;
288
+
289
+ // Query database
290
+ if( is_numeric($id) )
291
+ $result = $wpdb->get_col( $wpdb->prepare( "SELECT tt.pid FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid = %d $exclude_clause ORDER BY tt.{$order_by} $order_dir", $id ) );
292
+ else
293
+ $result = $wpdb->get_col( $wpdb->prepare( "SELECT tt.pid FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.slug = %s $exclude_clause ORDER BY tt.{$order_by} $order_dir", $id ) );
294
+
295
+ return $result;
296
+ }
297
+
298
+ /**
299
+ * Delete a gallery AND all the pictures associated to this gallery!
300
+ *
301
+ * @id The gallery ID
302
+ */
303
+ function delete_gallery( $id ) {
304
+ global $wpdb;
305
+
306
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->nggpictures WHERE galleryid = %d", $id) );
307
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->nggallery WHERE gid = %d", $id) );
308
+
309
+ wp_cache_delete($id, 'ngg_gallery');
310
+
311
+ //TODO:Remove all tag relationship
312
+ return true;
313
+ }
314
+
315
+ /**
316
+ * Get an album given its ID
317
+ *
318
+ * @id The album ID or name
319
+ * @return A nggGallery object (false if not found)
320
+ */
321
+ function find_album( $id ) {
322
+ global $wpdb;
323
+
324
+ // Query database
325
+ if ( is_numeric($id) && $id != 0 ) {
326
+ if ( $album = wp_cache_get($id, 'ngg_album') )
327
+ return $album;
328
+
329
+ $album = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->nggalbum WHERE id = %d", $id) );
330
+ } elseif ( $id == 'all' || (is_numeric($id) && $id == 0) ) {
331
+ // init the object and fill it
332
+ $album = new stdClass();
333
+ $album->id = 'all';
334
+ $album->name = __('Album overview','nggallery');
335
+ $album->albumdesc = __('Album overview','nggallery');
336
+ $album->previewpic = 0;
337
+ $album->sortorder = serialize( $wpdb->get_col("SELECT gid FROM $wpdb->nggallery") );
338
+ } else {
339
+ $album = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->nggalbum WHERE slug = %s", $id) );
340
+ }
341
+
342
+ // Unserialize the galleries inside the album
343
+ if ( $album ) {
344
+ if ( !empty( $album->sortorder ) )
345
+ $album->gallery_ids = unserialize( $album->sortorder );
346
+
347
+ // it was a bad idea to use a object, stripslashes_deep() could not used here, learn from it
348
+ $album->albumdesc = stripslashes($album->albumdesc);
349
+ $album->name = stripslashes($album->name);
350
+
351
+ wp_cache_add($album->id, $album, 'ngg_album');
352
+ return $album;
353
+ }
354
+
355
+ return false;
356
+ }
357
+
358
+ /**
359
+ * Delete an album
360
+ *
361
+ * @id The album ID
362
+ */
363
+ function delete_album( $id ) {
364
+ global $wpdb;
365
+
366
+ $result = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->nggalbum WHERE id = %d", $id) );
367
+ wp_cache_delete($id, 'ngg_album');
368
+
369
+ return $result;
370
+ }
371
+
372
+ /**
373
+ * Insert an image in the database
374
+ *
375
+ * @return the ID of the inserted image
376
+ */
377
+ function insert_image($gid, $filename, $alttext, $desc, $exclude) {
378
+ global $wpdb;
379
+
380
+ $result = $wpdb->query(
381
+ "INSERT INTO $wpdb->nggpictures (galleryid, filename, description, alttext, exclude) VALUES "
382
+ . "('$gid', '$filename', '$desc', '$alttext', '$exclude');");
383
+ $pid = (int) $wpdb->insert_id;
384
+ wp_cache_delete($gid, 'ngg_gallery');
385
+
386
+ return $pid;
387
+ }
388
+
389
+ /**
390
+ * nggdb::update_image() - Update an image in the database
391
+ *
392
+ * @param int $pid id of the image
393
+ * @param (optional) string|int $galleryid
394
+ * @param (optional) string $filename
395
+ * @param (optional) string $description
396
+ * @param (optional) string $alttext
397
+ * @param (optional) int $exclude (0 or 1)
398
+ * @param (optional) int $sortorder
399
+ * @return bool result of update query
400
+ */
401
+ function update_image($pid, $galleryid = false, $filename = false, $description = false, $alttext = false, $exclude = false, $sortorder = false) {
402
+
403
+ global $wpdb;
404
+
405
+ $sql = array();
406
+ $pid = (int) $pid;
407
+
408
+ // slug must be unique, we use the alttext for that
409
+ $slug = nggdb::get_unique_slug( sanitize_title( $alttext ), 'image' );
410
+
411
+ $update = array(
412
+ 'image_slug' => $slug,
413
+ 'galleryid' => $galleryid,
414
+ 'filename' => $filename,
415
+ 'description' => $description,
416
+ 'alttext' => $alttext,
417
+ 'exclude' => $exclude,
418
+ 'sortorder' => $sortorder);
419
+
420
+ // create the sql parameter "name = value"
421
+ foreach ($update as $key => $value)
422
+ if ($value !== false)
423
+ $sql[] = $key . " = '" . $value . "'";
424
+
425
+ // create the final string
426
+ $sql = implode(', ', $sql);
427
+
428
+ if ( !empty($sql) && $pid != 0)
429
+ $result = $wpdb->query( "UPDATE $wpdb->nggpictures SET $sql WHERE pid = $pid" );
430
+
431
+ wp_cache_delete($pid, 'ngg_image');
432
+
433
+ return $result;
434
+ }
435
+
436
+ /**
437
+ * nggdb::update_gallery() - Update an gallery in the database
438
+ *
439
+ * @since V1.7.0
440
+ * @param int $id id of the gallery
441
+ * @param (optional) string $title or name of the gallery
442
+ * @param (optional) string $path
443
+ * @param (optional) string $description
444
+ * @param (optional) int $pageid
445
+ * @param (optional) int $previewpic
446
+ * @param (optional) int $author
447
+ * @return bool result of update query
448
+ */
449
+ function update_gallery($id, $name = false, $path = false, $title = false, $description = false, $pageid = false, $previewpic = false, $author = false) {
450
+
451
+ global $wpdb;
452
+
453
+ $sql = array();
454
+ $id = (int) $id;
455
+
456
+ // slug must be unique, we use the title for that
457
+ $slug = nggdb::get_unique_slug( sanitize_title( $title ), 'gallery' );
458
+
459
+ $update = array(
460
+ 'name' => $name,
461
+ 'slug' => $slug,
462
+ 'path' => $path,
463
+ 'title' => $title,
464
+ 'galdesc' => $description,
465
+ 'pageid' => $pageid,
466
+ 'previewpic' => $previewpic,
467
+ 'author' => $author);
468
+
469
+ // create the sql parameter "name = value"
470
+ foreach ($update as $key => $value)
471
+ if ($value !== false)
472
+ $sql[] = $key . " = '" . $value . "'";
473
+
474
+ // create the final string
475
+ $sql = implode(', ', $sql);
476
+
477
+ if ( !empty($sql) && $id != 0)
478
+ $result = $wpdb->query( "UPDATE $wpdb->nggallery SET $sql WHERE gid = $id" );
479
+
480
+ wp_cache_delete($id, 'ngg_gallery');
481
+
482
+ return $result;
483
+ }
484
+
485
+ /**
486
+ * nggdb::update_album() - Update an album in the database
487
+ *
488
+ * @since V1.7.0
489
+ * @param int $ id id of the album
490
+ * @param (optional) string $title
491
+ * @param (optional) int $previewpic
492
+ * @param (optional) string $description
493
+ * @param (optional) serialized array $sortorder
494
+ * @param (optional) int $pageid
495
+ * @return bool result of update query
496
+ */
497
+ function update_album($id, $name = false, $previewpic = false, $description = false, $sortorder = false, $pageid = false ) {
498
+
499
+ global $wpdb;
500
+
501
+ $sql = array();
502
+ $id = (int) $id;
503
+
504
+ // slug must be unique, we use the title for that
505
+ $slug = nggdb::get_unique_slug( sanitize_title( $name ), 'album' );
506
+
507
+ $update = array(
508
+ 'name' => $name,
509
+ 'slug' => $slug,
510
+ 'previewpic' => $previewpic,
511
+ 'albumdesc' => $description,
512
+ 'sortorder' => $sortorder,
513
+ 'pageid' => $pageid);
514
+
515
+ // create the sql parameter "name = value"
516
+ foreach ($update as $key => $value)
517
+ if ($value !== false)
518
+ $sql[] = $key . " = '" . $value . "'";
519
+
520
+ // create the final string
521
+ $sql = implode(', ', $sql);
522
+
523
+ if ( !empty($sql) && $id != 0)
524
+ $result = $wpdb->query( "UPDATE $wpdb->nggalbum SET $sql WHERE id = $id" );
525
+
526
+ wp_cache_delete($id, 'ngg_album');
527
+
528
+ return $result;
529
+ }
530
+
531
+ /**
532
+ * Get an image given its ID
533
+ *
534
+ * @param int|string The image ID or Slug
535
+ * @return object A nggImage object representing the image (false if not found)
536
+ */
537
+ function find_image( $id ) {
538
+ global $wpdb;
539
+
540
+ if( is_numeric($id) ) {
541
+
542
+ if ( $image = wp_cache_get($id, 'ngg_image') )
543
+ return $image;
544
+
545
+ $result = $wpdb->get_row( $wpdb->prepare( "SELECT tt.*, t.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.pid = %d ", $id ) );
546
+ } else
547
+ $result = $wpdb->get_row( $wpdb->prepare( "SELECT tt.*, t.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.image_slug = %s ", $id ) );
548
+
549
+ // Build the object from the query result
550
+ if ($result) {
551
+ $image = new nggImage($result);
552
+ return $image;
553
+ }
554
+
555
+ return false;
556
+ }
557
+
558
+ /**
559
+ * Get images given a list of IDs
560
+ *
561
+ * @param $pids array of picture_ids
562
+ * @return An array of nggImage objects representing the images
563
+ */
564
+ function find_images_in_list( $pids, $exclude = false, $order = 'ASC' ) {
565
+ global $wpdb;
566
+
567
+ $result = array();
568
+
569
+ // Check for the exclude setting
570
+ $exclude_clause = ($exclude) ? ' AND t.exclude <> 1 ' : '';
571
+
572
+ // Check for the exclude setting
573
+ $order_clause = ($order == 'RAND') ? 'ORDER BY rand() ' : ' ORDER BY t.pid ASC' ;
574
+
575
+ if ( is_array($pids) ) {
576
+ $id_list = "'" . implode("', '", $pids) . "'";
577
+
578
+ // Save Query database
579
+ $images = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggpictures AS t INNER JOIN $wpdb->nggallery AS tt ON t.galleryid = tt.gid WHERE t.pid IN ($id_list) $exclude_clause $order_clause", OBJECT_K);
580
+
581
+ // Build the image objects from the query result
582
+ if ($images) {
583
+ foreach ($images as $key => $image)
584
+ $result[$key] = new nggImage( $image );
585
+ }
586
+ }
587
+ return $result;
588
+ }
589
+
590
+ /**
591
+ * Add an image to the database
592
+ *
593
+ * @since V1.4.0
594
+ * @param int $pid id of the gallery
595
+ * @param (optional) string|int $galleryid
596
+ * @param (optional) string $filename
597
+ * @param (optional) string $description
598
+ * @param (optional) string $alttext
599
+ * @param (optional) array $meta data
600
+ * @param (optional) int $post_id (required for sync with WP media lib)
601
+ * @param (optional) string $imagedate
602
+ * @param (optional) int $exclude (0 or 1)
603
+ * @param (optional) int $sortorder
604
+ * @return bool result of the ID of the inserted image
605
+ */
606
+ function add_image( $id = false, $filename = false, $description = '', $alttext = '', $meta_data = false, $post_id = 0, $imagedate = '0000-00-00 00:00:00', $exclude = 0, $sortorder = 0 ) {
607
+ global $wpdb;
608
+
609
+ if ( is_array($meta_data) )
610
+ $meta_data = serialize($meta_data);
611
+
612
+ // slug must be unique, we use the alttext for that
613
+ $slug = nggdb::get_unique_slug( sanitize_title( $alttext ), 'image' );
614
+
615
+ // Add the image
616
+ if ( false === $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->nggpictures (image_slug, galleryid, filename, description, alttext, meta_data, post_id, imagedate, exclude, sortorder)
617
+ VALUES (%s, %d, %s, %s, %s, %s, %d, %s, %d, %d)", $slug, $id, $filename, $description, $alttext, $meta_data, $post_id, $imagedate, $exclude, $sortorder ) ) ) {
618
+ return false;
619
+ }
620
+
621
+ $imageID = (int) $wpdb->insert_id;
622
+
623
+ // Remove from cache the galley, needs to be rebuild now
624
+ wp_cache_delete( $id, 'ngg_gallery');
625
+
626
+ //and give me the new id
627
+ return $imageID;
628
+ }
629
+
630
+ /**
631
+ * Add an album to the database
632
+ *
633
+ * @since V1.7.0
634
+ * @param (optional) string $title
635
+ * @param (optional) int $previewpic
636
+ * @param (optional) string $description
637
+ * @param (optional) serialized array $sortorder
638
+ * @param (optional) int $pageid
639
+ * @return bool result of the ID of the inserted album
640
+ */
641
+ function add_album( $name = false, $previewpic = 0, $description = '', $sortorder = 0, $pageid = 0 ) {
642
+ global $wpdb;
643
+
644
+ // name must be unique, we use the title for that
645
+ $slug = nggdb::get_unique_slug( sanitize_title( $name ), 'album' );
646
+
647
+ // Add the album
648
+ if ( false === $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->nggalbum (name, slug, previewpic, albumdesc, sortorder, pageid)
649
+ VALUES (%s, %s, %d, %s, %s, %d)", $name, $slug, $previewpic, $description, $sortorder, $pageid ) ) ) {
650
+ return false;
651
+ }
652
+
653
+ $albumID = (int) $wpdb->insert_id;
654
+
655
+ //and give me the new id
656
+ return $albumID;
657
+ }
658
+
659
+ /**
660
+ * Add an gallery to the database
661
+ *
662
+ * @since V1.7.0
663
+ * @param (optional) string $title or name of the gallery
664
+ * @param (optional) string $path
665
+ * @param (optional) string $description
666
+ * @param (optional) int $pageid
667
+ * @param (optional) int $previewpic
668
+ * @param (optional) int $author
669
+ * @return bool result of the ID of the inserted gallery
670
+ */
671
+ function add_gallery( $title = '', $path = '', $description = '', $pageid = 0, $previewpic = 0, $author = 0 ) {
672
+ global $wpdb;
673
+
674
+ // slug must be unique, we use the title for that
675
+ $slug = nggdb::get_unique_slug( sanitize_title( $title ), 'gallery' );
676
+
677
+ // Note : The field 'name' is deprecated, it's currently kept only for compat reason with older shortcodes, we copy the slug into this field
678
+ if ( false === $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->nggallery (name, slug, path, title, galdesc, pageid, previewpic, author)
679
+ VALUES (%s, %s, %s, %s, %s, %d, %d, %d)", $slug, $slug, $path, $title, $description, $pageid, $previewpic, $author ) ) ) {
680
+ return false;
681
+ }
682
+
683
+ $galleryID = (int) $wpdb->insert_id;
684
+
685
+ //and give me the new id
686
+ return $galleryID;
687
+ }
688
+
689
+ /**
690
+ * Delete an image entry from the database
691
+ * @param integer $id is the Image ID
692
+ */
693
+ function delete_image( $id ) {
694
+ global $wpdb;
695
+
696
+ // Delete the image
697
+ $result = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->nggpictures WHERE pid = %d", $id) );
698
+
699
+ // Delete tag references
700
+ wp_delete_object_term_relationships( $id, 'ngg_tag');
701
+
702
+ // Remove from cache
703
+ wp_cache_delete( $id, 'ngg_image');
704
+
705
+ return $result;
706
+ }
707
+
708
+ /**
709
+ * Get the last images registered in the database with a maximum number of $limit results
710
+ *
711
+ * @param integer $page start offset as page number (0,1,2,3,4...)
712
+ * @param integer $limit the number of result
713
+ * @param bool $exclude do not show exluded images
714
+ * @param int $galleryId Only look for images with this gallery id, or in all galleries if id is 0
715
+ * @param string $orderby is one of "id" (default, order by pid), "date" (order by exif date), sort (order by user sort order)
716
+ * @return
717
+ */
718
+ function find_last_images($page = 0, $limit = 30, $exclude = true, $galleryId = 0, $orderby = "id") {
719
+ global $wpdb;
720
+
721
+ // Check for the exclude setting
722
+ $exclude_clause = ($exclude) ? ' AND exclude<>1 ' : '';
723
+
724
+ // a limit of 0 makes no sense
725
+ $limit = ($limit == 0) ? 30 : $limit;
726
+ // calculate the offset based on the pagr number
727
+ $offset = (int) $page * $limit;
728
+
729
+ $galleryId = (int) $galleryId;
730
+ $gallery_clause = ($galleryId === 0) ? '' : ' AND galleryid = ' . $galleryId . ' ';
731
+
732
+ // default order by pid
733
+ $order = 'pid DESC';
734
+ switch ($orderby) {
735
+ case 'date':
736
+ $order = 'imagedate DESC';
737
+ break;
738
+ case 'sort':
739
+ $order = 'sortorder ASC';
740
+ break;
741
+ }
742
+
743
+ $result = array();
744
+ $gallery_cache = array();
745
+
746
+ // Query database
747
+ $images = $wpdb->get_results("SELECT * FROM $wpdb->nggpictures WHERE 1=1 $exclude_clause $gallery_clause ORDER BY $order LIMIT $offset, $limit");
748
+
749
+ // Build the object from the query result
750
+ if ($images) {
751
+ foreach ($images as $key => $image) {
752
+
753
+ // cache a gallery , so we didn't need to lookup twice
754
+ if (!array_key_exists($image->galleryid, $gallery_cache))
755
+ $gallery_cache[$image->galleryid] = nggdb::find_gallery($image->galleryid);
756
+
757
+ // Join gallery information with picture information
758
+ foreach ($gallery_cache[$image->galleryid] as $index => $value)
759
+ $image->$index = $value;
760
+
761
+ // Now get the complete image data
762
+ $result[$key] = new nggImage( $image );
763
+ }
764
+ }
765
+
766
+ return $result;
767
+ }
768
+
769
+ /**
770
+ * nggdb::get_random_images() - Get an random image from one ore more gally
771
+ *
772
+ * @param integer $number of images
773
+ * @param integer $galleryID optional a Gallery
774
+ * @return A nggImage object representing the image (null if not found)
775
+ */
776
+ function get_random_images($number = 1, $galleryID = 0) {
777
+ global $wpdb;
778
+
779
+ $number = (int) $number;
780
+ $galleryID = (int) $galleryID;
781
+ $images = array();
782
+
783
+ // Query database
784
+ if ($galleryID == 0)
785
+ $result = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 ORDER by rand() limit $number");
786
+ else
787
+ $result = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid = $galleryID AND tt.exclude != 1 ORDER by rand() limit {$number}");
788
+
789
+ // Return the object from the query result
790
+ if ($result) {
791
+ foreach ($result as $image) {
792
+ $images[] = new nggImage( $image );
793
+ }
794
+ return $images;
795
+ }
796
+
797
+ return null;
798
+ }
799
+
800
+ /**
801
+ * Get all the images from a given album
802
+ *
803
+ * @param object|int $album The album object or the id
804
+ * @param string $order_by
805
+ * @param string $order_dir
806
+ * @param bool $exclude
807
+ * @return An array containing the nggImage objects representing the images in the album.
808
+ */
809
+ function find_images_in_album($album, $order_by = 'galleryid', $order_dir = 'ASC', $exclude = true) {
810
+ global $wpdb;
811
+
812
+ if ( !is_object($album) )
813
+ $album = nggdb::find_album( $album );
814
+
815
+ // Get gallery list
816
+ $gallery_list = implode(',', $album->gallery_ids);
817
+ // Check for the exclude setting
818
+ $exclude_clause = ($exclude) ? ' AND tt.exclude<>1 ' : '';
819
+
820
+ // Say no to any other value
821
+ $order_dir = ( $order_dir == 'DESC') ? 'DESC' : 'ASC';
822
+ $order_by = ( empty($order_by) ) ? 'galleryid' : $order_by;
823
+
824
+ $result = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.galleryid IN ($gallery_list) $exclude_clause ORDER BY tt.$order_by $order_dir");
825
+ // Return the object from the query result
826
+ if ($result) {
827
+ foreach ($result as $image) {
828
+ $images[] = new nggImage( $image );
829
+ }
830
+ return $images;
831
+ }
832
+
833
+ return null;
834
+ }
835
+
836
+ /**
837
+ * search for images and return the result
838
+ *
839
+ * @since 1.3.0
840
+ * @param string $request
841
+ * @param int $limit number of results, 0 shows all results
842
+ * @return Array Result of the request
843
+ */
844
+ function search_for_images( $request, $limit = 0 ) {
845
+ global $wpdb;
846
+
847
+ // If a search pattern is specified, load the posts that match
848
+ if ( !empty($request) ) {
849
+ // added slashes screw with quote grouping when done early, so done later
850
+ $request = stripslashes($request);
851
+
852
+ // split the words it a array if seperated by a space or comma
853
+ preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $request, $matches);
854
+ $search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
855
+
856
+ $n = '%';
857
+ $searchand = '';
858
+ $search = '';
859
+
860
+ foreach( (array) $search_terms as $term) {
861
+ $term = addslashes_gpc($term);
862
+ $search .= "{$searchand}((tt.description LIKE '{$n}{$term}{$n}') OR (tt.alttext LIKE '{$n}{$term}{$n}') OR (tt.filename LIKE '{$n}{$term}{$n}'))";
863
+ $searchand = ' AND ';
864
+ }
865
+
866
+ $term = $wpdb->escape($request);
867
+ if (count($search_terms) > 1 && $search_terms[0] != $request )
868
+ $search .= " OR (tt.description LIKE '{$n}{$term}{$n}') OR (tt.alttext LIKE '{$n}{$term}{$n}') OR (tt.filename LIKE '{$n}{$term}{$n}')";
869
+
870
+ if ( !empty($search) )
871
+ $search = " AND ({$search}) ";
872
+
873
+ $limit_by = ( $limit > 0 ) ? 'LIMIT ' . intval($limit) : '';
874
+ } else
875
+ return false;
876
+
877
+ // build the final query
878
+ $query = "SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE 1=1 $search ORDER BY tt.pid ASC $limit_by";
879
+ $result = $wpdb->get_results($query);
880
+
881
+ // TODO: Currently we didn't support a proper pagination
882
+ $this->paged['total_objects'] = $this->paged['objects_per_page'] = intval ( $wpdb->get_var( "SELECT FOUND_ROWS()" ) );
883
+ $this->paged['max_objects_per_page'] = 1;
884
+
885
+ // Return the object from the query result
886
+ if ($result) {
887
+ foreach ($result as $image) {
888
+ $images[] = new nggImage( $image );
889
+ }
890
+ return $images;
891
+ }
892
+
893
+ return null;
894
+ }
895
+
896
+ /**
897
+ * search for galleries and return the result
898
+ *
899
+ * @since 1.7.0
900
+ * @param string $request
901
+ * @param int $limit number of results, 0 shows all results
902
+ * @return Array Result of the request
903
+ */
904
+ function search_for_galleries( $request, $limit = 0 ) {
905
+ global $wpdb;
906
+
907
+ // If a search pattern is specified, load the posts that match
908
+ if ( !empty($request) ) {
909
+ // added slashes screw with quote grouping when done early, so done later
910
+ $request = stripslashes($request);
911
+
912
+ // split the words it a array if seperated by a space or comma
913
+ preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $request, $matches);
914
+ $search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
915
+
916
+ $n = '%';
917
+ $searchand = '';
918
+ $search = '';
919
+
920
+ foreach( (array) $search_terms as $term) {
921
+ $term = addslashes_gpc($term);
922
+ $search .= "{$searchand}((title LIKE '{$n}{$term}{$n}') OR (name LIKE '{$n}{$term}{$n}') )";
923
+ $searchand = ' AND ';
924
+ }
925
+
926
+ $term = $wpdb->escape($request);
927
+ if (count($search_terms) > 1 && $search_terms[0] != $request )
928
+ $search .= " OR (title LIKE '{$n}{$term}{$n}') OR (name LIKE '{$n}{$term}{$n}')";
929
+
930
+ if ( !empty($search) )
931
+ $search = " AND ({$search}) ";
932
+
933
+ $limit = ( $limit > 0 ) ? 'LIMIT ' . intval($limit) : '';
934
+ } else
935
+ return false;
936
+
937
+ // build the final query
938
+ $query = "SELECT * FROM $wpdb->nggallery WHERE 1=1 $search ORDER BY title ASC $limit";
939
+ $result = $wpdb->get_results($query);
940
+
941
+ return $result;
942
+ }
943
+
944
+ /**
945
+ * search for albums and return the result
946
+ *
947
+ * @since 1.7.0
948
+ * @param string $request
949
+ * @param int $limit number of results, 0 shows all results
950
+ * @return Array Result of the request
951
+ */
952
+ function search_for_albums( $request, $limit = 0 ) {
953
+ global $wpdb;
954
+
955
+ // If a search pattern is specified, load the posts that match
956
+ if ( !empty($request) ) {
957
+ // added slashes screw with quote grouping when done early, so done later
958
+ $request = stripslashes($request);
959
+
960
+ // split the words it a array if seperated by a space or comma
961
+ preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $request, $matches);
962
+ $search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
963
+
964
+ $n = '%';
965
+ $searchand = '';
966
+ $search = '';
967
+
968
+ foreach( (array) $search_terms as $term) {
969
+ $term = addslashes_gpc($term);
970
+ $search .= "{$searchand}(name LIKE '{$n}{$term}{$n}')";
971
+ $searchand = ' AND ';
972
+ }
973
+
974
+ $term = $wpdb->escape($request);
975
+ if (count($search_terms) > 1 && $search_terms[0] != $request )
976
+ $search .= " OR (name LIKE '{$n}{$term}{$n}')";
977
+
978
+ if ( !empty($search) )
979
+ $search = " AND ({$search}) ";
980
+
981
+ $limit = ( $limit > 0 ) ? 'LIMIT ' . intval($limit) : '';
982
+ } else
983
+ return false;
984
+
985
+ // build the final query
986
+ $query = "SELECT * FROM $wpdb->nggalbum WHERE 1=1 $search ORDER BY name ASC $limit";
987
+ $result = $wpdb->get_results($query);
988
+
989
+ return $result;
990
+ }
991
+
992
+ /**
993
+ * search for a filename
994
+ *
995
+ * @since 1.4.0
996
+ * @param string $filename
997
+ * @param int (optional) $galleryID
998
+ * @return Array Result of the request
999
+ */
1000
+ function search_for_file( $filename, $galleryID = false ) {
1001
+ global $wpdb;
1002
+
1003
+ // If a search pattern is specified, load the posts that match
1004
+ if ( !empty($filename) ) {
1005
+ // added slashes screw with quote grouping when done early, so done later
1006
+ $term = $wpdb->escape($filename);
1007
+
1008
+ $where_clause = '';
1009
+ if ( is_numeric($galleryID) ) {
1010
+ $id = (int) $galleryID;
1011
+ $where_clause = " AND tt.galleryid = {$id}";
1012
+ }
1013
+ }
1014
+
1015
+ // build the final query
1016
+ $query = "SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.filename = '{$term}' {$where_clause} ORDER BY tt.pid ASC ";
1017
+ $result = $wpdb->get_row($query);
1018
+
1019
+ // Return the object from the query result
1020
+ if ($result) {
1021
+ $image = new nggImage( $result );
1022
+ return $image;
1023
+ }
1024
+
1025
+ return null;
1026
+ }
1027
+
1028
+
1029
+ /**
1030
+ * Update or add meta data for an image
1031
+ *
1032
+ * @since 1.4.0
1033
+ * @param int $id The image ID
1034
+ * @param array $values An array with existing or new values
1035
+ * @return bool result of query
1036
+ */
1037
+ function update_image_meta( $id, $new_values ) {
1038
+ global $wpdb;
1039
+
1040
+ // Query database for existing values
1041
+ // Use cache object
1042
+ $old_values = $wpdb->get_var( $wpdb->prepare( "SELECT meta_data FROM $wpdb->nggpictures WHERE pid = %d ", $id ) );
1043
+ $old_values = unserialize( $old_values );
1044
+
1045
+ $meta = array_merge( (array)$old_values, (array)$new_values );
1046
+
1047
+ $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->nggpictures SET meta_data = %s WHERE pid = %d", serialize($meta), $id) );
1048
+
1049
+ wp_cache_delete($id, 'ngg_image');
1050
+
1051
+ return $result;
1052
+ }
1053
+
1054
+ /**
1055
+ * Computes a unique slug for the gallery,album or image, when given the desired slug.
1056
+ *
1057
+ * @since 1.7.0
1058
+ * @author taken from WP Core includes/post.php
1059
+ * @param string $slug the desired slug (post_name)
1060
+ * @param string $type ('image', 'album' or 'gallery')
1061
+ * @param int (optional) $id of the object, so that it's not checked against itself
1062
+ * @return string unique slug for the object, based on $slug (with a -1, -2, etc. suffix)
1063
+ */
1064
+ function get_unique_slug( $slug, $type, $id = 0 ) {
1065
+
1066
+ global $wpdb;
1067
+
1068
+ switch ($type) {
1069
+ case 'image':
1070
+ $check_sql = "SELECT image_slug FROM $wpdb->nggpictures WHERE image_slug = %s AND NOT pid = %d LIMIT 1";
1071
+ break;
1072
+ case 'album':
1073
+ $check_sql = "SELECT slug FROM $wpdb->nggalbum WHERE slug = %s AND NOT id = %d LIMIT 1";
1074
+ break;
1075
+ case 'gallery':
1076
+ $check_sql = "SELECT slug FROM $wpdb->nggallery WHERE slug = %s AND NOT gid = %d LIMIT 1";
1077
+ break;
1078
+ default:
1079
+ return false;
1080
+ }
1081
+
1082
+ //if you didn't give us a name we take the type
1083
+ $slug = empty($slug) ? $type: $slug;
1084
+
1085
+ // Slugs must be unique across all objects.
1086
+ $slug_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $id ) );
1087
+
1088
+ if ( $slug_check ) {
1089
+ $suffix = 2;
1090
+ do {
1091
+ $alt_name = substr ($slug, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
1092
+ $slug_check = $wpdb->get_var( $wpdb->prepare($check_sql, $alt_name, $id ) );
1093
+ $suffix++;
1094
+ } while ( $slug_check );
1095
+ $slug = $alt_name;
1096
+ }
1097
+
1098
+ return $slug;
1099
+ }
1100
+
1101
+ }
1102
+ endif;
1103
+
1104
+ if ( ! isset($GLOBALS['nggdb']) ) {
1105
+ /**
1106
+ * Initate the NextGEN Gallery Database Object, for later cache reasons
1107
+ * @global object $nggdb Creates a new nggdb object
1108
+ * @since 1.1.0
1109
+ */
1110
+ unset($GLOBALS['nggdb']);
1111
+ $GLOBALS['nggdb'] = new nggdb() ;
1112
+ }
1113
+ ?>
lib/post-thumbnail.php ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // see : http://wordpress.org/support/topic/plugin-nextgen-gallery-ngg-and-featured-image-issue?replies=14
3
+ /**
4
+ * nggPostThumbnail - Class for adding the post thumbnail feature
5
+ *
6
+ * @package NextGEN Gallery
7
+ * @author Alex Rabe
8
+ *
9
+ * @version 1.0.2
10
+ * @access internal
11
+ */
12
+ class nggPostThumbnail {
13
+
14
+ /**
15
+ * PHP4 compatibility layer for calling the PHP5 constructor.
16
+ *
17
+ */
18
+ function nggPostThumbnail() {
19
+ return $this->__construct();
20
+ }
21
+
22
+ /**
23
+ * Main constructor - Add filter and action hooks
24
+ *
25
+ */
26
+ function __construct() {
27
+
28
+ add_filter( 'admin_post_thumbnail_html', array( &$this, 'admin_post_thumbnail') );
29
+ add_action( 'wp_ajax_ngg_set_post_thumbnail', array( &$this, 'ajax_set_post_thumbnail') );
30
+ // Adding filter for the new post_thumbnail
31
+ add_filter( 'post_thumbnail_html', array( &$this, 'ngg_post_thumbnail'), 10, 5 );
32
+ return;
33
+ }
34
+
35
+ /**
36
+ * Filter for the post meta box. look for a NGG image if the ID is "ngg-<imageID>"
37
+ *
38
+ * @param string $content
39
+ * @return string html output
40
+ */
41
+ function admin_post_thumbnail( $content ) {
42
+ global $post;
43
+
44
+ if ( !is_object($post) )
45
+ return $content;
46
+
47
+ $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
48
+
49
+ // in the case it's a ngg image it return ngg-<imageID>
50
+ if ( strpos($thumbnail_id, 'ngg-') === false)
51
+ return $content;
52
+
53
+ // cut off the 'ngg-'
54
+ $thumbnail_id = substr( $thumbnail_id, 4);
55
+
56
+ return $this->_wp_post_thumbnail_html( $thumbnail_id );
57
+ }
58
+
59
+ /**
60
+ * Filter for the post content
61
+ *
62
+ * @param string $html
63
+ * @param int $post_id
64
+ * @param int $post_thumbnail_id
65
+ * @param string|array $size Optional. Image size. Defaults to 'thumbnail'.
66
+ * @param string|array $attr Optional. Query string or array of attributes.
67
+ * @return string html output
68
+ */
69
+ function ngg_post_thumbnail( $html, $post_id, $post_thumbnail_id, $size = 'post-thumbnail', $attr = '' ) {
70
+
71
+ global $post, $_wp_additional_image_sizes;
72
+
73
+ // in the case it's a ngg image it return ngg-<imageID>
74
+ if ( strpos($post_thumbnail_id, 'ngg-') === false)
75
+ return $html;
76
+
77
+ // cut off the 'ngg-'
78
+ $post_thumbnail_id = substr( $post_thumbnail_id, 4);
79
+
80
+ // get the options
81
+ $ngg_options = nggGallery::get_option('ngg_options');
82
+
83
+ // get the image data
84
+ $image = nggdb::find_image($post_thumbnail_id);
85
+
86
+ if (!$image)
87
+ return $html;
88
+
89
+ $img_src = false;
90
+ $class = 'wp-post-image ngg-image-' . $image->pid . ' ';
91
+
92
+ if (is_array($size) || is_array($_wp_additional_image_sizes) && isset($_wp_additional_image_sizes[$size])) {
93
+ $class .= isset($attr['class']) ? esc_attr($attr['class']) : '';
94
+
95
+ if( is_array($size)){
96
+ //the parameters is given as an array rather than a predfined image
97
+ $width = absint( $size[0] );
98
+ $height = absint( $size[1] );
99
+ if(isset($size[2]) && $size[2] === true) {
100
+ $mode = 'crop';
101
+ } else if(isset($size[2])){
102
+ $mode = $size[2];
103
+ } else {
104
+ $mode = '';
105
+ }
106
+ } else {
107
+ $width = absint( $_wp_additional_image_sizes[$size]['width'] );
108
+ $height = absint( $_wp_additional_image_sizes[$size]['height'] );
109
+ $mode = ($_wp_additional_image_sizes[$size]['crop']) ? 'crop' : '';
110
+ }
111
+
112
+ // check fo cached picture
113
+ if ( $post->post_status == 'publish' )
114
+ $img_src = $image->cached_singlepic_file( $width, $height, $mode );
115
+
116
+ // if we didn't use a cached image then we take the on-the-fly mode
117
+ if ($img_src == false)
118
+ $img_src = trailingslashit( home_url() ) . 'index.php?callback=image&amp;pid=' . $image->pid . '&amp;width=' . $width . '&amp;height=' . $height . '&amp;mode=crop';
119
+
120
+ } else {
121
+ $img_src = $image->thumbURL;
122
+ }
123
+
124
+ $alttext = isset($attr['alt']) ? $attr['alt'] : $image->alttext;
125
+ $titletext = isset($attr['title']) ? $attr['title'] : $image->title;
126
+
127
+ $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alttext) . '" title="' . esc_attr($titletext) .'" class="'.$class.'" />';
128
+
129
+ return $html;
130
+ }
131
+
132
+ /**
133
+ * nggPostThumbnail::ajax_set_post_thumbnail()
134
+ *
135
+ * @return void
136
+ */
137
+ function ajax_set_post_thumbnail() {
138
+
139
+ global $post_ID;
140
+
141
+ // check for correct capability
142
+ if ( !is_user_logged_in() )
143
+ die( '-1' );
144
+
145
+ // get the post id as global variable, otherwise the ajax_nonce failed later
146
+ $post_ID = intval( $_POST['post_id'] );
147
+
148
+ if ( !current_user_can( 'edit_post', $post_ID ) )
149
+ die( '-1' );
150
+
151
+ $thumbnail_id = intval( $_POST['thumbnail_id'] );
152
+
153
+ // delete the image
154
+ if ( $thumbnail_id == '-1' ) {
155
+ delete_post_meta( $post_ID, '_thumbnail_id' );
156
+ die( $this->_wp_post_thumbnail_html() );
157
+ }
158
+
159
+ // for NGG we look for the image id
160
+ if ( $thumbnail_id && nggdb::find_image($thumbnail_id) ) {
161
+ // to know that we have a NGG image we add "ngg-" before the id
162
+ update_post_meta( $post_ID, '_thumbnail_id', 'ngg-' . $thumbnail_id );
163
+ die( $this->_wp_post_thumbnail_html( $thumbn