Dotclear


Ignore:
Timestamp:
03/08/18 17:58:39 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Code formatting (PSR-2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/importExport/index.php

    r3421 r3730  
    1010# 
    1111# -- END LICENSE BLOCK ----------------------------------------- 
    12 if (!defined('DC_CONTEXT_ADMIN')) { return; } 
     12if (!defined('DC_CONTEXT_ADMIN')) {return;} 
    1313 
    14 function listImportExportModules($core,$modules) 
     14function listImportExportModules($core, $modules) 
    1515{ 
    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); 
    2019 
    21           $res .= 
    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>'; 
    2423 
    25           unset($o); 
    26      } 
    27      return '<dl class="modules">'.$res.'</dl>'; 
     24        unset($o); 
     25    } 
     26    return '<dl class="modules">' . $res . '</dl>'; 
    2827} 
    2928 
    30 $modules = new ArrayObject(array('import' => array(),'export' => array())); 
     29$modules = new ArrayObject(array('import' => array(), 'export' => array())); 
    3130 
    3231# --BEHAVIOR-- importExportModules 
     
    3433 
    3534$type = null; 
    36 if (!empty($_REQUEST['type'])  && in_array($_REQUEST['type'],array('export','import'))) { 
    37      $type = $_REQUEST['type']; 
     35if (!empty($_REQUEST['type']) && in_array($_REQUEST['type'], array('export', 'import'))) { 
     36    $type = $_REQUEST['type']; 
    3837} 
    3938 
     
    4140if ($type && !empty($_REQUEST['module'])) { 
    4241 
    43      if (isset($modules[$type]) && in_array($_REQUEST['module'],$modules[$type])) { 
     42    if (isset($modules[$type]) && in_array($_REQUEST['module'], $modules[$type])) { 
    4443 
    45           $module = new $_REQUEST['module']($core); 
    46           $module->init(); 
    47      } 
     44        $module = new $_REQUEST['module']($core); 
     45        $module->init(); 
     46    } 
    4847} 
    4948 
    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      } 
     49if ($type && $module !== null && !empty($_REQUEST['do'])) { 
     50    try { 
     51        $module->process($_REQUEST['do']); 
     52    } catch (Exception $e) { 
     53        $core->error->add($e->getMessage()); 
     54    } 
    5755} 
    5856 
     
    6260<html> 
    6361<head> 
    64      <title>'.$title.'</title>'. 
    65      dcPage::cssLoad(dcPage::getPF('importExport/style.css')). 
    66      dcPage::jsLoad(dcPage::getPF('importExport/js/script.js')). 
    67      '<script type="text/javascript"> 
    68      '.dcPage::jsVar('dotclear.msg.please_wait',__('Please wait...')).' 
    69      </script> 
     62    <title>' . $title . '</title>' . 
     63dcPage::cssLoad(dcPage::getPF('importExport/style.css')) . 
     64dcPage::jsLoad(dcPage::getPF('importExport/js/script.js')) . 
     65'<script type="text/javascript"> 
     66    ' . dcPage::jsVar('dotclear.msg.please_wait', __('Please wait...')) . ' 
     67    </script> 
    7068</head> 
    7169<body>'; 
    7270 
    7371if ($type && $module !== null) { 
    74      echo dcPage::breadcrumb( 
    75           array( 
    76                __('Plugins') => '', 
    77                $title => $p_url, 
    78                html::escapeHTML($module->name) => '' 
    79           )). 
    80           dcPage::notices(); 
     72    echo dcPage::breadcrumb( 
     73        array( 
     74            __('Plugins')                  => '', 
     75            $title                          => $p_url, 
     76            html::escapeHTML($module->name) => '' 
     77        )) . 
     78    dcPage::notices(); 
    8179 
    82      echo 
    83      '<div id="ie-gui">'; 
     80    echo 
     81        '<div id="ie-gui">'; 
    8482 
    85      $module->gui(); 
     83    $module->gui(); 
    8684 
    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(); 
    9693 
    97      echo '<h3>'.__('Import').'</h3>'.listImportExportModules($core,$modules['import']); 
     94    echo '<h3>' . __('Import') . '</h3>' . listImportExportModules($core, $modules['import']); 
    9895 
    99      echo 
    100      '<h3>'.__('Export').'</h3>'. 
    101      '<p class="info">'.sprintf( 
    102           __('Export functions are in the page %s.'), 
    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>'; 
    105102} 
    106103 
Note: See TracChangeset for help on using the changeset viewer.

Sites map