Minahito
minah****@users*****
2006年 7月 31日 (月) 19:04:53 JST
Index: xoops2jp/html/modules/base/actions/BackendAction.class.php diff -u xoops2jp/html/modules/base/actions/BackendAction.class.php:1.1.2.4 xoops2jp/html/modules/base/actions/BackendAction.class.php:1.1.2.5 --- xoops2jp/html/modules/base/actions/BackendAction.class.php:1.1.2.4 Sat May 27 23:07:40 2006 +++ xoops2jp/html/modules/base/actions/BackendAction.class.php Mon Jul 31 19:04:53 2006 @@ -6,22 +6,6 @@ { var $mItems = array(); - function getDefaultView(&$controll, &$xoopsUser) - { - $items= $this->_getRSSInformation(); - - $sortArr = array(); - foreach ($items as $item) { - $i = intval($item['pubdate']); - for (; isset($sortArr[$i]) ; $i++); - - $sortArr[$i] = $item; - } - krsort($sortArr); - $this->mItems = $sortArr; - return LEGACY_FRAME_VIEW_INDEX; - } - /** * The spec of getRSS(): * append your RSS item to $eventArgs array. You don't need to sanitize your values. Use raw value. @@ -33,14 +17,34 @@ * $item['description'] ... not required. * $item['category'] ... not required. * $item['author'] ... not required. - */ - function _getRSSInformation() + * + * @var XCube_NewDelegate + */ + var $mGetRSSItems = null; + + function Legacy_BackendAction($flag) { - $root =& XCube_Root::getSingleton(); - $eventArgs = array(); - $root->mEventManager->raiseEvent("Module.Legacy.Backend.getRSS", $this, $eventArgs); + parent::Legacy_Action($flag); - return $eventArgs; + $this->mGetRSSItems =& new XCube_NewDelegate(); + $this->mGetRSSItems->register('Legacy_BackendAction.GetRSSItems'); + } + + function getDefaultView(&$controll, &$xoopsUser) + { + $items = array(); + $this->mGetRSSItems->call(new XCube_Ref($items)); + + $sortArr = array(); + foreach ($items as $item) { + $i = intval($item['pubdate']); + for (; isset($sortArr[$i]) ; $i++); + + $sortArr[$i] = $item; + } + krsort($sortArr); + $this->mItems = $sortArr; + return LEGACY_FRAME_VIEW_INDEX; } function executeViewIndex(&$controller, &$xoopsUser, &$render)