Local Plugin Add Settings Link

Local Plugin Add Settings Link

от Lucas Fath -
Количество ответов: 4

Hello everybody,

I'm trying to add some settings to my local plugin. So far I've managed to add a settings page, the only thing missing is the link in the plugin list to make it easier for the admin to navigate to the settings.

In the end it should look like this example:
But currently it looks like this example:



I've tried so many things and read a lot of forum disscussion but somehow cant make it work out. 

I also tried implementing a lib.php file as described in https://docs.moodle.org/dev/Local_plugins#Adding_an_element_to_the_settings_menu but I always get 500 response codes.


Can somebody help me please?
Thanks in advance 


Greetings

Dominik


В ответ на Lucas Fath

Re: Local Plugin Add Settings Link

от Benjamin Ellis -
Изображение пользователя Particularly helpful Moodlers
Hi,

Am I right assuming you have your settings in a settings.php file? is so post some/all the content of it.

Ben
В ответ на Benjamin Ellis

Re: Local Plugin Add Settings Link

от Lucas Fath -
Hey,

yeah you're right. I've also tried to mess with the lib.php file but this always resulted in moodle errors...

Here is the content of my settings.php file:
<?php
defined('MOODLE_INTERNAL') || die();

if ($hassiteconfig) { // needs this condition or there is error on login page
$settings = new admin_settingpage('local_snomsalesforce', get_string('pluginname', 'local_snomsalesforce'));
$ADMIN->add('localplugins', $settings);

// Add url settings
$settings->add(new admin_setting_configtext(
'local_snomsalesforce/url', // name
get_string('salesforce_url', 'local_snomsalesforce'), // visible name
get_string('salesforce_url_desc', 'local_snomsalesforce'), // description
'', // default value
PARAM_TEXT // type
));
}

And after adding this, i have a settings page under Dashboard / Site administration / Plugins / Local plugins / myplugin
Only thing missing is the settings link in the row for my plugin in the plugin overview
В ответ на Lucas Fath

Re: Local Plugin Add Settings Link

от Mark Sharp -
Изображение пользователя Core developers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Plugin developers