Source for file DBMS_FIELD_PRO_AUDIENCE.phpclass
Documentation is available at DBMS_FIELD_PRO_AUDIENCE.phpclass
* Class file DBMS_FIELD_PRO_AUDIENCE.phpclass
* @project Open CSP-Management
* @author Peter Krebs <p.krebs@lvus.at>
* @copyright © 2002-2005 by Peter Krebs and Landesverlag Unternehmensservice
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
if (empty($GLOBALS['OCSP']['PHPFORMPATH'])) $GLOBALS['OCSP']['PHPFORMPATH']=
dirname(__FILE__
).
"/";
require_once dirname(__FILE__
).
"/DBMS_FIELD_DBLOOKUPSELECTLIST.phpclass";
* Class DBMS_FIELD_PRO_AUDIENCE
* handels audience (T_AUDIENCE) select fields
* @project Open CSP-Management
* @author Peter Krebs <p.krebs@wpus.at>
* @copyright © 2002-2005 by Peter Krebs and Landesverlag Unternehmensservice
* @copyright © 2005-2006 by Peter Krebs and WURM & Partner Unternehmensservice
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
// ###########################################################
// OBJECT (CONST) VAR DECLARATION
// ###########################################################
// ###########################################################
// OBJECT SETTINGS METHODS
// ###########################################################
* echos the filed definition form
* @param boolean $showSize
* @param boolean $showDBFields
function editTblForm($showSize=
FALSE,$showDBFields=
FALSE) {
parent::editTblForm($showSize,$showDBFields);
* save the filed definition form
$this->popUp_frmId =
(intval($_POST['popUp_frmId']));
$this->popUp_width =
(intval($_POST['popUp_width']));
$this->popUp_height =
(intval($_POST['popUp_height']));
// ###########################################################
// ###########################################################
// ###########################################################
// OBJECT HTML FORM METHODS
// ###########################################################
* return a javascript code sequence to popup a input or edit dialog
* if $selName isset this is used instead of $this->myName
* if $mode is different from FRM_MODE_NEW the popup must get
* the value through javascript
* see $GLOBALS['OCSP']['SYSTEMURL']."forms/popup_form.php" for details
* if !empty $setMethod popup_form.php calls this method after adding
* the option instead of selecting the option
* @param string $selName since 06-02-10 (name of the select element
* @param string $setMethod
function getPopupLinkJs($mode=
FRM_MODE_NEW,$selName=
"",$setMethod=
"",$debug=
FALSE) {
if ($debug) echo
"<p><b>DBMS_FIELD_DBLOOKUPSELECTLIST::getPopupLinkJs(...)</b> (".
get_class($this).
"/".
$this->myName.
")</p>";
$s_url=
$GLOBALS['OCSP']['SYSTEMURL'].
"forms/popup_form.php?";
$a_args['FRMID'] =
$this->popUp_frmId;
$a_args['FRMMODE'] =
$mode;
$a_args['ARRFLD'] =
$this->myName;
$a_args['SELFLD'] =
(empty($selName) ?
$this->myName :
$selName);
$a_args['SETMETHOD']=
$setMethod;
require_once $GLOBALS['PHPINCPATH'].
"common/pcf_md5.phpinc";
$s_jCmd =
"var url_".
$this->myName.
"='".
$s_url.
"';\n";
$s_jCmd.=
"var opt_".
$this->myName.
"='width=".
$this->popUp_width.
",height=".
$this->popUp_height.
",toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes';\n";
$s_jCmd.=
"hWnd_".
$this->myName.
".focus();\n";
if ($debug) echo
"<blockquote><pre>".
htmlspecialchars($s_jCmd).
"</pre></blockquote>";
* returns the html option list of all elements in $aValArr
* @version pk-06-04-29 no empty values in list
foreach($aValArr as $m_key) {
if (!empty($m_key)) { // <pk-06-04-29 />
* returns the html option list of all elements in $aValArr
* @version pk-06-04-29 no empty values in list
foreach($aValArr as $m_key) {
// remove selected form list
unset
($a_allValues[$m_key]);
foreach($a_allValues as $m_key =>
$s_label) {
if (!empty($m_key)) { // <pk-06-04-29 />
$s_ret.=
"\t<option value=\"".
$m_key.
"\">".
htmlspecialchars($s_label).
"</option>\n";
* returns the html code for the select
* @version pk-06-02-06 popUp_frmId
* @version pk-06-04-29 layout
function getInputTag($aValue,$arrName=
"DBVAL",$debug=
FALSE) {
// set empty array to avoid errors
$ret =
"<input type=\"hidden\" name=\"".
$arrName.
"[".
$this->myName.
"]\" value=\"$s_valStr\">";
$s_eNamePart=
$arrName.
"[".
$this->myName;
<script language=\"javascript\" type=\"text/javascript\">
function sel_".
$arrName.
"_".
$this->myName.
"_addAll() {
elemOut=findElement(frmObj,'".
$s_eNamePart.
"_outList]');
elemIn =findElement(frmObj,'".
$s_eNamePart.
"_inList]');
if ((elemOut) && (elemIn)) {
while(i < elemOut.length) { // copy the fields from Out to In
nOpt_".
$arrName.
"_".
$this->myName.
"(elemOut[i].value,elemOut[i].text);
elemIn[elemIn.length]=new Option(elemOut[i].text,elemOut[i].value,false,false);
while(elemOut.length) elemOut[0]=null; // clear Out
function sel_".
$arrName.
"_".
$this->myName.
"_add() {
elemOut=findElement(frmObj,'".
$s_eNamePart.
"_outList]');
elemIn =findElement(frmObj,'".
$s_eNamePart.
"_inList]');
if ((elemOut) && (elemIn) && (elemOut.selectedIndex)) {
// alert(elemOut[elemOut.selectedIndex].value+'::'+elemOut[elemOut.selectedIndex].text);
nOpt_".
$arrName.
"_".
$this->myName.
"(elemOut[elemOut.selectedIndex].value,elemOut[elemOut.selectedIndex].text);
elemIn[elemIn.length]=new Option(elemOut[elemOut.selectedIndex].text,elemOut[elemOut.selectedIndex].value,false,false);
elemOut[elemOut.selectedIndex]=null;
function sel_".
$arrName.
"_".
$this->myName.
"_remove() {
elemOut=findElement(frmObj,'".
$s_eNamePart.
"_outList]');
elemIn =findElement(frmObj,'".
$s_eNamePart.
"_inList]');
if ((elemOut) && (elemIn) && (elemIn.selectedIndex)) {
// alert(elemIn[elemIn.selectedIndex].value+'::'+elemIn[elemIn.selectedIndex].text);
elemOut[elemOut.length]=new Option(elemIn[elemIn.selectedIndex].text,elemIn[elemIn.selectedIndex].value,false,false);
elemIn[elemIn.selectedIndex]=null;
sel_".
$arrName.
"_".
$this->myName.
"_updateHidden()
function sel_".
$arrName.
"_".
$this->myName.
"_removeAll() {
elemOut=findElement(frmObj,'".
$s_eNamePart.
"_outList]');
elemIn =findElement(frmObj,'".
$s_eNamePart.
"_inList]');
if ((elemOut) && (elemIn)) {
while(i < elemIn.length) {
elemOut[elemOut.length]=new Option(elemIn[i].text,elemIn[i].value,false,false);
while(i < elemOut.length) elemOut[i++]=null; // clear Out
setElemValByName(frmObj,'".
$s_eNamePart.
"]','');
function sel_".
$arrName.
"_".
$this->myName.
"_updateHidden() {
elemIn =findElement(frmObj,'".
$s_eNamePart.
"_inList]');
elemVal=findElement(frmObj,'".
$s_eNamePart.
"]');
while(i < elemIn.length) {
values=values+sep+elemIn[i++].value;
setElemValByName(frmObj,'".
$s_eNamePart.
"]',values);
function nOpt_".
$arrName.
"_".
$this->myName.
"(key,label) {
if (elem=findElement(frmObj,'".
$s_eNamePart.
"]')) {
elem.value=elem.value+','+key;
$ret.=
"<table border=\"0\" class=\"frmSelInOut\">"; // <pk-06-04-29 /> align=center removed
$ret.=
"<tr><td width=\"45%\" align=\"center\">gewählt</td><td width=\"10%\"><td width=\"45%\" align=\"center\">verfügbar</td></tr>";
$ret.=
"<td width=\"45%\" align=\"center\">";
$ret.=
"<td valign=\"middle\" width=\"10%\" align=\"center\">";
$ret.=
"<a href=\"javascript:{sel_".
$arrName.
"_".
$this->myName.
"_addAll()}\">\n";
$ret.=
"\t\t<img src=\"".
$GLOBALS['PROJECT']['SYSIMGURL'].
"icons-16x16/2leftarrow.gif\" border=\"0\" alt=\"alle Eifügen\" align=\"middle\" class=\"button\"></a><br />";
$ret.=
"<a href=\"javascript:{sel_".
$arrName.
"_".
$this->myName.
"_add()}\">\n";
$ret.=
"\t\t<img src=\"".
$GLOBALS['PROJECT']['SYSIMGURL'].
"icons-16x16/1leftarrow.gif\" border=\"0\" alt=\"gewählte Eifügen\" align=\"middle\" class=\"button\"></a><br />";
$ret.=
"<a href=\"javascript:{sel_".
$arrName.
"_".
$this->myName.
"_remove()}\">\n";
$ret.=
"\t\t<img src=\"".
$GLOBALS['PROJECT']['SYSIMGURL'].
"icons-16x16/1rightarrow.gif\" border=\"0\" alt=\"gewählte Entfernen\" align=\"middle\" class=\"button\"></a><br />";
$ret.=
"<a href=\"javascript:{sel_".
$arrName.
"_".
$this->myName.
"_removeAll()}\">\n";
$ret.=
"\t\t<img src=\"".
$GLOBALS['PROJECT']['SYSIMGURL'].
"icons-16x16/2rightarrow.gif\" border=\"0\" alt=\"alle Entfernen\" align=\"middle\" class=\"button\"></a><br />";
$ret.=
"<!--\n\t\t _______ ADD VALUES BUTTON _______ \n";
$ret.=
"\t\t \"><img src=\"".
$GLOBALS['PROJECT']['SYSIMGURL'].
"icons-16x16/filenew.gif\" border=\"0\" alt=\"neuer Eintrag\" align=\"middle\" class=\"button\">";
$ret.=
"\t\t _______ ADD VALUES BUTTON _______ \n-->";
$ret.=
"<td width=\"45%\" align=\"center\">";
// ###########################################################
// ###########################################################
// ###########################################################
// OBJECT HTML FORM METHODS
// ###########################################################
// ###########################################################
// OBJECT VALUE CHECK/RETURN METHODS
// ###########################################################
} // end class DBMS_FIELD_PRO_AUDIENCE
Documentation generated on Thu, 08 Jan 2009 17:42:40 +0100 by phpDocumentor 1.4.0a2