HomeAction::tag PHP Method

tag() public method

public tag ( )
    public function tag()
    {
        //列表key值 DOACTION表示操作
        $this->pageKeyList = array('tag_id', 'table', 'name', 'DOACTION');
        //搜索key值
        $this->searchKey = array('name', 'table');
        $this->opt['table'] = model('Tag')->getTableHash();
        //列表分页栏 按钮
        $this->pageButton[] = array('title' => L('PUBLIC_SEARCH_INDEX'), 'onclick' => "admin.fold('search_form')");
        /*数据的格式化 与listKey保持一致 */
        $map = array();
        !empty($_POST['name']) && ($map['b.name'] = array('like', '%' . t($_POST['name']) . '%'));
        !empty($_POST['table']) && ($map['_string'] = "`table` = '" . t($_POST['table']) . "'");
        $listData = model('Tag')->getAppTagList($map);
        foreach ($listData['data'] as &$v) {
            $v['DOACTION'] = '<a href="javascript:;" onclick="admin.delTag(this,' . $v['tag_id'] . ',\'' . $v['table'] . '\',' . $v['row_id'] . ')">' . L('PUBLIC_STREAM_DELETE') . '</a>';
        }
        $this->allSelected = false;
        $this->displayList($listData);
    }