Skip to content

Commit 1829f60

Browse files
authored
Merge pull request #155 from mambax7/master
min PHP 7.4 and other updates
2 parents 7615dee + 2e8b8e3 commit 1829f60

4 files changed

Lines changed: 16 additions & 11 deletions

File tree

class/Common/TestdataButtons.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,27 @@
3030
*/
3131
class TestdataButtons
3232
{
33-
//functions for import buttons
33+
/** Button status constants */
34+
private const SHOW_BUTTONS = 1;
35+
private const HIDE_BUTTONS = 0;
36+
3437
/**
38+
* Load the test button configuration
39+
*
3540
* @param \Xmf\Module\Admin $adminObject
41+
*
3642
* @return void
3743
*/
38-
public static function loadButtonConfig(\Xmf\Module\Admin $adminObject)
44+
public static function loadButtonConfig($adminObject): void
3945
{
40-
$moduleDirName = \basename(\dirname(__DIR__, 2));
41-
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
42-
$yamlFile = \dirname(__DIR__, 2) . '/config/admin.yml';
43-
$config[] = Yaml::readWrapped($yamlFile); // work with phpmyadmin YAML dumps
44-
$displaySampleButton = $config[0]['displaySampleButton'];
46+
$moduleDirName = \basename(\dirname(__DIR__, 2));
47+
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
4548
$helper = Helper::getInstance();
49+
$yamlFile = $helper->path('/config/admin.yml');
50+
$config = Yaml::readWrapped($yamlFile); // work with phpmyadmin YAML dumps
51+
$displaySampleButton = $config['displaySampleButton'];
4652

47-
if (1 == $displaySampleButton) {
53+
if (self::SHOW_BUTTONS == $displaySampleButton) {
4854
\xoops_loadLanguage('admin/modulesadmin', 'system');
4955
$adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA'), $helper->url('testdata/index.php?op=load'), 'add');
5056
$adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA'), $helper->url('testdata/index.php?op=save'), 'add');

preloads/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<script>history.go(-1);</script>

preloads/index.php

Lines changed: 0 additions & 2 deletions
This file was deleted.

xoops_version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
$modversion['targetdir'] = XOOPS_UPLOAD_PATH . "/{$moduleDirName}/repository/";
5555
$modversion['module_website_url'] = 'https://github.com/XoopsModules25x/modulebuilder';
5656
$modversion['module_website_name'] = 'GitHub Xoops';
57-
$modversion['min_php'] = '7.2';
57+
$modversion['min_php'] = '7.4';
5858
$modversion['min_xoops'] = '2.5.11-Beta 2';
5959
$modversion['min_admin'] = '1.2';
6060
$modversion['min_db'] = ['mysql' => '5.5'];

0 commit comments

Comments
 (0)