Roundcube Community Forum
News and Announcements => General Discussion => Topic started 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:
$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:
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!
-
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.
-
Hi again!
I found out what was causing the problem: the line
$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??!
-
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');