Ejemplo n.º 1
0
 /**
  * @see \Auth\Dependency\ListInterface::getItems()
  */
 public function getItems(User $user, View $view, $limit)
 {
     $items = [];
     foreach ($this->repository->getUserOrganizations($user->getId(), $limit) as $organization) {
         $name = $organization->getOrganizationName();
         $title = $name ? $name->getName() : '**** DRAFT ****';
         $url = $view->url('lang/organizations/edit', ['id' => $organization->getId()]);
         $items[] = new ListItem($title, $url);
     }
     return $items;
 }
Ejemplo n.º 2
0
 /**
  * @see \Auth\Dependency\ListInterface::getItems()
  */
 public function getItems(User $user, View $view, $limit)
 {
     $items = [];
     foreach ($this->repository->getUserApplications($user->getId(), $limit) as $application) {
         $title = $application->getJob()->getTitle();
         $title .= ' (' . $view->dateFormat($application->getDateCreated()) . ')';
         $url = $view->url('lang/applications/detail', ['id' => $application->getId()]);
         $items[] = new ListItem($title, $url);
     }
     return $items;
 }
Ejemplo n.º 3
0
 /**
  * @see \Auth\Dependency\ListInterface::getItems()
  */
 public function getItems(User $user, View $view, $limit)
 {
     $items = [];
     foreach ($this->repository->getUserJobs($user->getId(), $limit) as $job) {
         $title = $job->getTitle() ?: $view->translate('untitled');
         $title .= ' (' . $view->dateFormat($job->getDateCreated(), 'short', 'none') . ')';
         $url = $view->url('lang/jobs/manage', ['action' => 'edit'], ['query' => ['id' => $job->getId()]]);
         $items[] = new ListItem($title, $url);
     }
     return $items;
 }
Ejemplo n.º 4
0
 public function render(PhpRenderer $view, SitePageBlockRepresentation $block)
 {
     parse_str($this->getData($block->data(), 'query'), $query);
     $previewQuery = $query;
     $previewQuery['limit'] = 10;
     $previewQuery['site_id'] = $block->page()->site()->id();
     $response = $this->getServiceLocator()->get('Omeka\\ApiManager')->search('items', $previewQuery);
     $preview = '<ul>';
     foreach ($response->getContent() as $item) {
         $preview .= '<li>' . $item->displayTitle() . '</li>';
     }
     $preview .= '</ul>';
     $link = $view->hyperlink('browse this', $view->url('site/resource', ['controller' => 'item'], ['query' => $query], true));
     return $preview . $link;
 }