add search filter, fix form url

This commit is contained in:
Jean-Christian Denis 2021-10-10 11:23:02 +02:00
parent 67a214bbe8
commit 27dea8d717
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
2 changed files with 14 additions and 23 deletions

View file

@ -39,9 +39,9 @@ class zoneclearFeedServer
*/
public function __construct(dcCore $core)
{
$this->core = $core;
$this->con = $core->con;
$this->blog = $core->con->escape($core->blog->id);
$this->core = $core;
$this->con = $core->con;
$this->blog = $core->con->escape($core->blog->id);
$this->table = $core->prefix . 'zc_feed';
}
@ -87,11 +87,7 @@ class zoneclearFeedServer
}
# --BEHAVIOR-- zoneclearFeedServerAfterUpdFeed
$this->core->callBehavior(
'zoneclearFeedServerAfterUpdFeed',
$cur,
$id
);
$this->core->callBehavior('zoneclearFeedServerAfterUpdFeed', $cur, $id);
}
/**
@ -120,10 +116,7 @@ class zoneclearFeedServer
}
# --BEHAVIOR-- zoneclearFeedServerAfterAddFeed
$this->core->callBehavior(
'zoneclearFeedServerAfterAddFeed',
$cur
);
$this->core->callBehavior('zoneclearFeedServerAfterAddFeed', $cur);
return $cur->feed_id;
}
@ -166,12 +159,7 @@ class zoneclearFeedServer
}
# --BEHAVIOR-- zoneclearFeedServerAfterEnableFeed
$this->core->callBehavior(
'zoneclearFeedServerAfterEnableFeed',
$id,
$enable,
$time
);
$this->core->callBehavior('zoneclearFeedServerAfterEnableFeed', $id, $enable, $time);
}
#
@ -189,10 +177,7 @@ class zoneclearFeedServer
}
# --BEHAVIOR-- zoneclearFeedServerBeforeDelFeed
$this->core->callBehavior(
'zoneclearFeedServerBeforeDelFeed',
$id
);
$this->core->callBehavior('zoneclearFeedServerBeforeDelFeed', $id);
$this->con->execute(sprintf(
"DELETE FROM %s WHERE feed_id = %s AND blog_id = '%s' ",
@ -293,6 +278,11 @@ class zoneclearFeedServer
$strReq .= "AND Z.feed_status = " . ((integer) $params['feed_status']) . " ";
}
if (!empty($params['q'])) {
$q = $this->con->escape(str_replace('*', '%', strtolower($params['q'])));
$strReq .= "AND LOWER(Z.feed_name) LIKE '" . $q . "' ";
}
if (!empty($params['sql'])) {
$strReq .= $params['sql'] . ' ';
}

View file

@ -470,6 +470,7 @@ if (isset($_REQUEST['part']) && $_REQUEST['part'] == 'feed') {
$feeds_filter = new adminGenericFilter($core, 'zcfs_feeds');
$feeds_filter->add('part', 'feeds');
$feeds_filter->add(dcAdminFilters::getPageFilter());
$feeds_filter->add(dcAdminFilters::getSearchFilter());
$params = $feeds_filter->params();
# feeds
@ -514,7 +515,7 @@ if (isset($_REQUEST['part']) && $_REQUEST['part'] == 'feed') {
);
$feeds_list->feedsDisplay($feeds_filter->page, $feeds_filter->nb,
'<form action="' . $core->adminurl->getHiddenFormFields('admin.plugin.zoneclearFeedServer', ['part', 'feeds']) . '" method="post" id="form-actions">' .
'<form action="' . $core->adminurl->get('admin.plugin.zoneclearFeedServer', ['part', 'feeds']) . '" method="post" id="form-actions">' .
'%s' .
'<div class="two-cols">' .
'<p class="col checkboxes-helpers"></p>' .