Questions about adding settings in Admin Section

I know the thread title is a little broad, but I have a couple of questions about adding a section to the Admin section for a theme.

I would like to add some settings for my theme inside of the admin section of ISPConfig3. I was unable to get it to add dynamically so I had to hard code it for now. How can I get this to be added dynamically? Does the logic to check for admin.module.conf work in the theme folders as well?

It appears that it does, and I want to be sure that I am correct in that assumption.

The next question that I have is this, How do you query records from the database? This is the code that I am trying to use.

Right now, I am placing all of this inside of the admin module of ISPConfig3, but it appears that I can load this all from the theme. Is that correct? I would love to keep it there, if possible. I do not like making people have to copy files install ISPConfig3 directories.

Any help would be appreciated. I am just trying to make the theme that I created a little better than it currently is.

After more investigation, I can't load it from the theme file. I guess that you can, but you have to make some changes to the requires stuff that it is kind of silly. ../../../../ It gets to be a lot after a few of those.

The menu is created from the admin->lib->menu.d-> directory. This can not be included in your theme.

I was unable to figure out how to write that query. If someone could help with that, I would be very glad. I am learning PHP so it is taking me a lot longer than it probably should to figure this out.

Does anyone know what template tools ISPConfig uses? Is it using a readily available project for this or is it doing it on its own? I thought that it was using Smarty, but I don't think that it is. I could be completely wrong.

After even more finding, I can get it to save to the the database table now. The only issue is that it always inserts a new record instead of updating the data? How can I change that functionality? I need it to update here. Is there a parameter than I need to send that I am not.

I went ahead and added that ?id=1 to the end of the link open up the section. It did not place the value.

How do I set the template variable {tmpl_var name='id'}. Do I need to set this inside of my form configuration file? I am looking at the Interface config section because it is the most similar to what I am trying to do for this section.

I see that it sets the template variable id, but how is it getting that information? How can I do the same thing? I just need the ID set, and I think that I will have it all done. I can set it manually, but I don't think that is the right thing to do here.

How do I set the template variable {tmpl_var name='id'}. Do I need to set this inside of my form configuration file? I am looking at the Interface config section because it is the most similar to what I am trying to do for this section.

Click to expand...

The ID is set automatically based in the definition of the primary ID field in the form file.

I have everything almost completed in the backend, but this has led to more questions.

1. When you are using a datasource in a SELECT type field for the form, how can you have it save the value_field into the database. Right now, on save it is saving the value of the select as 0 or 1 or whatever. Can you set the value equal to the value that it displays in the select dropdown?

2. How do we do right template loops in ISPConfig3? Is it better to try to do it PHP and output the code in the template that way?

The way sou build the array for th loop looks wrong please check out the ispconfig files that build the menus for some working code. And the login module is just doing the user authentication, it is not writing ny menus or templates. So adding a menu thre oes not mke much sense for me.