22 require_once dirname(__FILE__).
'/../../../../../../mainfile.php';
25 $xoops->disableErrorReporting();
26 $xoops->simpleHeader(
false);
29 $helper->loadLanguage(
'tinymce');
31 $op = Request::getCmd(
'op',
'');
33 if (!
$xoops->security()->check()) {
34 $xoops->redirect(
'xoops_xlanguage.php', 2, implode(
',',
$xoops->security()->getErrors()));
40 $obj =
$helper->getHandlerSmilies()->create();
42 $obj->setVar(
'smiley_code', Request::getString(
'smiley_code',
''));
43 $obj->setVar(
'smiley_emotion', Request::getString(
'smiley_emotion',
''));
44 $obj->setVar(
'smiley_display', Request::getBool(
'smiley_display', 1));
45 $obj->setVar(
'smiley_url',
'smilies/' . Request::getPath(
'smiley_url',
''));
46 $xoops_upload_file = Request::getArray(
'xoops_upload_file', array());
48 $mimetypes = array(
'image/gif',
'image/jpeg',
'image/pjpeg',
'image/x-png',
'image/png');
51 if ($uploader->fetchMedia($xoops_upload_file[0])) {
52 $uploader->setPrefix(
'smil');
53 if (!$uploader->upload()) {
54 $msg[] = $uploader->getErrors();
55 $obj->setVar(
'smiley_url',
'blank.gif');
57 $obj->setVar(
'smiley_url',
'smilies/' . $uploader->getSavedFileName());
61 if (
$helper->getHandlerSmilies()->insert($obj)) {
62 $xoops->redirect(
'xoops_smilies.php', 2, implode(
'<br />',
$msg));
68 $xoopsTpl->assign(
'smileys',
Xoops\Module\Helper::getHelper(
'smilies')->getHandlerSmilies()->getSmilies(0, 0,
false));
70 $xoopsTpl->assign(
'smileys',
Xoops\Module\Helper::getHelper(
'smilies')->getHandlerSmilies()->getActiveSmilies(
false));
81 $xoopsTpl->display(
'module:smilies/smilies_tinymce.tpl');
if($op== 'save') $xoopsTpl
static getHelper($dirname= 'system')
static load($name, $type="core")
if(!is_object($module)||!$module->getVar('isactive')) $msg