prepare to DC 2.24
This commit is contained in:
parent
41f6c20e6f
commit
94f7e4da7e
19
_admin.php
19
_admin.php
@ -10,23 +10,22 @@
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if (!defined('DC_CONTEXT_ADMIN')) {
|
||||
return;
|
||||
}
|
||||
|
||||
# settings namespace
|
||||
$core->blog->settings->addNamespace('saba');
|
||||
dcCore::app()->blog->settings->addNamespace('saba');
|
||||
|
||||
# widget
|
||||
require_once dirname(__FILE__) . '/_widgets.php';
|
||||
require_once __DIR__ . '/_widgets.php';
|
||||
|
||||
# behaviors
|
||||
$core->addBehavior(
|
||||
'adminBlogPreferencesForm',
|
||||
dcCore::app()->addBehavior(
|
||||
'adminBlogPreferencesFormV2',
|
||||
['adminSaba', 'adminBlogPreferencesForm']
|
||||
);
|
||||
$core->addBehavior(
|
||||
dcCore::app()->addBehavior(
|
||||
'adminBeforeBlogSettingsUpdate',
|
||||
['adminSaba', 'adminBeforeBlogSettingsUpdate']
|
||||
);
|
||||
@ -34,19 +33,19 @@ $core->addBehavior(
|
||||
# add settings to admin blog pref page
|
||||
class adminSaba
|
||||
{
|
||||
public static function adminBlogPreferencesForm($core, $blog_settings)
|
||||
public static function adminBlogPreferencesForm($blog_settings)
|
||||
{
|
||||
echo
|
||||
'<div class="fieldset">' .
|
||||
'<h4 id="saba_params">' . __('Search Across Blog Archive') . '</h4>' .
|
||||
'<p><label class="classic">' .
|
||||
form::checkbox('saba_active', '1', (boolean) $blog_settings->saba->active) .
|
||||
form::checkbox('saba_active', '1', (bool) $blog_settings->saba->active) .
|
||||
__('Enable advanced search on this blog') . '</label></p>' .
|
||||
'<p><label class="classic">' .
|
||||
form::checkbox('saba_error', '1', (boolean) $blog_settings->saba->error) .
|
||||
form::checkbox('saba_error', '1', (bool) $blog_settings->saba->error) .
|
||||
__('Enable suggestion for page 404') . '</label></p>' .
|
||||
'<p class="form-note">' .
|
||||
__("This suggests visitors some posts on page 404.") .
|
||||
__('This suggests visitors some posts on page 404.') .
|
||||
'</p>' .
|
||||
'</div>';
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
return null;
|
||||
}
|
||||
@ -19,13 +18,13 @@ $this->registerModule(
|
||||
'saba',
|
||||
'Search across blog archive',
|
||||
'Jean-Christian Denis and Contributors',
|
||||
'2021.09.10',
|
||||
'2022.11.12',
|
||||
[
|
||||
'requires' => [['core', '2.19']],
|
||||
'permissions' => 'admin',
|
||||
'requires' => [['core', '2.24']],
|
||||
'permissions' => dcAuth::PERMISSION_ADMIN,
|
||||
'type' => 'plugin',
|
||||
'support' => 'https://github.com/JcDenis/saba',
|
||||
'details' => 'https://plugins.dotaddict.org/dc2/details/saba',
|
||||
'repository' => 'https://raw.githubusercontent.com/JcDenis/saba/master/dcstore.xml'
|
||||
'repository' => 'https://raw.githubusercontent.com/JcDenis/saba/master/dcstore.xml',
|
||||
]
|
||||
);
|
114
_public.php
114
_public.php
@ -10,47 +10,46 @@
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
# setting
|
||||
$core->blog->settings->addNamespace('saba');
|
||||
dcCore::app()->blog->settings->addNamespace('saba');
|
||||
|
||||
if (!$core->blog->settings->saba->active) {
|
||||
if (!dcCore::app()->blog->settings->saba->active) {
|
||||
return null;
|
||||
}
|
||||
|
||||
# translation
|
||||
l10n::set(dirname(__FILE__) . '/locales/' . $_lang . '/public');
|
||||
l10n::set(__DIR__ . '/locales/' . dcCore::app()->lang . '/public');
|
||||
|
||||
# widget
|
||||
require_once dirname(__FILE__) . '/_widgets.php';
|
||||
require_once __DIR__ . '/_widgets.php';
|
||||
|
||||
# template path
|
||||
$core->tpl->setPath(
|
||||
$core->tpl->getPath(),
|
||||
dirname(__FILE__) . '/default-templates/'
|
||||
dcCore::app()->tpl->setPath(
|
||||
dcCore::app()->tpl->getPath(),
|
||||
__DIR__ . '/default-templates/'
|
||||
);
|
||||
|
||||
# behavior
|
||||
$core->addBehavior(
|
||||
dcCore::app()->addBehavior(
|
||||
'templateCustomSortByAlias',
|
||||
['pubSaba', 'templateCustomSortByAlias']
|
||||
);
|
||||
$core->addBehavior(
|
||||
dcCore::app()->addBehavior(
|
||||
'urlHandlerBeforeGetData',
|
||||
['pubSaba', 'urlHandlerBeforeGetData']
|
||||
);
|
||||
$core->addBehavior(
|
||||
dcCore::app()->addBehavior(
|
||||
'coreBlogBeforeGetPosts',
|
||||
['pubSaba', 'coreBlogBeforeGetPosts']
|
||||
);
|
||||
|
||||
# url
|
||||
if ($core->blog->settings->saba->error) {
|
||||
$core->url->registerError(['urlSaba', 'error']);
|
||||
if (dcCore::app()->blog->settings->saba->error) {
|
||||
dcCore::app()->url->registerError(['urlSaba', 'error']);
|
||||
}
|
||||
|
||||
class pubSaba
|
||||
@ -65,18 +64,15 @@ class pubSaba
|
||||
'update' => 'post_upddt',
|
||||
'id' => 'post_id',
|
||||
'comment' => 'nb_comment',
|
||||
'trackback' => 'nb_trackback'
|
||||
'trackback' => 'nb_trackback',
|
||||
];
|
||||
}
|
||||
|
||||
public static function urlHandlerBeforeGetData($_ctx)
|
||||
{
|
||||
global $core;
|
||||
|
||||
$options = tplSaba::getSabaDefaultPostsOptions();
|
||||
|
||||
if (!empty($_GET['q']) && 1 < strlen($_GET['q'])) {
|
||||
|
||||
# search string
|
||||
$params = new ArrayObject(['search' => rawurldecode($_GET['q'])]);
|
||||
|
||||
@ -84,28 +80,29 @@ class pubSaba
|
||||
$options['q'] = rawurldecode($_GET['q']);
|
||||
|
||||
# count
|
||||
$GLOBALS['_search'] = rawurldecode($_GET['q']);
|
||||
if ($GLOBALS['_search']) {
|
||||
$GLOBALS['_search_count'] = $core->blog->getPosts($params, true)->f(0);
|
||||
dcCore::app()->public->search = rawurldecode($_GET['q']);
|
||||
if (dcCore::app()->public->search) {
|
||||
dcCore::app()->public->search_count = dcCore::app()->blog->getPosts($params, true)->f(0);
|
||||
}
|
||||
|
||||
# pagintaion
|
||||
$_page_number = !isset($GLOBALS['_page_number']) ? 1 : $GLOBALS['_page_number'];
|
||||
$params['limit'] = $_ctx->nb_entry_per_page;
|
||||
$_page_number = dcCore::app()->public->getPageNumber();
|
||||
if ($_page_number < 1) {
|
||||
$_page_number = 1;
|
||||
}
|
||||
$params['limit'] = dcCore::app()->ctx->nb_entry_per_page;
|
||||
$params['limit'] = [(($_page_number - 1) * $params['limit']), $params['limit']];
|
||||
|
||||
# get posts
|
||||
$_ctx->post_params = $params;
|
||||
$_ctx->posts = $core->blog->getPosts($params);
|
||||
dcCore::app()->ctx->post_params = $params;
|
||||
dcCore::app()->ctx->posts = dcCore::app()->blog->getPosts($params);
|
||||
unset($params);
|
||||
}
|
||||
$_ctx->saba_options = $options;
|
||||
dcCore::app()->ctx->saba_options = $options;
|
||||
}
|
||||
|
||||
public static function getPostsParams($params)
|
||||
{
|
||||
global $core;
|
||||
|
||||
if (!isset($params['sql'])) {
|
||||
$params['sql'] = '';
|
||||
}
|
||||
@ -123,26 +120,25 @@ class pubSaba
|
||||
|
||||
# options
|
||||
if (!empty($get['q_opt'])) {
|
||||
|
||||
if (in_array('selected', $get['q_opt'])) {
|
||||
$options['q_opt'][] = 'selected';
|
||||
$params['post_selected'] = 1;
|
||||
}
|
||||
if (in_array('comment', $get['q_opt'])) {
|
||||
$options['q_opt'][] = 'comment';
|
||||
$params['sql'] = "AND nb_comment > 0 ";
|
||||
$params['sql'] = 'AND nb_comment > 0 ';
|
||||
}
|
||||
if (in_array('trackback', $get['q_opt'])) {
|
||||
$options['q_opt'][] = 'trackback';
|
||||
$params['sql'] = "AND nb_trackback > 0";
|
||||
$params['sql'] = 'AND nb_trackback > 0';
|
||||
}
|
||||
}
|
||||
|
||||
# categories
|
||||
if (!empty($get['q_cat'])) {
|
||||
$cats = array();
|
||||
foreach($get['q_cat'] as $v) {
|
||||
$v = abs((integer) $v);
|
||||
$cats = [];
|
||||
foreach ($get['q_cat'] as $v) {
|
||||
$v = abs((int) $v);
|
||||
if (!$v) {
|
||||
continue;
|
||||
}
|
||||
@ -156,8 +152,8 @@ class pubSaba
|
||||
|
||||
# post types
|
||||
if (!empty($get['q_type'])) {
|
||||
$types = $core->getPostTypes();
|
||||
foreach($get['q_type'] as $v) {
|
||||
$types = dcCore::app()->getPostTypes();
|
||||
foreach ($get['q_type'] as $v) {
|
||||
if (!$types[$v]) {
|
||||
continue;
|
||||
}
|
||||
@ -187,9 +183,9 @@ class pubSaba
|
||||
|
||||
# user
|
||||
if (!empty($get['q_user'])) {
|
||||
$users = array();
|
||||
foreach($get['q_user'] as $v) {
|
||||
$users[] = "U.user_id = '" . $core->con->escape($v) . "'";
|
||||
$users = [];
|
||||
foreach ($get['q_user'] as $v) {
|
||||
$users[] = "U.user_id = '" . dcCore::app()->con->escape($v) . "'";
|
||||
$options['q_user'][] = $v;
|
||||
}
|
||||
if (!empty($users)) {
|
||||
@ -205,21 +201,19 @@ class pubSaba
|
||||
}
|
||||
$orders = tplSaba::getSabaFormOrders();
|
||||
if (!empty($get['q_order']) && in_array($get['q_order'], $orders)) {
|
||||
|
||||
$options['q_order'] = $get['q_order'];
|
||||
$params['order'] = $core->tpl->getSortByStr(
|
||||
['sortby' => $get['q_order'], 'order' => $sort],
|
||||
$params['order'] = dcCore::app()->tpl->getSortByStr(
|
||||
new ArrayObject(['sortby' => $get['q_order'], 'order' => $sort]),
|
||||
'post'
|
||||
); //?! post_type
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
# Ajouter la condition "ou" à la recherche
|
||||
public static function coreBlogBeforeGetPosts($p)
|
||||
{
|
||||
global $core;
|
||||
|
||||
if (empty($p['search'])) {
|
||||
return;
|
||||
}
|
||||
@ -227,19 +221,19 @@ class pubSaba
|
||||
self::getPostsParams($p);
|
||||
|
||||
$OR = [];
|
||||
foreach(explode(',', $p['search']) as $sentence) {
|
||||
foreach (explode(',', $p['search']) as $sentence) {
|
||||
$AND = [];
|
||||
$words = text::splitWords($sentence);
|
||||
foreach($words as $word) {
|
||||
$AND[] = "post_words LIKE '%" . $core->con->escape($word) . "%'";
|
||||
foreach ($words as $word) {
|
||||
$AND[] = "post_words LIKE '%" . dcCore::app()->con->escape($word) . "%'";
|
||||
}
|
||||
if (!empty($AND)) {
|
||||
$OR[] = " (" . implode (' AND ', $AND) . ") ";
|
||||
$OR[] = ' (' . implode(' AND ', $AND) . ') ';
|
||||
}
|
||||
}
|
||||
if (!empty($OR)) {
|
||||
$p['search'] = '';
|
||||
$p['sql'] .= "AND (" . implode (' OR ', $OR) . ") ";
|
||||
$p['sql'] .= 'AND (' . implode(' OR ', $OR) . ') ';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -248,8 +242,6 @@ class urlSaba extends dcUrlHandlers
|
||||
{
|
||||
public static function error($args, $type, $e)
|
||||
{
|
||||
global $core, $_ctx;
|
||||
|
||||
if ($e->getCode() == 404) {
|
||||
$q = explode('/', $args);
|
||||
if (empty($q)) {
|
||||
@ -276,14 +268,14 @@ class tplSaba
|
||||
public static function getSabaDefaultPostsOptions()
|
||||
{
|
||||
return [
|
||||
'q'=> '',
|
||||
'q' => '',
|
||||
'q_opt' => [],
|
||||
'q_cat' => [],
|
||||
'q_age' => '0,0',
|
||||
'q_user'=> [],
|
||||
'q_order'=> 'date',
|
||||
'q_user' => [],
|
||||
'q_order' => 'date',
|
||||
'q_rev' => '0',
|
||||
'q_type'=> []
|
||||
'q_type' => [],
|
||||
];
|
||||
}
|
||||
|
||||
@ -292,7 +284,7 @@ class tplSaba
|
||||
return [
|
||||
__('Selected entry') => 'selected',
|
||||
__('With comments') => 'comment',
|
||||
__('With trackbacks') => 'trackback'
|
||||
__('With trackbacks') => 'trackback',
|
||||
];
|
||||
}
|
||||
|
||||
@ -305,7 +297,7 @@ class tplSaba
|
||||
__('Date') => 'date',
|
||||
__('Update') => 'update',
|
||||
__('Comments count') => 'comment',
|
||||
__('Trackbacks count') => 'trackback'
|
||||
__('Trackbacks count') => 'trackback',
|
||||
];
|
||||
}
|
||||
|
||||
@ -316,7 +308,7 @@ class tplSaba
|
||||
__('Less than a month') => '0,2592000',
|
||||
__('From 1 to 6 month') => '2592000,15552000',
|
||||
__('From 6 to 12 month') => '15552000,31536000',
|
||||
__('More than a year') => '31536000,0'
|
||||
__('More than a year') => '31536000,0',
|
||||
];
|
||||
}
|
||||
|
||||
@ -326,18 +318,18 @@ class tplSaba
|
||||
'post' => __('Entry'),
|
||||
'page' => __('Page'),
|
||||
'pollsfactory' => __('Poll'),
|
||||
'eventhandler' => __('Event')
|
||||
'eventhandler' => __('Event'),
|
||||
];
|
||||
// todo: add behavior for unknow types
|
||||
|
||||
$rs = [];
|
||||
$types = $GLOBALS['core']->getPostTypes();
|
||||
$types = dcCore::app()->getPostTypes();
|
||||
|
||||
foreach($types as $k => $v) {
|
||||
foreach ($types as $k => $v) {
|
||||
if (!$v['public_url']) {
|
||||
continue;
|
||||
}
|
||||
$rs[isset($know[$k]) ? $know[$k] : __($k)] = $k;
|
||||
$rs[$know[$k] ?? __($k)] = $k;
|
||||
}
|
||||
|
||||
return $rs;
|
||||
|
69
_widgets.php
69
_widgets.php
@ -10,24 +10,21 @@
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$core->addBehavior('initWidgets', ['sabaWidget', 'setWidget']);
|
||||
dcCore::app()->addBehavior('initWidgets', ['sabaWidget', 'setWidget']);
|
||||
|
||||
class sabaWidget
|
||||
{
|
||||
public static function setWidget($w)
|
||||
{
|
||||
global $core;
|
||||
|
||||
$w
|
||||
->create(
|
||||
'saba',
|
||||
__('Advanced search'),
|
||||
array('sabaWidget', 'getWidget'),
|
||||
['sabaWidget', 'getWidget'],
|
||||
null,
|
||||
__('Add more search options on public side')
|
||||
)
|
||||
@ -79,15 +76,13 @@ class sabaWidget
|
||||
|
||||
public static function getWidget($w)
|
||||
{
|
||||
global $core, $_ctx;
|
||||
dcCore::app()->blog->settings->addNamespace('saba');
|
||||
|
||||
$core->blog->settings->addNamespace('saba');
|
||||
|
||||
if (!$core->blog->settings->saba->active) {
|
||||
if (!dcCore::app()->blog->settings->saba->active) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$core->blog->settings->saba->error && $core->url->type == '404') {
|
||||
if (!dcCore::app()->blog->settings->saba->error && dcCore::app()->url->type == '404') {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -95,12 +90,11 @@ class sabaWidget
|
||||
return;
|
||||
}
|
||||
|
||||
$q = $_ctx->saba_otpion ?? '';
|
||||
$q = dcCore::app()->ctx->saba_otpion ?? '';
|
||||
|
||||
# title and search
|
||||
$res =
|
||||
($w->title ? $w->renderTitle('<label for="q">' . html::escapeHTML($w->title) . '</label>') : '') .
|
||||
'<form action="' . $core->blog->url . '" method="get" role="search">' .
|
||||
$res = ($w->title ? $w->renderTitle('<label for="q">' . html::escapeHTML($w->title) . '</label>') : '') .
|
||||
'<form action="' . dcCore::app()->blog->url . '" method="get" role="search">' .
|
||||
'<p><input type="text" size="10" maxlength="255" id="q" name="q" value="' .
|
||||
html::escapeHTML($q) . '" ' .
|
||||
($w->placeholder ? 'placeholder="' . html::escapeHTML($w->placeholder) . '"' : '') .
|
||||
@ -108,22 +102,20 @@ class sabaWidget
|
||||
'<input type="submit" class="submit" value="ok" title="' . __('Search') . '" /></p>' ;
|
||||
|
||||
# advenced search only on search page
|
||||
if ($core->url->type == 'search') {
|
||||
|
||||
if (dcCore::app()->url->type == 'search') {
|
||||
# order
|
||||
if (!$w->saba_filter_orders) {
|
||||
$ct = '';
|
||||
|
||||
foreach(tplSaba::getSabaFormOrders() as $k => $v) {
|
||||
$ct .=
|
||||
'<li><label><input name="q_order" type="radio" value="' .
|
||||
foreach (tplSaba::getSabaFormOrders() as $k => $v) {
|
||||
$ct .= '<li><label><input name="q_order" type="radio" value="' .
|
||||
$v . '" ' .
|
||||
($v == $_ctx->saba_options['q_order'] ? 'checked="checked" ' : '') .
|
||||
($v == dcCore::app()->ctx->saba_options['q_order'] ? 'checked="checked" ' : '') .
|
||||
'/> ' . html::escapeHTML($k) . '</label></li>';
|
||||
}
|
||||
if (!empty($ct)) {
|
||||
$ct .= '<li><label><input name="q_rev" type="checkbox" value="1" ' .
|
||||
(!empty($_ctx->saba_options['q_rev']) ? 'checked="checked" ' : '') .
|
||||
(!empty(dcCore::app()->ctx->saba_options['q_rev']) ? 'checked="checked" ' : '') .
|
||||
'/> ' . __('Reverse order') . '</label></li>';
|
||||
$res .= $w->renderTitle(__('Filter order')) . sprintf('<ul>%s</ul>', $ct);
|
||||
}
|
||||
@ -134,14 +126,13 @@ class sabaWidget
|
||||
$ct = '';
|
||||
$rm = explode(',', $w->saba_remove_options);
|
||||
|
||||
foreach(tplSaba::getSabaFormOptions() as $k => $v) {
|
||||
foreach (tplSaba::getSabaFormOptions() as $k => $v) {
|
||||
if (in_array($v, $rm)) {
|
||||
continue;
|
||||
}
|
||||
$ct .=
|
||||
'<li><label><input name="q_opt[]" type="checkbox" value="' .
|
||||
$ct .= '<li><label><input name="q_opt[]" type="checkbox" value="' .
|
||||
$v . '" ' .
|
||||
(in_array($v, $_ctx->saba_options['q_opt']) ? 'checked="checked" ' : '') .
|
||||
(in_array($v, dcCore::app()->ctx->saba_options['q_opt']) ? 'checked="checked" ' : '') .
|
||||
'/> ' . html::escapeHTML($k) . '</label></li>';
|
||||
}
|
||||
if (!empty($ct)) {
|
||||
@ -153,11 +144,10 @@ class sabaWidget
|
||||
if (!$w->saba_filter_ages) {
|
||||
$ct = '';
|
||||
|
||||
foreach(tplSaba::getSabaFormAges() as $k => $v) {
|
||||
$ct .=
|
||||
'<li><label><input name="q_age" type="radio" value="' .
|
||||
foreach (tplSaba::getSabaFormAges() as $k => $v) {
|
||||
$ct .= '<li><label><input name="q_age" type="radio" value="' .
|
||||
$v . '" ' .
|
||||
($v == $_ctx->saba_options['q_age'] ? 'checked="checked" ' : '') .
|
||||
($v == dcCore::app()->ctx->saba_options['q_age'] ? 'checked="checked" ' : '') .
|
||||
'/> ' . html::escapeHTML($k) . '</label></li>';
|
||||
}
|
||||
if (!empty($ct)) {
|
||||
@ -170,14 +160,13 @@ class sabaWidget
|
||||
$ct = '';
|
||||
$rm = explode(',', $w->saba_remove_types);
|
||||
|
||||
foreach(tplSaba::getSabaFormTypes() as $k => $v) {
|
||||
foreach (tplSaba::getSabaFormTypes() as $k => $v) {
|
||||
if (in_array($v, $rm)) {
|
||||
continue;
|
||||
}
|
||||
$ct .=
|
||||
'<li><label><input name="q_type[]" type="checkbox" value="' .
|
||||
$ct .= '<li><label><input name="q_type[]" type="checkbox" value="' .
|
||||
$v . '" ' .
|
||||
(in_array($v, $_ctx->saba_options['q_type']) ? 'checked="checked" ' : '') .
|
||||
(in_array($v, dcCore::app()->ctx->saba_options['q_type']) ? 'checked="checked" ' : '') .
|
||||
'/> ' . html::escapeHTML($k) . '</label></li>';
|
||||
}
|
||||
if (!empty($ct)) {
|
||||
@ -189,16 +178,15 @@ class sabaWidget
|
||||
if (!$w->saba_filter_categories) {
|
||||
$ct = '';
|
||||
$rm = explode(',', $w->saba_remove_categories);
|
||||
$rs = $core->blog->getCategories();
|
||||
$rs = dcCore::app()->blog->getCategories();
|
||||
|
||||
while ($rs->fetch()) {
|
||||
if (in_array($rs->cat_id, $rm) || in_array($rs->cat_url, $rm)) {
|
||||
continue;
|
||||
}
|
||||
$ct .=
|
||||
'<li><label><input name="q_cat[]" type="checkbox" value="' .
|
||||
$ct .= '<li><label><input name="q_cat[]" type="checkbox" value="' .
|
||||
$rs->cat_id . '" ' .
|
||||
(in_array($rs->cat_id, $_ctx->saba_options['q_cat']) ? 'checked="checked" ' : '') .
|
||||
(in_array($rs->cat_id, dcCore::app()->ctx->saba_options['q_cat']) ? 'checked="checked" ' : '') .
|
||||
'/> ' . html::escapeHTML($rs->cat_title) . '</label></li>';
|
||||
}
|
||||
if (!empty($ct)) {
|
||||
@ -210,16 +198,15 @@ class sabaWidget
|
||||
if (!$w->saba_filter_authors) {
|
||||
$ct = '';
|
||||
$rm = explode(',', $w->saba_remove_authors);
|
||||
$rs = $core->blog->getPostsUsers();
|
||||
$rs = dcCore::app()->blog->getPostsUsers();
|
||||
|
||||
while ($rs->fetch()) {
|
||||
if (in_array($rs->user_id, $rm)) {
|
||||
continue;
|
||||
}
|
||||
$ct .=
|
||||
'<li><label><input name="q_user[]" type="checkbox" value="' .
|
||||
$ct .= '<li><label><input name="q_user[]" type="checkbox" value="' .
|
||||
$rs->user_id . '" ' .
|
||||
(in_array($rs->user_id, $_ctx->saba_options['q_user']) ? 'checked="checked" ' : '') .
|
||||
(in_array($rs->user_id, dcCore::app()->ctx->saba_options['q_user']) ? 'checked="checked" ' : '') .
|
||||
'/> ' . html::escapeHTML(dcUtils::getUserCN($rs->user_id, $rs->user_name, $rs->user_firstname, $rs->user_displayname)) . '</label></li>';
|
||||
}
|
||||
if (!empty($ct)) {
|
||||
|
@ -1,56 +0,0 @@
|
||||
<?php
|
||||
// Language: Français
|
||||
// Module: saba - 2021.08.21
|
||||
// Date: 2021-08-22 23:22:12
|
||||
// Translated with dcTranslater - 2021.08.18
|
||||
|
||||
#_admin.php:38
|
||||
$GLOBALS['__l10n']['Search Across Blog Archive'] = 'Rechercher dans les archives';
|
||||
|
||||
#_admin.php:41
|
||||
$GLOBALS['__l10n']['Enable advanced search on this blog'] = 'Activer la recherche avancée sur ce blog';
|
||||
|
||||
#_admin.php:44
|
||||
$GLOBALS['__l10n']['Enable suggestion for page 404'] = 'Activer la suggestion sur la page 404';
|
||||
|
||||
#_admin.php:46
|
||||
$GLOBALS['__l10n']['This suggests visitors some posts on page 404.'] = 'Ceci suggère au visiteurs des billets sur la page 404.';
|
||||
|
||||
#_widgets.php:18
|
||||
$GLOBALS['__l10n']['Advanced search'] = 'Recherche avancée';
|
||||
|
||||
#_widgets.php:21
|
||||
$GLOBALS['__l10n']['Add more search options on public side'] = 'Ajoute plus d\'options de recherche';
|
||||
|
||||
#_widgets.php:26
|
||||
$GLOBALS['__l10n']['Disable filter on post types'] = 'Désactiver le filtre de type de billets';
|
||||
|
||||
#_widgets.php:30
|
||||
$GLOBALS['__l10n']['Hidden types:'] = 'Billets cachés :';
|
||||
|
||||
#_widgets.php:33
|
||||
$GLOBALS['__l10n']['Disable filter on post options'] = 'Désactiver le filtre des options de billet';
|
||||
|
||||
#_widgets.php:37
|
||||
$GLOBALS['__l10n']['Hidden options:'] = 'Options cachées :';
|
||||
|
||||
#_widgets.php:40
|
||||
$GLOBALS['__l10n']['Disable filter on categories'] = 'Désactiver le filtre de catégories';
|
||||
|
||||
#_widgets.php:44
|
||||
$GLOBALS['__l10n']['Hidden categories:'] = 'Catégories cachées';
|
||||
|
||||
#_widgets.php:47
|
||||
$GLOBALS['__l10n']['Disable filter on authors'] = 'Désactiver le filtre d\'auteurs';
|
||||
|
||||
#_widgets.php:51
|
||||
$GLOBALS['__l10n']['Hidden authors:'] = 'Auteurs cachés';
|
||||
|
||||
#_widgets.php:54
|
||||
$GLOBALS['__l10n']['Disable filter on order'] = 'Désactiver le filtre d\'ordre';
|
||||
|
||||
#_widgets.php:60
|
||||
$GLOBALS['__l10n']['Disable filter on age'] = 'Désactiver le filtre de date';
|
||||
|
||||
#default-templates/saba_404_dotty.html:22
|
||||
$GLOBALS['__l10n']['Suggested items:'] = 'Articles suggérés :';
|
@ -1,81 +0,0 @@
|
||||
<?php
|
||||
// Language: Français
|
||||
// Module: saba - 2021.08.21
|
||||
// Date: 2021-08-22 23:22:12
|
||||
// Translated with dcTranslater - 2021.08.18
|
||||
|
||||
#_public.php:293
|
||||
#_public.php:303
|
||||
$GLOBALS['__l10n']['Selected entry'] = 'Billet sélectionné';
|
||||
|
||||
#_public.php:294
|
||||
$GLOBALS['__l10n']['With comments'] = 'Avec commentaires';
|
||||
|
||||
#_public.php:295
|
||||
$GLOBALS['__l10n']['With trackbacks'] = 'Avec rétroliens';
|
||||
|
||||
#_public.php:302
|
||||
$GLOBALS['__l10n']['Title'] = 'Titre';
|
||||
|
||||
#_public.php:304
|
||||
$GLOBALS['__l10n']['Author'] = 'Auteur·rice';
|
||||
|
||||
#_public.php:305
|
||||
$GLOBALS['__l10n']['Date'] = 'Date';
|
||||
|
||||
#_public.php:306
|
||||
$GLOBALS['__l10n']['Update'] = 'Mise à jour';
|
||||
|
||||
#_public.php:307
|
||||
$GLOBALS['__l10n']['Comments count'] = 'Nombre de commentaires';
|
||||
|
||||
#_public.php:308
|
||||
$GLOBALS['__l10n']['Trackbacks count'] = 'Nombre de rétroliens';
|
||||
|
||||
#_public.php:315
|
||||
$GLOBALS['__l10n']['All'] = 'Tous';
|
||||
|
||||
#_public.php:316
|
||||
$GLOBALS['__l10n']['Less than a month'] = 'Moins d\'un mois';
|
||||
|
||||
#_public.php:317
|
||||
$GLOBALS['__l10n']['From 1 to 6 month'] = 'De 1 à 6 mois';
|
||||
|
||||
#_public.php:318
|
||||
$GLOBALS['__l10n']['From 6 to 12 month'] = 'De 6 à 12 mois';
|
||||
|
||||
#_public.php:319
|
||||
$GLOBALS['__l10n']['More than a year'] = 'Plus d\'un an';
|
||||
|
||||
#_public.php:326
|
||||
$GLOBALS['__l10n']['Entry'] = 'Publication';
|
||||
|
||||
#_public.php:327
|
||||
$GLOBALS['__l10n']['Page'] = 'Page';
|
||||
|
||||
#_public.php:328
|
||||
$GLOBALS['__l10n']['Poll'] = 'Sondage';
|
||||
|
||||
#_public.php:329
|
||||
$GLOBALS['__l10n']['Event'] = 'Événement';
|
||||
|
||||
#_widgets.php:114
|
||||
$GLOBALS['__l10n']['Reverse order'] = 'Inverser l\'ordre';
|
||||
|
||||
#_widgets.php:115
|
||||
$GLOBALS['__l10n']['Filter order'] = 'Options de tri';
|
||||
|
||||
#_widgets.php:135
|
||||
$GLOBALS['__l10n']['Filter options'] = 'Options du filtre';
|
||||
|
||||
#_widgets.php:151
|
||||
$GLOBALS['__l10n']['Filter by age'] = 'Filtrer par date';
|
||||
|
||||
#_widgets.php:171
|
||||
$GLOBALS['__l10n']['Filter by type'] = 'Filtrer par type';
|
||||
|
||||
#_widgets.php:192
|
||||
$GLOBALS['__l10n']['Filter by category'] = 'Filter par catégorie';
|
||||
|
||||
#_widgets.php:213
|
||||
$GLOBALS['__l10n']['Filter by author'] = 'Filtrer par auteur';
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
#
|
||||
# This file is part of saba, a plugin for Dotclear 2.
|
||||
@ -16,5 +17,5 @@ if (!defined('DC_RC_PATH')) {
|
||||
}
|
||||
|
||||
if (!empty($_REQUEST['module']) && $_REQUEST['module'] == 'saba') {
|
||||
$__resources['help']['core_plugins_conf'] = dirname(__FILE__) . '/help/help.html';
|
||||
dcCore::app()->resources['help']['core_plugins_conf'] = __DIR__ . '/help/help.html';
|
||||
}
|
Loading…
Reference in New Issue
Block a user