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