Dotclear

source: admin/popup_posts.php @ 520:c495e7e8bf12

Revision 520:c495e7e8bf12, 1.5 KB checked in by Tomtom33 <tbouron@…>, 14 years ago (diff)

Applied changes in adminItemsList class

Line 
1<?php
2# -- BEGIN LICENSE BLOCK ---------------------------------------
3#
4# This file is part of Dotclear 2.
5#
6# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
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
13require dirname(__FILE__).'/../inc/admin/prepend.php';
14
15dcPage::check('usage,contentadmin');
16
17$q = !empty($_GET['q']) ? $_GET['q'] : null;
18
19$post_list = new adminPostMiniList($core);
20
21$params = array();
22$params['no_content'] = true;
23
24# - Limit, sortby and order filter
25$params = $post_list->applyFilters($params);
26
27if ($q) {
28     $params['search'] = $q;
29}
30
31dcPage::openPopup(__('Add a link to an entry'),
32     dcPage::jsLoad('js/_posts_list.js').
33     dcPage::jsLoad('js/jsToolBar/popup_posts.js'));
34
35echo '<h2>'.__('Add a link to an entry').'</h2>';
36
37echo '<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="'.__('ok').'" /></p>'.
40'</form>';
41
42try {
43     $posts = $core->blog->getPosts($params);
44     $counter = $core->blog->getPosts($params,true);
45     $post_list->setItems($posts,$counter->f(0));
46} catch (Exception $e) {
47     $core->error->add($e->getMessage());
48}
49
50echo '<div id="form-entries">'; # I know it's not a form but we just need the ID
51$post_list->display();
52echo '</div>';
53
54echo '<p><a class="button" href="#" id="link-insert-cancel">'.__('cancel').'</a></p>';
55
56dcPage::closePopup();
57?>
Note: See TracBrowser for help on using the repository browser.

Sites map