A
acpan author
Hi, I put most of my external header codes in header.php <head> section
and it works very well for me, with the flexibility of implement external codes,
such as accordian menu, show hints script, anywhere (add, edit, list) in the phpr
visual editor. i do not need to insert the same external script header codes in every
header section of the html pages in visual editor (html mode), just place
the main codes wherever i want in the body, without worry about the
header codes in each page because they are already inserted once at the header.php,
and not so hard to re-do when pages are resetted. i love this method. Example:
in header.php, i insert a Tab script
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'>http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link href="style.css" rel="stylesheet" type="text/css"> <!-- my menu -->
<link rel="stylesheet" type="text/css" href="ddsmoothmenu/ddsmoothmenu.css" />
<!--[if lte IE 7]>
<style type="text/css">
html .ddsmoothmenu{height: 1%;} /*Holly Hack for IE7 and below*/
</style>
<![endif]-->
<script type="text/javascript" src="ddsmoothmenu/jquery.min.js"></script>
<script type="text/javascript" src="ddsmoothmenu/ddsmoothmenu.js">
/* Smooth Navigational Menu- (c) Dynamic Drive DHTML code library */
</script>
<!-- my menu --> </head>
<title>Main Menu</title> Then in html mode of the Visual Editor, i put in the main codes in the
body section to implement Tab menu for Add page. I do that for other
Add pages as well.
My problem now is, with the above, i found a conflict with Inline Edit under
phpr 5.2. The 2 external codes use are from dynamic library:
ddsmoothmenu (http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm)
and ddaccordion (http://www.dynamicdrive.com/dynamicindex17/ddaccordion.htm) My header.php looks like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'>http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link href="style.css" rel="stylesheet" type="text/css"> <!-- menu -->
<link rel="stylesheet" type="text/css" href="ddsmoothmenu/ddsmoothmenu.css" />
<!--[if lte IE 7]>
<style type="text/css">
html .ddsmoothmenu{height: 1%;} /*Holly Hack for IE7 and below*/
</style>
<![endif]--> <script type="text/javascript" src="ddsmoothmenu/jquery.min.js"></script>
<script type="text/javascript" src="ddsmoothmenu/ddsmoothmenu.js"> /* Smooth Navigational Menu- (c) Dynamic Drive DHTML code library */ </script>
<!-- menu --> <!-- Drop Down -->
<script type="text/javascript" src="ddaccordion/jquery-1.2.6.pack.js"></script>
<script type="text/javascript" src="ddaccordion/ddaccordion.js">
/* Accordion Content script- (c) Dynamic Drive DHTML code library */
</script>
<style type="text/css"> .mypets{ /*header of 1st demo*/
cursor: hand;
cursor: pointer;
padding: 2px 5px;
border: 1px solid gray;
background: #E1E1E1;
} .openpet{ /*class added to contents of 1st demo when they are open*/
background: yellow;
} .technology{ /*header of 2nd demo*/
cursor: hand;
cursor: pointer;
font: bold 12px Verdana;
margin: 10px 0;
} .openlanguage{ /*class added to contents of 2nd demo when they are open*/
color: blue;
} .closedlanguage{ /*class added to contents of 2nd demo when they are closed*/
color: green;
}
</style> <script type="text/javascript"> //Initialize first demo:
ddaccordion.init({
headerclass: "mypets", //Shared CSS class name of headers group
contentclass: "thepet", //Shared CSS class name of contents group
revealtype: "mouseover", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover"
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
toggleclass: ["", "openpet"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["none", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing
}
}) //Initialize 2nd demo:
ddaccordion.init({
headerclass: "technology", //Shared CSS class name of headers group
contentclass: "thelanguage", //Shared CSS class name of contents group
revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover"
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: false, //persist state of opened contents within browser session?
toggleclass: ["closedlanguage", "openlanguage"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["prefix", "<img src='ddaccordion/plus.gif' /> ", "<img src='ddaccordion/minus.gif' /> "], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing
}
}) </script>
<!-- Drop Down --> </head>
<title>Main Menu</title> <!-- Align The menu to be at the center-->
<p align="center"></p>
<table width="678" border="0" bordercolor=#DD480 align="center" cellpadding="0">
<tr> <!-- Row -->
<td align = "left"><!-- Col -->
<!-- Align The menu to be at the center--> <body>
<!-- Add Menu Script-->
<? // --Start-------------------------
echo '<div id="smoothmenu1" class="ddsmoothmenu">
<!-- <div id="myslidemenu" class="jqueryslidemenu"> -->
<ul>';
// --Start------------------------- // --Your Account-------------------------
echo '
<li><a href="#">Your Account</a>
<ul>
<li><a href="x.php">Account Info</a></li>
<li><a href="y">Payment</a></li>
<li><a href="x.php">Rate</a></li>';
echo '</ul></li> ';
// --Your Account------------------------- // -- End -------------------------
echo '</ul><br style="clear: left" />';
// echo '<img border=0 src="images/header.jpg" alt=""/>';
echo '</div>';
// -- End ------------------------- ?>
<!-- Add Menu Script-->
</body>
</html>
I generated a sample project (the events template) using phpr 5.2 release,
and placed the above header.php in the include folder of my generated files,
along with the necessary files from dynamic library above. I then tried
to inline edit, the page goes blank or it became a normal edit. But it work if i use phpr 5.1. I tried to remove ddsmoothmenu and keep ddaccordion from the header.php,
or vice versa, the problem is still there, only if i remove both
than it is ok. Is there some scripts conflict with the new php5.2 ? I have to manage my menu using the above method - ddsmoothmenu,
as i do some checks before showing the actual menu to users,
eg. check which domain users are using then decide to show what menu items
in header.php if-else checking. Any advise is appreciated. acpan
|
|