WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

You are not logged in.

#26 23.03.2016 13:24:30

mrbaseman
Developer

Re: Output Filter Dashboard

I have published a new release on the github repo today:

CHANGELOG:

1.4.9 %(mrbaseman, 23 Mar 2016)%
        - change cachecontrols filter type to page(last)
        - realign code: wrap long lines and set tab width=4
        - make help browser work without javascript
        - fix css edit for filters that supply css files
        - provide export download link when javascript is disabled
        - allow to delete filters even without javascript
        - added French and Italian language support

would it make sense to link the AOR-Page to github directly?

Offline

#27 23.03.2016 13:33:11

florian
Administrator

Re: Output Filter Dashboard

updated AOR information & removed zip as demanded
http://addons.wbce.org/pages/addons.php?do=item&item=53

Offline

#28 24.03.2016 08:29:48

better-work
Member

Re: Output Filter Dashboard

@mrbaseman
Why now all Posts in English, but where it began in German???

Oder ist hier plötzlich auch die Pflicht ausgebrochen in Englisch schreiben zu müssen, wie in den websitebaker und lepton Foren...
devil devil


Gruß Jörg

Offline

#29 24.03.2016 08:32:50

florian
Administrator

Re: Output Filter Dashboard

Nein, wir haben hier keine Englisch-Pflicht. Ich vermute, es ist für mrbaseman einfacher, die Posts hier auf Englisch zu veröffentlichen, weil auch die Infos auf Github und im WB classic-Forum in dieser Sprache verfasst sind und dann einfach nur hierher kopiert werden müssen.

Correction. See the information about this board:
"Only for discussing actual changes on source, NO general suggestions. It would be nice if you could write in english."

Last edited by florian (24.03.2016 08:36:58)

Offline

#30 24.03.2016 09:31:20

better-work
Member

Re: Output Filter Dashboard

Okay, i understand  devil


Gruß Jörg

Offline

#31 29.09.2016 21:07:22

mrbaseman
Developer

Re: Output Filter Dashboard

I have an update for the outputfilter dashboard. Here the highlights of the changes:

