protected function _field($obj) { $route_str = Extasy::obj_placeholders($obj, $this->_route_str); if (!ACL::is_route_allowed($route_str)) { return '<td></td>'; } return $this->_draw_field($obj); }
protected function _field($obj) { $editRoute = Extasy::obj_placeholders($obj, $this->_route_str); $editUrl = Extasy_Html::link_to_route($editRoute, $obj->name); $externalRoute = Extasy::obj_placeholders($obj, $this->_external_url); $externalIcon = ' <i class="fa fa-share-square"></i>'; $externalUrl = Extasy_Html::link_to_route($externalRoute, $externalIcon, array('target' => '_blank', 'class' => 'title-tooltip noborder', 'title' => 'Перейти на страницу сайта')); return View::factory($this->_field_template, array('align' => $this->_align, 'value' => $editUrl . $externalUrl)); }
protected function _field($obj) { $model = $this->_model; $field = $this->_field; $name = $obj->{$model}->{$field}; $externalRoute = Extasy::obj_placeholders($obj, $this->_external_url); $externalUrl = Extasy_Html::link_to_route($externalRoute, $name, array('target' => '_blank', 'class' => 'title-tooltip', 'title' => 'Перейти на страницу сайта')); return View::factory($this->_field_template, array('align' => $this->_align, 'value' => $externalUrl)); }
protected function _draw_field($obj) { $title = Extasy::obj_placeholders($obj, $this->_title); if ($obj->{'allow_' . $this->_action}()) { return parent::_draw_field($obj); } else { return '<td align="' . $this->_align . '"><font color="grey">' . $title . '</font></td>'; } }
protected function _field($obj) { $values = $obj[$this->get_name()]; if ($values instanceof ORM) { $values = $values->find_all(); } $values_out = array(); foreach ($values as $value) { $values_out[] = Extasy::obj_placeholders($value, $this->_template); } return View::factory($this->_field_template, array('values' => $values_out, 'separator' => ', ')); }
public function prepare_to_populate($value) { $model = ORM::factory($this->_model); foreach ($this->_rules as $rule) { $model->where($rule[0], $rule[1], Extasy::obj_placeholders($this->get_object(), $rule[2])); } if (!$value) { $value = NULL; } $model->where($this->_key, '=', $value); $obj = $model->find(); return $obj; }
protected function _field($obj) { $editRoute = Extasy::obj_placeholders($obj, $this->_route_str); $editUrl = Extasy_Html::link_to_route($editRoute, 'Редактировать', array('class' => 'btn')); return View::factory($this->_field_template, array('align' => $this->_align, 'value' => substr(strip_tags($obj[$this->get_name()]), 0, 250) . '... ' . '<a href="#myModal" data-toggle="modal"><i class="fa fa-eye"></i></a> <div style="margin-top: 25px;" id="myModal" class="modal fade" tabindex="1" role="dialog" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body"> ' . $obj[$this->get_name()] . ' </div> <div class="modal-footer">' . $editUrl . ' <button class="btn" data-dismiss="modal" aria-hidden="true">Закрыть</button> </div> </div> </div> </div>')); }
protected function _field($obj) { return View::factory($this->_field_template, array('value' => Extasy::obj_placeholders($obj, $this->_template))); }
/** * @return Navigation_Title */ public function title() { if (is_null($this->_title)) { $this->_title = new Navigation_Title(); $title = Arr::get($this->_cur_item, 'title', ''); if ($model = Arr::get($this->_cur_item, 'model', FALSE) and $id = $this->_cur_id) { $title = Extasy::obj_placeholders(array('model' => ORM::factory($model, $id)), $title); } $this->_title->set($title); } return $this->_title; }