Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: TripleM on April 15, 2011, 09:47:29 AM

Title: Taskbar icons
Post by: TripleM on April 15, 2011, 09:47:29 AM
Hi all,

I want to realize a simple plugin, but I've a problem.
I've create an icon in taskbar, but when my plugin is opened I can't see the plugins icon in taskbar (not only my plugin, but all the plugin in taskbar).

Where can I take a look? There is an API documentation?

Thank you
Title: Taskbar icons
Post by: Julius Caesar on April 15, 2011, 10:29:34 AM
Just check the wiki (http://trac.roundcube.net/wiki).
Title: Taskbar icons
Post by: TripleM on April 15, 2011, 11:34:30 AM
I've seen the wiki, but I can't find the solution.
This is the plugin PHP code

class emailsms extends rcube_plugin{
function init(){
$rcmail = rcmail::get_instance();

$skin_path = $this->local_skin_path();

$this->include_script('emailsms.js');
$this->add_texts('localization', true);
$this->add_button(array(
'name'    => 'emailsms',
'class'   => 'button-emailsms',
'label'   => 'emailsms.buttontitle',
'href'    => './?_task=emailsms&_action=plugin.invio',
'id'      => 'emailsms_button'
), 'taskbar');
$this->include_stylesheet($skin_path . '/emailsms.css');

if ($rcmail->task == 'emailsms' && ($rcmail->action == '' || $rcmail->action == 'plugin.invio')) {

$this->mostra('emailsms.invio');

}
 
}

function mostra($template = 'emailsms.invio') {
$rcmail = rcmail::get_instance();
$plugins = array_flip($rcmail->config->get('plugins',array()));
if(!isset($plugins['jqueryui'])){
die('jqueryui plugin is not installed. Get it <a href=&quot;http://underwa.ter.net/roundcube-plugins&quot;>here</a>.');
}
$plugins = $rcmail->config->get('plugins',array());
foreach($plugins as $key){
if($key == 'emailsms'){
die('jqueryui plugin must be registered before calendar plugin.');
}
if($key == 'jqueryui'){
break;
}
}    
$temparr = explode(&quot;.&quot;, $template);
$domain = $temparr[0];
$template = $temparr[1];

$rcmail->output->set_pagetitle($this->gettext('emailsms'));

$skin_path = $this->local_skin_path();


$this->add_button(
array(
   'command' => 'plugin.invio',
   'href' => './?_task=emailsms&_action=plugin.invio',
   'imagepas' => $skin_path.'/sms_pas.png',
   'imageact' => $skin_path.'/sms_act.png',
   'title' => 'emailsms.invia'),
'toolbar');

$this->add_button(
array(
   'command' => 'plugin.notifiche',
   'href' => './?_task=emailsms&_action=plugin.notifiche',
   'imagepas' => $skin_path.'/sms_pas.png',
   'imageact' => $skin_path.'/sms_act.png',
   'title' => 'emailsms.notifiche'),
'toolbar');

$rcmail->output->send(&quot;$domain.$template&quot;);
   
}
 
}


This is the template header:




<roundcube:object name="pagetitle" />













This is my first plugin, I can't understand what's wrong.
In the plugin page I can't see taskbar plugins and toolbar icons.

Thanks