Commit 73c32546 authored by Sven Rhinow's avatar Sven Rhinow

+Feature: Overlay nicht ausgeben,in js pruefen ob DOM-Elemente vorhanden sind

parent d2aa51c4
......@@ -143,7 +143,7 @@ class ModuleSRLayer extends \Module
if(is_numeric($this->srl_option_layerheight)) $this->optionsArr[] = 'layerHeight:'.$this->srl_option_layerheight;
//expert options
if($this->srl_set_expertoptions == 1)
if($this->srl_set_jsoptions == 1)
{
if(strlen($this->srl_set_overLayID)) $this->optionsArr[] = "overLayID:'".$this->srl_set_overLayID."'";
if(strlen($this->srl_set_layerID)) $this->optionsArr[] = "layerID:'".$this->srl_set_layerID."'";
......@@ -173,6 +173,7 @@ class ModuleSRLayer extends \Module
$this->Template->content = $this->srl_content;
$this->Template->showLayerHtml = $this->show;
$this->Template->hideOverlay = ($this->srl_hideOverlay == 1) ? true : false;
}
}
......
......@@ -59,10 +59,10 @@
//resize and positon if resize browser
window.addEvent('resize', function()
{
//your logic goes here
this.parentsize = this.parentEl.getSize();
$(this.overLayID).setStyles({
$(this.overLayID).setStyles(
{
width : this.parentsize.x,
height : this.parentsize.y
});
......@@ -76,12 +76,13 @@
if(this.closePerEsc)
{
document.addEvent('keydown', function(event){
switch(event.code){
case 27: // Esc
case 88: // 'x'
case 67: // 'c'
this.close();
break
switch(event.code)
{
case 27: // Esc
case 88: // 'x'
case 67: // 'c'
this.close();
break
}
}.bind(this));
}
......@@ -152,10 +153,12 @@
height : this.layerHeight,
opacity: 0
});
var centerLeft = (this.parentsize.x - this.layerWidth) / 2;
var centerTop = (this.parentsize.y - this.layerHeight) / 2;
if(this.drawLayerCenterX) $(this.layerID).setStyle( 'left', centerLeft );
if(this.drawLayerCenterY) $(this.layerID).setStyle( 'top',centerTop );
var centerLeft = (this.parentsize.x - this.layerWidth) / 2;
var centerTop = (this.parentsize.y - this.layerHeight) / 2;
if(this.drawLayerCenterX) $(this.layerID).setStyle( 'left', centerLeft );
if(this.drawLayerCenterY) $(this.layerID).setStyle( 'top',centerTop );
}
// add event on close-button
......@@ -182,26 +185,29 @@
close: function()
{
$(this.layerID).tween('opacity',0).setStyle('display', 'none');
$(this.overLayID).tween('opacity',0).setStyle('display', 'none');
if($(this.layerID)) $(this.layerID).tween('opacity',0).setStyle('display', 'none');
if($(this.overLayID)) $(this.overLayID).tween('opacity',0).setStyle('display', 'none');
},
open: function(el)
{
$(this.layerID).set('tween',{
duration: this.duration,
transition: Fx.Transitions.Quad.easeIn,
});
$(this.layerID).setStyle('display', 'block').tween('opacity',1);
$(this.overLayID).set('tween',{
duration: this.duration,
transition: Fx.Transitions.Quad.easeIn,
});
$(this.overLayID).setStyle('display', 'block').tween('opacity',this.overLayOpacity);
if($(this.layerID))
{
$(this.layerID).set('tween',{
duration: this.duration,
transition: Fx.Transitions.Quad.easeIn,
});
$(this.layerID).setStyle('display', 'block').tween('opacity',1);
}
if($(this.overLayID))
{
$(this.overLayID).set('tween',{
duration: this.duration,
transition: Fx.Transitions.Quad.easeIn,
});
$(this.overLayID).setStyle('display', 'block').tween('opacity',this.overLayOpacity);
}
}
} );
// var ml = new myLayer();
......
......@@ -11,13 +11,14 @@
*/
$GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'] = array_merge( $GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'], array('srl_set_cookie', 'srl_set_expertoptions'));
$GLOBALS['TL_DCA']['tl_module']['palettes']['srlayer'] = 'name,type;{layer_legend},srl_content,srl_option_layerwidth,srl_option_layerheight;{htmlcss_legend},srl_template,srl_css_file;{show_legend},srl_no_param,srl_set_mkLinkEvents,srl_substr,srl_delay,srl_start,srl_stop;{session_legend},srl_set_session;{cookie_legend},srl_set_cookie;{expert_legend:hide},srl_set_expertoptions';
$GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'] = array_merge( $GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'], array('srl_set_cookie', 'srl_set_jsoptions'));
$GLOBALS['TL_DCA']['tl_module']['palettes']['srlayer'] = 'name,type;{layer_legend},srl_content,srl_option_layerwidth,srl_option_layerheight;{htmlcss_legend},srl_template,srl_css_file;{show_legend},srl_no_param,srl_set_mkLinkEvents,srl_substr,srl_delay,srl_start,srl_stop;{session_legend},srl_set_session;{cookie_legend},srl_set_cookie;{expert_legend:hide},srl_hideOverlay;{js_legend:hide},srl_set_jsoptions';
$GLOBALS['TL_DCA']['tl_module']['subpalettes'] = array_merge($GLOBALS['TL_DCA']['tl_module']['subpalettes'],
array(
'srl_set_cookie' => 'srl_cookie_name,srl_cookie_dauer',
'srl_set_expertoptions' => 'srl_set_overLayID,srl_set_layerID,srl_set_closeID,srl_set_closeClass,srl_set_overLayOpacity,srl_set_duration,srl_set_closePerEsc,srl_set_closePerLayerClick,srl_set_drawLayerCenterX,srl_set_drawLayerCenterY,srl_option_other'
'srl_set_jsoptions' => 'srl_set_overLayID,srl_set_layerID,srl_set_closeID,srl_set_closeClass,srl_set_overLayOpacity,srl_set_duration,srl_set_closePerEsc,srl_set_closePerLayerClick,srl_set_drawLayerCenterX,srl_set_drawLayerCenterY,srl_option_other'
)
);
......@@ -133,15 +134,23 @@ array_insert($GLOBALS['TL_DCA']['tl_module']['fields'] , 2, array
'eval' => array('mandatory'=>true,'maxlength'=>55,'tl_class'=>'w50','rgxp'=>'digit'),
'sql' => "varchar(55) NOT NULL default ''"
),
'srl_set_expertoptions' => array
'srl_hideOverlay' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_module']['srl_hideOverlay'],
'exclude' => true,
'default' => '',
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'srl_set_jsoptions' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_module']['srl_set_expertoptions'],
'label' => &$GLOBALS['TL_LANG']['tl_module']['srl_set_jsoptions'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('submitOnChange'=>true),
'sql' => "char(1) NOT NULL default ''"
),
'srl_set_overLayID' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_module']['srl_set_overLayID'],
......
......@@ -27,8 +27,9 @@ $GLOBALS['TL_LANG']['tl_module']['srl_cookie_name'] = array('Cookie-Name
$GLOBALS['TL_LANG']['tl_module']['srl_cookie_dauer'] = array('Cookie-Dauer', 'in Sekunden. Standart 3600 = 1Stunde.');
$GLOBALS['TL_LANG']['tl_module']['srl_start'] = array('Anzeigen ab', 'Den Layer erst ab diesem Tag auf der Webseite anzeigen.');
$GLOBALS['TL_LANG']['tl_module']['srl_stop'] = array('Anzeigen bis', 'Den Layer nur bis zu diesem Tag auf der Webseite anzeigen.');
$GLOBALS['TL_LANG']['tl_module']['srl_hideOverlay'] = array('Overlay nicht anzeigen','den Bereich um den Layer der sich über die ganze Seite legt, nicht anzeigen.');
$GLOBALS['TL_LANG']['tl_module']['srl_set_expertoptions'] = array('Experten-Einstellungen','Hier können die Standartwerte angepasst werden.');
$GLOBALS['TL_LANG']['tl_module']['srl_set_jsoptions'] = array('Javascript-Einstellungen bearbeiten','Hier können die Standartwerte angepasst werden.');
$GLOBALS['TL_LANG']['tl_module']['srl_set_overLayID'] = array('OverLay-ID','die ID des Overlay-Bereiches');
$GLOBALS['TL_LANG']['tl_module']['srl_set_layerID'] = array('Layer-ID','die ID des Layer-Bereiches');
$GLOBALS['TL_LANG']['tl_module']['srl_set_closeID'] = array('Schließen-Button-ID','die ID des Schließen-Button-Bereiches');
......@@ -47,4 +48,5 @@ $GLOBALS['TL_LANG']['tl_module']['htmlcss_legend'] = 'Anpassung der CSS-, und Te
$GLOBALS['TL_LANG']['tl_module']['show_legend'] = 'Sichtbarkeits-Einstellungen';
$GLOBALS['TL_LANG']['tl_module']['session_legend'] = 'Sitzungs-Cookie (Session)';
$GLOBALS['TL_LANG']['tl_module']['cookie_legend'] = 'Domain-Cookie (Cookie)';
$GLOBALS['TL_LANG']['tl_module']['js_legend'] = 'Javascript-Einstellungen';
<?php if($this->showLayerHtml): ?>
<div id="srl_overLay"></div>
<div id="srl_layer">
<div id="srl_closeBtn">schliessen</div>
<div class="srl_content">
<?php echo $this->content; ?>
</div>
</div><!--#layer-->
<?php if(!$this->hideOverlay): ?><div id="srl_overLay"></div><?php endif; ?>
<div id="srl_layer">
<div id="srl_closeBtn">schliessen</div>
<div class="srl_content">
<?php echo $this->content; ?>
</div>
</div><!--#srl_layer-->
<?php endif; ?>
<?php if($this->showLayerHtml): ?>
<div id="srl_overLay"></div>
<div id="srl_layer">
<div id="srl_closeBtn">schliessen</div>
<div class="srl_content">
<?php echo $this->content; ?>
</div>
</div><!--#layer-->
<?php if($this->hideOverlay): ?><div id="srl_overLay"></div><?php endif; ?>
<div id="srl_layer">
<div id="srl_closeBtn">schliessen</div>
<div class="srl_content">
<?php echo $this->content; ?>
</div>
</div><!--#srl_layer-->
<?php endif; ?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment