77 * @author Andreas Gohr <[email protected] > 88 */
99
10- // must be run within Dokuwiki
1110use dokuwiki \Extension \ActionPlugin ;
1211use dokuwiki \Extension \EventHandler ;
1312use dokuwiki \Extension \Event ;
1413use dokuwiki \Form \Form ;
1514use dokuwiki \Form \ButtonElement ;
1615
17- if (!defined ('DOKU_INC ' )) {
18- die ();
19- }
20-
2116class action_plugin_prosemirror_editor extends ActionPlugin
2217{
2318 /**
@@ -208,7 +203,9 @@ public function addAddtionalForms(Event $event)
208203 $ linkForm ->addRadioButton ('linktype ' , $ this ->getLang ('type:wiki page ' ))->val ('internallink ' );
209204 $ linkForm ->addRadioButton ('linktype ' , $ this ->getLang ('type:interwiki ' ))->val ('interwikilink ' );
210205 $ linkForm ->addRadioButton ('linktype ' , $ this ->getLang ('type:email ' ))->val ('emaillink ' );
211- $ linkForm ->addRadioButton ('linktype ' , $ this ->getLang ('type:external ' ))->val ('externallink ' )->attr ('checked ' , 'checked ' );
206+ $ linkForm ->addRadioButton ('linktype ' , $ this ->getLang ('type:external ' ))
207+ ->val ('externallink ' )
208+ ->attr ('checked ' , 'checked ' );
212209 $ linkForm ->addRadioButton ('linktype ' , $ this ->getLang ('type:other ' ))->val ('other ' );
213210 $ linkForm ->addTagClose ('fieldset ' );
214211 $ linkForm ->addTagClose ('div ' );
@@ -218,7 +215,9 @@ public function addAddtionalForms(Event $event)
218215 $ linkForm ->addTagOpen ('legend ' );
219216 $ linkForm ->addHTML ('Link Name Type ' );
220217 $ linkForm ->addTagClose ('legend ' );
221- $ linkForm ->addRadioButton ('nametype ' , $ this ->getLang ('type:automatic title ' ))->val ('automatic ' )->attr ('checked ' , 'checked ' );
218+ $ linkForm ->addRadioButton ('nametype ' , $ this ->getLang ('type:automatic title ' ))
219+ ->val ('automatic ' )
220+ ->attr ('checked ' , 'checked ' );
222221 $ linkForm ->addRadioButton ('nametype ' , $ this ->getLang ('type:custom title ' ))->val ('custom ' );
223222 $ linkForm ->addRadioButton ('nametype ' , $ this ->getLang ('type:image ' ))->val ('image ' );
224223 $ linkForm ->addTextInput ('linkname ' , 'Link name ' )->attr ('placeholder ' , $ this ->getLang ('placeholder:link name ' ));
@@ -240,9 +239,12 @@ public function addAddtionalForms(Event $event)
240239 'style ' => 'display: none; ' ,
241240 ]);
242241 $ mediaForm ->addFieldsetOpen ($ this ->getLang ('legend:media ' ))->addClass ('js-media-fieldset ' );
243- $ mediaForm ->addButtonHTML ('mediamanager ' , inlineSVG (DOKU_PLUGIN . 'prosemirror/images/file-image-outline.svg ' ))->attrs ([
244- 'type ' => 'button ' ,
245- 'class ' => 'js-open-mediamanager mediaform_mediamanager '
242+ $ mediaForm ->addButtonHTML (
243+ 'mediamanager ' ,
244+ inlineSVG (DOKU_PLUGIN . 'prosemirror/images/file-image-outline.svg ' )
245+ )->attrs ([
246+ 'type ' => 'button ' ,
247+ 'class ' => 'js-open-mediamanager mediaform_mediamanager '
246248 ]);
247249 $ mediaForm ->addTextInput ('mediatarget ' , $ this ->getLang ('media target ' ))->attrs (
248250 [
@@ -272,7 +274,9 @@ public function addAddtionalForms(Event $event)
272274 $ mediaForm ->addTagOpen ('legend ' );
273275 $ mediaForm ->addHTML ($ this ->getLang ('legend:alignment ' ));
274276 $ mediaForm ->addTagClose ('legend ' );
275- $ mediaForm ->addRadioButton ('alignment ' , $ this ->getLang ('label:default alignment ' ))->val ('' )->attr ('checked ' , 'checked ' );
277+ $ mediaForm ->addRadioButton ('alignment ' , $ this ->getLang ('label:default alignment ' ))
278+ ->val ('' )
279+ ->attr ('checked ' , 'checked ' );
276280 $ mediaForm ->addRadioButton ('alignment ' , $ this ->getLang ('label:float left ' ))->val ('left ' );
277281 $ mediaForm ->addRadioButton ('alignment ' , $ this ->getLang ('label:center alignment ' ))->val ('center ' );
278282 $ mediaForm ->addRadioButton ('alignment ' , $ this ->getLang ('label:float right ' ))->val ('right ' );
@@ -284,7 +288,9 @@ public function addAddtionalForms(Event $event)
284288 $ mediaForm ->addTagOpen ('legend ' );
285289 $ mediaForm ->addHTML ($ this ->getLang ('legend:linking ' ));
286290 $ mediaForm ->addTagClose ('legend ' );
287- $ mediaForm ->addRadioButton ('linking ' , $ this ->getLang ('label:default linking ' ))->val ('details ' )->attr ('checked ' , 'checked ' );
291+ $ mediaForm ->addRadioButton ('linking ' , $ this ->getLang ('label:default linking ' ))
292+ ->val ('details ' )
293+ ->attr ('checked ' , 'checked ' );
288294 $ mediaForm ->addRadioButton ('linking ' , $ this ->getLang ('label:direct linking ' ))->val ('direct ' );
289295 $ mediaForm ->addRadioButton ('linking ' , $ this ->getLang ('label:nolink ' ))->val ('nolink ' );
290296 $ mediaForm ->addRadioButton ('linking ' , $ this ->getLang ('label:linkonly ' ))->val ('linkonly ' );
@@ -296,7 +302,9 @@ public function addAddtionalForms(Event $event)
296302 $ mediaForm ->addTagOpen ('legend ' );
297303 $ mediaForm ->addHTML ($ this ->getLang ('legend:caching ' ));
298304 $ mediaForm ->addTagClose ('legend ' );
299- $ mediaForm ->addRadioButton ('caching ' , $ this ->getLang ('label:default caching ' ))->val ('' )->attr ('checked ' , 'checked ' );
305+ $ mediaForm ->addRadioButton ('caching ' , $ this ->getLang ('label:default caching ' ))
306+ ->val ('' )
307+ ->attr ('checked ' , 'checked ' );
300308 $ mediaForm ->addRadioButton ('caching ' , $ this ->getLang ('label:recache ' ))->val ('recache ' );
301309 $ mediaForm ->addRadioButton ('caching ' , $ this ->getLang ('label:nocache ' ))->val ('nocache ' );
302310 $ mediaForm ->addTagClose ('fieldset ' );
0 commit comments