@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | PlanetUtility::planetParseFunction(' |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | PlanetUtility::planetParseFunction(' |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | |
31 | 31 | $art_id = Request::getInt('article', Request::getInt('article', 0, 'POST'), 'GET');//(int)(isset($_GET['article']) ? $_GET['article'] : (isset($_POST['article']) ? $_POST['article'] : 0)); |
32 | 32 | if (empty($art_id)) { |
33 | - redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
|
33 | + redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
|
34 | 34 | } |
35 | 35 | if (!$xoopsUser->isAdmin()) { |
36 | - redirect_header('javascript:history.go(-1);', 2, _NOPERM); |
|
36 | + redirect_header('javascript:history.go(-1);', 2, _NOPERM); |
|
37 | 37 | } |
38 | 38 | include XOOPS_ROOT_PATH . '/header.php'; |
39 | 39 | include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
@@ -44,58 +44,58 @@ discard block |
||
44 | 44 | $op = Request::getCmd('op', 'check', 'POST');//isset($_POST['op']) ? $_POST['op'] : ''; |
45 | 45 | |
46 | 46 | if ('del' === $op || !empty(Request::getString('del', '', 'POST'))) { |
47 | - $articleHandler->delete($article_obj); |
|
48 | - $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
49 | - $message = planet_constant('MD_SAVED'); |
|
50 | - redirect_header($redirect, 2, $message); |
|
47 | + $articleHandler->delete($article_obj); |
|
48 | + $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
49 | + $message = planet_constant('MD_SAVED'); |
|
50 | + redirect_header($redirect, 2, $message); |
|
51 | 51 | } elseif ('save' === $op) { |
52 | - if (empty($_POST['art_content'])) { |
|
53 | - redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_TEXTEMPTY')); |
|
54 | - } |
|
52 | + if (empty($_POST['art_content'])) { |
|
53 | + redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_TEXTEMPTY')); |
|
54 | + } |
|
55 | 55 | |
56 | - foreach ([ |
|
57 | - 'art_title', |
|
58 | - 'art_link', |
|
59 | - 'art_author', |
|
60 | - 'art_content' |
|
61 | - ] as $tag) { |
|
62 | - if (@Request::getString('tag', '', 'POST') != $article_obj->getVar($tag)) { |
|
63 | - $article_obj->setVar($tag, @Request::getString('tag', '', 'POST')); |
|
64 | - } |
|
65 | - } |
|
56 | + foreach ([ |
|
57 | + 'art_title', |
|
58 | + 'art_link', |
|
59 | + 'art_author', |
|
60 | + 'art_content' |
|
61 | + ] as $tag) { |
|
62 | + if (@Request::getString('tag', '', 'POST') != $article_obj->getVar($tag)) { |
|
63 | + $article_obj->setVar($tag, @Request::getString('tag', '', 'POST')); |
|
64 | + } |
|
65 | + } |
|
66 | 66 | |
67 | - $art_id_new = $articleHandler->insert($article_obj); |
|
68 | - if (!$article_obj->getVar('art_id')) { |
|
69 | - $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
70 | - $message = planet_constant('MD_INSERTERROR'); |
|
71 | - } else { |
|
72 | - $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_obj->getVar('art_id'); |
|
73 | - $message = planet_constant('MD_SAVED'); |
|
74 | - } |
|
75 | - redirect_header($redirect, 2, $message); |
|
67 | + $art_id_new = $articleHandler->insert($article_obj); |
|
68 | + if (!$article_obj->getVar('art_id')) { |
|
69 | + $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
70 | + $message = planet_constant('MD_INSERTERROR'); |
|
71 | + } else { |
|
72 | + $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_obj->getVar('art_id'); |
|
73 | + $message = planet_constant('MD_SAVED'); |
|
74 | + } |
|
75 | + redirect_header($redirect, 2, $message); |
|
76 | 76 | } else { |
77 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
77 | + require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
78 | 78 | |
79 | - $form = new XoopsThemeForm(_EDIT, 'formarticle', xoops_getenv('PHP_SELF'), 'post', true); |
|
79 | + $form = new XoopsThemeForm(_EDIT, 'formarticle', xoops_getenv('PHP_SELF'), 'post', true); |
|
80 | 80 | |
81 | - $form->addElement(new XoopsFormText(planet_constant('MD_TITLE'), 'art_title', 50, 255, $article_obj->getVar('art_title', 'E')), true); |
|
82 | - $form->addElement(new XoopsFormText(planet_constant('MD_LINK'), 'art_link', 50, 255, $article_obj->getVar('art_link', 'E')), true); |
|
83 | - $form->addElement(new XoopsFormText(planet_constant('MD_AUTHOR'), 'art_author', 80, 255, $article_obj->getVar('art_author', 'E'))); |
|
84 | - $form->addElement(new XoopsFormTextArea(planet_constant('MD_CONTENT'), 'art_content', $article_obj->getVar('art_content', 'E')), true); |
|
81 | + $form->addElement(new XoopsFormText(planet_constant('MD_TITLE'), 'art_title', 50, 255, $article_obj->getVar('art_title', 'E')), true); |
|
82 | + $form->addElement(new XoopsFormText(planet_constant('MD_LINK'), 'art_link', 50, 255, $article_obj->getVar('art_link', 'E')), true); |
|
83 | + $form->addElement(new XoopsFormText(planet_constant('MD_AUTHOR'), 'art_author', 80, 255, $article_obj->getVar('art_author', 'E'))); |
|
84 | + $form->addElement(new XoopsFormTextArea(planet_constant('MD_CONTENT'), 'art_content', $article_obj->getVar('art_content', 'E')), true); |
|
85 | 85 | |
86 | - $form->addElement(new XoopsFormHidden('article', $art_id)); |
|
87 | - $form->addElement(new XoopsFormHidden('op', 'save')); |
|
86 | + $form->addElement(new XoopsFormHidden('article', $art_id)); |
|
87 | + $form->addElement(new XoopsFormHidden('op', 'save')); |
|
88 | 88 | |
89 | - $button_tray = new XoopsFormElementTray('', ''); |
|
90 | - $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
|
91 | - $button_tray->addElement($butt_save); |
|
92 | - $butt_del = new XoopsFormButton('', 'del', _DELETE, 'submit'); |
|
93 | - $butt_del->setExtra("onClick='document.forms.formarticle.op.value=del'"); |
|
94 | - $button_tray->addElement($butt_del); |
|
95 | - $butt_cancel = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
|
96 | - $butt_cancel->setExtra("onclick='window.document.location=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . (int)$art_id . "\"'"); |
|
97 | - $button_tray->addElement($butt_cancel); |
|
98 | - $form->addElement($button_tray); |
|
99 | - $form->display(); |
|
89 | + $button_tray = new XoopsFormElementTray('', ''); |
|
90 | + $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
|
91 | + $button_tray->addElement($butt_save); |
|
92 | + $butt_del = new XoopsFormButton('', 'del', _DELETE, 'submit'); |
|
93 | + $butt_del->setExtra("onClick='document.forms.formarticle.op.value=del'"); |
|
94 | + $button_tray->addElement($butt_del); |
|
95 | + $butt_cancel = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
|
96 | + $butt_cancel->setExtra("onclick='window.document.location=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . (int)$art_id . "\"'"); |
|
97 | + $button_tray->addElement($butt_cancel); |
|
98 | + $form->addElement($button_tray); |
|
99 | + $form->display(); |
|
100 | 100 | } |
101 | 101 | include XOOPS_ROOT_PATH . '/footer.php'; |
@@ -26,26 +26,26 @@ discard block |
||
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | use Xmf\Request; |
28 | 28 | |
29 | -include __DIR__ . '/header.php'; |
|
29 | +include __DIR__.'/header.php'; |
|
30 | 30 | |
31 | -$art_id = Request::getInt('article', Request::getInt('article', 0, 'POST'), 'GET');//(int)(isset($_GET['article']) ? $_GET['article'] : (isset($_POST['article']) ? $_POST['article'] : 0)); |
|
31 | +$art_id = Request::getInt('article', Request::getInt('article', 0, 'POST'), 'GET'); //(int)(isset($_GET['article']) ? $_GET['article'] : (isset($_POST['article']) ? $_POST['article'] : 0)); |
|
32 | 32 | if (empty($art_id)) { |
33 | 33 | redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
34 | 34 | } |
35 | 35 | if (!$xoopsUser->isAdmin()) { |
36 | 36 | redirect_header('javascript:history.go(-1);', 2, _NOPERM); |
37 | 37 | } |
38 | -include XOOPS_ROOT_PATH . '/header.php'; |
|
39 | -include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
38 | +include XOOPS_ROOT_PATH.'/header.php'; |
|
39 | +include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
40 | 40 | |
41 | 41 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
42 | 42 | $article_obj = $articleHandler->get($art_id); |
43 | 43 | |
44 | -$op = Request::getCmd('op', 'check', 'POST');//isset($_POST['op']) ? $_POST['op'] : ''; |
|
44 | +$op = Request::getCmd('op', 'check', 'POST'); //isset($_POST['op']) ? $_POST['op'] : ''; |
|
45 | 45 | |
46 | 46 | if ('del' === $op || !empty(Request::getString('del', '', 'POST'))) { |
47 | 47 | $articleHandler->delete($article_obj); |
48 | - $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
48 | + $redirect = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'; |
|
49 | 49 | $message = planet_constant('MD_SAVED'); |
50 | 50 | redirect_header($redirect, 2, $message); |
51 | 51 | } elseif ('save' === $op) { |
@@ -66,15 +66,15 @@ discard block |
||
66 | 66 | |
67 | 67 | $art_id_new = $articleHandler->insert($article_obj); |
68 | 68 | if (!$article_obj->getVar('art_id')) { |
69 | - $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
69 | + $redirect = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'; |
|
70 | 70 | $message = planet_constant('MD_INSERTERROR'); |
71 | - } else { |
|
72 | - $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_obj->getVar('art_id'); |
|
71 | + }else { |
|
72 | + $redirect = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$article_obj->getVar('art_id'); |
|
73 | 73 | $message = planet_constant('MD_SAVED'); |
74 | 74 | } |
75 | 75 | redirect_header($redirect, 2, $message); |
76 | -} else { |
|
77 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
76 | +}else { |
|
77 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
78 | 78 | |
79 | 79 | $form = new XoopsThemeForm(_EDIT, 'formarticle', xoops_getenv('PHP_SELF'), 'post', true); |
80 | 80 | |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | $butt_del->setExtra("onClick='document.forms.formarticle.op.value=del'"); |
94 | 94 | $button_tray->addElement($butt_del); |
95 | 95 | $butt_cancel = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
96 | - $butt_cancel->setExtra("onclick='window.document.location=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . (int)$art_id . "\"'"); |
|
96 | + $butt_cancel->setExtra("onclick='window.document.location=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.(int) $art_id."\"'"); |
|
97 | 97 | $button_tray->addElement($butt_cancel); |
98 | 98 | $form->addElement($button_tray); |
99 | 99 | $form->display(); |
100 | 100 | } |
101 | -include XOOPS_ROOT_PATH . '/footer.php'; |
|
101 | +include XOOPS_ROOT_PATH.'/footer.php'; |