e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 213 forks source link

Feature Request - ability to use admin message #3835

Open Jimmi08 opened 5 years ago

Jimmi08 commented 5 years ago

Maybe this is there already. I have a vague idea that there was file theme_setup.php very long ago...

I would like to have the option for the theme to check something and display an error and warning messages. For example, if the theme needs some plugin, then message similar like a warning about outdated plugins would be nice.

The same for the plugin. How to display some warning message not only on plugin page but in all admin? For example, if there is conflict or 2 similar plugins can't be installed together, then how to display a warning that other plugin should be uninstalled soon?

Thanks

Moc commented 5 years ago

There is a file called theme_config.php which allows for customization of the theme through the Admin Area, but I don't think there's a setup file... but I may be mistaken.

I do understand the use case and I think having such functionality would be good for themes.

As for plugins; there is a list in core which warns users if there are plugins installed that break e107 (due to incompatibilities or old and unsecure coding). Now, this is not a way for plugin authors to add 'conflicting' plugins but it may be a start. I do wonder how often this would occur though.

As for 'requiring' other plugins when installing a plugin, this can be done through the <dependencies> in plugin.xml.

Jimmi08 commented 5 years ago

As for plugins; there is a list in core which warns users if there are plugins installed that break e107 (due to incompatibilities or old and unsecure coding). Now, this is not a way for plugin authors to add 'conflicting' plugins but it may be a start. I do wonder how often this would occur though.

no, this is not needed. It was just example how message should look (on dashboard, not only on theme or plugin page)

There is a file called theme_config.php which allows for customization of the theme through the Admin Area, but I don't think there's a setup file... but I may be mistaken.

I got answer in other issue that there is method help in theme_config ( I am familiar with this file). It renders help in next tab in theme page. I don't think that people will look there if they are used to left help menu. But with theme there is no other option.
With theme_setup.php I had on mind something like with plugins - before install, after install method. If required plugin is missing, installation would be stopped.

As for 'requiring' other plugins when installing a plugin, this can be done through the in plugin.xml.

What does this do? Does it stop plugin installation? Is it only for plugin or for the theme too?
I haven't used this yet. Good hint.

Thanks

Moc commented 5 years ago

With theme_setup.php I had on mind something like with plugins - before install, after install method. If required plugin is missing, installation would be stopped.

This may be very useful to add indeed!

What does this do? Does it stop plugin installation? Is it only for plugin or for the theme too? I haven't used this yet. Good hint.

It checks for dependencies (other e107 plugins or PHP modules such as GD) and then it stops plugin installation with a message stating which requirement is not met. As far as I know this is for plugins only but I suppose adding this for themes would not be too difficult.