1: <?php
2: /*
3: You may not change or alter any portion of this comment or credits
4: of supporting developers from this source code or any supporting source code
5: which is considered copyrighted (c) material of the original comment or credit authors.
6:
7: This program is distributed in the hope that it will be useful,
8: but WITHOUT ANY WARRANTY; without even the implied warranty of
9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: /**
13: * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
14: * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
15: * @author Gregory Mage (AKA Mage)
16: * @package system
17: */
18:
19: // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
20:
21: /**
22: * System Banner Client
23: *
24: * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
25: * @package system
26: */
27: class SystemBannerclient extends XoopsObject
28: {
29: //PHP 8.2 Dynamic properties deprecated
30: public $cid;
31: public $name;
32: public $contact;
33: public $email;
34: public $login;
35: public $passwd;
36: public $extrainfo;
37:
38: /**
39: *
40: */
41: public function __construct()
42: {
43: parent::__construct();
44: $this->initVar('cid', XOBJ_DTYPE_INT, null, false, 5);
45: $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, false);
46: $this->initVar('contact', XOBJ_DTYPE_TXTBOX, null, false);
47: $this->initVar('email', XOBJ_DTYPE_TXTBOX, null, false);
48: $this->initVar('login', XOBJ_DTYPE_TXTBOX, null, false);
49: $this->initVar('passwd', XOBJ_DTYPE_TXTBOX, null, false);
50: $this->initVar('extrainfo', XOBJ_DTYPE_TXTAREA, null, false);
51: // For allow HTML
52: //$this->initVar('dohtml', XOBJ_DTYPE_INT, 1, false);
53: }
54:
55: /**
56: * @param bool $action
57: *
58: * @return XoopsThemeForm
59: */
60: public function getForm($action = false)
61: {
62: if ($action === false) {
63: $action = $_SERVER['REQUEST_URI'];
64: }
65:
66: $title = $this->isNew() ? sprintf(_AM_SYSTEM_BANNERS_ADDNWCLI) : sprintf(_AM_SYSTEM_BANNERS_EDITADVCLI);
67:
68: xoops_load('XoopsFormLoader');
69:
70: $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
71:
72: $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_CLINAMET, 'name', 50, 255, $this->getVar('name')), true);
73: $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_CONTNAMET, 'contact', 50, 255, $this->getVar('contact')));
74: $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_CONTMAILT, 'email', 50, 255, $this->getVar('email')));
75: $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_CLILOGINT, 'login', 50, 255, $this->getVar('login')));
76: $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_CLIPASST, 'passwd', 50, 255, $this->getVar('passwd')));
77:
78: $form->addElement(new xoopsFormTextArea(_AM_SYSTEM_BANNERS_EXTINFO, 'extrainfo', $this->getVar('extrainfo'), 5, 50), false);
79:
80: $form->addElement(new XoopsFormHidden('op', 'banner_client_save'));
81: $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
82:
83: return $form;
84: }
85: }
86:
87: /**
88: * System banner client handler class. (Singelton)
89: *
90: * This class is responsible for providing data access mechanisms to the data source
91: * of XOOPS block class objects.
92: *
93: * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
94: * @package system
95: * @subpackage banner
96: */
97: class SystemBannerclientHandler extends XoopsPersistableObjectHandler
98: {
99: /**
100: * @param null|object $db
101: */
102: public function __construct($db)
103: {
104: parent::__construct($db, 'bannerclient', 'SystemBannerclient', 'cid', 'name');
105: }
106: }
107: