Doc = &$Doc;
$this->DBObj = SiteMap::getObj('Member/CustomizeRss/CustomizeRss.php', $_REQUEST['id']);
$this->DBObj->memberData = $this->Doc->MemberAuth->getData();
parent::exec();
}
function setFormTitle()
{
return false;
}
function _bindFormFields($form)
{
$form = parent::_bindFormFields($form);
$form->removeElement('is_default');
return $form;
}
function _getReorderForm()
{
$form=$this->_getBaseForm();
$list=array();
$list4Grid = $this->DBObj->getList4Individual($this->DBObj->memberData['id']);
foreach ($list4Grid as $val) {
$list[$val['id']] = (strlen($val[$this->fldReorderTitle])>$this->reorderTitleSize)?substr($val[$this->fldReorderTitle], 0, $this->reorderTitleSize-3).'...':$val[$this->fldReorderTitle];
}
$orderList = Form::createElement('select_edit', 'order_list', false, $list);
$orderList->updateAttributes(array('size' => $this->reorderListSize));
$orderList->delAction('add');
$orderList->delAction('del');
$orderList->delAction('edit');
$form->addElement($orderList);
$form->addElement('hidden', 'id_parent', $this->DBObj->id_parent);
return $form;
}
function _doListBind(&$DB_List, $common = false)
{
$DB_List->insertColLast('sorter', array(
'title'=>'#',
'order_by'=>'individual_sorter',
'width'=>30,
'tpl'=>DB_LIST_CELL_TEXT,
'params'=>array('individual_sorter'),
));
$DB_List->insertColLast('title', array(
'title'=>'Title',
'order_by'=>'title',
'width'=>180,
'tpl'=>DB_LIST_CELL_TEXT,
'params'=>array('title'),
));
$DB_List->insertColLast('url', array(
'title'=>'URL',
'order_by'=>'url',
'width'=>300,
'attr'=>'target="_blank"',
'tpl'=>DB_LIST_CELL_LINK,
'params'=>array('url','url'),
));
$DB_List->insertColLast('active', array(
'title'=>'Active',
'order_by'=>'individual_active',
'width'=>70,
'values'=> array('y'=>'Yes', 'n'=>'No'),
'tpl' => DB_LIST_CELL_LINK_ENUM,
'url' => BASE_URL.'/'.CURR_PAGE.'/?action=chopt&opt=active&id=',
'params'=> array('individual_active', 'id')
));
if (!$common) {
$DB_List->insertColLast('options', array(
'title'=>'Options',
'tpl'=>'Member/CustomizeRss/List/cells/options.tpl',
'edit_link'=>BASE_URL.'/'.CURR_PAGE.'?action=edit&id=',
'del_link'=>BASE_URL.'/'.CURR_PAGE.'?action=del&id=',
'params'=>array('id'),
));
}
if ($common) {
foreach ($DB_List->_column as &$column) {
unset($column['order_by']);
}
}
$DB_List->bind();
return true;
}
function doDelete()
{
$data = $this->DBObj->getRssById($this->DBObj->id);
if ($data['id_individual'] != $this->DBObj->memberData['id']) {
Session::setData($this->_getPage4SaveMessage(), 'msg', ' You cannot delete this feed');
$this->doBack();
return;
}
Session::setData($this->_getPage4SaveMessage(), 'msg', $this->DBObj->itemName.' deleted');
$this->DBObj->delete();
$this->doBack();
return true;
}
function addLinkNew()
{
$link = BASE_URL . '/' . CURR_PAGE;
$addLink = array(
'tpl' => 'center_link.tpl',
'link_list' => array(
array('title' => 'Click here to add a new RSS feed', 'link' => $link . '?action=new'),
),
);
$this->Doc->addContent($addLink);
}
function addLinkReorder()
{
$link = BASE_URL . '/' . CURR_PAGE;
$addLink = array(
'tpl' => 'center_link.tpl',
'link_list' => array(
array('title' => 'Click here to reorder RSS feeds', 'link' => $link . '?action=reorder'),
),
);
$this->Doc->addContent($addLink);
}
function doList()
{
$this->_saveBackUrl();
$this->addLinkReorder();
$this->Doc->addContent(array('tpl'=>'text.tpl', 'text'=>'