mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Remove extra code
This commit is contained in:
parent
d6191b04fa
commit
874c01cb63
@ -26,16 +26,16 @@
|
||||
'url': 'advs/save_adv',
|
||||
})|raw }}
|
||||
<input type="hidden" value="pending_user" name="status">
|
||||
<input type="hidden" name="cat1" value="{{ request.cat1 }}">
|
||||
<input type="hidden" name="cat2" value="{{ request.cat2 }}">
|
||||
<input type="hidden" name="cat3" value="{{ request.cat3 }}">
|
||||
<input type="hidden" name="cat4" value="{{ request.cat4 }}">
|
||||
<input type="hidden" name="cat5" value="{{ request.cat5 }}">
|
||||
<input type="hidden" name="cat6" value="{{ request.cat6 }}">
|
||||
<input type="hidden" name="cat7" value="{{ request.cat7 }}">
|
||||
<input type="hidden" name="cat8" value="{{ request.cat8 }}">
|
||||
<input type="hidden" name="cat9" value="{{ request.cat9 }}">
|
||||
<input type="hidden" name="cat10" value="{{ request.cat10 }}">
|
||||
<input type="hidden" name="cat1" value="{{ cats.cat1 }}">
|
||||
<input type="hidden" name="cat2" value="{{ cats.cat2 }}">
|
||||
<input type="hidden" name="cat3" value="{{ cats.cat3 }}">
|
||||
<input type="hidden" name="cat4" value="{{ cats.cat4 }}">
|
||||
<input type="hidden" name="cat5" value="{{ cats.cat5 }}">
|
||||
<input type="hidden" name="cat6" value="{{ cats.cat6 }}">
|
||||
<input type="hidden" name="cat7" value="{{ cats.cat7 }}">
|
||||
<input type="hidden" name="cat8" value="{{ cats.cat8 }}">
|
||||
<input type="hidden" name="cat9" value="{{ cats.cat9 }}">
|
||||
<input type="hidden" name="cat10" value="{{ cats.cat10 }}">
|
||||
<input type="hidden" id="currencies" name="currencies" value="">
|
||||
<input type="hidden" name="update_id" value="{{ id }}">
|
||||
<fieldset>
|
||||
|
||||
@ -66,7 +66,10 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
protected $routes = [
|
||||
'admin/advs/advs' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@index',
|
||||
'admin/advs/advs/create' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@create',
|
||||
'admin/advs/advs/edit/{id}' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@edit',
|
||||
'admin/advs/advs/edit/{id}' => [
|
||||
'middleware' => 'auth',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@edit'
|
||||
],
|
||||
'admin/advs/village' => 'Visiosoft\AdvsModule\Http\Controller\Admin\VillageController@index',
|
||||
'admin/advs/village/create' => 'Visiosoft\AdvsModule\Http\Controller\Admin\VillageController@create',
|
||||
'admin/advs/village/edit/{id}' => 'Visiosoft\AdvsModule\Http\Controller\Admin\VillageController@edit',
|
||||
|
||||
@ -685,26 +685,17 @@ class AdvsController extends PublicController
|
||||
return redirect('/advs/edit_advs/' . $new->id);
|
||||
}
|
||||
|
||||
public function edit
|
||||
(
|
||||
$id,
|
||||
AdvFormBuilder $advFormBuilder,
|
||||
AdvRepositoryInterface $advRepository,
|
||||
CategoryRepositoryInterface $categoryRepository,
|
||||
AdvModel $advModel
|
||||
)
|
||||
public function edit($id)
|
||||
{
|
||||
if (!Auth::user()) {
|
||||
redirect('/login?redirect=' . url()->current())->send();
|
||||
}
|
||||
$isActive = new AdvModel();
|
||||
$adv = $advRepository->getAdvArray($id);
|
||||
$adv = $this->adv_repository->find($id);
|
||||
|
||||
if (is_null($adv)) {
|
||||
$this->messages->error(trans('visiosoft.module.advs::message.no_add_found'));
|
||||
return $this->redirect->to(route('advs::create_adv'));
|
||||
}
|
||||
|
||||
$adv = $adv->toArray();
|
||||
|
||||
if ($adv['created_by_id'] != auth()->id()
|
||||
&& !auth()->user()->hasPermission('visiosoft.module.advs::advs.write')) {
|
||||
abort(403);
|
||||
@ -714,9 +705,9 @@ class AdvsController extends PublicController
|
||||
$cats = array();
|
||||
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
if ($adv[$cat . $i] != null) {
|
||||
$name = $categoryRepository->getSingleCat($adv[$cat . $i]);
|
||||
if (!is_null($name)) {
|
||||
if ($adv[$cat . $i]) {
|
||||
$name = $this->category_repository->getSingleCat($adv[$cat . $i]);
|
||||
if ($name) {
|
||||
$cats_d['cat' . $i] = $name->name;
|
||||
$cats['cat' . $i] = $name->id;
|
||||
} else {
|
||||
@ -729,8 +720,7 @@ class AdvsController extends PublicController
|
||||
$options = $this->optionRepository->findAllBy('adv_id', $id);
|
||||
|
||||
//Cloudinary Module
|
||||
$isActiveCloudinary = new AdvModel();
|
||||
$isActiveCloudinary = $isActiveCloudinary->is_enabled('cloudinary');
|
||||
$isActiveCloudinary = $this->adv_model->is_enabled('cloudinary');
|
||||
if ($isActiveCloudinary) {
|
||||
$CloudinaryModel = new VideoModel();
|
||||
$Cloudinary = $CloudinaryModel->getVideo($id)->get();
|
||||
@ -740,16 +730,17 @@ class AdvsController extends PublicController
|
||||
}
|
||||
}
|
||||
|
||||
$request = $cats;
|
||||
|
||||
$categories = array_keys($cats);
|
||||
|
||||
if ($isActive->is_enabled('customfields')) {
|
||||
$custom_fields = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->edit($adv, $categories, $cats);
|
||||
if ($this->adv_model->is_enabled('customfields')) {
|
||||
$custom_fields = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')
|
||||
->edit($adv, $categories, $cats);
|
||||
}
|
||||
|
||||
return $this->view->make('visiosoft.module.advs::new-ad/new-create', compact('id', 'cats_d',
|
||||
'request', 'Cloudinary', 'cities', 'adv', 'custom_fields', 'options'));
|
||||
return $this->view->make(
|
||||
'visiosoft.module.advs::new-ad/new-create',
|
||||
compact('id', 'cats_d', 'cats', 'Cloudinary', 'cities', 'adv', 'custom_fields', 'options')
|
||||
);
|
||||
}
|
||||
|
||||
public function statusAds($id, $type, SettingRepositoryInterface $settings, Dispatcher $events)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user