adminurl->registercopy('admin.plugin.theme.editor','admin.plugin',array('p' => 'themeEditor')); if (!isset($__resources['help']['themeEditor'])) { $__resources['help']['themeEditor'] = dirname(__FILE__).'/help.html'; } $core->addBehavior('adminCurrentThemeDetails', array('themeEditorBehaviors','theme_editor_details')); $core->addBehavior('adminBeforeUserOptionsUpdate',array('themeEditorBehaviors','adminBeforeUserUpdate')); $core->addBehavior('adminPreferencesForm',array('themeEditorBehaviors','adminPreferencesForm')); class themeEditorBehaviors { public static function theme_editor_details($core,$id) { if ($id != 'default' && $core->auth->isSuperAdmin()) { return '
'; } } public static function adminBeforeUserUpdate($cur,$userID) { global $core; // Get and store user's prefs for plugin options $core->auth->user_prefs->addWorkspace('interface'); try { $core->auth->user_prefs->interface->put('colorsyntax',!empty($_POST['colorsyntax']),'boolean'); } catch (Exception $e) { $core->error->add($e->getMessage()); } } public static function adminPreferencesForm($core) { // Add fieldset for plugin options $core->auth->user_prefs->addWorkspace('interface'); echo ''. __('Syntax highlighting in theme editor'). '
'; } }