Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Lite 7

 AfterLogic Forum : AfterLogic WebMail Lite 7
Subject Topic: my plugin doesn’t work fine Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
osunix
Newbie
Newbie
Avatar

Joined: 21 April 2014
Location: Iran
Online Status: Offline
Posts: 3
Posted: 21 April 2014 at 5:38am | IP Logged Quote osunix

I create a directory in plugins with "let-check" name.
In that directory I have "templates" + "js" directory and "index.php"

My index.php code is:

<?php

class_exists('CApi') or die();

class CLetCheck extends AApiPlugin
{
     public function __construct(CApiPluginManager $oPluginManager)
     {
          parent::__construct('1.0',$oPluginManager);
     }
     public function Init()
     {
          parent::Init();
              
               $this->AddJsFile('js/first.js');
          $this->AddJsFile('js/include.js');
          $this->AddTemplate('first_template','templates/first.html');
     }
}

return new CLetCheck($this);
?>

and my js/include.js file:

AfterLogic.addSettingsTab(CLetCheck);

and js/firstjs.js file:

function CLetCheck()
{

}

CLetCheck.prototype.TemplateName = 'Plugin_mytemplate';
CLetCheck.prototype.TabName = 'myfirst';
CLetCheck.prototype.TabTitle = 'my first';

and my template "first.html":

<div class="panel_top">
     <h2 class="title">Custom Settings!!!</h2>
</div>

and my config.php:

return array(
     
     'sieve' => false,
     'sieve.autoresponder' => true,
     'sieve.forward' => true,
     'sieve.filters' => true,
     'sieve.config.host' => '',
     'sieve.config.port' => 2000,
     'sieve.config.filters-folder-charset' => 'utf-8', // [utf7-imap, utf-8]
     'sieve.config.domains' => $aSieveDomains,
     'plugins.let-check' => true,

);

but it doesn't add any menu in webmail.
I wanna add a menu that can show my template content.
how can I solve it?

Thanks for your advice.
Back to Top View osunix's Profile Search for other posts by osunix
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 21 April 2014 at 5:59am | IP Logged Quote Igor

Quote:
it doesn't add any menu in webmail.
I wanna add a menu that can show my template content.


It looks like you were making use of Example 1 which is about adding new screen in account settings. For adding new menu item which opens its custom screen, see Example 2 instead.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 21 April 2014 at 6:13am | IP Logged Quote Igor

Also note that you add template with one specific name but attempt to use it with a different one - while it has to be the same name prefixed with "Plugin_":

Code:
$this->AddTemplate('first_template','templates/first.html');
...
CLetCheck.prototype.TemplateName = 'Plugin_first_template';


--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide