Dotclear


Ignore:
Timestamp:
11/12/12 14:33:46 (11 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Every types of entries may be used to inserted an entry link in current edited post, fixes #1089

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/popup_posts.php

    r557 r995  
    1515dcPage::check('usage,contentadmin'); 
    1616 
     17$query_string = ''; 
    1718$q = !empty($_GET['q']) ? $_GET['q'] : null; 
    1819 
    1920$page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1; 
    2021$nb_per_page =  10; 
     22 
     23$post_types = $core->getPostTypes(); 
     24foreach ($post_types as $k => $v) { 
     25     $type_combo[__($k)] = (string) $k; 
     26} 
     27$type = !empty($_POST['type']) ? $_POST['type'] : null; 
     28if (!$type && $q) { 
     29     // Cope with search form 
     30     $type = !empty($_GET['type']) ? $_GET['type'] : null; 
     31} 
     32if (!in_array($type, $type_combo)) { 
     33     $type = null; 
     34} 
    2135 
    2236$params = array(); 
     
    2943} 
    3044 
     45if ($type) { 
     46     $params['post_type'] = $type; 
     47} 
     48 
    3149dcPage::openPopup(__('Add a link to an entry'), 
    3250     dcPage::jsLoad('js/_posts_list.js'). 
     
    3553echo '<h2 class="page-title">'.__('Add a link to an entry').'</h2>'; 
    3654 
     55echo '<form action="popup_posts.php" method="post">'. 
     56     '<p><label for"type" class="classic">'.__('Entry type:').' '.form::combo('type',$type_combo,$type).'</label></p>'. 
     57     $core->formNonce(). 
     58     '<noscript><div><input type="submit" value="'.__('Ok').'" /></div></noscript>'. 
     59     '</form>'; 
     60 
    3761echo '<form action="popup_posts.php" method="get">'. 
    38 '<p><label for="q" class="classic">'.__('Search entry:').' '.form::field('q',30,255,html::escapeHTML($q)).'</label> '. 
    39 ' <input type="submit" value="'.__('Search').'" /></p>'. 
    40 '</form>'; 
     62     '<p><label for="q" class="classic">'.__('Search entry:').' '.form::field('q',30,255,html::escapeHTML($q)).'</label> '. 
     63     ' <input type="submit" value="'.__('Search').'" /></p>'. 
     64     form::hidden('type',html::escapeHTML($type)). 
     65     '</form>'; 
    4166 
    4267try { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map