mirror of
https://github.com/openclassify/openclassify.git
synced 2026-03-06 07:15:24 -06:00
Merge branch 'master' of https://github.com/openclassify/openclassify into basetheme
# Conflicts: # addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/author-button.twig # addons/default/visiosoft/advs-module/resources/views/list/list.twig # addons/default/visiosoft/advs-module/resources/views/list/partials/list-filter.twig # addons/default/visiosoft/base-theme/resources/config/settings.php # addons/default/visiosoft/base-theme/resources/js/filterLocation.js # addons/default/visiosoft/base-theme/resources/views/indexes/index.twig
This commit is contained in:
commit
c21a370d37
@ -154,7 +154,7 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
||||
|
||||
public function popularAdvs()
|
||||
{
|
||||
return $this->getAdv()->where('popular_adv', 1)->paginate(9);
|
||||
return $this->getAdv()->orderBy('count_show_ad', 'desc')->limit(10)->get();
|
||||
}
|
||||
|
||||
public function advsofDay()
|
||||
@ -230,12 +230,12 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
||||
$id = $object->id;
|
||||
$seo = str_slug($object->name);
|
||||
$seo = str_replace('_', '-', $seo);
|
||||
return \route('adv_detail_seo', [$id, $seo]);
|
||||
return \route('adv_detail_seo', [$seo, $id]);
|
||||
}
|
||||
$id = $object->getObject()->id;
|
||||
$seo = str_slug($object->getObject()->name);
|
||||
$seo = str_replace('_', '-', $seo);
|
||||
return \route('adv_detail_seo', [$id, $seo]);
|
||||
return \route('adv_detail_seo', [$seo, $id]);
|
||||
}
|
||||
|
||||
public function getAdvDetailLinkByAdId($id)
|
||||
@ -245,7 +245,7 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
||||
$id = $adv->id;
|
||||
$seo = str_slug($adv->name);
|
||||
$seo = str_replace('_', '-', $seo);
|
||||
return \route('adv_detail_seo', [$id, $seo]);
|
||||
return \route('adv_detail_seo', [$seo, $id]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,63 +1,16 @@
|
||||
<?php namespace Visiosoft\AdvsModule;
|
||||
|
||||
use Anomaly\FilesModule\Disk\Contract\DiskRepositoryInterface;
|
||||
use Anomaly\FilesModule\Folder\Contract\FolderRepositoryInterface;
|
||||
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
||||
use Anomaly\Streams\Platform\Model\Options\OptionsAdvertisementEntryModel;
|
||||
use Chumper\Zipper\Zipper;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Visiosoft\AdvsModule\Seed\BlockSeeder;
|
||||
|
||||
class AdvsModuleSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* The disk repository.
|
||||
*
|
||||
* @var DiskRepositoryInterface
|
||||
*/
|
||||
protected $disks;
|
||||
|
||||
/**
|
||||
* The folder repository.
|
||||
*
|
||||
* @var FolderRepositoryInterface
|
||||
*/
|
||||
protected $folders;
|
||||
|
||||
/**
|
||||
* Create a new FolderSeeder instance.
|
||||
*
|
||||
* @param DiskRepositoryInterface $disks
|
||||
* @param FolderRepositoryInterface $folders
|
||||
*/
|
||||
public function __construct(DiskRepositoryInterface $disks, FolderRepositoryInterface $folders)
|
||||
{
|
||||
$this->disks = $disks;
|
||||
$this->folders = $folders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the seeder.
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
//Download demo SQL
|
||||
$repository = "https://raw.githubusercontent.com/openclassify/Openclassify-Demo-Data/master/";
|
||||
file_put_contents(__DIR__."/demo.sql", fopen($repository."demo.sql", 'r'));
|
||||
//Download demo Files and Extract to Files
|
||||
file_put_contents("advs-files.zip", fopen($repository."advs-files.zip", 'r'));
|
||||
$zipper = new Zipper();
|
||||
$zipper->make('advs-files.zip')->folder('advs-files')->extractTo(base_path().'/public/app/default/files-module/local/images/');
|
||||
$zipper->close();
|
||||
|
||||
$this->call(BlockSeeder::class);
|
||||
|
||||
/* Demo Start */
|
||||
DB::table('files_files')->truncate();
|
||||
Model::unguard();
|
||||
DB::unprepared(file_get_contents(__DIR__.'/demo.sql'));
|
||||
Model::reguard();
|
||||
/* Demo Stop*/
|
||||
}
|
||||
}
|
||||
@ -118,12 +118,20 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
'as' => 'adv_detail_seo',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@view'
|
||||
],
|
||||
'ad/{id}' => [
|
||||
'as' => 'adv_detail',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@view'
|
||||
],
|
||||
'ad/{seo}/{id}' => [
|
||||
'as' => 'adv_detail_seo',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@view'
|
||||
],
|
||||
'advs/map?country={country}&city[]={city}&district={districts}' => [
|
||||
'as' => 'visiosoft.module.advs::show_ad_map_location',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@map'
|
||||
],
|
||||
'advs/categories' => 'Visiosoft\AdvsModule\Http\Controller\CategoriesController@index',
|
||||
'advs/categories/{cat}' => 'Visiosoft\AdvsModule\Http\Controller\CategoriesController@listByCat',
|
||||
'advs/c/{cat}' => 'Visiosoft\AdvsModule\Http\Controller\CategoriesController@listByCat',
|
||||
'advs/module_active' => 'Visiosoft\AdvsModule\Http\Controller\advsController@index',
|
||||
'advs/create_adv' => [
|
||||
'as' => "create_adv",
|
||||
|
||||
@ -83,8 +83,14 @@ class AdvsController extends AdminController
|
||||
|
||||
$table->setColumns([
|
||||
'cover_photo' => [
|
||||
'wrapper' => '<img width="64" src="{value.cover_photo}">',
|
||||
'value' => ['cover_photo' => 'entry.cover_photo']
|
||||
'wrapper' => function (EntryInterface $entry, Request $request) {
|
||||
if (strpos($entry->cover_photo, 'http') === 0) {
|
||||
$wrapper = '<img width="64" src="'.$entry->cover_photo.'">';
|
||||
} else {
|
||||
$wrapper = '<img width="64" src="'.$request->root().'/'.$entry->cover_photo.'">';
|
||||
}
|
||||
return $wrapper;
|
||||
},
|
||||
],
|
||||
'entry.id',
|
||||
'name' => [
|
||||
@ -183,6 +189,7 @@ class AdvsController extends AdminController
|
||||
|
||||
$default_adv_publish = $settings->value('visiosoft.module.advs::default_published_time');
|
||||
$adv->finish_at = date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . ' + ' . $default_adv_publish . ' day'));
|
||||
$adv->publish_at = date('Y-m-d H:i:s');
|
||||
|
||||
//algolia Search Module
|
||||
$isActiveAlgolia = new AdvModel();
|
||||
|
||||
@ -8,12 +8,24 @@ class CategoriesController extends PublicController {
|
||||
|
||||
public function listByCat($cat) {
|
||||
$advs = DB::table('advs_advs')
|
||||
->where('category_id', $cat)
|
||||
->where('cat1', $cat)
|
||||
->orwhere('cat2', $cat)
|
||||
->orwhere('cat3', $cat)
|
||||
->orwhere('cat4', $cat)
|
||||
->orwhere('cat5', $cat)
|
||||
->orwhere('cat6', $cat)
|
||||
->orwhere('cat7', $cat)
|
||||
->leftJoin('users_users as u1', 'advs_advs.created_by_id', '=', 'u1.id')
|
||||
->leftJoin('advs_advs_translations as t1', 'advs_advs.id', '=', 't1.id')
|
||||
->select('advs_advs.*','u1.username as owner', 't1.name as name')
|
||||
->get();
|
||||
|
||||
foreach ($advs as $adv) {
|
||||
if (strpos($adv->cover_photo, 'http') !== 0 && strpos($adv->cover_photo, '/') !== 0) {
|
||||
$adv->cover_photo = "/$adv->cover_photo";
|
||||
}
|
||||
}
|
||||
|
||||
return $this->view->make('visiosoft.module.advs::list/list', compact('advs'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,6 +146,18 @@ class AdvsController extends PublicController
|
||||
$subCats = array();
|
||||
|
||||
$param = $this->requestHttp->toArray();
|
||||
if (!isset($param['country'])) {
|
||||
if (is_null(Cookie::get('country'))) {
|
||||
$param['country'] = setting_value('visiosoft.module.advs::default_country');
|
||||
} else {
|
||||
$param['country'] = Cookie::get('country');
|
||||
}
|
||||
} else {
|
||||
if ($param['country'] != setting_value('visiosoft.module.advs::default_country')) {
|
||||
Cookie::queue(Cookie::make('country', $param['country'], 84000));
|
||||
}
|
||||
}
|
||||
$searchedCountry = $param['country'];
|
||||
|
||||
$countries = $this->country_repository->viewAll();
|
||||
|
||||
@ -213,7 +225,7 @@ class AdvsController extends PublicController
|
||||
}
|
||||
|
||||
$compact = compact('advs', 'countries', 'mainCats', 'subCats', 'textfields', 'checkboxes', 'request',
|
||||
'user', 'userProfile', 'featured_advs', 'type', 'topfields', 'ranges', 'seenList');
|
||||
'user', 'userProfile', 'featured_advs', 'type', 'topfields', 'ranges', 'seenList', 'searchedCountry');
|
||||
|
||||
Cookie::queue(Cookie::make('last_search', $this->requestHttp->getRequestUri(), 84000));
|
||||
|
||||
@ -233,8 +245,10 @@ class AdvsController extends PublicController
|
||||
return redirect($this->request->headers->get('referer'));
|
||||
}
|
||||
|
||||
public function view($id)
|
||||
public function view($seo, $id = null)
|
||||
{
|
||||
$id = is_null($id) ? $seo : $id;
|
||||
|
||||
$categories = array();
|
||||
$categories_id = array();
|
||||
$isActiveComplaints = $this->adv_model->is_enabled('complaints');
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'description' => 'الوصف',
|
||||
'post_ad' => 'انشر إعلانك',
|
||||
'profile' => 'الملف الشخصي',
|
||||
'my_messages' => 'رسائلي',
|
||||
'my_ads' => 'إعلاناتي',
|
||||
'login' => 'تسجيل الدخول',
|
||||
'logout' => 'تسجيل الخروج',
|
||||
'chose_language' => 'اختر اللغة',
|
||||
|
||||
'privacy_and_use' => 'الخصوصية والاستخدام',
|
||||
'sell_fast' => 'البيع السريع',
|
||||
'cloudsite' => 'موقع السحابة',
|
||||
'banner_advertising' => 'راية الإعلان',
|
||||
'trade_delivers' => 'أدوات التجارة',
|
||||
'promote_your_ad' => 'تعزيز إعلانك',
|
||||
'faq' => 'الأسئلة المتكررة',
|
||||
'follow_us_on' => 'تابعنا على',
|
||||
'newsletter' => 'النشرة الإخبارية',
|
||||
'subscribe' => 'اشترك!',
|
||||
'your_email' => 'بريدك الإلكتروني',
|
||||
'sign_up' => 'التسجيل',
|
||||
'copyright' => 'حقوق الطبع والنشر 2019. | طورت بواسطة',
|
||||
'cart' => 'سلتي',
|
||||
'search' => 'بحث',
|
||||
'type_your_keyword' => 'اكتب كلمتك المفتاحية',
|
||||
'categories' => 'الفئات',
|
||||
'contact_us' => '24/7 دعم العملاء',
|
||||
'help_center' => 'مركز المساعدة',
|
||||
'find_your_ad' => 'ابحث عن إعلانك',
|
||||
'vehicle_type' => 'نوع السيارة',
|
||||
'select_makes' => 'اختر الصانع',
|
||||
'browse_cars_by_makes'=> 'تصفح السيارات حسب الصانع',
|
||||
'featured_car_deals'=> 'عروض السيارات المميزة',
|
||||
'learn_more'=> 'تعلم المزيد',
|
||||
'advs_default_theme_homepage_mobile_app_title' => 'تنزيل من متجر التطبيقات',
|
||||
'advs_default_theme_homepage_mobile_app_available_on' => 'متوفر في',
|
||||
'all'=>'الكل',
|
||||
'trend_ads'=>'الإعلانات الشائعة',
|
||||
'single_cta1'=>'التداول الآمن',
|
||||
'single_cta2'=>'احصل على راحة البال مع زيادة الحماية للتداول الآمن.',
|
||||
'single_cta3'=>'دعم 24/7',
|
||||
'single_cta4'=>'خدمة العملاء 212 555 55 55',
|
||||
'single_cta5'=>'التجارة السهلة',
|
||||
'single_cta6'=>'مع خدمات الدفع الآمنة ، يمكن تنفيذ معاملاتك بشكل مريح.',
|
||||
'welcome'=> 'مرحبًا',
|
||||
];
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'send' => [
|
||||
'name' => 'إرسال',
|
||||
],
|
||||
];
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'post_ad' => 'انشر إعلانك',
|
||||
'featured_ads' => "الإعلانات المميزة",
|
||||
'recent_ads' => "الإعلانات الحديثة",
|
||||
'trending_ads' => 'الإعلانات الشائعة',
|
||||
'search_map' => 'البحث على الخريطة',
|
||||
'search' => 'بحث',
|
||||
'categories' => 'الفئات',
|
||||
'city' => 'المدينة',
|
||||
'last_search' => 'لمواصلة البحث الأخير',
|
||||
'join-us' => 'انضم إلينا',
|
||||
'sign-in' => 'تسجيل الدخول',
|
||||
'new-here' => 'جديد هنا؟',
|
||||
'scroll-screen-for-details' => 'مرر الشاشة لعرض الجدول',
|
||||
'close' => 'إغلاق',
|
||||
|
||||
|
||||
'login' => 'تسجيل الدخول',
|
||||
'email' => [
|
||||
'name' => 'عنوان البريد الإلكتروني',
|
||||
],
|
||||
'name' => [
|
||||
'name' => 'الاسم',
|
||||
],
|
||||
'subject' => [
|
||||
'name' => 'العنوان',
|
||||
],
|
||||
'content' => [
|
||||
'name' => 'المحتوى',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [];
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'meta_tags' => [
|
||||
'name' => 'كلمات ميتا المفتاحية',
|
||||
],
|
||||
'template' => [
|
||||
'name' => 'القالب',
|
||||
],
|
||||
's-type-latest-limit' => [
|
||||
'name' => 'الحد الأقصى من نوع-اس',
|
||||
],
|
||||
's-type-showcase' => [
|
||||
'name' => 'اسم حد عرض S-type',
|
||||
],
|
||||
's-type-banner-code' => [
|
||||
'name' => 'رمز شعار نوع-اس',
|
||||
],
|
||||
|
||||
's-type-banner-mobile-code' => [
|
||||
'name' => 'رمز الجوال لراية نوع-اس',
|
||||
],
|
||||
|
||||
'show_post_your_add_btn' => [
|
||||
'name' => 'أظهر زر "انشر اعلانك"',
|
||||
],
|
||||
|
||||
'show_home_search_on_map_btn' => [
|
||||
'name' => 'أظهر زر "على الخريطة" في البحث في الصفحة الرئيسية',
|
||||
],
|
||||
|
||||
'show_last_search_btn' => [
|
||||
'name' => 'أظهر زر "آخر عملية بحث"',
|
||||
],
|
||||
];
|
||||
@ -20,7 +20,7 @@ return [
|
||||
'name' => 'Seo Description'
|
||||
],
|
||||
'icon' => [
|
||||
' name' => 'ICON'
|
||||
'name' => 'Icon'
|
||||
],
|
||||
|
||||
'please_wait' => 'Please wait.Deleting Sub Categories',
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
<?php namespace Visiosoft\CatsModule;
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
||||
use Chumper\Zipper\Zipper;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Visiosoft\CatsModule\Category\CategorySeeder;
|
||||
use Visiosoft\CatsModule\Placeholderforsearch\PlaceholderforsearchSeeder;
|
||||
|
||||
class CatsModuleSeeder extends Seeder
|
||||
@ -13,22 +10,6 @@ class CatsModuleSeeder extends Seeder
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->call(CategorySeeder::class);
|
||||
|
||||
//Download demo SQL
|
||||
$repository = "https://raw.githubusercontent.com/openclassify/Openclassify-Demo-Data/master/";
|
||||
file_put_contents(__DIR__."/categories.sql", fopen($repository."categories.sql", 'r'));
|
||||
file_put_contents(__DIR__."/categoryTransEn.sql", fopen($repository."categoryTransEn.sql", 'r'));
|
||||
//Download demo Files and Extract to Files
|
||||
file_put_contents("category-files.zip", fopen($repository."category-files.zip", 'r'));
|
||||
$zipper = new Zipper();
|
||||
$zipper->make('category-files.zip')->folder('category-files')->extractTo(base_path().'/public/app/default/files-module/local/images/');
|
||||
$zipper->close();
|
||||
|
||||
$this->call(PlaceholderforsearchSeeder::class);
|
||||
Model::unguard();
|
||||
DB::unprepared(file_get_contents(__DIR__.'/categories.sql'));
|
||||
DB::unprepared(file_get_contents(__DIR__.'/categoryTransEn.sql'));
|
||||
Model::reguard();
|
||||
}
|
||||
}
|
||||
@ -2,9 +2,11 @@
|
||||
|
||||
use Anomaly\Streams\Platform\Image\Command\MakeImageInstance;
|
||||
use Anomaly\Streams\Platform\Model\Cats\CatsCategoryEntryModel;
|
||||
use Anomaly\Streams\Platform\Model\Cats\CatsCategoryEntryTranslationsModel;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
use Sunra\PhpSimple\HtmlDomParser;
|
||||
use Visiosoft\CatsModule\Category\CategoryCollection;
|
||||
use Visiosoft\CatsModule\Category\CategoryModel;
|
||||
use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface;
|
||||
use Visiosoft\CatsModule\Category\Form\CategoryFormBuilder;
|
||||
@ -13,6 +15,22 @@ use Anomaly\Streams\Platform\Http\Controller\AdminController;
|
||||
|
||||
class CategoryController extends AdminController
|
||||
{
|
||||
private $categoryRepository;
|
||||
private $categoryEntryTranslationsModel;
|
||||
private $str;
|
||||
|
||||
public function __construct(
|
||||
CategoryRepositoryInterface $categoryRepository,
|
||||
CatsCategoryEntryTranslationsModel $categoryEntryTranslationsModel,
|
||||
Str $str
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->categoryRepository = $categoryRepository;
|
||||
$this->categoryEntryTranslationsModel = $categoryEntryTranslationsModel;
|
||||
$this->str = $str;
|
||||
}
|
||||
|
||||
public function index(CategoryTableBuilder $table, Request $request)
|
||||
{
|
||||
if ($this->request->action == "delete") {
|
||||
@ -55,10 +73,76 @@ class CategoryController extends AdminController
|
||||
return $this->redirect->back();
|
||||
}
|
||||
|
||||
$form->make();
|
||||
if ($form->hasFormErrors()) {
|
||||
return $this->redirect->to('/admin/cats/create');
|
||||
$locale = DB::table('cats_category_translations')->select('locale')->distinct()->get()->toArray();
|
||||
$translatable = array();
|
||||
foreach ($all as $key => $value) {
|
||||
foreach ($locale as $lang) {
|
||||
if ($this->endsWith($key, "_$lang->locale") && !in_array(substr($key, 0, -3), $translatable)) {
|
||||
$translatable[] = substr($key, 0, -3);
|
||||
}
|
||||
}
|
||||
}
|
||||
$translatableEntries = array();
|
||||
foreach ($locale as $lang) {
|
||||
$translatableEntries[$lang->locale] = array();
|
||||
foreach ($translatable as $translatableEntry) {
|
||||
$translatableEntries[$lang->locale][$translatableEntry] = $all[$translatableEntry . '_' . $lang->locale];
|
||||
}
|
||||
}
|
||||
|
||||
// Check if there is multiple categories in the name filed
|
||||
$isMultiCat = array();
|
||||
foreach ($translatableEntries as $key => $translatableEntry) {
|
||||
$multiCat = explode(",", $translatableEntry['name']);
|
||||
if (count($multiCat) > 1) {
|
||||
$firstArray = array();
|
||||
foreach ($multiCat as $cat) {
|
||||
$secondArray = array();
|
||||
foreach ($locale as $lang) {
|
||||
if ($key === $lang->locale) {
|
||||
$secondArray[$key]['name'] = trim($cat);
|
||||
}
|
||||
}
|
||||
array_push($firstArray, $secondArray);
|
||||
}
|
||||
array_push($isMultiCat, $firstArray);
|
||||
}
|
||||
}
|
||||
if (empty($isMultiCat)) {
|
||||
$this->categoryRepository->create(array_merge($translatableEntries, [
|
||||
'slug' => $all['slug'],
|
||||
'parent_category' => $all['parent_category'] === "" ? null : $all['parent_category'],
|
||||
'icon' => $all['icon'],
|
||||
'seo_keyword' => $all['seo_keyword'],
|
||||
'seo_description' => $all['seo_description'],
|
||||
]));
|
||||
} else {
|
||||
for ($i = 0; $i < count($isMultiCat[0]); $i++) {
|
||||
foreach ($isMultiCat as $cat) {
|
||||
$translatableEntries = array_merge($translatableEntries, $cat[$i]);
|
||||
}
|
||||
$this->categoryRepository->create(array_merge($translatableEntries, [
|
||||
'slug' => $this->str->slug(reset($translatableEntries)['name'], '_'),
|
||||
'parent_category' => $all['parent_category'] === "" ? null : $all['parent_category'],
|
||||
'icon' => $all['icon'],
|
||||
'seo_keyword' => $all['seo_keyword'],
|
||||
'seo_description' => $all['seo_description'],
|
||||
]));
|
||||
}
|
||||
};
|
||||
|
||||
// $this->categoryRepository->create(array_merge($translatableEntries, [
|
||||
// 'slug' => $all['slug'],
|
||||
// 'parent_category' => $all['parent_category'],
|
||||
// 'icon' => $all['icon'],
|
||||
// 'seo_keyword' => $all['seo_keyword'],
|
||||
// 'seo_description' => $all['seo_description'],
|
||||
// ]));
|
||||
|
||||
// $form->make();
|
||||
// if ($form->hasFormErrors()) {
|
||||
// return $this->redirect->to('/admin/cats/create');
|
||||
// }
|
||||
if ($parent_id != "") {
|
||||
return $this->redirect->to('/admin/cats?cat=' . $parent_id);
|
||||
}
|
||||
@ -81,6 +165,13 @@ class CategoryController extends AdminController
|
||||
return $this->view->make('visiosoft.module.cats::cats/admin-cat', compact('nameField', 'formBuilder'));
|
||||
}
|
||||
|
||||
public function endsWith($string, $test) {
|
||||
$strlen = strlen($string);
|
||||
$testlen = strlen($test);
|
||||
if ($testlen > $strlen) return false;
|
||||
return substr_compare($string, $test, $strlen - $testlen, $testlen) === 0;
|
||||
}
|
||||
|
||||
|
||||
public function edit(CategoryFormBuilder $form, Request $request, $id)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user