Author Topic: Add link to taskbar  (Read 3775 times)

Offline emmeliv

  • Jr. Member
  • **
  • Posts: 12
Add link to taskbar
« on: December 22, 2010, 09:53:50 AM »
Hi!

I want to add a link to the taskbar that opens a help file in a new window. I create the link with the following code:
   
Code: [Select]
$this->api->add_content(html::tag('a', array(
'id'=>'helpbutton',
'href'=>$pdf_path,
'target'=>'_blank',
'class'=>'button help',
'title'=>$this->gettext('buttontitle')),
$this->gettext('buttontitle')), 'taskbar');

The button comes out ok, but somehow it breaks the mail window so that no emails are shown.
If I encase the button in the following if-clause the email window works:
Code: [Select]
if ($rcmail->action == '' || $rcmail->action == 'show') {}
But then the help-button doesn't show up when composing new messages or when viewing settings in profile and folder tabs.
Could you please give some advice about how this should be done in a better way!

Thanks in advance!

Offline ABerglund

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 673
Add link to taskbar
« Reply #1 on: December 22, 2010, 09:32:15 PM »
Have you tried using the Help plugin for this? It adds a button that opens a file of your choice inside an iframe. (See attached screenshot.) Could probably be made to open in a new window fairly easily.
« Last Edit: December 22, 2010, 09:35:59 PM by ABerglund »
Arne Berglund
SysAdmin, Internet Services
Lane Education Service District
Eugene, OR, USA

Offline emmeliv

  • Jr. Member
  • **
  • Posts: 12
Add link to taskbar
« Reply #2 on: December 23, 2010, 03:15:33 AM »
Hi again!

I found out what was causing the problem: the line
Code: [Select]
 $this->include_stylesheet($this->local_skin_path() .'/myhelp.css');
If I hardcode the path to my css the mail window doesn't break!

This is a bit strange??!

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Add link to taskbar
« Reply #3 on: December 24, 2010, 05:00:03 AM »
I always use the following method:


    $rcmail 
rcmail::get_instance();
    
$skin $rcmail->config->get('skin','default');    
    if(!
file_exists("plugins/captcha/skins/$skin/captcha.css"))
      
$skin "default";
    
$this->include_stylesheet('skins/' $skin '/captcha.css'); 
Regards,
Rosali
__________________
MyRoundcube Project (commercial)