Dotclear


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

Code formatting (PSR-2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/importExport/inc/class.dc.ieModule.php

    r2825 r3730  
    1010# 
    1111# -- END LICENSE BLOCK ----------------------------------------- 
    12 if (!defined('DC_RC_PATH')) { return; } 
     12if (!defined('DC_RC_PATH')) {return;} 
    1313 
    1414abstract class dcIeModule 
    1515{ 
    16      public $type; 
    17      public $id; 
    18      public $name; 
    19      public $description; 
     16    public $type; 
     17    public $id; 
     18    public $name; 
     19    public $description; 
    2020 
    21      protected $import_url; 
    22      protected $export_url; 
    23      protected $core; 
     21    protected $import_url; 
     22    protected $export_url; 
     23    protected $core; 
    2424 
    25      public function __construct($core) 
    26      { 
    27           $this->core =& $core; 
    28           $this->setInfo(); 
     25    public function __construct($core) 
     26    { 
     27        $this->core = &$core; 
     28        $this->setInfo(); 
    2929 
    30           if (!in_array($this->type,array('import','export'))) { 
    31                throw new Exception(sprintf('Unknow type for module %s',get_class($this))); 
    32           } 
     30        if (!in_array($this->type, array('import', 'export'))) { 
     31            throw new Exception(sprintf('Unknow type for module %s', get_class($this))); 
     32        } 
    3333 
    34           if (!$this->name) { 
    35                $this->name = get_class($this); 
    36           } 
     34        if (!$this->name) { 
     35            $this->name = get_class($this); 
     36        } 
    3737 
    38           $this->id = get_class($this); 
    39           $this->url = sprintf('plugin.php?p=importExport&type=%s&module=%s',$this->type,$this->id); 
    40      } 
     38        $this->id = get_class($this); 
     39        $this->url = sprintf('plugin.php?p=importExport&type=%s&module=%s', $this->type, $this->id); 
     40    } 
    4141 
    42      public function init() 
    43      { 
    44      } 
     42    public function init() 
     43    { 
     44    } 
    4545 
    46      abstract protected function setInfo(); 
     46    abstract protected function setInfo(); 
    4747 
    48      final public function getURL($escape=false) 
    49      { 
    50           return $escape ? html::escapeHTML($this->url) : $this->url; 
    51      } 
     48    final public function getURL($escape = false) 
     49    { 
     50        return $escape ? html::escapeHTML($this->url) : $this->url; 
     51    } 
    5252 
    53      abstract public function process($do); 
     53    abstract public function process($do); 
    5454 
    55      abstract public function gui(); 
     55    abstract public function gui(); 
    5656 
    57      protected function progressBar($percent) 
    58      { 
    59           $percent = ceil($percent); 
    60           if ($percent > 100) { 
    61                $percent = 100; 
    62           } 
    63           return '<div class="ie-progress"><div style="width:'.$percent.'%">'.$percent.' %</div></div>'; 
    64      } 
     57    protected function progressBar($percent) 
     58    { 
     59        $percent = ceil($percent); 
     60        if ($percent > 100) { 
     61            $percent = 100; 
     62        } 
     63        return '<div class="ie-progress"><div style="width:' . $percent . '%">' . $percent . ' %</div></div>'; 
     64    } 
    6565 
    66      protected function autoSubmit() 
    67      { 
    68           return form::hidden(array('autosubmit'),1); 
    69      } 
     66    protected function autoSubmit() 
     67    { 
     68        return form::hidden(array('autosubmit'), 1); 
     69    } 
    7070 
    71      protected function congratMessage() 
    72      { 
    73           return 
    74           '<h3>'.__('Congratulation!').'</h3>'. 
    75           '<p class="success">'.__('Your blog has been successfully imported. Welcome on Dotclear 2!').'</p>'. 
    76           '<ul><li><strong><a href="'.$this->core->decode('admin.post').'">'.__('Why don\'t you blog this now?').'</a></strong></li>'. 
    77           '<li>'.__('or').' <a href="'.$this->core->decode('admin.home').'">'.__('visit your dashboard').'</a></li></ul>'; 
    78      } 
     71    protected function congratMessage() 
     72    { 
     73        return 
     74        '<h3>' . __('Congratulation!') . '</h3>' . 
     75        '<p class="success">' . __('Your blog has been successfully imported. Welcome on Dotclear 2!') . '</p>' . 
     76        '<ul><li><strong><a href="' . $this->core->decode('admin.post') . '">' . __('Why don\'t you blog this now?') . '</a></strong></li>' . 
     77        '<li>' . __('or') . ' <a href="' . $this->core->decode('admin.home') . '">' . __('visit your dashboard') . '</a></li></ul>'; 
     78    } 
    7979} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map