/** +++Method Helpers */ private function uploadFiles($model, $modelName) { $attributes = $this->fileAttributes($model->edit); foreach ($attributes as $key => $attribute) { $name = InputFactory::getName($key, $attribute); $imagePath = FileHelper::upload($model, $modelName, $name, $attribute, true); if ($imagePath !== false) { $model->{$name} = $imagePath["fileName"]; } } return $model; }
</div> </div> </div> <div id="sidebar"> <div class="panel sidebar_section" id="filters_sidebar_section"> <h3>Filters</h3> <div class="panel_contents"> {{ Form::open("lara_admin/models/$modelName", 'GET', array("class"=>"filter_form", "id"=>"q_search", "accept-charset"=>"UTF-8")) }} <div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /></div> @if (isset($modelInstance)) @foreach( $modelInstance->edit as $id => $options ) <div> @if ( ! InputFactory::isFile($options)) <?php if (Input::get($modelName) != null) { $name = InputFactory::getName($id, $options); $oldInput = Input::get($modelName); if (isset($oldInput[$name])) { $modelInstance->{$name} = $oldInput[$name]; } //TODO refactor if (isset($oldInput[$name . "_lte"])) { $nameInput = $name . "_lte"; $modelInstance->{$nameInput} = $oldInput[$nameInput]; } if (isset($oldInput[$name . "_gte"])) { $nameInput = $name . "_gte"; $modelInstance->{$nameInput} = $oldInput[$nameInput]; } } //TODO refactor