Skip to content

Instantly share code, notes, and snippets.

@dmsysop
Created December 15, 2015 11:37
Show Gist options
  • Save dmsysop/33ff03145a3150001148 to your computer and use it in GitHub Desktop.
Save dmsysop/33ff03145a3150001148 to your computer and use it in GitHub Desktop.
public function AdminFileInputNew($position = null, $input = null, $field = null) {
$position = !isset($position) ? 0 : $position;
$field = !isset($field) ? 'arquivo' : $field;
$input = !isset($input) ? 'Imagem' : $input;
$fileInput = '
<script type="text/javascript" src="' . $this->params->base . '/media/js/fileinput.js"></script>
<div class="form-group">
<label class="col-sm-2 control-label">' . ucfirst($input) . ':</label>
<div class="col-sm-10">
<div class="fileinput fileinput-new" data-provides="fileinput">
<div class="fileinput-new thumbnail" style="width: 190px; height: 214px;" data-trigger="fileinput">
<img src="http://placehold.it/190x214" alt="...">
</div>
<div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 710px; max-height: 230px"></div>
<div>
<span class="btn btn-white btn-file">
<span class="fileinput-new btn btn-hover btn-default btn-block">Selecione a imagem</span>
<span class="fileinput-exists btn btn-hover btn-success btn-block">Trocar</span>
<input type="file" name="data[Media][file][' . $position . ']" id="imagemnova" />
</span>
<a href="#" class="fileinput-exists btn btn-hover btn-warning btn-block" data-dismiss="fileinput">Remover</a>
</div>
</div>
</div>
</div>';
return $fileInput;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment