Source for file DBMS_FIELD_MEDIAFILE_SELID.phpclass
Documentation is available at DBMS_FIELD_MEDIAFILE_SELID.phpclass
* Class file DBMS_FIELD_MEDIAFILE_SELID.phpclass
* @project Open CSP-Management
* @author Peter Krebs (pk) <p.krebs@lvus.at>
* @copyright (c) 2002-2003 by Peter Krebs and Landesverlag Unternehmensservice
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
require_once dirname(__FILE__
).
"/DBMS_FIELD_FOREIGNKEY.phpclass";
require_once __OCSP_DEFAULTCONFPATH__.
"media.conf.phpinc";
* handles foreign key fields
* @project Open CSP-Management
* @author Peter Krebs (pk) <p.krebs@lvus.at>
* @copyright (c) 2002-2003 by Peter Krebs and Landesverlag Unternehmensservice
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* overwrite parent settings
* @staticvar string $className
* @var string $foreignTbl name of the media files table
* @var string $showField columnname or sql statement to use to show the
* @var string $showField columnname or sql statement to use to show the
* @var string $showField columnname or sql statement to use to show the
* source file of the class
* @var string $classSrcFile
* @var int $mecRootId id of the root category
* @var int $cur_mecId id currently selected (not stored to the db)
* @var boolean $allowNewMedia user can add media files if he has the rights for the category
* @var boolean $allowChangeCat allow to change into subcategories of $this::mecRootId
* @var boolean $allowNewSubCat allow to add new categories under $this::mecRootId
* @var boolean $allowEditMedia user can edit the media files if he has the rights for the category
* 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>)
unset
($a_ret['DBLOOKUP']['FLD_VALFLD']);
unset
($a_ret['DBLOOKUP']['FLD_FRMRELOAD']);
$a_ret['DBLOOKUP']['FLD_FOREIGNTBL']['FLDVAL']=
"T_MED_FILES.MED_ID";
$a_ret['DBLOOKUP']['FLD_FOREIGNTBL']['FLDVAL'].=
"
var tblName=getSelectedOptionByName(document.forms['frmEdit'],'foreignTbl');
alert('W�hlen Sie zuerst eine Tabelle aus');
var link='".
$GLOBALS['PROJECT']['ADMINURL'].
"phpmyadmin/tbl_properties_structure.php?db=".
$GLOBALS['USRDB']->getMyDBName().
"';
link=link+'&table=T_MED_FILES';
\" title=\"Tabelle in phpMyAdmin zeigen\">
<img src=\"".
$GLOBALS['OCSP']['SYSIMGURL'].
"icons-16x16/b_browse.png\" border=\"0\" class=\"button\">
$a_ret['DBLOOKUP']['FLD_MEDIACAT']['FLDLAB'] =
'Medienkategorie';
$a_ret['DBLOOKUP']['FLD_MEDIACAT']['FLDVAL'] =
$this->getCatSelectTree(NULL,0,"EDIT",FALSE,0,$debug);
$a_ret['DBLOOKUP']['FLD_MEDIACAT']['FLDVAL'].=
"
<input type=\"checkbox\" name=\"allowChangeCat\" value=\"1\" ".
($this->allowChangeCat ?
"checked":
"").
">
Wechesl in Unterkategorien zulassen.
$a_ret['FTBL_POPUPS']=
array(
'TITLE'=>
"Bearbeiten/Hinzufügen",
'FLD_ALLOWNEWMED'=>
array(
<input type=\"checkbox\" name=\"allowNewMedia\" value=\"1\" ".
($this->allowNewMedia ?
"checked" :
"").
"> ja, upload von Medien erlabuen.<br />
<input type=\"checkbox\" name=\"allowNewSubCat\" value=\"1\" ".
($this->allowNewSubCat ?
"checked" :
"").
"> ja neue Medienkategorie erlauben"
'FLDLAB'=>
"Neuer Datensatz URL",
'FLDVAL'=>
"<input name=\"newUrl\" value=\"".
$this->newUrl.
"\" size=\"40\">"
'FLD_ALLOWEDITMED'=>
array(
'FLDLAB'=>
'Medien bearbeiten',
'FLDVAL'=>
"<input type=\"checkbox\" name=\"allowEditMedia\" value=\"1\" ".
($this->allowEditMedia ?
"checked" :
"").
"> ja, bearbeiten von Medien erlabuen."
'FLDLAB'=>
"Datensatz bearbeiten URL",
'FLDVAL'=>
"<input name=\"editUrl\" value=\"".
$this->editUrl.
"\" size=\"40\">"
'FLDLAB'=>
"Popup Arguments",
'FLDVAL'=>
'<input name="myURIQueryArrgs" value="'.
$this->myURIQueryArrgs.
'" size="40"><br />(durch Semicolon ";" getrennte Feldnamen)'
'FLDLAB'=>
"Popup Größe",
width=<input name=\"popupWndWidth\" value=\"".
$this->popupWndWidth.
"\" size=\"4\">
height=<input name=\"popupWndHeight\" value=\"".
$this->popupWndHeight.
"\" size=\"4\">
* save the filed definition form
* @return bool <code>parent::save()</code>
function save($debug=
FALSE) {
$ret=
parent::save($debug);
// ###########################################
* returns the where part of to select the foreign Value
* @param boolean $withWhereAnd
* @version pk-07-02-08 bugfix with $append
function getWhereStmt($arrName=
"DBVAL",$append=
"",$debug=
FALSE,$withWhereAnd=
TRUE) {
if (!strstr($append,"MEF_ID")) {
if (!empty($append)) $append.=
" AND"; // <pk-07-02-08 />
return parent::getWhereStmt($arrName,$append,$debug,$withWhereAnd);
// ###########################################
* returns the html code for category select tree
* @param int $catTreeRoot
* @param boolean $reloadOnChange
function getCatSelectTree($aValue,$catTreeRoot=
0,$arrName=
"DBVAL",$reloadOnChange=
TRUE,$mecId=
0,$debug=
FALSE) {
require_once $GLOBALS['OCSP_MED']['PHPINCPATH'].
"MED_CATEGORY.phpclass";
$i_mecId=
intval($GLOBALS['USRDB']->quickQuery("SELECT MEC_ID FROM T_MED_FILES WHERE MEF_ID=".
intval($aValue),0));
$this->cur_mecId=
$i_mecId; // <pk-06-08-09 /> is used for generating queries
if ($debug) echo
"<p style=\"padding-left: 20px;\">MEC_ID set to: ".
$this->cur_mecId.
"</p>";
$ret.=
" name=\"".
$arrName.
"_MEC_ID_".
$this->myName.
"\" size=\"1\" ";
$ret.=
" onChange=\"document.forms['".
$this->getMyFormName().
"'].action='".
$frmReloadURL.
"#".
$this->myName.
"';document.forms['".
$this->getMyFormName().
"'].submit();\"";
$ret.=
"<option value=\"\">Wurzel</option>\n";
$mecTree->populateTree(TRUE,FALSE);
$o_mecRoot=
$mecTree->getNode(intval($catTreeRoot),FALSE);
$ret.=
$mecTree->getHTMLSelectOptionList($o_mecRoot,$i_mecId,FALSE);
* returns the html code for the add Button
* @version pk-05-03-17 getPopupLinkJs added -> rewrite
require_once $GLOBALS['MED']['PHPINCPATH'].
"MED_CATEGORY_NODE.phpclass";
$i_mecId=
(isset
($
{$arrName['MEC_ID']}) ?
intval($
{$arrName['MEC_ID']}) :
$this->mecRootId);
if ($o_mecNode->curUserCanUpload()) {
$
{$arrName}['MEC_ID']=
$o_mecNode->getId();
$s_ret =
"<a name=\"".
$s_aName.
"\" href=\"#".
$s_aName.
"\" onClick=\"".
$s_jsCmd.
"\">";
$s_ret.=
"<img src=\"".
$GLOBALS['PROJECT']['SYSIMGURL'].
"icons-16x16/filenew.gif\" border=\"0\" alt=\"hinzuf�gen\" class=\"button\">";
* returns the html code for inputting the value
* @param mixed $aValue the value to set
* @param string $nameAdd append something to name like "[VALUE]" for search forms
function getInputTag($aValue,$arrName=
"DBVAL",$nameAdd=
"",$debug=
FALSE) {
if (isset
($_POST[$arrName.
"_MEC_ID_".
$this->myName]) &&
intval($_POST[$arrName.
"_MEC_ID_".
$this->myName])) {
// we have a reload of the form use the postet value
$i_mecId=
0; // let getCatSelectTree find the category ID out of the value or the mecRootId
return "<p>CONFIGURATION ERROR: the field has no Category Root ID set</p>";
$s_query=
"SELECT MEC_NAME FROM T_MED_CATEGORY c,T_MED_FILES f WHERE c.MEC_ID=f.MEC_ID and MEF_ID=".
intval($aValue);
if ($s_mecName=
$GLOBALS[$this->get_gDBIDX()]->quickQuery($s_query,0)) {
$s_query=
"SELECT MEC_NAME FROM T_MED_CATEGORY WHERE MEC_ID=".
intval($this->mecRootId);
$s_ret.=
$GLOBALS[$this->get_gDBIDX()]->quickQuery($s_query,0);
$s_ret.=
$this->getSelect($aValue,$debug,$nameAdd);
// ###########################################################
// OBJECT VALUE CHECK/RETURN METHODS
// ###########################################################
Documentation generated on Thu, 08 Jan 2009 17:42:23 +0100 by phpDocumentor 1.4.0a2