Browse Source

arbeite daran ueber zu und aufklappen die bereiche zu de/aktivieren

master
Georg Hopp 18 years ago
parent
commit
3d4e045345
  1. 22
      js/personAdmin/person.js
  2. 81
      js/personAdmin/personInUp.js
  3. 6
      js/personAdmin/personSearch1.js
  4. 32
      templates/personAdmin/personInUp.tpl.php

22
js/personAdmin/person.js

@ -22,7 +22,7 @@ function c_person (personId, photographerId, ownerId, firstname, surname,
this.personForm = personForm;
}
this.reset = function ()
this.empty = function ()
{
if (this.personId != -1)
{
@ -45,6 +45,26 @@ function c_person (personId, photographerId, ownerId, firstname, surname,
}
}
this.reset = function ()
{
this.personId = -1;
this.photographerId = -1;
this.ownerId = -1;
this.firstname = '';
this.surname = '';
this.company = '';
this.email = '';
this.url = '';
this.cameraId = -1;
this.wmWidth = '';
this.wmHeight = '';
this.wmXPos = '';
this.wmYPos = '';
if (this.personForm != null)
this.personForm.updateForm ();
}
this.update = function (p)
{
if (this.personId != p.personId)

81
js/personAdmin/personInUp.js

@ -28,6 +28,57 @@ function personInUp (
person.connect (this);
this.showHideBlock = function (titleId)
{
var titleElement = document.getElementById (titleId);
var imgElement = titleElement.getElementsByTagName ('img')[0];
var blockElement = titleElement.parentNode;
var dataElement = blockElement.getElementsByTagName ('div')[1];
if (dataElement.style.display == 'none')
{
dataElement.style.display = 'block';
imgElement.src = arrDown.getImgUrl (titleElement);
switch (titleId)
{
case 'title_photographer':
if (this.person._photographerId != -1)
this.person.photographerId = this.person._photographerId;
else
this.person.photographerId = 0;
break;
case 'title_owner':
if (this.person._ownerId != -1)
this.person.ownerId = this.person._ownerId;
else
this.person.ownerId = 0;
}
}
else
{
dataElement.style.display = 'none';
imgElement.src = arrRight.getImgUrl (titleElement);
switch (titleId)
{
case 'title_photographer':
if (this.person._photographerId != -1)
this.person.photographerId = this.person._photographerId;
else
this.person.photographerId = 0;
break;
case 'title_owner':
if (this.person._ownerId != -1)
this.person.ownerId = this.person._ownerId;
else
this.person.ownerId = 0;
}
}
}
this.de_activate = function (field)
{
var updBox = document.getElementById (this.updBox);
@ -166,46 +217,26 @@ function personInUp (
this.setCameraId = function (value)
{
var person = this.selectPerson ();
person.cameraId = value;
if (person == this.newPerson)
person.photographerId = 0;
this.selectPerson ().cameraId = value;
}
this.setWmWidth = function (value)
{
var person = this.selectPerson ();
person.wmWidth = value;
if (person == this.newPerson)
person.ownerId = 0;
this.selectPerson ().wmWidth = value;
}
this.setWmHeight = function (value)
{
var person = this.selectPerson ();
person.wmHeight = value;
if (person == this.newPerson)
person.ownerId = 0;
this.selectPerson ().wmHeight = value;
}
this.setWmXPos = function (value)
{
var person = this.selectPerson ();
person.wmXPos = value;
if (person == this.newPerson)
person.ownerId = 0;
this.selectPerson ().wmXPos = value;
}
this.setWmYPos = function (value)
{
var person = this.selectPerson ();
person.wmYPos = value;
if (person == this.newPerson)
person.ownerId = 0;
this.selectPerson ().wmYPos = value;
}
}

6
js/personAdmin/personSearch1.js

@ -138,13 +138,13 @@ function c_personSearch1 (fname, sname, fnameAlt, snameAlt, names, person)
this.person.update (
this.persons[this.sNameBest[2]][this.fNameBest[2]]);
else
this.person.reset ();
this.person.empty ();
}
else
{
this.fNameBest = new Array (-1, -1, null);
if (this.person != null)
this.person.reset ();
this.person.empty ();
}
return false;
@ -172,7 +172,7 @@ function c_personSearch1 (fname, sname, fnameAlt, snameAlt, names, person)
this.person.update (
this.persons[this.sNameBest[2]][this.fNameBest[2]]);
else
this.person.reset ();
this.person.empty ();
return false;
}

32
templates/personAdmin/personInUp.tpl.php

@ -3,30 +3,11 @@
pInUp = new personInUp (
'update', 'insert', 'submit', person, newPerson, arrRight, arrDown);
function showHideBlock (titleId)
{
var titleElement = document.getElementById (titleId);
var imgElement = titleElement.getElementsByTagName ('img')[0];
var blockElement = titleElement.parentNode;
var dataElement = blockElement.getElementsByTagName ('div')[1];
if (dataElement.style.display == 'none')
{
dataElement.style.display = 'block';
imgElement.src = arrDown.getImgUrl (titleElement);
}
else
{
dataElement.style.display = 'none';
imgElement.src = arrRight.getImgUrl (titleElement);
}
}
function personInUpInit ()
{
var tCam = document.getElementById ('_title_camera');
var tCam = document.getElementById ('title_photographer');
var tCamImg = tCam.getElementsByTagName ('img')[0];
var tWat = document.getElementById ('_title_watermark');
var tWat = document.getElementById ('title_owner');
var tWatImg = tWat.getElementsByTagName ('img')[0];
tCamImg.src = arrRight.getImgUrl (tCam);
@ -111,13 +92,14 @@
</div>
<div class="bgc-grp1 d-grp1" style="margin-top: 2px">
<div class="bgc-grp-head1 f-grp-head1 d-grp-head1" id="_title_camera">
<div class="bgc-grp-head1 f-grp-head1 d-grp-head1"
id="title_photographer">
<img style="
position: relative;
float: right;
margin-right: 3px;
cursor: pointer"
onClick="showHideBlock ('_title_camera')" />
onClick="pInUp.showHideBlock ('title_photographer')" />
<?=_('photographer')?>
</div>
<div style="display: none">
@ -135,13 +117,13 @@
<div class="bgc-grp1 d-grp1" style="margin-top: 2px">
<div class="bgc-grp-head1 f-grp-head1 d-grp-head1"
id="_title_watermark">
id="title_owner">
<img style="
position: relative;
float: right;
margin-right: 3px;
cursor: pointer"
onClick="showHideBlock ('_title_watermark')" />
onClick="pInUp.showHideBlock ('title_owner')" />
<?=_('owner')?>
</div>
<div style="display: none">

Loading…
Cancel
Save