forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-69166 core_payment: Renamed plugintype name from pg to paygw
- Loading branch information
Showing
36 changed files
with
98 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
* @copyright 2019 Shamim Rezaie <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class pg extends base { | ||
class paygw extends base { | ||
public function is_uninstall_allowed() { | ||
return true; | ||
} | ||
|
@@ -73,9 +73,9 @@ public static function get_manage_url() { | |
public static function get_enabled_plugins() { | ||
global $CFG; | ||
|
||
$order = (!empty($CFG->pg_plugins_sortorder)) ? explode(',', $CFG->pg_plugins_sortorder) : []; | ||
$order = (!empty($CFG->paygw_plugins_sortorder)) ? explode(',', $CFG->paygw_plugins_sortorder) : []; | ||
if ($order) { | ||
$plugins = \core_plugin_manager::instance()->get_installed_plugins('pg'); | ||
$plugins = \core_plugin_manager::instance()->get_installed_plugins('paygw'); | ||
$order = array_intersect($order, array_keys($plugins)); | ||
} | ||
|
||
|
@@ -96,7 +96,7 @@ public function set_enabled(bool $newstate = true) { | |
} | ||
if ($newstate) { | ||
// Enable gateway plugin. | ||
$plugins = \core_plugin_manager::instance()->get_plugins_of_type('pg'); | ||
$plugins = \core_plugin_manager::instance()->get_plugins_of_type('paygw'); | ||
if (!array_key_exists($this->name, $plugins)) { | ||
// Can not be enabled. | ||
return; | ||
|
@@ -123,10 +123,10 @@ public static function set_enabled_plugins($list) { | |
$list = explode(',', $list); | ||
} | ||
if ($list) { | ||
$plugins = \core_plugin_manager::instance()->get_installed_plugins('pg'); | ||
$plugins = \core_plugin_manager::instance()->get_installed_plugins('paygw'); | ||
$list = array_intersect($list, array_keys($plugins)); | ||
} | ||
set_config('pg_plugins_sortorder', join(',', $list)); | ||
set_config('paygw_plugins_sortorder', join(',', $list)); | ||
\core_plugin_manager::reset_caches(); | ||
} | ||
|
||
|
@@ -136,7 +136,7 @@ public static function set_enabled_plugins($list) { | |
* @return string[] An array of the currency codes in the three-character ISO-4217 format | ||
*/ | ||
public function get_supported_currencies(): array { | ||
$classname = '\pg_'.$this->name.'\gateway'; | ||
$classname = '\paygw_'.$this->name.'\gateway'; | ||
|
||
return $classname::get_supported_currencies(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.