is there any way , we change form action address in admin setting pages?
i want to add some more query string instead of "section" only
i dont wanna touch the core ,, i have some extra config setting, i made a link to new setting page and it will redirect back to the setting pages with GET method, in setting page i will check query string and add extra config field , but, the "save changes" button wont save it .
when i debug the code, iv get it that it will sent it to same page (without my query string) then save it.
by the way, im sure there should be some update action url, like we change in mform, but in admin setting .
Thanks for your reply Tim,
let me explain you what i did, currently i have a plugin , with some sub component which need their own settings.
In main setting page, i have listed all components with "setting" link. when user click on the setting , it will redirect back to main settings page by 'section' plus my query string (GET method) and in main setting i will check, if there is param, i will add 3 more option like configtext and configcolorbox, but as i understand, when i click on "save Changes", it will post to the same main setting page (without my query string) and those 3 extra fields will gone. so i just thinking of changing form action to "admin/settings,php?section=xxx&myvar=yyy" or, as i understand, moodle have 3 hidden types field which one of those are 'return', so if i can assign data to it also can be fine to me.
by the way, is there any way which we have our own hidden type in admin setting?
or is it anyway we assign manually data to post? like we do in php $_POST, when i check main moodle code, its play with cookies and i dont know if any options there,
i know i can play with sessions, but i dont wanna touch it. thanks
How does one go about creating their own subclass of admin_setting_configtext? I know how to write the code to do this but am unsure where to put it. This is my first time using Moodle. What I'm trying to do is store a few URLS in my theme settings for things like social media links for the organization which I could then use in page templates. I figured I could create a new class called admin_setting_configurl which will inherit from admin_setting_configtext and ultimately check to be sure the string entered is a valid URL but I'm not sure where to put this.
If this already exists in Moodle please let me know as I've been unable to find anything that would work while reading through adminlib.php
Use the configtext with PARAM_URL?
// Website url setting.
$name = 'theme_uogateen/website';
$title = get_string('website', 'theme_uogateen');
$description = get_string('websitedesc', 'theme_uogateen');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
Very interesting. Thank you for that Richard. After posting my initial question last night I learned we can pass regular expressions into the $paramtype variable in the constructor for admin_setting_configtext. Is there a place in the online documentation where I can find a list of valid constants for this variable?
I'm curious what else can be passed here.
For anyone else curious about this sort of thing, check the file /lib/moodlelib.php for a list of constants.