Changeset 756:5127beea4a3a for admin
- Timestamp:
- 11/10/11 16:12:01 (14 years ago)
- Branch:
- formfilters
- Location:
- admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/comments.php
r523 r756 14 14 15 15 dcPage::check('usage,contentadmin'); 16 17 class authorFilter extends textFilter { 18 public function header() { 19 return 20 dcPage::jqueryUI(). 21 dcPage::jsLoad('js/author_filter.js') 22 ; 23 } 24 public function applyFilter($params) { 25 $val = preg_split("/[\s,]+/",$this->values[0]); 26 $params[$this->request_param]=$val; 27 } 28 } 29 16 30 17 31 # Creating filter combo boxes … … 54 68 $filterSet = new dcFilterSet('comments','comments.php'); 55 69 56 $authorFilter = new textFilter(57 'author',__('Author'), __('Author'),' q_author',20,255);70 $authorFilter = new authorFilter( 71 'author',__('Author'), __('Author'),'comment_author',20,255); 58 72 $filterSet 59 73 ->addFilter(new comboFilter( … … 67 81 $core->callBehavior('adminCommentsFilters',$filterSet); 68 82 69 $filterSet->set FormValues($_GET);83 $filterSet->setup($_GET,$_POST); 70 84 if (isset($_GET['author'])) { 71 85 $authorFilter->add(); … … 91 105 $core->error->add($e->getMessage()); 92 106 } 93 $filterSet->set ColumnsForm($comment_list->getColumnsForm());107 $filterSet->setExtraData($comment_list->getColumnsForm()); 94 108 95 109 /* DISPLAY 96 110 -------------------------------------------------------- */ 97 $starting_script = dcPage::jsLoad('js/_comments.js').$filterSet->header(); ;111 $starting_script = dcPage::jsLoad('js/_comments.js').$filterSet->header(); 98 112 99 113 # --BEHAVIOR-- adminCommentsHeaders -
admin/posts.php
r755 r756 138 138 ->addFilter(new comboFilter( 139 139 'users',__('Author'), __('Author'), 'user_id', $users_combo)) 140 ->addFilter(new c omboFilter(140 ->addFilter(new categoryFilter( 141 141 'category',__('Category'), __('Category'), 'cat_id', $categories_combo)) 142 142 ->addFilter(new comboFilter( … … 147 147 'lang',__('Lang'), __('Lang'), 'post_lang', $lang_combo)) 148 148 ->addFilter(new monthComboFilter( 149 'month',__('Month'),__('Month'), 'post_month', $dt_m_combo,array('singleval' => 1))); 149 'month',__('Month'),__('Month'), 'post_month', $dt_m_combo,array('singleval' => 1))) 150 ->addFilter(new textFilter( 151 'search',__('Contains'),__('The entry contains'), 'search',20,255)); 150 152 151 153 $core->callBehavior('adminPostsFilters',$filterSet); … … 165 167 } else { 166 168 $page_title = __('Entries'); 169 $filters_info = ''; 167 170 } 168 171 $post_list->setItems($posts,$counter->f(0)); -
admin/services.php
r0 r756 25 25 $core->rest->addFunction('delMeta',array('dcRestMethods','delMeta')); 26 26 $core->rest->addFunction('setPostMeta',array('dcRestMethods','setPostMeta')); 27 $core->rest->addFunction('searchCommentAuthor',array('dcRestMethods','searchCommentAuthor')); 27 28 $core->rest->addFunction('searchMeta',array('dcRestMethods','searchMeta')); 28 29 … … 393 394 return $rsp; 394 395 } 396 397 public static function searchCommentAuthor($core,$get) 398 { 399 $q = !empty($get['q']) ? strtoupper($get['q']) : null; 400 401 $strReq = 'SELECT DISTINCT C.comment_author '. 402 'FROM '.$core->prefix.'comment C '. 403 'INNER JOIN '.$core->prefix.'post P on C.post_id = P.post_id '. 404 'WHERE P.blog_id = \''.$core->blog->id.'\' '. 405 'AND UPPER(comment_author) like \'%'.$core->con->escape($q).'%\'' 406 ; 407 //echo $strReq; 408 $rs = $core->con->select($strReq); 409 $rsp = new xmlTag(); 410 411 while ($rs->fetch()) 412 { 413 $author = new xmlTag('author'); 414 $author->name=$rs->comment_author; 415 $rsp->insertNode($author); 416 } 417 418 return $rsp; 419 } 420 395 421 } 396 422 ?>
Note: See TracChangeset
for help on using the changeset viewer.