Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $site = $this->_convertSoapToJson($this->execute('getSite', $templateSakaiSiteId));
- $success = $this->execute('copySiteAndContent', $templateSakaiSiteId, $newSiteId, $class['name'], $siteDescription, '', '', '', false, RZIM_Model_Class::CLASS_ROLE_ACCESS, true, true, $sakaiSkin, 'project');
- if( $success != 'success' ) {
- throw new XenForo_Exception($success);
- }
- usleep(5); // wait until its done
- $pageTitle = $class['shortname'];
- $toolTitle = $pageTitle . ' Class';
- $result = $this->execute('addNewPageToSite', $newSiteId, $pageTitle, 0, 1, false);
- if ( $result == 'success' ){
- // if page is added successfully then we add the tool now!
- $result = $this->execute('addNewToolToPage', $newSiteId, $pageTitle, $toolTitle, 'sakai.iframe', '0,0');
- if( $result == 'success' ){
- $properties = array(
- 'height' => '1200px',
- 'source' => XenForo_Link::buildPublicLink('full:class', $class, array('sakai'=>1))
- );
- foreach( $properties AS $propertyName => $propertyValue ){
- $result = $this->execute('addConfigPropertyToTool', $newSiteId, $pageTitle, $toolTitle, $propertyName, $propertyValue);
- if( $result != 'success' ){
- throw new XenForo_Exception($result);
- }
- }
- } else {
- throw new XenForo_Exception($result);
- }
- } else {
- throw new XenForo_Exception($result);
- }
- // remove all sakai properties
- foreach( $site['properties'] AS $propertyName => $propertyValue ){
- $success = $this->execute('removeSiteProperty', $newSiteId, $propertyName);
- if( $success != 'success' ) {
- throw new XenForo_Exception($success);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement