Display a list of existing workspaces

@return void
175621
public function listCommand()
    {
        $workspaces = $this->workspaceRepository->findAll();

        if ($workspaces->count() === 0) {
            $this->outputLine('No workspaces found.');
            $this->quit(0);
        }

        $tableRows = [];
        $headerRow = ['Name', 'Base Workspace', 'Title', 'Owner', 'Description'];

        foreach ($workspaces as $workspace) {
            $owner = $workspace->getOwner() ? $workspace->getOwner()->getName() : '';
            $tableRows[] = [$workspace->getName(), ($workspace->getBaseWorkspace() ? $workspace->getBaseWorkspace()->getName() : ''), $workspace->getTitle(), $owner, $workspace->getDescription()];
        }
        $this->output->outputTable($tableRows, $headerRow);
    }
297218
protected function setAppConfigNamespaces()
    {
        $search = [
            $this->currentRoot.'\\Providers',
            $this->currentRoot.'\\Http\\Controllers\\',
        ];

        $replace = [
            $this->argument('name').'\\Providers',
            $this->argument('name').'\\Http\\Controllers\\',
        ];

        $this->replaceIn($this->getConfigPath('app'), $search, $replace);
    }
1104096
public function listCommand()
    {
        $head = ['Name', 'Stashed At', 'From Preset', 'Cloned At'];
        $rows = [];
        $basePath = sprintf(FLOW_PATH_ROOT . 'Data/MagicWandStash');

        if (!is_dir($basePath)) {
            $this->renderLine('Stash is empty.');
            $this->quit(1);
        }

        $baseDir = new \DirectoryIterator($basePath);
        $anyEntry = false;

        foreach ($baseDir as $entry) {
            if (!in_array($entry, ['.', '..'])) {
                $stashEntryName = $entry->getFilename();
                $manifest = $this->readStashEntryManifest($stashEntryName) ?: [];

                $rows[] = [
                    $stashEntryName,
                    $manifest['stashed_at'] ? date('Y-m-d H:i:s', $manifest['stashed_at']) : 'N/A',
                    isset($manifest['preset']['name']) ? $manifest['preset']['name'] : 'N/A',
                    $manifest['cloned_at'] ? date('Y-m-d H:i:s', $manifest['cloned_at']) : 'N/A',
                ];

                $anyEntry = true;
            }
        }

        if (!$anyEntry) {
            $this->renderLine('Stash is empty.');
            $this->quit(1);
        }

        $this->output->outputTable($rows, $head);
    }
55348
public function personalWorkspaceResourceRightsConfigAction()
    {
        $roles = $this->roleManager->getAllPlatformRoles();
        $rights = $this->rightsManager->getAllPersonalWorkspaceRightsConfig();

        return array(
            'roles' => $roles,
            'rights' => $rights
        );
    }
409862
public function Index() {
      $this->AddJsFile('setup.js');
      
      $this->ApplicationFolder = 'dashboard';
      $this->MasterView = 'setup';
      // Fatal error if Garden has already been installed.
      $Installed = C('Garden.Installed');
      if ($Installed) {
         $this->View = "AlreadyInstalled";
         $this->Render();
         return;
      }
      
      if (!$this->_CheckPrerequisites()) {
         $this->View = 'prerequisites';
      } else {
         $this->View = 'configure';
         
         // Make sure the user has copied the htaccess file over.
         if (!file_exists(PATH_ROOT.'/.htaccess') && !$this->Form->GetFormValue('SkipHtaccess')) {
            $this->SetData('NoHtaccess', TRUE);
            $this->Form->AddError(T('You are missing Vanilla\'s .htaccess file.', 'You are missing Vanilla\'s <b>.htaccess</b> file. Sometimes this file isn\'t copied if you are using ftp to upload your files because this file is hidden. Make sure you\'ve copied the <b>.htaccess</b> file before continuing.'));
         }
         
         $ApplicationManager = new Gdn_ApplicationManager();
         
         // Need to go through all of the setups for each application. Garden,
         if ($this->Configure() && $this->Form->IsPostBack()) {
            // Get list of applications to enable during install
            // Override by creating conf/config.php and adding this setting before install begins
            $AppNames = C('Garden.Install.Applications', array('Conversations', 'Vanilla'));
            try {
               // Step through the available applications, enabling each of them.
               foreach ($AppNames as $AppName) {
                  $Validation = new Gdn_Validation();
                  $ApplicationManager->RegisterPermissions($AppName, $Validation);
                  $ApplicationManager->EnableApplication($AppName, $Validation);
               }
            } catch (Exception $ex) {
               $this->Form->AddError($ex);
            }
            if ($this->Form->ErrorCount() == 0) {
               // Save a variable so that the application knows it has been installed.
               // Now that the application is installed, select a more user friendly error page.
               $Config = array('Garden.Installed' => TRUE);
               SaveToConfig($Config);
               
               // Go to the dashboard
               Redirect('/settings/gettingstarted');
            }
         }
      }
      $this->Render();
   }
