XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
bannerclient.php
Go to the documentation of this file.
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 
20 defined('XOOPS_ROOT_PATH') or die('XOOPS root path not defined');
21 
29 {
30  function __construct()
31  {
32  parent::__construct();
33  $this->initVar('cid',XOBJ_DTYPE_INT,null,false,5);
34  $this->initVar('name',XOBJ_DTYPE_TXTBOX,null,false);
35  $this->initVar('contact',XOBJ_DTYPE_TXTBOX,null,false);
36  $this->initVar('email',XOBJ_DTYPE_TXTBOX,null,false);
37  $this->initVar('login',XOBJ_DTYPE_TXTBOX,null,false);
38  $this->initVar('passwd',XOBJ_DTYPE_TXTBOX,null,false);
39  $this->initVar('extrainfo',XOBJ_DTYPE_TXTAREA, null, false);
40  // For allow HTML
41  //$this->initVar('dohtml', XOBJ_DTYPE_INT, 1, false);
42  }
43 
44  function getForm($action = false)
45  {
46  if ($action === false) {
47  $action = $_SERVER['REQUEST_URI'];
48  }
49 
50  $title = $this->isNew() ? sprintf( _AM_SYSTEM_BANNERS_ADDNWCLI ) : sprintf( _AM_SYSTEM_BANNERS_EDITADVCLI );
51 
52  xoops_load('XoopsFormLoader');
53 
54  $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
55 
56  $form->addElement(new XoopsFormText( _AM_SYSTEM_BANNERS_CLINAMET, 'name', 50, 255, $this->getVar('name') ), true );
57  $form->addElement(new XoopsFormText( _AM_SYSTEM_BANNERS_CONTNAMET, 'contact', 50, 255, $this->getVar('contact') ) );
58  $form->addElement(new XoopsFormText( _AM_SYSTEM_BANNERS_CONTMAILT, 'email', 50, 255, $this->getVar('email') ) );
59  $form->addElement(new XoopsFormText( _AM_SYSTEM_BANNERS_CLILOGINT, 'login', 50, 255, $this->getVar('login') ) );
60  $form->addElement(new XoopsFormText( _AM_SYSTEM_BANNERS_CLIPASST, 'passwd', 50, 255, $this->getVar('passwd') ) );
61 
62 
63  $form->addElement(new xoopsFormTextArea( _AM_SYSTEM_BANNERS_EXTINFO, 'extrainfo', $this->getVar('extrainfo'), 5, 50 ), false );
64 
65  $form->addElement(new XoopsFormHidden( 'op', 'banner_client_save' ) );
66  $form->addElement(new XoopsFormButton( '', 'submit', _SUBMIT, 'submit' ) );
67  return $form;
68  }
69 }
70 
82 {
83  function __construct( $db )
84  {
85  parent::__construct( $db, 'bannerclient', 'SystemBannerclient', 'cid', 'name' );
86  }
87 
88 }
89 
90 ?>