mixin.php
The "setting-admin" mixin defines a standard idiom for managing extension settings:
- Create a permission "administer {myext}" ("Administer {My Extension}").
- Create a page "civicrm/admin/setting/{myext}" (via
CRM_Admin_Form_Generic
) - Assign all settings from "{myext}" to appear on the page.
- Create a link "Administer > System Settings" to "{My Extension} Settings"
(The values of "{myext}" and "{My Extension}" come from info.xml's <file>
and <name>
.)
If you don't like the defaults, then there are a few override points:
- If you manually create permission "administer {myext}", then your label/description takes precedence.
- If you manually register route "civicrm/admin/setting/{myext}", then your definition takes precedence.
- If you manually configure a setting with
settings_page
, then that setting will move to the other page. (To make a hidden setting, specifysettings_page => []
.) - If you manually add "civicrm/admin/setting/{myext}" to the menu, then your link takes precedence.
Additionally, there is experimental support for overrides in info.xml. (Respected by v1.0.0 but not guaranteed future.)