Minahito
minah****@users*****
2006年 1月 24日 (火) 23:03:56 JST
Index: xoops2jp/html/include/functions.php diff -u xoops2jp/html/include/functions.php:1.2.8.7 xoops2jp/html/include/functions.php:1.2.8.8 --- xoops2jp/html/include/functions.php:1.2.8.7 Sun Jan 22 17:37:17 2006 +++ xoops2jp/html/include/functions.php Tue Jan 24 23:03:56 2006 @@ -1,5 +1,5 @@ <?php -// $Id: functions.php,v 1.2.8.7 2006/01/22 08:37:17 nobunobu Exp $ +// $Id: functions.php,v 1.2.8.8 2006/01/24 14:03:56 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -60,40 +60,65 @@ $renderSystem->showXoopsFooter(); } -function xoops_error($msg, $title='') +function xoops_error($message, $title='') { - require_once XOOPS_ROOT_PATH."/class/XCube_MessageBox.class.php"; - $messageBox=new XCube_MessageBox($title,$msg,XCUBE_MESSAGEBOX_ERROR); - $messageBox->show(); + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setTemplateName("legacy_xoops_error.html"); + $renderTarget->setAttribute("title", $title); + $renderTarget->setAttribute("message", $message); + + $renderer =& $root->getRenderSystem('Legacy_RenderSystem'); + $renderer->renderWithTarget($renderTarget); + + print $renderTarget->getResult(); } function xoops_result($msg, $title='') { - require_once XOOPS_ROOT_PATH."/class/XCube_MessageBox.class.php"; - $messageBox=new XCube_MessageBox($title,$msg,XCUBE_MESSAGEBOX_RESULT); - $messageBox->show(); + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setTemplateName("legacy_xoops_result.html"); + $renderTarget->setAttribute("title", $title); + $renderTarget->setAttribute("message", $message); + + $renderer =& $root->getRenderSystem('Legacy_RenderSystem'); + $renderer->renderWithTarget($renderTarget); + + print $renderTarget->getResult(); } -function xoops_confirm($hiddens, $action, $msg, $submit = '', $addToken = true) +function xoops_confirm($hiddens, $action, $message, $submit = '', $addToken = true) { - require_once XOOPS_ROOT_PATH."/class/XCube_MessageBox.class.php"; - - $confirmBox = ($addToken==true) ? new XCube_TokenConfirmBox($msg) - : new XCube_ConfirmBox($msg); - // - // Set $hiddens to attributes. But, never overwrite. + // Create token. // - foreach($hiddens as $key=>$value) - $confirmBox->setAttribute($key,$value); + $tokenHandler =& new XoopsMultiTokenHandler(); + $token =& $tokenHandler->create(XOOPS_TOKEN_DEFAULT); // - // Set other parameter and show. + // Register to session. And, set it to own property. // - $confirmBox->setSubmitText($submit); - $confirmBox->setAction($action); + $tokenHandler->register($token); + + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setTemplateName("legacy_xoops_confirm.html"); + + $renderTarget->setAttribute("action", $action); + $renderTarget->setAttribute("message", $message); + $renderTarget->setAttribute("hiddens", $hiddens); + $renderTarget->setAttribute("submit", $submit); + $renderTarget->setAttribute("tokenName", $token->getTokenName()); + $renderTarget->setAttribute("tokenValue", $token->getTokenValue()); - $confirmBox->show(); + $renderer =& $root->getRenderSystem('Legacy_RenderSystem'); + $renderer->renderWithTarget($renderTarget); + + print $renderTarget->getResult(); } /**