import initial.
[Epoz.git] / epoz / epoz_plone / epoz_wysiwyg_support.pt
1 <html i18n:domain="plone">
2
3 <div metal:define-macro="wysiwygEditorBox">
4
5 <tal:block tal:define="wysiwyg python: here.portal_membership.getAuthenticatedMember().getProperty('wysiwyg_editor')=='Epoz';">
6
7 <tal:block tal:condition="wysiwyg"
8 tal:define="ztu modules/ZTUtils;
9 pss modules/Products/PythonScripts/standard;
10 text_format python: getattr(here,'text_format','html');
11 is_stx python:text_format=='structured-text';
12 is_ptx python:text_format=='plain';
13 url3 request/URL3|nothing;
14 pageurl python: test(here.portal_factory.isTemporary(here), url3, here.absolute_url());
15 getProperty python: here.stylesheet_properties.getProperty;
16 current_skin python: ztu.make_query(skin=request.get(here.portal_skins.getRequestVarname(), ''));"
17
18 tal:replace="structure python: here.Epoz(
19 inputname,
20 data = (is_stx and pss.structured_text(inputvalue))
21 or (is_ptx and pss.newline_to_br(inputvalue))
22 or inputvalue,
23 toolbox = pageurl + '/epoz_toolbox',
24 lang = here.portal_properties.site_properties.default_language,
25 style = 'width: %s; height: %s; margin-top: 2px; border: %s;' % (path('width|string:99%'), path('height|string:450px'), getProperty('preBorder','1px solid #8cacbb'),),
26 button = 'background-color: %s; border: 1px solid %s; cursor: pointer; margin-right: 1px; margin-bottom: 1px;' % (
27 getProperty('contentTabBackground','#CDE2A7'),
28 getProperty('contentTabFontColor','#578308'),),
29 path = here.portal_url() + '/',
30 css = here.portal_url()+'/plone.css?'+pss.url_quote(current_skin),
31 customcss = here.portal_url()+'/ploneCustom.css?'+pss.url_quote(current_skin),
32 charset = here.portal_properties.site_properties.default_charset,
33 pageurl = pageurl)">
34 </tal:block>
35
36 <tal:block condition="not: wysiwyg">
37
38 <textarea cols="80"
39 rows="25"
40 tabindex=""
41 name="description"
42 tal:content="inputvalue"
43 tal:attributes="name inputname;
44 id inputname;
45 tabindex tabindex|nothing;
46 rows rows|default;
47 cols cols|default;"></textarea>
48 </tal:block>
49 </tal:block>
50 </div>
51
52 <div metal:define-macro="textFormatSelector">
53
54 <tal:block tal:define="wysiwyg python: here.portal_membership.getAuthenticatedMember().getProperty('wysiwyg_editor')=='Epoz'">
55
56 <tal:block condition="wysiwyg">
57 <input type="hidden"
58 name="text_format"
59 value="html" />
60 </tal:block>
61
62 <tal:block condition="not: wysiwyg">
63
64 <div class="field"
65 tal:define="tabindex tabindex/next;
66 text_format python:request.get('text_format', getattr(here,'text_format','structured-text'))">
67
68 <label for="text_format" i18n:translate="label_format">Format</label>
69
70 <div class="formHelp" i18n:translate="help_format_wysiwyg">
71 If you are unsure of which format to use, just select Plain
72 Text and type the document as you usually do.
73 </div>
74
75 <input class="noborder"
76 type="radio"
77 name="text_format"
78 value="structured-text"
79 tabindex=""
80 id="cb_structuredtext"
81 tal:attributes="checked python:test(text_format=='structured-text', 1, None);
82 tabindex tabindex;"
83 />
84 <label for="cb_structuredtext" i18n:translate="structured_text">Structured Text</label> <br />
85
86 <input class="noborder"
87 type="radio"
88 name="text_format"
89 value="html"
90 tabindex=""
91 id="cb_html"
92 tal:attributes="checked python:test(text_format=='html', 1, None);
93 tabindex tabindex;"
94 />
95 <label for="cb_html" i18n:translate="html">HTML</label> <br />
96
97 <input class="noborder"
98 type="radio"
99 name="text_format"
100 value="plain"
101 tabindex=""
102 id="cb_plain"
103 tal:attributes="checked python:test(text_format=='plain', 1, None);
104 tabindex tabindex;"
105 />
106 <label for="cb_plain" i18n:translate="plain_text">Plain Text</label>
107
108 </div>
109 </tal:block>
110
111 </tal:block>
112 </div>
113 </html>