List of instances action

@return mixed
358843
public function indexAction()
    {
        // Get all instances
        $instances = $this->getManager()->findAll();
        
        $worker = $this->get('ringo_php_redmon.instance_worker');
        if(is_array($instances)) {
            foreach($instances as $index => $instance) {
                // Ping server and get potential error message
                $working = $worker->setInstance($instance)->ping();
                $instances[$index]->setWorking($working);
                $instances[$index]->setError($worker->getMessage());
            }
        }
        
        return $this->render(
            $this->getTemplatePath().'index.html.twig',
            array(
                'instances' => $instances 
            )
        );
    }
337576
public function listAction()
    {
        \Mmi\App\FrontController::getInstance()->getResponse()->setHeader('Content-type', 'application/json');
        if (!$this->object || !$this->objectId || !$this->hash || !$this->t) {
            return '';
        }
        if ($this->hash != md5(\Mmi\Session\Session::getId() . '+' . $this->t . '+' . $this->objectId)) {
            return '';
        }
        $files = [];
        foreach (\Cms\Orm\CmsFileQuery::imagesByObject($this->object, $this->objectId)->find() as $file) {
            $files[] = ['title' => $file->original, 'value' => $file->getUrl('default', '')];
        }
        return json_encode($files);
    }
1338838
public function listAction()
    {
        $arg = $this->request->get('args');
        $tasks = $this->taskProcessor->find($arg);

        $length = 0;
        foreach ($tasks as $t) $length = $length < strlen($t->getName()) ? strlen($t->getName()) : $length;

        foreach ($tasks as $task) {
            $this->send('%s        %s', str_pad($task->getName(), $length), $task->getShortDescription());
        }
    }
785527
public function behaviors() {

		return [
			'rbac' => [
				'class' => Yii::$app->core->getRbacFilterClass(),
				'actions' => [
					'profile'  => [ 'permission' => CoreGlobal::PERM_ADMIN ],
					'settings'  => [ 'permission' => CoreGlobal::PERM_ADMIN ]
				]
			],
			'verbs' => [
				'class' => VerbFilter::class,
				'actions' => [
					'profile'  => [ 'get', 'post' ],
					'settings'  => [ 'get', 'post' ]
				]
			]
		];
	}
81819
public function listAction()
    {
        $clients = $this->oauthManager->findVisibleClients();
        $friendRequests = $this->oauthManager->findAllFriendRequests();
        $pendingFriends = $this->oauthManager->findAllPendingFriends();

        return [
            'clients' => $clients,
            'friendRequests' => $friendRequests,
            'pendingFriends' => $pendingFriends,
        ];
    }
410410
protected function getDefaultRowActionInstance()
    {
        // Make the first action that is allowed for the current user
        foreach ($this->getModelInformation()->list->default_action as $data) {

            $permissions = $data->permissions();

            if ( ! empty($permissions) && ! cms_auth()->can($permissions)) {
                continue;
            }

            $instance = $this->getActionStrategyFactory()->make($data->strategy);

            // Initialize the instance with extra information
            $instance->initialize($data, $this->getModelInformation()->modelClass());

            return $instance;
        }

        return false;
    }
630310
public function listAction()
    {
        $products = $this->container->get('vespolina.product_manager')->findBy(array());

        return $this->container->get('templating')->renderResponse('VespolinaCommerceBundle:Product:list.html.'.$this->getEngine(), array('products' => $products));
    }
60880
public function actions()
    {
        if (class_exists($file = $this->getQualifiedClassNameOfType('Actions'))) {
            return $file;
        }

        if (list(/*$flag*/, $value) = $this->hasCommentFlag('actions')) {
            return $value;
        }

        return $this->actions;
    }
1186867
public function listAction()
    {
        $metaSetManager = $this->get('phlexible_meta_set.meta_set_manager');
        $metaSet = $metaSetManager->findAll();

        $data = [];
        foreach ($metaSet as $set) {
            /* @var $set MetaSetInterface */

            $data[] = [
                'id' => $set->getId(),
                'name' => $set->getName(),
                'createdAt' => $set->getCreatedAt() ? $set->getCreatedAt()->format('Y-m-d H:i:s') : null,
                'createUser' => $set->getCreateUser(),
                'modifiedAt' => $set->getModifiedAt() ? $set->getModifiedAt()->format('Y-m-d H:i:s') : null,
                'modifyUser' => $set->getModifyUser(),
                'revision' => $set->getRevision(),
            ];
        }

        return new JsonResponse(['sets' => $data]);
    }
