Advertisement
Guest User

Untitled

a guest
Dec 7th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.67 KB | None | 0 0
  1. $site = $this->_convertSoapToJson($this->execute('getSite', $templateSakaiSiteId));
  2.                        
  3.             $success = $this->execute('copySiteAndContent', $templateSakaiSiteId, $newSiteId, $class['name'], $siteDescription, '', '', '', false, RZIM_Model_Class::CLASS_ROLE_ACCESS, true, true, $sakaiSkin, 'project');
  4.             if( $success != 'success' ) {
  5.                 throw new XenForo_Exception($success);
  6.             }
  7.            
  8.             usleep(5); // wait until its done
  9.            
  10.             $pageTitle = $class['shortname'];
  11.             $toolTitle = $pageTitle . ' Class';
  12.             $result = $this->execute('addNewPageToSite', $newSiteId, $pageTitle, 0, 1, false);
  13.            
  14.             if ( $result == 'success' ){
  15.                 // if page is added successfully then we add the tool now!
  16.                 $result = $this->execute('addNewToolToPage', $newSiteId, $pageTitle, $toolTitle, 'sakai.iframe', '0,0');
  17.                
  18.                 if( $result == 'success' ){
  19.                     $properties = array(
  20.                         'height' => '1200px',
  21.                         'source' => XenForo_Link::buildPublicLink('full:class', $class, array('sakai'=>1))
  22.                     );
  23.                     foreach( $properties AS $propertyName => $propertyValue ){
  24.                         $result = $this->execute('addConfigPropertyToTool', $newSiteId, $pageTitle, $toolTitle, $propertyName, $propertyValue);
  25.                         if( $result != 'success' ){
  26.                             throw new XenForo_Exception($result);
  27.                         }
  28.                     }
  29.                 } else {
  30.                     throw new XenForo_Exception($result);
  31.                 }
  32.             } else {
  33.                 throw new XenForo_Exception($result);
  34.             }
  35.            
  36.             // remove all sakai properties
  37.             foreach( $site['properties'] AS $propertyName => $propertyValue ){
  38.                 $success = $this->execute('removeSiteProperty', $newSiteId, $propertyName);
  39.                 if( $success != 'success' ) {
  40.                     throw new XenForo_Exception($success);
  41.                 }
  42.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement