/** * Render content. * * @return string */ public function content() { ob_start(); // Cover if (Valid::url($this->track->cover)) { echo HTML::image($this->track->cover, array('class' => 'cover img-responsive', 'alt' => __('Cover'))); } // Time if ($this->track->size_time) { echo '<i class="fa fa-fw fa-clock-o"></i> ' . $this->track->size_time . '<br />'; } // Listen count if ($this->track->listen_count > 1) { echo '<i class="fa fa-fw fa-play"></i> ' . ($this->track->listen_count == 1 ? __(':count play', array(':count' => $this->track->listen_count)) : __(':count plays', array(':count' => $this->track->listen_count))) . '<br />'; } // Tags if ($tags = $this->track->tags()) { echo '<i class="fa fa-fw fa-music"></i> ' . implode(', ', $tags) . '<br />'; } elseif (!empty($this->track->music)) { echo '<i class="fa fa-fw fa-music"></i> ' . $this->track->music . '<br />'; } // Meta echo '<footer class="meta text-muted">'; echo __('Added :date', array(':date' => HTML::time(Date::format(Date::DMY_SHORT, $this->track->created), $this->track->created))); echo '</footer>'; return ob_get_clean(); }
/** * Render content. * * @return string */ public function content() { ob_start(); echo Form::open(null, array('id' => 'form-music', 'class' => 'row')); ?> <div class="col-md-8"> <fieldset> <?php echo Form::input_wrap('name', $this->track->name, array('class' => 'input-lg'), __('Name'), Arr::get($this->errors, 'name')); ?> <?php echo Form::input_wrap('url', $this->track->url, array('placeholder' => 'http://'), __('URL'), Arr::get($this->errors, 'url')); ?> <?php echo Form::textarea_wrap('description', $this->track->description, null, true, __('Description'), Arr::get($this->errors, 'description')); ?> <?php if ($this->track->type == Model_Music_Track::TYPE_MIX) { echo Form::textarea_wrap('tracklist', $this->track->tracklist, null, true, __('Tracklist'), Arr::get($this->errors, 'tracklist')); } ?> </fieldset> <fieldset class="form-actions"> <?php echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large')); ?> <?php echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : ''; ?> <?php echo Form::csrf(); ?> </fieldset> </div> <div class="col-md-4"> <fieldset> <?php echo Form::input_wrap('cover', $this->track->cover, array('placeholder' => 'http://'), __('Cover'), Arr::get($this->errors, 'cover')); ?> <?php echo Form::input_wrap('size_time', $this->track->size_time, array('maxlength' => $this->track->type == Model_Music_Track::TYPE_MIX ? 8 : 6, 'placeholder' => $this->track->type == Model_Music_Track::TYPE_MIX ? __('hh:mm:ss') : __('mm:ss')), __('Length'), Arr::get($this->event_errors, 'size_time'), null, 'min'); ?> </fieldset> <fieldset id="fields-music"> <?php echo Form::checkboxes_wrap('tag', $this->tags(), $this->track->tags(), array('class' => 'block-grid three-up'), __('Music'), $this->errors); ?> </fieldset> </div> <?php echo Form::close(); return ob_get_clean(); }