39 $mimetypes = array(
'image/gif',
'image/jpeg',
'image/pjpeg',
'image/x-png',
'image/png');
56 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css' );
57 $xoTheme->addScript(
'browse.php?Frameworks/jquery/jquery.js');
58 $xoTheme->addScript(
'browse.php?Frameworks/jquery/plugins/jquery.tablesorter.js');
59 $xoTheme->addScript(
'modules/system/js/admin.js');
76 $xoopsTpl->assign(
'smilies_count', $smilies_count );
77 if ( $smilies_count > 0 ){
78 foreach (array_keys($smilies_arr) as
$i){
79 $smilies_id = $smilies_arr[
$i]->getVar(
"id");
80 $smilies[
'smilies_id'] = $smilies_id;
81 $smilies[
'code'] = $smilies_arr[
$i]->getVar(
"code");
82 $smilies[
'emotion'] = $smilies_arr[
$i]->getVar(
"emotion");
83 $smilies[
'display'] = $smilies_arr[
$i]->getVar(
"display");
84 $smilies_img = ($smilies_arr[
$i]->getVar(
"smile_url")) ? $smilies_arr[$i]->getVar(
"smile_url") :
'blank.gif';
85 $smilies[
'image'] =
'<img src="' .
XOOPS_UPLOAD_URL .
'/' . $smilies_img .
'" alt="" />';
86 $smilies[
'edit_delete'] =
'<a href="admin.php?fct=smilies&op=edit_smilie&smilies_id=' . $smilies_id .
'">
88 <a href="admin.php?fct=smilies&op=smilies_delete&smilies_id=' . $smilies_id .
'">
90 $xoopsTpl->append_by_ref(
'smilies', $smilies );
104 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css' );
112 $form = $obj->getForm();
120 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css' );
128 $form = $obj->getForm();
135 if (!
$GLOBALS[
'xoopsSecurity']->check()) {
144 if (isset(
$_POST[
"smilies_id"])) {
150 $obj->setVar(
"code",
$_POST[
"code"]);
151 $obj->setVar(
"emotion",
$_POST[
"emotion"]);
152 $display = (
$_POST[
"display"] == 1) ?
"1" :
"0";
153 $obj->setVar(
"display", $display);
155 include_once XOOPS_ROOT_PATH .
'/class/uploader.php';
158 if ($uploader_smilies_img->fetchMedia(
"smile_url")) {
159 $uploader_smilies_img->setPrefix(
"smil") ;
160 $uploader_smilies_img->fetchMedia(
"smile_url");
161 if (!$uploader_smilies_img->upload()) {
162 $errors = $uploader_smilies_img->getErrors();
165 $obj->setVar(
"smile_url",
'smilies/' . $uploader_smilies_img->getSavedFileName());
168 $obj->setVar(
"smile_url",
'smilies/' .
$_POST[
"smile_url"]);
173 echo $obj->getHtmlErrors();
176 $form =& $obj->getForm();
182 case "smilies_delete":
186 if ( !
$GLOBALS[
"xoopsSecurity"]->check() ) {
191 if (is_file($urlfile)){
192 chmod($urlfile, 0777);
201 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css' );
206 $smilies_img = ($obj->getVar(
"smile_url")) ? $obj->getVar(
"smile_url") :
'blank.gif';
211 case "smilies_update_display":
214 if ( $smilies_id > 0 ) {
216 $old = $obj->getVar(
'display');
217 $obj->setVar(
'display', !$old);
221 echo $obj->getHtmlErrors();