| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php declare(strict_types = 0);
- /*
- ** WeCom Center / ROMAN 定制中心 - a portable, multi-language Zabbix module.
- ** Adds a configuration center for alert optimisation, WeCom robot/key/media,
- ** template import, map coordinates, and the L2 physical topology feature
- ** (DB-backed history, configurable collection & display, live web map).
- */
- namespace Modules\WecomCenter;
- use Zabbix\Core\CModule;
- use APP;
- use CMenuItem;
- use CView;
- use Modules\WecomCenter\Lib\I18n;
- use Modules\WecomCenter\Lib\L2Store;
- class Module extends CModule {
- public function init(): void {
- // Register this module's own view directory so CView can find:
- // modules/WecomCenter/views/wecom.center.view.php, topology.view.php
- CView::registerDirectory($this->getRelativePath().'/views');
- // Load translations for the current language (falls back to English).
- I18n::init($this->getRelativePath().'/locale');
- // Make sure the L2 tables exist (idempotent, never fatal).
- L2Store::ensureSchema();
- $menu = APP::Component()->get('menu.main');
- // Configuration center under Administration.
- $menu->findOrAdd(_('Administration'))
- ->getSubMenu()
- ->add(
- (new CMenuItem(I18n::t('menu.title')))
- ->setAction('wecom.center.view')
- );
- // L2 physical topology under Monitoring.
- $menu->findOrAdd(_('Monitoring'))
- ->getSubMenu()
- ->add(
- (new CMenuItem(I18n::t('menu.l2')))
- ->setAction('l2.topology.view')
- );
- }
- }
|