1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: 13: 14: 15: 16: 17:
18:
19:
20:
21: 22: 23: 24: 25: 26:
27: class SystemBannerclient extends XoopsObject
28: {
29: 30: 31:
32: public function __construct()
33: {
34: parent::__construct();
35: $this->initVar('cid', XOBJ_DTYPE_INT, null, false, 5);
36: $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, false);
37: $this->initVar('contact', XOBJ_DTYPE_TXTBOX, null, false);
38: $this->initVar('email', XOBJ_DTYPE_TXTBOX, null, false);
39: $this->initVar('login', XOBJ_DTYPE_TXTBOX, null, false);
40: $this->initVar('passwd', XOBJ_DTYPE_TXTBOX, null, false);
41: $this->initVar('extrainfo', XOBJ_DTYPE_TXTAREA, null, false);
42:
43:
44: }
45:
46: 47: 48: 49: 50:
51: public function getForm($action = false)
52: {
53: if ($action === false) {
54: $action = $_SERVER['REQUEST_URI'];
55: }
56:
57: $title = $this->isNew() ? sprintf(_AM_SYSTEM_BANNERS_ADDNWCLI) : sprintf(_AM_SYSTEM_BANNERS_EDITADVCLI);
58:
59: xoops_load('XoopsFormLoader');
60:
61: $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
62:
63: $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_CLINAMET, 'name', 50, 255, $this->getVar('name')), true);
64: $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_CONTNAMET, 'contact', 50, 255, $this->getVar('contact')));
65: $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_CONTMAILT, 'email', 50, 255, $this->getVar('email')));
66: $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_CLILOGINT, 'login', 50, 255, $this->getVar('login')));
67: $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_CLIPASST, 'passwd', 50, 255, $this->getVar('passwd')));
68:
69: $form->addElement(new xoopsFormTextArea(_AM_SYSTEM_BANNERS_EXTINFO, 'extrainfo', $this->getVar('extrainfo'), 5, 50), false);
70:
71: $form->addElement(new XoopsFormHidden('op', 'banner_client_save'));
72: $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
73:
74: return $form;
75: }
76: }
77:
78: 79: 80: 81: 82: 83: 84: 85: 86: 87:
88: class SystemBannerclientHandler extends XoopsPersistableObjectHandler
89: {
90: 91: 92:
93: public function __construct($db)
94: {
95: parent::__construct($db, 'bannerclient', 'SystemBannerclient', 'cid', 'name');
96: }
97: }
98: