@@ -34,7 +34,7 @@ |
||
34 | 34 | $language = preg_replace("/[^a-z0-9_\-]/i", "", $GLOBALS["xoopsConfig"]["language"]); |
35 | 35 | |
36 | 36 | if(! @include_once dirname(__FILE__)."/language/{$language}.php") { |
37 | - require_once dirname(__FILE__)."/language/english.php"; |
|
37 | + require_once dirname(__FILE__)."/language/english.php"; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | return $config; |
@@ -26,82 +26,82 @@ |
||
26 | 26 | $op = isset($_POST['op']) ? $_POST['op'] : ''; |
27 | 27 | |
28 | 28 | switch ($op) { |
29 | - case 'sendlink' : |
|
30 | - |
|
31 | - include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
32 | - $controller = new SmartObjectController($smartobject_link_handler); |
|
33 | - |
|
34 | - $linkObj = $controller->storeSmartObject(); |
|
35 | - if ($linkObj->hasError()) { |
|
36 | - /** |
|
37 | - * @todo inform user and propose to close the window if a problem occured when saving the link |
|
38 | - */ |
|
39 | - } |
|
40 | - |
|
41 | - $xoopsMailer =& getMailer(); |
|
42 | - $xoopsMailer->useMail(); |
|
43 | - $xoopsMailer->setTemplateDir('language/'.$xoopsConfig['language'].'/mail_template'); |
|
44 | - |
|
45 | - $xoopsMailer->setTemplate('sendlink.tpl'); |
|
46 | - $xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']); |
|
47 | - $xoopsMailer->assign('TO_NAME', $linkObj->getVar('to_name')); |
|
48 | - $xoopsMailer->assign('FROM_NAME', $linkObj->getVar('from_name')); |
|
49 | - $xoopsMailer->assign('SITEURL', XOOPS_URL."/"); |
|
50 | - $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); |
|
51 | - $xoopsMailer->assign('MESSAGE', $_POST['body']); |
|
52 | - $xoopsMailer->setToEmails($linkObj->getVar('to_email')); |
|
53 | - $xoopsMailer->setFromEmail($linkObj->getVar('from_email')); |
|
54 | - $xoopsMailer->setFromName($xoopsConfig['sitename']); |
|
55 | - $xoopsMailer->setSubject(sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $myts->oopsStripSlashesGPC($xoopsConfig['sitename']))); |
|
56 | - |
|
57 | - if (!$xoopsMailer->send(true)) { |
|
58 | - $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']) . '<br />' . $xoopsMailer->getErrors(true)); |
|
59 | - } else { |
|
60 | - $xoopsTpl->assign('send_success', _CO_SOBJECT_SEND_SUCCESS); |
|
61 | - } |
|
62 | - |
|
63 | - break; |
|
64 | - |
|
65 | - default : |
|
66 | - if (isset($_GET['mid'])) { |
|
67 | - $mid = $_GET['mid']; |
|
68 | - } else { |
|
69 | - /** |
|
70 | - * @todo close the window if no mid is passed as GET |
|
71 | - */ |
|
72 | - } |
|
73 | - |
|
74 | - $hModule = xoops_gethandler('module'); |
|
75 | - $module = $hModule->get($mid); |
|
76 | - $linkObj->setVar('mid', $module->getVar('mid')); |
|
77 | - $linkObj->setVar('mid_name', $module->getVar('name')); |
|
78 | - |
|
79 | - if (isset($_GET['link'])) { |
|
80 | - $link = $_GET['link']; |
|
81 | - } else { |
|
82 | - /** |
|
83 | - * @todo close the window if no link is passed as GET |
|
84 | - */ |
|
85 | - } |
|
86 | - $linkObj->setVar('link', $link); |
|
87 | - |
|
88 | - if (is_object($xoopsUser)) { |
|
89 | - $linkObj->setVar('from_uid', $xoopsUser->getVar('uid')); |
|
90 | - $linkObj->setVar('from_name', $xoopsUser->getVar('name') != '' ? $xoopsUser->getVar('name') : $xoopsUser->getVar('uname')); |
|
91 | - $linkObj->setVar('from_email', $xoopsUser->getVar('email')); |
|
92 | - } |
|
93 | - |
|
94 | - $linkObj->setVar('subject', sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $xoopsConfig['sitename'])); |
|
95 | - $linkObj->setVar('body', sprintf(_CO_SOBJECT_BODY_DEFAULT, $xoopsConfig['sitename'], $link)); |
|
96 | - $linkObj->setVar('date', time()); |
|
97 | - $linkObj->hideFieldFromForm(array('from_uid', 'to_uid', 'link', 'mid', 'mid_name')); |
|
98 | - |
|
99 | - $form = $linkObj->getForm(_CO_SOBJECT_SEND_LINK_FORM, 'sendlink', false, _SEND,'javascript:window.close();'); |
|
100 | - |
|
101 | - $form->assign($xoopsTpl); |
|
102 | - |
|
103 | - $xoopsTpl->assign('showform', true); |
|
104 | - break; |
|
29 | + case 'sendlink' : |
|
30 | + |
|
31 | + include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
32 | + $controller = new SmartObjectController($smartobject_link_handler); |
|
33 | + |
|
34 | + $linkObj = $controller->storeSmartObject(); |
|
35 | + if ($linkObj->hasError()) { |
|
36 | + /** |
|
37 | + * @todo inform user and propose to close the window if a problem occured when saving the link |
|
38 | + */ |
|
39 | + } |
|
40 | + |
|
41 | + $xoopsMailer =& getMailer(); |
|
42 | + $xoopsMailer->useMail(); |
|
43 | + $xoopsMailer->setTemplateDir('language/'.$xoopsConfig['language'].'/mail_template'); |
|
44 | + |
|
45 | + $xoopsMailer->setTemplate('sendlink.tpl'); |
|
46 | + $xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']); |
|
47 | + $xoopsMailer->assign('TO_NAME', $linkObj->getVar('to_name')); |
|
48 | + $xoopsMailer->assign('FROM_NAME', $linkObj->getVar('from_name')); |
|
49 | + $xoopsMailer->assign('SITEURL', XOOPS_URL."/"); |
|
50 | + $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); |
|
51 | + $xoopsMailer->assign('MESSAGE', $_POST['body']); |
|
52 | + $xoopsMailer->setToEmails($linkObj->getVar('to_email')); |
|
53 | + $xoopsMailer->setFromEmail($linkObj->getVar('from_email')); |
|
54 | + $xoopsMailer->setFromName($xoopsConfig['sitename']); |
|
55 | + $xoopsMailer->setSubject(sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $myts->oopsStripSlashesGPC($xoopsConfig['sitename']))); |
|
56 | + |
|
57 | + if (!$xoopsMailer->send(true)) { |
|
58 | + $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']) . '<br />' . $xoopsMailer->getErrors(true)); |
|
59 | + } else { |
|
60 | + $xoopsTpl->assign('send_success', _CO_SOBJECT_SEND_SUCCESS); |
|
61 | + } |
|
62 | + |
|
63 | + break; |
|
64 | + |
|
65 | + default : |
|
66 | + if (isset($_GET['mid'])) { |
|
67 | + $mid = $_GET['mid']; |
|
68 | + } else { |
|
69 | + /** |
|
70 | + * @todo close the window if no mid is passed as GET |
|
71 | + */ |
|
72 | + } |
|
73 | + |
|
74 | + $hModule = xoops_gethandler('module'); |
|
75 | + $module = $hModule->get($mid); |
|
76 | + $linkObj->setVar('mid', $module->getVar('mid')); |
|
77 | + $linkObj->setVar('mid_name', $module->getVar('name')); |
|
78 | + |
|
79 | + if (isset($_GET['link'])) { |
|
80 | + $link = $_GET['link']; |
|
81 | + } else { |
|
82 | + /** |
|
83 | + * @todo close the window if no link is passed as GET |
|
84 | + */ |
|
85 | + } |
|
86 | + $linkObj->setVar('link', $link); |
|
87 | + |
|
88 | + if (is_object($xoopsUser)) { |
|
89 | + $linkObj->setVar('from_uid', $xoopsUser->getVar('uid')); |
|
90 | + $linkObj->setVar('from_name', $xoopsUser->getVar('name') != '' ? $xoopsUser->getVar('name') : $xoopsUser->getVar('uname')); |
|
91 | + $linkObj->setVar('from_email', $xoopsUser->getVar('email')); |
|
92 | + } |
|
93 | + |
|
94 | + $linkObj->setVar('subject', sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $xoopsConfig['sitename'])); |
|
95 | + $linkObj->setVar('body', sprintf(_CO_SOBJECT_BODY_DEFAULT, $xoopsConfig['sitename'], $link)); |
|
96 | + $linkObj->setVar('date', time()); |
|
97 | + $linkObj->hideFieldFromForm(array('from_uid', 'to_uid', 'link', 'mid', 'mid_name')); |
|
98 | + |
|
99 | + $form = $linkObj->getForm(_CO_SOBJECT_SEND_LINK_FORM, 'sendlink', false, _SEND,'javascript:window.close();'); |
|
100 | + |
|
101 | + $form->assign($xoopsTpl); |
|
102 | + |
|
103 | + $xoopsTpl->assign('showform', true); |
|
104 | + break; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | if (!defined("XOOPS_ROOT_PATH")) { |
11 | - die("XOOPS root path not defined"); |
|
11 | + die("XOOPS root path not defined"); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | define('_MI_SOBJECT_INDEX', 'Index'); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * Licence: GNU |
8 | 8 | */ |
9 | 9 | if (!defined("XOOPS_ROOT_PATH")) { |
10 | - die("XOOPS root path not defined"); |
|
10 | + die("XOOPS root path not defined"); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | define('_SOBJECT_RATING_RATE', 'Rate it !'); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | if (!defined("XOOPS_ROOT_PATH")) { |
11 | - die("XOOPS root path not defined"); |
|
11 | + die("XOOPS root path not defined"); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * Licence: GNU |
8 | 8 | */ |
9 | 9 | if (!defined("XOOPS_ROOT_PATH")) { |
10 | - die("XOOPS root path not defined"); |
|
10 | + die("XOOPS root path not defined"); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | define('_AM_SOBJECT_ADSENSES', 'Adense ads'); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * Licence: GNU |
8 | 8 | */ |
9 | 9 | if (!defined("XOOPS_ROOT_PATH")) { |
10 | - die("XOOPS root path not defined"); |
|
10 | + die("XOOPS root path not defined"); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | define("_SDU_IMPORT", "Import"); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | if (!defined("XOOPS_ROOT_PATH")) { |
11 | - die("XOOPS root path not defined"); |
|
11 | + die("XOOPS root path not defined"); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | define('_CO_OBJ_ALL', "All"); // deprecated |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * Licence: GNU |
8 | 8 | */ |
9 | 9 | if (!defined("XOOPS_ROOT_PATH")) { |
10 | - die("XOOPS root path not defined"); |
|
10 | + die("XOOPS root path not defined"); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | define('_AM_SOBJECT_ABOUT', 'About'); |