Merge in from pre_0.1 branch
git-svn-id: file:///svn-source/pmgr/trunk/site@847 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -8,17 +8,78 @@
|
||||
* @package pmgr
|
||||
*/
|
||||
|
||||
foreach ($menu AS $item) {
|
||||
if (isset($item['header']))
|
||||
echo('<DIV CLASS="header">' . $item['name'] . '</DIV>' . "\n");
|
||||
elseif (isset($item['hr']))
|
||||
echo('<HR>' . "\n");
|
||||
elseif (isset($item['url']))
|
||||
echo('<DIV CLASS="item">'
|
||||
. $html->link($item['name'], $item['url'],
|
||||
isset($item['htmlAttributes']) ? $item['htmlAttributes'] : null,
|
||||
isset($item['confirmMessage']) ? $item['confirmMessage'] : null,
|
||||
isset($item['escapeTitle']) ? $item['escapeTitle'] : null)
|
||||
// REVISIT <AP>: 20090823
|
||||
// Add way to slide the entire menu off the page
|
||||
|
||||
. '</DIV>' . "\n");
|
||||
// The sidemenu-container is necessary to define the
|
||||
// bounds as the parent of the sidemenu div, which will
|
||||
// be heavily manipulated by the accordion module. If
|
||||
// we don't have good control over the parent, the
|
||||
// accordion will get confused and behave poorly.
|
||||
echo('<DIV ID="sidemenu-container">' . "\n");
|
||||
echo('<DIV ID="sidemenu">' . "\n");
|
||||
|
||||
$section = 0;
|
||||
$active_section = null;
|
||||
foreach ($menu['areas'] AS $area_name => $area) {
|
||||
if (empty($area['subareas']))
|
||||
continue;
|
||||
|
||||
foreach ($area['subareas'] AS $subarea_name => $subarea) {
|
||||
if (empty($subarea['priorities']))
|
||||
continue;
|
||||
|
||||
if (!isset($active_section) &&
|
||||
!empty($menu['active']['area']) && $area_name == $menu['active']['area'] &&
|
||||
(empty($menu['active']['subarea']) || $subarea_name == $menu['active']['subarea']))
|
||||
$active_section = $section;
|
||||
|
||||
++$section;
|
||||
|
||||
echo('<H3' .
|
||||
//' id="sidemenu-section-'.$area_name.'-'.$subarea_name.'"' .
|
||||
' class="sidemenu-header">' .
|
||||
$subarea['name'] .
|
||||
"</H3>\n");
|
||||
|
||||
echo('<DIV class="sidemenu-content">' . "\n");
|
||||
foreach ($subarea['priorities'] AS $priority) {
|
||||
foreach ($priority AS $item) {
|
||||
if (isset($item['url'])) {
|
||||
echo('<DIV CLASS="sidemenu-item">'
|
||||
. $html->link($item['name'], $item['url'],
|
||||
isset($item['htmlAttributes']) ? $item['htmlAttributes'] : null,
|
||||
isset($item['confirmMessage']) ? $item['confirmMessage'] : null,
|
||||
isset($item['escapeTitle']) ? $item['escapeTitle'] : null)
|
||||
. '</DIV>' . "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
echo('</DIV>' . "\n");
|
||||
}
|
||||
}
|
||||
|
||||
echo('</DIV>' . "\n"); // End #sidemenu
|
||||
echo('</DIV>' . "\n"); // End #sidemenu-container
|
||||
|
||||
// Uses both hoverintent, which is a more user friendly mechanism
|
||||
// than mouseover, as well as click. This provides 1) a workable
|
||||
// solution for those browsers that don't use pointers, such as
|
||||
// a touchscreen, and 2) a means to open the menu if the animation
|
||||
// was running while the user moved the pointer to a new menu area.
|
||||
$javascript->codeBlock(
|
||||
<<<JSCB
|
||||
jQuery(document).ready(function(){
|
||||
if (jQuery("#sidemenu").accordion != null) {
|
||||
jQuery("#sidemenu").accordion
|
||||
({ fillSpace : true,
|
||||
event : "click hoverintent",
|
||||
animated : "bounceslide"
|
||||
JSCB
|
||||
. (isset($active_section) ? ",\n\t active : $active_section\n" : '') .
|
||||
<<<JSCB
|
||||
});
|
||||
}
|
||||
});
|
||||
JSCB
|
||||
, array('inline' => false));
|
||||
|
||||
Reference in New Issue
Block a user