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

Back to archive index

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


Index: xoops2jp/html/include/comment_edit.php
diff -u xoops2jp/html/include/comment_edit.php:1.2 xoops2jp/html/include/comment_edit.php:1.2.8.1
--- xoops2jp/html/include/comment_edit.php:1.2	Fri Mar 18 21:51:55 2005
+++ xoops2jp/html/include/comment_edit.php	Tue Jan 24 23:20:39 2006
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_edit.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+// $Id: comment_edit.php,v 1.2.8.1 2006/01/24 14:20:39 minahito Exp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -29,9 +29,24 @@
 // Project: The XOOPS Project (http://www.xoops.org/)                        //
 // ------------------------------------------------------------------------- //
 
+//
+// Guard directly access.
+//
 if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
 	exit();
 }
+require_once XOOPS_ROOT_PATH . '/header.php';
+require_once XOOPS_ROOT_PATH . "/include/comment_constants.php";
+
+require_once XOOPS_MODULE_PATH . "/base/forms/CommentEditForm.class.php";
+
+//
+// Load message resource
+//
+$root =& XCube_Root::getSingleton();
+
+$langManager =& $root->getLanguageManager();
+$langManager->loadModuleLanguage("base");
 
 if ('system' != $xoopsModule->getVar('dirname') && XOOPS_COMMENT_APPROVENONE == $xoopsModuleConfig['com_rule']) {
 	exit();
@@ -69,13 +84,51 @@
 $com_pid = $comment->getVar('com_pid');
 $com_status = $comment->getVar('com_status');
 $com_rootid = $comment->getVar('com_rootid');
+
+//
+// Get the icons of subject.
+//
+$handler =& xoops_gethandler('subjecticon');
+$subjectIcons =& $handler->getObjects();
+
 if ($xoopsModule->getVar('dirname') != 'system') {
-	include XOOPS_ROOT_PATH.'/header.php';
-	include XOOPS_ROOT_PATH.'/include/comment_form.php';
-	include XOOPS_ROOT_PATH.'/footer.php';
+	if (is_object($xoopsUser) && $xoopsUser->isAdmin()) {
+		$actionForm =& new Legacy_CommentEditForm_Admin();
+	}
+	else {
+		$actionForm =& new Legacy_CommentEditForm();
+	}
+	$actionForm->prepare();
+	$actionForm->load($comment);
+
+	//
+	// 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';
 } else {
+	//
+	// TODO
+	//
 	xoops_cp_header();
-	include XOOPS_ROOT_PATH.'/include/comment_form.php';
+	require_once XOOPS_ROOT_PATH.'/include/comment_form.php';
 	xoops_cp_footer();
 }
 ?>
\ No newline at end of file


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