- Drag&drop support for ordering the filters is available when Javascript is enabled (note that the filter type (module, module(last), page, page(last) has a larger influence on the position in the list - drag&drop ordering takes effect inside of each of these categories).
- By clicking on the icon which shows the type (inline- or plugin filter) you can convert between the two filter types. You can create an inline filter and easily develop the filter function online, and when it is ready, you can simply convert it to the more performant plugin filter
- The php code in exported filters is much better human readable now.
- When installing the dashboard, it searches for pre-existing module-filters and includes them into the filter list.
- Install scripts of filters can now influence their target position in the list. Of course you can move them at will later on

for more details see the changelog which is included in the documentation.

Offline

#32 09.03.2017 00:20:37

mrbaseman
Developer

Re: Output Filter Dashboard

Today I have written a very simple but useful plugin filter: an automatic link filter: If an URL is found in the output it is turned into a clickable link (somehow I have to detect if it is already part of a clickable link or something... the easiest approach is: If a whitespace is preceding the URL it is most probably not part of a html tag and rather just an URL written down in the flow of some text.

Offline

#33 09.03.2017 00:22:08

mrbaseman
Developer

Re: Output Filter Dashboard

and here another one: a bad word filter: Replaces a list of regular expressions (each on a separate line in the filter settings) by a fixed string (by default '***'). Currently just a very short bad word list is included, merely an example how to use. I'm planning to improve this (i.e. include a better list) and add a way to import the list from a file which one can upload in the backend (e.g. to the media folder and specify the path to the file in the filter settings).

Offline

#34 09.03.2017 21:46:27

mrbaseman
Developer

Re: Output Filter Dashboard

and here comes the next one: "Link Words"
In the backend you enter a list of words and corresponding links and whenever the word is found in the output, the corresponding link is automatically inserted. The list is just a textfield in the backend and the filter searches for the first word of each line, followed by a space character and a link. The link is then inserted for this particular word. A small list as an example is included in the filter.

Offline

Liked by:

florian

#35 12.03.2017 00:02:29

mrbaseman
Developer

Re: Output Filter Dashboard

here another filter about links: "trim external links"
In the backend you can define a link target for them - some people prefer "_blank" - or you define a specific one like "external" so that each external link is opened in the same (second) tab. If left empty, no target is added to the external links.
There is also a checkbox which lets you configure if rel="nofollow" should be added to each external link or not.

Offline

#36 12.03.2017 12:07:14

norhei
Developer

Re: Output Filter Dashboard

Love this :-)

Offline

#37 16.03.2017 21:18:56

mrbaseman
Developer

Re: Output Filter Dashboard

I have another filter ready: regex filter

in the backend you have a textarea in which you can enter regular expressions (one per line) which will be applied to the html output. An example use case is to unify currencies: For example you can turn all variants of Euro, EUR, €,... to the html special character €
Of course you can use this filter for many more changes.
A hint from my side: I'd recommend to use several simple expressions rather than a small number of rather complex regex'es

Offline

#38 05.09.2018 21:12:51

mrbaseman
Developer

Re: Output Filter Dashboard

Finally I have found some time for fixing the known issues in Outputfilter Dashboard. I have just released Version 1.5.5 on Github.

The first couple of fixes of this release were already available for quite some time on the master branch, but for instance converting filters from plugins back to inline filters works now. This really helps when developing new filter plugins and you notice that you want to change the the filter function again a little bit after you have already created a plugin. Note that some additional meta data is replaced by the default values when converting back and forth, but at least you can make an inline filter out of it and edit it with just a few clicks.

Offline

Liked by:

florian

#39 03.10.2018 23:42:35

mrbaseman
Developer

Re: Output Filter Dashboard

here a first draft for the suggestions from github issue #344 of WBCE - insert security headers

Note that the latest OpF Dashboard from github master (candidate for version 1.5.6) is needed to use the backend for switching the headers on and off individually

Offline

#40 04.10.2018 21:17:31

mrbaseman
Developer

Re: Output Filter Dashboard

here is an improved version which moves the filter to the correct position before "Remove System PH" and activates that one (if not already active anyway), and also "Auto Placeholder".

Offline

#41 18.03.2019 00:31:37

mrbaseman
Developer

Re: Output Filter Dashboard

a nice filter to convert http links to https: It makes the migration quite simple:

  1. Enable https in the web server (e.g. install the certificate and activate a server configuration that uses it - at most providers it's just completing the order form to buy that feature)

  2. Install the output filter

Normally you would have to change the WB_URL and manually replace all occurrences of its old http-Version by its new https-Version in the database. All that work is done by the output filter.

Offline

Liked by:

florian, stefanek

#42 18.03.2019 07:12:33

florian
Administrator

Re: Output Filter Dashboard

One question about the http / https filter: If I understand it right, in this line

  $http = str_replace ('https://', 'http://', WB_URL );

each already correct https link is changed to http, before it is (together with possible wrong links) re-converted to https in the line

  $content = str_replace ($http, $https, $content );

. Why is this necessary?

Offline

#43 18.03.2019 10:22:05

mrbaseman
Developer

Re: Output Filter Dashboard

florian wrote:

One question about the http / https filter: If I understand it right, in this line

  $http = str_replace ('https://', 'http://', WB_URL );

each already correct https link is changed to http, ...

no, I take WB_URL and replace in that string https by http so that I know for what I have to search in the page content.
If the site admin has not changed WB_URL I have to do the same the other way round so that I know by what I shall replace those strings:

  $https = str_replace ('http://', 'https://', WB_URL );

and finally:

  $content = str_replace ($http, $https, $content );

here I do the replacements in the page content

Offline

#44 18.03.2019 10:23:34

florian
Administrator

Re: Output Filter Dashboard

Ah, I see. Thank you for the explanation.

Offline

#45 13.06.2019 22:30:05

mrbaseman
Developer

Re: Output Filter Dashboard

mrbaseman wrote:

I have another filter ready: regex filter

in the backend you have a textarea in which you can enter regular expressions (one per line) which will be applied to the html output....

I have found this extremely useful to post process the output of the inline wrapper. I have changed the filter type to module (last) and selected the wrapper modules for this application.

However, I have noticed that escaping the delimiter character in the regex lines didn't work as expected. An improved version is attached.

One note from my side: Modifies are not (yet) supported for the whole expression, i.e. /foo/bar/i doesn't replace 'Foo'. There is a workaround: Use internal option setting at the beginning of the expression. /(?i)foo/bar/ replaces 'Foo' by 'bar'.

Offline

Liked by:

stefanek

#46 20.10.2019 01:11:47

colinax
Administrator

Re: Output Filter Dashboard

Hi, i've checked the opf modules with phpstorm.

The details can be found in the appendix, please do not be fooled by the numbers, there are sometimes false positives and doubly counted entries

edit: there are also some old [mod][text] lang params in the language files

Edit: appendix removed

Last edited by colinax (21.10.2019 00:02:39)

Offline

#47 20.10.2019 22:34:17

mrbaseman
Developer

Re: Output Filter Dashboard

Hi,
I had a look, but honestly, most (I tend to say almost all) issues are in generated code (OpF Dashboard uses naturaldocs to extract the function names and their documentation out of the php source) or in third party code (jquery plugins). I don't see an easy way to correct or postprocess this. I already replace Umlauts by their htmlentities.

There are a couple of html parse errors in the language files. Actually, I had an extra space character in the closing tag. That's not a big issue and I have corrected that in my source already. About the language parameters: Actually, all language parameters follow the style $LANG['MOD_OPF']['SOMETHING']. I know that WB has changed all their system language paremeters from $TEXT['CATEGORY']['KEY'] to  $TEXT['CATEGORY_KEY']. shall I do the same here with the module's language parameters? It would be an easy recursive search and replace, but why? Probably I didn't understand the problem here.

Apart from the closing html tags, do you see anything that shall be addressed here?

Offline

#48 20.10.2019 22:44:40

mrbaseman
Developer

Re: Output Filter Dashboard

about the filters:
a warning out of my experience  about the regex filter: the filter /foo/bar/ (take it literally)  changes <div class="footer> to <div class="barter>, which probably breaks the css layout of the web page. So be careful when playing around with filters. OpF Dashboard allows restricting them to specific pages, so that you don't mess up the whole web page when you are trying out the effect of a new output filter.

Offline

#49 21.10.2019 00:02:01

colinax
Administrator

Re: Output Filter Dashboard

Thanks for the explanation, its my first time with this Tool and i know it's a mess, but i can't config it exactly in this way as we need.

mrbaseman wrote:

About the language parameters: Actually, all language parameters follow the style $LANG['MOD_OPF']['SOMETHING']. I know that WB has changed all their system language paremeters from $TEXT['CATEGORY']['KEY'] to  $TEXT['CATEGORY_KEY']. shall I do the same here with the module's language parameters? It would be an easy recursive search and replace, but why? Probably I didn't understand the problem here.

In my opinion the parameters $ TEXT ['CATEGORY'] 'KEY'] were already deprecated in WB 2.8.3 (or earlier?). WBCE also uses $ TEXT ['CATEGORY_KEY'] but I do not have the current status of it or know how it exectly works.

Offline

#50 21.10.2019 23:23:14

mrbaseman
Developer

Re: Output Filter Dashboard

sure, this applies for the language variables that are provided by the central language files of the core. But I think the deprecated way is still supported in WBCE as a fallback.
Anyhow, for the module itself it's a different story. It just sources the appropriate language file and populates the  $LANG variable with what's defined in the file. As long as php doesn't forbid having multi dimensional arrays I think I can use them here. Well, if there was a mechanism to condense all the language files of the modules into a large dictionary in memory, then we would have to follow a common syntax.
Back to the results of phpstorm: The tool might be correct about some findings in the generated code (e.g. the documentation), but that's difficult to address. I'd have to go through the results in more detail. Maybe there are some findings that are easy to fix, like the </ em>  =>  </em> problem in some of the language files.

Offline

Liked by:

colinax

Board footer

Powered by FluxBB

up