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:
<?php echo 'hellooo!' ?>
The Controller:
<?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"
<?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
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...