Changeset 995:ffd146bbe114 for admin/popup_posts.php
- Timestamp:
- 11/12/12 14:33:46 (11 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/popup_posts.php
r557 r995 15 15 dcPage::check('usage,contentadmin'); 16 16 17 $query_string = ''; 17 18 $q = !empty($_GET['q']) ? $_GET['q'] : null; 18 19 19 20 $page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1; 20 21 $nb_per_page = 10; 22 23 $post_types = $core->getPostTypes(); 24 foreach ($post_types as $k => $v) { 25 $type_combo[__($k)] = (string) $k; 26 } 27 $type = !empty($_POST['type']) ? $_POST['type'] : null; 28 if (!$type && $q) { 29 // Cope with search form 30 $type = !empty($_GET['type']) ? $_GET['type'] : null; 31 } 32 if (!in_array($type, $type_combo)) { 33 $type = null; 34 } 21 35 22 36 $params = array(); … … 29 43 } 30 44 45 if ($type) { 46 $params['post_type'] = $type; 47 } 48 31 49 dcPage::openPopup(__('Add a link to an entry'), 32 50 dcPage::jsLoad('js/_posts_list.js'). … … 35 53 echo '<h2 class="page-title">'.__('Add a link to an entry').'</h2>'; 36 54 55 echo '<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 37 61 echo '<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>'; 41 66 42 67 try {
Note: See TracChangeset
for help on using the changeset viewer.