From f2532c7f616993a380578ca06bf5753a4463e406 Mon Sep 17 00:00:00 2001 From: Martin Hecht Date: Sat, 6 Jul 2019 14:18:35 +0200 Subject: [PATCH] updated to 1.5.9 --- CHANGELOG | 11 ++++++ TODO | 3 -- add_filter.php | 3 +- ajax/ajax_dragdrop.php | 2 +- backend.css | 2 +- backend_body.js | 2 +- config_init.php | 2 +- convert.php | 4 +- css.php | 2 +- debug_conf.php | 2 +- docs/files/CHANGELOG-txt.html | 2 +- docs/index/Files.html | 2 +- docs/index/General.html | 2 +- edit_filter.php | 44 ++++++++++++++------- export.php | 2 +- functions.php | 6 +-- functions_outputfilter.php | 3 +- info.php | 4 +- install.php | 24 ++---------- languages/DE.php | 2 +- languages/EN.php | 2 +- languages/FR.php | 2 +- languages/IT.php | 2 +- languages/NL.php | 2 +- languages/NO.php | 2 +- naturaldocs_txt/CHANGELOG.txt | 11 ++++++ naturaldocs_txt/functions_outputfilter.php | 3 +- plugins/http_to_https/filter.php | 34 ++++++++++++++++ plugins/http_to_https/index.php | 3 ++ plugins/http_to_https/plugin_info.php | 45 ++++++++++++++++++++++ plugins/http_to_https/plugin_install.php | 43 +++++++++++++++++++++ precheck.php | 2 +- templates/add_edit.htt | 8 ++-- templates/css.htt | 2 +- templates/tool.htt | 2 +- tool.php | 24 ++++++++++-- uninstall.php | 2 +- upgrade.php | 37 ++++++++++-------- upload.php | 2 +- 39 files changed, 262 insertions(+), 90 deletions(-) create mode 100644 plugins/http_to_https/filter.php create mode 100644 plugins/http_to_https/index.php create mode 100644 plugins/http_to_https/plugin_info.php create mode 100644 plugins/http_to_https/plugin_install.php diff --git a/CHANGELOG b/CHANGELOG index 8afb3f3..9f2a47e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,17 @@ Header: Version-History 1.5: +1.5.9 %(mrbaseman, 5 Jul 2019)% + - include edit_area.js only on pages where an editarea exists + - allow 'search' in pages_parent for specifying searchresults + +1.5.8 %(mrbaseman, 20 Mar 2019)% + - include http_to_https plugin + - support placeholders in helppath + - automatically install/update plugins from the plugins directory + - support relative path for helppath + - use placeholders in file path when editing a filter + 1.5.7 %(mrbaseman, 07 Mar 2019)% - starting with php 7.2 create_function is deprecated - use !{SYSVAR:WB_URL}!, !{SYSVAR:WB_PATH}!, !{OPF:PLUGIN_URL}!, and !{OPF:PLUGIN_PATH}! when storing to database diff --git a/TODO b/TODO index 45be80c..87a3dd1 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,4 @@ TODO list for future releases ============================= -- review if the default values of the settings (e.g. auto place holders switched off are ok to go) -- when shipped as core-module, block uninstall of the dashboard - - maybe include more example filters one time - change template engine from phplib to pure php (or Twig maybe?) diff --git a/add_filter.php b/add_filter.php index 753b5e4..044ea70 100644 --- a/add_filter.php +++ b/add_filter.php @@ -8,7 +8,7 @@ * * @category tool * @package Outputfilter Dashboard - * @version 1.5.7 + * @version 1.5.9 * @authors Thomas "thorn" Hornik , Christian M. Stefan (Stefek) , Martin Hecht (mrbaseman) * @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2019 Martin Hecht (mrbaseman) * @link https://github.com/WebsiteBaker-modules/outputfilter_dashboard @@ -134,6 +134,7 @@ 'tpl_funcname' => $funcname, 'tpl_func' => $func, 'tpl_cancel_onclick' => opf_quotes('javascript: window.location = \''.ADMIN_URL.'/admintools/tool.php?tool='.basename(dirname(__FILE__)).'\';'), + 'tpl_edit_area' => (($func <> "")?'':""), 'tpl_allowedit' => (($func <> "")?("var opf_editarea = ".($allowedit?'"editable"':'""').";"):""), 'tpl_list_editarea' => "", 'tpl_list_growfield' => $list_growfield, diff --git a/ajax/ajax_dragdrop.php b/ajax/ajax_dragdrop.php index 0fb001d..84adb05 100644 --- a/ajax/ajax_dragdrop.php +++ b/ajax/ajax_dragdrop.php @@ -4,7 +4,7 @@ * * @category tool * @package Outputfilter Dashboard - * @version 1.5.7 + * @version 1.5.9 * @authors Thomas "thorn" Hornik , Christian M. Stefan (Stefek) , Martin Hecht (mrbaseman) * @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2019 Martin Hecht (mrbaseman) * @link https://github.com/WebsiteBaker-modules/outputfilter_dashboard diff --git a/backend.css b/backend.css index 4ca3423..70752e1 100644 --- a/backend.css +++ b/backend.css @@ -6,7 +6,7 @@ backend.css * * @category tool * @package Outputfilter Dashboard - * @version 1.5.7 + * @version 1.5.9 * @authors Thomas "thorn" Hornik , Christian M. Stefan (Stefek) , Martin Hecht (mrbaseman) * @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2019 Martin Hecht (mrbaseman) * @link https://github.com/WebsiteBaker-modules/outputfilter_dashboard diff --git a/backend_body.js b/backend_body.js index 660cb8e..7309332 100644 --- a/backend_body.js +++ b/backend_body.js @@ -6,7 +6,7 @@ backend_body.js * * @category tool * @package Outputfilter Dashboard - * @version 1.5.7 + * @version 1.5.9 * @authors Thomas "thorn" Hornik , Christian M. Stefan (Stefek) , Martin Hecht (mrbaseman) * @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2019 Martin Hecht (mrbaseman) * @link https://github.com/WebsiteBaker-modules/outputfilter_dashboard diff --git a/config_init.php b/config_init.php index 449f552..8734734 100644 --- a/config_init.php +++ b/config_init.php @@ -8,7 +8,7 @@ * * @category tool * @package Outputfilter Dashboard - * @version 1.5.7 + * @version 1.5.9 * @authors Thomas "thorn" Hornik , Christian M. Stefan (Stefek) , Martin Hecht (mrbaseman) * @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2019 Martin Hecht (mrbaseman) * @link https://github.com/WebsiteBaker-modules/outputfilter_dashboard diff --git a/convert.php b/convert.php index e7247e6..5c1285e 100644 --- a/convert.php +++ b/convert.php @@ -8,7 +8,7 @@ * * @category tool * @package Outputfilter Dashboard - * @version 1.5.7 + * @version 1.5.9 * @authors Thomas "thorn" Hornik , Christian M. Stefan (Stefek) , Martin Hecht (mrbaseman) * @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2019 Martin Hecht (mrbaseman) * @link https://github.com/WebsiteBaker-modules/outputfilter_dashboard @@ -114,8 +114,6 @@ if($filter['plugin']!='') { $filter_file=$filter['file']; - $filter_file = str_replace('{OPF:PLUGIN_PATH}', OPF_PLUGINS_PATH.$filter['plugin'], $filter_file); - $filter_file = str_replace('{SYSVAR:WB_PATH}', WB_PATH, $filter_file); if(file_exists($filter_file)){ $filter['func']=file_get_contents($filter_file); $filter['userfunc']=1; diff --git a/css.php b/css.php index 3235423..e2a77c1 100644 --- a/css.php +++ b/css.php @@ -8,7 +8,7 @@ * * @category tool * @package Outputfilter Dashboard - * @version 1.5.7 + * @version 1.5.9 * @authors Thomas "thorn" Hornik , Christian M. Stefan (Stefek) , Martin Hecht (mrbaseman) * @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2019 Martin Hecht (mrbaseman) * @link https://github.com/WebsiteBaker-modules/outputfilter_dashboard diff --git a/debug_conf.php b/debug_conf.php index 654bee6..4b4cb31 100644 --- a/debug_conf.php +++ b/debug_conf.php @@ -8,7 +8,7 @@ * * @category tool * @package Outputfilter Dashboard - * @version 1.5.7 + * @version 1.5.9 * @authors Thomas "thorn" Hornik , Christian M. Stefan (Stefek) , Martin Hecht (mrbaseman) * @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2019 Martin Hecht (mrbaseman) * @link https://github.com/WebsiteBaker-modules/outputfilter_dashboard diff --git a/docs/files/CHANGELOG-txt.html b/docs/files/CHANGELOG-txt.html index c68bb38..2826c39 100644 --- a/docs/files/CHANGELOG-txt.html +++ b/docs/files/CHANGELOG-txt.html @@ -11,7 +11,7 @@ -

