Merge lp:~edb/quam-plures/yet_another_image_branch into lp:quam-plures

Proposed by EdB
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
Reviewer Review Type Date Requested Status
Yabs (community) Approve
EdB Needs Resubmitting
Kimberly (community) Needs Fixing
Review via email: mp+50959@code.launchpad.net

Description of the change

http://forums.quamplures.net/viewtopic.php?p=4970#p4970 sums up a very long forum thread about this branch.

To post a comment you must log in.
Revision history for this message
Kimberly (kimberly-netweb360) wrote :

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.

review: Needs Fixing
Revision history for this message
EdB (edb) 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...

Revision history for this message
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.

Revision history for this message
EdB (edb) 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.

7595. By EdB

updated messages.pot file due to tons of new strings in the plugin

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
EdB (edb) wrote :

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...

review: Needs Fixing
Revision history for this message
EdB (edb) wrote :

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.

review: Needs Resubmitting
Revision history for this message
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.

Revision history for this message
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 ;)

¥

review: Approve
Revision history for this message
EdB (edb) wrote :

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)

7596. By EdB

new stuff in core now here - woohoo!

Revision history for this message
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/caption, I am seeing the same thing I saw when I marked the revision as needing fixing.

So, is it possible that the wrong revision got merged?

-Kimberly.

Revision history for this message
EdB (edb) wrote :

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.

