示例#1
0
文件: Link.php 项目: ariol/adminshop
 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);
 }
示例#2
0
文件: Name.php 项目: ariol/adminshop
 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 = '&nbsp;&nbsp;<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));
 }
示例#3
0
文件: Child.php 项目: ariol/adminshop
 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));
 }
示例#4
0
 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>';
     }
 }
示例#5
0
文件: List.php 项目: ariol/adminshop
 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' => ', '));
 }
示例#6
0
文件: Orm.php 项目: ariol/adminshop
 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;
 }
示例#7
0
文件: More.php 项目: ariol/adminshop
    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>'));
    }
示例#8
0
 protected function _field($obj)
 {
     return View::factory($this->_field_template, array('value' => Extasy::obj_placeholders($obj, $this->_template)));
 }
示例#9
0
 /**
  * @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;
 }