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 | class dcIeModule |
---|
15 | { |
---|
16 | public $type; |
---|
17 | public $id; |
---|
18 | public $name; |
---|
19 | public $description; |
---|
20 | |
---|
21 | protected $import_url; |
---|
22 | protected $export_url; |
---|
23 | protected $core; |
---|
24 | |
---|
25 | public function __construct($core) |
---|
26 | { |
---|
27 | $this->core =& $core; |
---|
28 | $this->setInfo(); |
---|
29 | |
---|
30 | $this->id = get_class($this); |
---|
31 | if (!$this->type) { |
---|
32 | throw new Exception('No type for module'.$this->id); |
---|
33 | } |
---|
34 | |
---|
35 | $this->url = 'plugin.php?p=importExport&t='.$this->type.'&f='.$this->id; |
---|
36 | |
---|
37 | if (!$this->name) { |
---|
38 | $this->name = get_class($this); |
---|
39 | } |
---|
40 | } |
---|
41 | |
---|
42 | public function init() |
---|
43 | { |
---|
44 | } |
---|
45 | |
---|
46 | protected function setInfo() |
---|
47 | { |
---|
48 | } |
---|
49 | |
---|
50 | final public function getURL($escape=false) |
---|
51 | { |
---|
52 | if ($escape) { |
---|
53 | return html::escapeHTML($this->url); |
---|
54 | } |
---|
55 | return $this->url; |
---|
56 | } |
---|
57 | |
---|
58 | public function process($do) |
---|
59 | { |
---|
60 | } |
---|
61 | |
---|
62 | public function gui() |
---|
63 | { |
---|
64 | } |
---|
65 | |
---|
66 | protected function progressBar($percent) |
---|
67 | { |
---|
68 | $percent = ceil($percent); |
---|
69 | if ($percent > 100) { |
---|
70 | $percent = 100; |
---|
71 | } |
---|
72 | return '<div class="ie-progress"><div style="width:'.$percent.'%">'.$percent.' %</div></div>'; |
---|
73 | } |
---|
74 | |
---|
75 | protected function autoSubmit() |
---|
76 | { |
---|
77 | return form::hidden(array('autosubmit'),1); |
---|
78 | } |
---|
79 | |
---|
80 | protected function congratMessage() |
---|
81 | { |
---|
82 | return |
---|
83 | '<h3>'.__('Congratulation!').'</h3>'. |
---|
84 | '<p>'.__('Your blog has been successfully imported. Welcome on Dotclear 2!').'</p>'. |
---|
85 | '<ul><li><strong><a href="post.php">'.__('Why don\'t you blog this now?').'</a></strong></li>'. |
---|
86 | '<li>'.__('or').' <a href="index.php">'.__('visit your dashboard').'</a></li></ul>'; |
---|
87 | } |
---|
88 | } |
---|
89 | ?> |
---|