Dotclear

source: plugins/importExport/index.php @ 2256:d3c3fa1723ab

Revision 2256:d3c3fa1723ab, 2.5 KB checked in by Dsls, 12 years ago (diff)

updated most of notices to new format, should fix #1710 (maintenance and daInstaller still to be updated)

Line 
1<?php
2# -- BEGIN LICENSE BLOCK ---------------------------------------
3#
4# This file is part of importExport, a plugin for DotClear2.
5#
6# Copyright (c) 2003-2012 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 -----------------------------------------
12if (!defined('DC_CONTEXT_ADMIN')) { return; }
13
14function listImportExportModules($core,$modules)
15{
16     $res = '';
17     foreach ($modules as $id)
18     {
19          $o = new $id($core);
20         
21          $res .= 
22          '<dt><a href="'.$o->getURL(true).'">'.html::escapeHTML($o->name).'</a></dt>'.
23          '<dd>'.html::escapeHTML($o->description).'</dd>';
24         
25          unset($o);
26     }
27     return '<dl class="modules">'.$res.'</dl>';
28}
29
30$modules = new ArrayObject(array('import' => array(),'export' => array()));
31
32# --BEHAVIOR-- importExportModules
33$core->callBehavior('importExportModules', $modules, $core);
34
35$type = null;
36if (!empty($_REQUEST['type'])  && in_array($_REQUEST['type'],array('export','import'))) {
37     $type = $_REQUEST['type'];
38}
39
40$module = null;
41if ($type && !empty($_REQUEST['module'])) {
42
43     if (isset($modules[$type]) && in_array($_REQUEST['module'],$modules[$type])) {
44     
45          $module = new $_REQUEST['module']($core);
46          $module->init();
47     }
48}
49
50if ($type && $module !== null && !empty($_REQUEST['do']))
51{
52     try {
53          $module->process($_REQUEST['do']);
54     } catch (Exception $e) {
55          $core->error->add($e->getMessage());
56     }
57}
58
59$title = __('Import/Export');
60
61echo '
62<html>
63<head>
64     <title>'.$title.'</title>
65     <link rel="stylesheet" type="text/css" href="index.php?pf=importExport/style.css" />
66     '.dcPage::jsLoad('index.php?pf=importExport/js/script.js').'
67     <script type="text/javascript">
68     //<![CDATA[
69     '.dcPage::jsVar('dotclear.msg.please_wait',__('Please wait...')).'
70     //]]>
71     </script>
72</head>
73<body>';
74
75if ($type && $module !== null) {
76     echo dcPage::breadcrumb(
77          array(
78               __('Plugins') => '',
79               $title => $p_url,
80               html::escapeHTML($module->name) => ''
81          )).
82          dcPage::notices();
83
84     echo
85     '<div id="ie-gui">';
86     
87     $module->gui();
88     
89     echo '</div>';
90}
91else {
92     echo dcPage::breadcrumb(
93          array(
94               __('Plugins') => '',
95               $title => ''
96          )).
97          dcPage::notices();
98
99     echo '<h3>'.__('Import').'</h3>'.listImportExportModules($core,$modules['import']);
100     //echo '<h3>'.__('Export').'</h3>'.listImportExportModules($core,$modules['export']);
101}
102
103echo
104'<p class="info">'.sprintf(
105     __('Export functions are in the page %s.'),
106     '<a href="plugin.php?p=maintenance&amp;tab=backup#backup">'.__('Maintenance').'</a>'
107).'</p>';
108
109echo '
110</body>
111</html>';
112?>
Note: See TracBrowser for help on using the repository browser.

Sites map