Changeset 3730:5c45a5df9a59 for plugins/importExport/index.php
- Timestamp:
- 03/08/18 17:58:39 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/importExport/index.php
r3421 r3730 10 10 # 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 if (!defined('DC_CONTEXT_ADMIN')) { return;}12 if (!defined('DC_CONTEXT_ADMIN')) {return;} 13 13 14 function listImportExportModules($core, $modules)14 function listImportExportModules($core, $modules) 15 15 { 16 $res = ''; 17 foreach ($modules as $id) 18 { 19 $o = new $id($core); 16 $res = ''; 17 foreach ($modules as $id) { 18 $o = new $id($core); 20 19 21 22 '<dt><a href="'.$o->getURL(true).'">'.html::escapeHTML($o->name).'</a></dt>'.23 '<dd>'.html::escapeHTML($o->description).'</dd>';20 $res .= 21 '<dt><a href="' . $o->getURL(true) . '">' . html::escapeHTML($o->name) . '</a></dt>' . 22 '<dd>' . html::escapeHTML($o->description) . '</dd>'; 24 23 25 26 27 return '<dl class="modules">'.$res.'</dl>';24 unset($o); 25 } 26 return '<dl class="modules">' . $res . '</dl>'; 28 27 } 29 28 30 $modules = new ArrayObject(array('import' => array(), 'export' => array()));29 $modules = new ArrayObject(array('import' => array(), 'export' => array())); 31 30 32 31 # --BEHAVIOR-- importExportModules … … 34 33 35 34 $type = null; 36 if (!empty($_REQUEST['type']) && in_array($_REQUEST['type'],array('export','import'))) {37 35 if (!empty($_REQUEST['type']) && in_array($_REQUEST['type'], array('export', 'import'))) { 36 $type = $_REQUEST['type']; 38 37 } 39 38 … … 41 40 if ($type && !empty($_REQUEST['module'])) { 42 41 43 if (isset($modules[$type]) && in_array($_REQUEST['module'],$modules[$type])) {42 if (isset($modules[$type]) && in_array($_REQUEST['module'], $modules[$type])) { 44 43 45 46 47 44 $module = new $_REQUEST['module']($core); 45 $module->init(); 46 } 48 47 } 49 48 50 if ($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 } 49 if ($type && $module !== null && !empty($_REQUEST['do'])) { 50 try { 51 $module->process($_REQUEST['do']); 52 } catch (Exception $e) { 53 $core->error->add($e->getMessage()); 54 } 57 55 } 58 56 … … 62 60 <html> 63 61 <head> 64 <title>'.$title.'</title>'.65 dcPage::cssLoad(dcPage::getPF('importExport/style.css')).66 dcPage::jsLoad(dcPage::getPF('importExport/js/script.js')).67 68 '.dcPage::jsVar('dotclear.msg.please_wait',__('Please wait...')).'69 62 <title>' . $title . '</title>' . 63 dcPage::cssLoad(dcPage::getPF('importExport/style.css')) . 64 dcPage::jsLoad(dcPage::getPF('importExport/js/script.js')) . 65 '<script type="text/javascript"> 66 ' . dcPage::jsVar('dotclear.msg.please_wait', __('Please wait...')) . ' 67 </script> 70 68 </head> 71 69 <body>'; 72 70 73 71 if ($type && $module !== null) { 74 75 76 __('Plugins')=> '',77 $title=> $p_url,78 79 )).80 72 echo dcPage::breadcrumb( 73 array( 74 __('Plugins') => '', 75 $title => $p_url, 76 html::escapeHTML($module->name) => '' 77 )) . 78 dcPage::notices(); 81 79 82 83 80 echo 81 '<div id="ie-gui">'; 84 82 85 83 $module->gui(); 86 84 87 echo '</div>'; 88 } 89 else { 90 echo dcPage::breadcrumb( 91 array( 92 __('Plugins') => '', 93 $title => '' 94 )). 95 dcPage::notices(); 85 echo '</div>'; 86 } else { 87 echo dcPage::breadcrumb( 88 array( 89 __('Plugins') => '', 90 $title => '' 91 )) . 92 dcPage::notices(); 96 93 97 echo '<h3>'.__('Import').'</h3>'.listImportExportModules($core,$modules['import']);94 echo '<h3>' . __('Import') . '</h3>' . listImportExportModules($core, $modules['import']); 98 95 99 100 '<h3>'.__('Export').'</h3>'.101 '<p class="info">'.sprintf(102 103 '<a href="'.$core->adminurl->get('admin.plugin.maintenance',array('tab' => 'backup')).'#backup">'.__('Maintenance').'</a>'104 ).'</p>';96 echo 97 '<h3>' . __('Export') . '</h3>' . 98 '<p class="info">' . sprintf( 99 __('Export functions are in the page %s.'), 100 '<a href="' . $core->adminurl->get('admin.plugin.maintenance', array('tab' => 'backup')) . '#backup">' . __('Maintenance') . '</a>' 101 ) . '</p>'; 105 102 } 106 103
Note: See TracChangeset
for help on using the changeset viewer.