phpDocumentor lodel-logic
[ class tree: lodel-logic ] [ index: lodel-logic ] [ all elements ]

Source for file class.internalstyles.php

Documentation is available at class.internalstyles.php

  1. <?php
  2. /**    
  3.  * Logique des styles internes
  4.  *
  5.  * PHP versions 4 et 5
  6.  *
  7.  * LODEL - Logiciel d'Edition ELectronique.
  8.  *
  9.  * Home page: http://www.lodel.org
  10.  * E-Mail: lodel@lodel.org
  11.  *
  12.  * All Rights Reserved
  13.  *
  14.  * This program is free software; you can redistribute it and/or modify
  15.  * it under the terms of the GNU General Public License as published by
  16.  * the Free Software Foundation; either version 2 of the License, or
  17.  * (at your option) any later version.
  18.  *
  19.  * This program is distributed in the hope that it will be useful,
  20.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22.  * GNU General Public License for more details.
  23.  *
  24.  * You should have received a copy of the GNU General Public License
  25.  * along with this program; if not, write to the Free Software
  26.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  27.  *
  28.  * @package lodel/logic
  29.  * @author Ghislain Picard
  30.  * @author Jean Lamy
  31.  * @copyright 2001-2002, Ghislain Picard, Marin Dacos
  32.  * @copyright 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot
  33.  * @copyright 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou
  34.  * @copyright 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
  35.  * @copyright 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
  36.  * @copyright 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
  37.  * @licence http://www.gnu.org/copyleft/gpl.html
  38.  * @since Fichier ajouté depuis la version 0.8
  39.  * @version CVS:$Id: class.internalstyles.php 4006 2007-10-05 11:53:41Z malafosse $
  40.  */
  41.  
  42.  
  43.  
  44. /**
  45.  * Classe de logique des styles internes
  46.  * 
  47.  * @package lodel/logic
  48.  * @author Ghislain Picard
  49.  * @author Jean Lamy
  50.  * @copyright 2001-2002, Ghislain Picard, Marin Dacos
  51.  * @copyright 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot
  52.  * @copyright 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou
  53.  * @copyright 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
  54.  * @copyright 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
  55.  * @copyright 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
  56.  * @licence http://www.gnu.org/copyleft/gpl.html
  57.  * @since Classe ajouté depuis la version 0.8
  58.  * @see logic.php
  59.  */
  60. class InternalstylesLogic extends Logic {
  61.  
  62.     /** Constructor
  63.     */
  64.     function InternalstylesLogic({
  65.         $this->Logic("internalstyles");
  66.     }
  67.  
  68.  
  69.     function makeSelect(&$context,$var)
  70.  
  71.     {
  72.         switch($var{
  73.         case "surrounding" :
  74.             $arr=array(
  75.             "-*"=>getlodeltextcontents("previous_style","admin"),
  76.             "*-"=>getlodeltextcontents("next_styles","admin"),
  77.             );
  78.             
  79.             $dao=&getDAO("tablefields");
  80.             $vos=$dao->findMany("style!=''","style","style");
  81.             foreach($vos as $vo{
  82.     if (strpos($vo->style,".")!==false || strpos($vo->style,":")!==falsecontinue;
  83.     $style=preg_replace("/[;,].*/","",$vo->style)// remove the synonyms
  84.     $arr[$style]=$style;
  85.             }
  86.             renderOptions($arr,$context['surrounding']);
  87.             break;
  88.         }
  89.     }
  90.  
  91.  
  92.     /*---------------------------------------------------------------*/
  93.     //! Private or protected from this point
  94.     /**
  95.         * @private
  96.         */
  97.  
  98.  
  99.  
  100.  
  101.     // begin{publicfields} automatic generation  //
  102.  
  103.     /**
  104.      * Retourne la liste des champs publics
  105.      * @access private
  106.      */
  107.     function _publicfields(
  108.     {
  109.         return array('style' => array('style''+'),
  110.                                     'conversion' => array('text'''),
  111.                                     'surrounding' => array('select''+'),
  112.                                     'greedy' => array('boolean'''));
  113.     }
  114.     // end{publicfields} automatic generation  //
  115.  
  116.     // begin{uniquefields} automatic generation  //
  117.  
  118.     /**
  119.      * Retourne la liste des champs uniques
  120.      * @access private
  121.      */
  122.     function _uniqueFields(
  123.     
  124.         return array(array('style'));
  125.     }
  126.     // end{uniquefields} automatic generation  //
  127.  
  128.  
  129. // class 
  130.  
  131.  
  132. /*-----------------------------------*/
  133. /* loops                             */
  134.  
  135.  
  136.  
  137.  
  138.  
  139. ?>

Documentation generated on Thu, 24 Jul 2008 05:07:57 +0200 by phpDocumentor 1.4.0a2