You have to replace in map.phtml the following:
$('#uiLayoutNorth').pmToolLinks(PM.linksDefault);   // Tool links
with:
pmToolMenu(PM.linksDefault, 'toolLinkMenu', 'Tools', '#uiLayoutNorth', 
16, 16);

This is not php, but javascript. So you should have somewhere in you 
map.phtml:
<div class="ui-layout-north" id="uiLayoutNorth">
    <?php echo UiElement::pmHeader() ?>
</div>
And somewhere else something like that:
/** Some components to be added to UI <==== ADAPT ===== */
$('#uiLayoutCenter').pmToolBar(PM.buttonsDefault);  // ToolBar, REQUIRED
//$('#uiLayoutNorth').pmToolLinks(PM.linksDefault);   // Tool links
pmToolMenu(PM.linksDefault, 'toolLinkMenu', 'Tools', '#uiLayoutNorth', 
16, 16);
$('#uiLayoutCenter').appendElement('div').addClass('map-top-bar');  // 
Top bar over map

Don't forget to add the js code...


Andreas P. a écrit :
> Hello!
>
> Thank you for your answer.
>
> But it seems that your solution doesn't work? Am I doing something wrong??
>
> The message that appears is this: " Fatal error: Call to undefined function
> pmToolMenu() in C:\.....map.phtml on line 162'.
>
> In map.phtml i have put it this: "
>
> <div class="ui-layout-north" id="uiLayoutNorth">
>         <?php echo pmToolMenu(PM.linksDefault, 'toolLinkMenu', 'Tools',
> '#uiLayoutNorth',16, 16) ?>
> </div>
>
> What is wrong??
>
> Thank you in advance!
>
> p.
>
>
>
> Thomas RAFFIN wrote:
>   
>> Hi,
>>
>> 1) In your map.phtml replace
>> $('#uiLayoutNorth').pmToolLinks(PM.linksDefault);   // Tool links
>> with
>> pmToolMenu(PM.linksDefault, 'toolLinkMenu', 'Tools', '#uiLayoutNorth', 
>> 16, 16);
>>
>> 2) Add the folowing javascript code in config/common/menu.js for instance:
>> function pmToolMenu(tl, menuid, title, container, width, height) {
>>     // menu:
>>     var jqMenu = $('<div />').id(menuid + '-Container');
>>    
>>     // menu title:
>>     var jqMenuTitle = $(' ').id(menuid + '-title')
>>                               .addClass('pm-menu-button')
>>                               .attr('href', 
>> 'javascript:PM.Init.menu_toggle(\'' + menuid + '\')')
>>                               .html(title + ' images/menudown.gif ')
>>                               .appendTo(jqMenu);
>>
>>     // menu elements:
>>     var ul = $('<ul/>').id(menuid).addClass('pm-menu');
>>     var size = '';
>>     if (typeof(width) != 'undefined') size += ';width:'+width+'px';
>>     if (typeof(height) != 'undefined') size += ';height:'+height+'px';
>>     $.each(tl.links, function() {
>>         var linkName = _p(this.name); //;
>>         var a = ' ' + (this.run.substr(0,4) == 'http' ? this.run 
>>     
> : 'javascript:' + this.run + '();PM.Init.menu_toggle(\'pm-' + menuid + 
> '\');') + ' ';
>   
>>         a += ' images/transparent.png ';
>>         a += '' + linkName + ' ';
>>         $('<li/>').html(a).appendTo(ul);
>>     });
>>     ul.appendTo(jqMenu).height('auto');
>>    
>>     // menu element effect:
>>     ul.children('li').each(function() {           
>>         $(this).hover(
>>             function() { $(this).addClass('pm-menu_hover'); },
>>             function() { $(this).removeClass('pm-menu-hover'); }
>>         );
>>     });
>>
>>     // add menu to container
>>     $("<div />").id(tl.containerid).append(jqMenu).appendTo(container); 
>> }
>>
>>
>> 3) Then modify the css (for instance if you insert the menu in 
>> "uiLayoutNorth", you will need to put uiLayoutNorth's "z-index" above 2, 
>> maybe align right or left, ...)
>>
>>
>> Andreas P. a écrit :
>>     
>>> Hello Armin,
>>> Hello All,
>>>
>>> I am using pmapper 4 and I would like to have the tool links in an array
>>> object. I don't want to have a list with the links. I would like to have
>>> a
>>> button and when I press it, the 4 tool lins will appear as a menu.
>>>
>>>
>>> I suppose that I have to change the following code from js_config.php:
>>>
>>> PM.linksDefault = {
>>>     containerid:'toolLinkContainer',
>>>     links: [
>>>         {linkid:'link', name:'Link', run:'PM.UI.showMapLink',
>>> imgsrc:'link-w.png'},
>>>         {linkid:'print', name:'Print', run:'PM.Dlg.openPrint',
>>> imgsrc:'print-w.png'},
>>>         {linkid:'download', name:'Download', run:'PM.Dlg.openDownload',
>>> imgsrc:'download-w.png'},
>>>         {linkid:'help', name:'Help', run:'PM.Dlg.openHelp',
>>> imgsrc:'help-w.png'}
>>>         //{linkid:'layers', name:'Layers',
>>> run:'PM.Plugin.Layerselect.openDlg', imgsrc:'layers-bw.png'}
>>>         
>>>     ]
>>> };
>>>
>>> How should I change it??
>>>
>>> Thank you in advance!
>>>
>>> Regards,
>>>
>>> p.
>>>   
>>>       
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>> 30-Day 
>> trial. Simplify your report design, integration and deployment - and focus
>> on 
>> what you do best, core application coding. Discover what's new with 
>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> pmapper-users mailing list
>> pmapper-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>>
>>
>>     
>
>   
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to