Version-History

1.5

1.5.7 (mrbaseman, 07 Mar 2019)

  • starting with php 7.2 create_function is deprecated
  • use {SYSVAR:WB_URL}, {SYSVAR:WB_PATH}, {OPF:PLUGIN_URL}, and {OPF:PLUGIN_PATH} when storing to database
  • if it exists, use /temp directory instead of media folder
  • introduce new filter types
OPF_TYPE_SECTION_FIRST: is executed before OPF_TYPE_SECTION
+

Version-History

1.5

1.5.9 (mrbaseman, 5 Jul 2019)

  • include edit_area.js only on pages where an editarea exists
  • allow ‘search’ in pages_parent for specifying searchresults

1.5.8 (mrbaseman, 20 Mar 2019)

  • include http_to_https plugin
  • support placeholders in helppath
  • automatically install/update plugins from the plugins directory
  • support relative path for helppath
  • use placeholders in file path when editing a filter

1.5.7 (mrbaseman, 07 Mar 2019)

  • starting with php 7.2 create_function is deprecated
  • use {SYSVAR:WB_URL}, {SYSVAR:WB_PATH}, {OPF:PLUGIN_URL}, and {OPF:PLUGIN_PATH} when storing to database
  • if it exists, use /temp directory instead of media folder
  • introduce new filter types
