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

Source for file class.indextablefields.php

Documentation is available at class.indextablefields.php

  1. <?php
  2. /**    
  3.  * Logique des champs d'index
  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.indextablefields.php 4006 2007-10-05 11:53:41Z malafosse $
  40.  */
  41.  
  42.  
  43. require_once("logic/class.tablefields.php");
  44.  
  45. /**
  46.  * Classe de logique des champs d'indexs
  47.  * 
  48.  * @package lodel/logic
  49.  * @author Ghislain Picard
  50.  * @author Jean Lamy
  51.  * @copyright 2001-2002, Ghislain Picard, Marin Dacos
  52.  * @copyright 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot
  53.  * @copyright 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou
  54.  * @copyright 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
  55.  * @copyright 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
  56.  * @copyright 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
  57.  * @licence http://www.gnu.org/copyleft/gpl.html
  58.  * @since Classe ajouté depuis la version 0.8
  59.  * @see logic.php
  60.  */
  61.  
  62.     /** Constructor
  63.     */
  64.     function IndexTableFieldsLogic({
  65.         $this->Logic("tablefields");
  66.     }
  67.  
  68.  
  69.     /**
  70.         * edit/add an object Action
  71.         */
  72.     function editAction(&$context,&$error)
  73.  
  74.     {
  75.         $context['condition']="*";
  76.         return TableFieldsLogic::editAction($context,$error);
  77.     }
  78.  
  79.  
  80.     /**
  81.         *
  82.         */
  83.  
  84.     function makeSelect(&$context,$var)
  85.  
  86.     {
  87.         global $home;
  88.  
  89.         switch($var{
  90.         case "name" :       
  91.             $dao=&getDAO($context['type']=='entries' "entrytypes" "persontypes");
  92.             $vos=$dao->findMany("status>0","rank,title","type,title");
  93.             foreach($vos as $vo{
  94.     $arr[$vo->type]=$vo->title;
  95.             }
  96.             renderOptions($arr,$context['name']);
  97.             break;
  98.         case "edition" :
  99.             $arr=array(
  100.             "editable"=>getlodeltextcontents("edit_in_the_interface","admin"),
  101.             "importable"=>getlodeltextcontents("no_edit_but_import","admin"),
  102.             "none"=>getlodeltextcontents("no_change","admin"),
  103.             "display"=>getlodeltextcontents("display_no_edit","admin"),
  104.             );
  105.             renderOptions($arr,$context['edition']);
  106.             break;
  107.         default:
  108.             TableFieldsLogic::makeSelect($context,$var);
  109.             break;
  110.         }
  111.     }
  112.  
  113.     /*---------------------------------------------------------------*/
  114.     //! Private or protected from this point
  115.     /**
  116.         * @private
  117.         */
  118.  
  119.     /**
  120.     * Préparation de l'action Edit
  121.     *
  122.     * @access private
  123.     * @param object $dao la DAO utilisée
  124.     * @param array &$context le context passé par référence
  125.     */
  126.     function _prepareEdit($dao,&$context)
  127.  
  128.     {
  129.     }
  130.     /**
  131.     * Sauve des données dans des tables liées éventuellement
  132.     *
  133.     * Appelé par editAction pour effectuer des opérations supplémentaires de sauvegarde.
  134.     *
  135.     * @param object $vo l'objet qui a été créé
  136.     * @param array $context le contexte
  137.     */
  138.     function _saveRelatedTables($vo,$context
  139.  
  140.     {
  141.     }
  142.  
  143.     /**
  144.     * Appelé avant l'action delete
  145.     *
  146.     * Cette méthode est appelée avant l'action delete pour effectuer des vérifications
  147.     * préliminaires à une suppression.
  148.     *
  149.     * @param object $dao la DAO utilisée
  150.     * @param array &$context le contexte passé par référénce
  151.     */
  152.     function _prepareDelete($dao,&$context)
  153.  
  154.     {     
  155.     }
  156.  
  157.     function _deleteRelatedTables($id)
  158.  
  159.     {
  160.     }
  161.  
  162.  
  163.     // begin{publicfields} automatic generation  //
  164.  
  165.     /**
  166.      * Retourne la liste des champs publics
  167.      * @access private
  168.      */
  169.     function _publicfields(
  170.     {
  171.         return array('name' => array('select''+'),
  172.                                     'class' => array('class''+'),
  173.                                     'title' => array('text''+'),
  174.                                     'altertitle' => array('mltext'''),
  175.                                     'type' => array('class''+'),
  176.                                     'edition' => array('select'''),
  177.                                     'comment' => array('longtext'''),
  178.                                     'idgroup' => array('select''+'));
  179.     }
  180.     // end{publicfields} automatic generation  //
  181.  
  182.     // begin{uniquefields} automatic generation  //
  183.  
  184.     /**
  185.      * Retourne la liste des champs uniques
  186.      * @access private
  187.      */
  188.     function _uniqueFields(
  189.     
  190.         return array(array('name''class'));
  191.     }
  192.     // end{uniquefields} automatic generation  //
  193.  
  194.  
  195. // class 
  196.  
  197.  
  198. /*-----------------------------------*/
  199. /* loops                             */
  200.  
  201. ?>

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