Revision 3731:3770620079d4,
1.5 KB
checked in by franck <carnet.franck.paul@…>, 7 years ago
(diff) |
Simplify licence block at the beginning of each file
|
Line | |
---|
1 | <?php |
---|
2 | /** |
---|
3 | * @brief maintenance, a plugin for Dotclear 2 |
---|
4 | * |
---|
5 | * @package Dotclear |
---|
6 | * @subpackage Plugins |
---|
7 | * |
---|
8 | * @copyright Olivier Meunier & Association Dotclear |
---|
9 | * @copyright GPL-2.0-only |
---|
10 | */ |
---|
11 | |
---|
12 | if (!defined('DC_RC_PATH')) {return;} |
---|
13 | |
---|
14 | class dcMaintenanceIndexposts extends dcMaintenanceTask |
---|
15 | { |
---|
16 | protected $ajax = true; |
---|
17 | protected $group = 'index'; |
---|
18 | protected $limit = 500; |
---|
19 | protected $step_task; |
---|
20 | |
---|
21 | protected function init() |
---|
22 | { |
---|
23 | $this->name = __('Search engine index'); |
---|
24 | $this->task = __('Index all entries for search engine'); |
---|
25 | $this->step_task = __('Next'); |
---|
26 | $this->step = __('Indexing entry %d to %d.'); |
---|
27 | $this->success = __('Entries index done.'); |
---|
28 | $this->error = __('Failed to index entries.'); |
---|
29 | |
---|
30 | $this->description = __('Index all entries in search engine index. This operation is necessary, after importing content in your blog, to use internal search engine, on public and private pages.'); |
---|
31 | } |
---|
32 | |
---|
33 | public function execute() |
---|
34 | { |
---|
35 | $this->code = $this->core->indexAllPosts($this->code, $this->limit); |
---|
36 | |
---|
37 | return $this->code ?: true; |
---|
38 | } |
---|
39 | |
---|
40 | public function task() |
---|
41 | { |
---|
42 | return $this->code ? $this->step_task : $this->task; |
---|
43 | } |
---|
44 | |
---|
45 | public function step() |
---|
46 | { |
---|
47 | return $this->code ? sprintf($this->step, $this->code - $this->limit, $this->code) : null; |
---|
48 | } |
---|
49 | |
---|
50 | public function success() |
---|
51 | { |
---|
52 | return $this->code ? sprintf($this->step, $this->code - $this->limit, $this->code) : $this->success; |
---|
53 | } |
---|
54 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.