From d40be61774d45a083a7c80fce2f27d68b520e1ac Mon Sep 17 00:00:00 2001 From: Bugo Date: Tue, 10 Nov 2020 13:07:17 +0500 Subject: [PATCH] Prepare for release --- Sources/LightPortal/Block.php | 2 +- Sources/LightPortal/Comment.php | 8 +-- Sources/LightPortal/Credits.php | 2 +- Sources/LightPortal/Helpers.php | 14 ++--- Sources/LightPortal/Integration.php | 21 +++---- Sources/LightPortal/ManageBlocks.php | 9 +-- Sources/LightPortal/ManagePages.php | 29 +++++++--- Sources/LightPortal/Notify.php | 2 +- Sources/LightPortal/Page.php | 2 +- Sources/LightPortal/Settings.php | 6 +- Sources/LightPortal/Subs.php | 5 +- Sources/LightPortal/Tag.php | 4 +- .../LightPortal/addons/AdsBlock/AdsBlock.php | 9 ++- .../addons/ArticleList/ArticleList.php | 2 +- .../addons/BoardIndex/BoardIndex.php | 2 +- .../addons/BoardList/BoardList.php | 2 +- .../addons/BoardNews/BoardNews.php | 2 +- .../addons/CodeMirror/CodeMirror.php | 2 +- .../addons/CurrentMonth/CurrentMonth.php | 2 +- .../EasyMarkdownEditor/EasyMarkdownEditor.php | 2 +- .../addons/FaBoardIcons/FaBoardIcons.php | 2 +- .../FacebookComments/FacebookComments.php | 2 +- .../FlipsterCarousel/FlipsterCarousel.php | 2 +- .../FrontpageFlarumStyle.php | 2 +- .../addons/HidingBlocks/HidingBlocks.php | 2 +- .../KarmaPostRating/KarmaPostRating.php | 2 +- .../addons/LanguageAccess/LanguageAccess.php | 2 +- Sources/LightPortal/addons/Likely/Likely.php | 2 +- .../LightPortal/addons/Markdown/Markdown.php | 2 +- .../addons/Markdown/Michelf/MarkdownSMF.php | 2 +- Sources/LightPortal/addons/News/News.php | 3 +- .../LightPortal/addons/PageList/PageList.php | 2 +- .../addons/PrettyUrls/PrettyUrls.php | 2 +- .../addons/RandomTopics/RandomTopics.php | 2 +- .../RecentAttachments/RecentAttachments.php | 2 +- .../addons/RecentPosts/RecentPosts.php | 2 +- .../addons/RecentTopics/RecentTopics.php | 2 +- .../LightPortal/addons/RssFeed/RssFeed.php | 2 +- .../addons/SlickSlider/SlickSlider.php | 2 +- .../LightPortal/addons/TagList/TagList.php | 4 +- .../addons/ThemeSwitcher/ThemeSwitcher.php | 2 +- Sources/LightPortal/addons/Todays/Todays.php | 6 +- .../addons/TopBoards/TopBoards.php | 2 +- .../LightPortal/addons/TopPages/TopPages.php | 2 +- .../addons/TopPosters/TopPosters.php | 4 +- .../addons/TopTopics/TopTopics.php | 2 +- .../addons/TopicRatingBar/TopicRatingBar.php | 2 +- .../addons/Translator/Translator.php | 2 +- .../addons/Trumbowyg/Trumbowyg.php | 2 +- .../LightPortal/addons/UserInfo/UserInfo.php | 2 +- .../addons/VkComments/VkComments.php | 2 +- .../addons/WhosOnline/WhosOnline.php | 2 +- Sources/LightPortal/front/Article.php | 2 +- Sources/LightPortal/front/BoardArticle.php | 2 +- Sources/LightPortal/front/IArticle.php | 2 +- Sources/LightPortal/front/PageArticle.php | 2 +- Sources/LightPortal/front/TopicArticle.php | 2 +- Sources/LightPortal/impex/BlockExport.php | 2 +- Sources/LightPortal/impex/BlockImport.php | 2 +- Sources/LightPortal/impex/Export.php | 2 +- Sources/LightPortal/impex/IExport.php | 2 +- Sources/LightPortal/impex/IImport.php | 2 +- Sources/LightPortal/impex/Import.php | 2 +- Sources/LightPortal/impex/PageExport.php | 2 +- Sources/LightPortal/impex/PageImport.php | 2 +- Sources/LightPortal/utils/Arr.php | 58 ++++++------------- Sources/LightPortal/utils/Cache.php | 8 +-- Sources/LightPortal/utils/Post.php | 2 +- Sources/LightPortal/utils/Request.php | 2 +- Sources/LightPortal/utils/Server.php | 2 +- Sources/LightPortal/utils/Session.php | 2 +- package-info.xml | 4 +- 72 files changed, 146 insertions(+), 158 deletions(-) diff --git a/Sources/LightPortal/Block.php b/Sources/LightPortal/Block.php index e4f695f61..14c8fb683 100644 --- a/Sources/LightPortal/Block.php +++ b/Sources/LightPortal/Block.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/Comment.php b/Sources/LightPortal/Comment.php index 7fee9fb67..b67ceb096 100644 --- a/Sources/LightPortal/Comment.php +++ b/Sources/LightPortal/Comment.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -333,7 +333,7 @@ private function makeNotify(string $type, string $action, array $options = []) } /** - * Deleting a comment (and all childs) + * Deleting a comment (and all children) * * Удаление комментария (и всех дочерних) * @@ -433,7 +433,7 @@ public static function getAll(int $page_id = 0) } /** - * Get comment tree (parents and childs) + * Get comment tree (parents and children) * * Получаем дерево комментариев * @@ -447,7 +447,7 @@ private function getTree(array $data) foreach ($data as $id => &$node) { empty($node['parent_id']) ? $tree[$id] = &$node - : $data[$node['parent_id']]['childs'][$id] = &$node; + : $data[$node['parent_id']]['children'][$id] = &$node; } return $tree; diff --git a/Sources/LightPortal/Credits.php b/Sources/LightPortal/Credits.php index da41b4a76..824cd1c1c 100644 --- a/Sources/LightPortal/Credits.php +++ b/Sources/LightPortal/Credits.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/Helpers.php b/Sources/LightPortal/Helpers.php index 746814f69..92e56ea32 100644 --- a/Sources/LightPortal/Helpers.php +++ b/Sources/LightPortal/Helpers.php @@ -17,7 +17,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -30,7 +30,7 @@ class Helpers * * Получаем данные из кэша или объект класса Cache * - * @param string $key + * @param string|null $key * @param string|null $funcName * @param string $class * @param int $time (in seconds) @@ -116,8 +116,8 @@ public static function cleanBbcode(&$data) * * Получаем иконку блока * - * @param null|string $icon - * @param null|string $type + * @param string|null $icon + * @param string|null $type * @return string */ public static function getIcon($icon = null, $type = null) @@ -161,10 +161,10 @@ public static function doesThisThemeUseFontAwesome() * * Получаем заголовок блока превью * - * @param string $prefix + * @param string|null $prefix * @return string */ - public static function getPreviewTitle($prefix = null) + public static function getPreviewTitle(string $prefix = null) { global $context, $txt; @@ -668,7 +668,7 @@ public static function parseContent(string &$content, string $type = 'bbc') * @param string|array $type * @return mixed */ - public static function validate($key, $type = 'string') + public static function validate(string $key, $type = 'string') { if (is_array($type)) { return filter_var($key, FILTER_VALIDATE_REGEXP, $type); diff --git a/Sources/LightPortal/Integration.php b/Sources/LightPortal/Integration.php index 7aea3e8be..fc126bd0b 100644 --- a/Sources/LightPortal/Integration.php +++ b/Sources/LightPortal/Integration.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -41,7 +41,7 @@ public static function hooks() add_integration_function('integrate_load_permissions', __CLASS__ . '::loadPermissions', false, __FILE__); add_integration_function('integrate_alert_types', __CLASS__ . '::alertTypes', false, __FILE__); add_integration_function('integrate_fetch_alerts', __CLASS__ . '::fetchAlerts', false, __FILE__); - add_integration_function('integrate_whos_online', __CLASS__ . '::whosOnline', false, __FILE__); + add_integration_function('integrate_whos_online', __CLASS__ . '::whoisOnline', false, __FILE__); add_integration_function('integrate_credits', __NAMESPACE__ . '\Credits::show', false, '$sourcedir/LightPortal/Credits.php'); add_integration_function('integrate_admin_areas', __NAMESPACE__ . '\Settings::adminAreas', false, '$sourcedir/LightPortal/Settings.php'); add_integration_function('integrate_admin_search', __NAMESPACE__ . '\Settings::adminSearch', false, '$sourcedir/LightPortal/Settings.php'); @@ -80,8 +80,8 @@ public static function userInfo() $lp_constants = [ 'LP_NAME' => 'Light Portal', - 'LP_VERSION' => '1.2', - 'LP_RELEASE_DATE' => '2020-10-10', + 'LP_VERSION' => '1.3', + 'LP_RELEASE_DATE' => '2020-11-11', 'LP_DEBUG' => !empty($modSettings['lp_show_debug_info']) && !empty($user_info['is_admin']), 'LP_ADDONS' => $sourcedir . '/LightPortal/addons', 'LP_CACHE_TIME' => $modSettings['lp_cache_update_interval'] ?? 3600, @@ -137,7 +137,7 @@ public static function loadTheme() * @param string $setLocation * @return void */ - public static function redirect(&$setLocation) + public static function redirect(string &$setLocation) { global $modSettings, $scripturl; @@ -178,22 +178,23 @@ public static function actions(array &$actions) * * Обращаемся к странице портала или вызываем метод по умолчанию * - * @return void + * @return mixed */ public static function defaultAction() { global $modSettings, $sourcedir; if (Helpers::request()->filled('page')) - return Page::show(); + return call_user_func(array(__NAMESPACE__ . '\Page', 'show')); if (empty($modSettings['lp_frontpage_mode']) || (!empty($modSettings['lp_standalone_mode']) && !empty($modSettings['lp_standalone_url']))) { require_once($sourcedir . '/BoardIndex.php'); - return BoardIndex(); + + return call_user_func('BoardIndex'); } if (!empty($modSettings['lp_frontpage_mode'])) - return Front\Article::show(); + return call_user_func(array(__NAMESPACE__ . '\Front\Article', 'show')); } /** @@ -476,7 +477,7 @@ public static function fetchAlerts(array &$alerts, array &$formats) * @param array $actions * @return string */ - public static function whosOnline(array $actions) + public static function whoisOnline(array $actions) { global $txt, $scripturl, $modSettings, $context; diff --git a/Sources/LightPortal/ManageBlocks.php b/Sources/LightPortal/ManageBlocks.php index b2da6d046..a95daad2d 100644 --- a/Sources/LightPortal/ManageBlocks.php +++ b/Sources/LightPortal/ManageBlocks.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -778,7 +778,7 @@ private static function getAreasInfo() { global $context, $txt; - $exampe_areas = array( + $example_areas = array( 'all', 'custom_action', 'pages', @@ -793,7 +793,7 @@ private static function getAreasInfo() 'topic=id3|id7' ); - $context['lp_possible_areas'] = array_combine($exampe_areas, $txt['lp_block_areas_values']); + $context['lp_possible_areas'] = array_combine($example_areas, $txt['lp_block_areas_values']); ob_start(); @@ -898,6 +898,7 @@ private static function getPriority() ); [$priority] = $smcFunc['db_fetch_row']($request); + $smcFunc['db_free_result']($request); $smcFunc['lp_num_queries']++; @@ -1113,7 +1114,7 @@ private static function setData(int $item = 0) */ public static function getData(int $item) { - global $smcFunc, $context; + global $smcFunc; if (empty($item)) return []; diff --git a/Sources/LightPortal/ManagePages.php b/Sources/LightPortal/ManagePages.php index 37870e750..3e904cc3d 100644 --- a/Sources/LightPortal/ManagePages.php +++ b/Sources/LightPortal/ManagePages.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -369,6 +369,7 @@ public static function getTotalQuantity(string $query_string = '', array $query_ ); [$num_entries] = $smcFunc['db_fetch_row']($request); + $smcFunc['db_free_result']($request); $smcFunc['lp_num_queries']++; @@ -763,18 +764,14 @@ private static function findErrors(array $data) } /** - * Adding special fields to the form - * - * Добавляем свои поля для формы + * https://github.com/jshjohnson/Choices * * @return void */ - private static function prepareFormFields() + private static function improveKeywordsField() { - global $context, $txt, $modSettings, $language; - - // Improve keywords field ~ https://github.com/jshjohnson/Choices loadCssFile('https://cdn.jsdelivr.net/npm/choices.js/public/assets/styles/choices.min.css', array('external' => true)); + addInlineCss(' .choices__list { position: relative; @@ -782,6 +779,18 @@ private static function prepareFormFields() .choices__input { box-shadow: none; }'); + } + + /** + * Adding special fields to the form + * + * Добавляем свои поля для формы + * + * @return void + */ + private static function prepareFormFields() + { + global $context, $txt, $modSettings, $language; checkSubmitOnce('register'); @@ -853,6 +862,8 @@ private static function prepareFormFields() 'tab' => 'seo' ); + self::improveKeywordsField(); + $context['posting_fields']['keywords']['label']['text'] = $txt['lp_page_keywords']; $context['posting_fields']['keywords']['input'] = array( 'type' => 'text', @@ -1184,7 +1195,7 @@ private static function setData(int $item = 0) $smcFunc['lp_num_queries']++; - Subs::runAddons('onDataSaving', array($item)); + Subs::runAddons('onPageSaving', array($item)); if (!empty($context['lp_page']['title'])) { $titles = []; diff --git a/Sources/LightPortal/Notify.php b/Sources/LightPortal/Notify.php index 0ff704adb..8894a303d 100644 --- a/Sources/LightPortal/Notify.php +++ b/Sources/LightPortal/Notify.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ class Notify extends \SMF_BackgroundTask diff --git a/Sources/LightPortal/Page.php b/Sources/LightPortal/Page.php index fe776d0e1..c69f5a312 100644 --- a/Sources/LightPortal/Page.php +++ b/Sources/LightPortal/Page.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/Settings.php b/Sources/LightPortal/Settings.php index 93e638844..707d1ee75 100644 --- a/Sources/LightPortal/Settings.php +++ b/Sources/LightPortal/Settings.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -656,7 +656,7 @@ private static function getPluginTypes($snake_name) * @param string $name * @return array */ - private static function getPluginSettings($config_vars, $name = '') + private static function getPluginSettings(array $config_vars, $name = '') { if (empty($config_vars)) return []; @@ -732,7 +732,7 @@ public static function pageArea() * Вызывает метод, если он существует; в противном случае вызывается метод по умолчанию * * @param array $subActions - * @param string $defaultAction + * @param string|null $defaultAction * @return void */ private static function loadGeneralSettingParameters(array $subActions = [], string $defaultAction = null) diff --git a/Sources/LightPortal/Subs.php b/Sources/LightPortal/Subs.php index 9de7ffa76..9be21b19b 100644 --- a/Sources/LightPortal/Subs.php +++ b/Sources/LightPortal/Subs.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -106,8 +106,7 @@ public static function getActiveBLocks() 'title_class' => $row['title_class'], 'title_style' => $row['title_style'], 'content_class' => $row['content_class'], - 'content_style' => $row['content_style'], - 'permissions' => $row['permissions'] + 'content_style' => $row['content_style'] ); $active_blocks[$row['block_id']]['title'][$row['lang']] = $row['title']; diff --git a/Sources/LightPortal/Tag.php b/Sources/LightPortal/Tag.php index c38a5d4c5..6a7f7b99b 100644 --- a/Sources/LightPortal/Tag.php +++ b/Sources/LightPortal/Tag.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -385,7 +385,7 @@ public static function getAll(int $start, int $items_per_page, string $sort) */ public static function getTotalQuantity() { - global $smcFunc, $context; + global $smcFunc; $request = $smcFunc['db_query']('', ' SELECT t.page_id, t.value diff --git a/Sources/LightPortal/addons/AdsBlock/AdsBlock.php b/Sources/LightPortal/addons/AdsBlock/AdsBlock.php index 428a206c9..553ca04fc 100644 --- a/Sources/LightPortal/addons/AdsBlock/AdsBlock.php +++ b/Sources/LightPortal/addons/AdsBlock/AdsBlock.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -114,6 +114,7 @@ public static function getData() if (empty($context['lp_blocks']['ads'])) return []; + $ads_blocks = []; foreach ($txt['lp_ads_block_addon_placement_set'] as $position => $dump) $ads_blocks[$position] = self::getByPosition($position); @@ -233,14 +234,14 @@ public static function prepareDisplayContext(&$output, &$message, $counter) * @param string $position * @return array */ - private static function getByPosition($position) + private static function getByPosition(string $position) { global $context; if (empty($position)) return []; - $blocks = array_filter($context['lp_blocks']['ads'], function ($block) use ($position, $context) { + return array_filter($context['lp_blocks']['ads'], function ($block) use ($position, $context) { if (!empty($block['parameters']['ads_boards'])) { $boards = array_flip(explode(',', $block['parameters']['ads_boards'])); if (!array_key_exists($context['current_board'], $boards)) @@ -260,8 +261,6 @@ private static function getByPosition($position) return false; }); - - return $blocks; } /** diff --git a/Sources/LightPortal/addons/ArticleList/ArticleList.php b/Sources/LightPortal/addons/ArticleList/ArticleList.php index 37ed83f7e..62376ae70 100644 --- a/Sources/LightPortal/addons/ArticleList/ArticleList.php +++ b/Sources/LightPortal/addons/ArticleList/ArticleList.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/BoardIndex/BoardIndex.php b/Sources/LightPortal/addons/BoardIndex/BoardIndex.php index 8ebbedee7..b2f793a9b 100644 --- a/Sources/LightPortal/addons/BoardIndex/BoardIndex.php +++ b/Sources/LightPortal/addons/BoardIndex/BoardIndex.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/BoardList/BoardList.php b/Sources/LightPortal/addons/BoardList/BoardList.php index ea5b39e6c..605be2093 100644 --- a/Sources/LightPortal/addons/BoardList/BoardList.php +++ b/Sources/LightPortal/addons/BoardList/BoardList.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/BoardNews/BoardNews.php b/Sources/LightPortal/addons/BoardNews/BoardNews.php index d295560c6..4b2eb4e83 100644 --- a/Sources/LightPortal/addons/BoardNews/BoardNews.php +++ b/Sources/LightPortal/addons/BoardNews/BoardNews.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/CodeMirror/CodeMirror.php b/Sources/LightPortal/addons/CodeMirror/CodeMirror.php index cf8c13c45..1492b5735 100644 --- a/Sources/LightPortal/addons/CodeMirror/CodeMirror.php +++ b/Sources/LightPortal/addons/CodeMirror/CodeMirror.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/CurrentMonth/CurrentMonth.php b/Sources/LightPortal/addons/CurrentMonth/CurrentMonth.php index e406e06fc..81b8f951d 100644 --- a/Sources/LightPortal/addons/CurrentMonth/CurrentMonth.php +++ b/Sources/LightPortal/addons/CurrentMonth/CurrentMonth.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/EasyMarkdownEditor/EasyMarkdownEditor.php b/Sources/LightPortal/addons/EasyMarkdownEditor/EasyMarkdownEditor.php index 74b839e97..68561db55 100644 --- a/Sources/LightPortal/addons/EasyMarkdownEditor/EasyMarkdownEditor.php +++ b/Sources/LightPortal/addons/EasyMarkdownEditor/EasyMarkdownEditor.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/FaBoardIcons/FaBoardIcons.php b/Sources/LightPortal/addons/FaBoardIcons/FaBoardIcons.php index bfcce25e7..056eb28e6 100644 --- a/Sources/LightPortal/addons/FaBoardIcons/FaBoardIcons.php +++ b/Sources/LightPortal/addons/FaBoardIcons/FaBoardIcons.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/FacebookComments/FacebookComments.php b/Sources/LightPortal/addons/FacebookComments/FacebookComments.php index a73099432..ccdbcde78 100644 --- a/Sources/LightPortal/addons/FacebookComments/FacebookComments.php +++ b/Sources/LightPortal/addons/FacebookComments/FacebookComments.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/FlipsterCarousel/FlipsterCarousel.php b/Sources/LightPortal/addons/FlipsterCarousel/FlipsterCarousel.php index fcd8fc993..28b9f9dd3 100644 --- a/Sources/LightPortal/addons/FlipsterCarousel/FlipsterCarousel.php +++ b/Sources/LightPortal/addons/FlipsterCarousel/FlipsterCarousel.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/FrontpageFlarumStyle/FrontpageFlarumStyle.php b/Sources/LightPortal/addons/FrontpageFlarumStyle/FrontpageFlarumStyle.php index 7638916de..251436bf2 100644 --- a/Sources/LightPortal/addons/FrontpageFlarumStyle/FrontpageFlarumStyle.php +++ b/Sources/LightPortal/addons/FrontpageFlarumStyle/FrontpageFlarumStyle.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/HidingBlocks/HidingBlocks.php b/Sources/LightPortal/addons/HidingBlocks/HidingBlocks.php index d3143da99..584cdc40d 100644 --- a/Sources/LightPortal/addons/HidingBlocks/HidingBlocks.php +++ b/Sources/LightPortal/addons/HidingBlocks/HidingBlocks.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/KarmaPostRating/KarmaPostRating.php b/Sources/LightPortal/addons/KarmaPostRating/KarmaPostRating.php index 15dfe9df5..4eefbb124 100644 --- a/Sources/LightPortal/addons/KarmaPostRating/KarmaPostRating.php +++ b/Sources/LightPortal/addons/KarmaPostRating/KarmaPostRating.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/LanguageAccess/LanguageAccess.php b/Sources/LightPortal/addons/LanguageAccess/LanguageAccess.php index 21effc862..c0a444bf4 100644 --- a/Sources/LightPortal/addons/LanguageAccess/LanguageAccess.php +++ b/Sources/LightPortal/addons/LanguageAccess/LanguageAccess.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/Likely/Likely.php b/Sources/LightPortal/addons/Likely/Likely.php index 8cecfe30a..fdbc78615 100644 --- a/Sources/LightPortal/addons/Likely/Likely.php +++ b/Sources/LightPortal/addons/Likely/Likely.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/Markdown/Markdown.php b/Sources/LightPortal/addons/Markdown/Markdown.php index cb7d68b9f..a3417cf9d 100644 --- a/Sources/LightPortal/addons/Markdown/Markdown.php +++ b/Sources/LightPortal/addons/Markdown/Markdown.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/Markdown/Michelf/MarkdownSMF.php b/Sources/LightPortal/addons/Markdown/Michelf/MarkdownSMF.php index f285d5659..955bfc3bf 100644 --- a/Sources/LightPortal/addons/Markdown/Michelf/MarkdownSMF.php +++ b/Sources/LightPortal/addons/Markdown/Michelf/MarkdownSMF.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ class MarkdownSMF extends \Michelf\MarkdownExtra diff --git a/Sources/LightPortal/addons/News/News.php b/Sources/LightPortal/addons/News/News.php index dd1cbb830..1298ed822 100644 --- a/Sources/LightPortal/addons/News/News.php +++ b/Sources/LightPortal/addons/News/News.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -123,6 +123,7 @@ public static function prepareBlockFields() * * Получаем новость форума * + * @param int $item * @return string */ public static function getData($item = 0) diff --git a/Sources/LightPortal/addons/PageList/PageList.php b/Sources/LightPortal/addons/PageList/PageList.php index 69499ff2a..bf0d21087 100644 --- a/Sources/LightPortal/addons/PageList/PageList.php +++ b/Sources/LightPortal/addons/PageList/PageList.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/PrettyUrls/PrettyUrls.php b/Sources/LightPortal/addons/PrettyUrls/PrettyUrls.php index de5d0a45c..395519ea4 100644 --- a/Sources/LightPortal/addons/PrettyUrls/PrettyUrls.php +++ b/Sources/LightPortal/addons/PrettyUrls/PrettyUrls.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/RandomTopics/RandomTopics.php b/Sources/LightPortal/addons/RandomTopics/RandomTopics.php index b33c492d2..8bd8664e7 100644 --- a/Sources/LightPortal/addons/RandomTopics/RandomTopics.php +++ b/Sources/LightPortal/addons/RandomTopics/RandomTopics.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/RecentAttachments/RecentAttachments.php b/Sources/LightPortal/addons/RecentAttachments/RecentAttachments.php index 3a91861bc..7e39925f2 100644 --- a/Sources/LightPortal/addons/RecentAttachments/RecentAttachments.php +++ b/Sources/LightPortal/addons/RecentAttachments/RecentAttachments.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/RecentPosts/RecentPosts.php b/Sources/LightPortal/addons/RecentPosts/RecentPosts.php index c8de3442b..3602d9b48 100644 --- a/Sources/LightPortal/addons/RecentPosts/RecentPosts.php +++ b/Sources/LightPortal/addons/RecentPosts/RecentPosts.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/RecentTopics/RecentTopics.php b/Sources/LightPortal/addons/RecentTopics/RecentTopics.php index 3609d710a..8085caf73 100644 --- a/Sources/LightPortal/addons/RecentTopics/RecentTopics.php +++ b/Sources/LightPortal/addons/RecentTopics/RecentTopics.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/RssFeed/RssFeed.php b/Sources/LightPortal/addons/RssFeed/RssFeed.php index a55244e20..6ece3a8a4 100644 --- a/Sources/LightPortal/addons/RssFeed/RssFeed.php +++ b/Sources/LightPortal/addons/RssFeed/RssFeed.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/SlickSlider/SlickSlider.php b/Sources/LightPortal/addons/SlickSlider/SlickSlider.php index 5be78766c..0eaa66100 100644 --- a/Sources/LightPortal/addons/SlickSlider/SlickSlider.php +++ b/Sources/LightPortal/addons/SlickSlider/SlickSlider.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/TagList/TagList.php b/Sources/LightPortal/addons/TagList/TagList.php index 2e63ce23e..419532fb3 100644 --- a/Sources/LightPortal/addons/TagList/TagList.php +++ b/Sources/LightPortal/addons/TagList/TagList.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -157,6 +157,8 @@ public static function getAllTopicKeywords() * @param string $content * @param string $type * @param int $block_id + * @param int $cache_time + * @param array $parameters * @return void */ public static function prepareContent(&$content, $type, $block_id, $cache_time, $parameters) diff --git a/Sources/LightPortal/addons/ThemeSwitcher/ThemeSwitcher.php b/Sources/LightPortal/addons/ThemeSwitcher/ThemeSwitcher.php index de504c7ee..af7266436 100644 --- a/Sources/LightPortal/addons/ThemeSwitcher/ThemeSwitcher.php +++ b/Sources/LightPortal/addons/ThemeSwitcher/ThemeSwitcher.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/Todays/Todays.php b/Sources/LightPortal/addons/Todays/Todays.php index 6e888bce2..2ff718cbe 100644 --- a/Sources/LightPortal/addons/Todays/Todays.php +++ b/Sources/LightPortal/addons/Todays/Todays.php @@ -2,8 +2,6 @@ namespace Bugo\LightPortal\Addons\Todays; -use Bugo\LightPortal\Helpers; - /** * Todays * @@ -13,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -63,8 +61,6 @@ public static function blockOptions(&$options) */ public static function validateBlockData(&$parameters, $type) { - global $context; - if ($type !== 'todays') return; diff --git a/Sources/LightPortal/addons/TopBoards/TopBoards.php b/Sources/LightPortal/addons/TopBoards/TopBoards.php index 9c6858801..0cac09a27 100644 --- a/Sources/LightPortal/addons/TopBoards/TopBoards.php +++ b/Sources/LightPortal/addons/TopBoards/TopBoards.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/TopPages/TopPages.php b/Sources/LightPortal/addons/TopPages/TopPages.php index 758651364..f030076ef 100644 --- a/Sources/LightPortal/addons/TopPages/TopPages.php +++ b/Sources/LightPortal/addons/TopPages/TopPages.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/TopPosters/TopPosters.php b/Sources/LightPortal/addons/TopPosters/TopPosters.php index 4a982f91b..b40211730 100644 --- a/Sources/LightPortal/addons/TopPosters/TopPosters.php +++ b/Sources/LightPortal/addons/TopPosters/TopPosters.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -144,7 +144,7 @@ public static function prepareBlockFields() */ public static function getData($parameters) { - global $smcFunc, $memberContext, $scripturl, $modSettings; + global $smcFunc, $memberContext, $scripturl; $request = $smcFunc['db_query']('', ' SELECT id_member, real_name, posts diff --git a/Sources/LightPortal/addons/TopTopics/TopTopics.php b/Sources/LightPortal/addons/TopTopics/TopTopics.php index 089aa7081..89d14b668 100644 --- a/Sources/LightPortal/addons/TopTopics/TopTopics.php +++ b/Sources/LightPortal/addons/TopTopics/TopTopics.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/TopicRatingBar/TopicRatingBar.php b/Sources/LightPortal/addons/TopicRatingBar/TopicRatingBar.php index 0d899d5f6..bba23fc53 100644 --- a/Sources/LightPortal/addons/TopicRatingBar/TopicRatingBar.php +++ b/Sources/LightPortal/addons/TopicRatingBar/TopicRatingBar.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/Translator/Translator.php b/Sources/LightPortal/addons/Translator/Translator.php index 42ecab02f..81955de9e 100644 --- a/Sources/LightPortal/addons/Translator/Translator.php +++ b/Sources/LightPortal/addons/Translator/Translator.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/Trumbowyg/Trumbowyg.php b/Sources/LightPortal/addons/Trumbowyg/Trumbowyg.php index 64bd20212..6919f3f59 100644 --- a/Sources/LightPortal/addons/Trumbowyg/Trumbowyg.php +++ b/Sources/LightPortal/addons/Trumbowyg/Trumbowyg.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/UserInfo/UserInfo.php b/Sources/LightPortal/addons/UserInfo/UserInfo.php index 7d42b61ce..f236c8b61 100644 --- a/Sources/LightPortal/addons/UserInfo/UserInfo.php +++ b/Sources/LightPortal/addons/UserInfo/UserInfo.php @@ -12,7 +12,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/VkComments/VkComments.php b/Sources/LightPortal/addons/VkComments/VkComments.php index a93e75976..a1b6d14f2 100644 --- a/Sources/LightPortal/addons/VkComments/VkComments.php +++ b/Sources/LightPortal/addons/VkComments/VkComments.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/WhosOnline/WhosOnline.php b/Sources/LightPortal/addons/WhosOnline/WhosOnline.php index 04bc4e211..fc7aeb802 100644 --- a/Sources/LightPortal/addons/WhosOnline/WhosOnline.php +++ b/Sources/LightPortal/addons/WhosOnline/WhosOnline.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/front/Article.php b/Sources/LightPortal/front/Article.php index 7cfc366f2..88acfda32 100644 --- a/Sources/LightPortal/front/Article.php +++ b/Sources/LightPortal/front/Article.php @@ -15,7 +15,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ abstract class Article implements IArticle diff --git a/Sources/LightPortal/front/BoardArticle.php b/Sources/LightPortal/front/BoardArticle.php index f745ec240..1d40c1faa 100644 --- a/Sources/LightPortal/front/BoardArticle.php +++ b/Sources/LightPortal/front/BoardArticle.php @@ -14,7 +14,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/front/IArticle.php b/Sources/LightPortal/front/IArticle.php index 42c97ac7c..b14eda90a 100644 --- a/Sources/LightPortal/front/IArticle.php +++ b/Sources/LightPortal/front/IArticle.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ interface IArticle diff --git a/Sources/LightPortal/front/PageArticle.php b/Sources/LightPortal/front/PageArticle.php index 4ae5602e0..1f1c094cc 100644 --- a/Sources/LightPortal/front/PageArticle.php +++ b/Sources/LightPortal/front/PageArticle.php @@ -15,7 +15,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/front/TopicArticle.php b/Sources/LightPortal/front/TopicArticle.php index a4152d91e..8b936812c 100644 --- a/Sources/LightPortal/front/TopicArticle.php +++ b/Sources/LightPortal/front/TopicArticle.php @@ -14,7 +14,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/impex/BlockExport.php b/Sources/LightPortal/impex/BlockExport.php index 9e8d7a45d..b8de2554a 100644 --- a/Sources/LightPortal/impex/BlockExport.php +++ b/Sources/LightPortal/impex/BlockExport.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/impex/BlockImport.php b/Sources/LightPortal/impex/BlockImport.php index 7def3f5e2..9b5e5519a 100644 --- a/Sources/LightPortal/impex/BlockImport.php +++ b/Sources/LightPortal/impex/BlockImport.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/impex/Export.php b/Sources/LightPortal/impex/Export.php index d216ba44e..768265ba6 100644 --- a/Sources/LightPortal/impex/Export.php +++ b/Sources/LightPortal/impex/Export.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ abstract class Export implements IExport diff --git a/Sources/LightPortal/impex/IExport.php b/Sources/LightPortal/impex/IExport.php index 02a71f1cb..55633c20b 100644 --- a/Sources/LightPortal/impex/IExport.php +++ b/Sources/LightPortal/impex/IExport.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ interface IExport diff --git a/Sources/LightPortal/impex/IImport.php b/Sources/LightPortal/impex/IImport.php index a7eb30d54..aa6d147a1 100644 --- a/Sources/LightPortal/impex/IImport.php +++ b/Sources/LightPortal/impex/IImport.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ interface IImport diff --git a/Sources/LightPortal/impex/Import.php b/Sources/LightPortal/impex/Import.php index c87e2a3ef..839356f1f 100644 --- a/Sources/LightPortal/impex/Import.php +++ b/Sources/LightPortal/impex/Import.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ abstract class Import implements IImport diff --git a/Sources/LightPortal/impex/PageExport.php b/Sources/LightPortal/impex/PageExport.php index 181cf1a1d..7cff2af80 100644 --- a/Sources/LightPortal/impex/PageExport.php +++ b/Sources/LightPortal/impex/PageExport.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/impex/PageImport.php b/Sources/LightPortal/impex/PageImport.php index 7f9bff95e..413da8076 100644 --- a/Sources/LightPortal/impex/PageImport.php +++ b/Sources/LightPortal/impex/PageImport.php @@ -13,7 +13,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/utils/Arr.php b/Sources/LightPortal/utils/Arr.php index 186efb338..b45e0e4f3 100644 --- a/Sources/LightPortal/utils/Arr.php +++ b/Sources/LightPortal/utils/Arr.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ abstract class Arr @@ -24,9 +24,10 @@ abstract class Arr * Пытаемся запустить данный объект как функцию * * @param string $key + * @param mixed $default * @return mixed */ - public function __invoke($key, $default = null) + public function __invoke(string $key, $default = null) { return static::get($key) ?? $default; } @@ -37,10 +38,9 @@ public function __invoke($key, $default = null) * Получаем значение $obj[$key] * * @param string $key - * @param mixed $default * @return mixed */ - public static function &get($key) + public static function &get(string $key) { return static::$obj[$key]; } @@ -54,7 +54,7 @@ public static function &get($key) * @param mixed $value * @return void */ - public static function put($key, $value) + public static function put(string $key, $value) { static::$obj[$key] = &$value; } @@ -126,7 +126,7 @@ public static function except($keys) * @param mixed $value * @return void */ - public static function push($key, $value) + public static function push(string $key, $value) { if (! static::has($key) || ! is_array(static::$obj[$key])) return; @@ -147,41 +147,11 @@ public static function push($key, $value) * @param string $key * @return void */ - public static function forget($key) + public static function forget(string $key) { unset(static::$obj[$key]); } - /** - * Unset all $obj array - * - * Очищаем все содержимое $obj - * - * @return void - */ - public static function flush() - { - unset(static::$obj); - } - - /** - * Get and unset the key - * - * Получаем значение ячейки $obj[$key] и тут же очищаем её - * - * @param string $key - * @param mixed $default - * @return void - */ - public static function pull($key, $default = null) - { - $result = static::get($key, $default); - - static::forget($key); - - return $result; - } - /** * Check if the key is set * @@ -204,9 +174,17 @@ public static function has($key) return isset(static::$obj[$key]); } + /** + * Alias for static::has method + * + * Псевдоним для метода static::has + * + * @param string|array $key + * @return bool + */ public static function exists($key) { - return static::has(static::$obj, $key); + return static::has($key); } /** @@ -217,7 +195,7 @@ public static function exists($key) * @param string $key * @return bool */ - public static function filled($key) + public static function filled(string $key) { return ! static::isEmpty($key); } @@ -230,7 +208,7 @@ public static function filled($key) * @param string $key * @return bool */ - public static function isEmpty($key) + public static function isEmpty(string $key) { return empty(static::$obj[$key]); } diff --git a/Sources/LightPortal/utils/Cache.php b/Sources/LightPortal/utils/Cache.php index dbaaff129..0d9cf6ec0 100644 --- a/Sources/LightPortal/utils/Cache.php +++ b/Sources/LightPortal/utils/Cache.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ if (!defined('SMF')) @@ -65,7 +65,7 @@ public function __invoke(string $key, ?string $funcName, string $class = 'self', * @param int $time * @return mixed */ - public static function get($key, $time) + public static function get(string $key, $time = 120) { return cache_get_data(static::$prefix . $key, $time); } @@ -80,7 +80,7 @@ public static function get($key, $time) * @param int $time * @return void */ - public static function put($key, $value, $time = null) + public static function put(string $key, $value, $time = 120) { cache_put_data(static::$prefix . $key, $value, $time); } @@ -93,7 +93,7 @@ public static function put($key, $value, $time = null) * @param string $key * @return void */ - public static function forget($key) + public static function forget(string $key) { self::put($key, null); } diff --git a/Sources/LightPortal/utils/Post.php b/Sources/LightPortal/utils/Post.php index 9dd32a790..661e7b2cb 100644 --- a/Sources/LightPortal/utils/Post.php +++ b/Sources/LightPortal/utils/Post.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ class Post extends Request diff --git a/Sources/LightPortal/utils/Request.php b/Sources/LightPortal/utils/Request.php index 04511d3d4..37bd69e93 100644 --- a/Sources/LightPortal/utils/Request.php +++ b/Sources/LightPortal/utils/Request.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ class Request extends Arr diff --git a/Sources/LightPortal/utils/Server.php b/Sources/LightPortal/utils/Server.php index 3ad231a13..79a829cc7 100644 --- a/Sources/LightPortal/utils/Server.php +++ b/Sources/LightPortal/utils/Server.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ class Server extends Arr diff --git a/Sources/LightPortal/utils/Session.php b/Sources/LightPortal/utils/Session.php index 0f015dd0a..70640e0d5 100644 --- a/Sources/LightPortal/utils/Session.php +++ b/Sources/LightPortal/utils/Session.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://spdx.org/licenses/GPL-3.0-or-later.html GPL-3.0-or-later * - * @version 1.2 + * @version 1.3 */ class Session extends Arr diff --git a/package-info.xml b/package-info.xml index 40e9f061e..bc8dbbe42 100644 --- a/package-info.xml +++ b/package-info.xml @@ -3,7 +3,7 @@ Bugo:LightPortal Light Portal - 1.2 + 1.3 modification @@ -12,10 +12,10 @@ readme/ukrainian.txt readme/spanish.txt readme/spanish.txt + database.php - database.php