This commit is contained in:
Jean-Christian Paul Denis 2022-12-17 11:56:18 +01:00
parent 4908f533f3
commit 06c84ef2b0
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
3 changed files with 18 additions and 20 deletions

View File

@ -24,9 +24,9 @@ $this->registerModule(
'permissions' => dcCore::app()->auth->makePermissions([ 'permissions' => dcCore::app()->auth->makePermissions([
dcAuth::PERMISSION_ADMIN, dcAuth::PERMISSION_ADMIN,
]), ]),
'type' => 'plugin', 'type' => 'plugin',
'support' => 'https://github.com/JcDenis/saba', 'support' => 'https://github.com/JcDenis/saba',
'details' => 'https://plugins.dotaddict.org/dc2/details/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',
] ]
); );

View File

@ -68,7 +68,7 @@ class pubSaba
]; ];
} }
public static function urlHandlerBeforeGetData($_ctx) public static function urlHandlerBeforeGetData($_)
{ {
$options = tplSaba::getSabaDefaultPostsOptions(); $options = tplSaba::getSabaDefaultPostsOptions();
@ -97,7 +97,7 @@ class pubSaba
$posts = dcCore::app()->blog->getPosts($params); $posts = dcCore::app()->blog->getPosts($params);
if ($posts->isEmpty()) { // hack: don't breack context if ($posts->isEmpty()) { // hack: don't breack context
$params = ['limit' => $params['limit']]; $params = ['limit' => $params['limit']];
$posts = dcCore::app()->blog->getPosts($params); $posts = dcCore::app()->blog->getPosts($params);
} }
dcCore::app()->ctx->post_params = $params; dcCore::app()->ctx->post_params = $params;
dcCore::app()->ctx->posts = $posts; dcCore::app()->ctx->posts = $posts;
@ -230,7 +230,7 @@ class pubSaba
# decoupe un peu plus la recherche # decoupe un peu plus la recherche
$splits = preg_split("#[\s//,-_]+#", $p['search']); $splits = preg_split("#[\s//,-_]+#", $p['search']);
if (!$splits) { if (!$splits) {
$splits = explode(',', $p['search']); $splits = explode(',', $p['search']);
} }
foreach ($splits as $sentence) { foreach ($splits as $sentence) {
$AND = []; $AND = [];

View File

@ -1,17 +1,15 @@
<?php <?php
/**
# -- BEGIN LICENSE BLOCK ---------------------------------- * @brief saba, a plugin for Dotclear 2
# *
# This file is part of saba, a plugin for Dotclear 2. * @package Dotclear
# * @subpackage Plugin
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors *
# * @author Jean-Christian Denis and Contributors
# Licensed under the GPL version 2.0 license. *
# A copy of this license is available in LICENSE file or at * @copyright Jean-Christian Denis
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# */
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return null; return null;
} }