Minahito
minah****@users*****
2006年 1月 24日 (火) 20:05:20 JST
Index: xoops2jp/html/include/comment_new.php diff -u xoops2jp/html/include/comment_new.php:1.2 xoops2jp/html/include/comment_new.php:1.2.8.1 --- xoops2jp/html/include/comment_new.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/include/comment_new.php Tue Jan 24 20:05:20 2006 @@ -1,5 +1,5 @@ <?php -// $Id: comment_new.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: comment_new.php,v 1.2.8.1 2006/01/24 11:05:20 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -29,11 +29,25 @@ // 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.'/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"); + + +require_once XOOPS_ROOT_PATH.'/include/comment_constants.php'; if ('system' != $xoopsModule->getVar('dirname') && XOOPS_COMMENT_APPROVENONE == $xoopsModuleConfig['com_rule']) { exit(); } @@ -73,18 +87,57 @@ } else { $com_order = intval($_GET['com_order']); } - $com_id = 0; $noname = 0; - $dosmiley = 1; - $dohtml = 0; - $dobr = 1; - $doxcode = 1; - $com_icon = ''; - $com_pid = 0; - $com_rootid = 0; - $com_text = ''; - include XOOPS_ROOT_PATH.'/include/comment_form.php'; - include XOOPS_ROOT_PATH.'/footer.php'; +$handler =& xoops_gethandler('comment'); +$comment =& $handler->create(); + +// +// Initialize manually. +// +$comment->set("com_itemid", $com_itemid); +$comment->set("com_modid", $xoopsModule->get('mid')); +$comment->set("com_title", $com_title); + +// +// 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($comment); + +// +// Get the icons of subject. +// +$handler =& xoops_gethandler('subjecticon'); +$subjectIcons =& $handler->getObjects(); + +// +// 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