[xoops-cvslog 1886] CVS update: xoops2jp/html/include

Back to archive index

Minahito minah****@users*****
2006年 1月 24日 (火) 20:05:30 JST


Index: xoops2jp/html/include/comment_reply.php
diff -u xoops2jp/html/include/comment_reply.php:1.2 xoops2jp/html/include/comment_reply.php:1.2.8.1
--- xoops2jp/html/include/comment_reply.php:1.2	Fri Mar 18 21:51:55 2005
+++ xoops2jp/html/include/comment_reply.php	Tue Jan 24 20:05:30 2006
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_reply.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+// $Id: comment_reply.php,v 1.2.8.1 2006/01/24 11:05:30 minahito Exp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -29,10 +29,26 @@
 // Project: The XOOPS Project (http://www.xoops.org/)                        //
 // ------------------------------------------------------------------------- //
 
+//
+// Guard directly access.
+//
 if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
 	exit();
 }
-include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
+require_once XOOPS_ROOT_PATH.'/header.php';
+
+require_once XOOPS_MODULE_PATH . "/base/forms/CommentEditForm.class.php";
+
+//
+// Load message resource
+//
+$root =& XCube_Root::getSingleton();
+
+$langManager =& $root->getLanguageManager();
+$langManager->loadModuleLanguage("base");
+
+require_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
+
 $com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0;
 $com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : '';
 if ($com_mode == '') {
@@ -69,8 +85,52 @@
 $com_icon = '';
 $com_rootid = $comment->getVar('com_rootid');
 $com_itemid = $comment->getVar('com_itemid');
-include XOOPS_ROOT_PATH.'/header.php';
+
+//
+// Get res-comment object by a comment loaded.
+//
+$res_comment =& $comment->createChild();
+
+//
+// Create action form instance and load from a comment object.
+//
+if (is_object($xoopsUser) && $xoopsUser->isAdmin()) {
+	$actionForm =& new Legacy_CommentEditForm_Admin();
+}
+else {
+	$actionForm =& new Legacy_CommentEditForm();
+}
+$actionForm->prepare();
+$actionForm->load($res_comment);
+
+//
+// Get the icons of subject.
+//
+$handler =& xoops_gethandler('subjecticon');
+$subjectIcons =& $handler->getObjects();
+
 themecenterposts($comment->getVar('com_title'), $r_text);
-include XOOPS_ROOT_PATH.'/include/comment_form.php';
-include XOOPS_ROOT_PATH.'/footer.php';
+
+//
+// Render comment-form to render buffer with using Legacy_RenderSystem.
+//
+$renderTarget =& new Legacy_RenderTargetMain();
+$renderTarget->setTemplateName("legacy_comment_edit.html");
+
+$renderTarget->setAttribute("actionForm", $actionForm);
+$renderTarget->setAttribute("subjectIcons", $subjectIcons);
+$renderTarget->setAttribute("xoopsModuleComment", $xoopsModuleConfig);
+
+//
+// Rendering
+//
+$renderer =& $root->getRenderSystem("Legacy_RenderSystem");
+$renderer->renderWithTarget($renderTarget);
+
+//
+// Display now.
+//
+print $renderTarget->getResult();
+
+require_once XOOPS_ROOT_PATH . "/footer.php";
 ?>
\ No newline at end of file


xoops-cvslog メーリングリストの案内
Back to archive index