diff --git a/modules/ContactForm/Config/.gitkeep b/modules/ContactForm/Config/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/modules/ContactForm/Config/config.php b/modules/ContactForm/Config/config.php deleted file mode 100644 index c4bbdcdb..00000000 --- a/modules/ContactForm/Config/config.php +++ /dev/null @@ -1,12 +0,0 @@ - 'ContactForm', - 'translatedName' => 'contactform::module.name', - 'translatedDescription' => 'contactform::module.description', - 'alias' => 'contactform', - 'handler' => '\\Modules\\ContactForm\\Handlers\\ContactForm', - 'providers' => [\Modules\ContactForm\Providers\ContactFormServiceProvider::class], - 'files' => ['start.php'], - 'order' => 0, -]; \ No newline at end of file diff --git a/modules/ContactForm/Handlers/ContactForm.php b/modules/ContactForm/Handlers/ContactForm.php deleted file mode 100644 index 3755038e..00000000 --- a/modules/ContactForm/Handlers/ContactForm.php +++ /dev/null @@ -1,152 +0,0 @@ -. View is returned only as name in plain text - * - * @return array of views/templates/html codes divided into section - */ - public static function getExtendedFormInputsCreate() - { - return [ - 'basicInfo' => 'contactform::admin.form.basicInfo', - 'content' => 'contactform::admin.form.content', - 'meta' => 'admin.content.formParts.metaInformation', - 'appearance' => 'admin.content.formParts.appearance', - 'publication' => 'admin.content.formParts.publicationSetup', - 'files' => 'admin.content.formParts.files', - ]; - } - - public static function getExtendedFormInputsEdit() - { - return self::getExtendedFormInputsCreate(); - } - - /** - * Register admin menu (or multiple ones) - * - * This cannot be in ServiceProvider because Session is started at middleware. And ServiceProvider is called before - * starting any middleware.. - * - * @param User $user model of logged user - */ - public static function registerAdminMenu(User $user) - { - // register links in admin menu - $menu = \Menu::instance('mainMenu'); - - $submenu = $menu->whereTitle(trans('admin/mainMenu.contentPages')); - $submenu->dropdown(trans('contactform::admin/adminMenu.contactForm'), function ($submenu) use ($user) { - $submenu->route('content.new', trans('contactform::admin/adminMenu.new'), ['moduleId' => self::getModuleId()], 10, ['icon' => 'fa fa-plus']); - $submenu->route('content.overview', trans('contactform::admin/adminMenu.overview'), ['moduleId' => self::getModuleId()], 20, ['icon' => 'fa fa-list']); - // $submenu->route('emails.sent', trans('contactform::admin/adminMenu.sentMessages'), [], 30, ['icon' => 'fa fa-send']); - }, 25, ['icon' => 'fa fa-envelope-o']); - } - - /** - * Does given module manage content? Or is it just module with widgets/something internal/something absolutely else? - * - * @return bool - */ - public static function managesContent() - { - return true; - } - - /** - * Get translated title for pages overview of given type. - * - * This value is used for rendering list of all content pages of given type in administration. - * - * @return string - */ - public static function getOverviewTitle() - { - return trans('contactform::module.allForms'); - } - - /** - * Title displayed above for for creating new content page - * - * @return string - */ - public static function getCreateNewTitle() - { - return trans('contactform::module.newForm'); - } - - /** - * Title for form displayed for editin content page - * - * @param Content $content - * - * @return mixed - */ - public static function getEditTitle(Content $content) - { - return trans('contactform::module.editForm'); - } - - /** - * Does this module support categories? - * - * @return boolean - */ - public static function supportCategories() - { - return true; - } - - /** - * Method called right after content page is marked as deleted - * - * This method is supposed to clean after "deleted" page. - * - * @param Content $content - * - * @return mixed - */ - public static function delete(Content $content) - { - } -} \ No newline at end of file diff --git a/modules/ContactForm/Handlers/ContactFormHistory.php b/modules/ContactForm/Handlers/ContactFormHistory.php deleted file mode 100644 index 3a1def56..00000000 --- a/modules/ContactForm/Handlers/ContactFormHistory.php +++ /dev/null @@ -1,28 +0,0 @@ -findOrFail($formId); - - // select template - $template = isset($form->moduleSettings['emailTemplate']) ? $form->moduleSettings['emailTemplate'] : 'contactform::emails.default'; - - // send email - $status = Mail::send(Template::name($template), ['data' => $request], function (Message $message) use ($request, $form) { - $message->from($request->email, $request->name); - - // get message subject - $subject = isset($form->moduleSettings['subject']) ? $form->moduleSettings['subject'] : trans('contactform::admin/contents.defaultSubject'); - - $message->to($form->moduleSettings['email']) - ->subject($subject); - }); - - // inform user about success or failure - return $this->sendResponse($status, $request, $form); - } - - private function sendResponse($status, SendNewEmailRequest $request, $form) - { - // send response for ajax - if ($request->ajax()) { - return response()->json([ - 'status' => $status ? 'success' : 'failed', - 'redirectUrl' => $form->url - ]); - } else { - // redirect user to previous form - $response = redirect()->back(); - - return $status ? $response->with('success', 'sent') : $response->with('error', 'cannotSend'); - } - } -} diff --git a/modules/ContactForm/Http/Requests/SendNewEmailRequest.php b/modules/ContactForm/Http/Requests/SendNewEmailRequest.php deleted file mode 100644 index 7e0dab6a..00000000 --- a/modules/ContactForm/Http/Requests/SendNewEmailRequest.php +++ /dev/null @@ -1,21 +0,0 @@ - 'required', - 'email' => 'required|email', - 'message' => 'required', - 'g-recaptcha-response' => 'required|recaptcha', - ]; - } -} diff --git a/modules/ContactForm/Http/routes.php b/modules/ContactForm/Http/routes.php deleted file mode 100644 index 2ff17cff..00000000 --- a/modules/ContactForm/Http/routes.php +++ /dev/null @@ -1,12 +0,0 @@ - ['web'], - 'namespace' => '\Modules\ContactForm\Http\Controllers\Visitor', - 'prefix' => LaravelLocalization::setLocale() . '/contactform' - ], function () { - - // method for sending new message - - Route::post('/message/{formId}', 'CreateNewMessage@postMessage') - ->name('email.send'); -}); \ No newline at end of file diff --git a/modules/ContactForm/Pipeline/SavePipeline/SaveContactInformation.php b/modules/ContactForm/Pipeline/SavePipeline/SaveContactInformation.php deleted file mode 100644 index a4f74412..00000000 --- a/modules/ContactForm/Pipeline/SavePipeline/SaveContactInformation.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ - function handle(Content & $page, array & $input) - { - if (trim($page->moduleHandler, '\\') != ContactForm::class) { - return; - } - - $settings = [ - 'phone' => $input['phone'], - 'email' => $input['email'], - 'contactEmail' => $input['contactEmail'], - 'subject' => $input['subject'], - 'companyName' => $input['companyName'], - 'address' => $input['address'], - 'gpsLat' => $input['gpsLat'], - 'gpsLng' => $input['gpsLng'], - ]; - - // save settings - $page->moduleSettings = $settings; - $page->save(); - } -} \ No newline at end of file diff --git a/modules/ContactForm/Providers/ContactFormServiceProvider.php b/modules/ContactForm/Providers/ContactFormServiceProvider.php deleted file mode 100644 index 10f65909..00000000 --- a/modules/ContactForm/Providers/ContactFormServiceProvider.php +++ /dev/null @@ -1,50 +0,0 @@ -registerWidgets(); - - app('saveContentPipeline')->add(SaveContactInformation::class); - } - - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - } - - private function registerWidgets() - { - $registrator = $this->app->make('registerWidget'); - - $registrator->register(Address::class, null, ContactForm::getModuleId()); - $registrator->register(Form::class, null, ContactForm::getModuleId()); - } - - protected function setModuleAlias() - { - $this->alias = 'contactform'; - } - - protected function setModulePath() - { - $this->path = __DIR__; - } -} diff --git a/modules/ContactForm/Resources/lang/cs/admin/adminMenu.php b/modules/ContactForm/Resources/lang/cs/admin/adminMenu.php deleted file mode 100644 index 72e7b038..00000000 --- a/modules/ContactForm/Resources/lang/cs/admin/adminMenu.php +++ /dev/null @@ -1,9 +0,0 @@ - "Kontaktní formulář", -"emails" => "E-mailové šablony", -"new" => "Nový", -"overview" => "Všechny formuláře", -"sentMessages" => "Zprávy", -"templatePath" => "Kontaktní formulář", -]; diff --git a/modules/ContactForm/Resources/lang/cs/admin/content.php b/modules/ContactForm/Resources/lang/cs/admin/content.php deleted file mode 100644 index 85db12f7..00000000 --- a/modules/ContactForm/Resources/lang/cs/admin/content.php +++ /dev/null @@ -1,15 +0,0 @@ - "Adresa", -"compName" => "Jméno zobrazené nad adresou", -"contactEmail" => "E-mail, kam budou doručovány zprávy z tohoto formuláře", -"contactInformation" => "Kontaktní informace", -"content" => "Obsah kontaktního formuláře", -"defaultSubject" => "Nová zpráva z kontaktního formuláře", -"email" => "E-mail", -"emailList" => "Odesílat zprávy na tyto adresy", -"gpsLat" => "GPS šířka", -"gpsLng" => "GPS délka", -"phone" => "Kontaktní telefon", -"subject" => "Předmět zprávy", -]; diff --git a/modules/ContactForm/Resources/lang/cs/admin/history.php b/modules/ContactForm/Resources/lang/cs/admin/history.php deleted file mode 100644 index 2c6525b8..00000000 --- a/modules/ContactForm/Resources/lang/cs/admin/history.php +++ /dev/null @@ -1,11 +0,0 @@ - "Adresa", -"columnCompanyName" => "Jméno společnosti", -"columnContactEmail" => "Kontaktní e-mail", -"columnEmail" => "E-mail", -"columnGpsLat" => "GPS šířka", -"columnGpsLng" => "GPS délka", -"columnPhone" => "Telefon", -"columnSubject" => "Předmět", -]; diff --git a/modules/ContactForm/Resources/lang/cs/admin/widgets.php b/modules/ContactForm/Resources/lang/cs/admin/widgets.php deleted file mode 100644 index 9c2f1d09..00000000 --- a/modules/ContactForm/Resources/lang/cs/admin/widgets.php +++ /dev/null @@ -1,16 +0,0 @@ - [ - "description" => "Malý widget určený pro zobrazení adresy, která byla uložena u vybraného kontaktního formuláře.", - "edit" => "Upravuji blok s adresou", - "name" => "Blok s adresou", - "new" => "Nový blok s adresou", - ], - "form" => [ - "description" => "Widget pro zobrazení kontaktního formuláře kdekoliv na webu - v obsahu stránky, menu, patičce, ...", - "name" => "Kontaktní formulář", - "new" => "Nový widget s kontaktním formulářem", - ], - "noContactForms" => "Vypadá to, že v systému nebyl vytvořen žádný kontaktní formulář. Z toho důvodu není možné vytvořit ani tento widget. Vytvořte nejprve nějaký kontaktní formulář a pak opakujte tento pokus.", - "selectContactForm" => "Vybrat kontaktní formulář", -]; diff --git a/modules/ContactForm/Resources/lang/cs/module.php b/modules/ContactForm/Resources/lang/cs/module.php deleted file mode 100644 index c76b9420..00000000 --- a/modules/ContactForm/Resources/lang/cs/module.php +++ /dev/null @@ -1,8 +0,0 @@ - "Všechny formuláře", -"description" => "Jednoduchý kontaktní formulář", -"editForm" => "Upravuji formulář", -"name" => "Kontaktní formulář", -"newForm" => "Vytvořit nový kontaktní formulář", -]; diff --git a/modules/ContactForm/Resources/lang/en/admin/adminMenu.php b/modules/ContactForm/Resources/lang/en/admin/adminMenu.php deleted file mode 100644 index 3e869c0f..00000000 --- a/modules/ContactForm/Resources/lang/en/admin/adminMenu.php +++ /dev/null @@ -1,9 +0,0 @@ - 'Contact form', - 'new' => 'New', - 'overview' => 'All contact forms', - 'sentMessages' => 'Messages', - 'templatePath' => 'Contact form', - 'emails' => 'E-mail templates', -]; \ No newline at end of file diff --git a/modules/ContactForm/Resources/lang/en/admin/content.php b/modules/ContactForm/Resources/lang/en/admin/content.php deleted file mode 100644 index 134b9b30..00000000 --- a/modules/ContactForm/Resources/lang/en/admin/content.php +++ /dev/null @@ -1,15 +0,0 @@ - 'Contact form content', - 'address' => 'Address', - 'emailList' => 'Send emails to these addresses', - 'gpsLat' => 'GPS latitude', - 'gpsLng' => 'GPS longitude', - 'compName' => 'Name displayed above address', - 'phone' => 'Contact phone', - 'email' => 'E-mail', - 'contactEmail' => 'E-mail, where messages from this form will be delivered', - 'contactInformation' => 'Contact information', - 'subject' => 'Subject', - 'defaultSubject' => 'New message from contact form' -]; \ No newline at end of file diff --git a/modules/ContactForm/Resources/lang/en/admin/history.php b/modules/ContactForm/Resources/lang/en/admin/history.php deleted file mode 100644 index dab90865..00000000 --- a/modules/ContactForm/Resources/lang/en/admin/history.php +++ /dev/null @@ -1,12 +0,0 @@ - 'Phone', - 'columnAddress' => 'Address', - 'columnEmail' => 'E-mail', - 'columnContactEmail' => 'Contact E-mail', - 'columnSubject' => 'Subject', - 'columnCompanyName' => 'Company name', - 'columnGpsLat' => 'GPS Latitude', - 'columnGpsLng' => 'Gps Longitude', -]; - diff --git a/modules/ContactForm/Resources/lang/en/admin/widgets.php b/modules/ContactForm/Resources/lang/en/admin/widgets.php deleted file mode 100644 index 3d387a0d..00000000 --- a/modules/ContactForm/Resources/lang/en/admin/widgets.php +++ /dev/null @@ -1,16 +0,0 @@ - [ - 'name' => 'Address block', - 'description' => 'Small widget for displaying address saved in selected contact form.', - 'new' => 'New address block', - 'edit' => 'Editing address block' - ], - 'form' => [ - 'name' => 'Contact form', - 'description' => 'Display small contact form anywhere on website.', - 'new' => 'New contact form widget' - ], - 'noContactForms' => 'You have not created any contact form. Try to create one before creating this widget.', - 'selectContactForm' => 'Select contact form' -]; \ No newline at end of file diff --git a/modules/ContactForm/Resources/lang/en/module.php b/modules/ContactForm/Resources/lang/en/module.php deleted file mode 100644 index 3e9d374e..00000000 --- a/modules/ContactForm/Resources/lang/en/module.php +++ /dev/null @@ -1,8 +0,0 @@ - 'Contact form', - 'description' => 'Simple contact form', - 'allForms' => 'All contact forms', - 'newForm' => 'Create new contact form', - 'editForm' => 'Editing contact form' -]; \ No newline at end of file diff --git a/modules/ContactForm/Resources/lang/sk/admin/adminMenu.php b/modules/ContactForm/Resources/lang/sk/admin/adminMenu.php deleted file mode 100644 index d4dcea93..00000000 --- a/modules/ContactForm/Resources/lang/sk/admin/adminMenu.php +++ /dev/null @@ -1,8 +0,0 @@ - "Kontaktný formulár", - "new" => "Nový", - "overview" => "Všetky formuláre", - "sentMessages" => "Správy", - "templatePath" => "Kontaktný formulár", -]; \ No newline at end of file diff --git a/modules/ContactForm/Resources/lang/sk/admin/content.php b/modules/ContactForm/Resources/lang/sk/admin/content.php deleted file mode 100644 index c283c250..00000000 --- a/modules/ContactForm/Resources/lang/sk/admin/content.php +++ /dev/null @@ -1,15 +0,0 @@ - "Adresa", - "compName" => "Názov zobrazený nad adresou", - "contactEmail" => "E-mail, kam budú doručované správy z tohoto formulára", - "contactInformation" => "Kontaktné informácie", - "content" => "Obsah kontaktného formulára", - "defaultSubject" => "Nová správa z kontaktného formulára", - "email" => "E-mail", - "emailList" => "Odosielať správy na tieto adresy", - "gpsLat" => "GPS šírka", - "gpsLng" => "GPS dĺžka", - "phone" => "Kontaktný telefón", - "subject" => "Predmet správy", -]; diff --git a/modules/ContactForm/Resources/lang/sk/admin/history.php b/modules/ContactForm/Resources/lang/sk/admin/history.php deleted file mode 100644 index c0664dfd..00000000 --- a/modules/ContactForm/Resources/lang/sk/admin/history.php +++ /dev/null @@ -1,11 +0,0 @@ - "Adresa", - "columnCompanyName" => "Názov spoločnosti", - "columnContactEmail" => "Kontaktný e-mail", - "columnEmail" => "E-mail", - "columnGpsLat" => "GPS šírka", - "columnGpsLng" => "GPS dĺžka", - "columnPhone" => "Telefón", - "columnSubject" => "Predmet", -]; diff --git a/modules/ContactForm/Resources/lang/sk/module.php b/modules/ContactForm/Resources/lang/sk/module.php deleted file mode 100644 index ad642712..00000000 --- a/modules/ContactForm/Resources/lang/sk/module.php +++ /dev/null @@ -1,5 +0,0 @@ - "Jednoduchý kontaktný formulár", - "name" => "Kontaktný formulár", -]; diff --git a/modules/ContactForm/Resources/views/admin/form/basicInfo.blade.php b/modules/ContactForm/Resources/views/admin/form/basicInfo.blade.php deleted file mode 100644 index 184df299..00000000 --- a/modules/ContactForm/Resources/views/admin/form/basicInfo.blade.php +++ /dev/null @@ -1,136 +0,0 @@ -