Skip to content

Commit

Permalink
MSFTMPP-264: Move unified API enable switch to configurable setting
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmcq committed Oct 20, 2015
1 parent 3ae35c0 commit 04d60e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion local/o365/classes/rest/unified.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public static function is_configured() {
* @return bool Whether the unified API is enabled.
*/
public static function is_enabled() {
return true;
$enabled = get_config('local_o365', 'enableunifiedapi');
return (!empty($enabled)) ? true : false;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions local/o365/lang/en/local_o365.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@
$string['settings_detectperms_update'] = 'Update';
$string['settings_detectperms_valid'] = 'Permissions have been set up.';
$string['settings_detectperms_invalid'] = 'Check permissions in Azure AD';
$string['settings_enableunifiedapi'] = 'Enable Unified API';
$string['settings_enableunifiedapi_details'] = 'The unified API is a preview API that provides some new features like the "Create user groups" setting below. It will eventually replace the application-specific Office APIs, however it is still in preview and is subject to change which may break some functionality. If you\'d like to try it out, enable this setting and click "Save changes". Add the "Unified API" to your application in Azure then return here and run the "Azure Setup" tool below.';
$string['settings_header_setup'] = 'Setup';
$string['settings_header_options'] = 'Options';
$string['settings_healthcheck'] = 'Health Check';
Expand Down
4 changes: 4 additions & 0 deletions local/o365/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
$desc = get_string('settings_o365china_details', 'local_o365');
$settings->add(new \admin_setting_configcheckbox('local_o365/chineseapi', $label, $desc, '0'));

$label = get_string('settings_enableunifiedapi', 'local_o365');
$desc = get_string('settings_enableunifiedapi_details', 'local_o365');
$settings->add(new \admin_setting_configcheckbox('local_o365/enableunifiedapi', $label, $desc, '0'));

$label = get_string('settings_creategroups', 'local_o365');
$desc = get_string('settings_creategroups_details', 'local_o365');
$settings->add(new \admin_setting_configcheckbox('local_o365/creategroups', $label, $desc, '0'));
Expand Down

0 comments on commit 04d60e8

Please sign in to comment.