AdminAbout::write()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php namespace XoopsModules\Tdmcreate\Files\Admin;
2
3
use XoopsModules\Tdmcreate;
4
use XoopsModules\Tdmcreate\Files;
5
6
/*
7
 You may not change or alter any portion of this comment or credits
8
 of supporting developers from this source code or any supporting source code
9
 which is considered copyrighted (c) material of the original comment or credit authors.
10
11
 This program is distributed in the hope that it will be useful,
12
 but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 */
15
/**
16
 * tdmcreate module.
17
 *
18
 * @copyright       XOOPS Project (https://xoops.org)
19
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
20
 *
21
 * @since           2.5.0
22
 *
23
 * @author          Txmod Xoops http://www.txmodxoops.org
24
 *
25
 * @version         $Id: 1.91 admin_about.php 12258 2014-01-02 09:33:29Z timgno $
26
 */
27
28
/**
29
 * Class AdminAbout.
30
 */
31
class AdminAbout extends Files\CreateFile
32
{
33
    /**
34
    * @var mixed
35
    */
36
    private $axc = null;
37
38
    /**
39
    * @var string
40
    */
41
    private $xc = null;
42
43
    /**
44
    *  @public function constructor
45
    *  @param null
46
    */
47
48
    public function __construct()
49
    {
50
        parent::__construct();
51
        $this->xc = Tdmcreate\Files\CreateXoopsCode::getInstance();
0 ignored issues
show
Documentation Bug introduced by
It seems like XoopsModules\Tdmcreate\F...oopsCode::getInstance() of type XoopsModules\Tdmcreate\Files\CreateXoopsCode is incompatible with the declared type string of property $xc.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
52
        $this->axc = Tdmcreate\Files\Admin\AdminXoopsCode::getInstance();
53
    }
54
55
    /**
56
    *  @static function getInstance
57
    *  @param null
58
    * @return AdminAbout
59
    */
60
    public static function getInstance()
61
    {
62
        static $instance = false;
63
        if (!$instance) {
64
            $instance = new self();
65
        }
66
67
        return $instance;
68
    }
69
70
    /**
71
    *  @public function write
72
    *  @param string $module
73
    *  @param string $filename
74
    */
75
    public function write($module, $filename)
76
    {
77
        $this->setModule($module);
78
        $this->setFileName($filename);
79
    }
80
81
    /**
82
    *  @public function render
83
    *  @param null
84
    * @return bool|string
85
    */
86
    public function render()
87
    {
88
        $module = $this->getModule();
89
        $filename = $this->getFileName();
90
        $moduleDirname = $module->getVar('mod_dirname');
91
        $moduleDonations = $module->getVar('mod_donations');
92
        $content = $this->getHeaderFilesComments($module, $filename);
93
        $content .= $this->getInclude();
94
        $content .= $this->axc->getAdminTemplateMain($moduleDirname, 'about');
95
        $content .= $this->xc->getXcTplAssign('navigation', "\$adminObject->displayNavigation('about.php')");
96
        $content .= $this->xc->getXcTplAssign('about', "\$adminObject->renderAbout('{$moduleDonations}', false)");
97
        $content .= $this->getInclude('footer');
98
99
        $this->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
100
101
        return $this->renderFile();
102
    }
103
}
104