diff --git a/wbce/modules/output_filter/filter_routines.php b/wbce/modules/output_filter/filter_routines.php index 801aa9fe1..8e6a31a25 100644 --- a/wbce/modules/output_filter/filter_routines.php +++ b/wbce/modules/output_filter/filter_routines.php @@ -102,10 +102,17 @@ function executeFrontendOutputFilter($content) { } } - - +/* ### filter type: full qualified URLs to relative URLs##################### */ + if(OPF_REMOVE_SYSTEM_PH){ + if (file_exists($sFilterDirectory.'filterRemoveSystemPh.php ')) { + require_once($sFilterDirectory.'filterRemoveSystemPh.php '); + $content = doFilterRemoveSystemPh($content); + } + } + + @@ -172,8 +179,13 @@ function executeBackendOutputFilter($content) { } } - - +/* ### filter type: full qualified URLs to relative URLs##################### */ + if(OPF_REMOVE_SYSTEM_PH_BE){ + if (file_exists($sFilterDirectory.'filterRemoveSystemPh.php ')) { + require_once($sFilterDirectory.'filterRemoveSystemPh.php '); + $content = doFilterRemoveSystemPh($content); + } + } /* ### filter type: protect email addresses ################################# */ diff --git a/wbce/modules/output_filter/filters/filterRemoveSystemPh.php b/wbce/modules/output_filter/filters/filterRemoveSystemPh.php new file mode 100644 index 000000000..18e5efb08 --- /dev/null +++ b/wbce/modules/output_filter/filters/filterRemoveSystemPh.php @@ -0,0 +1,5 @@ +/s" ,"", $content); + return $content; + } \ No newline at end of file diff --git a/wbce/modules/output_filter/install.php b/wbce/modules/output_filter/install.php index b2b67e916..f12e2b656 100644 --- a/wbce/modules/output_filter/install.php +++ b/wbce/modules/output_filter/install.php @@ -31,6 +31,7 @@ Settings::Set('opf_wblink',1, false); Settings::Set('opf_short_url',0, false); Settings::Set('opf_sys_rel',1, false); +Settings::Set("opf_remove_system_ph", 1, false) ; //backend Settings::Set('opf_droplets_be',1, false); @@ -38,6 +39,7 @@ Settings::Set('opf_move_stuff_be',1, false); Settings::Set('opf_replace_stuff_be',1, false); Settings::Set('opf_css_to_head_be',1); +Settings::Set("opf_remove_system_ph_be", 1, false) ; //Setting version include ("info.php"); diff --git a/wbce/modules/output_filter/languages/DE.php b/wbce/modules/output_filter/languages/DE.php index 17064e949..79f3a0852 100644 --- a/wbce/modules/output_filter/languages/DE.php +++ b/wbce/modules/output_filter/languages/DE.php @@ -40,3 +40,4 @@ $OPF['JS_MAILTO'] = 'Javascript für Mailto-Filter'; $OPF['SHORT_URL'] = 'ShortUrl-Filter (kein /pages/, kein .php; htaccess-Anpassung erforderlich!)'; $OPF['CSS_TO_HEAD'] = 'CSS in den Head transferieren'; +$OPF['REMOVE_SYSTEM_PH'] = 'Vom Core automatisch generierte Kommentare löschen.'; diff --git a/wbce/modules/output_filter/languages/EN.php b/wbce/modules/output_filter/languages/EN.php index d5e2ed67c..c4cb3f292 100644 --- a/wbce/modules/output_filter/languages/EN.php +++ b/wbce/modules/output_filter/languages/EN.php @@ -39,5 +39,6 @@ $OPF['JS_MAILTO'] = 'Use Javascript on mailto-filter'; $OPF['SHORT_URL'] = 'Use short url filter (no /pages, no .php - htaccess has to be prepared for that)'; $OPF['CSS_TO_HEAD'] = 'Move CSS to head'; +$OPF['REMOVE_SYSTEM_PH'] = 'Remove placesholders(PH) generated by core filters.'; diff --git a/wbce/modules/output_filter/templates/output_filter.tpl.php b/wbce/modules/output_filter/templates/output_filter.tpl.php index 671cd7efa..d92479939 100644 --- a/wbce/modules/output_filter/templates/output_filter.tpl.php +++ b/wbce/modules/output_filter/templates/output_filter.tpl.php @@ -111,6 +111,15 @@ name="sys_rel" value="0"> + + : + + + name="remove_system_ph" value="1"> + + name="remove_system_ph" value="0"> + + @@ -161,7 +170,17 @@ name="css_to_head_be" value="0"> - + + : + + + name="remove_system_ph_be" value="1"> + + name="remove_system_ph_be" value="0"> + + + +
: diff --git a/wbce/modules/output_filter/tool.php b/wbce/modules/output_filter/tool.php index 99125aa87..519db7588 100644 --- a/wbce/modules/output_filter/tool.php +++ b/wbce/modules/output_filter/tool.php @@ -32,14 +32,17 @@ $data['wblink'] = (int)(intval(isset($_POST['wblink']) ? $_POST['wblink'] : 0) != 0); $data['short_url'] = (int)(intval(isset($_POST['short_url']) ? $_POST['short_url'] : 0) != 0); $data['sys_rel'] = (int)(intval(isset($_POST['sys_rel']) ? $_POST['sys_rel'] : 0) != 0); - + $data['remove_system_ph'] = (int)(intval(isset($_POST['remove_system_ph']) ? $_POST['remove_system_ph'] : 0) != 0); + //backend $data['droplets_be'] = (int)(intval(isset($_POST['droplets_be']) ? $_POST['droplets_be'] : 0) != 0); $data['auto_placeholder_be'] = (int)(intval(isset($_POST['auto_placeholder_be']) ? $_POST['auto_placeholder_be'] : 0) != 0); $data['move_stuff_be'] = (int)(intval(isset($_POST['move_stuff_be']) ? $_POST['move_stuff_be'] : 0) != 0); $data['replace_stuff_be'] = (int)(intval(isset($_POST['replace_stuff_be']) ? $_POST['replace_stuff_be'] : 0) != 0); $data['css_to_head_be'] = (int)(intval(isset($_POST['css_to_head_be']) ? $_POST['css_to_head_be'] : 0) != 0); + $data['remove_system_ph_be'] = (int)(intval(isset($_POST['remove_system_ph_be']) ? $_POST['remove_system_ph_be'] : 0) != 0); + // dont use JAvascript Mailto if no mailto filter active. if ($data['js_mailto'] and !$data['mailto_filter']) $data['js_mailto']=0; @@ -71,6 +74,7 @@ $errmsg.=(string)Settings::Set("opf_wblink", $data['wblink']); $errmsg.=(string)Settings::Set("opf_short_url", $data['short_url']); $errmsg.=(string)Settings::Set("opf_sys_rel", $data['sys_rel']); + $errmsg.=(string)Settings::Set("opf_remove_system_ph", $data['remove_system_ph']); //backend $errmsg.=(string)Settings::Set("opf_droplets_be", $data['droplets_be']); @@ -78,6 +82,7 @@ $errmsg.=(string)Settings::Set("opf_move_stuff_be", $data['move_stuff_be']); $errmsg.=(string)Settings::Set("opf_replace_stuff_be", $data['replace_stuff_be']); $errmsg.=(string)Settings::Set("opf_css_to_head_be", $data['css_to_head_be']); + $errmsg.=(string)Settings::Set("opf_remove_system_ph_be", $data['remove_system_ph_be']); if($errmsg=="") { //anything ok @@ -114,6 +119,7 @@ $data['wblink'] = Settings::Get('opf_wblink',1); $data['short_url'] = Settings::Get('opf_short_url',0); $data['sys_rel'] = Settings::Get('opf_sys_rel',1); + $data['remove_system_ph'] = Settings::Get('opf_remove_system_ph',1); //backend $data['droplets_be'] = Settings::Get('opf_droplets_be',1); @@ -121,6 +127,7 @@ $data['move_stuff_be'] = Settings::Get('opf_move_stuff_be',1); $data['replace_stuff_be'] = Settings::Get('opf_replace_stuff_be',1); $data['css_to_head_be'] = Settings::Get('opf_css_to_head_be',1); + $data['remove_system_ph_be'] = Settings::Get('opf_remove_system_ph_be',1); } diff --git a/wbce/modules/output_filter/uninstall.php b/wbce/modules/output_filter/uninstall.php index d0ba2bdd2..6db6db9a4 100644 --- a/wbce/modules/output_filter/uninstall.php +++ b/wbce/modules/output_filter/uninstall.php @@ -20,26 +20,28 @@ // Commented out , cause of new OPF dashboard still needs those settings. Settings::Del('wb_suppress_old_opf'); //frontend -Settings::Del('opf_droplets',1, false); -Settings::Del('opf_auto_placeholder',1, false); -Settings::Del('opf_move_stuff',1, false); -Settings::Del('opf_replace_stuff',1, false); -Settings::Del('opf_css_to_head',1, false); -Settings::Del('opf_email_filter',1, false); -Settings::Del('opf_mailto_filter',1, false); -Settings::Del('opf_js_mailto',1, false); -Settings::Del('opf_at_replacement',"(at)", false); -Settings::Del('opf_dot_replacement',"(dot)", false); -Settings::Del('opf_wblink',1, false); -Settings::Del('opf_short_url',0, false); -Settings::Del('opf_sys_rel',1, false); +Settings::Del('opf_droplets'); +Settings::Del('opf_auto_placeholder'); +Settings::Del('opf_move_stuff'); +Settings::Del('opf_replace_stuff'); +Settings::Del('opf_css_to_head'); +Settings::Del('opf_email_filter'); +Settings::Del('opf_mailto_filter'); +Settings::Del('opf_js_mailto'); +Settings::Del('opf_at_replacement',"(at)"); +Settings::Del('opf_dot_replacement',"(dot)"); +Settings::Del('opf_wblink'); +Settings::Del('opf_short_url'); +Settings::Del('opf_sys_rel'); +Settings::Set("opf_remove_system_ph") ; //backend -Settings::Del('opf_droplets_be',1, false); -Settings::Del('opf_auto_placeholder_be',1, false); -Settings::Del('opf_move_stuff_be',1, false); -Settings::Del('opf_replace_stuff_be',1, false); -Settings::Del('opf_css_to_head_be',1); +Settings::Del('opf_droplets_be'); +Settings::Del('opf_auto_placeholder_be'); +Settings::Del('opf_move_stuff_be'); +Settings::Del('opf_replace_stuff_be'); +Settings::Del('opf_css_to_head_be'); +Settings::Set("opf_remove_system_ph_be") ; // deleting version too Settings::Del("opf_version") ; diff --git a/wbce/modules/output_filter/upgrade.php b/wbce/modules/output_filter/upgrade.php index babe12156..389b759f5 100644 --- a/wbce/modules/output_filter/upgrade.php +++ b/wbce/modules/output_filter/upgrade.php @@ -70,13 +70,15 @@ function getOutputFilterSettings() { Settings::Set('opf_wblink',1, false); Settings::Set('opf_short_url',0, false); Settings::Set('opf_sys_rel',1, false); - +Settings::Set("opf_remove_system_ph", 1, false) ; + //backend Settings::Set('opf_droplets_be',1, false); Settings::Set('opf_auto_placeholder_be',1, false); Settings::Set('opf_move_stuff_be',1, false); Settings::Set('opf_replace_stuff_be',1, false); Settings::Set('opf_css_to_head_be',1); +Settings::Set("opf_remove_system_ph_be", 1, false) ; // Override based on old WBCE settings if (isset($data["sys_rel"])) Settings::Set('opf_sys_rel',$data["sys_rel"], false);