getPostTypes(); foreach ($post_types as $k => $v) { $type_combo[__($k)] = (string) $k; } if (!in_array($type, $type_combo)) { $type = null; } $params = []; $params['limit'] = [(($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/_popup_posts.js') . $core->callBehavior('adminPopupPosts', $plugin_id)); echo '

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

'; echo '
' . '

' . form::combo('type', $type_combo, $type) . '' . '

' . form::hidden('plugin_id', html::escapeHTML($plugin_id)) . '

' . '
'; echo '
' . '

' . form::field('q', 30, 255, html::escapeHTML($q)) . ' ' . form::hidden('plugin_id', html::escapeHTML($plugin_id)) . 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 '

'; dcPage::closePopup();