dude
Tue. 13. March 2007, 10:40
ZITAT(MaZderMind @ Mon. 12. March 2007, 20:19)
Im autoPopUp-Modul in die Ausgabe (unteres Feld) sowas rein
QUELLTEXT
<?php
if(<cms:mod type="checkbox" id="1" title="Anzeigen" elementName="Ja" elementValue="1" elementValueUnchecked="0" menuoptions="false" addslashes="true" /> == 1) {
echo '<body onload="autoPopUp(\'<cms:mod type="image" id="1" mode="url" title="Bild" menuoptions="false" />\');">';
} else {
echo '<body>';
}
?>
<cms:mod type="typegroup" elements="checkbox[1],image[1]" />
so in etwa müsste das funktionieren. Kanns grad nich testen aber damit kannst du schonmal experimentieren..
Gruß, Peter
Habs gerad mal versucht einzubauen, leider erhalte ich folgenden Fehler wenn ich die entsprechende Seite im Backend aufrufe:
QUELLTEXT
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /www/domain.tld/cms/backend/inc/inc.con_edit.php(838) : eval()'d code on line 86
Deinen Code hab ich folgendermaßen (am Ende!) in die Frontendausgabe des "Popup automatisch"-Moduls eingefügt:
QUELLTEXT
<?PHP
//2003 by Björn Brockmann
$myPopup['thumb_url'] = <cms:mod type="image" id="1" mode="url" width="MOD_VALUE[5]" height="MOD_VALUE[6]" aspectratio="MOD_VALUE[7]" autoresize="true" menuoptions="false" addslashes="true" />;
$myPopup['thumb_amplitude'] = <cms:mod type="image" id="1" mode="amplitude" width="MOD_VALUE[5]" height="MOD_VALUE[6]" aspectratio="MOD_VALUE[7]" autoresize="true" menuoptions="false" addslashes="true" />;
$myPopup['thumb_style'] = ( "MOD_VALUE[3]" == "") ? '' : 'class="MOD_VALUE[3]"';
$myPopup['thumb_image'] = '<img src="'. $myPopup['thumb_url'] .'" '. $myPopup['thumb_amplitude'] .' '. $myPopup['thumb_style'] .' alt="" />';
$myPopup['popup_url'] = <cms:mod type="image" id="1" mode="url" menuoptions="false" addslashes="true" />;
$myPopup['popup_width'] = <cms:mod type="image" id="1" mode="width" menuoptions="false" addslashes="true" />;
$myPopup['popup_height'] = <cms:mod type="image" id="1" mode="height" menuoptions="false" addslashes="true" />;
$myPopup['popup_desc'] = <cms:mod type="image" id="1" mode="desc" menuoptions="false" title="MOD_VALUE[2]" filetypes = "MOD_VALUE[8]" folders = "MOD_VALUE[9]" subfolders ="MOD_VALUE[10]" addslashes="true" />;
$myPopup['text_title'] = <cms:mod type="text" id="1" menuoptions="false" title="MOD_VALUE[1]" addslashes="true" />;
$myPopup['editbutton'] = <cms:mod type="typegroup" elements="text[1],image[1]" title="MOD_VALUE[0]" menuoptions ="MOD_VALUE[11]" addslashes="true" />;
$js_function_call = " onclick=\"return gb_pop('". $myPopup['popup_width'] ."', '". $myPopup['popup_height'] ."', '" . $myPopup['popup_url'] . "', '". rawurlencode($myPopup['text_title']) ."')\" ";
if ( empty($myPopup['thumb_url']) ) $myPopup['popup'] = '';
else $myPopup['popup'] = '
<a href="'. $myPopup['popup_url'] .'" '. $js_function_call .'>'. $myPopup['thumb_image'] .'</a>
';
$myPopup['font1'] = "MOD_VALUE[4]";
$myTplVars['thumb_url'] = '{thumb_url}';
$myTplVars['thumb_amplitude'] = '{thumb_amplitude}';
$myTplVars['thumb_style'] = '{style}';
$myTplVars['thumb_image'] = '{thumb_image}';
$myTplVars['popup_url'] = '{popup_url}';
$myTplVars['popup_width'] = '{popup_width}';
$myTplVars['popup_height'] = '{popup_height}';
$myTplVars['popup_desc'] = '{popup_desc}';
$myTplVars['text_title'] = '{title}';
$myTplVars['editbutton'] = '{editbutton}';
$myTplVars['popup'] = '{popup}';
$myTplVars['font1'] = '{font1}';
$myTpl = "MOD_VALUE[12]";
if($gb_pop_is_throwed_out != true){
//stellt sicher, dass die JS- Funktion bei mehrfacher Verwendung nur einmal ausgegeben wird
$gb_pop_is_throwed_out = true;
?>
<script type="text/javascript">
//<![CDATA[
var pic_popup = null
function gb_pop(b, h, url, windowtitle)
{
var tpop_bildschirmx = screen.availWidth;
var tpop_bildschirmy = screen.availHeight;
var tpop_breite = b;
var tpop_hoehe = h;
var tpop_startx = Math.round(tpop_bildschirmx / 2) - (tpop_breite / 2);
var tpop_starty = Math.round(tpop_bildschirmy / 2) - (tpop_hoehe / 2);
if (pic_popup != null && !pic_popup.closed)
pic_popup.close()
pic_popup = window.open('', '', "width="+ b + ", height=" + h
+ ", status=no, toolbar=no, menubar=no, resizable=yes, scrollbars=no, screenX=" + tpop_startx
+ ", left=" + tpop_startx + ", screenY=" + tpop_starty + ", top=" + tpop_starty + " ");
pic_popup.focus();
pic_popup.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
pic_popup.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de"><head>');
pic_popup.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />');
pic_popup.document.writeln('<title>'+ decodeURI(windowtitle) + '</title></head>');
pic_popup.document.writeln('<body style="overflow:hidden; margin:0;">');
pic_popup.document.writeln('<div style="margin:0;">');
pic_popup.document.writeln('<a href="#" onclick="self.close()"><img src="'+ url +'" style="margin:0px; border:0 none;" alt="" /></a>');
pic_popup.document.writeln('</div></body></html>');
pic_popup.document.close();
return false;
}
//]]>
</script>
<?PHP
}//end if
$myTpl = str_replace($myTplVars, $myPopup, $myTpl);
eval('?>'.$myTpl);
unset($myTpl, $myTplVars, $myPopup);
?>
<?php
if(<cms:mod type="checkbox" id="1" title="Anzeigen" elementName="Ja" elementValue="1" elementValueUnchecked="0" menuoptions="false" addslashes="true" /> == 1) {
echo '<body onload="autoPopUp(\'<cms:mod type="image" id="1" mode="url" title="Bild" menuoptions="false" />\');">';
} else {
echo '<body>';
}
?>
<cms:mod type="typegroup" elements="checkbox[1],image[1]" />
Idee?
Grüße.