Skip to content

Commit

Permalink
updated to version 1.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbaseman committed Feb 22, 2016
1 parent 94618b2 commit ddb70c0
Show file tree
Hide file tree
Showing 44 changed files with 252 additions and 225 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ Header: Version-History
*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.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
Expand Down
94 changes: 12 additions & 82 deletions add_filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @category tool
* @package Outputfilter Dashboard
* @version 1.4.5
* @version 1.4.8
* @authors Thomas "thorn" Hornik <[email protected]>, Christian M. Stefan (Stefek) <[email protected]>, Martin Hecht (mrbaseman) <[email protected]>
* @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2016 Martin Hecht (mrbaseman)
* @link https://github.com/WebsiteBaker-modules/outpufilter_dashboard
Expand Down Expand Up @@ -54,6 +54,9 @@

// This file will be included from tool.php

// prevent this file from being accessed directly
if(!defined('WB_PATH')) die(header('Location: ../index.php'));

// check if user is allowed to use admin-tools (to prevent this file to be called by an unauthorized user e.g. from a code-section)
if(!$admin->get_permission('admintools')) die(header('Location: ../../index.php'));

Expand Down Expand Up @@ -88,15 +91,14 @@


// fill target checkbox-trees
$mlist = $plist1 = $plist2 = '';
$mlist = $plist1 = '';
$mlist = opf_make_modules_checktree($modules, $type='tree', TRUE);
$plist1 = opf_make_pages_parent_checktree($pages_parent, $pages, $type='tree');
//$plist2 = opf_make_pages_checktree($pages, $type='tree');

// do we have to display additional_fields? - No
$list_growfield = "";
$list_editarea = "";
$extra_fields = array();
$list_growfield = "";
$list_editarea = "";
$extra_fields = "";


// init template
Expand All @@ -117,7 +119,8 @@
// checkbox-trees: contains the whole HTML-output. Just use echo
'tpl_module_tree' => $mlist,
'tpl_pages_list1' => $plist1,
'tpl_save_url' => opf_quotes(ADMIN_URL."/admintools/tool.php?tool=".basename(dirname(__FILE__)).'&amp;'.$admin->getFTAN(false)),
'tpl_save_url' => opf_quotes(ADMIN_URL."/admintools/tool.php?tool=".basename(dirname(__FILE__))),
'FTAN' => $ftan,
'tpl_id' => opf_quotes($id),
'tpl_filter_name' => opf_quotes($name),
'tpl_filter_funcname' => opf_quotes($funcname),
Expand All @@ -134,8 +137,8 @@
'tpl_filter_type_options' => $filter_type_options,
'WB_URL' => WB_URL,
'MOD_URL' => WB_URL.'/modules/'.$module_directory,
'IMAGE_URL' => WB_URL.'/modules/'.$module_directory.'/templates/images'

'IMAGE_URL' => WB_URL.'/modules/'.$module_directory.'/templates/images',
'TPL_EXTRA_FIELDS_BLOCK' => ""
)));


Expand All @@ -155,80 +158,7 @@
$tpl->set_var('TPL_FUNC_AREA_BLOCK', "");
}

// if extra_fileds is not empty parse the extra_fields_block and store the result in TPL_EXTRA_fields_AREA_BLOCK
if(!empty($extra_fields)){
$TPL_EXTRA_FIELDS_BLOCK="";
foreach($extra_fields as $field){
$template=$field['type'];
if($field['type']=='editarea')$template='textarea';
$tpl_field_text=opf_quotes($field['text']);
$tpl->set_var('tpl_field_text', $tpl_field_text);
$tpl_field_name=opf_quotes($field['name']);
$tpl->set_var('tpl_field_name', $tpl_field_name);
$tpl_field_value=$field['value'];
$tpl_field_id='';
if($template=='textarea'){
$tpl_field_id=opf_quotes($field['id']);
} else {
$tpl_field_value=opf_quotes($tpl_field_value);
}
$tpl->set_var('tpl_field_value', $tpl_field_value);
$tpl->set_var('tpl_field_id', $tpl_field_id);
$tpl_field_style=$field['style'];
$tpl->set_var('tpl_field_style', $tpl_field_style);
if(isset($field['checked']))
$tpl_field_checked=$field['checked'];
else $tpl_field_checked="";
$tpl->set_var('tpl_field_checked', $tpl_field_checked);
if(isset($field['options']))
$tpl_field_options=$field['options'];
else $tpl_field_options="";
$tpl->set_var('tpl_field_options', $tpl_field_options);

if($field['type']=='array'){
foreach($field['values'] as $key=>$value){
$tpl->set_var('tpl_key', $key);
$tpl->set_var('tpl_value', $value);
$keyid=uniqid();
$list_growfield[]=$keyid;
$tpl->set_var('tpl_keyid', $keyid);
$valid=uniqid();
$list_growfield[]=$valid;
$tpl->set_var('tpl_valid', $valid);
// first parse the block specific to this field type
$tpl->set_block('page', 'array_row_block', 'extra_field');
$TPL_EXTRA_FIELDS_BLOCK .= $tpl->parse('TPL_FIELD_BLOCK', 'array_row_block', false);
}
} else {
// in short, pretty much the same, but just do it only once
$tpl->set_block('page', $template.'_block', 'extra_field');
$TPL_EXTRA_FIELDS_BLOCK .= $tpl->parse('TPL_FIELD_BLOCK', $template.'_block', false);
}
}
$tpl->set_var('TPL_EXTRA_FIELDS_BLOCK', $TPL_EXTRA_FIELDS_BLOCK);
} else {
$tpl->set_var('TPL_EXTRA_FIELDS_BLOCK', "");
}

// if list_editarea is present update tpl_list_editarea
if($list_editarea <> ""){
$tpl_list_editarea = "var opf_editarea_list = new Array();";
$i = 0;
foreach($list_editarea as $id) {
$tpl_list_editarea .= 'opf_editarea_list['.$i++.'] = '."'$id';";
}
$tpl->set_var('tpl_list_editarea', $tpl_list_editarea);
}

// if list_growfield is present update tpl_list_growfield
if($list_growfield <> ""){
$tpl_list_growfield = "var opf_growfield_list = new Array();";
$i = 0;
foreach($list_growfield as $id) {
$tpl_list_growfield .= 'opf_growfield_list['.$i++.'] = '."'$id';";
}
$tpl->set_var('tpl_list_growfield', $tpl_list_growfield);
}


// show page
Expand Down
2 changes: 1 addition & 1 deletion backend.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ backend.css
*
* @category tool
* @package Outputfilter Dashboard
* @version 1.4.5
* @version 1.4.8
* @authors Thomas "thorn" Hornik <[email protected]>, Christian M. Stefan (Stefek) <[email protected]>, Martin Hecht (mrbaseman) <[email protected]>
* @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2016 Martin Hecht (mrbaseman)
* @link https://github.com/WebsiteBaker-modules/outpufilter_dashboard
Expand Down
2 changes: 1 addition & 1 deletion backend_body.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ backend_body.js
*
* @category tool
* @package Outputfilter Dashboard
* @version 1.4.5
* @version 1.4.8
* @authors Thomas "thorn" Hornik <[email protected]>, Christian M. Stefan (Stefek) <[email protected]>, Martin Hecht (mrbaseman) <[email protected]>
* @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2016 Martin Hecht (mrbaseman)
* @link https://github.com/WebsiteBaker-modules/outpufilter_dashboard
Expand Down
2 changes: 1 addition & 1 deletion config_init.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @category tool
* @package Outputfilter Dashboard
* @version 1.4.5
* @version 1.4.8
* @authors Thomas "thorn" Hornik <[email protected]>, Christian M. Stefan (Stefek) <[email protected]>, Martin Hecht (mrbaseman) <[email protected]>
* @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2016 Martin Hecht (mrbaseman)
* @link https://github.com/WebsiteBaker-modules/outpufilter_dashboard
Expand Down
5 changes: 3 additions & 2 deletions css.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @category tool
* @package Outputfilter Dashboard
* @version 1.4.5
* @version 1.4.8
* @authors Thomas "thorn" Hornik <[email protected]>, Christian M. Stefan (Stefek) <[email protected]>, Martin Hecht (mrbaseman) <[email protected]>
* @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2016 Martin Hecht (mrbaseman)
* @link https://github.com/WebsiteBaker-modules/outpufilter_dashboard
Expand Down Expand Up @@ -71,7 +71,8 @@
$tpl->set_var(
array_merge($LANG['MOD_OPF'],
array(
'tpl_save_url' => opf_quotes("$ToolUrl&amp;id=$id&amp;css_save=1&amp;".$admin->getFTAN(false)),
'tpl_save_url' => opf_quotes("$ToolUrl&amp;id=$id&amp;css_save=1"),
'FTAN' => $ftan,
'tpl_id' => opf_quotes($id),
'tpl_csspath' => opf_quotes($csspath),
'tpl_css' => opf_quotes($css),
Expand Down
2 changes: 1 addition & 1 deletion debug_conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @category tool
* @package Outputfilter Dashboard
* @version 1.4.5
* @version 1.4.8
* @authors Thomas "thorn" Hornik <[email protected]>, Christian M. Stefan (Stefek) <[email protected]>, Martin Hecht (mrbaseman) <[email protected]>
* @copyright (c) 2009,2010 Thomas "thorn" Hornik, 2010 Christian M. Stefan (Stefek), 2016 Martin Hecht (mrbaseman)
* @link https://github.com/WebsiteBaker-modules/outpufilter_dashboard
Expand Down
2 changes: 1 addition & 1 deletion docs/files/CHANGELOG-txt.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@



<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="Version-History"></a>Version-History</h1><div class=CBody><h4 class=CHeading>1.4</h4><p><b>this version is a major re-engineering of the module with the goal to use it without PMF.</b>&nbsp; Special thanks to all who have tested and especially to NorHei for fruitful discussions and for providing additional testing ressources.</p><p>1.4.5 <span class="mypriv_vartype">(mrbaseman, 09 Feb 2016)</span></p><ul><li>update documentation layout</li><li>include example plugins again</li><li>update patch check</li><li>merge in Stefek&rsquo;s changes, thanks for your contribution and for your ideas you have contributed</li><li>automatically remove naturaldocs sources during install</li><li>various minor changes to make it working in upcoming wb-classic releases</li></ul><p>1.4.4 <span class="mypriv_vartype">(Stefek, 05 Feb 2016)</span></p><ul><li>added the following tokens to apply instead of hardcoded pathes within OpF-Plugins:</li></ul><blockquote><pre class="prettyprint">{SYSVAR:WB_URL} = will replace with the content of the Constant WB_URL
<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="Version-History"></a>Version-History</h1><div class=CBody><h4 class=CHeading>1.4</h4><p><b>this version is a major re-engineering of the module with the goal to use it without PMF.</b>&nbsp; Special thanks to all who have tested and especially to NorHei for fruitful discussions and for providing additional testing ressources.</p><p>1.4.8 <span class="mypriv_vartype">(mrbaseman, 21 Feb 2016)</span></p><ul><li>remove unused code part from add_filter to fix array conversion warnings</li><li>update plugin filters to use new placeholders introduced in 1.4.4</li></ul><blockquote><pre class="prettyprint">in order to pick up this change you have to remove the example filters before upgrading OpF</pre></blockquote><ul><li>update documentation: added a section which explains the use of the constants and placeholders</li></ul><p>1.4.7 <span class="mypriv_vartype">(mrbaseman, 21 Feb 2016)</span></p><ul><li>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)</li><li>security fix: check ftan for upload</li><li>several fixes for arrays as additional field (like in correct date example)</li><li>fix css edit for filters that provide css</li></ul><p>1.4.6 <span class="mypriv_vartype">(mrbaseman, 18 Feb 2016)</span></p><ul><li>add module icon for WBCE 1.2</li><li>bugfix: do not allow moving up uppermost filter</li><li>switch from FTANs to IDKEYs in many places of the backend</li></ul><p>1.4.5 <span class="mypriv_vartype">(mrbaseman, 09 Feb 2016)</span></p><ul><li>update documentation layout</li><li>include example plugins again</li><li>update patch check</li><li>merge in Stefek&rsquo;s changes, thanks for your contribution and for your ideas you have contributed</li><li>automatically remove naturaldocs sources during install</li><li>various minor changes to make it working in upcoming wb-classic releases</li></ul><p>1.4.4 <span class="mypriv_vartype">(Stefek, 05 Feb 2016)</span></p><ul><li>added the following tokens to apply instead of hardcoded pathes within OpF-Plugins:</li></ul><blockquote><pre class="prettyprint">{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
{OPF:PLUGIN_URL} = will replace with WB_URL.'/modules/outputfilter_dashboard/plugins/{your_plugin}'
{OPF:PLUGIN_PATH} = will replace with WB_PATH.'/modules/outputfilter_dashboard/plugins/{your_plugin}'</pre></blockquote><ul><li>added 2 CONSTANTS to work with OPF Plugins</li></ul><blockquote><pre class="prettyprint">OPF_PLUGINS_PATH
Expand Down
2 changes: 1 addition & 1 deletion docs/files/DE/install_filter_module-txt.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
opf_register_filter(array(
'name' =&gt; 'Searchengine Highlighter',
'type' =&gt; OPF_TYPE_PAGE_LAST,
'file' =&gt; WB_PATH.'/modules/mymodule/filter.php',
'file' =&gt; '{SYSVAR:WB_PATH}/modules/mymodule/filter.php',
'funcname' =&gt; 'opff_searchengine_highlight',
'desc' =&gt; &quot;Google-Search-Highlighter&quot;,
'active' =&gt; 1,
Expand Down
8 changes: 6 additions & 2 deletions docs/files/DE/install_filter_plugin-txt.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@

<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="Plugin-Filter_schreiben(de)"></a>Plugin-Filter schreiben (de)</h1><div class=CBody><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#Plugin-Filter_schreiben(de)" >Plugin-Filter schreiben (de)</a></td><td class=SDescription></td></tr><tr class="SGeneric SMarked"><td class=SEntry><a href="#Einen_Plugin-Filter_erzeugen" >Einen Plugin-Filter erzeugen</a></td><td class=SDescription>Plugin-Filter sind, &auml;hnlich wie Module, ZIP-Archive aus den Dateien <span class="mypriv_var">plugin_info.php</span>, <span class="mypriv_var">plugin_install.php</span>, <span class="mypriv_var">filter.php</span>&nbsp; </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Einen_Plugin-Filter_erzeugen"></a>Einen Plugin-Filter erzeugen</h3><div class=CBody><p>Plugin-Filter sind, &auml;hnlich wie Module, ZIP-Archive aus den Dateien <span class="mypriv_var">plugin_info.php</span>, <span class="mypriv_var">plugin_install.php</span>, <span class="mypriv_var">filter.php</span> und m&ouml;glicherweise <span class="mypriv_var">plugin_uninstall.php</span>.</p><h4 class=CHeading>plugin_info.php</h4><blockquote><pre class="prettyprint">&lt;?php
<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Einen_Plugin-Filter_erzeugen"></a>Einen Plugin-Filter erzeugen</h3><div class=CBody><p>Plugin-Filter sind, &auml;hnlich wie Module, ZIP-Archive aus den Dateien <span class="mypriv_var">plugin_info.php</span>, <span class="mypriv_var">plugin_install.php</span>, <span class="mypriv_var">filter.php</span> und m&ouml;glicherweise <span class="mypriv_var">plugin_uninstall.php</span>.</p><p>Die folgenden Platzhalter k&ouml;nnen anstelle von hart codierten Pfaden innerhalb von OpF-Plugins verwendet werden</p><blockquote><pre class="prettyprint">{SYSVAR:WB_URL} = wird durch den Inhalt der Konstanten WB_URL ersetzt
{SYSVAR:WB_PATH} = wird durch den Inhalt der Konstanten WB_PATH ersetzt
{OPF:PLUGIN_URL} = wird durch WB_URL.'/modules/outputfilter_dashboard/plugins/{plugin_name}' ersetzt
{OPF:PLUGIN_PATH} = wird durch WB_PATH.'/modules/outputfilter_dashboard/plugins/{plugin_name}' ersetzt</pre></blockquote><p>Innerhalb der Filter funktionen funktionieren die folgenden KONSTANTEN f&uuml;r OPF Plugins</p><blockquote><pre class="prettyprint">OPF_PLUGINS_PATH
OPF_PLUGINS_URL</pre></blockquote><p>Der Pfad und die Url zum Plugins-Ordner ist sehr lang und wird h&auml;ufig innerhalb von FIltern ben&ouml;tigt, daher sind diese Konstanten eine bequeme Erg&auml;nzung.&nbsp; Die URL ist</p><blockquote><pre class="prettyprint">OPF_PLUGINS_URL = [ WB_URL.'/modules/'.basename(dirname(__FILE__)).'/plugins/' ]</pre></blockquote><h4 class=CHeading>plugin_info.php</h4><blockquote><pre class="prettyprint">&lt;?php
$plugin_directory = 'cachecontrol';
$plugin_name = 'Cache Control';
$plugin_version = '1.0.0';
Expand All @@ -26,7 +30,7 @@
'plugin' =&gt; 'cachecontrol',
'name' =&gt; 'Cache Control',
'type' =&gt; OPF_TYPE_PAGE_LAST,
'file' =&gt; WB_PATH.'/modules/outputfilter_dashboard/plugins/cachecontrol/filter.php',
'file' =&gt; '{OPF:PLUGIN_PATH}/filter.php',
'funcname' =&gt; 'opff_cachecontrol',
'desc' =&gt; array('EN' =&gt; &quot;Description ... Take care that this filter is called last!&quot;,
'DE' =&gt; &quot;Beschreibung ... Achten Sie darauf, da&szlig; dieser Filter als letzter aufgerufen wird!&quot;
Expand Down
2 changes: 1 addition & 1 deletion docs/files/EN/install_filter_module-txt.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
opf_register_filter(array(
'name' =&gt; 'Searchengine Highlighter',
'type' =&gt; OPF_TYPE_PAGE_LAST,
'file' =&gt; WB_PATH.'/modules/mymodule/filter.php',
'file' =&gt; '{SYSVAR:WB_PATH}/modules/mymodule/filter.php',
'funcname' =&gt; 'opff_searchengine_highlight',
'desc' =&gt; &quot;Google-Search-Highlighter&quot;,
'active' =&gt; 1,
Expand Down
Loading

0 comments on commit ddb70c0

Please sign in to comment.