getPostTypes(); foreach ($post_types as $k => $v) { $type_combo[__($k)] = (string) $k; } $type = !empty($_POST['type']) ? $_POST['type'] : null; if (!$type && $q) { // Cope with search form $type = !empty($_GET['type']) ? $_GET['type'] : null; } if (!in_array($type, $type_combo)) { $type = null; } $params = array(); $params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page); $params['no_content'] = true; $params['order'] = 'post_dt DESC'; if ($q) { $params['search'] = $q; } if ($type) { $params['post_type'] = $type; } dcPage::openPopup(__('Add a link to an entry'), dcPage::jsLoad('js/_posts_list.js'). dcPage::jsLoad('js/jsToolBar/popup_posts.js')); echo '

'.__('Add a link to an entry').'

'; echo '
'. '

'.form::combo('type',$type_combo,$type).''. $core->formNonce().'

'. ''. '
'; echo '
'. '

'.form::field('q',30,255,html::escapeHTML($q)). ' '. form::hidden('type',html::escapeHTML($type)). '

'; try { $posts = $core->blog->getPosts($params); $counter = $core->blog->getPosts($params,true); $post_list = new adminPostMiniList($core,$posts,$counter->f(0)); } catch (Exception $e) { $core->error->add($e->getMessage()); } echo '
'; # I know it's not a form but we just need the ID $post_list->display($page,$nb_per_page); echo '
'; echo '

'.__('cancel').'

'; dcPage::closePopup(); ?>