protected static function render_field(Jam_Model $item, Jam_Field $field) { $value = $item->{$field->name}; if ($field instanceof Jam_Field_Integer) { return HTML::chars(number_format($value)); } elseif ($field instanceof Jam_Field_Float) { return HTML::chars(number_format($value, 2)); } elseif ($field instanceof Jam_Field_Boolean) { return $value ? '<i class="icon-ok"></i>' : ''; } elseif ($field instanceof Jam_Field_Serialized) { return Debug::vars($value); } elseif ($field instanceof Jam_Field_Timestamp) { if (!$value) { return '-'; } $time = is_numeric($value) ? $value : strtotime($value); return '<span title="' . date('j M Y H:i:s', $time) . '">' . Tart_Html::date_span($time) . '</span>'; } elseif ($field instanceof Jam_Field_Weblink) { return Text::limit_chars(HTML::chars($value), 30) . ' ' . HTML::anchor($value, '<i class="icon-share-alt"></i>'); } elseif ($field instanceof Jam_Field_Text) { return Text::widont(Text::limit_chars(HTML::chars($value), 40)); } elseif ($field instanceof Jam_Field_Upload) { return HTML::image($value->url(TRUE), array('class' => 'img-polaroid', 'alt' => $item->name())); } else { return HTML::chars($value); } }
public static function _no_primary_key_pattern(Jam_Model $model) { return $model->name(); }
public static function _slug(Jam_Model $model) { return $model->name(); }