20 defined(
'XOOPS_ROOT_PATH') or die('XOOPS root path not defined');
30 function __construct()
32 parent::__construct();
48 $blank_img =
'blank.gif';
50 $blank_img = str_replace(
'smilies/',
'', $this->getVar(
'smile_url',
'e') );
59 $form->setExtra(
'enctype="multipart/form-data"');
65 $imageselect_img =
new XoopsFormSelect( $imgpath_img,
'smile_url', $blank_img );
66 $image_array_img = XoopsLists::getImgListAsArray(
XOOPS_UPLOAD_PATH .
'/smilies' );
67 $imageselect_img->addOption(
"$blank_img", $blank_img);
68 foreach ($image_array_img as $image_img) {
69 $imageselect_img->addOption(
"$image_img", $image_img);
71 $imageselect_img->setExtra(
'onchange="showImgSelected(\'xo-smilies-img\', \'smile_url\', \'smilies\', \'\', \'' .
XOOPS_UPLOAD_URL .
'\' )
"' );
72 $imgtray_img->addElement( $imageselect_img, false);
73 $imgtray_img->addElement( new XoopsFormLabel( '', "<br /><img src=
'" . XOOPS_UPLOAD_URL . "/smilies/" . $blank_img . "' name=
'image_img' id=
'xo-smilies-img' alt=
'' />
" ) );
75 $fileseltray_img = new XoopsFormElementTray('<br />','<br /><br />');
76 $fileseltray_img->addElement(new XoopsFormFile(_AM_SYSTEM_SMILIES_UPLOADS , 'smile_url', 500000),false);
77 $fileseltray_img->addElement(new XoopsFormLabel(''), false);
78 $imgtray_img->addElement($fileseltray_img);
79 $form->addElement($imgtray_img);
81 if (!$this->isNew()) {
82 $form->addElement(new XoopsFormHidden('smilies_id', $this->getVar('id')));
83 $display = $this->getVar('display');
88 $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_SMILIES_OFF, 'display', $display));
90 $form->addElement(new XoopsFormHidden('op', 'save_smilie'));
91 $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
106 class systemsmiliesHandler extends XoopsPersistableObjectHandler
109 function __construct($db)
111 parent::__construct($db, 'smiles', 'SystemSmilies', 'id', 'code');