'doList', 'view' => 'doView', ); function RssFeedBlockView($opt) { //$this->opt = $opt; } function initAction() { if (intval(@$_REQUEST['id'])) { $this->action = 'view'; } if (empty($this->action)) { if (isset($_REQUEST['action']) && !empty($_REQUEST['action'])) { $this->action= $_REQUEST['action']; } else { $this->action = $this->defaultAction; } } if (key_exists($this->action, $this->actions)){ $this->actionMethod = $this->actions[$this->action]; } else { $this->action = key($this->actions); $this->actionMethod = current($this->actions); } if ($this->isXmlHttpRequest()) { $this->actionMethod .= 'Ajax'; } } function exec(&$Doc) { $this->Doc = &$Doc; /* if ($this->Doc->MemberAuth->getData('id')) { $this->DBObj = SiteMap::getObj('Member/CustomizeRss/CustomizeRss.php', @$_REQUEST['id']); } else { $this->DBObj = SiteMap::getObj('RssFeed/RssFeed.php', @$_REQUEST['id']); } */ $this->DBObj = SiteMap::getObj('RssFeed/RssFeed.php', @$_REQUEST['id']); $this->DBObj->memberData = $this->Doc->MemberAuth->getData(); $this->initAction(); if (method_exists($this, $this->actionMethod)) { $function = $this->actionMethod; $this->$function(); } else { exit; } } public function doList() { if ((int)$this->DBObj->memberData['id']) { $item['list'] = $this->DBObj->getList4Individual((int)$this->DBObj->memberData['id']); } if (empty($item['list'])) { $item = $this->DBObj->getList4Grid(array('addonWhere'=>" AND Rss.active = 'y' ", 'order_by'=>'Rss.sorter')); } $item['tpl'] = 'Doc/rss_block.tpl'; $this->Doc->addItem($item); return $this; } function doView() { $this->doViewAjax(); } function doViewAjax() { $item = $this->DBObj->getFeedData(); $this->Doc->assign('item', $item); $this->Doc->setMainTpl('Rss/view.tpl'); Constant::set('DEBUG', false); echo $this->Doc->fetch(); exit; } }