View | Details | Raw Unified | Return to bug 26431
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt (-4 / +24 lines)
Lines 9-15 Link Here
9
[% INCLUDE 'doc-head-close.inc' %]
9
[% INCLUDE 'doc-head-close.inc' %]
10
[% IF ( opac_news_count ) %]
10
[% IF ( opac_news_count ) %]
11
[% END %]
11
[% END %]
12
[% IF Koha.Preference('NewsToolEditor') == 'codemirror' %]
12
[% UNLESS ( wysiwyg ) %]
13
    [% Asset.css("lib/codemirror/codemirror.css") | $raw %]
13
    [% Asset.css("lib/codemirror/codemirror.css") | $raw %]
14
    [% Asset.css("lib/codemirror/lint.min.css") | $raw %]
14
    [% Asset.css("lib/codemirror/lint.min.css") | $raw %]
15
    <style>
15
    <style>
Lines 159-166 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
159
                                [% opac_new.content | $raw %]
159
                                [% opac_new.content | $raw %]
160
                            </td>
160
                            </td>
161
                            <td class="actions">
161
                            <td class="actions">
162
                                <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% opac_new.idnew | uri %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
162
                                [% IF ( wysiwyg ) %]
163
                                <a href="/cgi-bin/koha/tools/koha-news.pl?op=del&amp;ids=[% opac_new.idnew | uri %]" class="delete_news btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
163
                                    [% SET editmode = "wysiwyg" %]
164
                                [% ELSE %]
165
                                    [% SET editmode = "text" %]
166
                                [% END %]
167
                                <div class="btn-group dropup">
168
                                    <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% opac_new.idnew | uri %]&editmode=[% editmode | uri %]" class="btn btn-default btn-xs"> <i class="fa fa-pencil"></i> Edit</a><button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
169
                                        <span class="caret"></span>
170
                                    </button>
171
                                    <ul class="dropdown-menu pull-right">
172
                                        <li>
173
                                            [% IF ( wysiwyg ) %]
174
                                                <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% opac_new.idnew | uri %]&editmode=text"><i class="fa fa-pencil"></i> Edit with text editor</a>
175
                                            [% ELSE %]
176
                                                <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% opac_new.idnew | uri %]&editmode=wysiwyg"><i class="fa fa-pencil"></i> Edit with WYSIWYG editor</a>
177
                                            [% END %]
178
                                        </li>
179
                                    </ul>
180
                                </div>
181
                                <div class="btn-group">
182
                                    <a href="/cgi-bin/koha/tools/koha-news.pl?op=del&amp;ids=[% opac_new.idnew | uri %]" class="delete_news btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
183
                                </div>
164
                            </td>
184
                            </td>
165
                        </tr>
185
                        </tr>
166
                    [% END %]</tbody>
186
                    [% END %]</tbody>
Lines 305-311 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
305
            });
325
            });
306
        </script>
326
        </script>
307
    [% END %]
327
    [% END %]
308
    [% IF Koha.Preference('NewsToolEditor') == 'codemirror' %]
328
    [% UNLESS ( wysiwyg ) %]
309
        [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %]
329
        [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %]
310
        [% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %]
330
        [% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %]
311
        [% Asset.js( "lib/codemirror/lint.min.js" ) | $raw %]
331
        [% Asset.js( "lib/codemirror/lint.min.js" ) | $raw %]
(-)a/tools/koha-news.pl (-2 / +10 lines)
Lines 47-52 my $number = $cgi->param('number'); Link Here
47
my $lang           = $cgi->param('lang');
47
my $lang           = $cgi->param('lang');
48
my $branchcode     = $cgi->param('branch');
48
my $branchcode     = $cgi->param('branch');
49
my $error_message  = $cgi->param('error_message');
49
my $error_message  = $cgi->param('error_message');
50
my $wysiwyg;
51
if( $cgi->param('editmode') ){
52
    $wysiwyg = $cgi->param('editmode') eq "wysiwyg" ? 1 : 0;
53
} else {
54
    $wysiwyg = C4::Context->preference("NewsToolEditor") eq "tinymce" ? 1 : 0;
55
}
50
56
51
# Foreign Key constraints work with NULL, not ''
57
# Foreign Key constraints work with NULL, not ''
52
# NULL = All branches.
58
# NULL = All branches.
Lines 158-162 else { Link Here
158
        opac_news_count => $opac_news_count,
164
        opac_news_count => $opac_news_count,
159
		);
165
		);
160
}
166
}
161
$template->param( lang => $lang );
167
$template->param(
168
    lang => $lang,
169
    wysiwyg => $wysiwyg,
170
);
162
output_html_with_http_headers $cgi, $cookie, $template->output;
171
output_html_with_http_headers $cgi, $cookie, $template->output;
163
- 

Return to bug 26431