attachListener(Events::PAGE_ADD_JS, $this, 'addJs'); } public function addJs(&$args) { if (array_key_exists(SESSION_PREFIX . 'operator', $_SESSION) && is_capable(CAN_ADMINISTRATE, operator_by_id($_SESSION[SESSION_PREFIX . 'operator']['operatorid']))) { if (!strcmp('/operator/history', $args['request']->getPathInfo())) { $args['js'][] = $this->getFilesPath() . '/js/alter_form.js'; } } } /** * Specify version of the plugin. * * @return string Plugin's version. */ public static function getVersion() { return '0.1.0'; } }