Пример #1
0
 /** @inheritdoc */
 public function render(RenderInterface $renderer, QueryInterface $query, $object)
 {
     // Get all available groups from db
     $groupSelect = array();
     foreach ($query->className('group')->cond('Active', 1)->exec() as $group) {
         $groupSelect[] = $group->GroupID . ':' . $group->Name;
     }
     // Set view
     return $renderer->view($this->innerView)->set('class', $this->css)->set($object, 'item')->set(m('samsoncms_input_application')->createFieldByType($query, 4, $object, $this->name)->build(implode(',', $groupSelect)), 'field')->output();
 }
Пример #2
0
 /**
  * Render collection entity field inner block
  * @param RenderInterface $renderer
  * @param QueryInterface $query
  * @param mixed $object Entity object instance
  * @return string Rendered entity field
  */
 public function render(RenderInterface $renderer, QueryInterface $query, $object)
 {
     /** @var \samson\activerecord\structure $structure Material structures list */
     $html = array();
     if (isset($object->onetomany['_structure'])) {
         foreach ($object->onetomany['_structure'] as $structure) {
             $html[] = '<a class="inner" title="' . t('Перейти к материалам ЭСС', true) . '" href="' . url_build($renderer->id(), $structure->id) . '">' . $structure->Name . '</a>';
         }
     }
     // Render input field view
     return $renderer->view($this->innerView)->set($this->css, 'class')->set($object, 'item')->set(implode(', ', $html), 'navigation')->output();
 }
Пример #3
0
 /**
  * Render collection entity field inner block
  * @param RenderInterface $renderer
  * @param QueryInterface $query
  * @param mixed $object Entity object instance
  * @return string Rendered entity field
  */
 public function render(RenderInterface $renderer, QueryInterface $query, $object)
 {
     $html = '';
     $user =& $object->onetoone['_user'];
     if (isset($user)) {
         $html = isset($user['s_name']) ? $user['s_name'] : '';
         $html .= isset($user['f_name']) ? ' ' . $user['f_name'] : '';
         $html .= isset($user['t_name']) ? ' ' . $user['t_name'] : '';
     }
     // Render input field view
     return $renderer->view($this->innerView)->set($this->css, 'class')->set($html, 'field_html')->output();
 }
Пример #4
0
 /**
  * Render collection entity field inner block
  * @param RenderInterface $renderer
  * @param QueryInterface $query
  * @param mixed $object Entity object instance
  * @return string Rendered entity field
  */
 public function render(RenderInterface $renderer, QueryInterface $query, $object)
 {
     $status = '';
     switch ($object->status) {
         case 0:
             $status = 'New';
             break;
         case 1:
             $status = 'Delivered';
             break;
         case 2:
             $status = 'Declined';
             break;
         case 3:
             $status = 'Deleted';
             break;
     }
     // Render input field view
     return $renderer->view($this->innerView)->set('class', $this->css)->set($object, 'item')->set('status', $status)->output();
 }
Пример #5
0
 /**
  * Render collection entity field header block
  * @param RenderInterface $renderer
  * @return string Rendered entity field
  */
 public function renderHeader(RenderInterface $renderer)
 {
     // Default sorting destination
     $dest = 'asc';
     // Default sorting class
     $sortClass = '';
     // If current field has sorting GET parameter
     if (isset($_GET['sort' . $this->name])) {
         // Change sorting destination
         $dest = $_GET['sort' . $this->name] == 'asc' ? 'desc' : 'asc';
         // Set sorting class as destination value
         $sortClass = $_GET['sort' . $this->name];
     }
     // Build part of url with existed GET parameters
     $link = '?';
     foreach ($_GET as $key => $value) {
         if (!substr_count($key, 'sort')) {
             $link .= $key . '=' . $value . '&';
         }
     }
     $link .= 'sort' . $this->name . '=' . $dest;
     // Render input field view
     return $renderer->view($this->headerView)->set($this->css, 'class')->set($this->title, 'field')->set($this->sortable, 'canSort')->set($sortClass, 'sortClass')->set($link, 'sortLink')->output();
 }
Пример #6
0
 /**
  * Render collection entity field inner block
  * @param RenderInterface $renderer
  * @param QueryInterface $query
  * @param mixed $object Entity object instance
  * @return string Rendered entity field
  */
 public function render(RenderInterface $renderer, QueryInterface $query, $object)
 {
     // Render input field view
     return $renderer->view($this->innerView)->set('class', $this->css)->set($object, 'item')->output();
 }