<html xmlns="http://www.w3.org/1999/xhtml"
      xml:lang="en"
      lang="en"
      i18n:domain="collective.ckeditor">


 <!-- wysiwyg default widget -->
 <div metal:define-macro="wysiwygEditorBox">
  <tal:defines define="fname fieldName|inputname|nothing;
                       ckview context/@@ckeditor_view;
                       usesCKeditor python:ckview.contentUsesCKeditor(fieldname=fname);
                       finder_context formlib_field/context|context">
    <tal:block condition="usesCKeditor">
     <div id="alerts"><!-- --></div>
     <input type="hidden"
            name="cke_config_url"
            class="cke_config_url"
            tal:attributes="value python:ckview.cke_config_url(finder_context)" />
     <tal:block condition="nocall:widget | nothing">
       <tal:block define="cke_widget python:ckview.getCK_widget_settings(widget)">
         <input type="hidden"
                name="cke_iswidget"
                class="cke_iswidget"
                tal:attributes="value python: True" />
         <div class="widget_settings">
           <input type="hidden"
                  class="cke_baseHref"
                  name="cke_baseHref"
                  tal:attributes="value ckview/cke_basehref" />
           <tal:block repeat="item cke_widget/items">
             <input type="hidden"
                    tal:define="k python: item[0];
                                v python: item[1];"
                    tal:attributes="name string:cke_$k;
                                    class string:cke_$k;
                                    value v" />
           </tal:block>
         </div>
       </tal:block>
     </tal:block>
     <textarea cols="80"
               rows="25"
               tabindex=""
               class="ckeditor_plone"
               tal:content="inputvalue"
               style="display:none"
               tal:attributes="name inputname;
                               id inputname;
                               onfocus onfocus|nothing;
                               onblur onblur|nothing;
                               tabindex tabindex|nothing;"></textarea>

    </tal:block>
    <tal:block condition="not: usesCKeditor">
     <textarea cols="80"
               rows="25"
               tabindex=""
               name="text"
               tal:content="inputvalue"
               tal:attributes="name inputname;
                               id inputname;
                               onfocus onfocus|nothing;
                               onblur onblur|nothing;
                               tabindex tabindex|nothing;" id="Textarea2"></textarea>
    </tal:block>
  </tal:defines>
 </div>

 <div metal:define-macro="textFormatSelector">
  <tal:defines define="fname fieldName|inputname|nothing;
                       ckview context/@@ckeditor_view;
                       usesCKeditor python:ckview.contentUsesCKeditor(fieldname=fname)">
    <tal:block condition="usesCKeditor">
          <input type="hidden"
                 name="text_format"
                 value="html" id="Hidden1"/>
    </tal:block>
    <tal:block condition="not: usesCKeditor">
      <div class="row">
        <div class="label">
           <span i18n:translate="label_format">Format</span>
           <div id="format_help"
                i18n:translate="help_format"
                class="help"
                style="visibility:hidden">
             Select which format you want to type the contents of this
             document in. If you are unsure of which format to use, just
             select Plain Text and type the document as you usually
             do.
           </div>
        </div>
        <div class="field"
             tal:define="tabindex tabindex/next;
                         text_format python:request.get('text_format', getattr(context,'text_format','structured-text'))">
          <input class="noborder"
                 type="radio"
                 name="text_format"
                 value="structured-text"
                 tabindex=""
                 id="cb_structuredtext"
                 onfocus="formtooltip('format_help',1)"
                 onblur="formtooltip('format_help',0)"
                 tal:attributes="checked python:test(text_format=='structured-text', 1, '');
                                 tabindex tabindex;"
                 />
          <label for="cb_structuredtext" i18n:translate="structured_text">Structured Text</label> <br />

          <input class="noborder"
                 type="radio"
                 name="text_format"
                 value="html"
                 tabindex=""
                 id="cb_html"
                 tal:attributes="checked python:test(text_format=='html', 1, '');
                                 tabindex tabindex;"
                 onfocus="formtooltip('format_help',1)"
                 onblur="formtooltip('format_help',0)"
                 />
          <label for="cb_html" i18n:translate="html">HTML</label> <br />

          <input class="noborder"
                 type="radio"
                 name="text_format"
                 value="plain"
                 tabindex=""
                 id="cb_plain"
                 tal:attributes="checked python:test(text_format=='plain', 1, '');
                                 tabindex tabindex;"
                 onfocus="formtooltip('format_help',1)"
                 onblur="formtooltip('format_help',0)"
                 />
          <label for="cb_plain" i18n:translate="plain_text">Plain Text</label>
        </div>
      </div>
    </tal:block>
  </tal:defines>
 </div>

</html>
