Kod jest banalnie prosty bo zrobiony na przykładzie "HelloWorld" 🙂
W załączeniu wszystkie pliki.
WarunkiHandloweInstall.php
<?php
defined("_VALID_ACCESS") || die('Direct access forbidden');
class Custom_WarunkiHandloweInstall extends ModuleInstall {
public function install() { // Here you can place the installation process for the module
$tab = 'company'; // notatki do firm
$label = _V('Warunki handlowe'); // etykieta do wyświetlenia
Utils_RecordBrowserCommon::new_addon($tab, $this->get_type(), 'body', $label);
return true;
}
public function uninstall() { // Here you can place uninstallation process for the module
$tab = 'company'; // notatki do firm
Utils_RecordBrowserCommon::delete_addon($tab, $this->get_type(), 'body');
return true;
}
public function info() { // Returns basic information about the module which will be available in the epesi Main Setup
return array( 'Author'=>'Daniel',
'License'=>'<>',
'Description'=>'');
}
public function simple_setup() { // Indicates if this module should be visible on the module list in Main Setup's simple view
return array('package' => __('WarunkiHandlowe'), 'version'=>'0.1'); // - now the module will be visible as "HelloWorld" in simple_view
}
public function requires($v) { // Returns list of modules and their versions, that are required to run this module
return array();
}
public function version() { // Return version name of the module
return array('0.1');
}
}
?>
WarunkiHandloweCommon_0.php
<?php
defined("_VALID_ACCESS") || die('Direct access forbidden');
class Custom_WarunkiHandloweCommon extends ModuleCommon {
}
?>
WarunkiHandlowe_0.php
<?php
defined("_VALID_ACCESS") || die('Direct access forbidden'); // - security feature
class Custom_WarunkiHandlowe extends Module { // - notice how the class name represents its path
public function body($record, $rb) {
$group = $rb->tab . '__my_notes/' . $record['id']; // <-- to jest kluczowy fragment który odróżnia normalne notatki od tych innych
$notes = $this->init_module('Utils/Attachment', $group);
$notes->set_view_func(array('Utils_RecordBrowserCommon','create_default_linked_label'),array($rb->tab, $record['id']));
$this->display_module($notes);
}
}
?>