Source for file DBMS_FIELD_DIRSELECTLIST.phpclass
Documentation is available at DBMS_FIELD_DIRSELECTLIST.phpclass
* Class file DBMS_FIELD_DIRSELECTLIST.phpclass
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* Class DBMS_FIELD_DIRSELECTLIST
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version pk-07-02-25 ajax
// ~~~~~~~~~~~~~~~~~~~~~~~~~~ inherit values ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* source file of the class
* @var string $classSrcFile
// ~~~~~~~~~~~~~~~~~~~~~~~~~~ attributes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* @var string $rootDir the first selectable directory
* rootDir is under documentRoot
* if True root starts at DOCUMENT_ROOT else root starts at Projekt root ($OCSP_CONF['PROJECTPATH']);
* @var boolean $useDocRoot
* @var string $rootDir the defaultDirectory == Default Value
* @var boolean $allow_mkdir (does the form allow the creation of a new directory)
* @var boolean $allow_cd (does the user have the right to change the directory)
* @var boolean $getValue_nochk do not check existance in method getValue()
// ###########################################################
// FIELD DEFINITION DATA METHODS
// ###########################################################
* returns an array of field to bie shown in the edit form
* by using editTbl_echoForm
* the array is in the form:
* [FLDLAB] (complete html code with <td></td>)
* [FLDVAL] (complete html code with <td></td>)
$str_dirSelPopup =
OCSP_CONF::getInstance()->getValue('SYSTEMURL') .
"forms/directory_selectList.php";
$str_dirSelPopup .=
"&fldDom=" .
$str_fldDomId;
$a_ret['DIRSELECT']=
array(
'TITLE'=>
"Dir Settings:",
<input name=\"rootDir\" id=\"{$str_fldDomId}\" value=\"".
$this->rootDir.
"\" size=\"40\" />
alt=\"" .
t_admin("Ordner wählen") .
"\"
onClick=\"popup_window('" .
$str_dirSelPopup .
"&useDocRoot='+ocsp_getRadioValue(document.forms['frmFieldEdit'],'useDocRoot') + '&rootDir=' + document.getElementById('{$str_fldDomId}').value,350,500);\"
'FLDLAB'=>
"Systemsetting",
'FLDVAL'=>
"RootDir ist unter:
<input name=\"useDocRoot\" type=\"radio\" value=\"0\" ".
($this->useDocRoot ?
"" :
"checked=\"checked\"").
" />Projekt Root
<input name=\"useDocRoot\" type=\"radio\" value=\"1\" ".
($this->useDocRoot ?
"checked=\"checked\"" :
"" ).
" />Document Root <br />
'FLDLAB'=>
t_admin("Berechtigungen"),
<input name=\"allow_mkdir\" type=\"checkbox\" value=\"1\" ".
($this->allow_mkdir ?
"checked" :
"").
" />
mkdir (" .
t_admin("Neues Verzeichnis") .
"<br />
<input name=\"allow_cd\" type=\"checkbox\" value=\"1\" ".
($this->allow_cd ?
"checked=\"checked\"" :
"").
" />
" .
t_admin("Verzeichnis wechseln") .
" <br />
<input name=\"getValue_nochk\" type=\"checkbox\" value=\"1\" ".
($this->getValue_nochk ?
"checked=\"checked\"" :
"").
" />
" .
t_admin("Verzeichnis beim speichern prüfen") .
"
* saves the fld definition
//$this->htmlValWithRoot = (intval($_POST['htmlValWithRoot']) ? TRUE : FALSE);
$this->allow_mkdir =
((isset
($_POST['allow_mkdir']) &&
intval($_POST['allow_mkdir'])) ?
TRUE :
FALSE);
$this->allow_cd =
((isset
($_POST['allow_cd']) &&
intval($_POST['allow_cd'])) ?
TRUE :
FALSE);
// --------------------------------------------------------
// --------------------------------------------------------
* returns the base path (DOCUMENTROOT or PROJECT PATH)
* returns the path to $aValue
// --------------------------------------------------------
// --------------------------------------------------------
* returns an array of jOCSP/jQuery Modules which are required
* $arr_ret[]="script url";
* @global array $OCSP_CONF
if ($debug) echoDebugMethod(__FILE__
,get_classe($this),"DBMS_FIELD::jOCSP_getRequiredModules()");
'CLASS' =>
'jOCSP.FLDOBJ_DirectorySelectList',
'SRC' =>
OCSP_OBJ::getConf('SYSTEMURL').
"jOCSP/formFields/jOCSP_FLDOBJ_DirectorySelectList.js"
* returns additional object elements of the field object
* array definition: [elemName] = value
* NOTE: do not js_escapte value this is done when building the json object
$arr_ret['fldClass'] =
"'FLDOBJ_DirectorySelectList'";
if ($debug) $arr_ret['debug'] =
True;
* retuns a js command to change the directory
return "alert('".
t_admin("Sie sind nicht berechtigt") .
"');";
//$str_ret .= "alert('jOCSP_setDIr: " . pcf_js_escape(print_r($request,True)) . "');";
if (isset
($request['toDir']) &&
!empty($request['toDir']) &&
(strtoupper($request['toDir']) !=
"UNDEFINED"))
$str_value =
$request['toDir'];
if (isset
($request['FRMARRAYNAME']) &&
is_array($request[$request['FRMARRAYNAME']]))
if (isset
($request[$request['FRMARRAYNAME']][$this->getName()]))
$str_value =
$request[$request['FRMARRAYNAME']][$this->getName()];
return "alert('" .
t_admin("Fehler") .
": " .
t_admin("Konnte Wert nicht ermitteln") .
"');";
//$str_ret .= "alert('DIR: " . $str_value . "');";
* retuns a js command to change the directory
return "alert('" .
t_admin("Sie sind nicht berechtigt") .
"');";
if (!isset
($request['newDirName']) ||
empty($request['newDirName']))
return "alert('" .
t_admin("Keine Daten") .
"');";
return "alert('" .
t_admin("ungültige Eingabe") .
"');";
if (isset
($request['FRMARRAYNAME']) &&
is_array($request[$request['FRMARRAYNAME']]))
if (isset
($request[$request['FRMARRAYNAME']][$this->getName()]))
$str_value =
$request[$request['FRMARRAYNAME']][$this->getName()];
return "alert('" .
t_admin("Fehler") .
": " .
t_admin("Konnte Wert nicht ermitteln") .
"');";
return "alert('" .
t_admin("ungültiger Pfad") .
"');";
return "alert('" .
t_admin("Verzeichnis nicht gefunden") .
": {$str_dir}');";
return "alert('" .
t_admin("Fehler") .
":" .
t_admin("Konnte Verzeichnis nicht anlegen") .
"');";
* returns the js to reload the select
return "alert('" .
t_admin("ungültiger Pfad") .
"');";
return "alert('" .
t_admin("Verzeichnis nicht gefunden") .
": {$str_dir}');";
if (obj_sel = document.getElementById('{$this->getDOMId()}'))
obj_sel.options.length=0;
$str_ret .=
"obj_sel.options[int_idx++] = new Option('.','{$str_path}',true,true);\n";
foreach($arr_dirList as $str_dir)
$str_ret .=
"obj_sel.options[int_idx++] = new Option('{$str_dir}','{$str_path}{$str_dir}',false,false);\n";
$str_ret .=
"obj_sel.options[int_idx++] = new Option('<-- " .
t_admin('zurück') .
"','" .
dirname($str_path) .
_OCSP_DIRSEP_ .
"',false,false);\n";
} catch(e) {alert('" .
dirname(__FILE__
) .
" L: " . __LINE__ .
"\\n' + e);}
* returns a javascript to be called for reloading the form
* @todo could sometimes not get the controll
if (obj_form = jOCSP.getFormByHash('" .
$this->myControll->jOCSP_getfrmHash() .
"'))
if (obj_field = obj_form.getFieldByDomId('" .
$this->getDOMId() .
"'))
obj_field.setDir(obj_field.getValue());
alert('Feld nicht gefunden');
alert('Formular nicht gefunden');
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
* get the html-code for the option list
* @param string $aValue (selected values)
$str_ret .=
"<option value=\"{$str_path}\">.</option>";
foreach($arr_dirList as $str_dir)
$str_ret .=
"<option value=\"{$str_path}{$str_dir}" .
_OCSP_DIRSEP_ .
"\"";
$str_ret .=
" selected=\"selected\"";
$str_ret .=
">{$str_dir}</option>";
$str_ret .=
"<option value=\"" .
dirname($str_path) .
"/\"><-- " .
t_admin('zurück') .
"</option>";
* returns the innerHTML of the path div
if (obj_form = jOCSP.getFormByHash('" .
$this->myControll->jOCSP_getfrmHash() .
"'))
if (obj_field = obj_form.getFieldByDomId('" .
$this->getDOMId() .
"'))
obj_field.setDir('\$*DIR\$');
alert('Feld nicht gefunden');
alert('Formular nicht gefunden');
foreach($arr_path as $str_dir)
$str_path .=
$str_dir .
"/";
$str_ret .=
"<span onclick=\"" .
str_replace('$*DIR$',$str_path,$str_jsTmpl) .
"\">" .
$str_dir .
"/</span>";
* returns the html code for the select
function getInputTag($aValue,$arrName=
"DBVAL",$debug=
FALSE) {
if ($debug) echo
"<p>Value: ".
$aValue.
"</p>";
<div id=\"{$this->getDOMId()}_DIRPATH\"
style=\"
float:
left\">
" .
$this->getPathDiv($aValue) .
"</div>
width=\"16\" height=\"16\" class=\"button\"
if (obj_form = jOCSP.getFormByHash('" .
$this->myControll->jOCSP_getfrmHash() .
"'))
if (obj_field = obj_form.getFieldByDomId('" .
$this->getDOMId() .
"'))
title=\"" .
t_admin('Neues Verzeichnis anlegen') .
"\"
//$str_ret .= "<br />" . $aValue;
* returns the field value if its an array,
* it is imploded with \n as seperator
* @param string $aValue the value
* @param array $err error array
* @param string $arrName name of the array to access fieldsarray gloabl ${$arrName}
function getValue($aValue,&$err,$arrName=
"DBVAL",$debug=
FALSE) {
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"\$aValue: {$aValue}");
if (empty($aValue)) { // root selected only check if empty is allowed
return parent::getValue($aValue,$err,$arrName,$b_debug); // <pk-07-03-01 />
$err[$this->myName]['MSG'] =
t_admin("Verzeichnis nicht gefunden");
/*** user rights *******************************************/
* returns if the current user can create a new directory
} // end class DBMS_FIELD_ARRSELECTLIST
Documentation generated on Thu, 08 Jan 2009 17:41:23 +0100 by phpDocumentor 1.4.0a2