OPF_TYPE_SECTION_FIRST: is executed before OPF_TYPE_SECTION
 OPF_TYPE_PAGE_FIRST:    is executed before OPF_TYPE_PAGE
 OPF_TYPE_PAGE_FINAL:    is ececuted after  OPF_TYPE_PAGE_LAST
  • rewrite of opf_filter_get_rel_pos() it did not return reliable results
  • introduce internal functions for sysvar replacements

1.5.6 (mrbaseman, 04 Nov 2018)

  • support a legacy module opf_simple_backend to switch between basic and advanced backend view
  • avoid warning during installation when shipped as core module
  • php 7.2 fixes
  • add configurl button in the filter edit view, if applicable
  • allow multiple uses of the same field type in extra fields
  • change the logic when backend filtering shall be offered
  • correctly start incrementing position of installed filters
  • fix bug in opf_filter_get_data() to find index correctly
  • fix the logic for the backend filtering - module filtering not for inline filters
  • print footer always when an exit() is issued in the backend tool

1.5.5 (mrbaseman, 5 Sep 2018)

  • fix uninstall.php in case MEDIA_DIRECTORY does not start with a slash
  • fix ajax drag&drop which caused warning when issued after editing a filter
  • fix: hand over $OPF_TYPE_ASSIGNMENTS correctly to opf_revert_type_consts
  • only apply filter to backend when backend is selected - ALL is for frontend
  • correctly apply filters for special pages like searchresults with $pageid==0
  • fix css for checktree so that indentation works correctly
  • bugfix: converting filter types between plugin and inline failed
  • updated assignments of modules to the categories
  • minor update of the help pages

1.5.4 (mrbaseman, 19 Apr 2017)

  • fix for opf_db functions when previous queries have triggered already an error

1.5.3 (mrbaseman, 7 Apr 2017)

  • added fallbacks in <opf_insert_frontend_files> in case the template lacks head
  • improved debug messages for calls to <opf_is_registered>

1.5.2 (mrbaseman, 8 Mar 2017)

  • use OPF_TYPE constants when exporting filters

1.5.1 (mrbaseman, 25 Jan 2017)

  • allow arrays for $ref_name in opf_move_up_before
  • switch to colon separator in ajax helper
  • if $ref_name is ommited in opf_move_up_before, move $name up to the top
  • update patch detection for WBCE and module filter replacement
  • suppress warning when opf_move_up_before is called and $ref_name not found
  • store active/inactive state not only inside opf but also as WBCE Settings value
  • add additional hint upon an attempt to install a module filter as a plugin
  • trigger upgrade/install of module filters
  • in opf_filter_is_active take settings constants into account
  • immediately reflect toggle of the active/inactive state in the dashboard

