Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
laravel-adminpanel
Commits
6ab7db35
Unverified
Commit
6ab7db35
authored
Oct 21, 2018
by
Vipul Basapati
Committed by
GitHub
Oct 21, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #280 from bvipul/develop
Removing Email Templates module
parents
aae971c8
76211ca6
Changes
42
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
94 additions
and
1614 deletions
+94
-1614
EmailTemplateDeleted.php
app/Events/Backend/EmailTemplates/EmailTemplateDeleted.php
+0
-26
EmailTemplateUpdated.php
app/Events/Backend/EmailTemplates/EmailTemplateUpdated.php
+0
-26
helpers.php
app/Helpers/helpers.php
+8
-23
Backend.php
app/Http/Breadcrumbs/Backend/Backend.php
+0
-1
Email_Template.php
app/Http/Breadcrumbs/Backend/Email_Template.php
+0
-16
EmailTemplatesController.php
...llers/Backend/EmailTemplates/EmailTemplatesController.php
+0
-92
EmailTemplatesTableController.php
.../Backend/EmailTemplates/EmailTemplatesTableController.php
+0
-52
NotificationController.php
app/Http/Controllers/Backend/NotificationController.php
+1
-1
DeleteEmailTemplatesRequest.php
...ts/Backend/EmailTemplates/DeleteEmailTemplatesRequest.php
+0
-33
EditEmailTemplatesRequest.php
...ests/Backend/EmailTemplates/EditEmailTemplatesRequest.php
+0
-33
ManageEmailTemplatesRequest.php
...ts/Backend/EmailTemplates/ManageEmailTemplatesRequest.php
+0
-33
UpdateEmailTemplatesRequest.php
...ts/Backend/EmailTemplates/UpdateEmailTemplatesRequest.php
+0
-36
SendEmail.php
app/Http/Utilities/SendEmail.php
+0
-104
EmailTemplateEventListener.php
...ers/Backend/EmailTemplates/EmailTemplateEventListener.php
+0
-58
PageEventListener.php
app/Listeners/Backend/Pages/PageEventListener.php
+76
-0
EmailTemplatePlaceholder.php
...ls/EmailTemplatePlaceholders/EmailTemplatePlaceholder.php
+0
-21
EmailTemplateType.php
app/Models/EmailTemplateTypes/EmailTemplateType.php
+0
-21
EmailTemplate.php
app/Models/EmailTemplates/EmailTemplate.php
+0
-32
EmailTemplateAttribute.php
...mailTemplates/Traits/Attribute/EmailTemplateAttribute.php
+0
-37
EventServiceProvider.php
app/Providers/EventServiceProvider.php
+1
-2
EmailTemplatesRepository.php
...ories/Backend/EmailTemplates/EmailTemplatesRepository.php
+0
-77
2017_11_02_060149_create_email_template_placeholders_table.php
...11_02_060149_create_email_template_placeholders_table.php
+0
-31
2017_11_02_060149_create_email_template_types_table.php
...s/2017_11_02_060149_create_email_template_types_table.php
+0
-31
2017_11_02_060149_create_email_templates_table.php
...ations/2017_11_02_060149_create_email_templates_table.php
+0
-38
DatabaseSeeder.php
database/seeds/DatabaseSeeder.php
+0
-3
EmailTemplatePlaceholderTableSeeder.php
database/seeds/EmailTemplatePlaceholderTableSeeder.php
+0
-80
EmailTemplateTableSeeder.php
database/seeds/EmailTemplateTableSeeder.php
+0
-290
EmailTemplateTypeTableSeeder.php
database/seeds/EmailTemplateTypeTableSeeder.php
+0
-48
HistoryTypeTableSeeder.php
database/seeds/HistoryTypeTableSeeder.php
+3
-9
MenuTableSeeder.php
database/seeds/MenuTableSeeder.php
+1
-1
ModulesTableSeeder.php
database/seeds/ModulesTableSeeder.php
+0
-7
admin.js
public/js/backend/admin.js
+0
-41
alerts.php
resources/lang/en/alerts.php
+1
-5
exceptions.php
resources/lang/en/exceptions.php
+0
-13
history.php
resources/lang/en/history.php
+3
-7
labels.php
resources/lang/en/labels.php
+0
-16
menus.php
resources/lang/en/menus.php
+0
-8
validation.php
resources/lang/en/validation.php
+0
-9
edit.blade.php
resources/views/backend/emailtemplates/edit.blade.php
+0
-112
index.blade.php
resources/views/backend/emailtemplates/index.blade.php
+0
-119
sidebar.blade.php
resources/views/backend/includes/sidebar.blade.php
+0
-10
EmailTemplates.php
routes/Backend/EmailTemplates.php
+0
-12
No files found.
app/Events/Backend/EmailTemplates/EmailTemplateDeleted.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Events\Backend\EmailTemplates
;
use
Illuminate\Queue\SerializesModels
;
/**
* Class EmailTemplateDeleted.
*/
class
EmailTemplateDeleted
{
use
SerializesModels
;
/**
* @var
*/
public
$emailtemplates
;
/**
* @param $emailtemplates
*/
public
function
__construct
(
$emailtemplates
)
{
$this
->
emailtemplates
=
$emailtemplates
;
}
}
app/Events/Backend/EmailTemplates/EmailTemplateUpdated.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Events\Backend\EmailTemplates
;
use
Illuminate\Queue\SerializesModels
;
/**
* Class EmailTemplateUpdated.
*/
class
EmailTemplateUpdated
{
use
SerializesModels
;
/**
* @var
*/
public
$emailtemplates
;
/**
* @param $emailtemplates
*/
public
function
__construct
(
$emailtemplates
)
{
$this
->
emailtemplates
=
$emailtemplates
;
}
}
app/Helpers/helpers.php
View file @
6ab7db35
<?php
use
App\Exceptions\GeneralException
;
use
App\Helpers\uuid
;
use
App\Http\Utilities\SendEmail
;
use
App\Models\Notification\Notification
;
use
App\Models\Settings\Setting
;
use
Carbon\Carbon
as
Carbon
;
...
...
@@ -145,38 +143,25 @@ if (!function_exists('settings')) {
}
}
// Creating Notification
if
(
!
function_exists
(
'createNotification'
))
{
/**
* create new notification.
*
* @param $message message you want to show in notification
* @param $userId To Whom You Want To send Notification
* @param $type type of notification (1 - dashboard, 2 - email, 3 - both) (by default 1)
* @param $option associate array [ 'data' => $data, 'email_template_type' => $template_type ]
*
* @return object
*/
function
createNotification
(
$message
,
$userId
,
$type
=
1
,
$options
=
[]
)
function
createNotification
(
$message
,
$userId
)
{
if
(
$type
==
1
||
$type
==
3
)
{
$notification
=
new
Notification
();
$notification
=
new
Notification
();
return
$notification
->
insert
([
'message'
=>
$message
,
'user_id'
=>
$userId
,
'type'
=>
$type
,
'created_at'
=>
Carbon
::
now
(),
]);
}
if
(
$type
==
2
||
$type
==
3
)
{
if
(
!
empty
(
$options
[
'data'
])
&&
!
empty
(
$options
[
'email_template_type'
]))
{
$mail
=
new
SendEmail
();
$emailResult
=
$mail
->
sendWithTemplate
(
$options
[
'data'
],
$options
[
'email_template_type'
]);
}
else
{
throw
new
GeneralException
(
'Invalid input given.option array shold contains data and email_template_type'
);
}
}
return
$notification
->
insert
([
'message'
=>
$message
,
'user_id'
=>
$userId
,
'type'
=>
1
,
'created_at'
=>
Carbon
::
now
(),
]);
}
}
...
...
app/Http/Breadcrumbs/Backend/Backend.php
View file @
6ab7db35
...
...
@@ -9,7 +9,6 @@ require __DIR__.'/Access/User.php';
require
__DIR__
.
'/Access/Role.php'
;
require
__DIR__
.
'/Access/Permission.php'
;
require
__DIR__
.
'/Page.php'
;
require
__DIR__
.
'/Email_Template.php'
;
require
__DIR__
.
'/Setting.php'
;
require
__DIR__
.
'/Blog_Category.php'
;
require
__DIR__
.
'/Blog_Tag.php'
;
...
...
app/Http/Breadcrumbs/Backend/Email_Template.php
deleted
100755 → 0
View file @
aae971c8
<?php
Breadcrumbs
::
register
(
'admin.emailtemplates.index'
,
function
(
$breadcrumbs
)
{
$breadcrumbs
->
parent
(
'admin.dashboard'
);
$breadcrumbs
->
push
(
trans
(
'menus.backend.emailtemplates.management'
),
route
(
'admin.emailtemplates.index'
));
});
Breadcrumbs
::
register
(
'admin.emailtemplates.create'
,
function
(
$breadcrumbs
)
{
$breadcrumbs
->
parent
(
'admin.emailtemplates.index'
);
$breadcrumbs
->
push
(
trans
(
'menus.backend.emailtemplates.create'
),
route
(
'admin.emailtemplates.create'
));
});
Breadcrumbs
::
register
(
'admin.emailtemplates.edit'
,
function
(
$breadcrumbs
,
$id
)
{
$breadcrumbs
->
parent
(
'admin.emailtemplates.index'
);
$breadcrumbs
->
push
(
trans
(
'menus.backend.emailtemplates.edit'
),
route
(
'admin.emailtemplates.edit'
,
$id
));
});
app/Http/Controllers/Backend/EmailTemplates/EmailTemplatesController.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Http\Controllers\Backend\EmailTemplates
;
use
App\Http\Controllers\Controller
;
use
App\Http\Requests\Backend\EmailTemplates\DeleteEmailTemplatesRequest
;
use
App\Http\Requests\Backend\EmailTemplates\EditEmailTemplatesRequest
;
use
App\Http\Requests\Backend\EmailTemplates\ManageEmailTemplatesRequest
;
use
App\Http\Requests\Backend\EmailTemplates\UpdateEmailTemplatesRequest
;
use
App\Models\EmailTemplatePlaceholders\EmailTemplatePlaceholder
;
use
App\Models\EmailTemplates\EmailTemplate
;
use
App\Models\EmailTemplateTypes\EmailTemplateType
;
use
App\Repositories\Backend\EmailTemplates\EmailTemplatesRepository
;
/**
* Class EmailTemplatesController.
*/
class
EmailTemplatesController
extends
Controller
{
/**
* @var EmailTemplatesRepository
*/
protected
$emailtemplates
;
/**
* __construct.
*
* @param \App\Repositories\Backend\EmailTemplates\EmailTemplatesRepository $emailtemplates
*/
public
function
__construct
(
EmailTemplatesRepository
$emailtemplates
)
{
$this
->
emailtemplates
=
$emailtemplates
;
}
/**
* @param \App\Http\Requests\Backend\EmailTemplates\ManageEmailTemplatesRequest $request
*
* @return mixed
*/
public
function
index
(
ManageEmailTemplatesRequest
$request
)
{
return
view
(
'backend.emailtemplates.index'
);
}
/**
* @param \App\Models\EmailTemplates\EmailTemplate $emailtemplate
* @param \App\Http\Requests\Backend\EmailTemplates\EditEmailTemplatesRequest $request
*
* @return mixed
*/
public
function
edit
(
EmailTemplate
$emailtemplate
,
EditEmailTemplatesRequest
$request
)
{
$emailtemplateTypes
=
EmailTemplateType
::
getSelectData
();
$emailtemplatePlaceholders
=
EmailTemplatePlaceholder
::
getSelectData
();
return
view
(
'backend.emailtemplates.edit'
)
->
withEmailtemplate
(
$emailtemplate
)
->
withEmailtemplatetypes
(
$emailtemplateTypes
)
->
withEmailtemplateplaceholders
(
$emailtemplatePlaceholders
);
}
/**
* @param \App\Models\EmailTemplates\EmailTemplate $emailtemplate
* @param \App\Http\Requests\Backend\EmailTemplates\UpdateEmailTemplatesRequest $request
*
* @return mixed
*/
public
function
update
(
EmailTemplate
$emailtemplate
,
UpdateEmailTemplatesRequest
$request
)
{
$this
->
emailtemplates
->
update
(
$emailtemplate
,
$request
->
except
([
'_method'
,
'_token'
,
'placeholder'
]));
return
redirect
()
->
route
(
'admin.emailtemplates.index'
)
->
withFlashSuccess
(
trans
(
'alerts.backend.emailtemplates.updated'
));
}
/**
* @param \App\Models\EmailTemplates\EmailTemplate $emailtemplate
* @param \App\Http\Requests\Backend\EmailTemplates\DeleteEmailTemplatesRequest $request
*
* @return mixed
*/
public
function
destroy
(
EmailTemplate
$emailtemplate
,
DeleteEmailTemplatesRequest
$request
)
{
$this
->
emailtemplates
->
delete
(
$emailtemplate
);
return
redirect
()
->
route
(
'admin.emailtemplates.index'
)
->
withFlashSuccess
(
trans
(
'alerts.backend.emailtemplates.deleted'
));
}
}
app/Http/Controllers/Backend/EmailTemplates/EmailTemplatesTableController.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Http\Controllers\Backend\EmailTemplates
;
use
App\Http\Controllers\Controller
;
use
App\Http\Requests\Backend\EmailTemplates\ManageEmailTemplatesRequest
;
use
App\Repositories\Backend\EmailTemplates\EmailTemplatesRepository
;
use
Carbon\Carbon
;
use
Yajra\DataTables\Facades\DataTables
;
/**
* Class EmailTemplatesTableController.
*/
class
EmailTemplatesTableController
extends
Controller
{
/**
* @var EmailTemplatesRepository
*/
protected
$emailtemplates
;
/**
* @param \App\Repositories\Backend\EmailTemplates\EmailTemplatesRepository $emailtemplates
*/
public
function
__construct
(
EmailTemplatesRepository
$emailtemplates
)
{
$this
->
emailtemplates
=
$emailtemplates
;
}
/**
* @param \App\Http\Requests\Backend\EmailTemplates\ManageEmailTemplatesRequest $request
*
* @return mixed
*/
public
function
__invoke
(
ManageEmailTemplatesRequest
$request
)
{
return
Datatables
::
of
(
$this
->
emailtemplates
->
getForDataTable
())
->
escapeColumns
([
'title'
])
->
addColumn
(
'status'
,
function
(
$emailtemplates
)
{
return
$emailtemplates
->
status_label
;
})
->
addColumn
(
'created_at'
,
function
(
$emailtemplates
)
{
return
Carbon
::
parse
(
$emailtemplates
->
created_at
)
->
toDateString
();
})
->
addColumn
(
'updated_at'
,
function
(
$emailtemplates
)
{
return
Carbon
::
parse
(
$emailtemplates
->
updated_at
)
->
toDateString
();
})
->
addColumn
(
'actions'
,
function
(
$emailtemplates
)
{
return
$emailtemplates
->
action_buttons
;
})
->
make
(
true
);
}
}
app/Http/Controllers/Backend/NotificationController.php
View file @
6ab7db35
...
...
@@ -12,7 +12,7 @@ use Illuminate\Support\Facades\Auth;
class
NotificationController
extends
Controller
{
/**
* @var
EmailTemplateContract
* @var
\App\Repositories\Backend\Notification\NotificationRepository
*/
protected
$notification
;
...
...
app/Http/Requests/Backend/EmailTemplates/DeleteEmailTemplatesRequest.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Http\Requests\Backend\EmailTemplates
;
use
App\Http\Requests\Request
;
/**
* Class DeleteEmailTemplatesRequest.
*/
class
DeleteEmailTemplatesRequest
extends
Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public
function
authorize
()
{
return
false
;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
//
];
}
}
app/Http/Requests/Backend/EmailTemplates/EditEmailTemplatesRequest.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Http\Requests\Backend\EmailTemplates
;
use
App\Http\Requests\Request
;
/**
* Class EditEmailTemplatesRequest.
*/
class
EditEmailTemplatesRequest
extends
Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public
function
authorize
()
{
return
access
()
->
allow
(
'edit-email-template'
);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
//
];
}
}
app/Http/Requests/Backend/EmailTemplates/ManageEmailTemplatesRequest.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Http\Requests\Backend\EmailTemplates
;
use
App\Http\Requests\Request
;
/**
* Class ManageEmailTemplatesRequest.
*/
class
ManageEmailTemplatesRequest
extends
Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public
function
authorize
()
{
return
access
()
->
allow
(
'view-email-template'
);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
//
];
}
}
app/Http/Requests/Backend/EmailTemplates/UpdateEmailTemplatesRequest.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Http\Requests\Backend\EmailTemplates
;
use
App\Http\Requests\Request
;
/**
* Class UpdateEmailTemplatesRequest.
*/
class
UpdateEmailTemplatesRequest
extends
Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public
function
authorize
()
{
return
access
()
->
allow
(
'edit-email-template'
);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
'title'
=>
'required|max:191'
,
'type_id'
=>
'required'
,
'subject'
=>
'required|max:191'
,
'body'
=>
'required'
,
];
}
}
app/Http/Utilities/SendEmail.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Http\Utilities
;
use
Illuminate\Support\Facades\Mail
;
class
SendEmail
{
public
function
sendWithTemplate
(
$data
,
$typeId
)
{
$template
=
\DB
::
table
(
'email_templates'
)
->
where
(
'type_id'
,
$typeId
)
->
where
(
'status'
,
1
)
->
orderBy
(
'updated_at'
,
'DESC'
)
->
first
();
if
(
!
empty
(
$template
))
{
switch
(
$typeId
)
{
case
'1'
:
// When user register from frontend
$content
=
$template
->
body
;
// Replace app name
$content
=
str_replace
(
'[app_name]'
,
app_name
(),
$content
);
// Replace user firstname
$content
=
str_replace
(
'[name]'
,
$data
[
'first_name'
],
$content
);
// Replace confirmation link
$url
=
'<a href='
.
url
(
'account/confirm/'
.
$data
[
'confirmation_code'
])
.
'>Click Here</a>'
;
$content
=
str_replace
(
'[confirmation_link]'
,
$url
,
$content
);
// User email
$data
[
'to'
]
=
$data
[
'email'
];
// Subject of mail
$data
[
'subject'
]
=
$template
->
subject
;
break
;
case
'2'
:
$content
=
$template
->
body
;
// Replace app name
$content
=
str_replace
(
'[app_name]'
,
app_name
(),
$content
);
// Replace user firstname
$content
=
str_replace
(
'[name]'
,
$data
[
'first_name'
],
$content
);
// Replace user email
$content
=
str_replace
(
'[email]'
,
$data
[
'email'
],
$content
);
// Replace user password
$content
=
str_replace
(
'[password]'
,
$data
[
'password'
],
$content
);
$data
[
'to'
]
=
$data
[
'email'
];
$data
[
'subject'
]
=
$template
->
subject
;
break
;
case
'3'
:
$content
=
$template
->
body
;
// Replace status in subject
$status
=
$data
->
status
==
0
?
'Deactivated'
:
'Activated'
;
$subject
=
str_replace
(
'[status]'
,
$status
,
$template
->
subject
);
// Replace status in email body
$content
=
str_replace
(
'[status]'
,
$status
,
$content
);
// Replace app name
$content
=
str_replace
(
'[app_name]'
,
app_name
(),
$content
);
$data
[
'to'
]
=
$data
[
'email'
];
$data
[
'subject'
]
=
$subject
;
break
;
case
'4'
:
$content
=
$template
->
body
;
// Replace status in email body
$content
=
str_replace
(
'[password]'
,
$data
[
'password'
],
$content
);
// Replace app name
$content
=
str_replace
(
'[app_name]'
,
app_name
(),
$content
);
$data
[
'to'
]
=
$data
[
'email'
];
$data
[
'subject'
]
=
$template
->
subject
;
break
;
default
:
echo
'Default case'
;
break
;
}
// Send email code
$message
=
[
'data'
=>
$content
];
return
Mail
::
send
([
'html'
=>
'emails.template'
],
$message
,
function
(
$message
)
use
(
$data
)
{
$message
->
to
(
$data
[
'to'
]);
$message
->
subject
(
$data
[
'subject'
]);
});
}
else
{
return
false
;
}
}
}
app/Listeners/Backend/EmailTemplates/EmailTemplateEventListener.php
deleted
100644 → 0
View file @
aae971c8
<?php
namespace
App\Listeners\Backend\EmailTemplates
;
/**
* Class EmailTemplateEventListener.
*/
class
EmailTemplateEventListener
{
/**
* @var string
*/
private
$history_slug
=
'EmailTemplate'
;
/**
* @param $event
*/
public
function
onUpdated
(
$event
)
{
history
()
->
withType
(
$this
->
history_slug
)
->
withEntity
(
$event
->
emailtemplates
->
id
)
->
withText
(
'trans("history.backend.emailtemplates.updated") <strong>'
.
$event
->
emailtemplates
->
title
.
'</strong>'
)
->
withIcon
(
'save'
)
->
withClass
(
'bg-aqua'
)
->
log
();
}
/**
* @param $event
*/
public
function
onDeleted
(
$event
)
{
history
()
->
withType
(
$this
->
history_slug
)
->
withEntity
(
$event
->
emailtemplates
->
id
)
->
withText
(
'trans("history.backend.emailtemplates.deleted") <strong>'
.
$event
->
emailtemplates
->
title
.
'</strong>'
)
->
withIcon
(
'trash'
)
->
withClass
(
'bg-maroon'
)
->
log
();
}
/**
* Register the listeners for the subscriber.
*
* @param \Illuminate\Events\Dispatcher $events
*/
public
function
subscribe
(
$events
)
{
$events
->
listen
(
\App\Events\Backend\EmailTemplates\EmailTemplateUpdated
::
class
,
'App\Listeners\Backend\EmailTemplates\EmailTemplateEventListener@onUpdated'
);
$events
->
listen
(
\App\Events\Backend\EmailTemplates\EmailTemplateDeleted
::
class
,
'App\Listeners\Backend\EmailTemplates\EmailTemplateEventListener@onDeleted'
);
}
}
app/Listeners/Backend/
CMSPages/CMS
PageEventListener.php
→
app/Listeners/Backend/
Pages/
PageEventListener.php
View file @
6ab7db35
<?php
namespace
App\Listeners\Backend\
CMS
Pages
;
namespace
App\Listeners\Backend\Pages
;
/**
* Class
CMS
PageEventListener.
* Class PageEventListener.
*/
class
CMS
PageEventListener
class
PageEventListener
{
/**
* @var string
*/
private
$history_slug
=
'
CMS
Page'
;
private
$history_slug
=
'Page'
;
/**
* @param $event
...
...
@@ -18,8 +18,8 @@ class CMSPageEventListener
public
function
onCreated
(
$event
)
{
history
()
->
withType
(
$this
->
history_slug
)
->
withEntity
(
$event
->
cmspages
->
id
)
->
withText
(
'trans("history.backend.
cmspages.created") <strong>'
.
$event
->
cmspages
->
title
.
'</strong>'
)
->
withEntity
(
$event
->
page
->
id
)
->
withText
(
'trans("history.backend.
pages.created") <strong>'
.
$event
->
page
->
title
.
'</strong>'
)
->
withIcon
(
'plus'
)
->
withClass
(
'bg-green'
)
->
log
();
...
...
@@ -31,8 +31,8 @@ class CMSPageEventListener
public
function
onUpdated
(
$event
)
{
history
()
->
withType
(
$this
->
history_slug
)
->
withEntity
(
$event
->
cmspages
->
id
)
->
withText
(
'trans("history.backend.
cmspages.updated") <strong>'
.
$event
->
cmspages
->
title
.
'</strong>'
)
->
withEntity
(
$event
->
page
->
id
)
->
withText
(
'trans("history.backend.
pages.updated") <strong>'
.
$event
->
page
->
title
.
'</strong>'
)
->
withIcon
(
'save'
)
->
withClass
(
'bg-aqua'
)
->
log
();
...
...
@@ -44,8 +44,8 @@ class CMSPageEventListener
public
function
onDeleted
(
$event
)
{
history
()
->
withType
(
$this
->
history_slug
)
->
withEntity
(
$event
->
cmspages
->
id
)
->
withText
(
'trans("history.backend.
cmspages.deleted") <strong>'
.
$event
->
cmspages
->
title
.
'</strong>'
)
->
withEntity
(
$event
->
page
->
id
)
->
withText
(
'trans("history.backend.
pages.deleted") <strong>'
.
$event
->
page
->
title
.
'</strong>'
)
->
withIcon
(
'trash'
)
->
withClass
(
'bg-maroon'
)
->
log
();
...
...
@@ -59,18 +59,18 @@ class CMSPageEventListener
public
function
subscribe
(
$events
)
{
$events
->
listen
(
\App\Events\Backend\
CMSPages\CMS
PageCreated
::
class
,
'App\Listeners\Backend\
CMSPages\CMS
PageEventListener@onCreated'
\App\Events\Backend\
Pages\
PageCreated
::
class
,
'App\Listeners\Backend\
Pages\
PageEventListener@onCreated'
);
$events
->
listen
(
\App\Events\Backend\
CMSPages\CMS
PageUpdated
::
class
,
'App\Listeners\Backend\
CMSPages\CMS
PageEventListener@onUpdated'
\App\Events\Backend\
Pages\
PageUpdated
::
class
,
'App\Listeners\Backend\
Pages\
PageEventListener@onUpdated'
);
$events
->
listen
(
\App\Events\Backend\
CMSPages\CMS
PageDeleted
::
class
,
'App\Listeners\Backend\
CMSPages\CMS
PageEventListener@onDeleted'
\App\Events\Backend\
Pages\
PageDeleted
::
class
,
'App\Listeners\Backend\
Pages\
PageEventListener@onDeleted'
);
}
}
app/Models/EmailTemplatePlaceholders/EmailTemplatePlaceholder.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Models\EmailTemplatePlaceholders
;
use
App\Models\BaseModel
;
class
EmailTemplatePlaceholder
extends
BaseModel
{
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
;
public
function
__construct
(
array
$attributes
=
[])
{
parent
::
__construct
(
$attributes
);
$this
->
table
=
config
(
'module.email_templates.placeholders_table'
);
}
}
app/Models/EmailTemplateTypes/EmailTemplateType.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Models\EmailTemplateTypes
;
use
App\Models\BaseModel
;
class
EmailTemplateType
extends
BaseModel
{
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
;
public
function
__construct
(
array
$attributes
=
[])
{
parent
::
__construct
(
$attributes
);
$this
->
table
=
config
(
'module.email_templates.types_table'
);
}
}
app/Models/EmailTemplates/EmailTemplate.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Models\EmailTemplates
;
use
App\Models\BaseModel
;
use
App\Models\EmailTemplates\Traits\Attribute\EmailTemplateAttribute
;
use
App\Models\ModelTrait
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
class
EmailTemplate
extends
BaseModel
{
use
ModelTrait
,
SoftDeletes
,
EmailTemplateAttribute
{
// EmailTemplateAttribute::getEditButtonAttribute insteadof ModelTrait;
}
protected
$guarded
=
[
'id'
];
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
;
public
function
__construct
(
array
$attributes
=
[])
{
parent
::
__construct
(
$attributes
);
$this
->
table
=
config
(
'module.email_templates.table'
);
}
}
app/Models/EmailTemplates/Traits/Attribute/EmailTemplateAttribute.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Models\EmailTemplates\Traits\Attribute
;
/**
* Class EmailTemplateAttribute.
*/
trait
EmailTemplateAttribute
{
/**
* @return string
*/
public
function
getActionButtonsAttribute
()
{
return
'<div class="btn-group action-btn">'
.
$this
->
getEditButtonAttribute
(
'edit-email-template'
,
'admin.emailtemplates.edit'
)
.
'</div>'
;
}
/**
* @return string
*/
public
function
getStatusLabelAttribute
()
{
if
(
$this
->
isActive
())
{
return
"<label class='label label-success'>"
.
trans
(
'labels.general.active'
)
.
'</label>'
;
}
return
"<label class='label label-danger'>"
.
trans
(
'labels.general.inactive'
)
.
'</label>'
;
}
/**
* @return bool
*/
public
function
isActive
()
{
return
$this
->
status
==
1
;
}
}
app/Providers/EventServiceProvider.php
View file @
6ab7db35
...
...
@@ -41,8 +41,7 @@ class EventServiceProvider extends ServiceProvider
\App\Listeners\Backend\Access\User\UserEventListener
::
class
,
\App\Listeners\Backend\Access\Role\RoleEventListener
::
class
,
\App\Listeners\Backend\Access\Permission\PermissionEventListener
::
class
,
\App\Listeners\Backend\CMSPages\CMSPageEventListener
::
class
,
\App\Listeners\Backend\EmailTemplates\EmailTemplateEventListener
::
class
,
\App\Listeners\Backend\Pages\PageEventListener
::
class
,
\App\Listeners\Backend\BlogCategories\BlogCategoryEventListener
::
class
,
\App\Listeners\Backend\BlogTags\BlogTagEventListener
::
class
,
\App\Listeners\Backend\Blogs\BlogEventListener
::
class
,
...
...
app/Repositories/Backend/EmailTemplates/EmailTemplatesRepository.php
deleted
100755 → 0
View file @
aae971c8
<?php
namespace
App\Repositories\Backend\EmailTemplates
;
use
App\Events\Backend\EmailTemplates\EmailTemplateDeleted
;
use
App\Events\Backend\EmailTemplates\EmailTemplateUpdated
;
use
App\Exceptions\GeneralException
;
use
App\Models\EmailTemplates\EmailTemplate
;
use
App\Repositories\BaseRepository
;
/**
* Class EmailTemplatesRepository.
*/
class
EmailTemplatesRepository
extends
BaseRepository
{
/**
* Associated Repository Model.
*/
const
MODEL
=
EmailTemplate
::
class
;
/**
* @return mixed
*/
public
function
getForDataTable
()
{
return
$this
->
query
()
->
select
([
config
(
'module.email_templates.table'
)
.
'.id'
,
config
(
'module.email_templates.table'
)
.
'.title'
,
config
(
'module.email_templates.table'
)
.
'.subject'
,
config
(
'module.email_templates.table'
)
.
'.status'
,
config
(
'module.email_templates.table'
)
.
'.created_at'
,
config
(
'module.email_templates.table'
)
.
'.updated_at'
,
]);
}
/**
* @param \App\Models\EmailTemplates\EmailTemplate $emailtemplate
* @param $input
*
* @throws GeneralException
*
* return bool
*/
public
function
update
(
EmailTemplate
$emailtemplate
,
array
$input
)
{
$input
[
'status'
]
=
isset
(
$input
[
'is_active'
])
?
1
:
0
;
unset
(
$input
[
'is_active'
]);
$input
[
'updated_by'
]
=
access
()
->
user
()
->
id
;
if
(
$emailtemplate
->
update
(
$input
))
{
event
(
new
EmailTemplateUpdated
(
$emailtemplate
));
return
true
;
}
throw
new
GeneralException
(
trans
(
'exceptions.backend.emailtemplates.update_error'
));
}
/**
* @param \App\Models\EmailTemplates\EmailTemplate $emailtemplate
*
* @throws GeneralException
*
* @return bool
*/
public
function
delete
(
EmailTemplate
$emailtemplate
)
{
if
(
$emailtemplate
->
delete
())
{
event
(
new
EmailTemplateDeleted
(
$emailtemplate
));
return
true
;
}
throw
new
GeneralException
(
trans
(
'exceptions.backend.emailtemplates.delete_error'
));
}
}
database/migrations/2017_11_02_060149_create_email_template_placeholders_table.php
deleted
100644 → 0
View file @
aae971c8
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
class
CreateEmailTemplatePlaceholdersTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'email_template_placeholders'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
string
(
'name'
,
191
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
drop
(
'email_template_placeholders'
);
}
}
database/migrations/2017_11_02_060149_create_email_template_types_table.php
deleted
100644 → 0
View file @
aae971c8
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
class
CreateEmailTemplateTypesTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'email_template_types'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
string
(
'name'
,
191
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
drop
(
'email_template_types'
);
}
}
database/migrations/2017_11_02_060149_create_email_templates_table.php
deleted
100644 → 0
View file @
aae971c8
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
class
CreateEmailTemplatesTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'email_templates'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
integer
(
'type_id'
)
->
unsigned
()
->
index
();
$table
->
string
(
'title'
);
$table
->
string
(
'subject'
);
$table
->
text
(
'body'
,
65535
);
$table
->
boolean
(
'status'
)
->
default
(
1
);
$table
->
integer
(
'created_by'
)
->
unsigned
();
$table
->
integer
(
'updated_by'
)
->
unsigned
()
->
nullable
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
drop
(
'email_templates'
);
}
}
database/seeds/DatabaseSeeder.php
View file @
6ab7db35
...
...
@@ -19,9 +19,6 @@ class DatabaseSeeder extends Seeder
$this
->
call
(
AccessTableSeeder
::
class
);
$this
->
call
(
HistoryTypeTableSeeder
::
class
);
$this
->
call
(
EmailTemplateTypeTableSeeder
::
class
);
$this
->
call
(
EmailTemplatePlaceholderTableSeeder
::
class
);
$this
->
call
(
EmailTemplateTableSeeder
::
class
);
$this
->
call
(
SettingsTableSeeder
::
class
);
$this
->
call
(
PagesTableSeeder
::
class
);
$this
->
call
(
MenuTableSeeder
::
class
);
...
...
database/seeds/EmailTemplatePlaceholderTableSeeder.php
deleted
100755 → 0
View file @
aae971c8
<?php
use
Carbon\Carbon
as
Carbon
;
use
Illuminate\Database\Seeder
;
use
Illuminate\Support\Facades\DB
;
class
EmailTemplatePlaceholderTableSeeder
extends
Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public
function
run
()
{
if
(
env
(
'DB_CONNECTION'
)
==
'mysql'
)
{
DB
::
table
(
config
(
'module.email_templates.placeholders_table'
))
->
truncate
();
}
$data
=
[
[
'name'
=>
'app_name'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'name'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'email'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'password'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'contact-details'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'confirmation_link'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'password_reset_link'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'header_logo'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'footer_logo'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'unscribe_link'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'status'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
];
DB
::
table
(
config
(
'module.email_templates.placeholders_table'
))
->
insert
(
$data
);
}
}
database/seeds/EmailTemplateTableSeeder.php
deleted
100755 → 0
View file @
aae971c8
This diff is collapsed.
Click to expand it.
database/seeds/EmailTemplateTypeTableSeeder.php
deleted
100755 → 0
View file @
aae971c8
<?php
use
Carbon\Carbon
as
Carbon
;
use
Illuminate\Database\Seeder
;
use
Illuminate\Support\Facades\DB
;
class
EmailTemplateTypeTableSeeder
extends
Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public
function
run
()
{
if
(
env
(
'DB_CONNECTION'
)
==
'mysql'
)
{
DB
::
table
(
config
(
'module.email_templates.types_table'
))
->
truncate
();
}
$data
=
[
[
'name'
=>
'Registration'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'Create User'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'Acivate / Deactivate User'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
'Change Password'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
];
DB
::
table
(
config
(
'module.email_templates.types_table'
))
->
insert
(
$data
);
}
}
database/seeds/HistoryTypeTableSeeder.php
View file @
6ab7db35
...
...
@@ -45,30 +45,24 @@ class HistoryTypeTableSeeder extends Seeder
],
[
'id'
=>
4
,
'name'
=>
'
CMS
Page'
,
'name'
=>
'Page'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'id'
=>
5
,
'name'
=>
'EmailTemplate'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'id'
=>
6
,
'name'
=>
'BlogTag'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'id'
=>
7
,
'id'
=>
6
,
'name'
=>
'BlogCategory'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
],
[
'id'
=>
8
,
'id'
=>
7
,
'name'
=>
'Blog'
,
'created_at'
=>
Carbon
::
now
(),
'updated_at'
=>
Carbon
::
now
(),
...
...
database/seeds/MenuTableSeeder.php
View file @
6ab7db35
...
...
@@ -18,7 +18,7 @@ class MenuTableSeeder extends Seeder
'id'
=>
1
,
'type'
=>
'backend'
,
'name'
=>
'Backend Sidebar Menu'
,
'items'
=>
'[{"view_permission_id":"view-access-management","icon":"fa-users","open_in_new_tab":0,"url_type":"route","url":"","name":"Access Management","id":11,"content":"Access Management","children":[{"view_permission_id":"view-user-management","open_in_new_tab":0,"url_type":"route","url":"admin.access.user.index","name":"User Management","id":12,"content":"User Management"},{"view_permission_id":"view-role-management","open_in_new_tab":0,"url_type":"route","url":"admin.access.role.index","name":"Role Management","id":13,"content":"Role Management"},{"view_permission_id":"view-permission-management","open_in_new_tab":0,"url_type":"route","url":"admin.access.permission.index","name":"Permission Management","id":14,"content":"Permission Management"}]},{"view_permission_id":"view-module","icon":"fa-wrench","open_in_new_tab":0,"url_type":"route","url":"admin.modules.index","name":"Module","id":1,"content":"Module"},{"view_permission_id":"view-menu","icon":"fa-bars","open_in_new_tab":0,"url_type":"route","url":"admin.menus.index","name":"Menus","id":3,"content":"Menus"},{"view_permission_id":"view-page","icon":"fa-file-text","open_in_new_tab":0,"url_type":"route","url":"admin.pages.index","name":"Pages","id":2,"content":"Pages"},{"view_permission_id":"
view-email-template","icon":"fa-envelope","open_in_new_tab":0,"url_type":"route","url":"admin.emailtemplates.index","name":"Email Templates","id":8,"content":"Email Templates"},{"view_permission_id":"
edit-settings","icon":"fa-gear","open_in_new_tab":0,"url_type":"route","url":"admin.settings.edit?id=1","name":"Settings","id":9,"content":"Settings"},{"view_permission_id":"view-blog","icon":"fa-commenting","open_in_new_tab":0,"url_type":"route","url":"","name":"Blog Management","id":15,"content":"Blog Management","children":[{"view_permission_id":"view-blog-category","open_in_new_tab":0,"url_type":"route","url":"admin.blogCategories.index","name":"Blog Category Management","id":16,"content":"Blog Category Management"},{"view_permission_id":"view-blog-tag","open_in_new_tab":0,"url_type":"route","url":"admin.blogTags.index","name":"Blog Tag Management","id":17,"content":"Blog Tag Management"},{"view_permission_id":"view-blog","open_in_new_tab":0,"url_type":"route","url":"admin.blogs.index","name":"Blog Management","id":18,"content":"Blog Management"}]},{"view_permission_id":"view-faq","icon":"fa-question-circle","open_in_new_tab":0,"url_type":"route","url":"admin.faqs.index","name":"Faq Management","id":19,"content":"Faq Management"}]'
,
'items'
=>
'[{"view_permission_id":"view-access-management","icon":"fa-users","open_in_new_tab":0,"url_type":"route","url":"","name":"Access Management","id":11,"content":"Access Management","children":[{"view_permission_id":"view-user-management","open_in_new_tab":0,"url_type":"route","url":"admin.access.user.index","name":"User Management","id":12,"content":"User Management"},{"view_permission_id":"view-role-management","open_in_new_tab":0,"url_type":"route","url":"admin.access.role.index","name":"Role Management","id":13,"content":"Role Management"},{"view_permission_id":"view-permission-management","open_in_new_tab":0,"url_type":"route","url":"admin.access.permission.index","name":"Permission Management","id":14,"content":"Permission Management"}]},{"view_permission_id":"view-module","icon":"fa-wrench","open_in_new_tab":0,"url_type":"route","url":"admin.modules.index","name":"Module","id":1,"content":"Module"},{"view_permission_id":"view-menu","icon":"fa-bars","open_in_new_tab":0,"url_type":"route","url":"admin.menus.index","name":"Menus","id":3,"content":"Menus"},{"view_permission_id":"view-page","icon":"fa-file-text","open_in_new_tab":0,"url_type":"route","url":"admin.pages.index","name":"Pages","id":2,"content":"Pages"},{"view_permission_id":"edit-settings","icon":"fa-gear","open_in_new_tab":0,"url_type":"route","url":"admin.settings.edit?id=1","name":"Settings","id":9,"content":"Settings"},{"view_permission_id":"view-blog","icon":"fa-commenting","open_in_new_tab":0,"url_type":"route","url":"","name":"Blog Management","id":15,"content":"Blog Management","children":[{"view_permission_id":"view-blog-category","open_in_new_tab":0,"url_type":"route","url":"admin.blogCategories.index","name":"Blog Category Management","id":16,"content":"Blog Category Management"},{"view_permission_id":"view-blog-tag","open_in_new_tab":0,"url_type":"route","url":"admin.blogTags.index","name":"Blog Tag Management","id":17,"content":"Blog Tag Management"},{"view_permission_id":"view-blog","open_in_new_tab":0,"url_type":"route","url":"admin.blogs.index","name":"Blog Management","id":18,"content":"Blog Management"}]},{"view_permission_id":"view-faq","icon":"fa-question-circle","open_in_new_tab":0,"url_type":"route","url":"admin.faqs.index","name":"Faq Management","id":19,"content":"Faq Management"}]'
,
'created_by'
=>
1
,
'created_at'
=>
Carbon
::
now
(),
];
...
...
database/seeds/ModulesTableSeeder.php
View file @
6ab7db35
...
...
@@ -65,13 +65,6 @@ class ModulesTableSeeder extends Seeder
'created_by'
=>
1
,
'created_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
trans
(
'labels.backend.emailtemplates.title'
),
'url'
=>
'admin.emailtemplates.index'
,
'view_permission_id'
=>
'view-email-template'
,
'created_by'
=>
1
,
'created_at'
=>
Carbon
::
now
(),
],
[
'name'
=>
trans
(
'labels.backend.settings.title'
),
'url'
=>
'admin.settings.edit'
,
...
...
public/js/backend/admin.js
View file @
6ab7db35
...
...
@@ -646,47 +646,6 @@ var Backend = {}; // common variable used in all the files of the backend
}
},
emailTemplate
:
{
selectors
:
{
emailtemplateSelection
:
document
.
querySelector
(
"
.select2
"
)
},
init
:
function
()
{
Backend
.
emailTemplate
.
addHandlers
();
Backend
.
tinyMCE
.
init
();
},
// ! Backend.emailTemplate.addHandlers
addHandlers
:
function
()
{
jQuery
(
"
.select2
"
).
select2
();
// to add placeholder in to active textarea
document
.
getElementById
(
"
addPlaceHolder
"
).
onclick
=
function
(
event
)
{
Backend
.
emailTemplate
.
addPlaceHolder
(
event
);
};
document
.
getElementById
(
"
showPreview
"
).
onclick
=
function
(
event
)
{
Backend
.
emailTemplate
.
showPreview
(
event
);
};
},
// ! Backend.emailTemplate.addPlaceHolder
addPlaceHolder
:
function
(
event
)
{
var
placeHolder
=
document
.
getElementById
(
'
placeHolder
'
).
value
;
if
(
placeHolder
!=
''
)
{
tinymce
.
activeEditor
.
execCommand
(
'
mceInsertContent
'
,
false
,
"
[
"
+
jQuery
(
'
#placeHolder :selected
'
).
text
()
+
"
]
"
);
}
},
// ! Backend.emailTemplate.showPreview
showPreview
:
function
(
event
)
{
document
.
querySelector
(
"
.modal-body
"
).
innerHTML
=
tinyMCE
.
get
(
'
txtBody
'
).
getContent
();
//jQuery( ".modal-body" ).html(tinyMCE.get('txtBody').getContent());
jQuery
(
"
.model-wrapper
"
).
modal
(
'
show
'
);
},
},
/**
* Faq
*
...
...
resources/lang/en/alerts.php
View file @
6ab7db35
...
...
@@ -61,14 +61,10 @@ return [
'updated'
=>
'The Blog was successfully updated.'
,
],
'emailtemplates'
=>
[
'deleted'
=>
'The Email Template was successfully deleted.'
,
'updated'
=>
'The Email Template was successfully updated.'
,
],
'settings'
=>
[
'updated'
=>
'The Setting was successfully updated.'
,
],
'faqs'
=>
[
'created'
=>
'The Faq was successfully created.'
,
'deleted'
=>
'The Faq was successfully deleted.'
,
...
...
resources/lang/en/exceptions.php
View file @
6ab7db35
...
...
@@ -81,14 +81,6 @@ return [
'update_error'
=>
'There was a problem updating this Blog Tag. Please try again.'
,
],
'emailtemplates'
=>
[
'already_exists'
=>
'That Email Template already exists. Please choose a different name.'
,
'create_error'
=>
'There was a problem creating this Email Template. Please try again.'
,
'delete_error'
=>
'There was a problem deleting this Email Template. Please try again.'
,
'not_found'
=>
'That Email Template does not exist.'
,
'update_error'
=>
'There was a problem updating this Email Template. Please try again.'
,
],
'settings'
=>
[
'update_error'
=>
'There was a problem updating this Settings. Please try again.'
,
],
...
...
@@ -134,9 +126,4 @@ return [
'registration_disabled'
=>
'Registration is currently closed.'
,
],
],
'api'
=>
[
'cmspage'
=>
[
'not_found'
=>
'given cms page is not found.'
,
],
],
];
resources/lang/en/history.php
View file @
6ab7db35
...
...
@@ -29,9 +29,9 @@ return [
'updated'
=>
'updated permission'
,
],
'pages'
=>
[
'created'
=>
'created
CMS
Page'
,
'deleted'
=>
'deleted
CMS
Page'
,
'updated'
=>
'updated
CMS
Page'
,
'created'
=>
'created Page'
,
'deleted'
=>
'deleted Page'
,
'updated'
=>
'updated Page'
,
],
'blogcategories'
=>
[
'created'
=>
'created Blog Category'
,
...
...
@@ -48,10 +48,6 @@ return [
'deleted'
=>
'deleted Blog'
,
'updated'
=>
'updated Blog'
,
],
'emailtemplates'
=>
[
'deleted'
=>
'deleted Email Template'
,
'updated'
=>
'updated Email Template'
,
],
'users'
=>
[
'changed_password'
=>
'changed password for user'
,
'created'
=>
'created user'
,
...
...
resources/lang/en/labels.php
View file @
6ab7db35
...
...
@@ -177,22 +177,6 @@ return [
],
],
'emailtemplates'
=>
[
'create'
=>
'Create Email Template'
,
'edit'
=>
'Edit Email Template'
,
'management'
=>
'Email Template Management'
,
'title'
=>
'Email Templates'
,
'table'
=>
[
'title'
=>
'Title'
,
'subject'
=>
'Subject'
,
'status'
=>
'Status'
,
'createdat'
=>
'Created At'
,
'updatedat'
=>
'Updated At'
,
'all'
=>
'All'
,
],
],
'settings'
=>
[
'edit'
=>
'Edit Settings'
,
'management'
=>
'Settings Management'
,
...
...
resources/lang/en/menus.php
View file @
6ab7db35
...
...
@@ -105,14 +105,6 @@ return [
'main'
=>
'Faq Pages'
,
],
'emailtemplates'
=>
[
'all'
=>
'All Email Template'
,
'create'
=>
'Create Email Template'
,
'edit'
=>
'Edit Email Template'
,
'management'
=>
'Email Template Management'
,
'main'
=>
'Email Template'
,
],
'settings'
=>
[
'all'
=>
'All Settings'
,
'create'
=>
'Create Settings'
,
...
...
resources/lang/en/validation.php
View file @
6ab7db35
...
...
@@ -166,15 +166,6 @@ return [
'is_active'
=>
'Active'
,
],
'emailtemplates'
=>
[
'title'
=>
'Title'
,
'type'
=>
'Type'
,
'subject'
=>
'Subject'
,
'body'
=>
'Body'
,
'placeholder'
=>
'Placeholder'
,
'is_active'
=>
'Active'
,
],
'blogcategories'
=>
[
'title'
=>
'Blog Category'
,
'is_active'
=>
'Active'
,
...
...
resources/views/backend/emailtemplates/edit.blade.php
deleted
100755 → 0
View file @
aae971c8
@
extends
(
'backend.layouts.app'
)
@
section
(
'title'
,
trans
(
'labels.backend.emailtemplates.management'
)
.
' | '
.
trans
(
'labels.backend.emailtemplates.edit'
))
@
section
(
'page-header'
)
<
h1
>
{{
trans
(
'labels.backend.emailtemplates.management'
)
}}
<
small
>
{{
trans
(
'labels.backend.emailtemplates.edit'
)
}}
</
small
>
</
h1
>
<
div
class
="
model
-
container
">
<div class="
modal
fade
model
-
wrapper
" id="
myModal
" role="
dialog
">
<div class="
modal
-
dialog
modal
-
md
">
<div class="
modal
-
content
">
<div class="
modal
-
header
">
<button type="
button
" class="
close
" data-dismiss="
modal
" aria-label="
Close
">
<span aria-hidden="
true
">×</span>
</button>
<h4 class="
modal
-
title
" id="
myModalLabel
"> Email Template </h4>
</div>
<div id="
model
-
body
" class="
modal
-
body
">
</div>
</div>
</div>
</div>
</div>
@endsection
@section('content')
{{ Form::model(
$emailtemplate
, ['route' => ['admin.emailtemplates.update',
$emailtemplate
], 'class' => 'form-horizontal', 'role' => 'form', 'method' => 'PATCH', 'id' => 'edit-role']) }}
<div class="
box
box
-
info
">
<div class="
box
-
header
with
-
border
">
<h3 class="
box
-
title
">{{ trans('labels.backend.emailtemplates.edit') }}</h3>
</div><!-- /.box-header -->
<div class="
box
-
body
">
<div class="
form
-
group
">
{{ Form::label('title', trans('validation.attributes.backend.emailtemplates.title'), ['class' => 'col-lg-2 control-label required']) }}
<div class="
col
-
lg
-
10
">
{{ Form::text('title', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.emailtemplates.title'), 'required' => 'required']) }}
</div><!--col-lg-10-->
</div><!--form control-->
<div class="
form
-
group
">
{{ Form::label('type_id', trans('validation.attributes.backend.emailtemplates.type'), ['class' => 'col-lg-2 control-label required']) }}
<div class="
col
-
lg
-
10
">
{{ Form::select('type_id',
$emailtemplatetypes
, null,['class' => 'form-control select2 box-size', 'placeholder' => trans('validation.attributes.backend.emailtemplates.type'), 'required' => 'required']) }}
</div><!--col-lg-10-->
</div><!--form control-->
<div class="
form
-
group
">
{{ Form::label('placeholder', trans('validation.attributes.backend.emailtemplates.placeholder'), ['class' => 'col-lg-2 control-label']) }}
<div class="
col
-
lg
-
10
">
<div class="
input
-
group
box
-
size
">
{{ Form::select('placeholder',
$emailtemplateplaceholders
, null,['class' => 'form-control select2', 'placeholder' => trans('validation.attributes.backend.emailtemplates.placeholder'), 'id' => 'placeHolder', 'style' => 'width:100%']) }}
<span class="
input
-
group
-
btn
">
<button class="
btn
btn
-
primary
" id="
addPlaceHolder
" type="
button
">{{ trans('buttons.general.crud.add') }}</button>
</span>
</div><!-- /input-group -->
</div><!--col-lg-10-->
</div><!--form control-->
<div class="
form
-
group
">
{{ Form::label('subject', trans('validation.attributes.backend.emailtemplates.subject'), ['class' => 'col-lg-2 control-label required']) }}
<div class="
col
-
lg
-
10
">
{{ Form::text('subject', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.emailtemplates.subject')]) }}
</div><!--col-lg-10-->
</div><!--form control-->
<div class="
form
-
group
">
{{ Form::label('body', trans('validation.attributes.backend.emailtemplates.body'), ['class' => 'col-lg-2 control-label required']) }}
<div class="
col
-
lg
-
10
mce
-
box
">
{{ Form::textarea('body', null,['class' => 'form-control', 'placeholder' => trans('validation.attributes.backend.emailtemplates.body'), 'id' => 'txtBody']) }}
</div><!--col-lg-3-->
</div><!--form control-->
<div class="
form
-
group
">
{{ Form::label('is_active', trans('validation.attributes.backend.emailtemplates.is_active'), ['class' => 'col-lg-2 control-label']) }}
<div class="
col
-
lg
-
10
">
<div class="
control
-
group
">
<label class="
control
control
--
checkbox
">
{{ Form::checkbox('is_active', 1, (
$emailtemplate->status
== 1) ? true : false ) }}
<div class="
control__indicator
"></div>
</label>
</div>
</div><!--col-lg-3-->
</div><!--form control-->
<div class="
edit
-
form
-
btn
">
{{ link_to_route('admin.emailtemplates.index', trans('buttons.general.cancel'), [], ['class' => 'btn btn-danger btn-md']) }}
<input type="
button
" id="
showPreview
" data-toggle="
modal
" data-target="
#templatePreview" class="btn btn-info btn-md" value="{{ trans('buttons.general.preview') }}" />
{{
Form
::
submit
(
trans
(
'buttons.general.crud.update'
),
[
'class'
=>
'btn btn-primary btn-md'
])
}}
<
div
class
="
clearfix
"></div>
</div>
</div><!-- /.box-body -->
</div><!--box-->
{{ Form::close() }}
@endsection
@section("
after
-
scripts
")
<script type="
text
/
javascript
">
Backend.emailTemplate.init();
</script>
@endsection
\ No newline at end of file
resources/views/backend/emailtemplates/index.blade.php
deleted
100755 → 0
View file @
aae971c8
@
extends
(
'backend.layouts.app'
)
@
section
(
'title'
,
trans
(
'labels.backend.emailtemplates.management'
))
@
section
(
'page-header'
)
<
h1
>
{{
trans
(
'labels.backend.emailtemplates.management'
)
}}
</
h1
>
@
endsection
@
section
(
'content'
)
<
div
class
="
box
box
-
info
">
<div class="
box
-
header
with
-
border
">
<h3 class="
box
-
title
">{{ trans('labels.backend.emailtemplates.management') }}</h3>
<div class="
box
-
tools
pull
-
right
">
<div class="
btn
-
group
">
<button type="
button
" class="
btn
btn
-
warning
btn
-
flat
dropdown
-
toggle
" data-toggle="
dropdown
">Export
<span class="
caret
"></span>
<span class="
sr
-
only
">Toggle Dropdown</span>
</button>
<ul class="
dropdown
-
menu
" role="
menu
">
<li><a href="
#" id="copyButton"><i class="fa fa-clone"></i> Copy</a></li>
<
li
><
a
href
=
"#"
id
=
"csvButton"
><
i
class
="
fa
fa
-
file
-
text
-
o
"></i> CSV</a></li>
<li><a href="
#" id="excelButton"><i class="fa fa-file-excel-o"></i> Excel</a></li>
<
li
><
a
href
=
"#"
id
=
"pdfButton"
><
i
class
="
fa
fa
-
file
-
pdf
-
o
"></i> PDF</a></li>
<li><a href="
#" id="printButton"><i class="fa fa-print"></i> Print</a></li>
</
ul
>
</
div
>
</
div
>
</
div
><!--
/.
box
-
header
-->
<
div
class
="
box
-
body
">
<div class="
table
-
responsive
data
-
table
-
wrapper
">
<table id="
emailtemplates
-
table
" class="
table
table
-
condensed
table
-
hover
table
-
bordered
">
<thead>
<tr>
<th>{{ trans('labels.backend.emailtemplates.table.title') }}</th>
<th>{{ trans('labels.backend.emailtemplates.table.subject') }}</th>
<th>{{ trans('labels.backend.emailtemplates.table.status') }}</th>
<th>{{ trans('labels.backend.emailtemplates.table.createdat') }}</th>
<th>{{ trans('labels.backend.emailtemplates.table.updatedat') }}</th>
<th>{{ trans('labels.general.actions') }}</th>
</tr>
</thead>
<thead class="
transparent
-
bg
">
<tr>
<th>
{!! Form::text('title', null, ["
class
"
=>
"
search
-
input
-
text
form
-
control
", "
data
-
column
" => 0, "
placeholder
" => trans('labels.backend.emailtemplates.table.title')]) !!}
<a class="
reset
-
data
" href="
javascript
:
void
(
0
)
" data-column=0><i class="
fa
fa
-
times
"></i></a>
</th>
<th>
{!! Form::text('subject', null, ["
class
"
=>
"
search
-
input
-
text
form
-
control
", "
data
-
column
" => 1, "
placeholder
" => trans('labels.backend.emailtemplates.table.subject')]) !!}
<a class="
reset
-
data
" href="
javascript
:
void
(
0
)
" data-column=1><i class="
fa
fa
-
times
"></i></a>
</th>
<th>
{!! Form::select('status', [0 => "
InActive
", 1 => "
Active
"], null, ["
class
"
=>
"
search
-
input
-
select
form
-
control
", "
data
-
column
" => 2, "
placeholder
" => trans('labels.backend.emailtemplates.table.all')]) !!}
</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
</table>
</div><!--table-responsive-->
</div><!-- /.box-body -->
</div><!--box-->
<!--<div class="
box
box
-
info
">
<div class="
box
-
header
with
-
border
">
<h3 class="
box
-
title
">{{ trans('history.backend.recent_history') }}</h3>
<div class="
box
-
tools
pull
-
right
">
<button class="
btn
btn
-
box
-
tool
" data-widget="
collapse
"><i class="
fa
fa
-
minus
"></i></button>
</div><!-- /.box tools -->
</div><!-- /.box-header -->
<div class="
box
-
body
">
{{-- {!! history()->renderType('EmailTemplate') !!} --}}
</div><!-- /.box-body -->
</div><!--box box-info-->
@endsection
@section('after-scripts')
{{-- For DataTables --}}
{{ Html::script(mix('js/dataTable.js')) }}
<script>
$(function() {
var dataTable = $('#emailtemplates-table').dataTable({
processing: true,
serverSide: true,
ajax: {
url: '{{ route("
admin
.
emailtemplates
.
get
") }}',
type: 'post'
},
columns: [
{data: 'title', name: '
{
{config('module.email_templates.table')}}.title'
}
,
{data: 'subject', name: '
{
{config('module.email_templates.table')}}.subject'
}
,
{data: 'status', name: '
{
{config('module.email_templates.table')}}.status'
}
,
{data: 'created_at', name: '
{
{config('module.email_templates.table')}}.created_at'
}
,
{data: 'updated_at', name: '
{
{config('module.email_templates.table')}}.updated_at'
}
,
{data: 'actions', name: 'actions', searchable: false, sortable: false}
],
order: [[3, "
asc
"]],
searchDelay: 500,
dom: 'lBfrtip',
buttons: {
buttons: [
{ extend: 'copy', className: 'copyButton', exportOptions: {columns: [ 0, 1, 2, 3, 4 ] }},
{ extend: 'csv', className: 'csvButton', exportOptions: {columns: [ 0, 1, 2, 3, 4 ] }},
{ extend: 'excel', className: 'excelButton', exportOptions: {columns: [ 0, 1, 2, 3, 4 ] }},
{ extend: 'pdf', className: 'pdfButton', exportOptions: {columns: [ 0, 1, 2, 3, 4 ] }},
{ extend: 'print', className: 'printButton', exportOptions: {columns: [ 0, 1, 2, 3, 4 ] }}
]
}
});
Backend.DataTableSearch.init(dataTable);
});
</script>
@endsection
\ No newline at end of file
resources/views/backend/includes/sidebar.blade.php
View file @
6ab7db35
<?php
//dd(getMenuItems());
?>
<!-- Left side column. contains the logo and sidebar -->
<aside
class=
"main-sidebar"
>
<!-- sidebar: style can be found in sidebar.less -->
...
...
@@ -58,14 +56,6 @@
</a>
</li>
@endauth
@permission('view-email-template')
<li
class=
"{{ active_class(Active::checkUriPattern('admin/emailtemplates*')) }}"
>
<a
href=
"{{ route('admin.emailtemplates.index') }}"
>
<i
class=
"fa fa-envelope"
></i>
<span>
{{ trans('labels.backend.emailtemplates.title') }}
</span>
</a>
</li>
@endauth
@permission('edit-settings')
<li
class=
"{{ active_class(Active::checkUriPattern('admin/settings*')) }}"
>
<a
href=
"{{ route('admin.settings.edit', 1 ) }}"
>
...
...
routes/Backend/EmailTemplates.php
deleted
100644 → 0
View file @
aae971c8
<?php
/*
* Email Templates Management
*/
Route
::
group
([
'namespace'
=>
'EmailTemplates'
],
function
()
{
Route
::
resource
(
'emailtemplates'
,
'EmailTemplatesController'
,
[
'except'
=>
[
'show'
,
'create'
,
'save'
]]);
//For DataTables
Route
::
post
(
'emailtemplates/get'
,
'EmailTemplatesTableController'
)
->
name
(
'emailtemplates.get'
);
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment