Skip to content

Commit

Permalink
for 1.5.6:
Browse files Browse the repository at this point in the history
        - 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
  • Loading branch information
mrbaseman committed Nov 5, 2018
1 parent 2fe75f5 commit 4c5afe4
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 33 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
Header: Version-History

1.5:
1.5.6 %(mrbaseman, 3 Oct 2018)%
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
Expand Down
2 changes: 1 addition & 1 deletion docs/files/CHANGELOG-txt.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index/Files.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@


<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt3"><div class=CFile>1.5.6 <span class="mypriv_vartype">(mrbaseman, 3 Oct 2018)</span></div></div><!--END_ND_TOOLTIPS-->
<div class=CToolTip id="tt3"><div class=CFile>1.5.6 <span class="mypriv_vartype">(mrbaseman, 04 Nov 2018)</span></div></div><!--END_ND_TOOLTIPS-->

</div><!--Index-->

Expand Down
2 changes: 1 addition & 1 deletion docs/index/General.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@


<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt50"><div class=CFile>1.5.6 <span class="mypriv_vartype">(mrbaseman, 3 Oct 2018)</span></div></div><div class=CToolTip id="tt51"><div class=CGeneric>Vor der Installation von OutputFilter-Dashboard mu&szlig; das alte Frontend-Filter-Admin Modul - wenn vorhanden - deinstalliert werden, nicht zu verwechseln mit dem Frontend-Output-Filter!</div></div><div class=CToolTip id="tt52"><div class=CGeneric>Website Baker 2.8 oder neuer.</div></div><!--END_ND_TOOLTIPS-->
<div class=CToolTip id="tt50"><div class=CFile>1.5.6 <span class="mypriv_vartype">(mrbaseman, 04 Nov 2018)</span></div></div><div class=CToolTip id="tt51"><div class=CGeneric>Vor der Installation von OutputFilter-Dashboard mu&szlig; das alte Frontend-Filter-Admin Modul - wenn vorhanden - deinstalliert werden, nicht zu verwechseln mit dem Frontend-Output-Filter!</div></div><div class=CToolTip id="tt52"><div class=CGeneric>Website Baker 2.8 oder neuer.</div></div><!--END_ND_TOOLTIPS-->

</div><!--Index-->

Expand Down
13 changes: 6 additions & 7 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1186,12 +1186,11 @@ function opf_apply_filters(&$content, $type, $module, $page_id, $section_id, $wb
foreach($opf_FILTERS as $key => $filter) {
if(is_array($filter) && isset($filter['pages_parent'])) {
if($filter['active'] && $filter['type']==$type
&& ($module=='' || in_array($module, $filter['modules']) || in_array('all', $filter['modules']))
&& ( ($page_id == 'backend') && (in_array('backend', $filter['pages']))
|| ( ($page_id != 'backend') && (in_array('all', $filter['pages']) || in_array($page_id, $filter['pages'])) )
|| ( ($page_id != 'backend') && (in_array('all', $filter['pages_parent']) || in_array($page_id, $filter['pages_parent'])) )
|| ( ($page_id == '0') && (in_array('all', $filter['pages']) || in_array('all', $filter['pages_parent']) || in_array('0', $filter['pages_parent']) ) )

&& ( $module==FALSE || $module=='' || in_array($module, $filter['modules']) || in_array('all', $filter['modules']) )
&& ( ( ($page_id == 'backend') && (in_array('backend', $filter['pages']) || in_array('backend',$filter['pages_parent'])) )
|| ( ($page_id != 'backend') && (in_array('all', $filter['pages']) || in_array($page_id, $filter['pages'])) )
|| ( ($page_id != 'backend') && (in_array('all', $filter['pages_parent']) || in_array($page_id, $filter['pages_parent'])) )
|| ( ($page_id == '0') && (in_array('all', $filter['pages']) || in_array('all', $filter['pages_parent']) || in_array('0', $filter['pages_parent'])) )
)) {

if(!function_exists($filter['funcname'])) {
Expand Down Expand Up @@ -1448,7 +1447,7 @@ function opf_make_pages_parent_checktree($pages_parent, $pages, $type='tree') {
} elseif($type=='tree') {
$plist = '<div class="checktreestylearea"><ul class="tree2 checktreestyle">';
$plist .= '<li><input type="checkbox" name="searchresult" value="0" '.$search_checked.' /><label>'.$LANG['MOD_OPF']['TXT_SEARCH_RESULTS'].'</label></li>';
if (class_exists ("Tool") && defined('WBCE_VERSION')){ // backend-filtering supported
if (defined('WBCE_VERSION') && version_compare(WBCE_VERSION, '1.3.0', '>=')){ // backend-filtering in general for pages supported
$plist .= '<li><input type="checkbox" name="backend" value="backend" '.$backend_checked.' /><label>'.$LANG['MOD_OPF']['TXT_BACKEND'].'</label></li>';
}
$plist .= '<li><input type="checkbox" name="pages_parent[]" value="all" /><label>'.$LANG['MOD_OPF']['TXT_ALL_PAGES'].'</label><ul>';
Expand Down
4 changes: 2 additions & 2 deletions functions_outputfilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ function opf_register_filter($filter, $serialized=FALSE) {

// get next free position for type
$position = opf_db_query_vars( "SELECT MAX(`position`) FROM `".TABLE_PREFIX."mod_outputfilter_dashboard` WHERE `type`='%s'", $type);
if(!$position) $position = 0; // NULL -> no entries
if($position===NULL) $position = 0; // NULL -> no entries
else ++$position;

// new entry or update?
Expand Down Expand Up @@ -1363,7 +1363,7 @@ function opf_filter_get_data($name='') {
$name = opf_check_name($name);
if(!$name)
$name = opf_filter_get_name_current();
if($name && in_array($name, $opf_FILTERS))
if($name && array_key_exists($name, $opf_FILTERS))
return($opf_FILTERS[$name]);
else return(FALSE);
}
Expand Down
16 changes: 10 additions & 6 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,16 @@
}
}

// run install scripts of already present module filters
foreach( preg_grep('/\/install.php/', opf_io_filelist(WB_PATH.'/modules')) as $installer){
if(strpos($installer,'outputfilter_dashboard')===FALSE){
$contents = file_get_contents($installer);
if(preg_match('/opf_register_filter/',$contents)){
require($installer);
// Only block this if WBCE CMS installer is running, if this is an Upgrade or
// Module install, we need this. But the installer registers the filter-modules later.
if(!defined('WB_INSTALLER')){
// run install scripts of already present module filters
foreach( preg_grep('/\/install.php/', opf_io_filelist(WB_PATH.'/modules')) as $installer){
if(strpos($installer,'outputfilter_dashboard')===FALSE){
$contents = file_get_contents($installer);
if(preg_match('/opf_register_filter/',$contents)){
require($installer);
}
}
}
}
7 changes: 6 additions & 1 deletion naturaldocs_txt/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
Header: Version-History

1.5:
1.5.6 %(mrbaseman, 3 Oct 2018)%
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
Expand Down
4 changes: 2 additions & 2 deletions naturaldocs_txt/functions_outputfilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ function opf_register_filter($filter, $serialized=FALSE) {

// get next free position for type
$position = opf_db_query_vars( "SELECT MAX(`position`) FROM `".TABLE_PREFIX."mod_outputfilter_dashboard` WHERE `type`='%s'", $type);
if(!$position) $position = 0; // NULL -> no entries
if($position===NULL) $position = 0; // NULL -> no entries
else ++$position;

// new entry or update?
Expand Down Expand Up @@ -1363,7 +1363,7 @@ function opf_filter_get_data($name='') {
$name = opf_check_name($name);
if(!$name)
$name = opf_filter_get_name_current();
if($name && in_array($name, $opf_FILTERS))
if($name && array_key_exists($name, $opf_FILTERS))
return($opf_FILTERS[$name]);
else return(FALSE);
}
Expand Down
14 changes: 5 additions & 9 deletions tool.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,15 @@
}

$simple_backend=dirname($ModPath)."/opf_simple_backend/tool.php";
if(class_exists('Settings') && defined('WBCE_VERSION')
&& file_exists($simple_backend)){
if(((isset($_POST['show_advanced_backend'])) && ($_POST['show_advanced_backend'] == 0))
|| ((!(isset($_POST['show_advanced_backend'])) &&
(!(Settings::Get( 'opf_show_advanced_backend', TRUE)))))){
if(class_exists('Settings') && defined('WBCE_VERSION') && file_exists($simple_backend)){
if(isset($_POST['show_advanced_backend']) || ! Settings::Get( 'opf_show_advanced_backend', TRUE)){
include($simple_backend);
if($need_footer){
if( ! Settings::Get( 'opf_show_advanced_backend', TRUE)){
$admin->print_footer();
exit(0);
}
exit(0);
} else {
$simple_backend=dirname($ModPath)."/opf_simple_backend/advanced.php";
}
$simple_backend=dirname($ModPath)."/opf_simple_backend/advanced.php";
} else {
$simple_backend="";
}
Expand Down
4 changes: 2 additions & 2 deletions upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@
}

// Only block this if WBCE CMS installer is running, if this is an Upgrade or
// Module install, we need this thing.
if(!defined('WB_INSTALL')){
// Module install, we need this. But the installer registers the filter-modules later.
if(!defined('WB_INSTALLER')){
// run install scripts of module filters - they should start upgrade if already installed
foreach( preg_grep('/\/install.php/', opf_io_filelist(WB_PATH.'/modules')) as $installer){
if(strpos($installer,'outputfilter_dashboard')===FALSE){
Expand Down

0 comments on commit 4c5afe4

Please sign in to comment.