749166
protected function loadViews()
    {
        if (is_dir($appPath = $this->publishViewPath())) {
            view()->addNamespace($this->getKey(), $appPath);
        }

        view()->addNamespace($this->getKey(), $this->getViewsPath());
    }
339294
protected function loadNamespaces(){
        $namespaces = [];
        foreach($this->queryXPath('namespace::*') as $node){
            $name = preg_replace('/xmlns(:)?/', '', $node->nodeName);
            if($name !== 'xml'){//always removed the implicit xml namespace
                $namespaces[$name] = $node->nodeValue;
            }
        }
        ksort($namespaces);
        foreach($namespaces as $name => $uri){
            $this->item->addNamespace($name, $uri);
        }
    }
589491
public function cleanupWorkspacesAfterFinalizing()
    {
        $queryBuilder = $this->getQueryBuilder();

        $constraints = [
            $queryBuilder->expr()->andX(
                $queryBuilder->expr()->eq(
                    'pid',
                    $queryBuilder->createNamedParameter(-1, \PDO::PARAM_INT)
                ),
                $queryBuilder->expr()->eq(
                    't3ver_wsid',
                    $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
                ),
                $queryBuilder->expr()->gt(
                    't3ver_id',
                    $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
                )
            ),
        ];

        $queryBuilder->delete('tt_content')
            ->where(...$constraints)
            ->execute();
    }
1205556
public function GetList() {
        $namespacePrefix = "\\Applications\\" .
                "APP_NAME" .
                "\\Resources\\Common\\";
        $resourceNamespace = $this->GetResourceNamespace($namespacePrefix, $this->GroupValue);
        $resourceFile = new $resourceNamespace();
        return $resourceFile->GetList();
    }
206759
public function listAction()
    {
        $this->checkFolders();
        $this->view->assign('missingFolders', $this->missingFolders);
        $this->view->assign('storages', $this->storageRepository->load());
    }
331314
public function Index() {
      $this->Permission('Garden.Messages.Manage');
      $this->AddSideMenu('dashboard/message');
      $this->AddJsFile('jquery.autogrow.js');
      $this->AddJsFile('jquery.tablednd.js');
      $this->AddJsFile('jquery-ui.js');
      $this->AddJsFile('messages.js');
      $this->Title(T('Messages'));
         
      // Load all messages from the db
      $this->MessageData = $this->MessageModel->Get('Sort');
      $this->Render();
   }
1114228
public function getNamespaces()
    {
        $db = Database::getActiveConnection();

        /** @var PDOStatement $results */
        $results = $db->createQueryBuilder()
            ->select('configNamespace')
            ->from('Config', 'c')
            ->where('configNamespace != ""')
            ->groupBy('configNamespace')
            ->execute();

        return array_map('array_shift', $results->fetchAll());
    }
1203812
protected function getReservations() {
        if (!$this->_reservations) {
            $this->_reservations = new ReservationList(
                $this->version,
                $this->solution['workspaceSid'],
                $this->solution['sid']
            );
        }

        return $this->_reservations;
    }
873186
def get_workspaces(self):
        
        data = self.message(MessageType.GET_WORKSPACES, '')
        return json.loads(data, object_hook=WorkspaceReply)
248136
public function getWorkspaces()
    {
        return $this->getCachedProperty(
            'workspaces',
            function () {
                $workspaces = [];
                $items = $this->getDomElement()->getElementsByTagNameNS($this->ns(), 'workspace');
                foreach ($items as $item) {
                    $workspaces[] = $this->getExtensions()->parseElement($this, $item);
                }

                return $workspaces;
            }
        );
    }
132590
def my_workspaces(context):
    
    pc = api.portal.get_tool('portal_catalog')
    brains = pc(
        portal_type="ploneintranet.workspace.workspacefolder",
        sort_on="modified",
        sort_order="reversed",
    )
    workspaces = [
        {
            'id': brain.getId,
            'title': brain.Title,
            'description': brain.Description,
            'url': brain.getURL(),
            'activities': get_workspace_activities(brain),
            'class': escape_id_to_class(brain.getId),
        } for brain in brains
    ]
    return workspaces
290357
public function setWorkspace(Workspace $workspace = null)
    {
        if ($this->workspace !== $workspace) {
            $this->workspace = $workspace;
            $this->addOrUpdate();
        }
    }