600761
public function listAction()
    {
        $page = $this->getRequest()->getQuery('page', 0);
        $limit = $this->getRequest()->getQuery('limit', $this->defaultPageSize);
        $sort = $this->getRequest()->getQuery('sort', $this->defaultSort);
        $order = $this->getRequest()->getQuery('order', $this->defaultOrder);

        if (empty($sort)) {
            $sort = $this->defaultSort;
        }

        $offset = $limit * $page - $limit;
        if ($offset < 0) {
            $offset = 0;
        }

        /* @var $qb \Doctrine\ODM\MongoDB\Query\Builder */
        $qb = $this->getDocumentManager()->createQueryBuilder($this->getDocumentClass());
        $qb->select()
        ->sort($sort, $order)
        ->limit($limit)
        ->skip($offset);

        $this->handleSearch($qb);

        $paginator = new Paginator(new DoctrinePaginator($qb->getQuery()->execute()));
        $paginator->setDefaultItemCountPerPage($limit);
        $paginator->setCurrentPageNumber($page);
        $paginator->setPageRange($this->paginatorRange);

        return [
            'paginator' => $paginator,
            'sort' => $sort,
            'order' => $order,
            'page' => $page,
            'query' => $this->params()->fromQuery(),
        ];
    }
1265881
public function action()
    {
        $action = $this->revision->action;

        return array_get($this->actions, $action, $action);
    }
193766
public function has_active_instances() {
        global $DB;
        if (empty($this->definition->id)) {
            return false;
        }
        if ($this->hasactiveinstances === null) {
            $conditions = array('definitionid'  => $this->definition->id,
                        'status'  => gradingform_instance::INSTANCE_STATUS_ACTIVE);
            $this->hasactiveinstances = $DB->record_exists('grading_instances', $conditions);
        }
        return $this->hasactiveinstances;
    }
266541
public function listAction()
    {
        $params     = $this->params();
        $request    = $this->getRequest();
        $bodyOnly   = $request->isXmlHttpRequest();
        $page       = $params->fromRoute( 'page',
            $request->getPost( 'page',
                $request->getQuery( 'page', 1 )
            )
        );

        $view = new ViewModel( array(
            'paginator' => $this->getPaginator(),
            'page'      => ( (int) $page ) ?: 1,
            'format'    => $bodyOnly,
        ) );

        if ( $bodyOnly )
        {
            $view->setTerminal( true );
        }

        return $view;
    }
659440
public function getInstancesList() {
		$arr = array();
		foreach ($this->declaredInstances as $instanceName=>$classDesc) {
			//if (!isset($classDesc["class"])) {var_dump($instanceName);var_dump($classDesc);}
			$arr[$instanceName] = isset($classDesc['class'])?$classDesc['class']:null;
		}
		return $arr;
	}
349886
protected function _getAllowedActions()
    {
        $actions = $this->_action()->getConfig('scaffold.actions');
        if ($actions === null) {
            $actions = array_keys($this->_crud()->getConfig('actions'));
        }

        $extraActions = $this->_action()->getConfig('scaffold.extra_actions') ?: [];

        $allActions = array_merge(
            $this->_normalizeActions($actions),
            $this->_normalizeActions($extraActions)
        );

        $blacklist = (array)$this->_action()->getConfig('scaffold.actions_blacklist');
        $blacklist = array_combine($blacklist, $blacklist);
        foreach ($this->_crud()->getConfig('actions') as $action => $config) {
            if ($config['className'] === 'Crud.Lookup') {
                $blacklist[$action] = $action;
            }
        }

        return array_diff_key($allActions, $blacklist);
    }
674655
public function listAction()
    {
        $this->checkAuth($this->resources, $this->modules, AccessManager::VIEW);
        $request = $this->getRequest();

        if ($request->query->has('id')) {
            $request->query->remove('id');
        }

        $params = array_merge(
            $this->defaultLoopArgs,
            $request->query->all()
        );

        try {
            $results = $this->getLoopResults($params);
        } catch (\Exception $e) {
            throw new HttpException(500, json_encode(["error" => $e->getMessage()]));
        }

        return JsonResponse::create($results);
    }
632740
public function listAction()
    {
        $page = $this->getRequest()->getQuery('page', 0);
        $limit = $this->getRequest()->getQuery('limit', $this->defaultPageSize);
        $sort = $this->getRequest()->getQuery('sort', $this->defaultSort);
        $order = $this->getRequest()->getQuery('order', $this->defaultOrder);

        if (empty($sort)) {
            $sort = $this->defaultSort;
        }

        $offset = $limit * $page - $limit;
        if ($offset < 0) {
            $offset = 0;
        }

        /* @var $qb \Doctrine\ORM\QueryBuilder */
        $qb = $this->getEntityManager()->createQueryBuilder();
        $qb->add('select', 'e')
            ->add('from', $this->getEntityClass().' e')
            ->orderBy('e.'.$sort, $order)
            ->setFirstResult($offset)
            ->setMaxResults($limit);

        $this->handleSearch($qb);

        $paginator = new Paginator(new DoctrinePaginator(new LosPaginator($qb, false)));
        $paginator->setDefaultItemCountPerPage($limit);
        $paginator->setCurrentPageNumber($page);
        $paginator->setPageRange($this->paginatorRange);

        return [
            'paginator' => $paginator,
            'sort' => $sort,
            'order' => $order,
            'page' => $page,
            'query' => $this->params()->fromQuery(),
        ];
    }