1.5.0 (mrbaseman, 29 Sept 2016)

  • fetch $page_id from constant PAGE_ID for all cases
  • automagically initialize the global filter list
  • allow to sort filters via drag&drop
  • make exported filter human-readable
  • improve processing of formatting of documentation
  • when exporting a filter create a filter.php file
  • during export also insert placeholders introduced in version 1.4.4
  • allow to convert between inline filters and plugin filters
  • added opf_move_up_before to move filters up in the list during installation
  • search for pre-existing module filters during installation of opf
  • cleaned up backend_body.js
  • support backend filtering, provided that the class “Tool” exists and the settings have been converted to modules (this relies on developments in the WBCE 2.0-dev Branch, so you might see the checkbox for the backend, but unless the backend is implemented as modules, most probably no filters are going to be applied) In case you have created a filter which screws up the backend completely, add the following line to your global config.php of your WBCE installation
define('WB_OPF_BE_OFF', 'off');

The value doesn’t really matter, just if the constant is defined, there will no filter be applied to the backend and you have access to the dashboard again and you can fix the filters.

1.4

this version is a major re-engineering of the module with the goal to use it without PMF.  Special thanks to all who have tested and especially to NorHei for fruitful discussions and for providing additional testing ressources.

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

1.4.8 (mrbaseman, 21 Feb 2016)

  • remove unused code part from add_filter to fix array conversion warnings
  • update plugin filters to use new placeholders introduced in 1.4.4 in order to pick up this change you have to remove the example filters before upgrading OpF
  • update documentation: added a section which explains the use of the constants and placeholders

1.4.7 (mrbaseman, 21 Feb 2016)

  • a couple of cosmetic bugfixes (correctly display Umlauts in filter list, replace German ss special char with ss in filter description, remove unused filter_id from template parsing, properly initialize TPL_EXTRA_FIELDS_BLOCK in edit_filter, fix for using global LANG inside method in WBCE)
  • security fix: check ftan for upload
  • several fixes for arrays as additional field (like in correct date example)
  • fix css edit for filters that provide css

1.4.6 (mrbaseman, 18 Feb 2016)

  • add module icon for WBCE 1.2
  • bugfix: do not allow moving up uppermost filter
  • switch from FTANs to IDKEYs in many places of the backend

1.4.5 (mrbaseman, 09 Feb 2016)

  • update documentation layout
  • include example plugins again
  • update patch check
  • merge in Stefek’s changes, thanks for your contribution and for your ideas you have contributed
  • automatically remove naturaldocs sources during install
  • various minor changes to make it working in upcoming wb-classic releases

1.4.4 (Stefek, 05 Feb 2016)

  • added the following tokens to apply instead of hardcoded pathes within OpF-Plugins:
{SYSVAR:WB_URL}   = will replace with the content of the Constant WB_URL
 {SYSVAR:WB_PATH}  = will replace with the content of the Constant WB_PATH
diff --git a/docs/index/Files.html b/docs/index/Files.html
index ee0279d..8ebfca5 100644
--- a/docs/index/Files.html
+++ b/docs/index/Files.html
@@ -49,7 +49,7 @@
 
 
 
