Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
test-project
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Junaid Rahman pv
test-project
Commits
eba4f238
Commit
eba4f238
authored
Sep 22, 2016
by
Junaid Rahman pv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added file editor
parent
0a811f75
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
ThemeFileController.php
backend/modules/theme/controllers/ThemeFileController.php
+2
-1
editor.php
backend/modules/theme/views/theme-file/editor.php
+15
-2
No files found.
backend/modules/theme/controllers/ThemeFileController.php
View file @
eba4f238
...
@@ -45,7 +45,8 @@ class ThemeFileController extends \yii\web\Controller
...
@@ -45,7 +45,8 @@ class ThemeFileController extends \yii\web\Controller
{
{
$model
=
$this
->
findModel
(
$id
);
$model
=
$this
->
findModel
(
$id
);
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
()))
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
()))
{
$file
=
yii
::
getAlias
(
'@storage/private/theme-assets/'
)
.
$model
->
theme_code
.
'/'
.
$model
->
file_code
;
file_put_contents
(
$file
,
$model
->
fileContent
);
}
}
return
$this
->
render
(
'editor'
,[
return
$this
->
render
(
'editor'
,[
'model'
=>
$model
,
'model'
=>
$model
,
...
...
backend/modules/theme/views/theme-file/editor.php
View file @
eba4f238
...
@@ -7,16 +7,29 @@
...
@@ -7,16 +7,29 @@
*/
*/
use
yii\widgets\ActiveForm
;
use
yii\widgets\ActiveForm
;
use
yii\helpers\Html
;
use
yii\helpers\Html
;
?>
?>
<div
class=
"text-block-form"
>
<div
class=
"text-block-form"
>
<?php
$form
=
ActiveForm
::
begin
();
?>
<?php
$form
=
ActiveForm
::
begin
();
?>
<?php
<?php
$file
=
yii
::
getAlias
(
'@storage/private/theme-assets/'
)
.
$model
->
theme_code
.
'/'
.
$model
->
file_code
;
$file
=
yii
::
getAlias
(
'@storage/private/theme-assets/'
)
.
$model
->
theme_code
.
'/'
.
$model
->
file_code
;
$model
->
fileContent
=
file_get_contents
(
$file
);
$model
->
fileContent
=
file_get_contents
(
$file
);
?>
?>
?>
<div
class=
"page-header"
>
<h4>
<b>
Theme code:
</b>
<?=
$model
->
theme_code
?>
<br><br><b>
File code:
</b>
<?=
$model
->
file_code
?>
</h4>
</div>
<?=
$form
->
field
(
$model
,
'fileContent'
)
->
widget
(
<?=
$form
->
field
(
$model
,
'fileContent'
)
->
widget
(
trntv\aceeditor\AceEditor
::
className
(),
trntv\aceeditor\AceEditor
::
className
(),
...
...
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