type, and AbstractItem::getType() // only auto-fills it from the class name when it is still empty. $this->type = 'usersettings'; parent::__construct(); if (!$INPUT->server->str('REMOTE_USER')) { throw new \RuntimeException('user settings are only for logged in users'); } // Label comes from the plugin's language file. Any plugin component // exposes getLang(); the helper is the lightest one to borrow. $helper = plugin_load('helper', 'usersettings'); if ($helper instanceof \helper_plugin_usersettings) { $this->label = $helper->getLang('menu'); } $this->svg = __DIR__ . '/images/usersettings.svg'; } }