Merge lp:~edb/quam-plures/yet_another_image_branch into lp:quam-plures
- yet_another_image_branch
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 7597 |
Proposed branch: | lp:~edb/quam-plures/yet_another_image_branch |
Merge into: | lp:quam-plures |
Diff against target: |
2342 lines (+1321/-637) 11 files modified
qp_inc/files/files.ctrl.php (+1/-1) qp_inc/files/upload.ctrl.php (+3/-3) qp_inc/files/views/_file_browse.view.php (+1/-1) qp_inc/files/views/_file_list.inc.php (+712/-564) qp_inc/plugins/_plugin.class.php (+10/-0) qp_inc/plugins/model/_plugins_admin.class.php (+1/-0) qp_install/_functions_create.php (+1/-1) qp_plugins/tinymce_plugin/README.html (+39/-3) qp_plugins/tinymce_plugin/_tinymce.plugin.php (+296/-10) qp_plugins/tinymce_plugin/po/messages.pot (+218/-14) qp_rsc/css/basic.css (+39/-40) |
To merge this branch: | bzr merge lp:~edb/quam-plures/yet_another_image_branch |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Yabs (community) | Approve | ||
EdB | Needs Resubmitting | ||
Kimberly (community) | Needs Fixing | ||
Review via email: mp+50959@code.launchpad.net |
Commit message
Description of the change
http://
Will grab a fresh copy and see if I can duplicate (then correct) the problem or not.
I'll guess when it doesn't insert anything it keeps the FM in popup open but re-orders the images in reverse alphabetical order? I saw that a couple of times, usually after trying too many changes at the same time. So I tinker away until the problem is resolved. Very possible I missed between my D drive where work happens and my C drive that talks to LP from time to time...
Kimberly (kimberly-netweb360) wrote : | # |
> Will grab a fresh copy and see if I can duplicate (then correct) the problem
> or not.
>
> I'll guess when it doesn't insert anything it keeps the FM in popup open but
> re-orders the images in reverse alphabetical order? I saw that a couple of
> times, usually after trying too many changes at the same time. So I tinker
> away until the problem is resolved. Very possible I missed between my D drive
> where work happens and my C drive that talks to LP from time to time...
Yes, that is exactly correct; I noticed that it seems to reload the FM in popup and reorders the images.
Grabbed core and merged in this branch, and grabbed a fresh copy of this branch. Ran both without issue on localhost and my server. Thus, could not duplicate problem.
Kimberly (kimberly-netweb360) wrote : | # |
> Grabbed core and merged in this branch, and grabbed a fresh copy of this
> branch. Ran both without issue on localhost and my server. Thus, could not
> duplicate problem.
I will grab a fresh copy of the branch and make sure it is properly loaded to server and then try again. Will report my findings.
Kimberly (kimberly-netweb360) wrote : | # |
OK, I used bazaar explorer and downloaded the branch using lp:~edb/quam-plures/yet_another_image_branch. Once the branched was saved to my local hard drive, I use FileZilla to upload all files to my qp test blog overwriting all files. Then I logged into the test blog and started a new post. It would not work for me. Am I doing this wrong? If so, then tell me how to do this so I can test this. I tried it both on FireFox and IE. Below are some test results I got.
In the TinyMCE configuration need to remove align="center"
In the file manager in pop-up, need to change title: no caption to no title
Float left, title default, caption default, does not work.
Float left, title default, caption placeholder, works.
Float left, title default, caption no caption, does not work.
Float left, title placeholder, caption default, does not work.
Float left, title no caption, caption default, does not work.
Float right, title default, caption default, does not work.
Float right, title default, caption placeholder, works.
Float right, title default, caption no caption, does not work.
Float right, title default, caption default, does not work.
Float right, title placeholder, caption default, does not work.
Float right, title no caption, caption default, does not work.
Float center, title default, caption default, does not work.
Float center, title default, caption default, does not work.
Float center, title default, caption placeholder, works.
inline, works.
The above was done in TinyMCE.
When I turned off TinyMCE I got the same results.
I was only able to insert an image for when caption was set to placeholder.
One bug fixed - the "no caption" as an option in the title selector.
One other verified - selecting "no caption" from the caption selector causes it to insert nothing. Fix on the way...
Changes to TinyMCE settings: align="center" removed from table due to it did nothing, class="center" removed from IMG tag for the same reason, class="center" added to TD for image in order to center the image in the available space.
Kimberly (kimberly-netweb360) wrote : | # |
Tested and all seem to be working as should be. I tried many different combinations. Unless someone else wants to test this, it may be ready for prime time.
Yabs (yabs) wrote : | # |
I assume Kimberlys comment means "approved" so I'll flag it as such as I don't use tiny and have no idea what I should be looking for ;)
¥
On 3/7/2011 2:42 AM, Yabs wrote:
> Review: Approve
> I assume Kimberlys comment means "approved" so I'll flag it as such as I don't use tiny and have no idea what I should be looking for ;)
>
> ¥
I hope replying by email from a computer that doesn't know my LP info
recognizes this is me...
The thing to look for even ignoring TinyMCE is problems when inserting
an image via file manager. Core is completely different in this
branch. I tried to ensure good testing of all sorts of combinations but
I wouldn't be surprised if I missed something. 3 options (position,
caption, title) with 3 choices each means ... 3 * 3 * 3 total
possibilities? Plus if the image has or doesn't have a caption or title
stored means even more.
Big-ass branch. I really didn't want to be doing those after we went
live, but I can't see any way to break this smaller. (EdB just in case)
Kimberly (kimberly-netweb360) wrote : | # |
EdB, is it possible that the wrong revision got merged? I just download the quam_plures branch and uploaded it to the server. The first thing I noticed was that in TinyMCE the align="center" was in the configuration for TinyMCE. If you recall, I mentioned that this produced the following code: <table class="floatleft" width="412" align="center"> which always align the table centre. I thought that it might just be the TinyMCE plugin which would not be a big problem. However, when I tried to insert images using variations of the align/title/
So, is it possible that the wrong revision got merged?
-Kimberly.
It should have been the currentest version but I dunno. Haven't actually looked at it yet. Busy at work at the moment, and will be for a couple of days, but I will compare what I have on the hard drive at home to what we have in core now.
Also possible is that I failed to upload a change. THAT is more likely than an older step along this branch got merged. Anyway I'll check and see what I can see.
Kimberly (kimberly-netweb360) wrote : | # |
Just wanted to comment on this again to keep it current. I just downloaded the March 15 trunk.zip instead of going through bazaar and it is broken. The drop-down list for title has the "no caption" and that was one of the things you corrected as well as the TinyMCE plugin having the align="center" causing all images to be centred regardless of choosing a float. With particular combinations of title and caption the file manager in a pop-up just reloads with the file list reordered as was mentioned.
I don't think we should do another release as was mentioned in the forums until this resolved.
-Kimberly.
Preview Diff
1 | === modified file 'qp_inc/files/files.ctrl.php' |
2 | --- qp_inc/files/files.ctrl.php 2010-12-31 12:12:03 +0000 |
3 | +++ qp_inc/files/files.ctrl.php 2011-03-08 04:29:14 +0000 |
4 | @@ -1475,7 +1475,7 @@ |
5 | } |
6 | |
7 | // Update sub-menu: |
8 | -$popfor = param( 'popfor', 'string', '' ); |
9 | +$popfor = param( 'popfor', 'string', '', true ); |
10 | if( $current_User->check_perm( 'files', 'add' ) && $popfor == '' ) |
11 | { // Permission to upload and we are not in a popup window (no subtabs needed otherwise) |
12 | $AdminUI->add_menu_entries( |
13 | |
14 | === modified file 'qp_inc/files/upload.ctrl.php' |
15 | --- qp_inc/files/upload.ctrl.php 2010-12-31 12:12:03 +0000 |
16 | +++ qp_inc/files/upload.ctrl.php 2011-03-08 04:29:14 +0000 |
17 | @@ -433,14 +433,14 @@ |
18 | $success_msg .= '<br />'; |
19 | $success_msg .= '<fieldset class="uploaded_image"><legend>'.T_('Add this Image to your Post').'</legend><ul><li>'; |
20 | // image tag floated left |
21 | - $img_tag = format_to_output( $newFile->get_tag( '<span class="imgwrap floatleft center">', '<br /><span class="image_legend">', '</span>', '</span>', 'original', '', 'spanimage' ), 'formvalue' ); |
22 | + $img_tag = format_to_output( $newFile->get_tag( '<span class="floatleft center">', '<br /><span class="image_legend">', '</span>', '</span>', 'original', '', 'spanimage' ), 'formvalue' ); |
23 | $success_msg .= '<a href="#" onclick="if( window.focus && window.opener ){ window.opener.focus(); textarea_wrap_selection( window.opener.document.getElementById(\'itemform_post_content\'), \''.$img_tag.'\', \'\', 1, window.opener.document ); } return false;">['.T_('float:left').']</a> or '; |
24 | // image tag centered |
25 | $img_tag = format_to_output( $newFile->get_tag( '<div class="image_block">', '<div class="image_legend">', '</div>', '</div>', 'original', '', 'center'), 'formvalue' ); |
26 | $success_msg .= '<a href="#" onclick="if( window.focus && window.opener ){ window.opener.focus(); textarea_wrap_selection( window.opener.document.getElementById(\'itemform_post_content\'), \''.$img_tag.'\', \'\', 1, window.opener.document ); } return false;">['.T_('centered').']</a> or '; |
27 | // image tag floated right |
28 | - $img_tag = format_to_output( $newFile->get_tag( '<span class="imgwrap floatright center">', '<br /><span class="image_legend">', '</span>', '</span>', 'original', '', 'spanimage' ), 'formvalue' ); |
29 | - $success_msg .= '<a href="#" onclick="if( window.focus && window.opener ){ window.opener.focus(); textarea_wrap_selection( window.opener.document.getElementById(\'itemform_post_content\'), \''.$img_tag.'\', \'\', 1, window.opener.document ); } return false;">['.T_('float:right)').']</a>'; |
30 | + $img_tag = format_to_output( $newFile->get_tag( '<span class="floatright center">', '<br /><span class="image_legend">', '</span>', '</span>', 'original', '', 'spanimage' ), 'formvalue' ); |
31 | + $success_msg .= '<a href="#" onclick="if( window.focus && window.opener ){ window.opener.focus(); textarea_wrap_selection( window.opener.document.getElementById(\'itemform_post_content\'), \''.$img_tag.'\', \'\', 1, window.opener.document ); } return false;">['.T_('float:right').']</a>'; |
32 | $success_msg .= '</li></ul></fieldset>'; |
33 | $success_msg .= '<hr class="hidden" />'; |
34 | } |
35 | |
36 | === modified file 'qp_inc/files/views/_file_browse.view.php' |
37 | --- qp_inc/files/views/_file_browse.view.php 2010-12-31 12:12:03 +0000 |
38 | +++ qp_inc/files/views/_file_browse.view.php 2011-03-08 04:29:14 +0000 |
39 | @@ -64,7 +64,7 @@ |
40 | */ |
41 | global $edited_Item; |
42 | |
43 | -$popfor = param( 'popfor', 'string', '' ); |
44 | +$popfor = param( 'popfor', 'string', '', true ); |
45 | |
46 | ?> |
47 | |
48 | |
49 | === modified file 'qp_inc/files/views/_file_list.inc.php' |
50 | --- qp_inc/files/views/_file_list.inc.php 2010-12-31 12:12:03 +0000 |
51 | +++ qp_inc/files/views/_file_list.inc.php 2011-03-08 04:29:14 +0000 |
52 | @@ -81,582 +81,730 @@ |
53 | <?php |
54 | $Form = new Form( NULL, 'FilesForm', 'post', 'none' ); |
55 | $Form->begin_form(); |
56 | - $Form->hidden_ctrl(); |
57 | - |
58 | - $Form->hidden( 'confirmed', '0' ); |
59 | - $Form->hidden( 'md5_filelist', $fm_Filelist->md5_checksum() ); |
60 | - $Form->hidden( 'md5_cwd', md5($fm_Filelist->get_ads_list_path()) ); |
61 | - $Form->hiddens_by_key( get_memorized('fm_selected') ); // 'fm_selected' gets provided by the form itself |
62 | +$Form->hidden_ctrl(); |
63 | +$Form->hidden( 'confirmed', '0' ); |
64 | +$Form->hidden( 'md5_filelist', $fm_Filelist->md5_checksum() ); |
65 | +$Form->hidden( 'md5_cwd', md5($fm_Filelist->get_ads_list_path()) ); |
66 | +$Form->hiddens_by_key( get_memorized('fm_selected') ); // 'fm_selected' gets provided by the form itself |
67 | ?> |
68 | <table class="filelist"> |
69 | - <thead> |
70 | - <?php |
71 | - /***************** Col headers ****************/ |
72 | - |
73 | - echo '<tr>'; |
74 | - |
75 | - // "Go to parent" icon |
76 | - echo '<th class="firstcol">'; |
77 | - if( empty($fm_Filelist->_rds_list_path) ) |
78 | - { // cannot go higher |
79 | - echo ' '; // for IE |
80 | - } |
81 | - else |
82 | - { |
83 | - echo action_icon( T_('Go to parent folder'), 'folder_parent', regenerate_url( 'path', 'path='.$fm_Filelist->_rds_list_path.'..' ) ); |
84 | - } |
85 | - echo '</th>'; |
86 | - |
87 | - echo '<th class="nowrap">'; |
88 | - if( $UserSettings->get( 'fm_imglistpreview' ) ) |
89 | - { // Image file preview: |
90 | - $col_title = T_('Icon/Type'); |
91 | - } |
92 | - else |
93 | - { |
94 | - $col_title = /* TRANS: short for (file)Type */ T_(' T '); |
95 | - } |
96 | - echo $fm_Filelist->get_sort_link( 'type', $col_title ); |
97 | - echo '</th>'; |
98 | - |
99 | - if( $fm_flatmode ) |
100 | - { |
101 | - echo '<th>'.$fm_Filelist->get_sort_link( 'path', /* TRANS: file/directory path */ T_('Path') ).'</th>'; |
102 | - } |
103 | - |
104 | - echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'name', /* TRANS: file name */ T_('Name') ).'</th>'; |
105 | - |
106 | - if( $UserSettings->get('fm_showtypes') ) |
107 | - { // Show file types column |
108 | - echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'type', /* TRANS: file type */ T_('Type') ).'</th>'; |
109 | - } |
110 | - |
111 | - echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'size', /* TRANS: file size */ T_('Size') ).'</th>'; |
112 | - |
113 | - if( $UserSettings->get('fm_showdate') != 'no' ) |
114 | - { // Show last mod column |
115 | - echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'lastmod', /* TRANS: file's last change / timestamp */ T_('Last change') ).'</th>'; |
116 | - } |
117 | - |
118 | - $popfor = param( 'popfor', 'string', '' ); |
119 | - |
120 | - if( $popfor == '' ) |
121 | - { |
122 | - if( $UserSettings->get('fm_showfsperms') ) |
123 | - { // Show file perms column |
124 | - echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'perms', /* TRANS: file's permissions (short) */ T_('Perms') ).'</th>'; |
125 | - } |
126 | - |
127 | - if( $UserSettings->get('fm_showfsowner') ) |
128 | - { // Show file owner column |
129 | - echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'fsowner', /* TRANS: file owner */ T_('Owner') ).'</th>'; |
130 | - } |
131 | - |
132 | - if( $UserSettings->get('fm_showfsgroup') ) |
133 | - { // Show file group column |
134 | - echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'fsgroup', /* TRANS: file group */ T_('Group') ).'</th>'; |
135 | - } |
136 | - |
137 | - echo '<th class="lastcol nowrap">'. /* TRANS: file actions; edit, rename, copy, .. */ T_('Actions').'</th>'; |
138 | - } |
139 | - echo '</tr>'; |
140 | - ?> |
141 | - </thead> |
142 | - |
143 | - <tbody> |
144 | - <?php |
145 | - param( 'checkall', 'integer', 0 ); // Non-Javascript-CheckAll |
146 | - |
147 | - /***********************************************************/ |
148 | - /* MAIN FILE LIST: */ |
149 | - /***********************************************************/ |
150 | - $countFiles = 0; |
151 | - while( $lFile = & $fm_Filelist->get_next() ) |
152 | - { // Loop through all Files: |
153 | - echo '<tr class="'.( $countFiles%2 ? 'odd' : 'even' ).'">'; |
154 | - |
155 | - |
156 | - /******************** Checkbox: *******************/ |
157 | - |
158 | - echo '<td class="checkbox firstcol">'; |
159 | - echo '<span name="surround_check" class="checkbox_surround_init">'; |
160 | - echo '<input title="'.T_('Select this file').'" type="checkbox" class="checkbox" |
161 | - name="fm_selected[]" value="'.rawurlencode($lFile->get_rdfp_rel_path()).'" id="cb_filename_'.$countFiles.'"'; |
162 | - global $checkall; |
163 | - if( $checkall || $selected_Filelist->contains( $lFile ) ) |
164 | - { |
165 | - echo ' checked="checked"'; |
166 | - } |
167 | - echo ' />'; |
168 | - echo '</span>'; |
169 | - |
170 | - /*********** Hidden info used by Javascript: ***********/ |
171 | - |
172 | - global $mode; |
173 | - if( $mode == 'upload' ) |
174 | - { // This mode allows to insert img tags into the post... |
175 | - // Hidden info used by Javascript: |
176 | - echo '<input type="hidden" name="img_tag_'.$countFiles.'" id="img_tag_'.$countFiles |
177 | - .'" value="'.format_to_output( $lFile->get_tag(), 'formvalue' ).'" />'; |
178 | - } |
179 | - |
180 | - echo '</td>'; |
181 | - |
182 | - |
183 | - /******************** Icon / File type: *******************/ |
184 | - |
185 | - echo '<td class="icon_type">'; |
186 | - if( $UserSettings->get( 'fm_imglistpreview' ) ) |
187 | - { // Image preview OR full type: |
188 | - if( $lFile->is_dir() ) |
189 | - { // Navigate into Directory |
190 | - echo '<a href="'.$lFile->get_view_url().'" title="'.T_('Change into this directory').'">'.$lFile->get_icon().' '.T_('Directory').'</a>'; |
191 | - } |
192 | - else |
193 | - { |
194 | - echo $lFile->get_preview_thumb( 'fulltype' ); |
195 | - } |
196 | - } |
197 | - else |
198 | - { // No image preview, small type: |
199 | - if( $lFile->is_dir() ) |
200 | - { // Navigate into Directory |
201 | - echo '<a href="'.$lFile->get_view_url().'" title="'.T_('Change into this directory').'">'.$lFile->get_icon().'</a>'; |
202 | - } |
203 | - else |
204 | - { // File |
205 | - echo $lFile->get_view_link( $lFile->get_icon(), NULL, $lFile->get_icon() ); |
206 | - } |
207 | - } |
208 | - echo '</td>'; |
209 | - |
210 | - /******************* Path (flatmode): ******************/ |
211 | - |
212 | - if( $fm_flatmode ) |
213 | - { |
214 | - echo '<td class="filepath">'; |
215 | - echo dirname($lFile->get_rdfs_rel_path()).'/'; |
216 | - echo '</td>'; |
217 | - } |
218 | - |
219 | - |
220 | - echo '<td class="fm_filename">'; |
221 | - |
222 | - /************* Invalid filename warning: *************/ |
223 | - |
224 | - if( !$lFile->is_dir() ) |
225 | - { |
226 | - if( $error_filename = validate_filename( $lFile->get_name() ) ) |
227 | - { // TODO: Warning icon with hint |
228 | - echo get_icon( 'warning', 'imgtag', array( 'class' => 'filenameIcon', 'title' => $error_filename ) ); |
229 | - } |
230 | - } |
231 | - elseif( $error_dirname = validate_dirname( $lFile->get_name() ) ) |
232 | - { // TODO: Warning icon with hint |
233 | - echo get_icon( 'warning', 'imgtag', array( 'class' => 'filenameIcon', 'title' => $error_dirname ) ); |
234 | - } |
235 | - |
236 | - /**** Open in a new window (only directories) ****/ |
237 | - |
238 | - if( $lFile->is_dir() ) |
239 | - { // Directory |
240 | - $browse_dir_url = $lFile->get_view_url(); |
241 | - $popup_url = url_add_param( $browse_dir_url, 'mode=popup' ); |
242 | - $target = 'evo_fm_'.$lFile->get_md5_ID(); |
243 | - |
244 | - echo '<a href="'.$browse_dir_url.'" target="'.$target.' " class="filenameIcon" |
245 | - title="'.T_('Open in a new window').'" onclick="' |
246 | - ."return pop_up_window( '$popup_url', '$target' )" |
247 | - .'">'.get_icon( 'window_new' ).'</a>'; |
248 | - } |
249 | - |
250 | - /*************** Link ("chain") icon: **************/ |
251 | - |
252 | - // if( ! $lFile->is_dir() ) // fp> OK but you need to include an else:placeholder, otherwise the display is ugly |
253 | - { // Only provide link/"chain" icons for files. |
254 | - // TODO: dh> provide support for direcories (display included files). |
255 | - |
256 | - // fp> here might not be the best place to put the perm check |
257 | - if( isset($edited_Item) && $current_User->check_perm( 'item_post!CURSTATUS', 'edit', false, $edited_Item ) ) |
258 | - { // Offer option to link the file to an Item (or anything else): |
259 | - $link_attribs = array(); |
260 | - $link_action = 'link'; |
261 | - if( $mode == 'upload' ) |
262 | - { // We want the action to happen in the post attachments iframe: |
263 | - $link_attribs['target'] = $iframe_name; |
264 | - $link_action = 'link_inpost'; |
265 | - } |
266 | - echo action_icon( T_('Link this file!'), 'link', |
267 | - regenerate_url( 'fm_selected', 'action='.$link_action.'&fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ), |
268 | - NULL, NULL, NULL, $link_attribs ); |
269 | - echo ' '; |
270 | - } |
271 | - |
272 | - if( isset($edited_User) ) // fp> Perm already checked in controller |
273 | - { // Offer option to link the file to an Item (or anything else): |
274 | - echo action_icon( T_('Link this file!'), 'link', |
275 | - regenerate_url( 'fm_selected', 'action=link_user&fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ), |
276 | - NULL, NULL, NULL, array() ); |
277 | - echo ' '; |
278 | - } |
279 | - } |
280 | - |
281 | - /******************** Filename ********************/ |
282 | - |
283 | - if( $lFile->is_dir() ) |
284 | - { // Directory |
285 | - // Link to open the directory in the curent window |
286 | - echo '<a href="'.$browse_dir_url.'">'.$lFile->dget('name').'</a>'; |
287 | - } |
288 | - else |
289 | - { // File |
290 | - if( $view_link = $lFile->get_view_link( $lFile->get_name(), NULL, NULL ) ) |
291 | - { |
292 | - echo $view_link; |
293 | - } |
294 | - else |
295 | - { // File extension unrecognized |
296 | - echo $lFile->dget('name'); |
297 | - } |
298 | - } |
299 | - |
300 | - /*************** File meta data: **************/ |
301 | - |
302 | - echo '<span class="filemeta">'; |
303 | - // Optionally display IMAGE pixel size: |
304 | - if( $UserSettings->get( 'fm_getimagesizes' ) ) |
305 | - { |
306 | - echo ' ('.$lFile->get_image_size( 'widthxheight' ).')'; |
307 | - } |
308 | - // Optionally display meta data title: |
309 | - if( $lFile->meta == 'loaded' ) |
310 | - { // We have loaded meta data for this file: |
311 | - echo ' - '.$lFile->title; |
312 | - } |
313 | - echo '</span>'; |
314 | - |
315 | - echo '</td>'; |
316 | - |
317 | - /******************* File type ******************/ |
318 | - |
319 | - if( $UserSettings->get('fm_showtypes') ) |
320 | - { // Show file types |
321 | - echo '<td class="type">'.$lFile->get_type().'</td>'; |
322 | - } |
323 | - |
324 | - /******************* File size ******************/ |
325 | - |
326 | - echo '<td class="size">'.$fm_Filelist->get_File_size_formatted($lFile).'</td>'; |
327 | - |
328 | - /**************** File time stamp ***************/ |
329 | - |
330 | - if( $UserSettings->get('fm_showdate') != 'no' ) |
331 | - { // Show last modified datetime (always full in title attribute) |
332 | - $lastmod_date = $lFile->get_lastmod_formatted( 'date' ); |
333 | - $lastmod_time = $lFile->get_lastmod_formatted( 'time' ); |
334 | - echo '<td class="timestamp" title="'.$lastmod_date.' '.$lastmod_time.'">'; |
335 | - if( $UserSettings->get('fm_showdate') == 'long' ) |
336 | - { |
337 | - echo '<span class="date">'.$lastmod_date.'</span> '; |
338 | - echo '<span class="time">'.$lastmod_time.'</span>'; |
339 | - } |
340 | - else |
341 | - { // Compact format |
342 | - echo $lFile->get_lastmod_formatted( 'compact' ); |
343 | - } |
344 | - echo '</td>'; |
345 | - } |
346 | - |
347 | - /**************** File pemissions ***************/ |
348 | - if( $popfor == '' ) |
349 | - { |
350 | - if( $UserSettings->get('fm_showfsperms') ) |
351 | - { // Show file perms |
352 | - echo '<td class="perms">'; |
353 | - $fm_permlikelsl = $UserSettings->param_Request( 'fm_permlikelsl', 'fm_permlikelsl', 'integer', 0 ); |
354 | - if( $current_User->check_perm( 'files', 'edit' ) ) |
355 | - { // User can edit: |
356 | - echo '<a title="'.T_('Edit permissions').'" href="'.regenerate_url( 'fm_selected,action', 'action=edit_perms&fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ).'">' |
357 | - .$lFile->get_perms( $fm_permlikelsl ? 'lsl' : '' ).'</a>'; |
358 | - } |
359 | - else |
360 | - { |
361 | - echo $lFile->get_perms( $fm_permlikelsl ? 'lsl' : '' ); |
362 | - } |
363 | - echo '</td>'; |
364 | - } |
365 | - |
366 | - /**************** File owner ********************/ |
367 | - if( $UserSettings->get('fm_showfsowner') ) |
368 | - { // Show file owner |
369 | - echo '<td class="fsowner">'; |
370 | - echo $lFile->get_fsowner_name(); |
371 | - echo '</td>'; |
372 | - } |
373 | - |
374 | - /**************** File group *********************/ |
375 | - if( $UserSettings->get('fm_showfsgroup') ) |
376 | - { // Show file owner |
377 | - echo '<td class="fsgroup">'; |
378 | - echo $lFile->get_fsgroup_name(); |
379 | - echo '</td>'; |
380 | - } |
381 | - |
382 | - /***************** Action icons ****************/ |
383 | - echo '<td class="actions lastcol">'; |
384 | - if( $current_User->check_perm( 'files', 'edit' ) ) |
385 | - { // User can edit: |
386 | - if( $lFile->is_editable( $current_User->check_perm( 'files', 'all' ) ) ) |
387 | - { |
388 | - echo action_icon( T_('Edit file...'), 'edit', regenerate_url( 'fm_selected', 'action=edit_file&fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ) ); |
389 | - } |
390 | - else |
391 | - { |
392 | - echo get_icon( 'edit', 'noimg' ); |
393 | - } |
394 | - } |
395 | - echo action_icon( T_('Edit properties...'), 'properties', regenerate_url( 'fm_selected', 'action=edit_properties&fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ) ); |
396 | - |
397 | - if( $current_User->check_perm( 'files', 'edit' ) ) |
398 | - { // User can edit: |
399 | - echo action_icon( T_('Rename'), 'rename', regenerate_url( 'fm_selected', 'action=rename&fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ) ); |
400 | - echo action_icon( T_('Move'), 'move', regenerate_url( 'fm_mode,fm_sources,fm_sources_root', 'fm_mode=file_move&fm_sources[]='.rawurlencode( $lFile->get_rdfp_rel_path() ).'&fm_sources_root='.$fm_Filelist->_FileRoot->ID ) ); |
401 | - echo action_icon( T_('Copy'), 'copy', regenerate_url( 'fm_mode,fm_sources,fm_sources_root', 'fm_mode=file_copy&fm_sources[]='.rawurlencode( $lFile->get_rdfp_rel_path() ).'&fm_sources_root='.$fm_Filelist->_FileRoot->ID ) ); |
402 | - echo action_icon( T_('Delete'), 'delete', regenerate_url( 'fm_selected', 'action=delete&fm_selected[]='.rawurlencode( $lFile->get_rdfp_rel_path() ) ) ); |
403 | - } |
404 | - echo '</td>'; |
405 | - } |
406 | - |
407 | - echo '</tr>'; |
408 | - |
409 | - $countFiles++; |
410 | - } |
411 | - // / End of file list.. |
412 | - |
413 | - |
414 | - /** |
415 | - * @global integer Number of cols for the files table, 6 is minimum. |
416 | - */ |
417 | - $filetable_cols = 5 |
418 | - + (int)$fm_flatmode |
419 | - + (int)$UserSettings->get('fm_showtypes') |
420 | - + (int)($UserSettings->get('fm_showdate') != 'no') |
421 | - + (int)$UserSettings->get('fm_showfsperms') |
422 | - + (int)$UserSettings->get('fm_showfsowner') |
423 | - + (int)$UserSettings->get('fm_showfsgroup') |
424 | - + (int)$UserSettings->get('fm_imglistpreview'); |
425 | - |
426 | - |
427 | - if( $countFiles == 0 ) |
428 | - { // Filelist errors or "directory is empty" |
429 | +<thead> |
430 | +<?php |
431 | +/***************** Col headers ****************/ |
432 | +echo '<tr>'; |
433 | + |
434 | +// "Go to parent" icon |
435 | +echo '<th class="firstcol">'; |
436 | +if( empty($fm_Filelist->_rds_list_path) ) |
437 | +{ // cannot go higher |
438 | + echo ' '; // for IE |
439 | +} |
440 | +else |
441 | +{ |
442 | + echo action_icon( T_('Go to parent folder'), 'folder_parent', regenerate_url( 'path', 'path='.$fm_Filelist->_rds_list_path.'..' ) ); |
443 | +} |
444 | +echo '</th>'; |
445 | + |
446 | +echo '<th class="nowrap">'; |
447 | +if( $UserSettings->get( 'fm_imglistpreview' ) ) |
448 | +{ // Image file preview: |
449 | + $col_title = T_('Icon/Type'); |
450 | +} |
451 | +else |
452 | +{ |
453 | + $col_title = /* TRANS: short for (file)Type */ T_(' T '); |
454 | +} |
455 | +echo $fm_Filelist->get_sort_link( 'type', $col_title ); |
456 | +echo '</th>'; |
457 | + |
458 | +if( $fm_flatmode ) |
459 | +{ |
460 | + echo '<th>'.$fm_Filelist->get_sort_link( 'path', /* TRANS: file/directory path */ T_('Path') ).'</th>'; |
461 | +} |
462 | + |
463 | +echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'name', /* TRANS: file name */ T_('Name') ).'</th>'; |
464 | + |
465 | +if( $UserSettings->get('fm_showtypes') ) |
466 | +{ // Show file types column |
467 | + echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'type', /* TRANS: file type */ T_('Type') ).'</th>'; |
468 | +} |
469 | + |
470 | +echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'size', /* TRANS: file size */ T_('Size') ).'</th>'; |
471 | + |
472 | +if( $UserSettings->get('fm_showdate') != 'no' ) |
473 | +{ // Show last mod column |
474 | + echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'lastmod', /* TRANS: file's last change / timestamp */ T_('Last change') ).'</th>'; |
475 | +} |
476 | + |
477 | +$popfor = param( 'popfor', 'string', '', true ); |
478 | + |
479 | +if( $popfor == '' ) |
480 | +{ |
481 | + if( $UserSettings->get('fm_showfsperms') ) |
482 | + { // Show file perms column |
483 | + echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'perms', /* TRANS: file's permissions (short) */ T_('Perms') ).'</th>'; |
484 | + } |
485 | + |
486 | + if( $UserSettings->get('fm_showfsowner') ) |
487 | + { // Show file owner column |
488 | + echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'fsowner', /* TRANS: file owner */ T_('Owner') ).'</th>'; |
489 | + } |
490 | + |
491 | + if( $UserSettings->get('fm_showfsgroup') ) |
492 | + { // Show file group column |
493 | + echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'fsgroup', /* TRANS: file group */ T_('Group') ).'</th>'; |
494 | + } |
495 | + |
496 | + echo '<th class="lastcol nowrap">'. /* TRANS: file actions; edit, rename, copy, .. */ T_('Actions').'</th>'; |
497 | +} |
498 | +echo '</tr>'; |
499 | +?> |
500 | +</thead> |
501 | +<tbody> |
502 | + |
503 | +<?php |
504 | +param( 'checkall', 'integer', 0 ); // Non-Javascript-CheckAll |
505 | + |
506 | +/***********************************************************/ |
507 | +/* MAIN FILE LIST: */ |
508 | +/***********************************************************/ |
509 | +$countFiles = 0; |
510 | +while( $lFile = & $fm_Filelist->get_next() ) |
511 | +{ // Loop through all Files: |
512 | + echo '<tr class="'.( $countFiles%2 ? 'odd' : 'even' ).'">'; |
513 | + |
514 | + /******************** Checkbox: *******************/ |
515 | + echo '<td class="checkbox firstcol">'; |
516 | + echo '<span name="surround_check" class="checkbox_surround_init">'; |
517 | + echo '<input title="'.T_('Select this file').'" type="checkbox" class="checkbox" |
518 | + name="fm_selected[]" value="'.rawurlencode($lFile->get_rdfp_rel_path()).'" id="cb_filename_'.$countFiles.'"'; |
519 | + global $checkall; |
520 | + if( $checkall || $selected_Filelist->contains( $lFile ) ) |
521 | + { |
522 | + echo ' checked="checked"'; |
523 | + } |
524 | + echo ' />'; |
525 | + echo '</span>'; |
526 | + |
527 | + /*********** Hidden info used by Javascript: ***********/ |
528 | + |
529 | + global $mode; |
530 | + if( $mode == 'upload' ) |
531 | + { // This mode allows inserting images or links to files in items... |
532 | + $lFile->load_meta( true ); |
533 | + echo '<input type="hidden" name="link_'.$countFiles.'" id="link_'.$countFiles.'" value="' |
534 | + .$lFile->get_url().'" />'."\n"; |
535 | + // this is the title |
536 | + echo '<input type="hidden" name="title_'.$countFiles.'" id="title_'.$countFiles.'" value="' |
537 | + .$lFile->dget('title', 'htmlattr').'" />'."\n"; |
538 | + // this is the alttxt |
539 | + echo '<input type="hidden" name="alttxt_'.$countFiles.'" id="alttxt_'.$countFiles.'" value="' |
540 | + .$lFile->dget('alt', 'htmlattr').'" />'."\n"; |
541 | + // this is the caption |
542 | + echo '<input type="hidden" name="caption_'.$countFiles.'" id="caption_'.$countFiles.'" value="' |
543 | + .$lFile->dget('desc', 'htmlattr').'" />'."\n"; |
544 | + // this is width and height OR false for non-image files |
545 | + echo '<input type="hidden" name="dimens_'.$countFiles.'" id="dimens_'.$countFiles.'" value="' |
546 | + .$lFile->get_image_size().'" />'."\n"; |
547 | + } |
548 | + |
549 | + echo '</td>'; |
550 | + |
551 | + /******************** Icon / File type: *******************/ |
552 | + echo '<td class="icon_type">'; |
553 | + if( $UserSettings->get( 'fm_imglistpreview' ) ) |
554 | + { // Image preview OR full type: |
555 | + if( $lFile->is_dir() ) |
556 | + { // Navigate into Directory |
557 | + echo '<a href="'.$lFile->get_view_url().'" title="'.T_('Change into this directory').'">'.$lFile->get_icon().' '.T_('Directory').'</a>'; |
558 | + } |
559 | + else |
560 | + { |
561 | + echo $lFile->get_preview_thumb( 'fulltype' ); |
562 | + } |
563 | + } |
564 | + else |
565 | + { // No image preview, small type: |
566 | + if( $lFile->is_dir() ) |
567 | + { // Navigate into Directory |
568 | + echo '<a href="'.$lFile->get_view_url().'" title="'.T_('Change into this directory').'">'.$lFile->get_icon().'</a>'; |
569 | + } |
570 | + else |
571 | + { // File |
572 | + echo $lFile->get_view_link( $lFile->get_icon(), NULL, $lFile->get_icon() ); |
573 | + } |
574 | + } |
575 | + echo '</td>'; |
576 | + |
577 | + /******************* Path (flatmode): ******************/ |
578 | + if( $fm_flatmode ) |
579 | + { |
580 | + echo '<td class="filepath">'; |
581 | + echo dirname($lFile->get_rdfs_rel_path()).'/'; |
582 | + echo '</td>'; |
583 | + } |
584 | + |
585 | + echo '<td class="fm_filename">'; |
586 | + |
587 | + /************* Invalid filename warning: *************/ |
588 | + if( !$lFile->is_dir() ) |
589 | + { |
590 | + if( $error_filename = validate_filename( $lFile->get_name() ) ) |
591 | + { // TODO: Warning icon with hint |
592 | + echo get_icon( 'warning', 'imgtag', array( 'class' => 'filenameIcon', 'title' => $error_filename ) ); |
593 | + } |
594 | + } |
595 | + elseif( $error_dirname = validate_dirname( $lFile->get_name() ) ) |
596 | + { // TODO: Warning icon with hint |
597 | + echo get_icon( 'warning', 'imgtag', array( 'class' => 'filenameIcon', 'title' => $error_dirname ) ); |
598 | + } |
599 | + |
600 | + /**** Open in a new window (only directories) ****/ |
601 | + if( $lFile->is_dir() ) |
602 | + { // Directory |
603 | + $browse_dir_url = $lFile->get_view_url(); |
604 | + $popup_url = url_add_param( $browse_dir_url, 'mode=popup' ); |
605 | + $target = 'evo_fm_'.$lFile->get_md5_ID(); |
606 | + |
607 | + echo '<a href="'.$browse_dir_url.'" target="'.$target.' " class="filenameIcon" |
608 | + title="'.T_('Open in a new window').'" onclick="' |
609 | + ."return pop_up_window( '$popup_url', '$target' )" |
610 | + .'">'.get_icon( 'window_new' ).'</a>'; |
611 | + } |
612 | + |
613 | + /*************** Link ("chain") icon: **************/ |
614 | + // if( ! $lFile->is_dir() ) // fp> OK but you need to include an else:placeholder, otherwise the display is ugly |
615 | + { // Only provide link/"chain" icons for files. |
616 | + // TODO: dh> provide support for direcories (display included files). |
617 | + |
618 | + // fp> here might not be the best place to put the perm check |
619 | + if( isset($edited_Item) && $current_User->check_perm( 'item_post!CURSTATUS', 'edit', false, $edited_Item ) ) |
620 | + { // Offer option to link the file to an Item (or anything else): |
621 | + $link_attribs = array(); |
622 | + $link_action = 'link'; |
623 | + if( $mode == 'upload' ) |
624 | + { // We want the action to happen in the post attachments iframe: |
625 | + $link_attribs['target'] = $iframe_name; |
626 | + $link_action = 'link_inpost'; |
627 | + } |
628 | + echo action_icon( T_('Link this file!'), 'link', |
629 | + regenerate_url( 'fm_selected', 'action='.$link_action.'&fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ), |
630 | + NULL, NULL, NULL, $link_attribs ); |
631 | + echo ' '; |
632 | + } |
633 | + |
634 | + if( isset($edited_User) ) // fp> Perm already checked in controller |
635 | + { // Offer option to link the file to an Item (or anything else): |
636 | + echo action_icon( T_('Link this file!'), 'link', |
637 | + regenerate_url( 'fm_selected', 'action=link_user&fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ), |
638 | + NULL, NULL, NULL, array() ); |
639 | + echo ' '; |
640 | + } |
641 | + |
642 | + } |
643 | + |
644 | + /******************** Filename ********************/ |
645 | + if( $lFile->is_dir() ) |
646 | + { // Directory |
647 | + // Link to open the directory in the curent window |
648 | + echo '<a href="'.$browse_dir_url.'">'.$lFile->dget('name').'</a>'; |
649 | + } |
650 | + else |
651 | + { // File |
652 | + if( $view_link = $lFile->get_view_link( $lFile->get_name(), NULL, NULL ) ) |
653 | + { |
654 | + echo $view_link; |
655 | + } |
656 | + else |
657 | + { // File extension unrecognized |
658 | + echo $lFile->dget('name'); |
659 | + } |
660 | + } |
661 | + |
662 | + /*************** File meta data: **************/ |
663 | + echo '<span class="filemeta">'; |
664 | + // Optionally display IMAGE pixel size: |
665 | + if( $UserSettings->get( 'fm_getimagesizes' ) ) |
666 | + { |
667 | + echo ' ('.$lFile->get_image_size( 'widthxheight' ).')'; |
668 | + } |
669 | + // Optionally display meta data title: |
670 | + if( $lFile->meta == 'loaded' ) |
671 | + { // We have loaded meta data for this file: |
672 | + echo ' - '.$lFile->title; |
673 | + } |
674 | + echo '</span>'; |
675 | + echo '</td>'; |
676 | + |
677 | + /******************* File type ******************/ |
678 | + if( $UserSettings->get('fm_showtypes') ) |
679 | + { // Show file types |
680 | + echo '<td class="type">'.$lFile->get_type().'</td>'; |
681 | + } |
682 | + |
683 | + /******************* File size ******************/ |
684 | + echo '<td class="size">'.$fm_Filelist->get_File_size_formatted($lFile).'</td>'; |
685 | + |
686 | + /**************** File time stamp ***************/ |
687 | + if( $UserSettings->get('fm_showdate') != 'no' ) |
688 | + { // Show last modified datetime (always full in title attribute) |
689 | + $lastmod_date = $lFile->get_lastmod_formatted( 'date' ); |
690 | + $lastmod_time = $lFile->get_lastmod_formatted( 'time' ); |
691 | + echo '<td class="timestamp" title="'.$lastmod_date.' '.$lastmod_time.'">'; |
692 | + if( $UserSettings->get('fm_showdate') == 'long' ) |
693 | + { |
694 | + echo '<span class="date">'.$lastmod_date.'</span> '; |
695 | + echo '<span class="time">'.$lastmod_time.'</span>'; |
696 | + } |
697 | + else |
698 | + { // Compact format |
699 | + echo $lFile->get_lastmod_formatted( 'compact' ); |
700 | + } |
701 | + echo '</td>'; |
702 | + } |
703 | + |
704 | + /**************** File pemissions ***************/ |
705 | + if( $popfor == '' ) |
706 | + { |
707 | + if( $UserSettings->get('fm_showfsperms') ) |
708 | + { // Show file perms |
709 | + echo '<td class="perms">'; |
710 | + $fm_permlikelsl = $UserSettings->param_Request( 'fm_permlikelsl', 'fm_permlikelsl', 'integer', 0 ); |
711 | + if( $current_User->check_perm( 'files', 'edit' ) ) |
712 | + { // User can edit: |
713 | + echo '<a title="'.T_('Edit permissions').'" href="'.regenerate_url( 'fm_selected,action', 'action=edit_perms&fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ).'">' |
714 | + .$lFile->get_perms( $fm_permlikelsl ? 'lsl' : '' ).'</a>'; |
715 | + } |
716 | + else |
717 | + { |
718 | + echo $lFile->get_perms( $fm_permlikelsl ? 'lsl' : '' ); |
719 | + } |
720 | + echo '</td>'; |
721 | + } |
722 | + |
723 | + /**************** File owner ********************/ |
724 | + if( $UserSettings->get('fm_showfsowner') ) |
725 | + { // Show file owner |
726 | + echo '<td class="fsowner">'; |
727 | + echo $lFile->get_fsowner_name(); |
728 | + echo '</td>'; |
729 | + } |
730 | + |
731 | + /**************** File group *********************/ |
732 | + if( $UserSettings->get('fm_showfsgroup') ) |
733 | + { // Show file owner |
734 | + echo '<td class="fsgroup">'; |
735 | + echo $lFile->get_fsgroup_name(); |
736 | + echo '</td>'; |
737 | + } |
738 | + |
739 | + /***************** Action icons ****************/ |
740 | + echo '<td class="actions lastcol">'; |
741 | + if( $current_User->check_perm( 'files', 'edit' ) ) |
742 | + { // User can edit: |
743 | + if( $lFile->is_editable( $current_User->check_perm( 'files', 'all' ) ) ) |
744 | + { |
745 | + echo action_icon( T_('Edit file...'), 'edit', regenerate_url( 'fm_selected', 'action=edit_file&fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ) ); |
746 | + } |
747 | + else |
748 | + { |
749 | + echo get_icon( 'edit', 'noimg' ); |
750 | + } |
751 | + } |
752 | + echo action_icon( T_('Edit properties...'), 'properties', regenerate_url( 'fm_selected', 'action=edit_properties&fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ) ); |
753 | + |
754 | + if( $current_User->check_perm( 'files', 'edit' ) ) |
755 | + { // User can edit: |
756 | + echo action_icon( T_('Rename'), 'rename', regenerate_url( 'fm_selected', 'action=rename&fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ) ); |
757 | + echo action_icon( T_('Move'), 'move', regenerate_url( 'fm_mode,fm_sources,fm_sources_root', 'fm_mode=file_move&fm_sources[]='.rawurlencode( $lFile->get_rdfp_rel_path() ).'&fm_sources_root='.$fm_Filelist->_FileRoot->ID ) ); |
758 | + echo action_icon( T_('Copy'), 'copy', regenerate_url( 'fm_mode,fm_sources,fm_sources_root', 'fm_mode=file_copy&fm_sources[]='.rawurlencode( $lFile->get_rdfp_rel_path() ).'&fm_sources_root='.$fm_Filelist->_FileRoot->ID ) ); |
759 | + echo action_icon( T_('Delete'), 'delete', regenerate_url( 'fm_selected', 'action=delete&fm_selected[]='.rawurlencode( $lFile->get_rdfp_rel_path() ) ) ); |
760 | + } |
761 | + echo '</td>'; |
762 | + } |
763 | + |
764 | + echo '</tr>'; |
765 | + |
766 | + $countFiles++; |
767 | +} |
768 | +// End of file list.. |
769 | + |
770 | +/** |
771 | + * @global integer Number of cols for the files table, 6 is minimum. |
772 | + */ |
773 | +$filetable_cols = 5 |
774 | + + (int)$fm_flatmode |
775 | + + (int)$UserSettings->get('fm_showtypes') |
776 | + + (int)($UserSettings->get('fm_showdate') != 'no') |
777 | + + (int)$UserSettings->get('fm_showfsperms') |
778 | + + (int)$UserSettings->get('fm_showfsowner') |
779 | + + (int)$UserSettings->get('fm_showfsgroup') |
780 | + + (int)$UserSettings->get('fm_imglistpreview'); |
781 | + |
782 | +if( $countFiles == 0 ) |
783 | +{ // Filelist errors or "directory is empty" |
784 | + ?> |
785 | + <tr> |
786 | + <td class="firstcol"> </td> <?php /* blueyed> This empty column is needed so that the defaut width:100% style of the main column below makes the column go over the whole screen */ ?> |
787 | + <td class="lastcol" colspan="<?php echo $filetable_cols - 1 ?>" id="fileman_error"> |
788 | + <?php |
789 | + if( ! $Messages->count('fl_error') ) |
790 | + { // no Filelist errors, the directory must be empty |
791 | + $Messages->add( T_('No files found.') |
792 | + .( $fm_Filelist->is_filtering() ? '<br />'.T_('Filter').': «'.$fm_Filelist->get_filter().'»' : '' ), 'fl_error' ); |
793 | + } |
794 | + $Messages->display( '', '', true, 'fl_error', 'log_error' ); |
795 | + ?> |
796 | + </td> |
797 | + </tr> |
798 | + |
799 | + <?php |
800 | +} |
801 | +else |
802 | +{ |
803 | + // ------------- |
804 | + // Footer with "check all", "with selected: ..": |
805 | + // -------------- |
806 | + if( $popfor != 'attach' ) |
807 | + { |
808 | ?> |
809 | - <tr> |
810 | - <td class="firstcol"> </td> <?php /* blueyed> This empty column is needed so that the defaut width:100% style of the main column below makes the column go over the whole screen */ ?> |
811 | - <td class="lastcol" colspan="<?php echo $filetable_cols - 1 ?>" id="fileman_error"> |
812 | + <tr class="listfooter firstcol lastcol"> |
813 | + <td colspan="<?php echo $filetable_cols ?>"> |
814 | <?php |
815 | - if( ! $Messages->count('fl_error') ) |
816 | - { // no Filelist errors, the directory must be empty |
817 | - $Messages->add( T_('No files found.') |
818 | - .( $fm_Filelist->is_filtering() ? '<br />'.T_('Filter').': «'.$fm_Filelist->get_filter().'»' : '' ), 'fl_error' ); |
819 | - } |
820 | - $Messages->display( '', '', true, 'fl_error', 'log_error' ); |
821 | + echo $Form->check_all(); |
822 | + |
823 | + $field_options = array(); |
824 | + $title_options = array(); |
825 | + $caption_options = array(); |
826 | + |
827 | + if( $mode != 'upload' && ($fm_Filelist->get_root_type() == 'collection' || !empty($Blog)) ) |
828 | + { // We are browsing files for a collection: |
829 | + // fp> TODO: use current as default but let user choose into which blog he wants to post |
830 | + $field_options['make_post'] = T_('Make one post (including all images)'); |
831 | + $field_options['make_posts'] = T_('Make multiple posts (1 per image)'); |
832 | + $title_options['default'] = T_('include if provided'); |
833 | + $caption_options['default'] = T_('include if provided'); |
834 | + } |
835 | + |
836 | + if( $mode == 'upload' ) |
837 | + { // we are in a popup opened by the "Files" button |
838 | + $field_options['float_left'] = T_('Float left'); |
839 | + $field_options['float_right'] = T_('Float right'); |
840 | + $field_options['centered'] = T_('Centered'); |
841 | + $field_options['inline'] = T_('In-line'); |
842 | + $title_options['default'] = T_('default'); |
843 | + $title_options['placeholder'] = T_('placeholder'); |
844 | + $title_options['none'] = T_('no title'); |
845 | + $caption_options['default'] = T_('default'); |
846 | + $caption_options['placeholder'] = T_('placeholder'); |
847 | + $caption_options['none'] = T_('no caption'); |
848 | + } |
849 | + |
850 | + if( $popfor == '' ) |
851 | + { |
852 | + if( $current_User->check_perm( 'files', 'edit' ) ) |
853 | + { // current user can edit files |
854 | + $field_options['rename'] = T_('Rename files...'); |
855 | + $field_options['delete'] = T_('Delete files...'); |
856 | + // NOTE: No delete confirmation by javascript, we need to check DB integrity! |
857 | + } |
858 | + // BROKEN ? |
859 | + $field_options['download'] = T_('Download files as ZIP archive...'); |
860 | + |
861 | + /* Not fully functional: |
862 | + $field_options['copy'] = T_('Copy the selected files...'); |
863 | + $field_options['move'] = T_('Move the selected files...'); |
864 | + */ |
865 | + } |
866 | + |
867 | + $Form->switch_layout( 'none' ); |
868 | + $Form->select_input_array( 'group_action', $action, $field_options, ' || <strong>'.T_('With selected files').'</strong>' ); |
869 | + |
870 | + if( $mode == 'upload' ) |
871 | + { // we are in a popup opened by the "Files" button |
872 | + $Form->select_input_array( 'title_action', 'default', $caption_options, ' <strong>'.T_('title').'</strong>' ); |
873 | + $Form->select_input_array( 'caption_action', 'default', $caption_options, ' <strong>'.T_('caption').'</strong>' ); |
874 | + } |
875 | + // The "go" button gives us what to do with the file, title, and caption for all files |
876 | + $Form->submit_input( array( 'name'=>'actionArray[group_action][title_action][caption_action]', 'value'=>T_('Go!'), 'onclick'=>'return js_act_on_selected();' ) ); |
877 | + $Form->switch_layout( NULL ); |
878 | ?> |
879 | </td> |
880 | </tr> |
881 | - |
882 | <?php |
883 | } |
884 | - else |
885 | - { |
886 | - // ------------- |
887 | - // Footer with "check all", "with selected: ..": |
888 | - // -------------- |
889 | - if( $popfor != 'attach' ) |
890 | - { |
891 | - ?> |
892 | - <tr class="listfooter firstcol lastcol"> |
893 | - <td colspan="<?php echo $filetable_cols ?>"> |
894 | - <?php |
895 | - echo $Form->check_all(); |
896 | - |
897 | - $field_options = array(); |
898 | - |
899 | - if( $mode != 'upload' && ($fm_Filelist->get_root_type() == 'collection' || !empty($Blog)) ) |
900 | - { // We are browsing files for a collection: |
901 | - // fp> TODO: use current as default but let user choose into which blog he wants to post |
902 | - $field_options['make_post'] = T_('Make one post (including all images)'); |
903 | - $field_options['make_posts'] = T_('Make multiple posts (1 per image)'); |
904 | - } |
905 | - |
906 | - if( $mode == 'upload' ) |
907 | - { // we are in a popup opened by the "Files" button |
908 | - $field_options['img_tag_left'] = T_('Insert IMG/link into post float:left'); |
909 | - $field_options['img_tag'] = T_('Insert IMG/link into post in a div'); |
910 | - $field_options['img_tag_right'] = T_('Insert IMG/link into post float:right'); |
911 | - } |
912 | - |
913 | - if( $popfor == '' ) |
914 | - { |
915 | - if( $current_User->check_perm( 'files', 'edit' ) ) |
916 | - { // current user can edit files |
917 | - $field_options['rename'] = T_('Rename files...'); |
918 | - $field_options['delete'] = T_('Delete files...'); |
919 | - // NOTE: No delete confirmation by javascript, we need to check DB integrity! |
920 | - } |
921 | - // BROKEN ? |
922 | - $field_options['download'] = T_('Download files as ZIP archive...'); |
923 | - |
924 | - /* Not fully functional: |
925 | - $field_options['copy'] = T_('Copy the selected files...'); |
926 | - $field_options['move'] = T_('Move the selected files...'); |
927 | - */ |
928 | - } |
929 | - |
930 | - $Form->switch_layout( 'none' ); |
931 | - $Form->select_input_array( 'group_action', $action, $field_options, ' — <strong>'.T_('With selected files').'</strong>' ); |
932 | - $Form->submit_input( array( 'name'=>'actionArray[group_action]', 'value'=>T_('Go!'), 'onclick'=>'return js_act_on_selected();' ) ); |
933 | - $Form->switch_layout( NULL ); |
934 | - |
935 | - /* |
936 | - fp> the following has been integrated into the select. |
937 | - if( $mode == 'upload' ) |
938 | - { // We are uploading in a popup opened by an edit screen |
939 | - ?> |
940 | - — |
941 | - <input class="ActionButton" |
942 | - title="<?php echo T_('Insert IMG or link tags for the selected files, directly into the post text'); ?>" |
943 | - name="actionArray[img_tag]" |
944 | - value="<?php echo T_('Insert IMG/link into post') ?>" |
945 | - type="submit" |
946 | - onclick="insert_tag_for_selected_files(); return false;" /> |
947 | - <?php |
948 | - } |
949 | - */ |
950 | - ?> |
951 | - </td> |
952 | - </tr> |
953 | - <?php |
954 | - } |
955 | - } |
956 | - ?> |
957 | - </tbody> |
958 | +} |
959 | +?> |
960 | +</tbody> |
961 | </table> |
962 | <?php |
963 | - $Form->end_form(); |
964 | - |
965 | - if( $countFiles ) |
966 | - {{{ // include JS |
967 | - // TODO: remove these javascript functions to an external .js file and include them through add_headline() |
968 | - ?> |
969 | - <script type="text/javascript"> |
970 | - <!-- |
971 | - function js_act_on_selected() |
972 | - { |
973 | - // There may be an easier selector than below but couldn't make sense of it :( |
974 | - selected_value = jQuery('#group_action option:selected').attr('value'); |
975 | - if( selected_value == 'img_tag_left' ) |
976 | - { |
977 | - insert_tag_for_selected_files( 'left' ); |
978 | - return false; |
979 | - } |
980 | - if( selected_value == 'img_tag' ) |
981 | - { |
982 | - insert_tag_for_selected_files( false ); |
983 | - return false; |
984 | - } |
985 | - if( selected_value == 'img_tag_right' ) |
986 | - { |
987 | - insert_tag_for_selected_files( 'right' ); |
988 | - return false; |
989 | - } |
990 | - // other actions: |
991 | +$Form->end_form(); |
992 | + |
993 | +// allow a plugin to provide it's own $file_tags array |
994 | +global $Plugins; |
995 | +if( $plugin_return = $Plugins->trigger_event_first_return( 'ItemInsertFileJavascript' ) ) |
996 | +{ |
997 | + $editor_Plugin = & $Plugins->get_by_ID( $plugin_return['plugin_ID'] ); |
998 | + $file_tags = $plugin_return['plugin_return']; |
999 | +} |
1000 | +// if we don't have one, we need one |
1001 | +if( ! isset( $file_tags ) ) |
1002 | +{ |
1003 | + $file_tags = array( |
1004 | + 'insert_tag' => 'span', |
1005 | + 'insert_class_floats' => 'FLOATDIRECTION center', |
1006 | + 'insert_class_centered' => 'image_block', |
1007 | + 'insert_style_floats' => 'STYLEWIDTH', |
1008 | + 'insert_style_centered' => '', |
1009 | + 'title_tag' => 'span', |
1010 | + 'title_class' => 'image_title', |
1011 | + 'title_style' => '', |
1012 | + 'title_post' => '<br />', |
1013 | + 'image_pre' => '', |
1014 | + 'image_class' => 'center', |
1015 | + 'image_style' => '', |
1016 | + 'image_post' => '', |
1017 | + 'caption_pre' => '<br />', |
1018 | + 'caption_tag' => 'span', |
1019 | + 'caption_class' => 'image_legend', |
1020 | + 'caption_style' => '', |
1021 | + 'caption_post' => '', |
1022 | + 'caption_none' => '', |
1023 | + 'caption_separator' => '', |
1024 | + ); |
1025 | +} |
1026 | + |
1027 | +/** |
1028 | + * @todo (legacy): remove these javascript functions to an external .js file and include them through add_headline() |
1029 | + */ |
1030 | +if( $countFiles ) |
1031 | +{{{ // include JS |
1032 | + ?> |
1033 | + <script type="text/javascript"> |
1034 | + <!-- |
1035 | + /** |
1036 | + * Prepare for inserting images or file links into the item/post |
1037 | + */ |
1038 | + function js_act_on_selected() |
1039 | + { |
1040 | + // There may be an easier selector than below but couldn't make sense of it :( |
1041 | + disp_value = jQuery('#group_action option:selected').attr('value'); |
1042 | + title_action = jQuery('#title_action option:selected').attr('value'); |
1043 | + caption_action = jQuery('#caption_action option:selected').attr('value'); |
1044 | + |
1045 | + if( disp_value == 'float_left' ) |
1046 | + { |
1047 | + insert_tag_for_selected_files( 'float', 'left', title_action, caption_action ); |
1048 | + return false; |
1049 | + } |
1050 | + if( disp_value == 'float_right' ) |
1051 | + { |
1052 | + insert_tag_for_selected_files( 'float', 'right', title_action, caption_action ); |
1053 | + return false; |
1054 | + } |
1055 | + if( disp_value == 'centered' ) |
1056 | + { |
1057 | + insert_tag_for_selected_files( 'center', 'center', title_action, caption_action ); |
1058 | + return false; |
1059 | + } |
1060 | + if( disp_value == 'inline' ) |
1061 | + { |
1062 | + insert_tag_for_selected_files( 'inline', 'inline', title_action, caption_action ); |
1063 | + return false; |
1064 | + } |
1065 | + |
1066 | + // other actions: |
1067 | + return true; |
1068 | + } |
1069 | + |
1070 | + /** |
1071 | + * Check if files are selected. This should be used as "onclick" handler for |
1072 | + * "With selected" actions (onclick="return check_if_selected_files();"). |
1073 | + * @return boolean true, if something is selected, false if not. |
1074 | + */ |
1075 | + function check_if_selected_files() |
1076 | + { |
1077 | + elems = document.getElementsByName( 'fm_selected[]' ); |
1078 | + var checked = 0; |
1079 | + for( i = 0; i < elems.length; i++ ) |
1080 | + { |
1081 | + if( elems[i].checked ) |
1082 | + { |
1083 | + checked++; |
1084 | + } |
1085 | + } |
1086 | + if( !checked ) |
1087 | + { |
1088 | + alert( '<?php echo TS_('Nothing selected.') ?>' ); |
1089 | + return false; |
1090 | + } |
1091 | + else |
1092 | + { |
1093 | + return true; |
1094 | + } |
1095 | + } |
1096 | + |
1097 | + /** |
1098 | + * Insert IMG tags into parent window for selected files |
1099 | + */ |
1100 | + function insert_tag_for_selected_files( what, where, title_action, caption_action ) |
1101 | + { |
1102 | + var elems = document.getElementsByName( 'fm_selected[]' ); |
1103 | + var snippet = ''; |
1104 | + |
1105 | + // these values might come from an editor plugin :) |
1106 | + var insert_tag = '<?php echo $file_tags['insert_tag']; ?>'; |
1107 | + if( what == 'float' ) |
1108 | + { |
1109 | + var insert_class = '<?php echo $file_tags['insert_class_floats']; ?>'; |
1110 | + var insert_style = '<?php echo $file_tags['insert_style_floats']; ?>'; |
1111 | + } |
1112 | + else if( what == 'center' ) |
1113 | + { |
1114 | + var insert_class = '<?php echo $file_tags['insert_class_centered']; ?>'; |
1115 | + var insert_style = '<?php echo $file_tags['insert_style_centered']; ?>'; |
1116 | + } |
1117 | + var title_open = '<?php echo $file_tags['title_tag']; ?>'; |
1118 | + var title_class = '<?php echo $file_tags['title_class']; ?>'; |
1119 | + var title_style = '<?php echo $file_tags['title_style']; ?>'; |
1120 | + var title_post = '<?php echo $file_tags['title_post']; ?>'; |
1121 | + var image_pre = '<?php echo $file_tags['image_pre']; ?>'; |
1122 | + var image_class = '<?php echo $file_tags['image_class']; ?>'; |
1123 | + var image_style = '<?php echo $file_tags['image_style']; ?>'; |
1124 | + var image_post = '<?php echo $file_tags['image_post']; ?>'; |
1125 | + var caption_pre = '<?php echo $file_tags['caption_pre']; ?>'; |
1126 | + var caption_tag = '<?php echo $file_tags['caption_tag']; ?>'; |
1127 | + var caption_class = '<?php echo $file_tags['caption_class']; ?>'; |
1128 | + var caption_style = '<?php echo $file_tags['caption_style']; ?>'; |
1129 | + var caption_post = '<?php echo $file_tags['caption_post']; ?>'; |
1130 | + var caption_separator = '<?php echo $file_tags['caption_separator']; ?>'; |
1131 | + |
1132 | + var snippet = ''; // this is what we will eventually insert into the item |
1133 | + for( i = 0; i < elems.length; i++ ) |
1134 | + { |
1135 | + if( elems[i].checked ) |
1136 | + { |
1137 | + id = elems[i].id.substring( elems[i].id.lastIndexOf('_')+1, elems[i].id.length ); |
1138 | + link_value = document.getElementById( 'link_'+id ).value; |
1139 | + title_value = document.getElementById( 'title_'+id ).value; |
1140 | + alttxt_value = document.getElementById( 'alttxt_'+id ).value; |
1141 | + caption_value = document.getElementById( 'caption_'+id ).value; |
1142 | + dimens_value = document.getElementById( 'dimens_'+id ).value; |
1143 | + |
1144 | + // ensure we have both a title_value and an alttxt_value |
1145 | + var link_array = link_value.split( "/" ); |
1146 | + var filename = link_array.pop(); |
1147 | + |
1148 | + // dimens_value effectively tells us if we have an image or not |
1149 | + if( dimens_value == '' ) |
1150 | + { // this is a non-image ... and it needs a lot of help but not now. images first... |
1151 | + |
1152 | + if( title_value == '' ) { title_value = filename; } |
1153 | + if( alttxt_value == '' ) { alttxt_value = '<?php echo TS_('Link to ') ?>' + filename; } |
1154 | + snippet += '<a href="' + link_value + '" title="' + alttxt_value + '">' + title_value + '</a> '; |
1155 | + } |
1156 | + else |
1157 | + { // THIS IS AN IMAGE FILE - WOOHOO! |
1158 | + // prep work - set some variables we'll need along the way |
1159 | + var dims_arr = dimens_value.split( "x" ); // this is the image width |
1160 | + var calculated_width = Math.round( parseFloat( dims_arr[0] ) + 12 ); |
1161 | + var image_tag = ''; // for first build |
1162 | + var begin_block = ''; // for second build |
1163 | + var end_block = ''; // for second build |
1164 | + var title_html = ''; // for third build |
1165 | + var caption_html = ''; // for fourth build |
1166 | + |
1167 | + // FIRST BUILD: the image tag. inserts, floats, and centered will all use the image tag |
1168 | + image_tag = '<img src="' + link_value + '"'; |
1169 | + if( alttxt_value == '' ) { alttxt_value = filename; } |
1170 | + image_tag += ' alt="' + alttxt_value + '"'; |
1171 | + image_tag += ' width="' + dims_arr[0] + '" height="' + dims_arr[1] + '"'; |
1172 | + if( image_class != '' ) { image_tag += ' class="' + image_class + '"'; } |
1173 | + if( what != 'inline' && image_style != '' ) { image_tag += ' style="' + image_style + '"'; } |
1174 | + image_tag += ' />'; |
1175 | + // for floats and centered we might have pre- and post- stuff to add |
1176 | + if( what == 'float' || what == 'center' ) |
1177 | + { |
1178 | + image_tag = image_pre + image_tag + image_post; |
1179 | + } |
1180 | + |
1181 | + // SECOND BUILD: the overall insertion block (only floats and centered) |
1182 | + if( what == 'float' || what == 'center' ) |
1183 | + { |
1184 | + begin_block = '<' + insert_tag; |
1185 | + if( insert_class != '' ) { begin_block += ' class="' + insert_class + '"'; } |
1186 | + if( insert_style != '' ) { begin_block += ' style="' + insert_style + '"'; } |
1187 | + begin_block += '>'; |
1188 | + var splitblocktag = insert_tag.split(" "); |
1189 | + end_block = '</' + splitblocktag[0] + '>'; |
1190 | + |
1191 | + // THIRD BUILD: a title block if desired (only floats and centered) |
1192 | + if( ( title_action == 'default' && title_value != '' ) || title_action == 'placeholder' ) |
1193 | + { // we want the title and have one, or we want a placeholder |
1194 | + title_html = '<' + title_open; |
1195 | + if( title_class != '' ) { title_html += ' class="' + title_class + '"'; } |
1196 | + if( title_style != '' ) { title_html += ' style="' + title_style + '"'; } |
1197 | + title_html += '>'; |
1198 | + if( title_action == 'placeholder' ) { title_value = '<?php echo TS_('TITLE PLACEHOLDER') ?>'; } |
1199 | + var splittitletag = title_open.split(" "); |
1200 | + title_html += title_value + '</' + splittitletag[0] + '>'; |
1201 | + title_html += title_post; |
1202 | + } |
1203 | + |
1204 | + // FOURTH BUILD: a caption block if desired |
1205 | + if( ( caption_action == 'default' && caption_value != '' ) || caption_action == 'placeholder' ) |
1206 | + { // we want the caption and have one, or we want a placeholder |
1207 | + caption_html = caption_pre + '<' + caption_tag; |
1208 | + if( caption_class != '' ) { caption_html += ' class="' + caption_class + '"'; } |
1209 | + if( caption_style != '' ) { caption_html += ' style="' + caption_style + '"'; } |
1210 | + caption_html += '>'; |
1211 | + if( caption_action == 'placeholder' ) { caption_value = '<?php echo TS_('CAPTION PLACEHOLDER') ?>'; } |
1212 | + var splitcaptiontag = caption_tag.split(" "); |
1213 | + caption_html += caption_value + '</' + splitcaptiontag[0] + '>'; |
1214 | + caption_html += caption_post + caption_separator; |
1215 | + } |
1216 | + else |
1217 | + { // we need the "splitter" for TinyMCE and maybe others one day |
1218 | + caption_html = caption_none + caption_separator; |
1219 | + } |
1220 | + |
1221 | + } // end floats and centered |
1222 | + |
1223 | + // build the snippet and replace some things... |
1224 | + snippet += begin_block + title_html + image_tag + caption_html + end_block + ' '; |
1225 | + snippet = snippet.replace( /FLOATDIRECTION/g, 'float' + where ); |
1226 | + snippet = snippet.replace( /STYLEWIDTH/g, 'width:' + calculated_width + 'px;' ); |
1227 | + snippet = snippet.replace( /WIDTHONLY/g, calculated_width ); |
1228 | + |
1229 | + } // end 'this is an image' |
1230 | + |
1231 | + } // end elems.checked |
1232 | + |
1233 | + } // end for each elem |
1234 | + |
1235 | + // check it... |
1236 | + if( ! snippet.length ) |
1237 | + { // eh? |
1238 | + alert( '<?php echo TS_('You must select at least one file!') ?>' ); |
1239 | + return false; |
1240 | + } |
1241 | + else |
1242 | + { // ship it! |
1243 | + if (! (window.focus && window.opener)) |
1244 | + { |
1245 | + self.close(); |
1246 | return true; |
1247 | } |
1248 | - |
1249 | - /** |
1250 | - * Check if files are selected. |
1251 | - * |
1252 | - * This should be used as "onclick" handler for "With selected" actions (onclick="return check_if_selected_files();"). |
1253 | - * @return boolean true, if something is selected, false if not. |
1254 | - */ |
1255 | - function check_if_selected_files() |
1256 | - { |
1257 | - elems = document.getElementsByName( 'fm_selected[]' ); |
1258 | - var checked = 0; |
1259 | - for( i = 0; i < elems.length; i++ ) |
1260 | - { |
1261 | - if( elems[i].checked ) |
1262 | - { |
1263 | - checked++; |
1264 | - } |
1265 | - } |
1266 | - if( !checked ) |
1267 | - { |
1268 | - alert( '<?php echo TS_('Nothing selected.') ?>' ); |
1269 | - return false; |
1270 | - } |
1271 | - else |
1272 | - { |
1273 | - return true; |
1274 | - } |
1275 | - } |
1276 | - |
1277 | - /** |
1278 | - * Insert IMG tags into parent window for selected files: |
1279 | - */ |
1280 | - function insert_tag_for_selected_files( floatdir ) |
1281 | - { |
1282 | - var elems = document.getElementsByName( 'fm_selected[]' ); |
1283 | - var snippet = ''; |
1284 | - for( i = 0; i < elems.length; i++ ) |
1285 | - { |
1286 | - if( elems[i].checked ) |
1287 | - { |
1288 | - id = elems[i].id.substring( elems[i].id.lastIndexOf('_')+1, elems[i].id.length ); |
1289 | - img_tag_info_field = document.getElementById( 'img_tag_'+id ).value; |
1290 | - // floating left or right? |
1291 | - if( floatdir == 'left' || floatdir == 'right' ) |
1292 | - { |
1293 | - var pre_caption = ''; |
1294 | - var the_caption = ''; |
1295 | - var image_class = floatdir+'margin'; |
1296 | - var image_caption = img_tag_info_field.split( "image_legend\">" ); |
1297 | - if( image_caption.length > 1 ) |
1298 | - { |
1299 | - image_caption = image_caption[1]; |
1300 | - the_caption = image_caption.split( "<\/div>" ); |
1301 | - pre_caption = '<span class="imgwrap float'+floatdir+' center">'; |
1302 | - the_caption = '<br /><span class="image_legend">'+the_caption[0]+'</span></span>'; |
1303 | - image_class = 'spanimage'; |
1304 | - } |
1305 | - img_tag_info_field = img_tag_info_field.replace(/^.*(<img.+?)( \/>).*$/, pre_caption+'$1 class="'+image_class+'"$2'+the_caption ); |
1306 | - } |
1307 | - snippet += img_tag_info_field + ' '; |
1308 | - } |
1309 | - } |
1310 | - if( ! snippet.length ) |
1311 | - { |
1312 | - alert( '<?php echo TS_('You must select at least one file!') ?>' ); |
1313 | - return false; |
1314 | - } |
1315 | - else |
1316 | - { |
1317 | - if (! (window.focus && window.opener)) |
1318 | - { |
1319 | - self.close(); |
1320 | - return true; |
1321 | - } |
1322 | - window.opener.focus(); |
1323 | - textarea_wrap_selection( window.opener.document.getElementById("itemform_post_content"), snippet, '', 1, window.opener.document ); |
1324 | - self.close(); |
1325 | - return true; |
1326 | - } |
1327 | - } |
1328 | - // --> |
1329 | - </script> |
1330 | - <?php |
1331 | + window.opener.focus(); |
1332 | + textarea_wrap_selection( window.opener.document.getElementById("itemform_post_content"), snippet, '', 1, window.opener.document ); |
1333 | + self.close(); |
1334 | + return true; |
1335 | + } |
1336 | + |
1337 | + } |
1338 | + // --> |
1339 | + </script> |
1340 | + <?php |
1341 | }}} |
1342 | ?> |
1343 | -<!-- End of detailed file list --> |
1344 | -<?php |
1345 | -?> |
1346 | +<!-- End of detailed file list but not the end of html comments in our code, obviously ;) --> |
1347 | |
1348 | === modified file 'qp_inc/plugins/_plugin.class.php' |
1349 | --- qp_inc/plugins/_plugin.class.php 2011-02-01 17:45:46 +0000 |
1350 | +++ qp_inc/plugins/_plugin.class.php 2011-03-08 04:29:14 +0000 |
1351 | @@ -1347,6 +1347,16 @@ |
1352 | |
1353 | |
1354 | /** |
1355 | + * Event handler: allows an editor plugin to write custom tags when inserting a file, usually an image. |
1356 | + * |
1357 | + * @return array Tags used to wrap files (usually images) |
1358 | + */ |
1359 | + function ItemInsertFileJavascript() |
1360 | + { |
1361 | + } |
1362 | + |
1363 | + |
1364 | + /** |
1365 | * Event handler: send a ping about a new item. |
1366 | * |
1367 | * @param array Associative array of parameters |
1368 | |
1369 | === modified file 'qp_inc/plugins/model/_plugins_admin.class.php' |
1370 | --- qp_inc/plugins/model/_plugins_admin.class.php 2011-01-31 22:13:02 +0000 |
1371 | +++ qp_inc/plugins/model/_plugins_admin.class.php 2011-03-08 04:29:14 +0000 |
1372 | @@ -166,6 +166,7 @@ |
1373 | 'ItemCanComment' => 'Asks the plugin if an item can receive comments/feedback.', |
1374 | 'ItemSendPing' => 'Send a ping to a service about new items.', |
1375 | 'ItemViewsIncreased' => 'Called when the view counter of an item got increased.', |
1376 | + 'ItemInsertFileJavascript' => 'Allows an editor plugin to write custom tags when inserting a file, usually an image.', |
1377 | |
1378 | 'TemplateTag' => 'This method gets invoked when a plugin is called by its code. Providing this method causes the plugin to be listed as a widget.', |
1379 | |
1380 | |
1381 | === modified file 'qp_install/_functions_create.php' |
1382 | --- qp_install/_functions_create.php 2010-12-31 12:12:03 +0000 |
1383 | +++ qp_install/_functions_create.php 2011-03-08 04:29:14 +0000 |
1384 | @@ -1058,7 +1058,7 @@ |
1385 | // Insert a post into blog #1: |
1386 | $now = date('Y-m-d H:i:s',installer_timestamp()); |
1387 | $edited_Item = new Item(); |
1388 | - $edited_Item->insert( 1, T_('Inserted Image post'), T_('<p><span class="imgwrap floatright center"><img src="'.$app_baseurl.'media/blogs/id_1/waterfall.jpg" alt="waterfall" title="waterfall" width="160" height="240" class="spanimage" /><br /><span class="image_legend">waterfall</span></span> This waterfall image was re-sized before uploading, then uploaded using the <strong>quick upload</strong> feature. Therefore the file name is also the title, alt text, and image caption. You can customize those details and even rename the file when you upload it if you use <strong>advanced upload properties</strong>, which is discussed in a different post.</p> |
1389 | + $edited_Item->insert( 1, T_('Inserted Image post'), T_('<p><span class="floatright center"><img src="'.$app_baseurl.'media/blogs/id_1/waterfall.jpg" alt="waterfall" title="waterfall" width="160" height="240" class="spanimage" /><br /><span class="image_legend">waterfall</span></span> This waterfall image was re-sized before uploading, then uploaded using the <strong>quick upload</strong> feature. Therefore the file name is also the title, alt text, and image caption. You can customize those details and even rename the file when you upload it if you use <strong>advanced upload properties</strong>, which is discussed in a different post.</p> |
1390 | |
1391 | <p>This image is floated to the right which is why the text flows alongside and under the image. When you insert an image you can float it right, or left, or have it centered in a <div> if you like.</p> |
1392 | |
1393 | |
1394 | === modified file 'qp_plugins/tinymce_plugin/README.html' |
1395 | --- qp_plugins/tinymce_plugin/README.html 2010-12-18 18:52:49 +0000 |
1396 | +++ qp_plugins/tinymce_plugin/README.html 2011-03-08 04:29:14 +0000 |
1397 | @@ -44,10 +44,42 @@ |
1398 | <dt>Plugin Settings:</dt> |
1399 | <dd><ul> |
1400 | <li><span class="settings">Use TinyMCE (default)</span>: Sets the default condition for whether or not to use this plugin, which users can override in their profile. Default value is OFF (unchecked).</li> |
1401 | -<li><span class="settings">Use compressor</span>: For users with slow internet connections, check this option to use "compressed" versions of the javascript files. Default value is OFF (unchecked).</li> |
1402 | <li><span class="settings">Directionality support</span>: This allows for better handling of "right to left" languages by providing buttons to switch between LTR and RTL. Default value is OFF (unchecked).</li> |
1403 | <li><span class="settings">Custom TinyMCE init</span>: I have no idea what this one does. All I know is the plugin has a setting for it and you get to type stuff in a box, so here it is in the readme file :) This field defaults to something.</li> |
1404 | </ul></dd> |
1405 | +<dt>Insert Image Settings:</dt> |
1406 | +<dd>Settings in blue are plain text only, settings in green allow html inputs<br /> |
1407 | +<strong>overall html block settings:</strong> |
1408 | +<ul> |
1409 | +<li><span class="settings_b">insert tag</span>: The tag for the overall "inserted image" block. For core it is a simple 'span', for TinyMCE the default is a bit more complicated: <code>table align="center" width="WIDTHONLY"</code></li> |
1410 | +<li><span class="settings_b">insert class (floats) / (centered)</span>: 2 settings, this is the class applied to the tag above. One for floating an image, the other for centering an image. If blank then class is not used. Default is <code>FLOATDIRECTION</code></li> |
1411 | +<li><span class="settings_b">insert style (floats) / (centered)</span>: 2 settings, this is the style applied to the tag above. One for floating an image, the other for centering an image. If blank then style is not used. Default is <code>image_block center</code></li> |
1412 | +</ul> |
1413 | +<strong>title section settings:</strong> |
1414 | +<ul> |
1415 | +<li><span class="settings_b">title tag</span>: If you are using a title with your image, this is the tag for that section of the inserted code. Default is <code>caption</code></li> |
1416 | +<li><span class="settings_b">title class</span>: This is the class applied to the title tag. If blank then class is not used. Default is <code>image_title</code></li> |
1417 | +<li><span class="settings_b">title style</span>: This is the style applied to the title tag. If blank then style is not used. Default is (blank).</li> |
1418 | +<li><span class="settings_c">post-title</span>: If a title section is used, this allows for some html bits after the title section. Core uses it, TinyMCE does not. Default is (blank)</li> |
1419 | +</ul> |
1420 | +<strong>image section settings:</strong> |
1421 | +<ul> |
1422 | +<li><span class="settings_c">pre-image</span>: This allows some html bits before the actual image tag. Default is <code><tbody><tr><td></code></li> |
1423 | +<li><span class="settings_b">image class</span>: This is the class applied to the image tag. Default is <code>center</code></li> |
1424 | +<li><span class="settings_b">image style</span>: This is the style applied to the image tag. Default is (blank)</li> |
1425 | +<li><span class="settings_c">post-image</span>: This allows some html bits before the actual image tag. Default is (blank)</li> |
1426 | +</ul> |
1427 | +<strong>caption section settings:</strong> |
1428 | +<ul> |
1429 | +<li><span class="settings_c">pre-caption</span>: If a caption is present, this allows some html bits before the caption section. Default is <code></td></tr><tr></code></li> |
1430 | +<li><span class="settings_b">caption tag</span>: The tag for the actual caption section. Default is <code>td</code></li> |
1431 | +<li><span class="settings_b">caption class</span>: This is the class applied to the caption tag. Default is <code>image_legend</code></li> |
1432 | +<li><span class="settings_b">caption style</span>: This is the style applied to the caption tag. Default is (blank)</li> |
1433 | +<li><span class="settings_c">post-caption</span>: If a caption is present, this allows some html bits after the caption section. Default is (blank)</li> |
1434 | +<li><span class="settings_c">NO caption</span>: If there is no caption present, this allows some html bits to fill that space sort of. TinyMCE needs it to close a TD. Default is <code></td></code></li> |
1435 | +<li><span class="settings_c">post caption separator</span>: This allows some html bits before closing the entire "insert image" block. Default is <code></tr></tbody></code></li> |
1436 | +</ul></dd> |
1437 | + |
1438 | <dt>User Settings:</dt> |
1439 | <dd><ul> |
1440 | <li><span class="settings">Use TinyMCE</span>: This allows each user to use (or not use) the TinyMCE plugin. Default value is set by the installation owner on the plugin's settings page.</li> |
1441 | @@ -69,11 +101,14 @@ |
1442 | <dl> |
1443 | <dt>More Info:</dt> |
1444 | <dd><ul> |
1445 | -<li>No additional information provided by the author.</li> |
1446 | +<li>For all settings: if you enter "FLOATDIRECTION" (no quote marks) it will be replaced with "floatleft" or "floatright" depending on which way you want to float an image. The primary purpose is for a "class" attribute.</li> |
1447 | +<li>For all settings: if you enter "STYLEWIDTH" (no quote marks) it will be replaced with "width:XXXpx;", where XXX is the image's width plus 12. The primary purpose is for a "style" attribute.</li> |
1448 | +<li>For all settings: if you enter "WIDTHONLY" (no quote marks) it will be replaced with "XXX", where XXX is the image's width plus 12. The primary purpose is for a "width" attribute for a table.</li> |
1449 | </ul></dd> |
1450 | <dt>Credits:</dt> |
1451 | <dd><ul> |
1452 | <li>Thanks to Daniel Hahler (http://daniel.hahler.de/) for initial creation and release of this plugin for the b2evolution (http://b2evolution.net) project.</li> |
1453 | +<li>Thanks to Kimberly (http://secretcorners.net/) for hammering on how inserting an image sucks when someone uses TinyMCE else this revision never would have been thought of.</li> |
1454 | </ul></dd> |
1455 | <dt>Links:</dt> |
1456 | <dd><ul> |
1457 | @@ -87,10 +122,11 @@ |
1458 | <h2>Release History:</h2> |
1459 | <div id="log"> |
1460 | <dl> |
1461 | +<dt>1.0</dt><dd>Uses new hook and settings to allow inserting in tables instead of spans (24-Feb-11)</dd> |
1462 | <dt>0.1</dt><dd>initial release (1-Jan-11)</dd> |
1463 | </dl> |
1464 | </div> |
1465 | |
1466 | </div> |
1467 | </body> |
1468 | -</html> |
1469 | \ No newline at end of file |
1470 | +</html> |
1471 | |
1472 | === modified file 'qp_plugins/tinymce_plugin/_tinymce.plugin.php' |
1473 | --- qp_plugins/tinymce_plugin/_tinymce.plugin.php 2010-09-25 12:29:17 +0000 |
1474 | +++ qp_plugins/tinymce_plugin/_tinymce.plugin.php 2011-03-08 04:29:14 +0000 |
1475 | @@ -53,7 +53,9 @@ |
1476 | */ |
1477 | function GetDefaultSettings( & $params ) |
1478 | { |
1479 | - return array( |
1480 | + $plain_text_only = '<strong>'.T_('plain text only').'</strong>'; |
1481 | + $html_allowed = '<strong class="red">'.T_('html allowed').'</strong>'; |
1482 | + $default_settings = array( |
1483 | 'default_use_tinymce' => array( |
1484 | 'label' => $this->T_('Use TinyMCE (default)'), |
1485 | 'type' => 'checkbox', |
1486 | @@ -74,9 +76,258 @@ |
1487 | .'height : "400"', |
1488 | 'note' => sprintf( $this->T_('Custom parameters to tinyMCE.init(). See the <a %s>TinyMCE manual</a>.'), 'href="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration"' ), |
1489 | ), |
1490 | + 'primary_start' => array( |
1491 | + 'label' => $this->T_('Insert Image Settings'), |
1492 | + 'layout' => 'begin_fieldset', |
1493 | + ), |
1494 | + 'primary_info' => array( |
1495 | + 'label' => $this->T_('WARNING'), |
1496 | + 'type' => 'info', |
1497 | + 'info' => $this->T_('<strong>DO NOT CHANGE THE NEXT 20 SETTINGS IF YOU ARE NOT GOOD WITH HTML!!!</strong><ul><li>For all settings: if you enter "FLOATDIRECTION" (no quote marks) it will be replaced with "floatleft" or "floatright" depending on which way you want to float an image. The primary purpose is for a "class" attribute.</li><li>For all settings: if you enter "STYLEWIDTH" (no quote marks) it will be replaced with "width:XXXpx;", where XXX is the image\'s width plus 12. The primary purpose is for a "style" attribute.</li><li>For all settings: if you enter "WIDTHONLY" (no quote marks) it will be replaced with "XXX", where XXX is the image\'s width plus 12. The primary purpose is for a "width" attribute for a table (TinyMCE).</li><ul>'), |
1498 | + ), |
1499 | + 'primary_info_b' => array( |
1500 | + 'label' => $this->T_('Info'), |
1501 | + 'type' => 'info', |
1502 | + 'info' => $this->T_('These settings appear in roughly the order they are used to help make sense of it all.<ul><li>Some settings are marked either "(floats)" or "(centered)". If we need different values for floating or centering we do it, otherwise the setting is shared across both methods.</li><li>ONLY "image class" and "image style" are used when inserting an image inline.</li></ul>'), |
1503 | + ), |
1504 | + 'overallblock_start' => array( |
1505 | + 'label' => $this->T_('overall html block settings'), |
1506 | + 'layout' => 'begin_fieldset', |
1507 | + ), |
1508 | + 'overallblock_info' => array( |
1509 | + 'label' => $this->T_('Info'), |
1510 | + 'type' => 'info', |
1511 | + 'info' => $this->T_('These are for the entire inserted html block (title if present, image, and caption if present).'), |
1512 | + ), |
1513 | + 'insert_tag' => array( |
1514 | + 'label' => $this->T_('insert tag'), |
1515 | + 'type' => 'text', |
1516 | + 'size' => 64, |
1517 | + 'defaultvalue' => 'table align="center" width="WIDTHONLY"', |
1518 | + 'note' => '<br />'.$plain_text_only, |
1519 | + ), |
1520 | + 'insert_class_floats' => array( |
1521 | + 'label' => $this->T_('insert class (floats)'), |
1522 | + 'type' => 'text', |
1523 | + 'size' => 64, |
1524 | + 'defaultvalue' => 'FLOATDIRECTION', |
1525 | + 'note' => '<br />'.$plain_text_only, |
1526 | + ), |
1527 | + 'insert_class_centered' => array( |
1528 | + 'label' => $this->T_('insert class (centered)'), |
1529 | + 'type' => 'text', |
1530 | + 'size' => 64, |
1531 | + 'defaultvalue' => 'image_block center', |
1532 | + 'note' => '<br />'.$plain_text_only, |
1533 | + ), |
1534 | + 'insert_style_floats' => array( |
1535 | + 'label' => $this->T_('insert style (floats)'), |
1536 | + 'type' => 'text', |
1537 | + 'size' => 64, |
1538 | + 'defaultvalue' => '', |
1539 | + 'note' => '<br />'.$plain_text_only, |
1540 | + ), |
1541 | + 'insert_style_centered' => array( |
1542 | + 'label' => $this->T_('insert style (centered)'), |
1543 | + 'type' => 'text', |
1544 | + 'size' => 64, |
1545 | + 'defaultvalue' => '', |
1546 | + 'note' => '<br />'.$plain_text_only, |
1547 | + ), |
1548 | + 'overallblock_end' => array( 'layout' => 'end_fieldset' ), |
1549 | + |
1550 | + 'titlesection_start' => array( |
1551 | + 'label' => $this->T_('title section settings'), |
1552 | + 'layout' => 'begin_fieldset', |
1553 | + ), |
1554 | + 'titlesection_info' => array( |
1555 | + 'label' => $this->T_('Info'), |
1556 | + 'type' => 'info', |
1557 | + 'info' => $this->T_('These are used only if the title is displayed ("default" and a title exists, or "placeholder").'), |
1558 | + ), |
1559 | + 'title_tag' => array( |
1560 | + 'label' => $this->T_('title tag'), |
1561 | + 'type' => 'text', |
1562 | + 'size' => 64, |
1563 | + 'defaultvalue' => 'caption', |
1564 | + 'note' => '<br />'.$plain_text_only, |
1565 | + ), |
1566 | + 'title_class' => array( |
1567 | + 'label' => $this->T_('title class'), |
1568 | + 'type' => 'text', |
1569 | + 'size' => 64, |
1570 | + 'defaultvalue' => 'image_title', |
1571 | + 'note' => '<br />'.$plain_text_only, |
1572 | + ), |
1573 | + 'title_style' => array( |
1574 | + 'label' => $this->T_('title style'), |
1575 | + 'type' => 'text', |
1576 | + 'size' => 64, |
1577 | + 'defaultvalue' => '', |
1578 | + 'note' => '<br />'.$plain_text_only, |
1579 | + ), |
1580 | + 'title_post' => array( |
1581 | + 'label' => $this->T_('post-title'), |
1582 | + 'type' => 'html_textarea', // allows "<" |
1583 | + 'rows' => 1, |
1584 | + 'cols' => 60, |
1585 | + 'defaultvalue' => '', |
1586 | + 'note' => $this->T_('added after closing the "title tag" ONLY IF there is a title').' · '.$html_allowed, |
1587 | + ), |
1588 | + 'titlesection_end' => array( 'layout' => 'end_fieldset' ), |
1589 | + 'imagesection_start' => array( |
1590 | + 'label' => $this->T_('image section settings'), |
1591 | + 'layout' => 'begin_fieldset', |
1592 | + ), |
1593 | + 'imagesection_info' => array( |
1594 | + 'label' => $this->T_('Info'), |
1595 | + 'type' => 'info', |
1596 | + 'info' => $this->T_('These settings affect the actual IMG tag, including possible code before and after the image tag.'), |
1597 | + ), |
1598 | + 'imagesection_pre_start' => array( |
1599 | + 'label' => $this->T_('before the image tag'), |
1600 | + 'layout' => 'begin_fieldset', |
1601 | + ), |
1602 | + 'imagesection_pre_info' => array( |
1603 | + 'label' => $this->T_('Info'), |
1604 | + 'type' => 'info', |
1605 | + 'info' => $this->T_('This is used between the title section and the image tag, even if there is no title section displayed.'), |
1606 | + ), |
1607 | + 'image_pre' => array( |
1608 | + 'label' => $this->T_('pre-image'), |
1609 | + 'type' => 'html_textarea', // allows "<" |
1610 | + 'rows' => 1, |
1611 | + 'cols' => 60, |
1612 | + 'defaultvalue' => '<tbody><tr><td>', |
1613 | + 'note' => $html_allowed, |
1614 | + ), |
1615 | + 'imagesection_pre_end' => array( 'layout' => 'end_fieldset' ), |
1616 | + 'imagesection_attribs_start' => array( |
1617 | + 'label' => $this->T_('image tag attributes'), |
1618 | + 'layout' => 'begin_fieldset', |
1619 | + ), |
1620 | + 'image_class' => array( |
1621 | + 'label' => $this->T_('image class'), |
1622 | + 'type' => 'text', |
1623 | + 'size' => 64, |
1624 | + 'defaultvalue' => 'center', |
1625 | + 'note' => '<br />'.$this->T_('class value for the IMG tag').' · '.$plain_text_only, |
1626 | + ), |
1627 | + 'image_style' => array( |
1628 | + 'label' => $this->T_('image style'), |
1629 | + 'type' => 'text', |
1630 | + 'size' => 64, |
1631 | + 'defaultvalue' => '', |
1632 | + 'note' => '<br />'.$this->T_('style value for the IMG tag').' · '.$plain_text_only, |
1633 | + ), |
1634 | + 'imagesection_attribs_end' => array( 'layout' => 'end_fieldset' ), |
1635 | + 'imagesection_post_start' => array( |
1636 | + 'label' => $this->T_('after the image tag'), |
1637 | + 'layout' => 'begin_fieldset', |
1638 | + ), |
1639 | + 'imagesection_post_info' => array( |
1640 | + 'label' => $this->T_('Info'), |
1641 | + 'type' => 'info', |
1642 | + 'info' => $this->T_('This is used between the image tag and the caption section, even if there is no caption section displayed.'), |
1643 | + ), |
1644 | + 'image_post' => array( |
1645 | + 'label' => $this->T_('post-image'), |
1646 | + 'type' => 'html_textarea', // allows "<" |
1647 | + 'rows' => 1, |
1648 | + 'cols' => 60, |
1649 | + 'defaultvalue' => '', |
1650 | + 'note' => $html_allowed, |
1651 | + ), |
1652 | + 'imagesection_post_end' => array( 'layout' => 'end_fieldset' ), |
1653 | + 'imagesection_end' => array( 'layout' => 'end_fieldset' ), |
1654 | + 'captionsection_start' => array( |
1655 | + 'label' => $this->T_('caption section settings'), |
1656 | + 'layout' => 'begin_fieldset', |
1657 | + ), |
1658 | + 'captionsection_info' => array( |
1659 | + 'label' => $this->T_('Info'), |
1660 | + 'type' => 'info', |
1661 | + 'info' => $this->T_('These are used only if the caption is displayed ("default" and a caption exists, or "placeholder").'), |
1662 | + ), |
1663 | + 'caption_pre' => array( |
1664 | + 'label' => $this->T_('pre-caption'), |
1665 | + 'type' => 'html_textarea', // allows "<" |
1666 | + 'rows' => 1, |
1667 | + 'cols' => 60, |
1668 | + 'defaultvalue' => '</td></tr><tr>', |
1669 | + 'note' => $this->T_('before the caption section tag').' · '.$html_allowed, |
1670 | + ), |
1671 | + 'caption_tag' => array( |
1672 | + 'label' => $this->T_('caption tag'), |
1673 | + 'type' => 'text', |
1674 | + 'size' => 64, |
1675 | + 'defaultvalue' => 'td', |
1676 | + 'note' => '<br />'.$plain_text_only, |
1677 | + ), |
1678 | + 'caption_class' => array( |
1679 | + 'label' => $this->T_('caption class'), |
1680 | + 'type' => 'text', |
1681 | + 'size' => 64, |
1682 | + 'defaultvalue' => 'image_legend', |
1683 | + 'note' => '<br />'.$plain_text_only, |
1684 | + ), |
1685 | + 'caption_style' => array( |
1686 | + 'label' => $this->T_('caption style'), |
1687 | + 'type' => 'text', |
1688 | + 'size' => 64, |
1689 | + 'defaultvalue' => '', |
1690 | + 'note' => '<br />'.$plain_text_only, |
1691 | + ), |
1692 | + 'caption_post' => array( |
1693 | + 'label' => $this->T_('post-caption'), |
1694 | + 'type' => 'html_textarea', // allows "<" |
1695 | + 'rows' => 1, |
1696 | + 'cols' => 60, |
1697 | + 'defaultvalue' => '', |
1698 | + 'note' => $this->T_('used after closing the caption tag').' · '.$html_allowed, |
1699 | + ), |
1700 | + 'nocaption_start' => array( |
1701 | + 'label' => $this->T_('no caption displayed'), |
1702 | + 'layout' => 'begin_fieldset', |
1703 | + ), |
1704 | + 'nocaption_info' => array( |
1705 | + 'label' => $this->T_('Info'), |
1706 | + 'type' => 'info', |
1707 | + 'info' => $this->T_('This is used only if there is no caption present (useful for TinyMCE)'), |
1708 | + ), |
1709 | + 'caption_none' => array( |
1710 | + 'label' => $this->T_('NO caption'), |
1711 | + 'type' => 'html_textarea', // allows "<" |
1712 | + 'rows' => 1, |
1713 | + 'cols' => 60, |
1714 | + 'defaultvalue' => '</td>', |
1715 | + 'note' => $html_allowed, |
1716 | + ), |
1717 | + 'nocaption_end' => array( 'layout' => 'end_fieldset' ), |
1718 | + 'captionsplitter_start' => array( |
1719 | + 'label' => $this->T_('Caption -> Closing separator'), |
1720 | + 'layout' => 'begin_fieldset', |
1721 | + ), |
1722 | + 'captionsplitter_info' => array( |
1723 | + 'label' => $this->T_('Info'), |
1724 | + 'type' => 'info', |
1725 | + 'info' => $this->T_('This is used between the caption section and the overall block closing, even if there is no caption section displayed.'), |
1726 | + ), |
1727 | + 'caption_separator' => array( |
1728 | + 'label' => $this->T_('post caption separator'), |
1729 | + 'type' => 'html_textarea', // allows "<" |
1730 | + 'rows' => 1, |
1731 | + 'cols' => 60, |
1732 | + 'defaultvalue' => '</tr></tbody>', |
1733 | + 'note' => $html_allowed, |
1734 | + ), |
1735 | + 'captionsplitter_end' => array( 'layout' => 'end_fieldset' ), |
1736 | + 'captionsection_end' => array( 'layout' => 'end_fieldset' ), |
1737 | ); |
1738 | + return $default_settings; |
1739 | } |
1740 | |
1741 | + |
1742 | /** |
1743 | * @see Plugin::GetExtraEvents() |
1744 | * |
1745 | @@ -183,7 +434,7 @@ |
1746 | * @todo EdB: forcing expert to do away with simple but 'edit_layout' is still around (and still valuable?) |
1747 | * |
1748 | * <input id="tinymce_plugin_toggle_button" type="button" value="WYSIWYG" style="display:none" |
1749 | - * title="<?php echo htmlspecialchars($this->T_('Toggle between WYSIWYG and plain HTML editor')); ?>" /> |
1750 | + * title="<?php echo htmlspecialchars($this->T_('Toggle between WYSIWYG and plain HTML editor')); ?>" /> |
1751 | * |
1752 | */ |
1753 | $tmce_init = $this->get_tmce_init( 'expert' ); |
1754 | @@ -327,26 +578,26 @@ |
1755 | |
1756 | <?php |
1757 | if( is_object($edited_Item) && !empty($edited_Item->editor_code) ) |
1758 | - { // We have a preference for the current post, follow it: |
1759 | + { // We have a preference for the current post, follow it: |
1760 | // Use tinyMCE if code matched the code of the current plugin. |
1761 | // fp> Note: this is a temporary solution; in the long term, this will be part of the API and the appropriate plugin will be selected. |
1762 | $use_tinymce = ($edited_Item->editor_code == $this->code); |
1763 | } |
1764 | else |
1765 | - { // We have no pref, fall back to whatever current user has last used: |
1766 | + { // We have no pref, fall back to whatever current user has last used: |
1767 | |
1768 | // Has the user used MCE last time he edited this particular blog? |
1769 | $use_tinymce = $this->UserSettings->get('use_tinymce_coll'.$Blog->ID ); |
1770 | |
1771 | if( is_null($use_tinymce) ) |
1772 | - { // We don't know for this blog, check if he used MCE last time he edited anything: |
1773 | + { // We don't know for this blog, check if he used MCE last time he edited anything: |
1774 | $use_tinymce = $this->UserSettings->get('use_tinymce'); |
1775 | } |
1776 | } |
1777 | |
1778 | if( $use_tinymce ) |
1779 | { // User used MCE last time, load MCE now: |
1780 | - // fp> why do we need to wrap in jQuery() here? |
1781 | + // fp> why do we need to wrap in jQuery() here? |
1782 | echo '<script type="text/javascript">jQuery( tinymce_plugin_toggleEditor("'.$this->tmce_editor_id.'") );</script>'; |
1783 | } |
1784 | |
1785 | @@ -487,7 +738,7 @@ |
1786 | $Template = $TemplateCache->get_by_ID( $Blog->template_ID ); |
1787 | $item_css_url = $templates_url.$Template->folder.'/item.css'; |
1788 | // else: $item_css_url = $rsc_url.'css/item_base.css'; |
1789 | - $content_css = ','.$item_css_url; // fp> TODO: this needs to be a param... "of course" -- if none: else item_default.css ? |
1790 | + $content_css = ','.$item_css_url; // fp> TODO: this needs to be a param... "of course" -- if none: else item_default.css ? |
1791 | } |
1792 | // else item_default.css -- is it still possible to have no template ? |
1793 | |
1794 | @@ -499,7 +750,7 @@ |
1795 | $init_options[] = 'entity_encoding : "raw"'; |
1796 | |
1797 | // remove_linebreaks : false, |
1798 | - // not documented: auto_cleanup_word : true, |
1799 | + // not documented: auto_cleanup_word : true, |
1800 | |
1801 | $init = implode( ",\n", $init_options ).', |
1802 | plugin_insertdate_dateFormat : "%Y-%m-%d", |
1803 | @@ -538,7 +789,7 @@ |
1804 | |
1805 | // fp>This is a super dirty hack that we're going to use only until we have a clean API for handling WYSIWYG editors: |
1806 | if( !empty($params['item']) ) |
1807 | - { // Save the status last used by this Item: |
1808 | + { // Save the status last used by this Item: |
1809 | // fp> TODO: also do that on CREATE post because it won't have been done here: |
1810 | $sql = 'UPDATE T_items__item |
1811 | SET post_editor_code = '.$DB->quote( (int)$params['on'] ? $this->code : 'html' ) |
1812 | @@ -548,7 +799,7 @@ |
1813 | |
1814 | // Clean: |
1815 | if( !empty($params['blog']) ) |
1816 | - { // This is in order to try & recall a specific state for each blog: (will be used for new posts especially) |
1817 | + { // This is in order to try & recall a specific state for each blog: (will be used for new posts especially) |
1818 | $this->UserSettings->set( 'use_tinymce_coll'.(int)$params['blog'], (int)$params['on'] ); |
1819 | } |
1820 | $this->UserSettings->set( 'use_tinymce', (int)$params['on'] ); |
1821 | @@ -564,6 +815,41 @@ |
1822 | return array('save_editor_state'); |
1823 | } |
1824 | |
1825 | + |
1826 | + /** |
1827 | + * @see Plugin::ItemInsertFileJavascript() |
1828 | + */ |
1829 | + function ItemInsertFileJavascript() |
1830 | + { |
1831 | + if( ! $this->UserSettings->get('use_tinymce') ) |
1832 | + { // if this user does not use tinymce get out |
1833 | + return NULL; |
1834 | + } |
1835 | + // provide custom tag bits |
1836 | + return array( |
1837 | + 'insert_tag' => $this->Settings->get('insert_tag'), |
1838 | + 'insert_class_floats' => $this->Settings->get('insert_class_floats'), |
1839 | + 'insert_class_centered' => $this->Settings->get('insert_class_centered'), |
1840 | + 'insert_style_floats' => $this->Settings->get('insert_style_floats'), |
1841 | + 'insert_style_centered' => $this->Settings->get('insert_style_centered'), |
1842 | + 'title_tag' => $this->Settings->get('title_tag'), |
1843 | + 'title_class' => $this->Settings->get('title_class'), |
1844 | + 'title_style' => $this->Settings->get('title_style'), |
1845 | + 'title_post' => $this->Settings->get('title_post'), |
1846 | + 'image_pre' => $this->Settings->get('image_pre'), |
1847 | + 'image_class' => $this->Settings->get('image_class'), |
1848 | + 'image_style' => $this->Settings->get('image_style'), |
1849 | + 'image_post' => $this->Settings->get('image_post'), |
1850 | + 'caption_pre' => $this->Settings->get('caption_pre'), |
1851 | + 'caption_tag' => $this->Settings->get('caption_tag'), |
1852 | + 'caption_class' => $this->Settings->get('caption_class'), |
1853 | + 'caption_style' => $this->Settings->get('caption_style'), |
1854 | + 'caption_post' => $this->Settings->get('caption_post'), |
1855 | + 'caption_none' => $this->Settings->get('caption_none'), |
1856 | + 'caption_separator' => $this->Settings->get('caption_separator'), |
1857 | + ); |
1858 | + } |
1859 | + |
1860 | } |
1861 | |
1862 | ?> |
1863 | |
1864 | === modified file 'qp_plugins/tinymce_plugin/po/messages.pot' |
1865 | --- qp_plugins/tinymce_plugin/po/messages.pot 2010-10-22 15:20:35 +0000 |
1866 | +++ qp_plugins/tinymce_plugin/po/messages.pot 2011-03-08 04:29:14 +0000 |
1867 | @@ -7,8 +7,8 @@ |
1868 | msgid "" |
1869 | msgstr "" |
1870 | "Project-Id-Version: PACKAGE VERSION\n" |
1871 | -"Report-Msgid-Bugs-To: http://quamplures.net/\n" |
1872 | -"POT-Creation-Date: 2010-09-06 10:50-0700\n" |
1873 | +"Report-Msgid-Bugs-To: http://quam-plures.net/\n" |
1874 | +"POT-Creation-Date: 2011-02-23 22:32-0700\n" |
1875 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
1876 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
1877 | "Language-Team: LANGUAGE <LL@li.org>\n" |
1878 | @@ -28,49 +28,253 @@ |
1879 | msgid "Provides a javascript-powered \"WYSIWYG\" editor. Note that this editor sometimes makes \"bad\" code. If validation is important to you then you might be unhappy." |
1880 | msgstr "" |
1881 | |
1882 | -#: ../_tinymce.plugin.php:58 |
1883 | +#: ../_tinymce.plugin.php:56 |
1884 | +msgid "plain text only" |
1885 | +msgstr "" |
1886 | + |
1887 | +#: ../_tinymce.plugin.php:57 |
1888 | +msgid "html allowed" |
1889 | +msgstr "" |
1890 | + |
1891 | +#: ../_tinymce.plugin.php:60 |
1892 | msgid "Use TinyMCE (default)" |
1893 | msgstr "" |
1894 | |
1895 | -#: ../_tinymce.plugin.php:61 |
1896 | +#: ../_tinymce.plugin.php:63 |
1897 | msgid "This is the default, which users can override in their profile." |
1898 | msgstr "" |
1899 | |
1900 | -#: ../_tinymce.plugin.php:64 |
1901 | -#: ../_tinymce.plugin.php:137 |
1902 | +#: ../_tinymce.plugin.php:66 |
1903 | +#: ../_tinymce.plugin.php:388 |
1904 | msgid "Directionality support" |
1905 | msgstr "" |
1906 | |
1907 | -#: ../_tinymce.plugin.php:67 |
1908 | +#: ../_tinymce.plugin.php:69 |
1909 | msgid "Enable to add directionality icons to TinyMCE for better handling of right-to-left languages" |
1910 | msgstr "" |
1911 | |
1912 | -#: ../_tinymce.plugin.php:70 |
1913 | +#: ../_tinymce.plugin.php:72 |
1914 | msgid "Custom TinyMCE init" |
1915 | msgstr "" |
1916 | |
1917 | -#: ../_tinymce.plugin.php:75 |
1918 | +#: ../_tinymce.plugin.php:77 |
1919 | #, php-format |
1920 | msgid "Custom parameters to tinyMCE.init(). See the <a %s>TinyMCE manual</a>." |
1921 | msgstr "" |
1922 | |
1923 | -#: ../_tinymce.plugin.php:130 |
1924 | +#: ../_tinymce.plugin.php:80 |
1925 | +msgid "Insert Image Settings" |
1926 | +msgstr "" |
1927 | + |
1928 | +#: ../_tinymce.plugin.php:84 |
1929 | +msgid "WARNING" |
1930 | +msgstr "" |
1931 | + |
1932 | +#: ../_tinymce.plugin.php:86 |
1933 | +msgid "<strong>DO NOT CHANGE THE NEXT 20 SETTINGS IF YOU ARE NOT GOOD WITH HTML!!!</strong><ul><li>For all settings: if you enter \"FLOATDIRECTION\" (no quote marks) it will be replaced with \"floatleft\" or \"floatright\" depending on which way you want to float an image. The primary purpose is for a \"class\" attribute.</li><li>For all settings: if you enter \"STYLEWIDTH\" (no quote marks) it will be replaced with \"width:XXXpx;\", where XXX is the image's width plus 12. The primary purpose is for a \"style\" attribute.</li><li>For all settings: if you enter \"WIDTHONLY\" (no quote marks) it will be replaced with \"XXX\", where XXX is the image's width plus 12. The primary purpose is for a \"width\" attribute for a table (TinyMCE).</li><ul>" |
1934 | +msgstr "" |
1935 | + |
1936 | +#: ../_tinymce.plugin.php:89 |
1937 | +#: ../_tinymce.plugin.php:98 |
1938 | +#: ../_tinymce.plugin.php:144 |
1939 | +#: ../_tinymce.plugin.php:183 |
1940 | +#: ../_tinymce.plugin.php:192 |
1941 | +#: ../_tinymce.plugin.php:229 |
1942 | +#: ../_tinymce.plugin.php:248 |
1943 | +#: ../_tinymce.plugin.php:294 |
1944 | +#: ../_tinymce.plugin.php:312 |
1945 | +msgid "Info" |
1946 | +msgstr "" |
1947 | + |
1948 | +#: ../_tinymce.plugin.php:91 |
1949 | +msgid "These settings appear in roughly the order they are used to help make sense of it all.<ul><li>Some settings are marked either \"(floats)\" or \"(centered)\". If we need different values for floating or centering we do it, otherwise the setting is shared across both methods.</li><li>ONLY \"image class\" and \"image style\" are used when inserting an image inline.</li></ul>" |
1950 | +msgstr "" |
1951 | + |
1952 | +#: ../_tinymce.plugin.php:94 |
1953 | +msgid "overall html block settings" |
1954 | +msgstr "" |
1955 | + |
1956 | +#: ../_tinymce.plugin.php:100 |
1957 | +msgid "These are for the entire inserted html block (title if present, image, and caption if present)." |
1958 | +msgstr "" |
1959 | + |
1960 | +#: ../_tinymce.plugin.php:103 |
1961 | +msgid "insert tag" |
1962 | +msgstr "" |
1963 | + |
1964 | +#: ../_tinymce.plugin.php:110 |
1965 | +msgid "insert class (floats)" |
1966 | +msgstr "" |
1967 | + |
1968 | +#: ../_tinymce.plugin.php:117 |
1969 | +msgid "insert class (centered)" |
1970 | +msgstr "" |
1971 | + |
1972 | +#: ../_tinymce.plugin.php:124 |
1973 | +msgid "insert style (floats)" |
1974 | +msgstr "" |
1975 | + |
1976 | +#: ../_tinymce.plugin.php:131 |
1977 | +msgid "insert style (centered)" |
1978 | +msgstr "" |
1979 | + |
1980 | +#: ../_tinymce.plugin.php:140 |
1981 | +msgid "title section settings" |
1982 | +msgstr "" |
1983 | + |
1984 | +#: ../_tinymce.plugin.php:146 |
1985 | +msgid "These are used only if the title is displayed (\"default\" and a title exists, or \"placeholder\")." |
1986 | +msgstr "" |
1987 | + |
1988 | +#: ../_tinymce.plugin.php:149 |
1989 | +msgid "title tag" |
1990 | +msgstr "" |
1991 | + |
1992 | +#: ../_tinymce.plugin.php:156 |
1993 | +msgid "title class" |
1994 | +msgstr "" |
1995 | + |
1996 | +#: ../_tinymce.plugin.php:163 |
1997 | +msgid "title style" |
1998 | +msgstr "" |
1999 | + |
2000 | +#: ../_tinymce.plugin.php:170 |
2001 | +msgid "post-title" |
2002 | +msgstr "" |
2003 | + |
2004 | +#: ../_tinymce.plugin.php:175 |
2005 | +msgid "added after closing the \"title tag\" ONLY IF there is a title" |
2006 | +msgstr "" |
2007 | + |
2008 | +#: ../_tinymce.plugin.php:179 |
2009 | +msgid "image section settings" |
2010 | +msgstr "" |
2011 | + |
2012 | +#: ../_tinymce.plugin.php:185 |
2013 | +msgid "These settings affect the actual IMG tag, including possible code before and after the image tag." |
2014 | +msgstr "" |
2015 | + |
2016 | +#: ../_tinymce.plugin.php:188 |
2017 | +msgid "before the image tag" |
2018 | +msgstr "" |
2019 | + |
2020 | +#: ../_tinymce.plugin.php:194 |
2021 | +msgid "This is used between the title section and the image tag, even if there is no title section displayed." |
2022 | +msgstr "" |
2023 | + |
2024 | +#: ../_tinymce.plugin.php:197 |
2025 | +msgid "pre-image" |
2026 | +msgstr "" |
2027 | + |
2028 | +#: ../_tinymce.plugin.php:206 |
2029 | +msgid "image tag attributes" |
2030 | +msgstr "" |
2031 | + |
2032 | +#: ../_tinymce.plugin.php:210 |
2033 | +msgid "image class" |
2034 | +msgstr "" |
2035 | + |
2036 | +#: ../_tinymce.plugin.php:214 |
2037 | +msgid "class value for the IMG tag" |
2038 | +msgstr "" |
2039 | + |
2040 | +#: ../_tinymce.plugin.php:217 |
2041 | +msgid "image style" |
2042 | +msgstr "" |
2043 | + |
2044 | +#: ../_tinymce.plugin.php:221 |
2045 | +msgid "style value for the IMG tag" |
2046 | +msgstr "" |
2047 | + |
2048 | +#: ../_tinymce.plugin.php:225 |
2049 | +msgid "after the image tag" |
2050 | +msgstr "" |
2051 | + |
2052 | +#: ../_tinymce.plugin.php:231 |
2053 | +msgid "This is used between the image tag and the caption section, even if there is no caption section displayed." |
2054 | +msgstr "" |
2055 | + |
2056 | +#: ../_tinymce.plugin.php:234 |
2057 | +msgid "post-image" |
2058 | +msgstr "" |
2059 | + |
2060 | +#: ../_tinymce.plugin.php:244 |
2061 | +msgid "caption section settings" |
2062 | +msgstr "" |
2063 | + |
2064 | +#: ../_tinymce.plugin.php:250 |
2065 | +msgid "These are used only if the caption is displayed (\"default\" and a caption exists, or \"placeholder\")." |
2066 | +msgstr "" |
2067 | + |
2068 | +#: ../_tinymce.plugin.php:253 |
2069 | +msgid "pre-caption" |
2070 | +msgstr "" |
2071 | + |
2072 | +#: ../_tinymce.plugin.php:258 |
2073 | +msgid "before the caption section tag" |
2074 | +msgstr "" |
2075 | + |
2076 | +#: ../_tinymce.plugin.php:261 |
2077 | +msgid "caption tag" |
2078 | +msgstr "" |
2079 | + |
2080 | +#: ../_tinymce.plugin.php:268 |
2081 | +msgid "caption class" |
2082 | +msgstr "" |
2083 | + |
2084 | +#: ../_tinymce.plugin.php:275 |
2085 | +msgid "caption style" |
2086 | +msgstr "" |
2087 | + |
2088 | +#: ../_tinymce.plugin.php:282 |
2089 | +msgid "post-caption" |
2090 | +msgstr "" |
2091 | + |
2092 | +#: ../_tinymce.plugin.php:287 |
2093 | +msgid "used after closing the caption tag" |
2094 | +msgstr "" |
2095 | + |
2096 | +#: ../_tinymce.plugin.php:290 |
2097 | +msgid "no caption displayed" |
2098 | +msgstr "" |
2099 | + |
2100 | +#: ../_tinymce.plugin.php:296 |
2101 | +msgid "This is used only if there is no caption present (useful for TinyMCE)" |
2102 | +msgstr "" |
2103 | + |
2104 | +#: ../_tinymce.plugin.php:299 |
2105 | +msgid "NO caption" |
2106 | +msgstr "" |
2107 | + |
2108 | +#: ../_tinymce.plugin.php:308 |
2109 | +msgid "Caption -> Closing separator" |
2110 | +msgstr "" |
2111 | + |
2112 | +#: ../_tinymce.plugin.php:314 |
2113 | +msgid "This is used between the caption section and the overall block closing, even if there is no caption section displayed." |
2114 | +msgstr "" |
2115 | + |
2116 | +#: ../_tinymce.plugin.php:317 |
2117 | +msgid "post caption separator" |
2118 | +msgstr "" |
2119 | + |
2120 | +#: ../_tinymce.plugin.php:381 |
2121 | msgid "Use TinyMCE" |
2122 | msgstr "" |
2123 | |
2124 | -#: ../_tinymce.plugin.php:133 |
2125 | +#: ../_tinymce.plugin.php:384 |
2126 | msgid "Check this to enable the extended Javascript editor (TinyMCE)." |
2127 | msgstr "" |
2128 | |
2129 | -#: ../_tinymce.plugin.php:140 |
2130 | +#: ../_tinymce.plugin.php:391 |
2131 | msgid "Enable to add directionality icons to TinyMCE that enables TinyMCE to better handle languages that are written from right to left." |
2132 | msgstr "" |
2133 | |
2134 | -#: ../_tinymce.plugin.php:260 |
2135 | +#: ../_tinymce.plugin.php:511 |
2136 | #, php-format |
2137 | msgid "TinyMCE javascript could not be loaded. Check the \"%s\" plugin setting." |
2138 | msgstr "" |
2139 | |
2140 | -#: ../_tinymce.plugin.php:261 |
2141 | +#: ../_tinymce.plugin.php:512 |
2142 | msgid "URL to TinyMCE" |
2143 | msgstr "" |
2144 | |
2145 | === modified file 'qp_rsc/css/basic.css' |
2146 | --- qp_rsc/css/basic.css 2010-08-17 07:33:35 +0000 |
2147 | +++ qp_rsc/css/basic.css 2011-03-08 04:29:14 +0000 |
2148 | @@ -1,6 +1,7 @@ |
2149 | /* |
2150 | * Obviously, this file no longer contains only basic styles. |
2151 | - * It now also contains all sorts of base styles like the toolbar and debug for backward comaptibility with older templates... :/ |
2152 | + * It now also contains all sorts of base styles like the toolbar |
2153 | + * and debug for backward comaptibility with older templates... :/ |
2154 | */ |
2155 | |
2156 | @import url("basic_styles.css"); /* Import the REAL basic styles */ |
2157 | @@ -10,9 +11,7 @@ |
2158 | margin: 0; |
2159 | } |
2160 | |
2161 | -/** |
2162 | - * Image styles |
2163 | - */ |
2164 | +/* Image styles */ |
2165 | img { |
2166 | border: none; |
2167 | } |
2168 | @@ -38,27 +37,48 @@ |
2169 | border: 1px solid #ccc; |
2170 | } |
2171 | |
2172 | -div.image_block { |
2173 | -/* WARNING: this will screw out backoffice layout (fulltext edit screen) in firefox! |
2174 | - overflow: hidden; */ |
2175 | +div.bImages, .image_block { |
2176 | text-align: center; |
2177 | } |
2178 | +.image_block { |
2179 | + clear: both; |
2180 | + display: block; |
2181 | +} |
2182 | + |
2183 | +.image_block img { |
2184 | + margin: 1ex; |
2185 | +} |
2186 | + |
2187 | +.image_block .image_legend { |
2188 | + display: block; |
2189 | +} |
2190 | |
2191 | /* We only float image_blocks when in multiple image zone */ |
2192 | -div.multi_image_zone div.image_block { |
2193 | +div.multi_image_zone .image_block { |
2194 | margin: 1ex; |
2195 | float: left; |
2196 | } |
2197 | |
2198 | -div.image_block img { |
2199 | - margin: 1ex; |
2200 | -} |
2201 | - |
2202 | div.image_legend, .image_legend { |
2203 | font-size: 84%; |
2204 | color: #aaa; |
2205 | margin: 1ex; |
2206 | -} |
2207 | + text-align: center; |
2208 | +} |
2209 | + |
2210 | +.image_title { |
2211 | + font-size: 1.4em; |
2212 | + color: #333333; |
2213 | + margin: 0 0 .2ex 0; |
2214 | +} |
2215 | + |
2216 | +table.image_block, |
2217 | +table.image_block img, |
2218 | +table.image_block span.image_legend { |
2219 | +margin:0 auto; |
2220 | +padding:0; |
2221 | +} |
2222 | + |
2223 | .spanimage { |
2224 | margin: .2ex 1ex; |
2225 | } |
2226 | @@ -126,8 +146,7 @@ |
2227 | } |
2228 | |
2229 | /* *** SuperFish *** */ |
2230 | - |
2231 | -/*** ESSENTIAL STYLES ***/ |
2232 | +/* ESSENTIAL STYLES */ |
2233 | .sf-menu, |
2234 | .sf-menu * { |
2235 | margin: 0; |
2236 | @@ -316,7 +335,7 @@ |
2237 | background-position: -10px 0; /* arrow hovers for modern browsers*/ |
2238 | } |
2239 | |
2240 | -/*** shadows for all but IE6 ***/ |
2241 | +/* shadows for all but IE6 */ |
2242 | .sf-shadow ul { |
2243 | background: url('../img/superfish-shadow.png') no-repeat bottom right; |
2244 | padding: 0 8px 9px 0; |
2245 | @@ -330,9 +349,7 @@ |
2246 | } |
2247 | |
2248 | |
2249 | -/** |
2250 | - * Default Form styles |
2251 | - */ |
2252 | +/* Default Form styles */ |
2253 | form { |
2254 | margin: 0; |
2255 | padding: 0; |
2256 | @@ -392,12 +409,6 @@ |
2257 | padding : 1px; |
2258 | } |
2259 | |
2260 | -/* fp> The following breaks the login screen and probably a lot more space constrained forms. |
2261 | -.label{ |
2262 | -padding-right:3ex; |
2263 | -} |
2264 | -*/ |
2265 | - |
2266 | /* The following is a dirty fix. */ |
2267 | .field_required .label{ |
2268 | background-image: url("../img/required-star.gif"); |
2269 | @@ -449,7 +460,6 @@ |
2270 | border: none; |
2271 | margin: 1ex; |
2272 | padding: 0; |
2273 | - /* border: 1px solid #00f; */ |
2274 | } |
2275 | .fform fieldset.bordered { |
2276 | border: 1px solid #ddd; |
2277 | @@ -461,11 +471,9 @@ |
2278 | font-weight:bold; |
2279 | margin: 0; |
2280 | padding-top: .5ex; |
2281 | - /* border: 1px solid #f00; */ |
2282 | } |
2283 | .fform div.input { |
2284 | margin: 0 0 0 25%; |
2285 | - /* border: 1px solid #f00; */ |
2286 | } |
2287 | * html .fform div.input { |
2288 | height:1%; /* so IE6 gains layout (hasLayout) and does not cause 3px bug for lines below div.label (if div.input is heigher than div.label) */ |
2289 | @@ -473,12 +481,10 @@ |
2290 | } |
2291 | .fform fieldset.input{ |
2292 | margin: 0; |
2293 | - /* border: 1px solid #0f0; */ |
2294 | } |
2295 | .fform div.info { |
2296 | margin: 0 0 0 25%; |
2297 | padding-top: .5ex; |
2298 | - /* border: 1px solid #f00; */ |
2299 | } |
2300 | |
2301 | /* hide checkbox in order to indent exactly the same size */ |
2302 | @@ -494,9 +500,7 @@ |
2303 | } |
2304 | |
2305 | |
2306 | -/* |
2307 | -{{{ Messages |
2308 | -*/ |
2309 | +/* Messages */ |
2310 | div.log_container, |
2311 | div.action_messages { |
2312 | margin:1ex; |
2313 | @@ -541,7 +545,6 @@ |
2314 | p.error { |
2315 | margin: 1ex; |
2316 | } |
2317 | -/* }}} */ |
2318 | |
2319 | /* include errors, wrong params, deleted blog, etc... */ |
2320 | div.template_error { |
2321 | @@ -595,9 +598,7 @@ |
2322 | font-weight: normal; |
2323 | } |
2324 | |
2325 | -/* |
2326 | - * Bottom of page Debug output formatting: |
2327 | - */ |
2328 | +/* Bottom of page Debug output formatting: */ |
2329 | div.debug { |
2330 | border: 2px solid #000; |
2331 | padding: 1ex; |
2332 | @@ -653,9 +654,7 @@ |
2333 | background-color: #eee; |
2334 | } |
2335 | |
2336 | -/* |
2337 | - * Definition Lists default styling |
2338 | - */ |
2339 | +/* Definition Lists default styling */ |
2340 | dl { |
2341 | display: block; |
2342 | margin: 1em 0 1em 0; |
I set the review as Needs Fixing because I could not get it to work. Not sure if it is the code, or something about my site. I have a QP Test Blog where I test out branches. I uploaded the entire branch, uninstalled TinyMCE, reinstalled TinyMCE. I can not get the file manager in a pop-up to insert the image code either in TinyMCE or the HTML editor. I will play with it more tomorrow, but wanted to put out there may be a bug and to see if others would test it as well before merging it.
-Kimberly.