Passed
Pull Request — master (#8)
by Michael
17:34 queued 13:57
created
class/Common/Breadcrumb.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -25,39 +25,39 @@  discard block
 block discarded – undo
25 25
  */
26 26
 class Breadcrumb
27 27
 {
28
-    public  $dirname;
29
-    private $bread = [];
28
+	public  $dirname;
29
+	private $bread = [];
30 30
 
31
-    public function __construct()
32
-    {
33
-        $this->dirname = \basename(\dirname(__DIR__, 2));
34
-    }
31
+	public function __construct()
32
+	{
33
+		$this->dirname = \basename(\dirname(__DIR__, 2));
34
+	}
35 35
 
36
-    /**
37
-     * Add link to breadcrumb
38
-     *
39
-     * @param string $title
40
-     * @param string $link
41
-     */
42
-    public function addLink($title = '', $link = ''): void
43
-    {
44
-        $this->bread[] = [
45
-            'link'  => $link,
46
-            'title' => $title,
47
-        ];
48
-    }
36
+	/**
37
+	 * Add link to breadcrumb
38
+	 *
39
+	 * @param string $title
40
+	 * @param string $link
41
+	 */
42
+	public function addLink($title = '', $link = ''): void
43
+	{
44
+		$this->bread[] = [
45
+			'link'  => $link,
46
+			'title' => $title,
47
+		];
48
+	}
49 49
 
50
-    /**
51
-     * Render BreadCrumb
52
-     */
53
-    public function render(): void
54
-    {
55
-        /*
50
+	/**
51
+	 * Render BreadCrumb
52
+	 */
53
+	public function render(): void
54
+	{
55
+		/*
56 56
         TODO if you want to use the render code below,
57 57
         1) create ./templates/chess_common_breadcrumb.tpl)
58 58
         2) add declaration to  xoops_version.php
59 59
         */
60
-        /*
60
+		/*
61 61
         if (!isset($GLOBALS['xoTheme']) || !\is_object($GLOBALS['xoTheme'])) {
62 62
             require $GLOBALS['xoops']->path('class/theme.php');
63 63
 
@@ -76,5 +76,5 @@  discard block
 block discarded – undo
76 76
 
77 77
         return $html;
78 78
         */
79
-    }
79
+	}
80 80
 }
Please login to merge, or discard this patch.
class/Common/ServerStats.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -19,60 +19,60 @@
 block discarded – undo
19 19
  */
20 20
 trait ServerStats
21 21
 {
22
-    /**
23
-     * serverStats()
24
-     *
25
-     * @return string
26
-     */
27
-    public static function getServerStats()
28
-    {
29
-        //mb    $wfdownloads = WfdownloadsWfdownloads::getInstance();
30
-        $moduleDirName      = \basename(\dirname(__DIR__, 2));
31
-        $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
32
-        \xoops_loadLanguage('common', $moduleDirName);
33
-        $html = '';
34
-        //        $sql   = 'SELECT metavalue';
35
-        //        $sql   .= ' FROM ' . $GLOBALS['xoopsDB']->prefix('wfdownloads_meta');
36
-        //        $sql   .= " WHERE metakey='version' LIMIT 1";
37
-        //        $query = $GLOBALS['xoopsDB']->query($sql);
38
-        //        list($meta) = $GLOBALS['xoopsDB']->fetchRow($query);
39
-        $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . \constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n";
40
-        $html .= "<div style='padding: 8px;'>\n";
41
-        //        $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n";
42
-        //        $html .= "<br>\n";
43
-        //        $html .= "<br>\n";
44
-        $html .= '<div>' . \constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n";
45
-        $html .= "<ul>\n";
22
+	/**
23
+	 * serverStats()
24
+	 *
25
+	 * @return string
26
+	 */
27
+	public static function getServerStats()
28
+	{
29
+		//mb    $wfdownloads = WfdownloadsWfdownloads::getInstance();
30
+		$moduleDirName      = \basename(\dirname(__DIR__, 2));
31
+		$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
32
+		\xoops_loadLanguage('common', $moduleDirName);
33
+		$html = '';
34
+		//        $sql   = 'SELECT metavalue';
35
+		//        $sql   .= ' FROM ' . $GLOBALS['xoopsDB']->prefix('wfdownloads_meta');
36
+		//        $sql   .= " WHERE metakey='version' LIMIT 1";
37
+		//        $query = $GLOBALS['xoopsDB']->query($sql);
38
+		//        list($meta) = $GLOBALS['xoopsDB']->fetchRow($query);
39
+		$html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . \constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n";
40
+		$html .= "<div style='padding: 8px;'>\n";
41
+		//        $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n";
42
+		//        $html .= "<br>\n";
43
+		//        $html .= "<br>\n";
44
+		$html .= '<div>' . \constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n";
45
+		$html .= "<ul>\n";
46 46
 
47
-        $gdlib = \function_exists('gd_info') ? '<span style="color: green;">' . \constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . \constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>';
48
-        $html  .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib;
49
-        if (\function_exists('gd_info')) {
50
-            if (true === ($gdlib = gd_info())) {
51
-                $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>';
52
-            }
53
-        }
54
-        //
55
-        //    $safemode = ini_get('safe_mode') ? constant('CO_' . $moduleDirNameUpper . '_ON') . constant('CO_' . $moduleDirNameUpper . '_SAFEMODEPROBLEMS : constant('CO_' . $moduleDirNameUpper . '_OFF');
56
-        //    $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SAFEMODESTATUS . $safemode;
57
-        //
58
-        //    $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>';
59
-        //    $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals;
60
-        //
61
-        $downloads = \ini_get('file_uploads') ? '<span style="color: green;">' . \constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . \constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>';
62
-        $html      .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads;
47
+		$gdlib = \function_exists('gd_info') ? '<span style="color: green;">' . \constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . \constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>';
48
+		$html  .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib;
49
+		if (\function_exists('gd_info')) {
50
+			if (true === ($gdlib = gd_info())) {
51
+				$html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>';
52
+			}
53
+		}
54
+		//
55
+		//    $safemode = ini_get('safe_mode') ? constant('CO_' . $moduleDirNameUpper . '_ON') . constant('CO_' . $moduleDirNameUpper . '_SAFEMODEPROBLEMS : constant('CO_' . $moduleDirNameUpper . '_OFF');
56
+		//    $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SAFEMODESTATUS . $safemode;
57
+		//
58
+		//    $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>';
59
+		//    $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals;
60
+		//
61
+		$downloads = \ini_get('file_uploads') ? '<span style="color: green;">' . \constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . \constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>';
62
+		$html      .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads;
63 63
 
64
-        $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . \ini_get('upload_max_filesize') . "</span></b>\n";
65
-        $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . \ini_get('post_max_size') . "</span></b>\n";
66
-        $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . \ini_get('memory_limit') . "</span></b>\n";
67
-        $html .= "</ul>\n";
68
-        $html .= "<ul>\n";
69
-        $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n";
70
-        $html .= "</ul>\n";
71
-        $html .= "<br>\n";
72
-        $html .= \constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n";
73
-        $html .= '</div>';
74
-        $html .= '</fieldset><br>';
64
+		$html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . \ini_get('upload_max_filesize') . "</span></b>\n";
65
+		$html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . \ini_get('post_max_size') . "</span></b>\n";
66
+		$html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . \ini_get('memory_limit') . "</span></b>\n";
67
+		$html .= "</ul>\n";
68
+		$html .= "<ul>\n";
69
+		$html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n";
70
+		$html .= "</ul>\n";
71
+		$html .= "<br>\n";
72
+		$html .= \constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n";
73
+		$html .= '</div>';
74
+		$html .= '</fieldset><br>';
75 75
 
76
-        return $html;
77
-    }
76
+		return $html;
77
+	}
78 78
 }
Please login to merge, or discard this patch.
class/Common/Configurator.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -24,41 +24,41 @@
 block discarded – undo
24 24
  */
25 25
 class Configurator
26 26
 {
27
-    public $name;
28
-    public $paths           = [];
29
-    public $uploadFolders   = [];
30
-    public $copyBlankFiles  = [];
31
-    public $copyTestFolders = [];
32
-    public $templateFolders = [];
33
-    public $oldFiles        = [];
34
-    public $oldFolders      = [];
35
-    public $renameTables    = [];
36
-    public $renameColumns   = [];
37
-    public $moduleStats     = [];
38
-    public $modCopyright;
39
-    public $icons;
27
+	public $name;
28
+	public $paths           = [];
29
+	public $uploadFolders   = [];
30
+	public $copyBlankFiles  = [];
31
+	public $copyTestFolders = [];
32
+	public $templateFolders = [];
33
+	public $oldFiles        = [];
34
+	public $oldFolders      = [];
35
+	public $renameTables    = [];
36
+	public $renameColumns   = [];
37
+	public $moduleStats     = [];
38
+	public $modCopyright;
39
+	public $icons;
40 40
 
41
-    /**
42
-     * Configurator constructor.
43
-     */
44
-    public function __construct()
45
-    {
46
-        $config = require \dirname(__DIR__, 2) . '/config/config.php';
41
+	/**
42
+	 * Configurator constructor.
43
+	 */
44
+	public function __construct()
45
+	{
46
+		$config = require \dirname(__DIR__, 2) . '/config/config.php';
47 47
 
48
-        $this->name            = $config->name;
49
-        $this->paths           = $config->paths;
50
-        $this->uploadFolders   = $config->uploadFolders;
51
-        $this->copyBlankFiles  = $config->copyBlankFiles;
52
-        $this->copyTestFolders = $config->copyTestFolders;
53
-        $this->templateFolders = $config->templateFolders;
54
-        $this->oldFiles        = $config->oldFiles;
55
-        $this->oldFolders      = $config->oldFolders;
56
-        $this->renameTables    = $config->renameTables;
57
-        $this->renameColumns   = $config->renameColumns;
58
-        $this->moduleStats     = $config->moduleStats;
59
-        $this->modCopyright    = $config->modCopyright;
48
+		$this->name            = $config->name;
49
+		$this->paths           = $config->paths;
50
+		$this->uploadFolders   = $config->uploadFolders;
51
+		$this->copyBlankFiles  = $config->copyBlankFiles;
52
+		$this->copyTestFolders = $config->copyTestFolders;
53
+		$this->templateFolders = $config->templateFolders;
54
+		$this->oldFiles        = $config->oldFiles;
55
+		$this->oldFolders      = $config->oldFolders;
56
+		$this->renameTables    = $config->renameTables;
57
+		$this->renameColumns   = $config->renameColumns;
58
+		$this->moduleStats     = $config->moduleStats;
59
+		$this->modCopyright    = $config->modCopyright;
60 60
 
61
-        $this->icons = require \dirname(__DIR__, 2) . '/config/icons.php';
62
-        $this->paths = require \dirname(__DIR__, 2) . '/config/paths.php';
63
-    }
61
+		$this->icons = require \dirname(__DIR__, 2) . '/config/icons.php';
62
+		$this->paths = require \dirname(__DIR__, 2) . '/config/paths.php';
63
+	}
64 64
 }
Please login to merge, or discard this patch.
class/MyiframeBase.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -15,50 +15,50 @@
 block discarded – undo
15 15
  */
16 16
 class MyiframeBase extends \XoopsObject
17 17
 {
18
-    //    /** @var \XoopsMySQLDatabase */
19
-    public $db;
18
+	//    /** @var \XoopsMySQLDatabase */
19
+	public $db;
20 20
 
21
-    /**
22
-     * myiframe constructor.
23
-     * @param null $id
24
-     */
25
-    public function __construct($id = null)
26
-    {
27
-        $this->db = \XoopsDatabaseFactory::getDatabaseConnection();
28
-        $this->initVar('frame_frameid', \XOBJ_DTYPE_INT, null, false, 10);
29
-        $this->initVar('frame_created', \XOBJ_DTYPE_INT, null, false, 10);
30
-        $this->initVar('frame_uid', \XOBJ_DTYPE_INT, null, false, 10);
31
-        $this->initVar('frame_description', \XOBJ_DTYPE_TXTBOX, null, false, 255);
32
-        $this->initVar('frame_width', \XOBJ_DTYPE_TXTBOX, null, false, 15);
33
-        $this->initVar('frame_height', \XOBJ_DTYPE_TXTBOX, null, false, 15);
34
-        $this->initVar('frame_align', \XOBJ_DTYPE_INT, null, false, 10);
35
-        $this->initVar('frame_frameborder', \XOBJ_DTYPE_INT, null, false, 10);
36
-        $this->initVar('frame_marginwidth', \XOBJ_DTYPE_INT, null, false, 10);
37
-        $this->initVar('frame_marginheight', \XOBJ_DTYPE_INT, null, false, 10);
38
-        $this->initVar('frame_scrolling', \XOBJ_DTYPE_INT, null, false, 10);
39
-        $this->initVar('frame_hits', \XOBJ_DTYPE_INT, null, false, 10);
40
-        $this->initVar('frame_url', \XOBJ_DTYPE_TXTBOX, null, false, 255);
41
-        if (!empty($id)) {
42
-            if (\is_array($id)) {
43
-                $this->assignVars($id);
44
-            } else {
45
-                $this->load((int)$id);
46
-            }
47
-        } else {
48
-            $this->setNew();
49
-        }
50
-    }
21
+	/**
22
+	 * myiframe constructor.
23
+	 * @param null $id
24
+	 */
25
+	public function __construct($id = null)
26
+	{
27
+		$this->db = \XoopsDatabaseFactory::getDatabaseConnection();
28
+		$this->initVar('frame_frameid', \XOBJ_DTYPE_INT, null, false, 10);
29
+		$this->initVar('frame_created', \XOBJ_DTYPE_INT, null, false, 10);
30
+		$this->initVar('frame_uid', \XOBJ_DTYPE_INT, null, false, 10);
31
+		$this->initVar('frame_description', \XOBJ_DTYPE_TXTBOX, null, false, 255);
32
+		$this->initVar('frame_width', \XOBJ_DTYPE_TXTBOX, null, false, 15);
33
+		$this->initVar('frame_height', \XOBJ_DTYPE_TXTBOX, null, false, 15);
34
+		$this->initVar('frame_align', \XOBJ_DTYPE_INT, null, false, 10);
35
+		$this->initVar('frame_frameborder', \XOBJ_DTYPE_INT, null, false, 10);
36
+		$this->initVar('frame_marginwidth', \XOBJ_DTYPE_INT, null, false, 10);
37
+		$this->initVar('frame_marginheight', \XOBJ_DTYPE_INT, null, false, 10);
38
+		$this->initVar('frame_scrolling', \XOBJ_DTYPE_INT, null, false, 10);
39
+		$this->initVar('frame_hits', \XOBJ_DTYPE_INT, null, false, 10);
40
+		$this->initVar('frame_url', \XOBJ_DTYPE_TXTBOX, null, false, 255);
41
+		if (!empty($id)) {
42
+			if (\is_array($id)) {
43
+				$this->assignVars($id);
44
+			} else {
45
+				$this->load((int)$id);
46
+			}
47
+		} else {
48
+			$this->setNew();
49
+		}
50
+	}
51 51
 
52
-    /**
53
-     * @param $id
54
-     */
55
-    public function load($id): void
56
-    {
57
-        $sql   = 'SELECT * FROM ' . $this->db->prefix('myiframe') . ' WHERE frame_frameid=' . (int)$id;
58
-        $myrow = $this->db->fetchArray($this->db->query($sql));
59
-        $this->assignVars($myrow);
60
-        if (!$myrow) {
61
-            $this->setNew();
62
-        }
63
-    }
52
+	/**
53
+	 * @param $id
54
+	 */
55
+	public function load($id): void
56
+	{
57
+		$sql   = 'SELECT * FROM ' . $this->db->prefix('myiframe') . ' WHERE frame_frameid=' . (int)$id;
58
+		$myrow = $this->db->fetchArray($this->db->query($sql));
59
+		$this->assignVars($myrow);
60
+		if (!$myrow) {
61
+			$this->setNew();
62
+		}
63
+	}
64 64
 }
Please login to merge, or discard this patch.
index.php 1 patch
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -18,81 +18,81 @@
 block discarded – undo
18 18
 
19 19
 $suplparam = '';
20 20
 if (isset($_GET)) {
21
-    foreach ($_GET as $k => $v) {
22
-        if ('IFRAMEID' !== \mb_strtoupper(trim($k))) {
23
-            $suplparam .= $k . '=' . $v . '&';
24
-        }
25
-    }
21
+	foreach ($_GET as $k => $v) {
22
+		if ('IFRAMEID' !== \mb_strtoupper(trim($k))) {
23
+			$suplparam .= $k . '=' . $v . '&';
24
+		}
25
+	}
26 26
 }
27 27
 
28 28
 if (mb_strlen(xoops_trim($suplparam)) > 0) {
29
-    $suplparam = mb_substr($suplparam, 0, -1);
29
+	$suplparam = mb_substr($suplparam, 0, -1);
30 30
 }
31 31
 
32 32
 /** @var \MyiframeBaseHandler $iframeHandler */
33 33
 $iframeHandler = $helper->getHandler('MyiframeBase');
34 34
 
35 35
 if (Request::hasVar('iframeid', 'GET')) {
36
-    $tblalign     = [
37
-        'top',
38
-        'middle',
39
-        'bottom',
40
-        'left',
41
-        'rigth',
42
-    ];
43
-    $tblscrolling = [
44
-        'yes',
45
-        'no',
46
-        'auto',
47
-    ];
48
-    $frameid      = Request::getInt('iframeid', 0, 'GET');
36
+	$tblalign     = [
37
+		'top',
38
+		'middle',
39
+		'bottom',
40
+		'left',
41
+		'rigth',
42
+	];
43
+	$tblscrolling = [
44
+		'yes',
45
+		'no',
46
+		'auto',
47
+	];
48
+	$frameid      = Request::getInt('iframeid', 0, 'GET');
49 49
 
50
-    $frame = $iframeHandler->get($frameid);
50
+	$frame = $iframeHandler->get($frameid);
51 51
 
52
-    if (is_object($frame)) {
53
-        $iframeHandler->updatehits($frameid);
54
-        $xoopsTpl->assign('frameok', true);
55
-        $xoopsTpl->assign('longdesc', $frame->getVar('frame_description'));
56
-        $xoopsTpl->assign('width', $frame->getVar('frame_width'));
57
-        $xoopsTpl->assign('height', $frame->getVar('frame_height'));
58
-        $xoopsTpl->assign('align', $tblalign[(string)($frame->getVar('frame_align') - 1)]);
59
-        $xoopsTpl->assign('frameborder', $frame->getVar('frame_frameborder'));
60
-        $xoopsTpl->assign('marginwidth', $frame->getVar('frame_marginwidth'));
61
-        $xoopsTpl->assign('marginheight', $frame->getVar('frame_marginheight'));
62
-        $xoopsTpl->assign('scrolling', $tblscrolling[(string)($frame->getVar('frame_scrolling') - 1)]);
63
-        if ('' !== xoops_trim($suplparam)) {
64
-            $xoopsTpl->assign('url', $frame->getVar('frame_url') . '?' . $suplparam);
65
-        } else {
66
-            $xoopsTpl->assign('url', $frame->getVar('frame_url'));
67
-        }
68
-        $title = $frame->getVar('frame_description');
69
-        myiframe_set_metas($title, $title);
70
-    } else {
71
-        $xoopsTpl->assign('frameok', false);
72
-        $xoopsTpl->assign('frame_error', _MYIFRAME_FRAME_ERROR);
73
-    }
52
+	if (is_object($frame)) {
53
+		$iframeHandler->updatehits($frameid);
54
+		$xoopsTpl->assign('frameok', true);
55
+		$xoopsTpl->assign('longdesc', $frame->getVar('frame_description'));
56
+		$xoopsTpl->assign('width', $frame->getVar('frame_width'));
57
+		$xoopsTpl->assign('height', $frame->getVar('frame_height'));
58
+		$xoopsTpl->assign('align', $tblalign[(string)($frame->getVar('frame_align') - 1)]);
59
+		$xoopsTpl->assign('frameborder', $frame->getVar('frame_frameborder'));
60
+		$xoopsTpl->assign('marginwidth', $frame->getVar('frame_marginwidth'));
61
+		$xoopsTpl->assign('marginheight', $frame->getVar('frame_marginheight'));
62
+		$xoopsTpl->assign('scrolling', $tblscrolling[(string)($frame->getVar('frame_scrolling') - 1)]);
63
+		if ('' !== xoops_trim($suplparam)) {
64
+			$xoopsTpl->assign('url', $frame->getVar('frame_url') . '?' . $suplparam);
65
+		} else {
66
+			$xoopsTpl->assign('url', $frame->getVar('frame_url'));
67
+		}
68
+		$title = $frame->getVar('frame_description');
69
+		myiframe_set_metas($title, $title);
70
+	} else {
71
+		$xoopsTpl->assign('frameok', false);
72
+		$xoopsTpl->assign('frame_error', _MYIFRAME_FRAME_ERROR);
73
+	}
74 74
 } else {
75
-    if (myiframe_getmoduleoption('showlist')) {
76
-        $baseurl = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php';
77
-        $frarray = [];
78
-        $critere = new \Criteria('1', '1', '=');
79
-        $critere->setSort('frame_description');
80
-        $frarray = $iframeHandler->getObjects($critere);
81
-        if (count($frarray) > 0) {
82
-            foreach ($frarray as $frame) {
83
-                /** @var Myiframe $frame */
84
-                if ('' === xoops_trim($frame->getVar('frame_description'))) {
85
-                    $liendesc = $frame->getVar('frame_url');
86
-                } else {
87
-                    $liendesc = "<a href='" . $baseurl . '?iframeid=' . $frame->getVar('frame_frameid') . "'>" . $frame->getVar('frame_description') . '</a>';
88
-                }
89
-                $iframe['list'] = $liendesc;
90
-                $xoopsTpl->append('iframes', $iframe);
91
-            }
92
-        }
93
-    } else {
94
-        $xoopsTpl->assign('frameok', false);
95
-        $xoopsTpl->assign('frame_error', _MYIFRAME_FRAME_ERROR);
96
-    }
75
+	if (myiframe_getmoduleoption('showlist')) {
76
+		$baseurl = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php';
77
+		$frarray = [];
78
+		$critere = new \Criteria('1', '1', '=');
79
+		$critere->setSort('frame_description');
80
+		$frarray = $iframeHandler->getObjects($critere);
81
+		if (count($frarray) > 0) {
82
+			foreach ($frarray as $frame) {
83
+				/** @var Myiframe $frame */
84
+				if ('' === xoops_trim($frame->getVar('frame_description'))) {
85
+					$liendesc = $frame->getVar('frame_url');
86
+				} else {
87
+					$liendesc = "<a href='" . $baseurl . '?iframeid=' . $frame->getVar('frame_frameid') . "'>" . $frame->getVar('frame_description') . '</a>';
88
+				}
89
+				$iframe['list'] = $liendesc;
90
+				$xoopsTpl->append('iframes', $iframe);
91
+			}
92
+		}
93
+	} else {
94
+		$xoopsTpl->assign('frameok', false);
95
+		$xoopsTpl->assign('frame_error', _MYIFRAME_FRAME_ERROR);
96
+	}
97 97
 }
98 98
 require_once XOOPS_ROOT_PATH . '/footer.php';
Please login to merge, or discard this patch.
blocks/myiframe_iframe.php 1 patch
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
 
10 10
 use XoopsModules\Newbb;
11 11
 use XoopsModules\Myiframe\{
12
-    Constants,
13
-    Helper
12
+	Constants,
13
+	Helper
14 14
 };
15 15
 /** @var Helper $helper */
16 16
 
@@ -22,40 +22,40 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function b_myiframe_iframe_show($options)
24 24
 {
25
-    if (!class_exists(Helper::class)) {
26
-        return false;
27
-    }
28
-    $frame         = null;
29
-    $helper = Helper::getInstance();
30
-    $block         = [];
31
-    $tblalign      = [
32
-        'top',
33
-        'middle',
34
-        'bottom',
35
-        'left',
36
-        'rigth',
37
-    ];
38
-    $tblscrolling  = [
39
-        'yes',
40
-        'no',
41
-        'auto',
42
-    ];
43
-    $iframeHandler = $helper->getHandler('MyiframeBase');
44
-    $frame         = $iframeHandler->get($options[0]);
25
+	if (!class_exists(Helper::class)) {
26
+		return false;
27
+	}
28
+	$frame         = null;
29
+	$helper = Helper::getInstance();
30
+	$block         = [];
31
+	$tblalign      = [
32
+		'top',
33
+		'middle',
34
+		'bottom',
35
+		'left',
36
+		'rigth',
37
+	];
38
+	$tblscrolling  = [
39
+		'yes',
40
+		'no',
41
+		'auto',
42
+	];
43
+	$iframeHandler = $helper->getHandler('MyiframeBase');
44
+	$frame         = $iframeHandler->get($options[0]);
45 45
 
46
-    if (is_object($frame)) {
47
-        $block['longdesc']     = $frame->getVar('frame_description');
48
-        $block['width']        = $frame->getVar('frame_width');
49
-        $block['height']       = $frame->getVar('frame_height');
50
-        $block['align']        = $tblalign[$frame->getVar('frame_align') - 1];
51
-        $block['frameborder']  = $frame->getVar('frame_frameborder');
52
-        $block['marginwidth']  = $frame->getVar('frame_marginwidth');
53
-        $block['marginheight'] = $frame->getVar('frame_marginheight');
54
-        $block['scrolling']    = $tblscrolling[$frame->getVar('frame_scrolling') - 1];
55
-        $block['url']          = $frame->getVar('frame_url');
56
-    }
46
+	if (is_object($frame)) {
47
+		$block['longdesc']     = $frame->getVar('frame_description');
48
+		$block['width']        = $frame->getVar('frame_width');
49
+		$block['height']       = $frame->getVar('frame_height');
50
+		$block['align']        = $tblalign[$frame->getVar('frame_align') - 1];
51
+		$block['frameborder']  = $frame->getVar('frame_frameborder');
52
+		$block['marginwidth']  = $frame->getVar('frame_marginwidth');
53
+		$block['marginheight'] = $frame->getVar('frame_marginheight');
54
+		$block['scrolling']    = $tblscrolling[$frame->getVar('frame_scrolling') - 1];
55
+		$block['url']          = $frame->getVar('frame_url');
56
+	}
57 57
 
58
-    return $block;
58
+	return $block;
59 59
 }
60 60
 
61 61
 /**
@@ -64,30 +64,30 @@  discard block
 block discarded – undo
64 64
  */
65 65
 function b_myiframe_iframe_edit($options)
66 66
 {
67
-    if (!class_exists(Helper::class)) {
68
-        return false;
69
-    }
70
-    $helper = Helper::getInstance();
67
+	if (!class_exists(Helper::class)) {
68
+		return false;
69
+	}
70
+	$helper = Helper::getInstance();
71 71
 
72
-    /** @var \MyiframeBaseHandler $iframeHandler */
73
-    $iframeHandler = $helper->getHandler('MyiframeBase');
74
-    $frarray       = [];
75
-    $critere       = new \Criteria('1', '1', '=');
76
-    $critere->setSort('frame_description');
77
-    $frarray = $iframeHandler->getObjects($critere);
72
+	/** @var \MyiframeBaseHandler $iframeHandler */
73
+	$iframeHandler = $helper->getHandler('MyiframeBase');
74
+	$frarray       = [];
75
+	$critere       = new \Criteria('1', '1', '=');
76
+	$critere->setSort('frame_description');
77
+	$frarray = $iframeHandler->getObjects($critere);
78 78
 
79
-    $form = '' . _MB_MYIFRAME_IFRAME . "&nbsp;<select name='options[0]'>";
80
-    /** @var Myiframe $oneframe */
81
-    foreach ($frarray as $oneframe) {
82
-        $form .= "<option value='" . $oneframe->getVar('frame_frameid') . "'";
83
-        if ($options[0] == $oneframe->getVar('frame_frameid')) {
84
-            $form .= " selected='selected'";
85
-        }
86
-        $form .= '>' . $oneframe->getVar('frame_description') . '</option>';
87
-    }
88
-    $form .= "</select>\n";
79
+	$form = '' . _MB_MYIFRAME_IFRAME . "&nbsp;<select name='options[0]'>";
80
+	/** @var Myiframe $oneframe */
81
+	foreach ($frarray as $oneframe) {
82
+		$form .= "<option value='" . $oneframe->getVar('frame_frameid') . "'";
83
+		if ($options[0] == $oneframe->getVar('frame_frameid')) {
84
+			$form .= " selected='selected'";
85
+		}
86
+		$form .= '>' . $oneframe->getVar('frame_description') . '</option>';
87
+	}
88
+	$form .= "</select>\n";
89 89
 
90
-    return $form;
90
+	return $form;
91 91
 }
92 92
 
93 93
 /**
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
  */
96 96
 function b_myiframe_iframe_onthefly($options): void
97 97
 {
98
-    $options = explode('|', $options);
99
-    $block   = b_myiframe_iframe_show($options);
98
+	$options = explode('|', $options);
99
+	$block   = b_myiframe_iframe_show($options);
100 100
 
101
-    $tpl = new \XoopsTpl();
102
-    $tpl->assign('block', $block);
103
-    $tpl->display('db:myiframe_block_show.tpl');
101
+	$tpl = new \XoopsTpl();
102
+	$tpl->assign('block', $block);
103
+	$tpl->display('db:myiframe_block_show.tpl');
104 104
 }
Please login to merge, or discard this patch.
class/Constants.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -27,28 +27,28 @@
 block discarded – undo
27 27
  */
28 28
 final class Constants
29 29
 {
30
-    /**#@+
30
+	/**#@+
31 31
      * Constant definition
32 32
      */
33 33
 
34
-    public const DISALLOW = 0;
35
-
36
-    /**
37
-     * no delay XOOPS redirect delay (in seconds)
38
-     */
39
-    public const REDIRECT_DELAY_NONE = 0;
40
-    /**
41
-     * short XOOPS redirect delay (in seconds)
42
-     */
43
-    public const REDIRECT_DELAY_SHORT = 1;
44
-    /**
45
-     * medium XOOPS redirect delay (in seconds)
46
-     */
47
-    public const REDIRECT_DELAY_MEDIUM = 3;
48
-    /**
49
-     * long XOOPS redirect delay (in seconds)
50
-     */
51
-    public const REDIRECT_DELAY_LONG = 7;
52
-
53
-    /**#@-*/
34
+	public const DISALLOW = 0;
35
+
36
+	/**
37
+	 * no delay XOOPS redirect delay (in seconds)
38
+	 */
39
+	public const REDIRECT_DELAY_NONE = 0;
40
+	/**
41
+	 * short XOOPS redirect delay (in seconds)
42
+	 */
43
+	public const REDIRECT_DELAY_SHORT = 1;
44
+	/**
45
+	 * medium XOOPS redirect delay (in seconds)
46
+	 */
47
+	public const REDIRECT_DELAY_MEDIUM = 3;
48
+	/**
49
+	 * long XOOPS redirect delay (in seconds)
50
+	 */
51
+	public const REDIRECT_DELAY_LONG = 7;
52
+
53
+	/**#@-*/
54 54
 }
Please login to merge, or discard this patch.
class/Common/TestdataButtons.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
  */
24 24
 
25 25
 use Xmf\{
26
-    Module\Admin,
27
-    Request,
28
-    Yaml
26
+	Module\Admin,
27
+	Request,
28
+	Yaml
29 29
 };
30 30
 use XoopsModules\Myiframe\{
31
-    Helper
31
+	Helper
32 32
 };
33 33
 
34 34
 /** @var Helper $helper */
@@ -40,65 +40,65 @@  discard block
 block discarded – undo
40 40
  */
41 41
 class TestdataButtons
42 42
 {
43
-    /** Button status constants */
44
-    private const SHOW_BUTTONS = 1;
45
-    private const HIDE_BUTTONS = 0;
43
+	/** Button status constants */
44
+	private const SHOW_BUTTONS = 1;
45
+	private const HIDE_BUTTONS = 0;
46 46
 
47
-    /**
48
-     * Load the test button configuration
49
-     *
50
-     * @param \Xmf\Module\Admin $adminObject
51
-     *
52
-     * @return void
53
-     */
54
-    public static function loadButtonConfig($adminObject): void
55
-    {
56
-        $moduleDirName      = \basename(\dirname(__DIR__, 2));
57
-        $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
58
-        $helper              = Helper::getInstance();
59
-        $yamlFile            = $helper->path('/config/admin.yml');
60
-        /** @var array $config */
61
-        $config              = Yaml::readWrapped($yamlFile); // work with phpmyadmin YAML dumps
62
-        $displaySampleButton = $config['displaySampleButton'];
47
+	/**
48
+	 * Load the test button configuration
49
+	 *
50
+	 * @param \Xmf\Module\Admin $adminObject
51
+	 *
52
+	 * @return void
53
+	 */
54
+	public static function loadButtonConfig($adminObject): void
55
+	{
56
+		$moduleDirName      = \basename(\dirname(__DIR__, 2));
57
+		$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
58
+		$helper              = Helper::getInstance();
59
+		$yamlFile            = $helper->path('/config/admin.yml');
60
+		/** @var array $config */
61
+		$config              = Yaml::readWrapped($yamlFile); // work with phpmyadmin YAML dumps
62
+		$displaySampleButton = $config['displaySampleButton'];
63 63
 
64
-        if (self::SHOW_BUTTONS == $displaySampleButton) {
65
-            \xoops_loadLanguage('admin/modulesadmin', 'system');
66
-            $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA'), $helper->url('testdata/index.php?op=load'), 'add');
67
-            $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA'), $helper->url('testdata/index.php?op=save'), 'add');
68
-            $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA'), $helper->url('testdata/index.php?op=clear'), 'alert');
69
-            //    $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA'), $helper->url( 'testdata/index.php?op=exportschema'), 'add');
70
-            $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete');
71
-        } else {
72
-            $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add');
73
-            // $displaySampleButton = $config['displaySampleButton'];
74
-        }
75
-    }
64
+		if (self::SHOW_BUTTONS == $displaySampleButton) {
65
+			\xoops_loadLanguage('admin/modulesadmin', 'system');
66
+			$adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA'), $helper->url('testdata/index.php?op=load'), 'add');
67
+			$adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA'), $helper->url('testdata/index.php?op=save'), 'add');
68
+			$adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA'), $helper->url('testdata/index.php?op=clear'), 'alert');
69
+			//    $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA'), $helper->url( 'testdata/index.php?op=exportschema'), 'add');
70
+			$adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete');
71
+		} else {
72
+			$adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add');
73
+			// $displaySampleButton = $config['displaySampleButton'];
74
+		}
75
+	}
76 76
 
77
-    /**
78
-     * Hide the test buttons
79
-     *
80
-     * @return void
81
-     */
82
-    public static function hideButtons(): void
83
-    {
84
-        $yamlFile                   = \dirname(__DIR__, 2) . '/config/admin.yml';
85
-        $app                        = [];
86
-        $app['displaySampleButton'] = 0;
87
-        Yaml::save($app, $yamlFile);
88
-        \redirect_header('index.php', 0, '');
89
-    }
77
+	/**
78
+	 * Hide the test buttons
79
+	 *
80
+	 * @return void
81
+	 */
82
+	public static function hideButtons(): void
83
+	{
84
+		$yamlFile                   = \dirname(__DIR__, 2) . '/config/admin.yml';
85
+		$app                        = [];
86
+		$app['displaySampleButton'] = 0;
87
+		Yaml::save($app, $yamlFile);
88
+		\redirect_header('index.php', 0, '');
89
+	}
90 90
 
91
-    /**
92
-     * Show the test buttons
93
-     *
94
-     * @return void
95
-     */
96
-    public static function showButtons(): void
97
-    {
98
-        $yamlFile                   = \dirname(__DIR__, 2) . '/config/admin.yml';
99
-        $app                        = [];
100
-        $app['displaySampleButton'] = 1;
101
-        Yaml::save($app, $yamlFile);
102
-        \redirect_header('index.php', 0, '');
103
-    }
91
+	/**
92
+	 * Show the test buttons
93
+	 *
94
+	 * @return void
95
+	 */
96
+	public static function showButtons(): void
97
+	{
98
+		$yamlFile                   = \dirname(__DIR__, 2) . '/config/admin.yml';
99
+		$app                        = [];
100
+		$app['displaySampleButton'] = 1;
101
+		Yaml::save($app, $yamlFile);
102
+		\redirect_header('index.php', 0, '');
103
+	}
104 104
 }
Please login to merge, or discard this patch.
class/Helper.php 1 patch
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -23,62 +23,62 @@
 block discarded – undo
23 23
  */
24 24
 class Helper extends \Xmf\Module\Helper
25 25
 {
26
-    public $debug;
26
+	public $debug;
27 27
 
28
-    /**
29
-     * @param bool $debug
30
-     */
31
-    public function __construct($debug = false)
32
-    {
33
-        $this->debug   = $debug;
34
-        $moduleDirName = \basename(\dirname(__DIR__));
35
-        parent::__construct($moduleDirName);
36
-    }
28
+	/**
29
+	 * @param bool $debug
30
+	 */
31
+	public function __construct($debug = false)
32
+	{
33
+		$this->debug   = $debug;
34
+		$moduleDirName = \basename(\dirname(__DIR__));
35
+		parent::__construct($moduleDirName);
36
+	}
37 37
 
38
-    /**
39
-     * @param bool $debug
40
-     *
41
-     * @return \XoopsModules\Myiframe\Helper
42
-     */
43
-    public static function getInstance(bool $debug = false): self
44
-    {
45
-        static $instance;
46
-        if (null === $instance) {
47
-            $instance = new static($debug);
48
-        }
38
+	/**
39
+	 * @param bool $debug
40
+	 *
41
+	 * @return \XoopsModules\Myiframe\Helper
42
+	 */
43
+	public static function getInstance(bool $debug = false): self
44
+	{
45
+		static $instance;
46
+		if (null === $instance) {
47
+			$instance = new static($debug);
48
+		}
49 49
 
50
-        return $instance;
51
-    }
50
+		return $instance;
51
+	}
52 52
 
53
-    /**
54
-     * @return string
55
-     */
56
-    public function getDirname()
57
-    {
58
-        return $this->dirname;
59
-    }
53
+	/**
54
+	 * @return string
55
+	 */
56
+	public function getDirname()
57
+	{
58
+		return $this->dirname;
59
+	}
60 60
 
61
-    /**
62
-     * Get an Object Handler
63
-     *
64
-     * @param string $name name of handler to load
65
-     *
66
-     * @return bool|\XoopsObjectHandler|\XoopsPersistableObjectHandler
67
-     */
68
-    public function getHandler($name)
69
-    {
70
-        $ret = false;
61
+	/**
62
+	 * Get an Object Handler
63
+	 *
64
+	 * @param string $name name of handler to load
65
+	 *
66
+	 * @return bool|\XoopsObjectHandler|\XoopsPersistableObjectHandler
67
+	 */
68
+	public function getHandler($name)
69
+	{
70
+		$ret = false;
71 71
 
72
-        $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler';
73
-        if (!\class_exists($class)) {
74
-            throw new \RuntimeException("Class '$class' not found");
75
-        }
76
-        /** @var \XoopsMySQLDatabase $db */
77
-        $db     = \XoopsDatabaseFactory::getDatabaseConnection();
78
-        $helper = self::getInstance();
79
-        $ret    = new $class($db, $helper);
80
-        $this->addLog("Getting handler '{$name}'");
72
+		$class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler';
73
+		if (!\class_exists($class)) {
74
+			throw new \RuntimeException("Class '$class' not found");
75
+		}
76
+		/** @var \XoopsMySQLDatabase $db */
77
+		$db     = \XoopsDatabaseFactory::getDatabaseConnection();
78
+		$helper = self::getInstance();
79
+		$ret    = new $class($db, $helper);
80
+		$this->addLog("Getting handler '{$name}'");
81 81
 
82
-        return $ret;
83
-    }
82
+		return $ret;
83
+	}
84 84
 }
Please login to merge, or discard this patch.