Dotclear


Ignore:
Timestamp:
07/09/12 14:44:20 (13 years ago)
Author:
JcDenis
Branch:
default
Message:

Clean up structure, added (un)zip to flat import/export, fixes #1319

File:
1 edited

Legend:

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

    r270 r840  
    22# -- BEGIN LICENSE BLOCK --------------------------------------- 
    33# 
    4 # This file is part of Dotclear 2. 
     4# This file is part of importExport, a plugin for DotClear2. 
    55# 
    6 # Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 
     6# Copyright (c) 2003-2012 Olivier Meunier & Association Dotclear 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    1212if (!defined('DC_RC_PATH')) { return; } 
    1313 
    14 class dcIeModule 
     14abstract class dcIeModule 
    1515{ 
    1616     public $type; 
     
    2828          $this->setInfo(); 
    2929           
    30           $this->id = get_class($this); 
    31           if (!$this->type) { 
    32                throw new Exception('No type for module'.$this->id); 
     30          if (!in_array($this->type,array('import','export'))) { 
     31               throw new Exception(sprintf('Unknow type for module %s',get_class($this))); 
    3332          } 
    34            
    35           $this->url = 'plugin.php?p=importExport&t='.$this->type.'&f='.$this->id; 
    3633           
    3734          if (!$this->name) { 
    3835               $this->name = get_class($this); 
    3936          } 
     37           
     38          $this->id = get_class($this); 
     39          $this->url = sprintf('plugin.php?p=importExport&type=%s&module=%s',$this->type,$this->id); 
    4040     } 
    4141      
     
    4444     } 
    4545      
    46      protected function setInfo() 
    47      { 
    48      } 
     46     abstract protected function setInfo(); 
    4947      
    5048     final public function getURL($escape=false) 
    5149     { 
    52           if ($escape) { 
    53                return html::escapeHTML($this->url); 
    54           } 
    55           return $this->url; 
     50          return $escape ? html::escapeHTML($this->url) : $this->url; 
    5651     } 
    5752      
    58      public function process($do) 
    59      { 
    60      } 
     53     abstract public function process($do); 
    6154      
    62      public function gui() 
    63      { 
    64      } 
     55     abstract public function gui(); 
    6556      
    6657     protected function progressBar($percent) 
Note: See TracChangeset for help on using the changeset viewer.

Sites map