[ Index ]
 

Code source de eGroupWare 1.2.106-2

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

title

Body

[fermer]

/sitemgr/inc/ -> class.xslt_transform.inc.php (source)

   1  <?php
   2      /**************************************************************************\
   3      * eGroupWare SiteMgr - Web Content Management                              *
   4      * http://www.egroupware.org                                                *
   5      * --------------------------------------------                             *
   6      *  This program is free software; you can redistribute it and/or modify it *
   7      *  under the terms of the GNU General Public License as published by the   *
   8      *  Free Software Foundation; either version 2 of the License, or (at your  *
   9      *  option) any later version.                                              *
  10      \**************************************************************************/
  11  
  12      /* $Id: class.xslt_transform.inc.php 15064 2004-05-02 18:13:30Z ralfbecker $ */
  13  
  14  // some constanst for pre php4.3
  15  if (!defined('PHP_SHLIB_SUFFIX'))
  16  {
  17      define('PHP_SHLIB_SUFFIX',strtoupper(substr(PHP_OS, 0,3)) == 'WIN' ? 'dll' : 'so');
  18  }
  19  if (!defined('PHP_SHLIB_PREFIX'))
  20  {
  21      define('PHP_SHLIB_PREFIX',PHP_SHLIB_SUFFIX == 'dll' ? 'php_' : '');
  22  }
  23  
  24  class xslt_transform
  25  {
  26      var $arguments;
  27  
  28  	function xslt_transform($xsltfile,$xsltparameters=NULL)
  29      {
  30          $this->xsltfile = $xsltfile;
  31          $this->xsltparameters = $xsltparameters;
  32  
  33          $this->xslt_extension_availible = extension_loaded('xslt') || @dl(PHP_SHLIB_PREFIX.'xslt.'.PHP_SHLIB_SUFFIX);
  34      }
  35  
  36  	function apply_transform($title,$content)
  37      {
  38          if (!$this->xslt_extension_availible)
  39          {
  40              return 'The xslt_transformation used, needs the "xslt" extension of php !!!';
  41          }
  42          $xh = xslt_create();
  43          $xsltarguments = array('/_xml' => $content);
  44          $result = xslt_process($xh, 'arg:/_xml', $this->xsltfile, NULL, $xsltarguments,$this->xsltparameters);
  45          xslt_free($xh);
  46          return $result;
  47      }
  48  }


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7