community hub MDL-22976 make community hub ws call compatible to a futur protocol change
This commit is contained in:
@@ -80,7 +80,7 @@ if (empty($cancel) and $unregistration and $confirm and confirm_sesskey()) {
|
||||
//unpublish the courses by web service
|
||||
if (!empty($hubcourseids)) {
|
||||
$function = 'hub_unregister_courses';
|
||||
$params = array($hubcourseids);
|
||||
$params = array('courseids' => $hubcourseids);
|
||||
$serverurl = $huburl . "/local/hub/webservice/webservices.php";
|
||||
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
|
||||
try {
|
||||
|
||||
@@ -64,7 +64,7 @@ class registration_manager {
|
||||
foreach ($hubs as $hub) {
|
||||
//update the registration
|
||||
$siteinfo = $this->get_site_info($hub->huburl);
|
||||
$params = array($siteinfo);
|
||||
$params = array('siteinfo' => $siteinfo);
|
||||
$serverurl = $hub->huburl . "/local/hub/webservice/webservices.php";
|
||||
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
|
||||
try {
|
||||
|
||||
@@ -111,7 +111,7 @@ if ($update and confirm_sesskey()) {
|
||||
//update the registration
|
||||
$function = 'hub_update_site_info';
|
||||
$siteinfo = $registrationmanager->get_site_info($huburl);
|
||||
$params = array($siteinfo);
|
||||
$params = array('siteinfo' => $siteinfo);
|
||||
$serverurl = $huburl . "/local/hub/webservice/webservices.php";
|
||||
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
|
||||
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $registeredhub->token);
|
||||
|
||||
@@ -119,7 +119,8 @@ class course_publication_form extends moodleform {
|
||||
$options = new stdClass();
|
||||
$options->ids = array($publication->hubcourseid);
|
||||
$options->allsitecourses = 1;
|
||||
$params = array('', $share, !$share, $options);
|
||||
$params = array('search' => '', 'downloadable' => $share,
|
||||
'enrollable' => !$share, 'options' => $options);
|
||||
$serverurl = $huburl . "/local/hub/webservice/webservices.php";
|
||||
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
|
||||
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $registeredhub->token);
|
||||
|
||||
@@ -69,7 +69,8 @@ if (has_capability('moodle/course:publish', get_context_instance(CONTEXT_COURSE,
|
||||
} else {
|
||||
//get all site courses registered on this hub
|
||||
$function = 'hub_get_courses';
|
||||
$params = array('', 1, 1, array( 'allsitecourses' => 1));
|
||||
$params = array('search' => '', 'downloadable' => 1,
|
||||
'enrollable' => 1, 'options' => array( 'allsitecourses' => 1));
|
||||
$serverurl = $hub->huburl."/local/hub/webservice/webservices.php";
|
||||
require_once($CFG->dirroot."/webservice/xmlrpc/lib.php");
|
||||
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
|
||||
@@ -128,7 +129,7 @@ if (has_capability('moodle/course:publish', get_context_instance(CONTEXT_COURSE,
|
||||
//unpublish the publication by web service
|
||||
$registeredhub = $registrationmanager->get_registeredhub($huburl);
|
||||
$function = 'hub_unregister_courses';
|
||||
$params = array(array( $publication->hubcourseid));
|
||||
$params = array('courseids' => array( $publication->hubcourseid));
|
||||
$serverurl = $huburl."/local/hub/webservice/webservices.php";
|
||||
require_once($CFG->dirroot."/webservice/xmlrpc/lib.php");
|
||||
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $registeredhub->token);
|
||||
|
||||
@@ -172,7 +172,7 @@ if (has_capability('moodle/course:publish', get_context_instance(CONTEXT_COURSE,
|
||||
|
||||
//publish the course information
|
||||
$function = 'hub_register_courses';
|
||||
$params = array(array($courseinfo));
|
||||
$params = array('courses' => array($courseinfo));
|
||||
$serverurl = $huburl . "/local/hub/webservice/webservices.php";
|
||||
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
|
||||
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $registeredhub->token);
|
||||
|
||||
Reference in New Issue
Block a user