예제 #1
0
 public function addDataFromModel(WorkspaceModel $model, Workspace $workspace, User $user, &$errors)
 {
     $modelWorkspace = $model->getWorkspace();
     $resourcesModels = $model->getResourcesModel();
     $homeTabs = $model->getHomeTabs();
     $resourcesInfos = array();
     $this->duplicateWorkspaceRoles($modelWorkspace, $workspace, $user);
     $this->duplicateOrderedTools($modelWorkspace, $workspace);
     $rootDirectory = $this->duplicateRootDirectory($modelWorkspace, $workspace, $user);
     $errors['resourceErrors'] = $this->duplicateResources($resourcesModels->toArray(), $rootDirectory, $workspace, $user, $resourcesInfos);
     $this->om->forceFlush();
     $errors['widgetConfigErrors'] = $this->duplicateHomeTabs($modelWorkspace, $workspace, $homeTabs->toArray(), $resourcesInfos);
 }
예제 #2
0
 /**
  * @param Workspace $workspace
  *
  * @EXT\Route(
  *     "/{model}/configure",
  *     name="claro_workspace_model_configure",
  *     options = {"expose"=true}
  * )
  *
  * @EXT\Template("ClarolineCoreBundle:Tool\workspace\parameters\model:configure.html.twig")
  */
 public function configureModelAction(WorkspaceModel $model)
 {
     $resourceModels = $model->getResourcesModel();
     $copied = [];
     $links = [];
     foreach ($resourceModels as $resourceModel) {
         $resourceModel->isCopy() ? $copied[] = $resourceModel : ($links[] = $resourceModel);
     }
     $root = $this->resourceManager->getWorkspaceRoot($model->getWorkspace());
     return array('model' => $model, 'copied' => $copied, 'links' => $links, 'rootId' => $root->getId(), 'workspace' => $model->getWorkspace());
 }