Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: emmeliv on December 22, 2010, 09:53:50 AM

Title: Add link to taskbar
Post by: emmeliv 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!
Title: Add link to taskbar
Post by: ABerglund 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.
Title: Add link to taskbar
Post by: emmeliv 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??!
Title: Add link to taskbar
Post by: rosali 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');