-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modules: manual activation check to main table #1137
modules: manual activation check to main table #1137
Conversation
@@ -259,6 +259,7 @@ private function add_sections( $nonce_action ) { | |||
$admin_sections['import'] = __( 'Import', 'qtranslate' ) . '/' . __( 'Export', 'qtranslate' ); | |||
$admin_sections['languages'] = __( 'Languages', 'qtranslate' ); | |||
|
|||
//TODO: this actually assumes every manual activation module has settings, dedicated key to be added if that is not the case... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The activation setting has to be saved differently. I may revisit the ma_module_enabled
config.
<?php echo $module['name']; ?> | ||
</label> | ||
<?php else: echo $module['name']; endif; ?> | ||
</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good for now in but eventually I'd want a checkbox for all modules. But some have dependencies, I'll look how to evolve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as it's only a matter of dependencies it should be enough to add 'manual_activation' => true
flag in configuration and it should work, the option will be just an additional condition to the dependencies (needs to be tested though).
But as those are integration plugin, maybe some of them are strictly needed for the relevant plugin to work correctly or at all with qtranslate, I don't know. If this is the case that should not be a setting exposed to the user.
If it's just a matter of layout, greyed-out checkboxes can be easily added following the internal plugin state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's some bug, I tried adding manual_activation
to ACF just to try, and the checkbox doesn't appear.
If you know of a quick fix that would be good.
Looking forward, this looks too complicated to maintain, I'd like to simplify this without ma_module_enabled
in q_config
. This info should be better integrated with the $module
object. I didn't expect so many changes regarding the modules before the next release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls check #1147
The `bool_elements_array` setting was introduced in #1135 and #1137. Re-using the QTX_ARRAY code with an extra argument makes it hard to maintain. The QTX_ARRAY type is not suited for set of checkboxes. Separate the logic by handling this type all separately. The `QTX_BOOLEAN_SET` was legacy, defined but not used in the code. Make the new type generic though only used by `ma_module_enabled`. Remove the extra `bool_elements_array` argument.
The `bool_elements_array` setting was introduced in #1135 and #1137. Re-using the QTX_ARRAY code with an extra argument makes it hard to maintain. The QTX_ARRAY type is not suited for set of checkboxes. Separate the logic by handling this type all separately. The `QTX_BOOLEAN_SET` was legacy, defined but not used in the code. Make the new type generic though only used by `ma_module_enabled`. Remove the extra `bool_elements_array` argument.
* Refactor module activation handler and options Disambiguate the confusion between module state and admin options. The module state depends in general on other plugin states. The new admin options to manually disable or enable the modules are just preferences for the module activation. They should be stored regardless of the current state and can be deleted at any time. Rename the option to `modules_ma_enabled` and make it admin option. Refactor the module state update to separate the concepts. * Minor cleanup * Fix missing checkbox, cleanup module info * Refactor bool-array setting to `QTX_BOOLEAN_SET` (qtranslate#1151) The `bool_elements_array` setting was introduced in qtranslate#1135 and qtranslate#1137. Re-using the QTX_ARRAY code with an extra argument makes it hard to maintain. The QTX_ARRAY type is not suited for set of checkboxes. Separate the logic by handling this type all separately. The `QTX_BOOLEAN_SET` was legacy, defined but not used in the code. Make the new type generic though only used by `ma_module_enabled`. Remove the extra `bool_elements_array` argument. * Use `QTX_BOOLEAN_SET` for module checkboxes * Cleanup dead code * Fix module init on activation, complete doc * Rename `ma_enabled_modules` to `admin_enabled_modules` Co-authored-by: HerrVigg <herrvigg@gmail.com>
No description provided.