@@ -296,6 +296,9 @@ public class CmsHtmlWidgetOption {
296
296
/** Option for the "show/hide visual control characters" button. */
297
297
public static final String OPTION_VISUALCHARS = "visualchars" ;
298
298
299
+ /** Option for the default protocol for links */
300
+ public static final String OPTION_LINKDEFAULTPROTOCOL = "linkdefaultprotocol:" ;
301
+
299
302
/** The optional buttons that can be additionally added to the button bar. */
300
303
public static final String [] OPTIONAL_BUTTONS = {
301
304
OPTION_ANCHOR ,
@@ -405,6 +408,9 @@ public class CmsHtmlWidgetOption {
405
408
/** The style XML path. */
406
409
private String m_stylesXmlPath ;
407
410
411
+ /** The link default protocol */
412
+ private String m_linkDefaultProtocol ;
413
+
408
414
/**
409
415
* Creates a new empty HTML widget object object.<p>
410
416
*/
@@ -503,6 +509,10 @@ public static String createConfigurationString(CmsHtmlWidgetOption option) {
503
509
result .append (option .getFormatSelectOptions ());
504
510
added = true ;
505
511
}
512
+ if (CmsStringUtil .isNotEmpty (option .getLinkDefaultProtocol ())) {
513
+ result .append (OPTION_LINKDEFAULTPROTOCOL );
514
+ result .append (option .getLinkDefaultProtocol ());
515
+ }
506
516
507
517
return result .toString ();
508
518
}
@@ -861,6 +871,15 @@ public String getStylesXmlPath() {
861
871
return m_stylesXmlPath ;
862
872
}
863
873
874
+ /**
875
+ * Returns the link default protocol to use when inserting/editing links via the link dialog.
876
+ *
877
+ * @return the link default protocol to use when inserting/editing links via the link dialog
878
+ */
879
+ public String getLinkDefaultProtocol () {
880
+ return m_linkDefaultProtocol ;
881
+ }
882
+
864
883
/**
865
884
* Initializes the widget options from the given configuration String.<p>
866
885
*
@@ -1043,6 +1062,17 @@ public void setStylesXmlPath(String stylesXmlPath) {
1043
1062
m_stylesXmlPath = stylesXmlPath ;
1044
1063
}
1045
1064
1065
+ /**
1066
+ * Set the link default protocol to use when inserting/editing links via the link dialog
1067
+ *
1068
+ * @param linkDefaultProtocol
1069
+ * the link default protocol to use when inserting/editing links via the link dialog
1070
+ */
1071
+ public void setLinkDefaultProtocol (String linkDefaultProtocol ) {
1072
+
1073
+ m_linkDefaultProtocol = linkDefaultProtocol ;
1074
+ }
1075
+
1046
1076
/**
1047
1077
* Returns true if the anchor dialog button should be available.<p>
1048
1078
*
@@ -1228,6 +1258,12 @@ protected void parseOptions(String configuration) {
1228
1258
m_importCss = true ;
1229
1259
} else if (option .startsWith (OPTION_ALLOWSCRIPTS )) {
1230
1260
m_allowScripts = true ;
1261
+ } else if (option .startsWith (OPTION_LINKDEFAULTPROTOCOL )) {
1262
+ // the link default protocol
1263
+ option = option .substring (OPTION_LINKDEFAULTPROTOCOL .length ());
1264
+ if (CmsStringUtil .isNotEmptyOrWhitespaceOnly (option )) {
1265
+ setLinkDefaultProtocol (option );
1266
+ }
1231
1267
} else {
1232
1268
// check if option describes an additional button
1233
1269
if (OPTIONAL_BUTTONS_LIST .contains (option )) {
0 commit comments