| Author |  | 
      
        | osunix Newbie
 
  
  
 Joined: 21 April 2014
 Location: Iran
 Online Status: Offline
 Posts: 3
 | 
          I create a directory in plugins with "let-check" name.
           | Posted: 21 April 2014 at 5:38am | IP Logged |   |  
           | 
 |  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 |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          
           | Posted: 21 April 2014 at 5:59am | IP Logged |   |  
           | 
 |  
| 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 |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          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_":
           | Posted: 21 April 2014 at 6:13am | IP Logged |   |  
           | 
 |  
 
 
| Code: 
 
    
    | 
      
       | $this->AddTemplate('first_template','templates/first.html'); ...
 CLetCheck.prototype.TemplateName = 'Plugin_first_template';
 |  |  |  
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  |