Roundcube Community Forum

 

Need help to track error

Started by buffe, November 26, 2009, 06:39:09 AM

Previous topic - Next topic

buffe

Hi,
I'm developing a plugin for roundcube to have blacklist in my university project. While doing I found  an error and I can not figure out what causes it.
The error log says:
PHP Error: Error loading template for blacklist in /var/www/html/roundcubemail/program/include/rcube_template.php on line 372 (GET /roundcubemail/?_task=settings)


Can anyone give me a hint where i might went wrong.
Here is the code I've written as blacklist.php,


class blacklist extends rcube_plugin
{
   public $task = 'settings';
   
   function init(){
      $this->add_texts('localization/', true);
      $this->include_script('blacklist.js');

      $this->add_hook('list_prefs_sections', array($this, 'blacklist_link'));
      $this->register_action('plugin.body', array($this, 'blacklist'));
         $this->add_hook('user_preferences', array($this, 'prefs_table'));
      $this->register_handler('plugin.body', array($this, 'generate_html'));
      
      
            

      rcmail::get_instance()->output->add_label('blacklist');
      
   }

   function blacklist_link($args){
      $temp = array();
      $temp['blacklistlink']['id'] = 'blacklistlink';
      $temp['blacklistlink']['section'] = $this->gettext('blacklist');
      $args['list'] = $args['list'] + $temp;  
        return $args;       
   }

   function prefs_table($args){
      if ($args['section'] == 'blacklistlink') {
        $args['blocks']['main']['options']['blacklistlink']['title'] = "";
        $args['blocks']['main']['options']['blacklistlink']['content'] = "";
      }
   
      return $args;
   
   }
   //this is for the test, actual html will be diffrent
   function generate_html(){
      $the_content = "\n";      
      return "$the_content";
   }
   
   function blacklist()
   {
   $rcmail = rcmail::get_instance();
   $rcmail->output->send("blacklist");
   exit;
   }



}

?>



Thanks

rosali

$rcmail->output->send("blacklist");

Where is blacklist.html located? If the path is "./plugins/blacklist/skins/default/templates/blacklist.html" please use:

$rcmail->output->send("blacklist.blacklist"); //[prefix: plugin name].[suffix: template name]
Regards,
Rosali

buffe

Thanks rosali,

I think that is the problem as I don't have any blacklist.html. so i changed it as

$rcmail->output->send("plugin");

then the error didn't occur but the preferences tabs also disappears.   Can I just add the tab to view without adding a blacklist.html? Where should I change in my blacklist.php