[0] | 1 | <?php |
---|
| 2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
| 3 | # |
---|
| 4 | # This file is part of Dotclear 2. |
---|
| 5 | # |
---|
[270] | 6 | # Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear |
---|
[0] | 7 | # Licensed under the GPL version 2.0 license. |
---|
| 8 | # See LICENSE file or |
---|
| 9 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
| 10 | # |
---|
| 11 | # -- END LICENSE BLOCK ----------------------------------------- |
---|
| 12 | |
---|
| 13 | require dirname(__FILE__).'/../inc/admin/prepend.php'; |
---|
| 14 | |
---|
| 15 | dcPage::check('usage,contentadmin'); |
---|
| 16 | |
---|
| 17 | $q = !empty($_GET['q']) ? $_GET['q'] : null; |
---|
| 18 | |
---|
| 19 | $page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1; |
---|
| 20 | $nb_per_page = 10; |
---|
| 21 | |
---|
| 22 | $params = array(); |
---|
| 23 | $params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page); |
---|
| 24 | $params['no_content'] = true; |
---|
| 25 | $params['order'] = 'post_dt DESC'; |
---|
| 26 | |
---|
| 27 | if ($q) { |
---|
| 28 | $params['search'] = $q; |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | dcPage::openPopup(__('Add a link to an entry'), |
---|
| 32 | dcPage::jsLoad('js/_posts_list.js'). |
---|
| 33 | dcPage::jsLoad('js/jsToolBar/popup_posts.js')); |
---|
| 34 | |
---|
[500] | 35 | echo '<h2 class="page-title">'.__('Add a link to an entry').'</h2>'; |
---|
[0] | 36 | |
---|
| 37 | echo '<form action="popup_posts.php" method="get">'. |
---|
[68] | 38 | '<p><label for="q" class="classic">'.__('Search entry:').' '.form::field('q',30,255,html::escapeHTML($q)).'</label> '. |
---|
[557] | 39 | ' <input type="submit" value="'.__('Search').'" /></p>'. |
---|
[0] | 40 | '</form>'; |
---|
| 41 | |
---|
| 42 | try { |
---|
| 43 | $posts = $core->blog->getPosts($params); |
---|
| 44 | $counter = $core->blog->getPosts($params,true); |
---|
| 45 | $post_list = new adminPostMiniList($core,$posts,$counter->f(0)); |
---|
| 46 | } catch (Exception $e) { |
---|
| 47 | $core->error->add($e->getMessage()); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | echo '<div id="form-entries">'; # I know it's not a form but we just need the ID |
---|
| 51 | $post_list->display($page,$nb_per_page); |
---|
| 52 | echo '</div>'; |
---|
| 53 | |
---|
| 54 | echo '<p><a class="button" href="#" id="link-insert-cancel">'.__('cancel').'</a></p>'; |
---|
| 55 | |
---|
| 56 | dcPage::closePopup(); |
---|
| 57 | ?> |
---|