Source for file DBMS_FIELD_MENUSELECT.phpclass
Documentation is available at DBMS_FIELD_MENUSELECT.phpclass
* Class file DBMS_FIELD_MENUSELECT.phpclass
* @project Open CSP-Management
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: DBMS_FIELD_MENUSELECT.phpclass,v 1.5 2008/06/14 09:50:39 pitlinz Exp $
* Class DBMS_FIELD_MENUSELECT
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: DBMS_FIELD_MENUSELECT.phpclass,v 1.5 2008/06/14 09:50:39 pitlinz Exp $
* source file of the class
* @var string $classSrcFile
* 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>)
$a_ret['COMMON']['FLD_SHOWNULLOPT']=
array(
'FLDLAB'=>
"Wurzel (Null) Anzeigen",
'FLDVAL'=>
"<input name=\"showNullOption\" type=\"checkbox\" value=\"1\" ".
($this->showNullOption ?
"checked=\"checked\"" :
"").
" /> anzeigen
<input type=\"hidden\" name=\"nullToZero\" value=\"1\" />"
$a_ret['DBLOOKUP']['FLD_LUTBL']=
array(
'FLDVAL' =>
"T_CMS_MENU.MEN_ID"
unset
($a_ret['DBLOOKUP']['FLD_VALFLD']);
unset
($a_ret['DBLOOKUP']['TREEROOTKEY']);
unset
($a_ret['DBLOOKUP']['PARENTFIELD']);
$a_ret['DBLOOKUP']['PROJECT']['FLDLAB']=
"Projekt:";
$a_ret['DBLOOKUP']['PROJECT']['FLDVAL']=
'
<select name="projId" size="1">
<option value="-1" '.
(($this->projId == -
1) ?
"selected" :
"").
'>HTTP_GET/DBVAL</option>
<option value="0" '.
(($this->projId ==
0) ?
"selected" :
"").
'>default</option>'.
"\n";
$query=
"SELECT * FROM T_CMS_PROJECT ORDER BY PROJ_ID";
if ($cursor=
$GLOBALS['USRDB']->query($query)) {
while($row=
$cursor->fetchArray()) {
$a_ret['DBLOOKUP']['PROJECT']['FLDVAL'].=
"<option value='".
$row['PROJ_ID'].
"' ";
if ($row['PROJ_ID'] ==
$this->projId) {
$a_ret['DBLOOKUP']['PROJECT']['FLDVAL'].=
"selected";
$a_ret['DBLOOKUP']['PROJECT']['FLDVAL'].=
">".
$row['PROJ_NAME'].
"</option>\n";
$a_ret['DBLOOKUP']['PROJECT']['FLDVAL'].=
"</select>\n";
$a_ret['DBLOOKUP']['LANGUAGE']['FLDLAB']=
"Sprache:";
$a_ret['DBLOOKUP']['LANGUAGE']['FLDVAL']=
'
<select name="langId" size="1">
<option value="-2" '.
(($this->langId == -
2) ?
"selected" :
"").
'>kein Filter</option>
<option value="-1" '.
(($this->langId == -
1) ?
"selected" :
"").
'>HTTP_GET/DBVAL</option>
<option value="0" '.
(($this->langId ==
0) ?
"selected" :
"").
'>default</option>'.
"\n";
$query=
"SELECT * FROM T_SYS_LANGUAGE ORDER BY LANG_NAME";
if ($cursor=
$GLOBALS['USRDB']->query($query)) {
while($row=
$cursor->fetchArray()) {
$a_ret['DBLOOKUP']['LANGUAGE']['FLDVAL'].=
"<option value='".
$row['LANG_ID'].
"' ";
if ($row['LANG_ID'] ==
$this->langId) {
$a_ret['DBLOOKUP']['LANGUAGE']['FLDVAL'].=
"selected";
$a_ret['DBLOOKUP']['LANGUAGE']['FLDVAL'].=
">".
$row['LANG_NAME'].
"</option>\n";
$a_ret['DBLOOKUP']['LANGUAGE']['FLDVAL'].=
"</select>\n";
$this->sortField =
"MEN_SORTORDER";
// ###########################################
* returns the database query
* @global ${$this->myDataArrName}
* @requires pcf_templates.phpinc
* @version pk-07-09-26 bugfix PROJ_ID
* @todo DBMS_FIELD_DBLOOKUPSELECTLIST::getMyValueQuery() remove inline SQL
global $
{$this->myDataArrName};
$str_query =
"SELECT ".
$this->lookupField.
" AS KEYFIELD";
$str_query.=
",(MEN_SHOW AND MEN_SHOWFROM < NOW() AND MEN_SHOWTILL >= NOW()) AS ISTOSHOW";
$str_query.=
$str_whereAnd.
" (";
if (isset
($_GET['PROJ_ID'])) {
$str_query.=
"PROJ_ID=".
intval($_GET['PROJ_ID']).
" OR ";
if (isset
($_POST['PROJ_ID']))
$str_query.=
"PROJ_ID=".
intval($_POST['PROJ_ID']).
" OR ";
$str_query=
substr($str_query,0,-
4).
")";
$str_query.=
" ORDER BY PROJ_ID,MEN_PARENT,MEN_SORTORDER";
$str_query.=
" ORDER BY PROJ_ID,MEN_PARENT,MEN_SORTORDER,".
$this->lookupSort;
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"<strong>myValueQuery:</strong><br /> $str_query");
Documentation generated on Thu, 08 Jan 2009 17:42:26 +0100 by phpDocumentor 1.4.0a2