Revision history for this message
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qp_inc/files/files.ctrl.php'
--- qp_inc/files/files.ctrl.php 2010-12-31 12:12:03 +0000
+++ qp_inc/files/files.ctrl.php 2011-03-08 04:29:14 +0000
@@ -1475,7 +1475,7 @@
1475}1475}
14761476
1477// Update sub-menu:1477// Update sub-menu:
1478$popfor = param( 'popfor', 'string', '' );1478$popfor = param( 'popfor', 'string', '', true );
1479if( $current_User->check_perm( 'files', 'add' ) && $popfor == '' )1479if( $current_User->check_perm( 'files', 'add' ) && $popfor == '' )
1480{ // Permission to upload and we are not in a popup window (no subtabs needed otherwise)1480{ // Permission to upload and we are not in a popup window (no subtabs needed otherwise)
1481 $AdminUI->add_menu_entries(1481 $AdminUI->add_menu_entries(
14821482
=== modified file 'qp_inc/files/upload.ctrl.php'
--- qp_inc/files/upload.ctrl.php 2010-12-31 12:12:03 +0000
+++ qp_inc/files/upload.ctrl.php 2011-03-08 04:29:14 +0000
@@ -433,14 +433,14 @@
433 $success_msg .= '<br />';433 $success_msg .= '<br />';
434 $success_msg .= '<fieldset class="uploaded_image"><legend>'.T_('Add this Image to your Post').'</legend><ul><li>';434 $success_msg .= '<fieldset class="uploaded_image"><legend>'.T_('Add this Image to your Post').'</legend><ul><li>';
435 // image tag floated left435 // image tag floated left
436 $img_tag = format_to_output( $newFile->get_tag( '<span class="imgwrap floatleft center">', '<br /><span class="image_legend">', '</span>', '</span>', 'original', '', 'spanimage' ), 'formvalue' );436 $img_tag = format_to_output( $newFile->get_tag( '<span class="floatleft center">', '<br /><span class="image_legend">', '</span>', '</span>', 'original', '', 'spanimage' ), 'formvalue' );
437 $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 ';437 $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 ';
438 // image tag centered438 // image tag centered
439 $img_tag = format_to_output( $newFile->get_tag( '<div class="image_block">', '<div class="image_legend">', '</div>', '</div>', 'original', '', 'center'), 'formvalue' );439 $img_tag = format_to_output( $newFile->get_tag( '<div class="image_block">', '<div class="image_legend">', '</div>', '</div>', 'original', '', 'center'), 'formvalue' );
440 $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 ';440 $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 ';
441 // image tag floated right441 // image tag floated right
442 $img_tag = format_to_output( $newFile->get_tag( '<span class="imgwrap floatright center">', '<br /><span class="image_legend">', '</span>', '</span>', 'original', '', 'spanimage' ), 'formvalue' );442 $img_tag = format_to_output( $newFile->get_tag( '<span class="floatright center">', '<br /><span class="image_legend">', '</span>', '</span>', 'original', '', 'spanimage' ), 'formvalue' );
443 $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>';443 $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>';
444 $success_msg .= '</li></ul></fieldset>';444 $success_msg .= '</li></ul></fieldset>';
445 $success_msg .= '<hr class="hidden" />';445 $success_msg .= '<hr class="hidden" />';
446 }446 }
447447
=== modified file 'qp_inc/files/views/_file_browse.view.php'
--- qp_inc/files/views/_file_browse.view.php 2010-12-31 12:12:03 +0000
+++ qp_inc/files/views/_file_browse.view.php 2011-03-08 04:29:14 +0000
@@ -64,7 +64,7 @@
64 */64 */
65global $edited_Item;65global $edited_Item;
6666
67$popfor = param( 'popfor', 'string', '' );67$popfor = param( 'popfor', 'string', '', true );
6868
69?>69?>
7070
7171
=== modified file 'qp_inc/files/views/_file_list.inc.php'
--- qp_inc/files/views/_file_list.inc.php 2010-12-31 12:12:03 +0000
+++ qp_inc/files/views/_file_list.inc.php 2011-03-08 04:29:14 +0000
@@ -81,582 +81,730 @@
81<?php81<?php
82$Form = new Form( NULL, 'FilesForm', 'post', 'none' );82$Form = new Form( NULL, 'FilesForm', 'post', 'none' );
83$Form->begin_form();83$Form->begin_form();
84 $Form->hidden_ctrl();84$Form->hidden_ctrl();
8585$Form->hidden( 'confirmed', '0' );
86 $Form->hidden( 'confirmed', '0' );86$Form->hidden( 'md5_filelist', $fm_Filelist->md5_checksum() );
87 $Form->hidden( 'md5_filelist', $fm_Filelist->md5_checksum() );87$Form->hidden( 'md5_cwd', md5($fm_Filelist->get_ads_list_path()) );
88 $Form->hidden( 'md5_cwd', md5($fm_Filelist->get_ads_list_path()) );88$Form->hiddens_by_key( get_memorized('fm_selected') ); // 'fm_selected' gets provided by the form itself
89 $Form->hiddens_by_key( get_memorized('fm_selected') ); // 'fm_selected' gets provided by the form itself
90?>89?>
91<table class="filelist">90<table class="filelist">
92 <thead>91<thead>
93 <?php92<?php
94 /***************** Col headers ****************/93/***************** Col headers ****************/
9594echo '<tr>';
96 echo '<tr>';95
9796// "Go to parent" icon
98 // "Go to parent" icon97echo '<th class="firstcol">';
99 echo '<th class="firstcol">';98if( empty($fm_Filelist->_rds_list_path) )
100 if( empty($fm_Filelist->_rds_list_path) )99{ // cannot go higher
101 { // cannot go higher100 echo '&nbsp;'; // for IE
102 echo '&nbsp;'; // for IE101}
103 }102else
104 else103{
105 {104 echo action_icon( T_('Go to parent folder'), 'folder_parent', regenerate_url( 'path', 'path='.$fm_Filelist->_rds_list_path.'..' ) );
106 echo action_icon( T_('Go to parent folder'), 'folder_parent', regenerate_url( 'path', 'path='.$fm_Filelist->_rds_list_path.'..' ) );105}
107 }106echo '</th>';
108 echo '</th>';107
109108echo '<th class="nowrap">';
110 echo '<th class="nowrap">';109if( $UserSettings->get( 'fm_imglistpreview' ) )
111 if( $UserSettings->get( 'fm_imglistpreview' ) )110{ // Image file preview:
112 { // Image file preview:111 $col_title = T_('Icon/Type');
113 $col_title = T_('Icon/Type');112}
114 }113else
115 else114{
116 {115 $col_title = /* TRANS: short for (file)Type */ T_(' T ');
117 $col_title = /* TRANS: short for (file)Type */ T_(' T ');116}
118 }117echo $fm_Filelist->get_sort_link( 'type', $col_title );
119 echo $fm_Filelist->get_sort_link( 'type', $col_title );118echo '</th>';
120 echo '</th>';119
121120if( $fm_flatmode )
122 if( $fm_flatmode )121{
123 {122 echo '<th>'.$fm_Filelist->get_sort_link( 'path', /* TRANS: file/directory path */ T_('Path') ).'</th>';
124 echo '<th>'.$fm_Filelist->get_sort_link( 'path', /* TRANS: file/directory path */ T_('Path') ).'</th>';123}
125 }124
126125echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'name', /* TRANS: file name */ T_('Name') ).'</th>';
127 echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'name', /* TRANS: file name */ T_('Name') ).'</th>';126
128127if( $UserSettings->get('fm_showtypes') )
129 if( $UserSettings->get('fm_showtypes') )128{ // Show file types column
130 { // Show file types column129 echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'type', /* TRANS: file type */ T_('Type') ).'</th>';
131 echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'type', /* TRANS: file type */ T_('Type') ).'</th>';130}
132 }131
133132echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'size', /* TRANS: file size */ T_('Size') ).'</th>';
134 echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'size', /* TRANS: file size */ T_('Size') ).'</th>';133
135134if( $UserSettings->get('fm_showdate') != 'no' )
136 if( $UserSettings->get('fm_showdate') != 'no' )135{ // Show last mod column
137 { // Show last mod column136 echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'lastmod', /* TRANS: file's last change / timestamp */ T_('Last change') ).'</th>';
138 echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'lastmod', /* TRANS: file's last change / timestamp */ T_('Last change') ).'</th>';137}
139 }138
140139$popfor = param( 'popfor', 'string', '', true );
141 $popfor = param( 'popfor', 'string', '' );140
142141if( $popfor == '' )
143 if( $popfor == '' )142{
144 {143 if( $UserSettings->get('fm_showfsperms') )
145 if( $UserSettings->get('fm_showfsperms') )144 { // Show file perms column
146 { // Show file perms column145 echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'perms', /* TRANS: file's permissions (short) */ T_('Perms') ).'</th>';
147 echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'perms', /* TRANS: file's permissions (short) */ T_('Perms') ).'</th>';146 }
148 }147
149148 if( $UserSettings->get('fm_showfsowner') )
150 if( $UserSettings->get('fm_showfsowner') )149 { // Show file owner column
151 { // Show file owner column150 echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'fsowner', /* TRANS: file owner */ T_('Owner') ).'</th>';
152 echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'fsowner', /* TRANS: file owner */ T_('Owner') ).'</th>';151 }
153 }152
154153 if( $UserSettings->get('fm_showfsgroup') )
155 if( $UserSettings->get('fm_showfsgroup') )154 { // Show file group column
156 { // Show file group column155 echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'fsgroup', /* TRANS: file group */ T_('Group') ).'</th>';
157 echo '<th class="nowrap">'.$fm_Filelist->get_sort_link( 'fsgroup', /* TRANS: file group */ T_('Group') ).'</th>';156 }
158 }157
159158 echo '<th class="lastcol nowrap">'. /* TRANS: file actions; edit, rename, copy, .. */ T_('Actions').'</th>';
160 echo '<th class="lastcol nowrap">'. /* TRANS: file actions; edit, rename, copy, .. */ T_('Actions').'</th>';159}
161 }160echo '</tr>';
162 echo '</tr>';161?>
163 ?>162</thead>
164 </thead>163<tbody>
165164
166 <tbody>165<?php
167 <?php166param( 'checkall', 'integer', 0 ); // Non-Javascript-CheckAll
168 param( 'checkall', 'integer', 0 ); // Non-Javascript-CheckAll167
169168/***********************************************************/
170 /***********************************************************/169/* MAIN FILE LIST: */
171 /* MAIN FILE LIST: */170/***********************************************************/
172 /***********************************************************/171$countFiles = 0;
173 $countFiles = 0;172while( $lFile = & $fm_Filelist->get_next() )
174 while( $lFile = & $fm_Filelist->get_next() )173{ // Loop through all Files:
175 { // Loop through all Files:174 echo '<tr class="'.( $countFiles%2 ? 'odd' : 'even' ).'">';
176 echo '<tr class="'.( $countFiles%2 ? 'odd' : 'even' ).'">';175
177176 /******************** Checkbox: *******************/
178177 echo '<td class="checkbox firstcol">';
179 /******************** Checkbox: *******************/178 echo '<span name="surround_check" class="checkbox_surround_init">';
180179 echo '<input title="'.T_('Select this file').'" type="checkbox" class="checkbox"
181 echo '<td class="checkbox firstcol">';180 name="fm_selected[]" value="'.rawurlencode($lFile->get_rdfp_rel_path()).'" id="cb_filename_'.$countFiles.'"';
182 echo '<span name="surround_check" class="checkbox_surround_init">';181 global $checkall;
183 echo '<input title="'.T_('Select this file').'" type="checkbox" class="checkbox"182 if( $checkall || $selected_Filelist->contains( $lFile ) )
184 name="fm_selected[]" value="'.rawurlencode($lFile->get_rdfp_rel_path()).'" id="cb_filename_'.$countFiles.'"';183 {
185 global $checkall;184 echo ' checked="checked"';
186 if( $checkall || $selected_Filelist->contains( $lFile ) )185 }
187 {186 echo ' />';
188 echo ' checked="checked"';187 echo '</span>';
189 }188
190 echo ' />';189 /*********** Hidden info used by Javascript: ***********/
191 echo '</span>';190
192191 global $mode;
193 /*********** Hidden info used by Javascript: ***********/192 if( $mode == 'upload' )
194193 { // This mode allows inserting images or links to files in items...
195 global $mode;194 $lFile->load_meta( true );
196 if( $mode == 'upload' )195 echo '<input type="hidden" name="link_'.$countFiles.'" id="link_'.$countFiles.'" value="'
197 { // This mode allows to insert img tags into the post...196 .$lFile->get_url().'" />'."\n";
198 // Hidden info used by Javascript:197 // this is the title
199 echo '<input type="hidden" name="img_tag_'.$countFiles.'" id="img_tag_'.$countFiles198 echo '<input type="hidden" name="title_'.$countFiles.'" id="title_'.$countFiles.'" value="'
200 .'" value="'.format_to_output( $lFile->get_tag(), 'formvalue' ).'" />';199 .$lFile->dget('title', 'htmlattr').'" />'."\n";
201 }200 // this is the alttxt
202201 echo '<input type="hidden" name="alttxt_'.$countFiles.'" id="alttxt_'.$countFiles.'" value="'
203 echo '</td>';202 .$lFile->dget('alt', 'htmlattr').'" />'."\n";
204203 // this is the caption
205204 echo '<input type="hidden" name="caption_'.$countFiles.'" id="caption_'.$countFiles.'" value="'
206 /******************** Icon / File type: *******************/205 .$lFile->dget('desc', 'htmlattr').'" />'."\n";
207206 // this is width and height OR false for non-image files
208 echo '<td class="icon_type">';207 echo '<input type="hidden" name="dimens_'.$countFiles.'" id="dimens_'.$countFiles.'" value="'
209 if( $UserSettings->get( 'fm_imglistpreview' ) )208 .$lFile->get_image_size().'" />'."\n";
210 { // Image preview OR full type:209 }
211 if( $lFile->is_dir() )210
212 { // Navigate into Directory211 echo '</td>';
213 echo '<a href="'.$lFile->get_view_url().'" title="'.T_('Change into this directory').'">'.$lFile->get_icon().' '.T_('Directory').'</a>';212
214 }213 /******************** Icon / File type: *******************/
215 else214 echo '<td class="icon_type">';
216 {215 if( $UserSettings->get( 'fm_imglistpreview' ) )
217 echo $lFile->get_preview_thumb( 'fulltype' );216 { // Image preview OR full type:
218 }217 if( $lFile->is_dir() )
219 }218 { // Navigate into Directory
220 else219 echo '<a href="'.$lFile->get_view_url().'" title="'.T_('Change into this directory').'">'.$lFile->get_icon().' '.T_('Directory').'</a>';
221 { // No image preview, small type:220 }
222 if( $lFile->is_dir() )221 else
223 { // Navigate into Directory222 {
224 echo '<a href="'.$lFile->get_view_url().'" title="'.T_('Change into this directory').'">'.$lFile->get_icon().'</a>';223 echo $lFile->get_preview_thumb( 'fulltype' );
225 }224 }
226 else225 }
227 { // File226 else
228 echo $lFile->get_view_link( $lFile->get_icon(), NULL, $lFile->get_icon() );227 { // No image preview, small type:
229 }228 if( $lFile->is_dir() )
230 }229 { // Navigate into Directory
231 echo '</td>';230 echo '<a href="'.$lFile->get_view_url().'" title="'.T_('Change into this directory').'">'.$lFile->get_icon().'</a>';
232231 }
233 /******************* Path (flatmode): ******************/232 else
234233 { // File
235 if( $fm_flatmode )234 echo $lFile->get_view_link( $lFile->get_icon(), NULL, $lFile->get_icon() );
236 {235 }
237 echo '<td class="filepath">';236 }
238 echo dirname($lFile->get_rdfs_rel_path()).'/';237 echo '</td>';
239 echo '</td>';238
240 }239 /******************* Path (flatmode): ******************/
241240 if( $fm_flatmode )
242241 {
243 echo '<td class="fm_filename">';242 echo '<td class="filepath">';
244243 echo dirname($lFile->get_rdfs_rel_path()).'/';
245 /************* Invalid filename warning: *************/244 echo '</td>';
246245 }
247 if( !$lFile->is_dir() )246
248 {247 echo '<td class="fm_filename">';
249 if( $error_filename = validate_filename( $lFile->get_name() ) )248
250 { // TODO: Warning icon with hint249 /************* Invalid filename warning: *************/
251 echo get_icon( 'warning', 'imgtag', array( 'class' => 'filenameIcon', 'title' => $error_filename ) );250 if( !$lFile->is_dir() )
252 }251 {
253 }252 if( $error_filename = validate_filename( $lFile->get_name() ) )
254 elseif( $error_dirname = validate_dirname( $lFile->get_name() ) )253 { // TODO: Warning icon with hint
255 { // TODO: Warning icon with hint254 echo get_icon( 'warning', 'imgtag', array( 'class' => 'filenameIcon', 'title' => $error_filename ) );
256 echo get_icon( 'warning', 'imgtag', array( 'class' => 'filenameIcon', 'title' => $error_dirname ) );255 }
257 }256 }
258257 elseif( $error_dirname = validate_dirname( $lFile->get_name() ) )
259 /**** Open in a new window (only directories) ****/258 { // TODO: Warning icon with hint
260259 echo get_icon( 'warning', 'imgtag', array( 'class' => 'filenameIcon', 'title' => $error_dirname ) );
261 if( $lFile->is_dir() )260 }
262 { // Directory261
263 $browse_dir_url = $lFile->get_view_url();262 /**** Open in a new window (only directories) ****/
264 $popup_url = url_add_param( $browse_dir_url, 'mode=popup' );263 if( $lFile->is_dir() )
265 $target = 'evo_fm_'.$lFile->get_md5_ID();264 { // Directory
266265 $browse_dir_url = $lFile->get_view_url();
267 echo '<a href="'.$browse_dir_url.'" target="'.$target.' " class="filenameIcon"266 $popup_url = url_add_param( $browse_dir_url, 'mode=popup' );
268 title="'.T_('Open in a new window').'" onclick="'267 $target = 'evo_fm_'.$lFile->get_md5_ID();
269 ."return pop_up_window( '$popup_url', '$target' )"268
270 .'">'.get_icon( 'window_new' ).'</a>';269 echo '<a href="'.$browse_dir_url.'" target="'.$target.' " class="filenameIcon"
271 }270 title="'.T_('Open in a new window').'" onclick="'
272271 ."return pop_up_window( '$popup_url', '$target' )"
273 /*************** Link ("chain") icon: **************/272 .'">'.get_icon( 'window_new' ).'</a>';
274273 }
275 // if( ! $lFile->is_dir() ) // fp> OK but you need to include an else:placeholder, otherwise the display is ugly274
276 { // Only provide link/"chain" icons for files.275 /*************** Link ("chain") icon: **************/
277 // TODO: dh> provide support for direcories (display included files).276 // if( ! $lFile->is_dir() ) // fp> OK but you need to include an else:placeholder, otherwise the display is ugly
278277 { // Only provide link/"chain" icons for files.
279 // fp> here might not be the best place to put the perm check278 // TODO: dh> provide support for direcories (display included files).
280 if( isset($edited_Item) && $current_User->check_perm( 'item_post!CURSTATUS', 'edit', false, $edited_Item ) )279
281 { // Offer option to link the file to an Item (or anything else):280 // fp> here might not be the best place to put the perm check
282 $link_attribs = array();281 if( isset($edited_Item) && $current_User->check_perm( 'item_post!CURSTATUS', 'edit', false, $edited_Item ) )
283 $link_action = 'link';282 { // Offer option to link the file to an Item (or anything else):
284 if( $mode == 'upload' )283 $link_attribs = array();
285 { // We want the action to happen in the post attachments iframe:284 $link_action = 'link';
286 $link_attribs['target'] = $iframe_name;285 if( $mode == 'upload' )
287 $link_action = 'link_inpost';286 { // We want the action to happen in the post attachments iframe:
288 }287 $link_attribs['target'] = $iframe_name;
289 echo action_icon( T_('Link this file!'), 'link',288 $link_action = 'link_inpost';
290 regenerate_url( 'fm_selected', 'action='.$link_action.'&amp;fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ),289 }
291 NULL, NULL, NULL, $link_attribs );290 echo action_icon( T_('Link this file!'), 'link',
292 echo ' ';291 regenerate_url( 'fm_selected', 'action='.$link_action.'&amp;fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ),
293 }292 NULL, NULL, NULL, $link_attribs );
294293 echo ' ';
295 if( isset($edited_User) ) // fp> Perm already checked in controller294 }
296 { // Offer option to link the file to an Item (or anything else):295
297 echo action_icon( T_('Link this file!'), 'link',296 if( isset($edited_User) ) // fp> Perm already checked in controller
298 regenerate_url( 'fm_selected', 'action=link_user&amp;fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ),297 { // Offer option to link the file to an Item (or anything else):
299 NULL, NULL, NULL, array() );298 echo action_icon( T_('Link this file!'), 'link',
300 echo ' ';299 regenerate_url( 'fm_selected', 'action=link_user&amp;fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ),
301 }300 NULL, NULL, NULL, array() );
302 }301 echo ' ';
303302 }
304 /******************** Filename ********************/303
305304 }
306 if( $lFile->is_dir() )305
307 { // Directory306 /******************** Filename ********************/
308 // Link to open the directory in the curent window307 if( $lFile->is_dir() )
309 echo '<a href="'.$browse_dir_url.'">'.$lFile->dget('name').'</a>';308 { // Directory
310 }309 // Link to open the directory in the curent window
311 else310 echo '<a href="'.$browse_dir_url.'">'.$lFile->dget('name').'</a>';
312 { // File311 }
313 if( $view_link = $lFile->get_view_link( $lFile->get_name(), NULL, NULL ) )312 else
314 {313 { // File
315 echo $view_link;314 if( $view_link = $lFile->get_view_link( $lFile->get_name(), NULL, NULL ) )
316 }315 {
317 else316 echo $view_link;
318 { // File extension unrecognized317 }
319 echo $lFile->dget('name');318 else
320 }319 { // File extension unrecognized
321 }320 echo $lFile->dget('name');
322321 }
323 /*************** File meta data: **************/322 }
324323
325 echo '<span class="filemeta">';324 /*************** File meta data: **************/
326 // Optionally display IMAGE pixel size:325 echo '<span class="filemeta">';
327 if( $UserSettings->get( 'fm_getimagesizes' ) )326 // Optionally display IMAGE pixel size:
328 {327 if( $UserSettings->get( 'fm_getimagesizes' ) )
329 echo ' ('.$lFile->get_image_size( 'widthxheight' ).')';328 {
330 }329 echo ' ('.$lFile->get_image_size( 'widthxheight' ).')';
331 // Optionally display meta data title:330 }
332 if( $lFile->meta == 'loaded' )331 // Optionally display meta data title:
333 { // We have loaded meta data for this file:332 if( $lFile->meta == 'loaded' )
334 echo ' - '.$lFile->title;333 { // We have loaded meta data for this file:
335 }334 echo ' - '.$lFile->title;
336 echo '</span>';335 }
337336 echo '</span>';
338 echo '</td>';337 echo '</td>';
339338
340 /******************* File type ******************/339 /******************* File type ******************/
341340 if( $UserSettings->get('fm_showtypes') )
342 if( $UserSettings->get('fm_showtypes') )341 { // Show file types
343 { // Show file types342 echo '<td class="type">'.$lFile->get_type().'</td>';
344 echo '<td class="type">'.$lFile->get_type().'</td>';343 }
345 }344
346345 /******************* File size ******************/
347 /******************* File size ******************/346 echo '<td class="size">'.$fm_Filelist->get_File_size_formatted($lFile).'</td>';
348347
349 echo '<td class="size">'.$fm_Filelist->get_File_size_formatted($lFile).'</td>';348 /**************** File time stamp ***************/
350349 if( $UserSettings->get('fm_showdate') != 'no' )
351 /**************** File time stamp ***************/350 { // Show last modified datetime (always full in title attribute)
352351 $lastmod_date = $lFile->get_lastmod_formatted( 'date' );
353 if( $UserSettings->get('fm_showdate') != 'no' )352 $lastmod_time = $lFile->get_lastmod_formatted( 'time' );
354 { // Show last modified datetime (always full in title attribute)353 echo '<td class="timestamp" title="'.$lastmod_date.' '.$lastmod_time.'">';
355 $lastmod_date = $lFile->get_lastmod_formatted( 'date' );354 if( $UserSettings->get('fm_showdate') == 'long' )
356 $lastmod_time = $lFile->get_lastmod_formatted( 'time' );355 {
357 echo '<td class="timestamp" title="'.$lastmod_date.' '.$lastmod_time.'">';356 echo '<span class="date">'.$lastmod_date.'</span> ';
358 if( $UserSettings->get('fm_showdate') == 'long' )357 echo '<span class="time">'.$lastmod_time.'</span>';
359 {358 }
360 echo '<span class="date">'.$lastmod_date.'</span> ';359 else
361 echo '<span class="time">'.$lastmod_time.'</span>';360 { // Compact format
362 }361 echo $lFile->get_lastmod_formatted( 'compact' );
363 else362 }
364 { // Compact format363 echo '</td>';
365 echo $lFile->get_lastmod_formatted( 'compact' );364 }
366 }365
367 echo '</td>';366 /**************** File pemissions ***************/
368 }367 if( $popfor == '' )
369368 {
370 /**************** File pemissions ***************/369 if( $UserSettings->get('fm_showfsperms') )
371 if( $popfor == '' )370 { // Show file perms
372 {371 echo '<td class="perms">';
373 if( $UserSettings->get('fm_showfsperms') )372 $fm_permlikelsl = $UserSettings->param_Request( 'fm_permlikelsl', 'fm_permlikelsl', 'integer', 0 );
374 { // Show file perms373 if( $current_User->check_perm( 'files', 'edit' ) )
375 echo '<td class="perms">';374 { // User can edit:
376 $fm_permlikelsl = $UserSettings->param_Request( 'fm_permlikelsl', 'fm_permlikelsl', 'integer', 0 );375 echo '<a title="'.T_('Edit permissions').'" href="'.regenerate_url( 'fm_selected,action', 'action=edit_perms&amp;fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ).'">'
377 if( $current_User->check_perm( 'files', 'edit' ) )376 .$lFile->get_perms( $fm_permlikelsl ? 'lsl' : '' ).'</a>';
378 { // User can edit:377 }
379 echo '<a title="'.T_('Edit permissions').'" href="'.regenerate_url( 'fm_selected,action', 'action=edit_perms&amp;fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ).'">'378 else
380 .$lFile->get_perms( $fm_permlikelsl ? 'lsl' : '' ).'</a>';379 {
381 }380 echo $lFile->get_perms( $fm_permlikelsl ? 'lsl' : '' );
382 else381 }
383 {382 echo '</td>';
384 echo $lFile->get_perms( $fm_permlikelsl ? 'lsl' : '' );383 }
385 }384
386 echo '</td>';385 /**************** File owner ********************/
387 }386 if( $UserSettings->get('fm_showfsowner') )
388387 { // Show file owner
389 /**************** File owner ********************/388 echo '<td class="fsowner">';
390 if( $UserSettings->get('fm_showfsowner') )389 echo $lFile->get_fsowner_name();
391 { // Show file owner390 echo '</td>';
392 echo '<td class="fsowner">';391 }
393 echo $lFile->get_fsowner_name();392
394 echo '</td>';393 /**************** File group *********************/
395 }394 if( $UserSettings->get('fm_showfsgroup') )
396395 { // Show file owner
397 /**************** File group *********************/396 echo '<td class="fsgroup">';
398 if( $UserSettings->get('fm_showfsgroup') )397 echo $lFile->get_fsgroup_name();
399 { // Show file owner398 echo '</td>';
400 echo '<td class="fsgroup">';399 }
401 echo $lFile->get_fsgroup_name();400
402 echo '</td>';401 /***************** Action icons ****************/
403 }402 echo '<td class="actions lastcol">';
404403 if( $current_User->check_perm( 'files', 'edit' ) )
405 /***************** Action icons ****************/404 { // User can edit:
406 echo '<td class="actions lastcol">';405 if( $lFile->is_editable( $current_User->check_perm( 'files', 'all' ) ) )
407 if( $current_User->check_perm( 'files', 'edit' ) )406 {
408 { // User can edit:407 echo action_icon( T_('Edit file...'), 'edit', regenerate_url( 'fm_selected', 'action=edit_file&amp;fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ) );
409 if( $lFile->is_editable( $current_User->check_perm( 'files', 'all' ) ) )408 }
410 {409 else
411 echo action_icon( T_('Edit file...'), 'edit', regenerate_url( 'fm_selected', 'action=edit_file&amp;fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ) );410 {
412 }411 echo get_icon( 'edit', 'noimg' );
413 else412 }
414 {413 }
415 echo get_icon( 'edit', 'noimg' );414 echo action_icon( T_('Edit properties...'), 'properties', regenerate_url( 'fm_selected', 'action=edit_properties&amp;fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ) );
416 }415
417 }416 if( $current_User->check_perm( 'files', 'edit' ) )
418 echo action_icon( T_('Edit properties...'), 'properties', regenerate_url( 'fm_selected', 'action=edit_properties&amp;fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ) );417 { // User can edit:
419418 echo action_icon( T_('Rename'), 'rename', regenerate_url( 'fm_selected', 'action=rename&amp;fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ) );
420 if( $current_User->check_perm( 'files', 'edit' ) )419 echo action_icon( T_('Move'), 'move', regenerate_url( 'fm_mode,fm_sources,fm_sources_root', 'fm_mode=file_move&amp;fm_sources[]='.rawurlencode( $lFile->get_rdfp_rel_path() ).'&amp;fm_sources_root='.$fm_Filelist->_FileRoot->ID ) );
421 { // User can edit:420 echo action_icon( T_('Copy'), 'copy', regenerate_url( 'fm_mode,fm_sources,fm_sources_root', 'fm_mode=file_copy&amp;fm_sources[]='.rawurlencode( $lFile->get_rdfp_rel_path() ).'&amp;fm_sources_root='.$fm_Filelist->_FileRoot->ID ) );
422 echo action_icon( T_('Rename'), 'rename', regenerate_url( 'fm_selected', 'action=rename&amp;fm_selected[]='.rawurlencode($lFile->get_rdfp_rel_path()) ) );421 echo action_icon( T_('Delete'), 'delete', regenerate_url( 'fm_selected', 'action=delete&amp;fm_selected[]='.rawurlencode( $lFile->get_rdfp_rel_path() ) ) );
423 echo action_icon( T_('Move'), 'move', regenerate_url( 'fm_mode,fm_sources,fm_sources_root', 'fm_mode=file_move&amp;fm_sources[]='.rawurlencode( $lFile->get_rdfp_rel_path() ).'&amp;fm_sources_root='.$fm_Filelist->_FileRoot->ID ) );422 }
424 echo action_icon( T_('Copy'), 'copy', regenerate_url( 'fm_mode,fm_sources,fm_sources_root', 'fm_mode=file_copy&amp;fm_sources[]='.rawurlencode( $lFile->get_rdfp_rel_path() ).'&amp;fm_sources_root='.$fm_Filelist->_FileRoot->ID ) );423 echo '</td>';
425 echo action_icon( T_('Delete'), 'delete', regenerate_url( 'fm_selected', 'action=delete&amp;fm_selected[]='.rawurlencode( $lFile->get_rdfp_rel_path() ) ) );424 }
426 }425
427 echo '</td>';426 echo '</tr>';
428 }427
429428 $countFiles++;
430 echo '</tr>';429}
431430// End of file list..
432 $countFiles++;431
433 }432/**
434 // / End of file list..433 * @global integer Number of cols for the files table, 6 is minimum.
435434 */
436435$filetable_cols = 5
437 /**436 + (int)$fm_flatmode
438 * @global integer Number of cols for the files table, 6 is minimum.437 + (int)$UserSettings->get('fm_showtypes')
439 */438 + (int)($UserSettings->get('fm_showdate') != 'no')
440 $filetable_cols = 5439 + (int)$UserSettings->get('fm_showfsperms')
441 + (int)$fm_flatmode440 + (int)$UserSettings->get('fm_showfsowner')
442 + (int)$UserSettings->get('fm_showtypes')441 + (int)$UserSettings->get('fm_showfsgroup')
443 + (int)($UserSettings->get('fm_showdate') != 'no')442 + (int)$UserSettings->get('fm_imglistpreview');
444 + (int)$UserSettings->get('fm_showfsperms')443
445 + (int)$UserSettings->get('fm_showfsowner')444if( $countFiles == 0 )
446 + (int)$UserSettings->get('fm_showfsgroup')445{ // Filelist errors or "directory is empty"
447 + (int)$UserSettings->get('fm_imglistpreview');446 ?>
448447 <tr>
449448 <td class="firstcol">&nbsp;</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 */ ?>
450 if( $countFiles == 0 )449 <td class="lastcol" colspan="<?php echo $filetable_cols - 1 ?>" id="fileman_error">
451 { // Filelist errors or "directory is empty"450 <?php
451 if( ! $Messages->count('fl_error') )
452 { // no Filelist errors, the directory must be empty
453 $Messages->add( T_('No files found.')
454 .( $fm_Filelist->is_filtering() ? '<br />'.T_('Filter').': &laquo;'.$fm_Filelist->get_filter().'&raquo;' : '' ), 'fl_error' );
455 }
456 $Messages->display( '', '', true, 'fl_error', 'log_error' );
457 ?>
458 </td>
459 </tr>
460
461 <?php
462}
463else
464{
465 // -------------
466 // Footer with "check all", "with selected: ..":
467 // --------------
468 if( $popfor != 'attach' )
469 {
452 ?>470 ?>
453 <tr>471 <tr class="listfooter firstcol lastcol">
454 <td class="firstcol">&nbsp;</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 */ ?>472 <td colspan="<?php echo $filetable_cols ?>">
455 <td class="lastcol" colspan="<?php echo $filetable_cols - 1 ?>" id="fileman_error">
456 <?php473 <?php
457 if( ! $Messages->count('fl_error') )474 echo $Form->check_all();
458 { // no Filelist errors, the directory must be empty475
459 $Messages->add( T_('No files found.')476 $field_options = array();
460 .( $fm_Filelist->is_filtering() ? '<br />'.T_('Filter').': &laquo;'.$fm_Filelist->get_filter().'&raquo;' : '' ), 'fl_error' );477 $title_options = array();
461 }478 $caption_options = array();
462 $Messages->display( '', '', true, 'fl_error', 'log_error' );479
480 if( $mode != 'upload' && ($fm_Filelist->get_root_type() == 'collection' || !empty($Blog)) )
481 { // We are browsing files for a collection:
482 // fp> TODO: use current as default but let user choose into which blog he wants to post
483 $field_options['make_post'] = T_('Make one post (including all images)');
484 $field_options['make_posts'] = T_('Make multiple posts (1 per image)');
485 $title_options['default'] = T_('include if provided');
486 $caption_options['default'] = T_('include if provided');
487 }
488
489 if( $mode == 'upload' )
490 { // we are in a popup opened by the "Files" button
491 $field_options['float_left'] = T_('Float left');
492 $field_options['float_right'] = T_('Float right');
493 $field_options['centered'] = T_('Centered');
494 $field_options['inline'] = T_('In-line');
495 $title_options['default'] = T_('default');
496 $title_options['placeholder'] = T_('placeholder');
497 $title_options['none'] = T_('no title');
498 $caption_options['default'] = T_('default');
499 $caption_options['placeholder'] = T_('placeholder');
500 $caption_options['none'] = T_('no caption');
501 }
502
503 if( $popfor == '' )
504 {
505 if( $current_User->check_perm( 'files', 'edit' ) )
506 { // current user can edit files
507 $field_options['rename'] = T_('Rename files...');
508 $field_options['delete'] = T_('Delete files...');
509 // NOTE: No delete confirmation by javascript, we need to check DB integrity!
510 }
511 // BROKEN ?
512 $field_options['download'] = T_('Download files as ZIP archive...');
513
514 /* Not fully functional:
515 $field_options['copy'] = T_('Copy the selected files...');
516 $field_options['move'] = T_('Move the selected files...');
517 */
518 }
519
520 $Form->switch_layout( 'none' );
521 $Form->select_input_array( 'group_action', $action, $field_options, ' || <strong>'.T_('With selected files').'</strong>' );
522
523 if( $mode == 'upload' )
524 { // we are in a popup opened by the "Files" button
525 $Form->select_input_array( 'title_action', 'default', $caption_options, ' <strong>'.T_('title').'</strong>' );
526 $Form->select_input_array( 'caption_action', 'default', $caption_options, ' <strong>'.T_('caption').'</strong>' );
527 }
528 // The "go" button gives us what to do with the file, title, and caption for all files
529 $Form->submit_input( array( 'name'=>'actionArray[group_action][title_action][caption_action]', 'value'=>T_('Go!'), 'onclick'=>'return js_act_on_selected();' ) );
530 $Form->switch_layout( NULL );
463 ?>531 ?>
464 </td>532 </td>
465 </tr>533 </tr>
466
467 <?php534 <?php
468 }535 }
469 else536}
470 {537?>
471 // -------------538</tbody>
472 // Footer with "check all", "with selected: ..":
473 // --------------
474 if( $popfor != 'attach' )
475 {
476 ?>
477 <tr class="listfooter firstcol lastcol">
478 <td colspan="<?php echo $filetable_cols ?>">
479 <?php
480 echo $Form->check_all();
481
482 $field_options = array();
483
484 if( $mode != 'upload' && ($fm_Filelist->get_root_type() == 'collection' || !empty($Blog)) )
485 { // We are browsing files for a collection:
486 // fp> TODO: use current as default but let user choose into which blog he wants to post
487 $field_options['make_post'] = T_('Make one post (including all images)');
488 $field_options['make_posts'] = T_('Make multiple posts (1 per image)');
489 }
490
491 if( $mode == 'upload' )
492 { // we are in a popup opened by the "Files" button
493 $field_options['img_tag_left'] = T_('Insert IMG/link into post float:left');
494 $field_options['img_tag'] = T_('Insert IMG/link into post in a div');
495 $field_options['img_tag_right'] = T_('Insert IMG/link into post float:right');
496 }
497
498 if( $popfor == '' )
499 {
500 if( $current_User->check_perm( 'files', 'edit' ) )
501 { // current user can edit files
502 $field_options['rename'] = T_('Rename files...');
503 $field_options['delete'] = T_('Delete files...');
504 // NOTE: No delete confirmation by javascript, we need to check DB integrity!
505 }
506 // BROKEN ?
507 $field_options['download'] = T_('Download files as ZIP archive...');
508
509 /* Not fully functional:
510 $field_options['copy'] = T_('Copy the selected files...');
511 $field_options['move'] = T_('Move the selected files...');
512 */
513 }
514
515 $Form->switch_layout( 'none' );
516 $Form->select_input_array( 'group_action', $action, $field_options, ' &mdash; <strong>'.T_('With selected files').'</strong>' );
517 $Form->submit_input( array( 'name'=>'actionArray[group_action]', 'value'=>T_('Go!'), 'onclick'=>'return js_act_on_selected();' ) );
518 $Form->switch_layout( NULL );
519
520 /*
521 fp> the following has been integrated into the select.
522 if( $mode == 'upload' )
523 { // We are uploading in a popup opened by an edit screen
524 ?>
525 &mdash;
526 <input class="ActionButton"
527 title="<?php echo T_('Insert IMG or link tags for the selected files, directly into the post text'); ?>"
528 name="actionArray[img_tag]"
529 value="<?php echo T_('Insert IMG/link into post') ?>"
530 type="submit"
531 onclick="insert_tag_for_selected_files(); return false;" />
532 <?php
533 }
534 */
535 ?>
536 </td>
537 </tr>
538 <?php
539 }
540 }
541 ?>
542 </tbody>
543</table>539</table>
544<?php540<?php
545 $Form->end_form();541$Form->end_form();
546542
547 if( $countFiles )543// allow a plugin to provide it's own $file_tags array
548 {{{ // include JS544global $Plugins;
549 // TODO: remove these javascript functions to an external .js file and include them through add_headline()545if( $plugin_return = $Plugins->trigger_event_first_return( 'ItemInsertFileJavascript' ) )
550 ?>546{
551 <script type="text/javascript">547 $editor_Plugin = & $Plugins->get_by_ID( $plugin_return['plugin_ID'] );
552 <!--548 $file_tags = $plugin_return['plugin_return'];
553 function js_act_on_selected()549}
554 {550// if we don't have one, we need one
555 // There may be an easier selector than below but couldn't make sense of it :(551if( ! isset( $file_tags ) )
556 selected_value = jQuery('#group_action option:selected').attr('value');552{
557 if( selected_value == 'img_tag_left' )553 $file_tags = array(
558 {554 'insert_tag' => 'span',
559 insert_tag_for_selected_files( 'left' );555 'insert_class_floats' => 'FLOATDIRECTION center',
560 return false;556 'insert_class_centered' => 'image_block',
561 }557 'insert_style_floats' => 'STYLEWIDTH',
562 if( selected_value == 'img_tag' )558 'insert_style_centered' => '',
563 {559 'title_tag' => 'span',
564 insert_tag_for_selected_files( false );560 'title_class' => 'image_title',
565 return false;561 'title_style' => '',
566 }562 'title_post' => '<br />',
567 if( selected_value == 'img_tag_right' )563 'image_pre' => '',
568 {564 'image_class' => 'center',
569 insert_tag_for_selected_files( 'right' );565 'image_style' => '',
570 return false;566 'image_post' => '',
571 }567 'caption_pre' => '<br />',
572 // other actions:568 'caption_tag' => 'span',
569 'caption_class' => 'image_legend',
570 'caption_style' => '',
571 'caption_post' => '',
572 'caption_none' => '',
573 'caption_separator' => '',
574 );
575}
576
577/**
578 * @todo (legacy): remove these javascript functions to an external .js file and include them through add_headline()
579 */
580if( $countFiles )
581{{{ // include JS
582 ?>
583 <script type="text/javascript">
584 <!--
585 /**
586 * Prepare for inserting images or file links into the item/post
587 */
588 function js_act_on_selected()
589 {
590 // There may be an easier selector than below but couldn't make sense of it :(
591 disp_value = jQuery('#group_action option:selected').attr('value');
592 title_action = jQuery('#title_action option:selected').attr('value');
593 caption_action = jQuery('#caption_action option:selected').attr('value');
594
595 if( disp_value == 'float_left' )
596 {
597 insert_tag_for_selected_files( 'float', 'left', title_action, caption_action );
598 return false;
599 }
600 if( disp_value == 'float_right' )
601 {
602 insert_tag_for_selected_files( 'float', 'right', title_action, caption_action );
603 return false;
604 }
605 if( disp_value == 'centered' )
606 {
607 insert_tag_for_selected_files( 'center', 'center', title_action, caption_action );
608 return false;
609 }
610 if( disp_value == 'inline' )
611 {
612 insert_tag_for_selected_files( 'inline', 'inline', title_action, caption_action );
613 return false;
614 }
615
616 // other actions:
617 return true;
618 }
619
620 /**
621 * Check if files are selected. This should be used as "onclick" handler for
622 * "With selected" actions (onclick="return check_if_selected_files();").
623 * @return boolean true, if something is selected, false if not.
624 */
625 function check_if_selected_files()
626 {
627 elems = document.getElementsByName( 'fm_selected[]' );
628 var checked = 0;
629 for( i = 0; i < elems.length; i++ )
630 {
631 if( elems[i].checked )
632 {
633 checked++;
634 }
635 }
636 if( !checked )
637 {
638 alert( '<?php echo TS_('Nothing selected.') ?>' );
639 return false;
640 }
641 else
642 {
643 return true;
644 }
645 }
646
647 /**
648 * Insert IMG tags into parent window for selected files
649 */
650 function insert_tag_for_selected_files( what, where, title_action, caption_action )
651 {
652 var elems = document.getElementsByName( 'fm_selected[]' );
653 var snippet = '';
654
655 // these values might come from an editor plugin :)
656 var insert_tag = '<?php echo $file_tags['insert_tag']; ?>';
657 if( what == 'float' )
658 {
659 var insert_class = '<?php echo $file_tags['insert_class_floats']; ?>';
660 var insert_style = '<?php echo $file_tags['insert_style_floats']; ?>';
661 }
662 else if( what == 'center' )
663 {
664 var insert_class = '<?php echo $file_tags['insert_class_centered']; ?>';
665 var insert_style = '<?php echo $file_tags['insert_style_centered']; ?>';
666 }
667 var title_open = '<?php echo $file_tags['title_tag']; ?>';
668 var title_class = '<?php echo $file_tags['title_class']; ?>';
669 var title_style = '<?php echo $file_tags['title_style']; ?>';
670 var title_post = '<?php echo $file_tags['title_post']; ?>';
671 var image_pre = '<?php echo $file_tags['image_pre']; ?>';
672 var image_class = '<?php echo $file_tags['image_class']; ?>';
673 var image_style = '<?php echo $file_tags['image_style']; ?>';
674 var image_post = '<?php echo $file_tags['image_post']; ?>';
675 var caption_pre = '<?php echo $file_tags['caption_pre']; ?>';
676 var caption_tag = '<?php echo $file_tags['caption_tag']; ?>';
677 var caption_class = '<?php echo $file_tags['caption_class']; ?>';
678 var caption_style = '<?php echo $file_tags['caption_style']; ?>';
679 var caption_post = '<?php echo $file_tags['caption_post']; ?>';
680 var caption_separator = '<?php echo $file_tags['caption_separator']; ?>';
681
682 var snippet = ''; // this is what we will eventually insert into the item
683 for( i = 0; i < elems.length; i++ )
684 {
685 if( elems[i].checked )
686 {
687 id = elems[i].id.substring( elems[i].id.lastIndexOf('_')+1, elems[i].id.length );
688 link_value = document.getElementById( 'link_'+id ).value;
689 title_value = document.getElementById( 'title_'+id ).value;
690 alttxt_value = document.getElementById( 'alttxt_'+id ).value;
691 caption_value = document.getElementById( 'caption_'+id ).value;
692 dimens_value = document.getElementById( 'dimens_'+id ).value;
693
694 // ensure we have both a title_value and an alttxt_value
695 var link_array = link_value.split( "/" );
696 var filename = link_array.pop();
697
698 // dimens_value effectively tells us if we have an image or not
699 if( dimens_value == '' )
700 { // this is a non-image ... and it needs a lot of help but not now. images first...
701
702 if( title_value == '' ) { title_value = filename; }
703 if( alttxt_value == '' ) { alttxt_value = '<?php echo TS_('Link to ') ?>' + filename; }
704 snippet += '<a href="' + link_value + '" title="' + alttxt_value + '">' + title_value + '</a> ';
705 }
706 else
707 { // THIS IS AN IMAGE FILE - WOOHOO!
708 // prep work - set some variables we'll need along the way
709 var dims_arr = dimens_value.split( "x" ); // this is the image width
710 var calculated_width = Math.round( parseFloat( dims_arr[0] ) + 12 );
711 var image_tag = ''; // for first build
712 var begin_block = ''; // for second build
713 var end_block = ''; // for second build
714 var title_html = ''; // for third build
715 var caption_html = ''; // for fourth build
716
717 // FIRST BUILD: the image tag. inserts, floats, and centered will all use the image tag
718 image_tag = '<img src="' + link_value + '"';
719 if( alttxt_value == '' ) { alttxt_value = filename; }
720 image_tag += ' alt="' + alttxt_value + '"';
721 image_tag += ' width="' + dims_arr[0] + '" height="' + dims_arr[1] + '"';
722 if( image_class != '' ) { image_tag += ' class="' + image_class + '"'; }
723 if( what != 'inline' && image_style != '' ) { image_tag += ' style="' + image_style + '"'; }
724 image_tag += ' />';
725 // for floats and centered we might have pre- and post- stuff to add
726 if( what == 'float' || what == 'center' )
727 {
728 image_tag = image_pre + image_tag + image_post;
729 }
730
731 // SECOND BUILD: the overall insertion block (only floats and centered)
732 if( what == 'float' || what == 'center' )
733 {
734 begin_block = '<' + insert_tag;
735 if( insert_class != '' ) { begin_block += ' class="' + insert_class + '"'; }
736 if( insert_style != '' ) { begin_block += ' style="' + insert_style + '"'; }
737 begin_block += '>';
738 var splitblocktag = insert_tag.split(" ");
739 end_block = '</' + splitblocktag[0] + '>';
740
741 // THIRD BUILD: a title block if desired (only floats and centered)
742 if( ( title_action == 'default' && title_value != '' ) || title_action == 'placeholder' )
743 { // we want the title and have one, or we want a placeholder
744 title_html = '<' + title_open;
745 if( title_class != '' ) { title_html += ' class="' + title_class + '"'; }
746 if( title_style != '' ) { title_html += ' style="' + title_style + '"'; }
747 title_html += '>';
748 if( title_action == 'placeholder' ) { title_value = '<?php echo TS_('TITLE PLACEHOLDER') ?>'; }
749 var splittitletag = title_open.split(" ");
750 title_html += title_value + '</' + splittitletag[0] + '>';
751 title_html += title_post;
752 }
753
754 // FOURTH BUILD: a caption block if desired
755 if( ( caption_action == 'default' && caption_value != '' ) || caption_action == 'placeholder' )
756 { // we want the caption and have one, or we want a placeholder
757 caption_html = caption_pre + '<' + caption_tag;
758 if( caption_class != '' ) { caption_html += ' class="' + caption_class + '"'; }
759 if( caption_style != '' ) { caption_html += ' style="' + caption_style + '"'; }
760 caption_html += '>';
761 if( caption_action == 'placeholder' ) { caption_value = '<?php echo TS_('CAPTION PLACEHOLDER') ?>'; }
762 var splitcaptiontag = caption_tag.split(" ");
763 caption_html += caption_value + '</' + splitcaptiontag[0] + '>';
764 caption_html += caption_post + caption_separator;
765 }
766 else
767 { // we need the "splitter" for TinyMCE and maybe others one day
768 caption_html = caption_none + caption_separator;
769 }
770
771 } // end floats and centered
772
773 // build the snippet and replace some things...
774 snippet += begin_block + title_html + image_tag + caption_html + end_block + ' ';
775 snippet = snippet.replace( /FLOATDIRECTION/g, 'float' + where );
776 snippet = snippet.replace( /STYLEWIDTH/g, 'width:' + calculated_width + 'px;' );
777 snippet = snippet.replace( /WIDTHONLY/g, calculated_width );
778
779 } // end 'this is an image'
780
781 } // end elems.checked
782
783 } // end for each elem
784
785 // check it...
786 if( ! snippet.length )
787 { // eh?
788 alert( '<?php echo TS_('You must select at least one file!') ?>' );
789 return false;
790 }
791 else
792 { // ship it!
793 if (! (window.focus && window.opener))
794 {
795 self.close();
573 return true;796 return true;
574 }797 }
575798 window.opener.focus();
576 /**799 textarea_wrap_selection( window.opener.document.getElementById("itemform_post_content"), snippet, '', 1, window.opener.document );
577 * Check if files are selected.800 self.close();
578 *801 return true;
579 * This should be used as "onclick" handler for "With selected" actions (onclick="return check_if_selected_files();").802 }
580 * @return boolean true, if something is selected, false if not.803
581 */804 }
582 function check_if_selected_files()805 // -->
583 {806 </script>
584 elems = document.getElementsByName( 'fm_selected[]' );807 <?php
585 var checked = 0;
586 for( i = 0; i < elems.length; i++ )
587 {
588 if( elems[i].checked )
589 {
590 checked++;
591 }
592 }
593 if( !checked )
594 {
595 alert( '<?php echo TS_('Nothing selected.') ?>' );
596 return false;
597 }
598 else
599 {
600 return true;
601 }
602 }
603
604 /**
605 * Insert IMG tags into parent window for selected files:
606 */
607 function insert_tag_for_selected_files( floatdir )
608 {
609 var elems = document.getElementsByName( 'fm_selected[]' );
610 var snippet = '';
611 for( i = 0; i < elems.length; i++ )
612 {
613 if( elems[i].checked )
614 {
615 id = elems[i].id.substring( elems[i].id.lastIndexOf('_')+1, elems[i].id.length );
616 img_tag_info_field = document.getElementById( 'img_tag_'+id ).value;
617 // floating left or right?
618 if( floatdir == 'left' || floatdir == 'right' )
619 {
620 var pre_caption = '';
621 var the_caption = '';
622 var image_class = floatdir+'margin';
623 var image_caption = img_tag_info_field.split( "image_legend\">" );
624 if( image_caption.length > 1 )
625 {
626 image_caption = image_caption[1];
627 the_caption = image_caption.split( "<\/div>" );
628 pre_caption = '<span class="imgwrap float'+floatdir+' center">';
629 the_caption = '<br /><span class="image_legend">'+the_caption[0]+'</span></span>';
630 image_class = 'spanimage';
631 }
632 img_tag_info_field = img_tag_info_field.replace(/^.*(<img.+?)( \/>).*$/, pre_caption+'$1 class="'+image_class+'"$2'+the_caption );
633 }
634 snippet += img_tag_info_field + ' ';
635 }
636 }
637 if( ! snippet.length )
638 {
639 alert( '<?php echo TS_('You must select at least one file!') ?>' );
640 return false;
641 }
642 else
643 {
644 if (! (window.focus && window.opener))
645 {
646 self.close();
647 return true;
648 }
649 window.opener.focus();
650 textarea_wrap_selection( window.opener.document.getElementById("itemform_post_content"), snippet, '', 1, window.opener.document );
651 self.close();
652 return true;
653 }
654 }
655 // -->
656 </script>
657 <?php
658 }}}808 }}}
659?>809?>
660<!-- End of detailed file list -->810<!-- End of detailed file list but not the end of html comments in our code, obviously ;) -->
661<?php
662?>
663811
=== modified file 'qp_inc/plugins/_plugin.class.php'
--- qp_inc/plugins/_plugin.class.php 2011-02-01 17:45:46 +0000
+++ qp_inc/plugins/_plugin.class.php 2011-03-08 04:29:14 +0000
@@ -1347,6 +1347,16 @@
13471347
13481348
1349 /**1349 /**
1350 * Event handler: allows an editor plugin to write custom tags when inserting a file, usually an image.
1351 *
1352 * @return array Tags used to wrap files (usually images)
1353 */
1354 function ItemInsertFileJavascript()
1355 {
1356 }
1357
1358
1359 /**
1350 * Event handler: send a ping about a new item.1360 * Event handler: send a ping about a new item.
1351 *1361 *
1352 * @param array Associative array of parameters1362 * @param array Associative array of parameters
13531363
=== modified file 'qp_inc/plugins/model/_plugins_admin.class.php'
--- qp_inc/plugins/model/_plugins_admin.class.php 2011-01-31 22:13:02 +0000
+++ qp_inc/plugins/model/_plugins_admin.class.php 2011-03-08 04:29:14 +0000
@@ -166,6 +166,7 @@
166 'ItemCanComment' => 'Asks the plugin if an item can receive comments/feedback.',166 'ItemCanComment' => 'Asks the plugin if an item can receive comments/feedback.',
167 'ItemSendPing' => 'Send a ping to a service about new items.',167 'ItemSendPing' => 'Send a ping to a service about new items.',
168 'ItemViewsIncreased' => 'Called when the view counter of an item got increased.',168 'ItemViewsIncreased' => 'Called when the view counter of an item got increased.',
169 'ItemInsertFileJavascript' => 'Allows an editor plugin to write custom tags when inserting a file, usually an image.',
169170
170 '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.',171 '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.',
171172
172173
=== modified file 'qp_install/_functions_create.php'
--- qp_install/_functions_create.php 2010-12-31 12:12:03 +0000
+++ qp_install/_functions_create.php 2011-03-08 04:29:14 +0000
@@ -1058,7 +1058,7 @@
1058 // Insert a post into blog #1:1058 // Insert a post into blog #1:
1059 $now = date('Y-m-d H:i:s',installer_timestamp());1059 $now = date('Y-m-d H:i:s',installer_timestamp());
1060 $edited_Item = new Item();1060 $edited_Item = new Item();
1061 $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>1061 $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>
10621062
1063<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 &lt;div&gt; if you like.</p>1063<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 &lt;div&gt; if you like.</p>
10641064
10651065
=== modified file 'qp_plugins/tinymce_plugin/README.html'
--- qp_plugins/tinymce_plugin/README.html 2010-12-18 18:52:49 +0000
+++ qp_plugins/tinymce_plugin/README.html 2011-03-08 04:29:14 +0000
@@ -44,10 +44,42 @@
44<dt>Plugin Settings:</dt>44<dt>Plugin Settings:</dt>
45<dd><ul>45<dd><ul>
46<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>46<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>
47<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>
48<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>47<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>
49<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>48<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>
50</ul></dd>49</ul></dd>
50<dt>Insert Image Settings:</dt>
51<dd>Settings in blue are plain text only, settings in green allow html inputs<br />
52<strong>overall html block settings:</strong>
53<ul>
54<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>
55<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>
56<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>
57</ul>
58<strong>title section settings:</strong>
59<ul>
60<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>
61<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>
62<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>
63<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>
64</ul>
65<strong>image section settings:</strong>
66<ul>
67<li><span class="settings_c">pre-image</span>: This allows some html bits before the actual image tag. Default is <code>&lt;tbody>&lt;tr>&lt;td></code></li>
68<li><span class="settings_b">image class</span>: This is the class applied to the image tag. Default is <code>center</code></li>
69<li><span class="settings_b">image style</span>: This is the style applied to the image tag. Default is (blank)</li>
70<li><span class="settings_c">post-image</span>: This allows some html bits before the actual image tag. Default is (blank)</li>
71</ul>
72<strong>caption section settings:</strong>
73<ul>
74<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>&lt;/td>&lt;/tr>&lt;tr></code></li>
75<li><span class="settings_b">caption tag</span>: The tag for the actual caption section. Default is <code>td</code></li>
76<li><span class="settings_b">caption class</span>: This is the class applied to the caption tag. Default is <code>image_legend</code></li>
77<li><span class="settings_b">caption style</span>: This is the style applied to the caption tag. Default is (blank)</li>
78<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>
79<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>&lt;/td></code></li>
80<li><span class="settings_c">post caption separator</span>: This allows some html bits before closing the entire "insert image" block. Default is <code>&lt;/tr>&lt;/tbody></code></li>
81</ul></dd>
82
51<dt>User Settings:</dt>83<dt>User Settings:</dt>
52<dd><ul>84<dd><ul>
53<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>85<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>
@@ -69,11 +101,14 @@
69<dl>101<dl>
70<dt>More Info:</dt>102<dt>More Info:</dt>
71<dd><ul>103<dd><ul>
72<li>No additional information provided by the author.</li>104<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>
105<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>
106<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>
73</ul></dd>107</ul></dd>
74<dt>Credits:</dt>108<dt>Credits:</dt>
75<dd><ul>109<dd><ul>
76<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>110<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>
111<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>
77</ul></dd>112</ul></dd>
78<dt>Links:</dt>113<dt>Links:</dt>
79<dd><ul>114<dd><ul>
@@ -87,10 +122,11 @@
87<h2>Release History:</h2>122<h2>Release History:</h2>
88<div id="log">123<div id="log">
89<dl>124<dl>
125<dt>1.0</dt><dd>Uses new hook and settings to allow inserting in tables instead of spans (24-Feb-11)</dd>
90<dt>0.1</dt><dd>initial release (1-Jan-11)</dd>126<dt>0.1</dt><dd>initial release (1-Jan-11)</dd>
91</dl>127</dl>
92</div>128</div>
93129
94</div>130</div>
95</body>131</body>
96</html>
97\ No newline at end of file132\ No newline at end of file
133</html>
98134
=== modified file 'qp_plugins/tinymce_plugin/_tinymce.plugin.php'
--- qp_plugins/tinymce_plugin/_tinymce.plugin.php 2010-09-25 12:29:17 +0000
+++ qp_plugins/tinymce_plugin/_tinymce.plugin.php 2011-03-08 04:29:14 +0000
@@ -53,7 +53,9 @@
53 */53 */
54 function GetDefaultSettings( & $params )54 function GetDefaultSettings( & $params )
55 {55 {
56 return array(56 $plain_text_only = '<strong>'.T_('plain text only').'</strong>';
57 $html_allowed = '<strong class="red">'.T_('html allowed').'</strong>';
58 $default_settings = array(
57 'default_use_tinymce' => array(59 'default_use_tinymce' => array(
58 'label' => $this->T_('Use TinyMCE (default)'),60 'label' => $this->T_('Use TinyMCE (default)'),
59 'type' => 'checkbox',61 'type' => 'checkbox',
@@ -74,9 +76,258 @@
74 .'height : "400"',76 .'height : "400"',
75 '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"' ),77 '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"' ),
76 ),78 ),
79 'primary_start' => array(
80 'label' => $this->T_('Insert Image Settings'),
81 'layout' => 'begin_fieldset',
82 ),
83 'primary_info' => array(
84 'label' => $this->T_('WARNING'),
85 'type' => 'info',
86 '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>'),
87 ),
88 'primary_info_b' => array(
89 'label' => $this->T_('Info'),
90 'type' => 'info',
91 '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>'),
92 ),
93 'overallblock_start' => array(
94 'label' => $this->T_('overall html block settings'),
95 'layout' => 'begin_fieldset',
96 ),
97 'overallblock_info' => array(
98 'label' => $this->T_('Info'),
99 'type' => 'info',
100 'info' => $this->T_('These are for the entire inserted html block (title if present, image, and caption if present).'),
101 ),
102 'insert_tag' => array(
103 'label' => $this->T_('insert tag'),
104 'type' => 'text',
105 'size' => 64,
106 'defaultvalue' => 'table align="center" width="WIDTHONLY"',
107 'note' => '<br />'.$plain_text_only,
108 ),
109 'insert_class_floats' => array(
110 'label' => $this->T_('insert class (floats)'),
111 'type' => 'text',
112 'size' => 64,
113 'defaultvalue' => 'FLOATDIRECTION',
114 'note' => '<br />'.$plain_text_only,
115 ),
116 'insert_class_centered' => array(
117 'label' => $this->T_('insert class (centered)'),
118 'type' => 'text',
119 'size' => 64,
120 'defaultvalue' => 'image_block center',
121 'note' => '<br />'.$plain_text_only,
122 ),
123 'insert_style_floats' => array(
124 'label' => $this->T_('insert style (floats)'),
125 'type' => 'text',
126 'size' => 64,
127 'defaultvalue' => '',
128 'note' => '<br />'.$plain_text_only,
129 ),
130 'insert_style_centered' => array(
131 'label' => $this->T_('insert style (centered)'),
132 'type' => 'text',
133 'size' => 64,
134 'defaultvalue' => '',
135 'note' => '<br />'.$plain_text_only,
136 ),
137 'overallblock_end' => array( 'layout' => 'end_fieldset' ),
138
139 'titlesection_start' => array(
140 'label' => $this->T_('title section settings'),
141 'layout' => 'begin_fieldset',
142 ),
143 'titlesection_info' => array(
144 'label' => $this->T_('Info'),
145 'type' => 'info',
146 'info' => $this->T_('These are used only if the title is displayed ("default" and a title exists, or "placeholder").'),
147 ),
148 'title_tag' => array(
149 'label' => $this->T_('title tag'),
150 'type' => 'text',
151 'size' => 64,
152 'defaultvalue' => 'caption',
153 'note' => '<br />'.$plain_text_only,
154 ),
155 'title_class' => array(
156 'label' => $this->T_('title class'),
157 'type' => 'text',
158 'size' => 64,
159 'defaultvalue' => 'image_title',
160 'note' => '<br />'.$plain_text_only,
161 ),
162 'title_style' => array(
163 'label' => $this->T_('title style'),
164 'type' => 'text',
165 'size' => 64,
166 'defaultvalue' => '',
167 'note' => '<br />'.$plain_text_only,
168 ),
169 'title_post' => array(
170 'label' => $this->T_('post-title'),
171 'type' => 'html_textarea', // allows "<"
172 'rows' => 1,
173 'cols' => 60,
174 'defaultvalue' => '',
175 'note' => $this->T_('added after closing the "title tag" ONLY IF there is a title').' &middot; '.$html_allowed,
176 ),
177 'titlesection_end' => array( 'layout' => 'end_fieldset' ),
178 'imagesection_start' => array(
179 'label' => $this->T_('image section settings'),
180 'layout' => 'begin_fieldset',
181 ),
182 'imagesection_info' => array(
183 'label' => $this->T_('Info'),
184 'type' => 'info',
185 'info' => $this->T_('These settings affect the actual IMG tag, including possible code before and after the image tag.'),
186 ),
187 'imagesection_pre_start' => array(
188 'label' => $this->T_('before the image tag'),
189 'layout' => 'begin_fieldset',
190 ),
191 'imagesection_pre_info' => array(
192 'label' => $this->T_('Info'),
193 'type' => 'info',
194 'info' => $this->T_('This is used between the title section and the image tag, even if there is no title section displayed.'),
195 ),
196 'image_pre' => array(
197 'label' => $this->T_('pre-image'),
198 'type' => 'html_textarea', // allows "<"
199 'rows' => 1,
200 'cols' => 60,
201 'defaultvalue' => '<tbody><tr><td>',
202 'note' => $html_allowed,
203 ),
204 'imagesection_pre_end' => array( 'layout' => 'end_fieldset' ),
205 'imagesection_attribs_start' => array(
206 'label' => $this->T_('image tag attributes'),
207 'layout' => 'begin_fieldset',
208 ),
209 'image_class' => array(
210 'label' => $this->T_('image class'),
211 'type' => 'text',
212 'size' => 64,
213 'defaultvalue' => 'center',
214 'note' => '<br />'.$this->T_('class value for the IMG tag').' &middot; '.$plain_text_only,
215 ),
216 'image_style' => array(
217 'label' => $this->T_('image style'),
218 'type' => 'text',
219 'size' => 64,
220 'defaultvalue' => '',
221 'note' => '<br />'.$this->T_('style value for the IMG tag').' &middot; '.$plain_text_only,
222 ),
223 'imagesection_attribs_end' => array( 'layout' => 'end_fieldset' ),
224 'imagesection_post_start' => array(
225 'label' => $this->T_('after the image tag'),
226 'layout' => 'begin_fieldset',
227 ),
228 'imagesection_post_info' => array(
229 'label' => $this->T_('Info'),
230 'type' => 'info',
231 'info' => $this->T_('This is used between the image tag and the caption section, even if there is no caption section displayed.'),
232 ),
233 'image_post' => array(
234 'label' => $this->T_('post-image'),
235 'type' => 'html_textarea', // allows "<"
236 'rows' => 1,
237 'cols' => 60,
238 'defaultvalue' => '',
239 'note' => $html_allowed,
240 ),
241 'imagesection_post_end' => array( 'layout' => 'end_fieldset' ),
242 'imagesection_end' => array( 'layout' => 'end_fieldset' ),
243 'captionsection_start' => array(
244 'label' => $this->T_('caption section settings'),
245 'layout' => 'begin_fieldset',
246 ),
247 'captionsection_info' => array(
248 'label' => $this->T_('Info'),
249 'type' => 'info',
250 'info' => $this->T_('These are used only if the caption is displayed ("default" and a caption exists, or "placeholder").'),
251 ),
252 'caption_pre' => array(
253 'label' => $this->T_('pre-caption'),
254 'type' => 'html_textarea', // allows "<"
255 'rows' => 1,
256 'cols' => 60,
257 'defaultvalue' => '</td></tr><tr>',
258 'note' => $this->T_('before the caption section tag').' &middot; '.$html_allowed,
259 ),
260 'caption_tag' => array(
261 'label' => $this->T_('caption tag'),
262 'type' => 'text',
263 'size' => 64,
264 'defaultvalue' => 'td',
265 'note' => '<br />'.$plain_text_only,
266 ),
267 'caption_class' => array(
268 'label' => $this->T_('caption class'),
269 'type' => 'text',
270 'size' => 64,
271 'defaultvalue' => 'image_legend',
272 'note' => '<br />'.$plain_text_only,
273 ),
274 'caption_style' => array(
275 'label' => $this->T_('caption style'),
276 'type' => 'text',
277 'size' => 64,
278 'defaultvalue' => '',
279 'note' => '<br />'.$plain_text_only,
280 ),
281 'caption_post' => array(
282 'label' => $this->T_('post-caption'),
283 'type' => 'html_textarea', // allows "<"
284 'rows' => 1,
285 'cols' => 60,
286 'defaultvalue' => '',
287 'note' => $this->T_('used after closing the caption tag').' &middot; '.$html_allowed,
288 ),
289 'nocaption_start' => array(
290 'label' => $this->T_('no caption displayed'),
291 'layout' => 'begin_fieldset',
292 ),
293 'nocaption_info' => array(
294 'label' => $this->T_('Info'),
295 'type' => 'info',
296 'info' => $this->T_('This is used only if there is no caption present (useful for TinyMCE)'),
297 ),
298 'caption_none' => array(
299 'label' => $this->T_('NO caption'),
300 'type' => 'html_textarea', // allows "<"
301 'rows' => 1,
302 'cols' => 60,
303 'defaultvalue' => '</td>',
304 'note' => $html_allowed,
305 ),
306 'nocaption_end' => array( 'layout' => 'end_fieldset' ),
307 'captionsplitter_start' => array(
308 'label' => $this->T_('Caption -> Closing separator'),
309 'layout' => 'begin_fieldset',
310 ),
311 'captionsplitter_info' => array(
312 'label' => $this->T_('Info'),
313 'type' => 'info',
314 'info' => $this->T_('This is used between the caption section and the overall block closing, even if there is no caption section displayed.'),
315 ),
316 'caption_separator' => array(
317 'label' => $this->T_('post caption separator'),
318 'type' => 'html_textarea', // allows "<"
319 'rows' => 1,
320 'cols' => 60,
321 'defaultvalue' => '</tr></tbody>',
322 'note' => $html_allowed,
323 ),
324 'captionsplitter_end' => array( 'layout' => 'end_fieldset' ),
325 'captionsection_end' => array( 'layout' => 'end_fieldset' ),
77 );326 );
327 return $default_settings;
78 }328 }
79329
330
80 /**331 /**
81 * @see Plugin::GetExtraEvents()332 * @see Plugin::GetExtraEvents()
82 *333 *
@@ -183,7 +434,7 @@
183 * @todo EdB: forcing expert to do away with simple but 'edit_layout' is still around (and still valuable?)434 * @todo EdB: forcing expert to do away with simple but 'edit_layout' is still around (and still valuable?)
184 *435 *
185 * <input id="tinymce_plugin_toggle_button" type="button" value="WYSIWYG" style="display:none"436 * <input id="tinymce_plugin_toggle_button" type="button" value="WYSIWYG" style="display:none"
186 * title="<?php echo htmlspecialchars($this->T_('Toggle between WYSIWYG and plain HTML editor')); ?>" />437 * title="<?php echo htmlspecialchars($this->T_('Toggle between WYSIWYG and plain HTML editor')); ?>" />
187 *438 *
188 */439 */
189 $tmce_init = $this->get_tmce_init( 'expert' );440 $tmce_init = $this->get_tmce_init( 'expert' );
@@ -327,26 +578,26 @@
327578
328 <?php579 <?php
329 if( is_object($edited_Item) && !empty($edited_Item->editor_code) )580 if( is_object($edited_Item) && !empty($edited_Item->editor_code) )
330 { // We have a preference for the current post, follow it:581 { // We have a preference for the current post, follow it:
331 // Use tinyMCE if code matched the code of the current plugin.582 // Use tinyMCE if code matched the code of the current plugin.
332 // 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.583 // 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.
333 $use_tinymce = ($edited_Item->editor_code == $this->code);584 $use_tinymce = ($edited_Item->editor_code == $this->code);
334 }585 }
335 else586 else
336 { // We have no pref, fall back to whatever current user has last used:587 { // We have no pref, fall back to whatever current user has last used:
337588
338 // Has the user used MCE last time he edited this particular blog?589 // Has the user used MCE last time he edited this particular blog?
339 $use_tinymce = $this->UserSettings->get('use_tinymce_coll'.$Blog->ID );590 $use_tinymce = $this->UserSettings->get('use_tinymce_coll'.$Blog->ID );
340591
341 if( is_null($use_tinymce) )592 if( is_null($use_tinymce) )
342 { // We don't know for this blog, check if he used MCE last time he edited anything:593 { // We don't know for this blog, check if he used MCE last time he edited anything:
343 $use_tinymce = $this->UserSettings->get('use_tinymce');594 $use_tinymce = $this->UserSettings->get('use_tinymce');
344 }595 }
345 }596 }
346597
347 if( $use_tinymce )598 if( $use_tinymce )
348 { // User used MCE last time, load MCE now:599 { // User used MCE last time, load MCE now:
349 // fp> why do we need to wrap in jQuery() here?600 // fp> why do we need to wrap in jQuery() here?
350 echo '<script type="text/javascript">jQuery( tinymce_plugin_toggleEditor("'.$this->tmce_editor_id.'") );</script>';601 echo '<script type="text/javascript">jQuery( tinymce_plugin_toggleEditor("'.$this->tmce_editor_id.'") );</script>';
351 }602 }
352603
@@ -487,7 +738,7 @@
487 $Template = $TemplateCache->get_by_ID( $Blog->template_ID );738 $Template = $TemplateCache->get_by_ID( $Blog->template_ID );
488 $item_css_url = $templates_url.$Template->folder.'/item.css';739 $item_css_url = $templates_url.$Template->folder.'/item.css';
489 // else: $item_css_url = $rsc_url.'css/item_base.css';740 // else: $item_css_url = $rsc_url.'css/item_base.css';
490 $content_css = ','.$item_css_url; // fp> TODO: this needs to be a param... "of course" -- if none: else item_default.css ?741 $content_css = ','.$item_css_url; // fp> TODO: this needs to be a param... "of course" -- if none: else item_default.css ?
491 }742 }
492 // else item_default.css -- is it still possible to have no template ?743 // else item_default.css -- is it still possible to have no template ?
493744
@@ -499,7 +750,7 @@
499 $init_options[] = 'entity_encoding : "raw"';750 $init_options[] = 'entity_encoding : "raw"';
500751
501 // remove_linebreaks : false,752 // remove_linebreaks : false,
502 // not documented: auto_cleanup_word : true,753 // not documented: auto_cleanup_word : true,
503754
504 $init = implode( ",\n", $init_options ).',755 $init = implode( ",\n", $init_options ).',
505 plugin_insertdate_dateFormat : "%Y-%m-%d",756 plugin_insertdate_dateFormat : "%Y-%m-%d",
@@ -538,7 +789,7 @@
538789
539 // fp>This is a super dirty hack that we're going to use only until we have a clean API for handling WYSIWYG editors:790 // fp>This is a super dirty hack that we're going to use only until we have a clean API for handling WYSIWYG editors:
540 if( !empty($params['item']) )791 if( !empty($params['item']) )
541 { // Save the status last used by this Item:792 { // Save the status last used by this Item:
542 // fp> TODO: also do that on CREATE post because it won't have been done here:793 // fp> TODO: also do that on CREATE post because it won't have been done here:
543 $sql = 'UPDATE T_items__item794 $sql = 'UPDATE T_items__item
544 SET post_editor_code = '.$DB->quote( (int)$params['on'] ? $this->code : 'html' )795 SET post_editor_code = '.$DB->quote( (int)$params['on'] ? $this->code : 'html' )
@@ -548,7 +799,7 @@
548799
549 // Clean:800 // Clean:
550 if( !empty($params['blog']) )801 if( !empty($params['blog']) )
551 { // This is in order to try & recall a specific state for each blog: (will be used for new posts especially)802 { // This is in order to try & recall a specific state for each blog: (will be used for new posts especially)
552 $this->UserSettings->set( 'use_tinymce_coll'.(int)$params['blog'], (int)$params['on'] );803 $this->UserSettings->set( 'use_tinymce_coll'.(int)$params['blog'], (int)$params['on'] );
553 }804 }
554 $this->UserSettings->set( 'use_tinymce', (int)$params['on'] );805 $this->UserSettings->set( 'use_tinymce', (int)$params['on'] );
@@ -564,6 +815,41 @@
564 return array('save_editor_state');815 return array('save_editor_state');
565 }816 }
566817
818
819 /**
820 * @see Plugin::ItemInsertFileJavascript()
821 */
822 function ItemInsertFileJavascript()
823 {
824 if( ! $this->UserSettings->get('use_tinymce') )
825 { // if this user does not use tinymce get out
826 return NULL;
827 }
828 // provide custom tag bits
829 return array(
830 'insert_tag' => $this->Settings->get('insert_tag'),
831 'insert_class_floats' => $this->Settings->get('insert_class_floats'),
832 'insert_class_centered' => $this->Settings->get('insert_class_centered'),
833 'insert_style_floats' => $this->Settings->get('insert_style_floats'),
834 'insert_style_centered' => $this->Settings->get('insert_style_centered'),
835 'title_tag' => $this->Settings->get('title_tag'),
836 'title_class' => $this->Settings->get('title_class'),
837 'title_style' => $this->Settings->get('title_style'),
838 'title_post' => $this->Settings->get('title_post'),
839 'image_pre' => $this->Settings->get('image_pre'),
840 'image_class' => $this->Settings->get('image_class'),
841 'image_style' => $this->Settings->get('image_style'),
842 'image_post' => $this->Settings->get('image_post'),
843 'caption_pre' => $this->Settings->get('caption_pre'),
844 'caption_tag' => $this->Settings->get('caption_tag'),
845 'caption_class' => $this->Settings->get('caption_class'),
846 'caption_style' => $this->Settings->get('caption_style'),
847 'caption_post' => $this->Settings->get('caption_post'),
848 'caption_none' => $this->Settings->get('caption_none'),
849 'caption_separator' => $this->Settings->get('caption_separator'),
850 );
851 }
852
567}853}
568854
569?>855?>
570856
=== modified file 'qp_plugins/tinymce_plugin/po/messages.pot'
--- qp_plugins/tinymce_plugin/po/messages.pot 2010-10-22 15:20:35 +0000
+++ qp_plugins/tinymce_plugin/po/messages.pot 2011-03-08 04:29:14 +0000
@@ -7,8 +7,8 @@
7msgid ""7msgid ""
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: http://quamplures.net/\n"10"Report-Msgid-Bugs-To: http://quam-plures.net/\n"
11"POT-Creation-Date: 2010-09-06 10:50-0700\n"11"POT-Creation-Date: 2011-02-23 22:32-0700\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -28,49 +28,253 @@
28msgid "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."28msgid "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."
29msgstr ""29msgstr ""
3030
31#: ../_tinymce.plugin.php:5831#: ../_tinymce.plugin.php:56
32msgid "plain text only"
33msgstr ""
34
35#: ../_tinymce.plugin.php:57
36msgid "html allowed"
37msgstr ""
38
39#: ../_tinymce.plugin.php:60
32msgid "Use TinyMCE (default)"40msgid "Use TinyMCE (default)"
33msgstr ""41msgstr ""
3442
35#: ../_tinymce.plugin.php:6143#: ../_tinymce.plugin.php:63
36msgid "This is the default, which users can override in their profile."44msgid "This is the default, which users can override in their profile."
37msgstr ""45msgstr ""
3846
39#: ../_tinymce.plugin.php:6447#: ../_tinymce.plugin.php:66
40#: ../_tinymce.plugin.php:13748#: ../_tinymce.plugin.php:388
41msgid "Directionality support"49msgid "Directionality support"
42msgstr ""50msgstr ""
4351
44#: ../_tinymce.plugin.php:6752#: ../_tinymce.plugin.php:69
45msgid "Enable to add directionality icons to TinyMCE for better handling of right-to-left languages"53msgid "Enable to add directionality icons to TinyMCE for better handling of right-to-left languages"
46msgstr ""54msgstr ""
4755
48#: ../_tinymce.plugin.php:7056#: ../_tinymce.plugin.php:72
49msgid "Custom TinyMCE init"57msgid "Custom TinyMCE init"
50msgstr ""58msgstr ""
5159
52#: ../_tinymce.plugin.php:7560#: ../_tinymce.plugin.php:77
53#, php-format61#, php-format
54msgid "Custom parameters to tinyMCE.init(). See the <a %s>TinyMCE manual</a>."62msgid "Custom parameters to tinyMCE.init(). See the <a %s>TinyMCE manual</a>."
55msgstr ""63msgstr ""
5664
57#: ../_tinymce.plugin.php:13065#: ../_tinymce.plugin.php:80
66msgid "Insert Image Settings"
67msgstr ""
68
69#: ../_tinymce.plugin.php:84
70msgid "WARNING"
71msgstr ""
72
73#: ../_tinymce.plugin.php:86
74msgid "<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>"
75msgstr ""
76
77#: ../_tinymce.plugin.php:89
78#: ../_tinymce.plugin.php:98
79#: ../_tinymce.plugin.php:144
80#: ../_tinymce.plugin.php:183
81#: ../_tinymce.plugin.php:192
82#: ../_tinymce.plugin.php:229
83#: ../_tinymce.plugin.php:248
84#: ../_tinymce.plugin.php:294
85#: ../_tinymce.plugin.php:312
86msgid "Info"
87msgstr ""
88
89#: ../_tinymce.plugin.php:91
90msgid "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>"
91msgstr ""
92
93#: ../_tinymce.plugin.php:94
94msgid "overall html block settings"
95msgstr ""
96
97#: ../_tinymce.plugin.php:100
98msgid "These are for the entire inserted html block (title if present, image, and caption if present)."
99msgstr ""
100
101#: ../_tinymce.plugin.php:103
102msgid "insert tag"
103msgstr ""
104
105#: ../_tinymce.plugin.php:110
106msgid "insert class (floats)"
107msgstr ""
108
109#: ../_tinymce.plugin.php:117
110msgid "insert class (centered)"
111msgstr ""
112
113#: ../_tinymce.plugin.php:124
114msgid "insert style (floats)"
115msgstr ""
116
117#: ../_tinymce.plugin.php:131
118msgid "insert style (centered)"
119msgstr ""
120
121#: ../_tinymce.plugin.php:140
122msgid "title section settings"
123msgstr ""
124
125#: ../_tinymce.plugin.php:146
126msgid "These are used only if the title is displayed (\"default\" and a title exists, or \"placeholder\")."
127msgstr ""
128
129#: ../_tinymce.plugin.php:149
130msgid "title tag"
131msgstr ""
132
133#: ../_tinymce.plugin.php:156
134msgid "title class"
135msgstr ""
136
137#: ../_tinymce.plugin.php:163
138msgid "title style"
139msgstr ""
140
141#: ../_tinymce.plugin.php:170
142msgid "post-title"
143msgstr ""
144
145#: ../_tinymce.plugin.php:175
146msgid "added after closing the \"title tag\" ONLY IF there is a title"
147msgstr ""
148
149#: ../_tinymce.plugin.php:179
150msgid "image section settings"
151msgstr ""
152
153#: ../_tinymce.plugin.php:185
154msgid "These settings affect the actual IMG tag, including possible code before and after the image tag."
155msgstr ""
156
157#: ../_tinymce.plugin.php:188
158msgid "before the image tag"
159msgstr ""
160
161#: ../_tinymce.plugin.php:194
162msgid "This is used between the title section and the image tag, even if there is no title section displayed."
163msgstr ""
164
165#: ../_tinymce.plugin.php:197
166msgid "pre-image"
167msgstr ""
168
169#: ../_tinymce.plugin.php:206
170msgid "image tag attributes"
171msgstr ""
172
173#: ../_tinymce.plugin.php:210
174msgid "image class"
175msgstr ""
176
177#: ../_tinymce.plugin.php:214
178msgid "class value for the IMG tag"
179msgstr ""
180
181#: ../_tinymce.plugin.php:217
182msgid "image style"
183msgstr ""
184
185#: ../_tinymce.plugin.php:221
186msgid "style value for the IMG tag"
187msgstr ""
188
189#: ../_tinymce.plugin.php:225
190msgid "after the image tag"
191msgstr ""
192
193#: ../_tinymce.plugin.php:231
194msgid "This is used between the image tag and the caption section, even if there is no caption section displayed."
195msgstr ""
196
197#: ../_tinymce.plugin.php:234
198msgid "post-image"
199msgstr ""
200
201#: ../_tinymce.plugin.php:244
202msgid "caption section settings"
203msgstr ""
204
205#: ../_tinymce.plugin.php:250
206msgid "These are used only if the caption is displayed (\"default\" and a caption exists, or \"placeholder\")."
207msgstr ""
208
209#: ../_tinymce.plugin.php:253
210msgid "pre-caption"
211msgstr ""
212
213#: ../_tinymce.plugin.php:258
214msgid "before the caption section tag"
215msgstr ""
216
217#: ../_tinymce.plugin.php:261
218msgid "caption tag"
219msgstr ""
220
221#: ../_tinymce.plugin.php:268
222msgid "caption class"
223msgstr ""
224
225#: ../_tinymce.plugin.php:275
226msgid "caption style"
227msgstr ""
228
229#: ../_tinymce.plugin.php:282
230msgid "post-caption"
231msgstr ""
232
233#: ../_tinymce.plugin.php:287
234msgid "used after closing the caption tag"
235msgstr ""
236
237#: ../_tinymce.plugin.php:290
238msgid "no caption displayed"
239msgstr ""
240
241#: ../_tinymce.plugin.php:296
242msgid "This is used only if there is no caption present (useful for TinyMCE)"
243msgstr ""
244
245#: ../_tinymce.plugin.php:299
246msgid "NO caption"
247msgstr ""
248
249#: ../_tinymce.plugin.php:308
250msgid "Caption -> Closing separator"
251msgstr ""
252
253#: ../_tinymce.plugin.php:314
254msgid "This is used between the caption section and the overall block closing, even if there is no caption section displayed."
255msgstr ""
256
257#: ../_tinymce.plugin.php:317
258msgid "post caption separator"
259msgstr ""
260
261#: ../_tinymce.plugin.php:381
58msgid "Use TinyMCE"262msgid "Use TinyMCE"
59msgstr ""263msgstr ""
60264
61#: ../_tinymce.plugin.php:133265#: ../_tinymce.plugin.php:384
62msgid "Check this to enable the extended Javascript editor (TinyMCE)."266msgid "Check this to enable the extended Javascript editor (TinyMCE)."
63msgstr ""267msgstr ""
64268
65#: ../_tinymce.plugin.php:140269#: ../_tinymce.plugin.php:391
66msgid "Enable to add directionality icons to TinyMCE that enables TinyMCE to better handle languages that are written from right to left."270msgid "Enable to add directionality icons to TinyMCE that enables TinyMCE to better handle languages that are written from right to left."
67msgstr ""271msgstr ""
68272
69#: ../_tinymce.plugin.php:260273#: ../_tinymce.plugin.php:511
70#, php-format274#, php-format
71msgid "TinyMCE javascript could not be loaded. Check the \"%s\" plugin setting."275msgid "TinyMCE javascript could not be loaded. Check the \"%s\" plugin setting."
72msgstr ""276msgstr ""
73277
74#: ../_tinymce.plugin.php:261278#: ../_tinymce.plugin.php:512
75msgid "URL to TinyMCE"279msgid "URL to TinyMCE"
76msgstr ""280msgstr ""
77281
=== modified file 'qp_rsc/css/basic.css'
--- qp_rsc/css/basic.css 2010-08-17 07:33:35 +0000
+++ qp_rsc/css/basic.css 2011-03-08 04:29:14 +0000
@@ -1,6 +1,7 @@
1/*1/*
2 * Obviously, this file no longer contains only basic styles.2 * Obviously, this file no longer contains only basic styles.
3 * It now also contains all sorts of base styles like the toolbar and debug for backward comaptibility with older templates... :/3 * It now also contains all sorts of base styles like the toolbar
4 * and debug for backward comaptibility with older templates... :/
4 */5 */
56
6@import url("basic_styles.css"); /* Import the REAL basic styles */7@import url("basic_styles.css"); /* Import the REAL basic styles */
@@ -10,9 +11,7 @@
10 margin: 0;11 margin: 0;
11}12}
1213
13/**14/* Image styles */
14 * Image styles
15 */
16img {15img {
17 border: none;16 border: none;
18}17}
@@ -38,27 +37,48 @@
38 border: 1px solid #ccc;37 border: 1px solid #ccc;
39}38}
4039
41div.image_block {40div.bImages, .image_block {
42/* WARNING: this will screw out backoffice layout (fulltext edit screen) in firefox!
43 overflow: hidden; */
44 text-align: center;41 text-align: center;
45}42}
43.image_block {
44 clear: both;
45 display: block;
46}
47
48.image_block img {
49 margin: 1ex;
50}
51
52.image_block .image_legend {
53 display: block;
54}
4655
47/* We only float image_blocks when in multiple image zone */56/* We only float image_blocks when in multiple image zone */
48div.multi_image_zone div.image_block {57div.multi_image_zone .image_block {
49 margin: 1ex;58 margin: 1ex;
50 float: left;59 float: left;
51}60}
5261
53div.image_block img {
54 margin: 1ex;
55}
56
57div.image_legend, .image_legend {62div.image_legend, .image_legend {
58 font-size: 84%;63 font-size: 84%;
59 color: #aaa;64 color: #aaa;
60 margin: 1ex;65 margin: 1ex;
61}66 text-align: center;
67}
68
69.image_title {
70 font-size: 1.4em;
71 color: #333333;
72 margin: 0 0 .2ex 0;
73}
74
75table.image_block,
76table.image_block img,
77table.image_block span.image_legend {
78margin:0 auto;
79padding:0;
80}
81
62.spanimage {82.spanimage {
63margin: .2ex 1ex;83margin: .2ex 1ex;
64}84}
@@ -126,8 +146,7 @@
126}146}
127147
128/* *** SuperFish *** */148/* *** SuperFish *** */
129149/* ESSENTIAL STYLES */
130/*** ESSENTIAL STYLES ***/
131.sf-menu,150.sf-menu,
132.sf-menu * {151.sf-menu * {
133 margin: 0;152 margin: 0;
@@ -316,7 +335,7 @@
316 background-position: -10px 0; /* arrow hovers for modern browsers*/335 background-position: -10px 0; /* arrow hovers for modern browsers*/
317}336}
318337
319/*** shadows for all but IE6 ***/338/* shadows for all but IE6 */
320.sf-shadow ul {339.sf-shadow ul {
321 background: url('../img/superfish-shadow.png') no-repeat bottom right;340 background: url('../img/superfish-shadow.png') no-repeat bottom right;
322 padding: 0 8px 9px 0;341 padding: 0 8px 9px 0;
@@ -330,9 +349,7 @@
330}349}
331350
332351
333/**352/* Default Form styles */
334 * Default Form styles
335 */
336form {353form {
337 margin: 0;354 margin: 0;
338 padding: 0;355 padding: 0;
@@ -392,12 +409,6 @@
392 padding : 1px;409 padding : 1px;
393}410}
394411
395/* fp> The following breaks the login screen and probably a lot more space constrained forms.
396.label{
397padding-right:3ex;
398}
399*/
400
401/* The following is a dirty fix. */412/* The following is a dirty fix. */
402.field_required .label{413.field_required .label{
403 background-image: url("../img/required-star.gif");414 background-image: url("../img/required-star.gif");
@@ -449,7 +460,6 @@
449 border: none;460 border: none;
450 margin: 1ex;461 margin: 1ex;
451 padding: 0;462 padding: 0;
452 /* border: 1px solid #00f; */
453}463}
454.fform fieldset.bordered {464.fform fieldset.bordered {
455 border: 1px solid #ddd;465 border: 1px solid #ddd;
@@ -461,11 +471,9 @@
461 font-weight:bold;471 font-weight:bold;
462 margin: 0;472 margin: 0;
463 padding-top: .5ex;473 padding-top: .5ex;
464 /* border: 1px solid #f00; */
465}474}
466.fform div.input {475.fform div.input {
467 margin: 0 0 0 25%;476 margin: 0 0 0 25%;
468 /* border: 1px solid #f00; */
469}477}
470* html .fform div.input {478* html .fform div.input {
471 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) */479 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) */
@@ -473,12 +481,10 @@
473}481}
474.fform fieldset.input{482.fform fieldset.input{
475 margin: 0;483 margin: 0;
476 /* border: 1px solid #0f0; */
477}484}
478.fform div.info {485.fform div.info {
479 margin: 0 0 0 25%;486 margin: 0 0 0 25%;
480 padding-top: .5ex;487 padding-top: .5ex;
481 /* border: 1px solid #f00; */
482}488}
483489
484/* hide checkbox in order to indent exactly the same size */490/* hide checkbox in order to indent exactly the same size */
@@ -494,9 +500,7 @@
494}500}
495501
496502
497/*503/* Messages */
498{{{ Messages
499*/
500div.log_container,504div.log_container,
501div.action_messages {505div.action_messages {
502 margin:1ex;506 margin:1ex;
@@ -541,7 +545,6 @@
541p.error {545p.error {
542 margin: 1ex;546 margin: 1ex;
543}547}
544/* }}} */
545548
546/* include errors, wrong params, deleted blog, etc... */549/* include errors, wrong params, deleted blog, etc... */
547div.template_error {550div.template_error {
@@ -595,9 +598,7 @@
595 font-weight: normal;598 font-weight: normal;
596}599}
597600
598/*601/* Bottom of page Debug output formatting: */
599 * Bottom of page Debug output formatting:
600 */
601div.debug {602div.debug {
602 border: 2px solid #000;603 border: 2px solid #000;
603 padding: 1ex;604 padding: 1ex;
@@ -653,9 +654,7 @@
653 background-color: #eee;654 background-color: #eee;
654}655}
655656
656/*657/* Definition Lists default styling */
657 * Definition Lists default styling
658 */
659dl {658dl {
660 display: block;659 display: block;
661 margin: 1em 0 1em 0;660 margin: 1em 0 1em 0;

Subscribers

People subscribed via source and target branches