-
1.5.7 (mrbaseman, 07 Mar 2019)
+
1.5.9 (mrbaseman, 5 Jul 2019)
diff --git a/docs/index/General.html b/docs/index/General.html index bdca398..c6fa9fa 100644 --- a/docs/index/General.html +++ b/docs/index/General.html @@ -81,7 +81,7 @@ -
1.5.7 (mrbaseman, 07 Mar 2019)
Vor der Installation von OutputFilter-Dashboard muß das alte Frontend-Filter-Admin Modul - wenn vorhanden - deinstalliert werden, nicht zu verwechseln mit dem Frontend-Output-Filter!
Website Baker 2.8 oder neuer.
+
1.5.9 (mrbaseman, 5 Jul 2019)
Vor der Installation von OutputFilter-Dashboard muß das alte Frontend-Filter-Admin Modul - wenn vorhanden - deinstalliert werden, nicht zu verwechseln mit dem Frontend-Output-Filter!
Website Baker 2.8 oder neuer.
diff --git a/edit_filter.php b/edit_filter.php index 9b4ea2a..53fb908 100644 --- a/edit_filter.php +++ b/edit_filter.php @@ -8,7 +8,7 @@ * * @category tool * @package Outputfilter Dashboard - * @version 1.5.7 + * @version 1.5.9 * @authors Thomas "thorn" Hornik , Christian M. Stefan (Stefek) , Martin Hecht (mrbaseman) * @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2019 Martin Hecht (mrbaseman) * @link https://github.com/WebsiteBaker-modules/outputfilter_dashboard @@ -66,6 +66,14 @@ if(!$filters = opf_db_query( "SELECT * FROM `".TABLE_PREFIX."mod_outputfilter_dashboard` WHERE `id`=$id")) return; $filter = $filters[0]; +$filter['modules'] = unserialize($filter['modules']); +$filter['desc'] = unserialize($filter['desc']); +$filter['helppath'] = unserialize($filter['helppath']); +$filter['pages_parent'] = unserialize($filter['pages_parent']); +$filter['pages'] = unserialize($filter['pages']); +$filter['additional_values'] = unserialize($filter['additional_values']); +$filter['additional_fields'] = unserialize($filter['additional_fields']); +$filter['additional_fields_languages'] = unserialize($filter['additional_fields_languages']); $filter = opf_replace_sysvar($filter); $types = opf_get_types(); $name = $filter['name']; @@ -76,19 +84,19 @@ $plugin = $filter['plugin']; $type = (array_key_exists($filter['type'],$types)?$filter['type']:key($types)); $file = $filter['file']; -$modules = unserialize($filter['modules']); -$desc = opf_fetch_entry_language(unserialize($filter['desc'])); -$helppath = opf_fetch_entry_language(unserialize($filter['helppath'])); +$modules = $filter['modules']; +$desc = opf_fetch_entry_language($filter['desc']); +$helppath = opf_fetch_entry_language($filter['helppath']); $helppath = opf_insert_sysvar($helppath,$filter['plugin']); $func = $filter['func']; $funcname = $filter['funcname']; -$pages_parent = unserialize($filter['pages_parent']); -$pages = unserialize($filter['pages']); +$pages_parent = $filter['pages_parent']; +$pages = $filter['pages']; $allowedit = ($filter['allowedit']==1?1:0); $allowedittarget = ($filter['allowedittarget']==1?1:0); -$additional_values = unserialize($filter['additional_values']); -$additional_fields = unserialize($filter['additional_fields']); -$additional_fields_languages = unserialize($filter['additional_fields_languages']); +$additional_values = $filter['additional_values']; +$additional_fields = $filter['additional_fields']; +$additional_fields_languages = $filter['additional_fields_languages']; $filter_type_options=''; @@ -98,9 +106,17 @@ $filter_type_options .= ">".opf_quotes($text).""; } - if($helppath) { - $helppath_onclick = "javascript: return opf_popup('$helppath');"; + $helppath_onclick = $helppath; + if(!preg_match('/^(https?:\/\/|\/)/', $helppath_onclick)) { + if(!empty($plugin)){ // relative paths in plugin filters + $helppath_onclick = OPF_PLUGINS_URL.$plugin.'/'.$helppath_onclick; + } else if(!empty($file)){ // the same for module filters + $helppath_onclick = preg_replace('/[^\/]*$/','',file).$helppath_onclick; + $helppath_onclick = str_replace(WB_PATH,WB_URL,$helppath_onclick); + } + } + $helppath_onclick = "javascript: return opf_popup('$helppath_onclick');"; } else { $helppath_onclick = ''; } @@ -215,7 +231,7 @@ 'tpl_id' => $id, 'tpl_filter_name' => $name, 'tpl_filter_funcname' => $funcname, - 'tpl_filter_file' => $file, + 'tpl_filter_file' => opf_insert_sysvar($file,$plugin), 'tpl_filter_description' => $desc, 'tpl_filter_helppath_onclick' => $helppath_onclick, 'tpl_filter_configurl_start' => ($filter['configurl'])?"":" - + +{tpl_edit_area}