Dotclear

Changeset 756:5127beea4a3a for admin


Ignore:
Timestamp:
11/10/11 16:12:01 (14 years ago)
Author:
Dsls <dsls@…>
Branch:
formfilters
Message:
  • Adapted comments.php do new filters
  • added author filter, with autocompletion
  • added comment_author parameter to dcBlog::getComments
  • removed jquery.autocomplete
  • added jquery UI (should be refined, this is quite raw...)
  • added dcPager::jqueryUI
  • adapted tags plugin to new jquery ui autocomplete
Location:
admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • admin/comments.php

    r523 r756  
    1414 
    1515dcPage::check('usage,contentadmin'); 
     16 
     17class 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 
    1630 
    1731# Creating filter combo boxes 
     
    5468$filterSet = new dcFilterSet('comments','comments.php'); 
    5569 
    56 $authorFilter = new textFilter( 
    57           'author',__('Author'), __('Author'),'q_author',20,255); 
     70$authorFilter = new authorFilter( 
     71          'author',__('Author'), __('Author'),'comment_author',20,255); 
    5872$filterSet 
    5973     ->addFilter(new comboFilter( 
     
    6781$core->callBehavior('adminCommentsFilters',$filterSet); 
    6882 
    69 $filterSet->setFormValues($_GET); 
     83$filterSet->setup($_GET,$_POST); 
    7084if (isset($_GET['author'])) { 
    7185     $authorFilter->add(); 
     
    91105     $core->error->add($e->getMessage()); 
    92106} 
    93 $filterSet->setColumnsForm($comment_list->getColumnsForm()); 
     107$filterSet->setExtraData($comment_list->getColumnsForm()); 
    94108 
    95109/* DISPLAY 
    96110-------------------------------------------------------- */ 
    97 $starting_script = dcPage::jsLoad('js/_comments.js').$filterSet->header();; 
     111$starting_script = dcPage::jsLoad('js/_comments.js').$filterSet->header(); 
    98112 
    99113# --BEHAVIOR-- adminCommentsHeaders 
  • admin/posts.php

    r755 r756  
    138138     ->addFilter(new comboFilter( 
    139139          'users',__('Author'), __('Author'), 'user_id', $users_combo)) 
    140      ->addFilter(new comboFilter( 
     140     ->addFilter(new categoryFilter( 
    141141          'category',__('Category'), __('Category'), 'cat_id', $categories_combo)) 
    142142     ->addFilter(new comboFilter( 
     
    147147          'lang',__('Lang'), __('Lang'), 'post_lang', $lang_combo)) 
    148148     ->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)); 
    150152 
    151153$core->callBehavior('adminPostsFilters',$filterSet); 
     
    165167     } else { 
    166168          $page_title = __('Entries'); 
     169          $filters_info = ''; 
    167170     } 
    168171     $post_list->setItems($posts,$counter->f(0)); 
  • admin/services.php

    r0 r756  
    2525$core->rest->addFunction('delMeta',array('dcRestMethods','delMeta')); 
    2626$core->rest->addFunction('setPostMeta',array('dcRestMethods','setPostMeta')); 
     27$core->rest->addFunction('searchCommentAuthor',array('dcRestMethods','searchCommentAuthor')); 
    2728$core->rest->addFunction('searchMeta',array('dcRestMethods','searchMeta')); 
    2829 
     
    393394          return $rsp; 
    394395     } 
     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 
    395421} 
    396422?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map