|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace XoopsModules\Tdmcreate\Files\Templates\User; |
|
4
|
|
|
|
|
5
|
|
|
use XoopsModules\Tdmcreate; |
|
6
|
|
|
use XoopsModules\Tdmcreate\Files; |
|
7
|
|
|
|
|
8
|
|
|
/* |
|
9
|
|
|
You may not change or alter any portion of this comment or credits |
|
10
|
|
|
of supporting developers from this source code or any supporting source code |
|
11
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
|
12
|
|
|
|
|
13
|
|
|
This program is distributed in the hope that it will be useful, |
|
14
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
16
|
|
|
*/ |
|
17
|
|
|
/** |
|
18
|
|
|
* tdmcreate module. |
|
19
|
|
|
* |
|
20
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
|
21
|
|
|
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) |
|
22
|
|
|
* |
|
23
|
|
|
* @since 2.5.0 |
|
24
|
|
|
* |
|
25
|
|
|
* @author Txmod Xoops http://www.txmodxoops.org |
|
26
|
|
|
* |
|
27
|
|
|
*/ |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* class Footer. |
|
31
|
|
|
*/ |
|
32
|
|
|
class Footer extends Files\CreateFile |
|
33
|
|
|
{ |
|
34
|
|
|
/** |
|
35
|
|
|
* @var string |
|
36
|
|
|
*/ |
|
37
|
|
|
private $tdmcfile = null; |
|
|
|
|
|
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @public function constructor |
|
41
|
|
|
* @param null |
|
42
|
|
|
*/ |
|
43
|
|
|
public function __construct() |
|
44
|
|
|
{ |
|
45
|
|
|
parent::__construct(); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* @static function getInstance |
|
50
|
|
|
* @param null |
|
51
|
|
|
* @return Footer |
|
52
|
|
|
*/ |
|
53
|
|
|
public static function getInstance() |
|
54
|
|
|
{ |
|
55
|
|
|
static $instance = false; |
|
56
|
|
|
if (!$instance) { |
|
57
|
|
|
$instance = new self(); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
return $instance; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @public function write |
|
65
|
|
|
* @param string $module |
|
66
|
|
|
* @param mixed $table |
|
67
|
|
|
* @param string $filename |
|
68
|
|
|
*/ |
|
69
|
|
|
public function write($module, $table, $filename) |
|
70
|
|
|
{ |
|
71
|
|
|
$this->setModule($module); |
|
72
|
|
|
$this->setTable($table); |
|
73
|
|
|
$this->setFileName($filename); |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @public function getTemplateUserFooterFacebookLikeButton |
|
78
|
|
|
* @param null |
|
79
|
|
|
* |
|
80
|
|
|
* @return bool|string |
|
81
|
|
|
*/ |
|
82
|
|
|
public function getTemplateUserFooterFacebookLikeButton() |
|
83
|
|
|
{ |
|
84
|
|
|
return "<li class='fb-like' data-href='<{\$xoops_mpageurl}>' data-layout='standard' data-action='like' data-show-faces='true'></li>"; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* @public function getTemplateUserFooterFacebookShareButton |
|
89
|
|
|
* @param null |
|
90
|
|
|
* |
|
91
|
|
|
* @return bool|string |
|
92
|
|
|
*/ |
|
93
|
|
|
public function getTemplateUserFooterFacebookShareButton() |
|
94
|
|
|
{ |
|
95
|
|
|
return "<li class='fb-share-button' data-href='<{\$xoops_mpageurl}>' data-layout='button_count'></li>"; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* @public function render |
|
100
|
|
|
* @param null |
|
101
|
|
|
* @return bool|string |
|
102
|
|
|
*/ |
|
103
|
|
|
private function getTemplateUserFooterContent($moduleDirname, $language) |
|
|
|
|
|
|
104
|
|
|
{ |
|
105
|
|
|
$hc = Tdmcreate\Files\CreateHtmlCode::getInstance(); |
|
106
|
|
|
$sc = Tdmcreate\Files\CreateSmartyCode::getInstance(); |
|
107
|
|
|
$ret = $hc->getHtmlDiv('<{$copyright}>', 'pull-left', '', "\n", false); |
|
108
|
|
|
$ret .= $hc->getHtmlEmpty("\n"); |
|
109
|
|
|
$contIf = $hc->getHtmlDiv('<{$pagenav}>', 'pull-right', "\t", "\n", false); |
|
110
|
|
|
$ret .= $sc->getSmartyConditions('pagenav', ' != ', "''", $contIf); |
|
111
|
|
|
$ret .= $hc->getHtmlEmpty("<br>\n"); |
|
112
|
|
|
$contIf = $hc->getHtmlDiv("<a href='<{\$admin}>'><{\$smarty.const.{$language}ADMIN}></a>", 'text-center bold', "\t", "\n", false); |
|
113
|
|
|
$ret .= $sc->getSmartyConditions('xoops_isadmin', ' != ', "''", $contIf); |
|
114
|
|
|
$ret .= $hc->getHtmlEmpty("\n"); |
|
115
|
|
|
$contIf = $sc->getSmartyIncludeFile('system_comments','flat',false, false,"\t\t\t"); |
|
116
|
|
|
$contIf .= $this->getSimpleString('<{elseif $comment_mode == "thread"}>',"\t\t"); |
|
117
|
|
|
$contIf .= $sc->getSmartyIncludeFile('system_comments','thread',false, false,"\t\t\t"); |
|
118
|
|
|
$contIf .= $this->getSimpleString('<{elseif $comment_mode == "nest"}>',"\t\t"); |
|
119
|
|
|
$contIf .= $sc->getSmartyIncludeFile('system_comments','nest',false, false,"\t\t\t"); |
|
120
|
|
|
$contDiv = $sc->getSmartyConditions('comment_mode', ' == ', '"flat"', $contIf, false, '','',"\t\t"); |
|
|
|
|
|
|
121
|
|
|
$contIf = $hc->getHtmlDiv($contDiv, 'pad2 marg2', "\t", "\n", true); |
|
122
|
|
|
$ret .= $sc->getSmartyConditions('comment_mode', '', '', $contIf); |
|
123
|
|
|
|
|
124
|
|
|
return $ret; |
|
125
|
|
|
} |
|
126
|
|
|
|
|
127
|
|
|
|
|
128
|
|
|
/** |
|
129
|
|
|
* @public function render |
|
130
|
|
|
* @param null |
|
131
|
|
|
* @return bool|string |
|
132
|
|
|
*/ |
|
133
|
|
|
public function render() |
|
134
|
|
|
{ |
|
135
|
|
|
$module = $this->getModule(); |
|
136
|
|
|
$filename = $this->getFileName(); |
|
137
|
|
|
$moduleDirname = $module->getVar('mod_dirname'); |
|
138
|
|
|
$language = $this->getLanguage($moduleDirname, 'MA'); |
|
139
|
|
|
$content = $this->getTemplateUserFooterContent($moduleDirname, $language); |
|
140
|
|
|
|
|
141
|
|
|
$this->create($moduleDirname, 'templates', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); |
|
142
|
|
|
|
|
143
|
|
|
return $this->renderFile(); |
|
144
|
|
|
} |
|
145
|
|
|
} |
|
146
|
|
|
|