17if (!defined(
'XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
21require_once XOOPS_MODULE_PATH .
'/legacy/forms/CommentEditForm.class.php';
26$t_root =& XCube_Root::getSingleton();
28$t_root->mLanguageManager->loadModuleMessageCatalog(
'legacy');
30require_once XOOPS_ROOT_PATH.
'/include/comment_constants.php';
32if (
'system' != $xoopsModule->getVar(
'dirname') && XOOPS_COMMENT_APPROVENONE == $xoopsModuleConfig[
'com_rule'])
37$t_root->mLanguageManager->loadPageTypeMessageCatalog(
'comment');
39$com_itemid = isset($_GET[
'com_itemid']) ? (int)$_GET[
'com_itemid'] : 0;
43 include XOOPS_ROOT_PATH.
'/header.php';
45 if (isset($com_replytitle))
47 if (isset($com_replytext)) {
48 themecenterposts($com_replytitle, $com_replytext);
51 $com_title = $myts->htmlSpecialChars($com_replytitle);
52 if (!preg_match(
'/^re:/i', $com_title)) {
53 $com_title =
'Re: ' . xoops_substr($com_title, 0, 56);
59 $com_mode = isset($_GET[
'com_mode']) ? htmlspecialchars(trim($_GET[
'com_mode']), ENT_QUOTES) :
'';
63 if (is_object($xoopsUser)) {
64 $com_mode = $xoopsUser->getVar(
'umode');
66 $com_mode = $xoopsConfig[
'com_mode'];
70 if (!isset($_GET[
'com_order']))
72 if (is_object($xoopsUser)) {
73 $com_order = $xoopsUser->getVar(
'uorder');
75 $com_order = $xoopsConfig[
'com_order'];
78 $com_order = (int)$_GET[
'com_order'];
83 $handler =& xoops_gethandler(
'comment');
84 $comment =& $handler->create();
89 $comment->set(
'com_itemid', $com_itemid);
90 $comment->set(
'com_modid', $xoopsModule->get(
'mid'));
91 $comment->set(
'com_title', $com_title);
93 if (is_object($xoopsUser)) {
94 $comment->set(
'uid', $xoopsUser->get(
'uid'));
96 $comment->set(
'uid', 0);
102 if (is_object($xoopsUser) && $xoopsUser->isAdmin())
109 $actionForm->prepare();
110 $actionForm->load($comment);
115 $handler =& xoops_gethandler(
'subjecticon');
116 $subjectIcons =& $handler->getObjects();
121 $renderSystem =& $t_root->getRenderSystem($t_root->mContext->mBaseRenderSystemName);
122 $renderTarget =& $renderSystem->createRenderTarget(
'main');
124 $renderTarget->setTemplateName(
'legacy_comment_edit.html');
126 $renderTarget->setAttribute(
'actionForm', $actionForm);
127 $renderTarget->setAttribute(
'subjectIcons', $subjectIcons);
128 $renderTarget->setAttribute(
'xoopsModuleConfig', $xoopsModuleConfig);
129 $renderTarget->setAttribute(
'com_order', $com_order);
132 if (
'system' !== $xoopsModule->get(
'dirname'))
134 $comment_config = $xoopsModule->getInfo(
'comments');
135 if (isset($comment_config[
'extraParams']) && is_array($comment_config[
'extraParams'])) {
136 foreach ($comment_config[
'extraParams'] as $extra_param) {
137 $extraParams[$extra_param] = xoops_getrequest($extra_param);
142 $renderTarget->setAttribute(
'extraParams', $extraParams);
147 $renderSystem->render($renderTarget);
152 print $renderTarget->getResult();
154 require_once XOOPS_ROOT_PATH .
'/footer.php';