1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
3 | # |
---|
4 | # This file is part of Dotclear 2. |
---|
5 | # |
---|
6 | # Copyright (c) 2003-2011 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 | if (!defined('DC_RC_PATH')) { return; } |
---|
13 | |
---|
14 | /** |
---|
15 | @ingroup DC_CORE |
---|
16 | @nosubgrouping |
---|
17 | @brief Dotclear generic list class. |
---|
18 | @deprecated Please use class adminItemslist to create admin lists |
---|
19 | |
---|
20 | Dotclear generic list handles every admin list. |
---|
21 | */ |
---|
22 | class adminGenericList |
---|
23 | { |
---|
24 | protected $core; |
---|
25 | protected $rs; |
---|
26 | protected $rs_count; |
---|
27 | |
---|
28 | /** |
---|
29 | @deprecated Please use class adminItemslist to create admin lists |
---|
30 | |
---|
31 | @param core <b>dcCore</b> dcCore object |
---|
32 | @param rs <b>recordSet</b> Items recordSet to display |
---|
33 | @param rs_count <b>int</b> Total items number |
---|
34 | */ |
---|
35 | public function __construct($core,$rs,$rs_count) |
---|
36 | { |
---|
37 | // For backward compatibility only: the developer tried to create |
---|
38 | // a list with the old constructor. |
---|
39 | $this->raiseDeprecated(get_class($this)); |
---|
40 | |
---|
41 | $this->core =& $core; |
---|
42 | $this->rs =& $rs; |
---|
43 | $this->rs_count = $rs_count; |
---|
44 | $this->html_prev = __('«prev.'); |
---|
45 | $this->html_next = __('next»'); |
---|
46 | } |
---|
47 | |
---|
48 | /** |
---|
49 | Raises a E_USER_NOTICE error for deprecated classes. |
---|
50 | This allows the developer to know he's been using deprecated classes. |
---|
51 | |
---|
52 | @param name <b>string</b> Name of the deprecated classes that was called. |
---|
53 | */ |
---|
54 | private function raiseDeprecated($name) |
---|
55 | { |
---|
56 | if (DC_DEBUG) { |
---|
57 | $trace = debug_backtrace(); |
---|
58 | array_shift($trace); |
---|
59 | $grand = array_shift($trace); |
---|
60 | $msg = 'Deprecated class called. ('; |
---|
61 | $msg .= $name . ' was called from '.$grand['file'].' ['.$grand['line'].'])'; |
---|
62 | trigger_error($msg, E_USER_NOTICE); |
---|
63 | } |
---|
64 | } |
---|
65 | } |
---|
66 | |
---|
67 | ?> |
---|