Skip to content

Commit

Permalink
added support php8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfriend committed Jan 22, 2023
1 parent bd3c3fd commit 542f848
Show file tree
Hide file tree
Showing 23 changed files with 341 additions and 258 deletions.
7 changes: 7 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# These are supported funding model platforms

# github: [darkfriend]
custom: [
'https://www.tinkoff.ru/cf/36wVfnMf7mo',
'https://paypal.me/darkfriend'
]
16 changes: 8 additions & 8 deletions utf8/dev2fun.opengraph/admin/dev2fun_settings.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @author dev2fun <darkfriend>
* @copyright (c) 2019-2022, darkfriend <[email protected]>
* @version 1.4.1
* @copyright (c) 2019-2023, darkfriend <[email protected]>
* @version 1.4.2
* @global CUser $USER
* @global CMain $APPLICATION
*/
Expand Down Expand Up @@ -178,7 +178,7 @@
'HEIGHT' => '',
];
} else {
$arSettingResize = unserialize($arSettingResize);
$arSettingResize = unserialize($arSettingResize, ["allowed_classes" => false]);
}
if (!isset($arSettingResize['TYPE'])) {
$arSettingResize['TYPE'] = BX_RESIZE_IMAGE_PROPORTIONAL;
Expand All @@ -194,7 +194,7 @@
if (!$arSortable) {
$arSortable = array_keys($arSortableDefault);
} else {
$arSortable = unserialize($arSortable);
$arSortable = unserialize($arSortable, ["allowed_classes" => false]);
}

require($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/prolog_admin_after.php");
Expand Down Expand Up @@ -223,11 +223,11 @@
<link rel="stylesheet" href="https://unpkg.com/[email protected]/scss/dist/objects.grid.responsive.min.css">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/scss/dist/objects.containers.min.css">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/scss/dist/components.tables.min.css">
<form method="POST" action="?action=save&lang=<? echo LANGUAGE_ID ?>&<?= $tabControl->ActiveTabParam() ?>"
<form method="POST" action="?action=save&lang=<?php echo LANGUAGE_ID ?>&<?= $tabControl->ActiveTabParam() ?>"
enctype="multipart/form-data" name="editform">
<?= bitrix_sessid_post() ?>
<input type="hidden" name="lang" value="<?= LANG ?>">
<?
<?php
$tabControl->Begin();
$tabControl->BeginNextTab();

Expand Down Expand Up @@ -582,9 +582,9 @@
<td>
<div class="sort_container">
<ul id="sort_items" class="sort_list" data-input="sortableOpenGraph">
<? foreach ($arSortable as $sort) { ?>
<?php foreach ($arSortable as $sort) { ?>
<li data-id="<?= $sort ?>"><?= $arSortableDefault[$sort] ?></li>
<? } ?>
<?php } ?>
</ul>
<input type="hidden" value="<?= implode(',', $arSortable) ?>"
id="sortableOpenGraph"
Expand Down
8 changes: 4 additions & 4 deletions utf8/dev2fun.opengraph/classes/general/OpenGraph.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @author dev2fun <darkfriend>
* @copyright (c) 2019-2022, darkfriend <[email protected]>
* @version 1.4.1
* @copyright (c) 2019-2023, darkfriend <[email protected]>
* @version 1.4.2
*/

namespace Dev2fun\Module;
Expand Down Expand Up @@ -70,7 +70,7 @@ public static function IsAddTab()
/**
* @param \CAdminTabControl $form
*/
public function AddAdminTab(&$form)
public static function AddAdminTab(&$form)
{
Loader::includeModule("dev2fun.opengraph");
if (!OpenGraph::$_init && self::IsAddTab()) {
Expand Down Expand Up @@ -103,7 +103,7 @@ public function AddAdminTab(&$form)
* Event Handler on save element
* @param array &$arFields
*/
public function saveElement(&$arFields)
public static function saveElement(&$arFields)
{
if (!empty($arFields["ID"])) {
$obParser = new \CTextParser;
Expand Down
21 changes: 10 additions & 11 deletions utf8/dev2fun.opengraph/include.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @author dev2fun <darkfriend>
* @copyright (c) 2019-2022, darkfriend <[email protected]>
* @version 1.4.0
* @copyright (c) 2019-2023, darkfriend <[email protected]>
* @version 1.4.2
*/
IncludeModuleLangFile(__FILE__);

Expand Down Expand Up @@ -150,7 +150,7 @@ public static function getSettingFields($incDefault = true)
if ($sFields) {
$sFields = unserialize($sFields, ['allowed_classes' => false]);
} else {
$sFields = array();
$sFields = [];
}
if ($incDefault) {
$sFields = array_merge(self::$arReqSettings, $sFields);
Expand Down Expand Up @@ -205,7 +205,7 @@ public function getSettingsExcludePage()
if ($pages) {
$pages = unserialize($pages, ['allowed_classes' => false]);
} else {
$pages = array();
$pages = [];
}
return $pages;
}
Expand Down Expand Up @@ -236,7 +236,7 @@ public function getSettingsResize()
if ($data) {
$data = unserialize($data, ['allowed_classes' => false]);
} else {
$data = array();
$data = [];
}
return $data;
}
Expand All @@ -251,7 +251,7 @@ public function getSettingsSortable()
if ($data) {
$data = unserialize($data, ['allowed_classes' => false]);
} else {
$data = array();
$data = [];
}
return $data;
}
Expand Down Expand Up @@ -457,16 +457,15 @@ public function getUrl($path = '')
public static function ShowThanksNotice()
{
\CAdminNotify::Add([
// 'MESSAGE' => \Bitrix\Main\Localization\Loc::getMessage('D2F_OPENGRAPH_DONATE_MESSAGE',['#URL#'=>$APPLICATION->GetCurUri('tabControl_active_tab=donate')]),
'MESSAGE' => Loc::getMessage('D2F_OPENGRAPH_DONATE_MESSAGE', ['#URL#' => '/bitrix/admin/dev2fun_opengraph_manager.php?action=settings&tabControl_active_tab=donate']),
'TAG' => 'dev2fun_opengraph_update',
'MODULE_ID' => 'dev2fun.opengraph',
]);
}

public function DoBuildGlobalMenu(&$aGlobalMenu, &$aModuleMenu)
public static function DoBuildGlobalMenu(&$aGlobalMenu, &$aModuleMenu)
{
$aModuleMenu[] = array(
$aModuleMenu[] = [
"parent_menu" => "global_menu_settings",
"icon" => "dev2fun_admin_icon",
"page_icon" => "dev2fun_admin_icon",
Expand All @@ -476,7 +475,7 @@ public function DoBuildGlobalMenu(&$aGlobalMenu, &$aModuleMenu)
"url" => "/bitrix/admin/dev2fun_opengraph_manager.php?action=settings",
"items_id" => "menu_dev2fun_opengraph",
"section" => "dev2fun_opengraph",
"more_url" => array(),
"more_url" => [],
// "items" => array(
// array(
// "text" => GetMessage("SUB_SETINGS_MENU_TEXT"),
Expand All @@ -487,6 +486,6 @@ public function DoBuildGlobalMenu(&$aGlobalMenu, &$aModuleMenu)
// "page_icon" => "default_page_icon",
// ),
// )
);
];
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?
<?php
/**
* @author dev2fun (darkfriend)
* @copyright darkfriend
* @version 1.0.0
* @version 1.4.2
*/
global $action, $type;
$GLOBALS['reqPath'] = $_SERVER["DOCUMENT_ROOT"].'/bitrix/modules/dev2fun.opengraph/admin/dev2fun_settings.php';
require($GLOBALS['reqPath']);
?>
Loading

0 comments on commit 542f848

Please sign in to comment.