[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/kernel/classes/datatypes/ezxmltext/ -> ezxmlinputtype.php (source)

   1  <?php
   2  //
   3  // Definition of eZXMLInputType class
   4  //
   5  // Created on: <06-Nov-2002 14:23:08 wy>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  /*! \file ezxmlinputtype.php
  30  */
  31  
  32  /*!
  33    \class eZXMLInputType ezxmlinputtype.php
  34    \ingroup eZDatatype
  35    \brief The class eZXMLInputType does
  36  
  37  */
  38  
  39  class eZXMLInputType
  40  {
  41      /*!
  42       Constructor
  43      */
  44      function eZXMLInputType()
  45      {
  46      }
  47  
  48      function &instance()
  49      {
  50          $ini =& eZINI::instance();
  51          $inputHandler = $ini->variable( "ExtensionSettings", "XMLEditor" );
  52  
  53          $isMSIE = false;
  54          $userAgent = eZSys::serverVariable( 'HTTP_USER_AGENT' );
  55          if ( eregi('MSIE[ \/]([0-9\.]+)', $userAgent, $browserInfo ) )
  56          {
  57              $version = $browserInfo[1];
  58              if ( $version >= 5.5 )
  59              {
  60                  $isMSIE = true;
  61              }
  62          }
  63  
  64          $disableExtension = false;
  65          $http =& eZHTTPTool::instance();
  66          if ( $http->hasSessionVariable( 'DisableEditorExtension' ) )
  67          {
  68              $disableExtension = true;
  69          }
  70  
  71          $impl = null;
  72          if ( $inputHandler == "standard" )
  73          {
  74              if ( file_exists( "kernel/classes/datatypes/ezxmltext/ezxmlinputhandler.php" ) )
  75              {
  76                  include_once ( "kernel/classes/datatypes/ezxmltext/ezxmlinputhandler.php" );
  77                  $impl = new eZXMLInputHandler();
  78              }
  79          }
  80          elseif ( $inputHandler == "dhtml" )
  81          {
  82              if ( $isMSIE
  83                   and ( file_exists( "extension/xmleditor/" . $inputHandler . "/ezdhtmlinputhandler.php" ) )
  84                   and ( $disableExtension == false ) )
  85              {
  86                  include_once( "extension/xmleditor/" . $inputHandler . "/ezdhtmlinputhandler.php" );
  87                  $impl = new eZDHTMLInputHandler();
  88              }
  89              else
  90              {
  91                  if ( file_exists( "kernel/classes/datatypes/ezxmltext/ezxmlinputhandler.php" ) )
  92                  {
  93                      include_once ( "kernel/classes/datatypes/ezxmltext/ezxmlinputhandler.php" );
  94                      $impl = new eZXMLInputHandler();
  95                  }
  96              }
  97          }
  98          else
  99          {
 100              eZDebug::writeError( "No XML editor available." );
 101          }
 102          return $impl;
 103      }
 104  
 105      function &editorName()
 106      {
 107          $ini =& eZINI::instance();
 108          $inputHandler = $ini->variable( "ExtensionSettings", "XMLEditor" );
 109  
 110          $disableExtension = false;
 111  
 112          $isMSIE = false;
 113          $userAgent = eZSys::serverVariable( 'HTTP_USER_AGENT' );
 114          if ( eregi('MSIE[ \/]([0-9\.]+)', $userAgent, $browserInfo ) )
 115          {
 116              $version = $browserInfo[1];
 117              if ( $version >= 5.5 )
 118              {
 119                  $isMSIE = true;
 120              }
 121          }
 122  
 123          $http =& eZHTTPTool::instance();
 124          if ( $http->hasSessionVariable( 'DisableEditorExtension' ) )
 125          {
 126              $disableExtension = true;
 127          }
 128  
 129          $editorName = null;
 130          if ( $inputHandler == "standard" )
 131          {
 132              if ( file_exists( "kernel/classes/datatypes/ezxmltext/ezxmlinputhandler.php" ) )
 133              {
 134                  $editorName = "standard";
 135              }
 136          }
 137          elseif ( $inputHandler == "dhtml" )
 138          {
 139              if ( $isMSIE
 140                   and ( file_exists( "extension/xmleditor/" . $inputHandler . "/ezdhtmlinputhandler.php" ) )
 141                   and ( $disableExtension == false ) )
 142              {
 143                  $editorName = "dhtml";
 144              }
 145              else
 146              {
 147                  if ( file_exists( "kernel/classes/datatypes/ezxmltext/ezxmlinputhandler.php" ) )
 148                  {
 149                      $editorName = "standard";
 150                  }
 151              }
 152          }
 153          else
 154          {
 155              eZDebug::writeError( "No XML editor available." );
 156          }
 157          return $editorName;
 158      }
 159  
 160  }
 161  
 162  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7