Author Topic: Creating a new Hook Plugin  (Read 4110 times)

el Paquito

  • Newbie
  • *
  • Posts: 1
    • View Profile
Creating a new Hook Plugin
« on: September 20, 2011, 11:06:40 am »
I am creating a hook, which should create a tab when FengOffice starts (as does any module). I created several files with the following code:

The view:

Code: [Select]
<?php echo 'hellooo!' ?>
The Controller:

Code: [Select]
<?php
// QHK: Clase controlador de Helloworld
class HelloworldController extends ApplicationController {
function __construct() {
parent::__construct();
prepare_company_website_controller($this'website');
}

function index() {
$my_var 'World';
tpl_assign('world'$my_var);
}
}
?>

And the Hook, "helloworld_hooks.php"

Code: [Select]
<?php
Hook
::register('helloworld');

/**
 * Se llama cuando se realiza la carga de los JS
 */
function helloworld_autoload_javascripts($ignored, &$jss) {
// AƱadimos nuestro archivo JS
$jss[] = 'og/plugins/helloworld.js';
}

?>

Helloworld.js

Code: [Select]
Ext.onReady(function() {
// Ext.get('tabs-panel__messages-panel').setDisplayed(false);
// Ext.get('tabs-panel__mails-panel').setDisplayed(false);
// Ext.get('tabs-panel__contacts-panel').setDisplayed(false);
// Ext.get('tabs-panel__calendar-panel').setDisplayed(false);

var tp = Ext.get('tabs-panel');
var tab = new og.ContentPanel({
title: lang('helloworld'),
id: 'reporting-panel',
iconCls: 'ico-reporting-layout',
//refreshOnWorkspaceChange: true,
// defaultContent: {
// type: "url",
// data: og.getUrl('helloworld','index')
// }
});
});

It does not work load the new tab. What can happen? I have tried several ways, but the JS is loaded as the code to hide tabs if executed properly... ???
« Last Edit: September 20, 2011, 02:19:00 pm by el Paquito »

franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: Creating a new Hook Plugin
« Reply #1 on: November 07, 2011, 09:25:13 am »
Have you checked this documentation yet? What about the Hello World example?

Anyway, soon when Feng 2 is out, plugins will be easy to develop.

Best regards,
Francisco
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!

timveer

  • Freshman
  • *
  • Posts: 28
    • View Profile
Re: Creating a new Hook Plugin
« Reply #2 on: November 08, 2011, 02:14:52 am »
Anyway, soon when Feng 2 is out, plugins will be easy to develop.

Oh, oh, oh Francisco... your just teasing us with these comments.... Now we're all sitting on pins & needles! ;)

-t

 

anything