Source for file DBMS_FIELD_DIRSELECTLIST.phpclass

Documentation is available at DBMS_FIELD_DIRSELECTLIST.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_DIRSELECTLIST.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    dbms_field
  7.   * @category   string
  8.   *
  9.   * @author     Peter Krebs <pitlinz@users.sourceforge.net>
  10.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  11.   *
  12.   ***/
  13.  
  14. pcf_require_class('DBMS_FIELD_SELECTLIST',dirname(__FILE__."/");
  15. pcf_require_class('OCSP_DIRECTORY',"common/");
  16.  
  17. /**
  18.   * Class DBMS_FIELD_DIRSELECTLIST
  19.   *
  20.   * handles directories
  21.   *
  22.   * @project    Open CSP-Management
  23.   * @package    dbms_field
  24.   * @category   string
  25.   *
  26.   * @author     Peter Krebs <pitlinz@users.sourceforge.net>
  27.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  28.   *
  29.   * @version pk-07-02-25 ajax
  30.   *
  31.   ***/
  32.     
  33.     // ~~~~~~~~~~~~~~~~~~~~~~~~~~ inherit values ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  34.     var $className       = "DirListSelect";
  35.     var $allowNullSelect = FALSE;
  36.     
  37.     /**
  38.       * source file of the class
  39.       *
  40.       * @var string $classSrcFile 
  41.       ***/
  42.     protected $classSrcFile=__FILE__;
  43.     
  44.     // ~~~~~~~~~~~~~~~~~~~~~~~~~~ attributes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  45.     
  46.     /**
  47.       * @var string $rootDir the first selectable directory
  48.       * @access protected
  49.       ***/
  50.     protected $rootDir         = "";
  51.     
  52.     /**
  53.       * rootDir is under documentRoot
  54.       * if True root starts at DOCUMENT_ROOT else root starts at Projekt root ($OCSP_CONF['PROJECTPATH']);
  55.       * @var boolean $useDocRoot 
  56.       * @access protected
  57.       ***/
  58.     protected $useDocRoot     = FALSE;    
  59.     
  60.     /**
  61.       * @var string $rootDir the defaultDirectory == Default Value
  62.       * @access protected
  63.       ***/
  64.     protected $defaultDir      = "";
  65.  
  66.     /**
  67.       * @var boolean $allow_mkdir (does the form allow the creation of a new directory)
  68.       * @access protected
  69.       */
  70.     protected $allow_mkdirTRUE;
  71.  
  72.     /**
  73.       * @var boolean $allow_cd (does the user have the right to change the directory)
  74.       * @access protected
  75.       */
  76.     protected $allow_cd=TRUE;
  77.     
  78.     /**
  79.       * @var boolean $getValue_nochk do not check existance in method getValue()
  80.       * @access protected
  81.       ***/
  82.     protected $getValue_nochk = FALSE;
  83.  
  84.  
  85.     // ###########################################################
  86.     // FIELD DEFINITION DATA METHODS
  87.     // ###########################################################
  88.  
  89.     /**
  90.       * returns an array of field to bie shown in the edit form
  91.       * by using editTbl_echoForm
  92.       *
  93.       * the array is in the form:
  94.       *
  95.       * <code>
  96.       * [_sectionName_]
  97.       *      [TITLE] -> string
  98.       *      [_rowName_]
  99.       *         [FLDLAB]  (complete html code with <td></td>)
  100.       *         [FLDVAL] (complete html code with <td></td>)
  101.       * </code>
  102.       *
  103.       * @param boolean $debug 
  104.       *
  105.       * @global $OCSP_CONF 
  106.       *
  107.       * @returns array
  108.       *
  109.       * @since pk-07-03-01
  110.       *
  111.       ***/
  112.     function editTbl_getFieldEditArr($debug=FALSE{        
  113.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_DBSELECTLIST::editTbl_getFieldEditArr","",0);
  114.         $a_ret=parent::editTbl_getFieldEditArr($debug);
  115.  
  116.         unset($a_ret['SELECT']);
  117.  
  118.         $str_dirSelPopup OCSP_CONF::getInstance()->getValue('SYSTEMURL'"forms/directory_selectList.php";
  119.         $arr_sec array(
  120.             'USER'     => OCSP_OBJ::currentUser(True)->getId(),
  121.             'GROUP'    => _OCSP_GROUP_DBMS_
  122.         );
  123.         $str_dirSelPopup .= "?SecReq=" OCSP_SESSION::getInstance()->encrypt(serialize($arr_sec));
  124.         $str_fldDomId "rootDir_" md5($this->getMyForm()->getId($this->getName())
  125.         $str_dirSelPopup .= "&fldDom=" $str_fldDomId
  126.         
  127.         
  128.         $a_ret['DIRSELECT']=array(
  129.             'TITLE'=>"Dir Settings:",
  130.             'FLD_ROOTDIR'=>array(
  131.                 'FLDLAB'=>"ROOT DIR",
  132.                 'FLDVAL'=>"
  133.                 <input name=\"rootDir\" id=\"{$str_fldDomId}\" value=\"".$this->rootDir."\" size=\"40\" />
  134.                 <img
  135.                     src=\"" OCSP_CONF::getInstance()->getValue('SYSIMGURL'"icons-16x16/folderopen.gif\"
  136.                     alt=\"" t_admin("Ordner w&auml;hlen"."\"
  137.                     class=\"button\"
  138.                     onClick=\"popup_window('" $str_dirSelPopup ."&useDocRoot='+ocsp_getRadioValue(document.forms['frmFieldEdit'],'useDocRoot') + '&rootDir=' + document.getElementById('{$str_fldDomId}').value,350,500);\"
  139.                 />
  140.                 "
  141.                 ),
  142.             'FLD_RDSETTINGS'=>array(
  143.                 'FLDLAB'=>"Systemsetting",
  144.                 'FLDVAL'=>"RootDir ist unter:
  145.                         <input name=\"useDocRoot\" type=\"radio\" value=\"0\" ".($this->useDocRoot ? "" "checked=\"checked\"")." />Projekt Root
  146.                         <input name=\"useDocRoot\" type=\"radio\" value=\"1\" ".($this->useDocRoot ? "checked=\"checked\"" "" )." />Document Root <br />
  147.                     "
  148.                 ),
  149.             'FLD_RIGHTS'=>array(
  150.                 'FLDLAB'=>t_admin("Berechtigungen"),
  151.                 'FLDVAL'=>"
  152.                         <input name=\"allow_mkdir\" type=\"checkbox\" value=\"1\" ".($this->allow_mkdir ? "checked" "")." />
  153.                         mkdir (" t_admin("Neues Verzeichnis""<br />
  154.                         <input name=\"allow_cd\" type=\"checkbox\" value=\"1\" ".($this->allow_cd ? "checked=\"checked\"" "")." />
  155.                         " t_admin("Verzeichnis wechseln"." <br />
  156.                         <input name=\"getValue_nochk\" type=\"checkbox\" value=\"1\" ".($this->getValue_nochk ? "checked=\"checked\"" "")." />
  157.                         " t_admin("Verzeichnis beim speichern pr&uuml;fen""
  158.                     "
  159.                 ),
  160.         );
  161.         return $a_ret;
  162.     }
  163.  
  164.  
  165.     /**
  166.       * saves the fld definition
  167.       *
  168.       * @global $OCSP_CONF 
  169.       *
  170.       * @return bool 
  171.       *
  172.       ***/
  173.     function save({
  174.         global $OCSP_CONF;
  175.         
  176.         $ret parent::save();
  177.         $this->allowNullSelect  =$this->allowNull();
  178.         
  179.         $this->rootDir          =trim($_POST['rootDir']);
  180.         if (!empty($this->rootDir))
  181.         {
  182.             if (substr($this->rootDir,-1!= _OCSP_DIRSEP_$this->rootDir.=_OCSP_DIRSEP_;
  183.             if (substr($this->rootDir,0,1== _OCSP_DIRSEP_$this->rootDir=substr($this->rootDir,1);
  184.         }
  185.         
  186.         //$this->htmlValWithRoot = (intval($_POST['htmlValWithRoot']) ? TRUE : FALSE);
  187.         $this->useDocRoot      = (intval($_POST['useDocRoot']TRUE FALSE);
  188.         $this->getValue_nochk  = (intval($_POST['getValue_nochk']TRUE FALSE);
  189.         
  190.         if (!OCSP_DIRECTORY::isDir($this->getBasePath($this->rootDir))
  191.         {
  192.             pcf_js_alert(t_admin("Fehler:"" " $this->getBasePath($this->rootDir . " " t_admin('existiert nicht'));
  193.             return False;            
  194.         }
  195.         
  196.         $this->allow_mkdir = ((isset($_POST['allow_mkdir']&& intval($_POST['allow_mkdir'])) TRUE FALSE);
  197.         $this->allow_cd    = ((isset($_POST['allow_cd']&& intval($_POST['allow_cd'])) TRUE FALSE);
  198.         
  199.         return $ret;
  200.     }
  201.  
  202.     // --------------------------------------------------------
  203.     // directory method
  204.     // --------------------------------------------------------
  205.        
  206.     /**
  207.      * returns the base path (DOCUMENTROOT or PROJECT PATH)
  208.      *
  209.      * @return string 
  210.      */
  211.     protected function getBasePath()
  212.     {
  213.         return ($this->useDocRoot ? $_SERVER['DOCUMENT_ROOT'_OCSP_DIRSEP_ OCSP_OBJ::getConf('PROJECTPATH'));
  214.     }    
  215.  
  216.     /**
  217.      * returns the path to $aValue
  218.      *
  219.      * @param string $aValue 
  220.      * 
  221.      * @return string 
  222.      */
  223.     protected function getCurPath($aValue)
  224.     {
  225.         if (empty($aValue))
  226.         {
  227.             return $this->getBasePath($this->rootDir;
  228.         else {
  229.             if (substr($aValue,0,1== _OCSP_DIRSEP_)
  230.             {
  231.                 $aValue substr($aValue,1);
  232.             }
  233.             if (substr($aValue,-1!= _OCSP_DIRSEP_)
  234.             {
  235.                 $aValue .= _OCSP_DIRSEP_;
  236.             }
  237.             return $this->getBasePath($aValue;
  238.         }
  239.     }
  240.     
  241.     
  242.  
  243.     // --------------------------------------------------------
  244.     // jOCSP
  245.     // --------------------------------------------------------
  246.  
  247.     /**
  248.      * returns an array of jOCSP/jQuery Modules which are required
  249.      * 
  250.      * $arr_ret[]="script url";
  251.      *
  252.      * @param boolean $debug 
  253.      * 
  254.      * @global array $OCSP_CONF 
  255.      * 
  256.      * @return string 
  257.      */
  258.     public function jOCSP_getRequiredModules($debug=FALSE)
  259.     {        
  260.         if ($debugechoDebugMethod(__FILE__,get_classe($this),"DBMS_FIELD::jOCSP_getRequiredModules()");
  261.         
  262.         $arr_ret parent::jOCSP_getRequiredModules($debug);
  263.         $arr_ret[array(
  264.             'CLASS'    => 'jOCSP.FLDOBJ_DirectorySelectList',
  265.             'SRC'     => OCSP_OBJ::getConf('SYSTEMURL')."jOCSP/formFields/jOCSP_FLDOBJ_DirectorySelectList.js"
  266.         );
  267.                
  268.         return $arr_ret;
  269.     }    
  270.     
  271.     
  272.    /**
  273.      * returns additional object elements of the field object
  274.      * 
  275.      * array definition: [elemName] = value
  276.      * 
  277.      * NOTE: do not js_escapte value this is done when building the json object
  278.      *
  279.      * @param boolean $debug 
  280.      * 
  281.      * @return array 
  282.      * 
  283.      * @since pk-08-11-03
  284.      */
  285.     protected function jOCSP_getAdditonalFieldObjElems($debug=False)
  286.     {  
  287.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_DIRSELECT::jOCSP_getAdditonalFieldObjElems()");
  288.         $arr_ret parent::jOCSP_getAdditonalFieldObjElems($debug);        
  289.         $arr_ret['fldClass'"'FLDOBJ_DirectorySelectList'";        
  290.         if ($debug$arr_ret['debug'True;
  291.                 
  292.         return $arr_ret;          
  293.     }    
  294.  
  295.     /**
  296.      * retuns a js command to change the directory
  297.      * 
  298.      * @param array $request 
  299.      * @param boolean $debug 
  300.      * 
  301.      * @return string (js)
  302.      */
  303.     public function jOCSP_setDir($request,$debug=False)
  304.     {
  305.         if (!$this->allow_cd)
  306.         {
  307.             return "alert('"t_admin("Sie sind nicht berechtigt""');";
  308.         }
  309.         $str_ret "";
  310.         //$str_ret .= "alert('jOCSP_setDIr: " . pcf_js_escape(print_r($request,True)) . "');";
  311.         
  312.         if (isset($request['toDir']&& !empty($request['toDir']&& (strtoupper($request['toDir']!= "UNDEFINED"))
  313.         {
  314.             $str_value $request['toDir'];
  315.         else {
  316.             if (isset($request['FRMARRAYNAME']&& is_array($request[$request['FRMARRAYNAME']]))
  317.             {
  318.                 if (isset($request[$request['FRMARRAYNAME']][$this->getName()]))
  319.                 {
  320.                     $str_value $request[$request['FRMARRAYNAME']][$this->getName()];
  321.                 else {
  322.                     $str_value "";
  323.                 }
  324.             else {
  325.                 return "alert('" t_admin("Fehler"": " t_admin("Konnte Wert nicht ermitteln""');";
  326.             }
  327.         }
  328.         
  329.         $str_ret .= $this->jOCSP_reloadDirSel($str_value,$debug);
  330.         //$str_ret .= "alert('DIR: " . $str_value . "');";
  331.  
  332.         return $str_ret;
  333.     }
  334.     
  335.    /**
  336.      * retuns a js command to change the directory
  337.      * 
  338.      * @param array $request 
  339.      * @param boolean $debug 
  340.      * 
  341.      * @return string (js)
  342.      */
  343.     public function jOCSP_addDir($request,$debug=False)
  344.     {    
  345.         if (!$this->userCanMkDir())
  346.         {
  347.             return "alert('" t_admin("Sie sind nicht berechtigt""');";    
  348.         }
  349.         
  350.         if (!isset($request['newDirName']|| empty($request['newDirName']))
  351.         {
  352.             return "alert('" t_admin("Keine Daten""');";
  353.         }
  354.         
  355.         if (!($str_newDir OCSP_DIRECTORY::checkDirName($request['newDirName'],_OCSP_DIRSEP_,0,$debug)))
  356.         {
  357.             return "alert('" t_admin("ungültige Eingabe""');";
  358.         }
  359.         
  360.            if (isset($request['FRMARRAYNAME']&& is_array($request[$request['FRMARRAYNAME']]))
  361.            {
  362.                if (isset($request[$request['FRMARRAYNAME']][$this->getName()]))
  363.                {
  364.                    $str_value $request[$request['FRMARRAYNAME']][$this->getName()];
  365.                else {
  366.                     $str_value "";
  367.                }
  368.            else {
  369.                return "alert('" t_admin("Fehler"": " t_admin("Konnte Wert nicht ermitteln""');";
  370.            }        
  371.  
  372.         $str_dir $this->getCurPath($str_value);
  373.         
  374.         if (!empty($this->rootDir&& (!strstr($str_dir,$this->rootDir)))
  375.         {
  376.             return "alert('" t_admin("ungültiger Pfad""');";
  377.         }
  378.         
  379.         if (!OCSP_DIRECTORY::isDir($str_dir))
  380.         {
  381.             return "alert('" t_admin("Verzeichnis nicht gefunden"": {$str_dir}');";
  382.         }        
  383.         
  384.         $str_dir .= $str_newDir._OCSP_DIRSEP_;
  385.         
  386.         if (!OCSP_DIRECTORY::checkDir($str_dir,True))
  387.         {
  388.             return "alert('" t_admin("Fehler"":" t_admin("Konnte Verzeichnis nicht anlegen""');";
  389.         }
  390.                 
  391.         $str_path str_replace($this->getBasePath(),"",$str_dir);
  392.         return $this->jOCSP_reloadDirSel($str_path,$debug);
  393.                    
  394.     }    
  395.     
  396.     /**
  397.      * returns the js to reload the select
  398.      *
  399.      * @param string $aValue 
  400.      * @param boolean $debug 
  401.      * 
  402.      * @return string (js)
  403.      */
  404.     public function jOCSP_reloadDirSel($aValue,$debug=False)
  405.     {
  406.         $str_dir $this->getCurPath($aValue);
  407.         if (!empty($this->rootDir&& (!strstr($str_dir,$this->rootDir)))
  408.         {
  409.             return "alert('" t_admin("ungültiger Pfad""');";
  410.         }
  411.         
  412.         if (!OCSP_DIRECTORY::isDir($str_dir))
  413.         {
  414.             return "alert('" t_admin("Verzeichnis nicht gefunden"": {$str_dir}');";
  415.         }        
  416.         $str_ret "
  417.             try {
  418.                 document.getElementById('{$this->getDOMId()}_DIRPATH').innerHTML=\"pcf_js_escape($this->getPathDiv($aValue)) "\";
  419.                 if (obj_sel = document.getElementById('{$this->getDOMId()}'))
  420.                 {
  421.                     obj_sel.options.length=0;                    
  422.                     int_idx = 0;
  423.                     ";
  424.         $str_path str_replace($this->getBasePath(),"",$str_dir);        
  425.         $str_ret .= "obj_sel.options[int_idx++] = new Option('.','{$str_path}',true,true);\n";
  426.         
  427.         if ($arr_dirList OCSP_DIRECTORY::getDirList($str_dir,"DL"))
  428.         {
  429.             foreach($arr_dirList as $str_dir)
  430.             {
  431.                 $str_ret .= "obj_sel.options[int_idx++] = new Option('{$str_dir}','{$str_path}{$str_dir}',false,false);\n";
  432.             }
  433.         }
  434.         
  435.         if ($str_path != $this->rootDir)
  436.         {
  437.             $str_ret .= "obj_sel.options[int_idx++] = new Option('<-- " t_admin('zurück'"','" dirname($str_path_OCSP_DIRSEP_ ."',false,false);\n";
  438.         }        
  439.         
  440.         $str_ret .= "
  441.                 }
  442.             } catch(e) {alert('" dirname(__FILE__" L: " . __LINE__ . "\\n' + e);}
  443.             ";
  444.         return $str_ret;        
  445.     }
  446.         
  447.        /**
  448.      * returns a javascript to be called for reloading the form
  449.      *
  450.      * @param boolean $debug 
  451.      * 
  452.      * @return string 
  453.      * 
  454.      * @todo could sometimes not get the controll
  455.      */
  456.     public function jOCSP_getSetDirScript($debug=False)
  457.     {    
  458.         if ($this->allow_cd)
  459.         {
  460.             $str_jsReload="
  461.                 if (obj_form = jOCSP.getFormByHash('" $this->myControll->jOCSP_getfrmHash("')) 
  462.                 {
  463.                     if (obj_field = obj_form.getFieldByDomId('" $this->getDOMId("')) 
  464.                     {
  465.                         obj_field.setDir(obj_field.getValue());
  466.                     } else { 
  467.                         alert('Feld nicht gefunden');
  468.                     }
  469.                 } else { 
  470.                     alert('Formular nicht gefunden');
  471.                 }            
  472.             ";         
  473.             return $str_jsReload;
  474.         else {
  475.             return "";
  476.         }
  477.     }
  478.     
  479.     // -------------------------------------------------------------------------
  480.     // IO methods
  481.     // -------------------------------------------------------------------------
  482.  
  483.  
  484.     /**
  485.       * get the html-code for the option list
  486.       *
  487.       * @param string $aValue (selected values)
  488.       *
  489.       * @return string 
  490.       * @version pk-08-11-04
  491.       */
  492.     function getOptionList($aValue{
  493.         
  494.         $str_path str_replace($this->getBasePath(),"",$this->getCurPath($aValue));        
  495.         $str_ret .= "<option value=\"{$str_path}\">.</option>";
  496.         
  497.         if ($arr_dirList OCSP_DIRECTORY::getDirList($this->getCurPath($aValue),"DL"))
  498.         {
  499.             foreach($arr_dirList as $str_dir)
  500.             {
  501.                 $str_ret .= "<option value=\"{$str_path}{$str_dir}_OCSP_DIRSEP_ "\"";
  502.                 if (basename($aValue== $str_dir)
  503.                 {
  504.                     $str_ret .= " selected=\"selected\"";
  505.                 }
  506.                 $str_ret .= ">{$str_dir}</option>";
  507.             }
  508.         }
  509.         
  510.         if ($str_path != $this->rootDir)
  511.         {
  512.             $str_ret .= "<option value=\"" dirname($str_path"/\">&lt;-- " t_admin('zurück'"</option>";
  513.         }
  514.         
  515.         return $str_ret;
  516.     }
  517.  
  518.     /**
  519.      * returns the innerHTML of the path div
  520.      *
  521.      * @param string $aValue 
  522.      * 
  523.      * @return string (html)
  524.      */
  525.     function getPathDiv($aValue)
  526.     {
  527.         $str_jsTmpl "
  528.                 if (obj_form = jOCSP.getFormByHash('" $this->myControll->jOCSP_getfrmHash("')) 
  529.                 {
  530.                     if (obj_field = obj_form.getFieldByDomId('" $this->getDOMId("')) 
  531.                     {
  532.                         obj_field.setDir('\$*DIR\$');
  533.                     } else { 
  534.                         alert('Feld nicht gefunden');
  535.                     }
  536.                 } else { 
  537.                     alert('Formular nicht gefunden');
  538.                 }        
  539.             ";
  540.         
  541.         $str_ret "<span onclick=\"" str_replace('$*DIR$',$this->rootDir,$str_jsTmpl"\">/" $this->rootDir . "</span>";
  542.         
  543.         $str_path=$this->rootDir;
  544.         
  545.         if ($arr_path explode("/",str_replace($this->rootDir,"",$aValue)))
  546.         {
  547.             foreach($arr_path as $str_dir)
  548.             {
  549.                 if (!empty($str_dir))
  550.                 {
  551.                     $str_path .= $str_dir "/";
  552.                     $str_ret .= "<span onclick=\"" str_replace('$*DIR$',$str_path,$str_jsTmpl"\">" $str_dir "/</span>";
  553.                 }
  554.             }
  555.             
  556.         }
  557.  
  558.         return $str_ret;
  559.     }
  560.     
  561.     /**
  562.       * returns the html code for the select
  563.       *
  564.       * @param string $aValue 
  565.       * @param string $arrName 
  566.       * @param boolean $debug 
  567.       *
  568.       * @returns string
  569.       *
  570.       ***/
  571.     function getInputTag($aValue,$arrName="DBVAL",$debug=FALSE{
  572.         
  573.         $debug=($debug || $this->fldDebug);
  574.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_DIRSELECTLIST::getInputTag()","Value=$aValue");
  575.         
  576.         if ($debugecho "<p>Value: ".$aValue."</p>";
  577.  
  578.        
  579.         
  580.         $str_ret "
  581.             <div id=\"{$this->getDOMId()}_DIRPATH\" style=\"float:left\">$this->getPathDiv($aValue"</div>
  582.             <select name=\"".$arrName."[".$this->myName."]\" id=\"{$this->getDOMId()}\" onchange=\"$this->jOCSP_getSetDirScript("\">
  583.             ";
  584.         $str_ret .= $this->getOptionList($aValue)
  585.         $str_ret .= ";                
  586.             </select>
  587.           ";
  588.  
  589.         if ($this->userCanMkDir())
  590.         {
  591.             $str_ret .= "<img 
  592.                 src=\"" OCSP_CONF::getInstance()->getValue('SYSIMGURL'"/famfamfam/silk/folder_add.png\" 
  593.                 width=\"16\" height=\"16\" class=\"button\"
  594.                 onclick=\"
  595.                     if (obj_form = jOCSP.getFormByHash('" $this->myControll->jOCSP_getfrmHash("')) 
  596.                     {
  597.                         if (obj_field = obj_form.getFieldByDomId('" $this->getDOMId("')) 
  598.                         {
  599.                             obj_field.addDir();
  600.                         }
  601.                     }    
  602.                 \"
  603.                 title=\"" t_admin('Neues Verzeichnis anlegen'"\" 
  604.                 />";
  605.                 
  606.         }
  607.         
  608.         //$str_ret .= "<br />" . $aValue;
  609.         
  610.         return $str_ret;
  611.     }
  612.  
  613.     /**
  614.       * returns the field value if its an array,
  615.       * it is imploded with \n as seperator
  616.       *
  617.       * @param  string  $aValue     the value
  618.       * @param  array   $err        error array
  619.       * @param  string  $arrName    name of the array to access fieldsarray  gloabl ${$arrName}
  620.       * @param  bool    $debug 
  621.       *
  622.       * @return string 
  623.       *
  624.       * @version pk-04-08-19
  625.       * @version pk-05-06-24
  626.       * @version pk-07-03-01
  627.       *
  628.       ***/
  629.     function getValue($aValue,&$err,$arrName="DBVAL",$debug=FALSE{
  630.         require_once __OCSP_PHPINCPATH__."/common/pcf_directory.phpinc";
  631.         $b_debug=($debug || $this->fldDebug || $this->fldDbgGetValue);
  632.                 
  633.         if ($b_debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_DIRSELECTLIST::getValue($aValue)");;
  634.  
  635.         if ($aValue == $this->rootDir)
  636.         {
  637.             $aValue "";
  638.         
  639.  
  640.         if ($debugechoDebugLine(__FILE__,__LINE__,"\$aValue: {$aValue}");
  641.                 
  642.         if (empty($aValue)) // root selected only check if empty is allowed
  643.             return parent::getValue($aValue,$err,$arrName,$b_debug)// <pk-07-03-01 />
  644.         }
  645.  
  646.  
  647.         
  648.         if ($this->getValue_nochk{
  649.             return $aValue;
  650.         }
  651.  
  652.         $str_path $this->getCurPath($aValue);
  653.         if (OCSP_DIRECTORY::isDir($str_path))
  654.         {
  655.             return $aValue;
  656.         else {
  657.             $err['ERROR']=True;
  658.             $err[$this->myName]['MSG']     t_admin("Verzeichnis nicht gefunden");
  659.             $err[$this->myName]['LABEL']$this->label;
  660.             return False;
  661.         }        
  662.     }
  663.  
  664.     /*** user rights *******************************************/
  665.     
  666.     /**
  667.      * returns if the current user can create a new directory
  668.      * @param boolean $debug 
  669.      * 
  670.      * @since pk-07-11-04
  671.      */
  672.     function userCanMkDir($debug=False)
  673.     {
  674.         return $this->allow_mkdir;
  675.     }
  676.     
  677.     
  678.     
  679. // end class DBMS_FIELD_ARRSELECTLIST
  680. ?>

Documentation generated on Thu, 08 Jan 2009 17:41:23 +0100 by phpDocumentor 1.4.0a2