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

Source for file commonselect.php

Documentation is available at commonselect.php

  1. <?php
  2. /**
  3.  * Fichier utilitaire de gestion des makeSelect (utile en LODELSCRIPT)
  4.  *
  5.  * PHP versions 4 et 5
  6.  *
  7.  * LODEL - Logiciel d'Edition ELectronique.
  8.  *
  9.  * Copyright (c) 2001-2002, Ghislain Picard, Marin Dacos
  10.  * Copyright (c) 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot
  11.  * Copyright (c) 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou
  12.  * Copyright (c) 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
  13.  * Copyright (c) 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
  14.  * Copyright (c) 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
  15.  *
  16.  * Home page: http://www.lodel.org
  17.  *
  18.  * E-Mail: lodel@lodel.org
  19.  *
  20.  * All Rights Reserved
  21.  *
  22.  * This program is free software; you can redistribute it and/or modify
  23.  * it under the terms of the GNU General Public License as published by
  24.  * the Free Software Foundation; either version 2 of the License, or
  25.  * (at your option) any later version.
  26.  *
  27.  * This program is distributed in the hope that it will be useful,
  28.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  29.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  30.  * GNU General Public License for more details.
  31.  *
  32.  * You should have received a copy of the GNU General Public License
  33.  * along with this program; if not, write to the Free Software
  34.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  35.  *
  36.  * @author Ghislain Picard
  37.  * @author Jean Lamy
  38.  * @copyright 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
  39.  * @copyright 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
  40.  * @copyright 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
  41.  * @licence http://www.gnu.org/copyleft/gpl.html
  42.  * @version CVS:$Id:
  43.  * @package lodel
  44.  */
  45.  
  46. /**
  47.  * Construit le SELECT des différents types de champs
  48.  *
  49.  * Cette fonction récupère la liste des types de champs (dans fieldfunc.php) et appelle
  50.  * renderOptions()
  51.  * @param string $value la valeur courante (pour positionner le selected="selected"
  52.  */
  53. function makeSelectFieldTypes($value)
  54. {
  55.     require_once 'fieldfunc.php';
  56.     $arr2 array ();
  57.     foreach ($GLOBALS['lodelfieldtypes'as $k => $v{
  58.         if ($v{
  59.             $arr2[$kgetlodeltextcontents($k"common");
  60.         }
  61.     }
  62.     renderOptions($arr2$value);
  63. }
  64.  
  65. /**
  66.  * Construit le SELECT des différents types d'utilisateurs
  67.  *
  68.  * Cette fonction récupère la liste des niveaux d'utilisateurs et appelle
  69.  * renderOptions()
  70.  * @param string $value la valeur courante (pour positionner le selected="selected"
  71.  * @param boolean $adminlodel un booleen qui indique si on doit inclure le niveau Admin Lodel
  72.  */
  73. function makeSelectUserRights($value$adminlodel)
  74. {
  75.     $arr array (LEVEL_VISITOR => getlodeltextcontents("user_visitor""common")LEVEL_REDACTOR => getlodeltextcontents("user_redactor""common")LEVEL_EDITOR => getlodeltextcontents("user_editor""common")LEVEL_ADMIN => getlodeltextcontents("user_admin""common"));
  76.     if (!$GLOBALS['site'&& !SINGLESITE{
  77.         $arr array ();
  78.     }
  79.     if ($adminlodel{
  80.         $arr[LEVEL_ADMINLODELgetlodeltextcontents("user_adminlodel""common");
  81.     }
  82.  
  83.     // take only the rights below the current user rights
  84.     // in pratice only the ADMIN and ADMINLODEL should be authorized to add/remove users...
  85.     $arr2 array ();
  86.     foreach ($arr as $k => $v{
  87.         if ($GLOBALS['lodeluser']['rights'>= $k{
  88.             $arr2[$k$v;
  89.         }
  90.     }
  91.     renderOptions($arr2$value);
  92. }
  93. function makeSelectGuiUserComplexity($value)
  94. {
  95.     
  96.     $arr arrayINTERFACE_SIMPLE => getlodeltextcontents('simple''common'),
  97.                                 INTERFACE_NORMAL => getlodeltextcontents('normal''common'),
  98.                                 INTERFACE_ADVANCED => getlodeltextcontents('advanced''common'),
  99.                                 INTERFACE_DEBUG => getlodeltextcontents('debug''common')
  100.                             );
  101.     if(!$value || $value == 0{
  102.         $value INTERFACE_ADVANCED;
  103.     }
  104.     renderOptions($arr$value);
  105. }
  106.  
  107. /**
  108.  * Construit le SELECT des différents types d'édition d'un champ
  109.  * Appel de renderOptions()
  110.  * Dans $arr, si la clé commence par "OPTGROUP", on génère une balise <optgroup> au lieu de <option>
  111.  * Cf class.tablefields.php (makeselect, case edition)
  112.  *
  113.  * @param string $value la valeur courante (pour positionner le selected="selected")
  114.  *
  115.  */
  116.  
  117. function makeSelectEdition($value)
  118. {
  119.     $arr array(
  120.         'OPTGROUP-1'=> getlodeltextcontents("edit_in_the_interface""admin"),
  121.             "editable" => getlodeltextcontents("edit_in_form_field""admin"),
  122.             "fckeditor" => getlodeltextcontents("edit_wysiwyg""admin"),
  123.             "wysiwyg_fckeditor" => getlodeltextcontents("edit_wysiwyg_fckeditor""admin"),
  124.             "wysiwyg_spaw" => getlodeltextcontents("edit_wysiwyg_spaw""admin"),
  125.         "ENDOPTGROUP-1"=> "",
  126.         "OPTGROUP-2"=> getlodeltextcontents("no_edit_in_interface_but_import""admin"),
  127.             "importable" => getlodeltextcontents("no_show_in_interface""admin"),
  128.             "display" => getlodeltextcontents("show_in_interface""admin"),
  129.         "ENDOPTGROUP-2"=> "",
  130.         "OPTGROUP-3"=> getlodeltextcontents("no_edit_and_no_import""admin"),
  131.             "none" => getlodeltextcontents("no_show_in_interface""admin"),
  132.         "ENDOPTGROUP-3"=> "",
  133.         "OPTGROUP-4"=> getlodeltextcontents('for_list_only''admin'),
  134.             "select" => getlodeltextcontents("edit_select""admin"),
  135.             "multipleselect" => getlodeltextcontents("edit_multiple_select""admin"),
  136.             "radio" => getlodeltextcontents("edit_radio""admin"),
  137.             "checkbox" => getlodeltextcontents("edit_checkbox""admin"),
  138.         "ENDOPTGROUP-4"=> "");
  139.     renderOptions($arr$value);
  140. }
  141. ?>

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