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
7f91e429
Commit
7f91e429
authored
Sep 23, 2016
by
Junaid Rahman pv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some bug fix
parent
eba4f238
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
31 deletions
+73
-31
index.php
backend/modules/theme/views/category/index.php
+2
-2
editor.php
backend/modules/theme/views/theme-file/editor.php
+17
-20
m160830_105840_category.php
common/migrations/db/m160830_105840_category.php
+16
-3
m160903_101233_theme.php
common/migrations/db/m160903_101233_theme.php
+20
-6
Theme.php
common/models/Theme.php
+17
-0
ThemeFiles.php
common/models/ThemeFiles.php
+1
-0
a
storage/private/theme-assets/ab/a
+0
-0
No files found.
backend/modules/theme/views/category/index.php
View file @
7f91e429
...
...
@@ -40,11 +40,11 @@ $this->params['breadcrumbs'][] = $this->title;
'enum'
=>
Category
::
statuses
(),
'filter'
=>
Category
::
statuses
()
],
'created_at'
,
'created_at
:datetime
'
,
// 'updated_at',
[
'class'
=>
'yii\grid\ActionColumn'
,
'template'
=>
'{update}{delete}'
],
'template'
=>
'{update}
{delete}'
],
],
]);
?>
...
...
backend/modules/theme/views/theme-file/editor.php
View file @
7f91e429
...
...
@@ -10,38 +10,35 @@ use yii\helpers\Html;
?>
<div
class=
"text-block-form"
>
<div
class=
"text-block-form"
>
<?php
$form
=
ActiveForm
::
begin
();
?>
<?php
$file
=
yii
::
getAlias
(
'@storage/private/theme-assets/'
)
.
$model
->
theme_code
.
'/'
.
$model
->
file_code
;
$model
->
fileContent
=
file_get_contents
(
$file
);
?>
<div
class=
"page-header"
>
<h4>
<b>
Theme code:
</b>
<?=
$model
->
theme_code
?>
<br><br><b>
File code:
</b>
<?php
$form
=
ActiveForm
::
begin
();
?>
<?php
$file
=
yii
::
getAlias
(
'@storage/private/theme-assets/'
)
.
$model
->
theme_code
.
'/'
.
$model
->
file_code
;
$model
->
fileContent
=
file_get_contents
(
$file
);
?>
<?=
$model
->
file_code
?>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
</h4
>
<b>
File:
</b>
<?=
$model
->
theme_code
?>
/
<?=
$model
->
file_code
?>
<br/><br/
>
</div>
</div>
<?=
$form
->
field
(
$model
,
'fileContent'
)
->
widget
(
<?=
$form
->
field
(
$model
,
'fileContent'
)
->
widget
(
trntv\aceeditor\AceEditor
::
className
(),
[
'mode'
=>
'html'
'mode'
=>
'html'
,
'theme'
=>
'chaos'
,
]
)
?>
)
?>
<div
class=
"form-group"
>
<?=
Html
::
submitButton
(
<?=
Html
::
submitButton
(
$model
->
isNewRecord
?
Yii
::
t
(
'backend'
,
'Create'
)
:
Yii
::
t
(
'backend'
,
'Update'
),
[
'class'
=>
$model
->
isNewRecord
?
'btn btn-success'
:
'btn btn-primary'
]
[
'class'
=>
$model
->
isNewRecord
?
'btn btn-success'
:
'btn btn-primary'
]
)
?>
</div>
...
...
common/migrations/db/m160830_105840_category.php
View file @
7f91e429
...
...
@@ -27,20 +27,33 @@ class m160830_105840_category extends Migration
$this
->
createTable
(
'{{%category_files}}'
,
[
'id'
=>
$this
->
primaryKey
(),
'category_id'
=>
$this
->
integer
()
->
notNull
(),
'code'
=>
$this
->
string
(
1
1
)
->
notNull
(),
'code'
=>
$this
->
string
(
1
0
)
->
notNull
(),
'type'
=>
$this
->
integer
()
->
notNull
(),
'name'
=>
$this
->
string
(
32
)
->
notNull
(),
'created_at'
=>
$this
->
integer
(),
'updated_at'
=>
$this
->
integer
()
],
$tableOptions
);
$this
->
addForeignKey
(
'fk_category'
,
'{{%category_files}}'
,
'category_id'
,
'{{%category}}'
,
'id'
,
'cascade'
,
'cascade'
);
$this
->
createIndex
(
'idx_category_name'
,
'{{%category}}'
,
'name'
);
$this
->
createIndex
(
'idx_category_slug'
,
'{{%category}}'
,
'slug'
);
$this
->
createIndex
(
'idx_category_files_category_id'
,
'{{%category_files}}'
,
'category_id'
);
$this
->
createIndex
(
'idx_category_files_code'
,
'{{%category_files}}'
,
'code'
);
$this
->
createIndex
(
'idx_category_files_name'
,
'{{%category_files}}'
,
'name'
);
$this
->
addForeignKey
(
'fk_category'
,
'{{%category_files}}'
,
'category_id'
,
'{{%category}}'
,
'id'
,
'RESTRICT'
,
'RESTRICT'
);
}
public
function
safeDown
()
{
$this
->
dropForeignKey
(
'fk_category'
,
'{{%category_files}}'
);
$this
->
dropIndex
(
'idx_category_files_name'
,
'{{%category_files}}'
);
$this
->
dropIndex
(
'idx_category_files_code'
,
'{{%category_files}}'
);
$this
->
dropIndex
(
'idx_category_files_category_id'
,
'{{%category_files}}'
);
$this
->
dropIndex
(
'idx_category_slug'
,
'{{%category}}'
);
$this
->
dropIndex
(
'idx_category_name'
,
'{{%category}}'
);
$this
->
dropTable
(
'{{%category_files}}'
);
$this
->
dropTable
(
'{{%category}}'
);
}
...
...
common/migrations/db/m160903_101233_theme.php
View file @
7f91e429
...
...
@@ -15,7 +15,7 @@ class m160903_101233_theme extends Migration
$this
->
createTable
(
'{{%theme}}'
,
[
'id'
=>
$this
->
primaryKey
(),
'category_id'
=>
$this
->
integer
()
->
notNull
(),
'code'
=>
$this
->
string
(
1
1
)
->
notNull
(),
'code'
=>
$this
->
string
(
1
0
)
->
notNull
(),
'slug'
=>
$this
->
string
(
32
)
->
notNull
(),
'name'
=>
$this
->
string
(
32
)
->
notNull
(),
'description'
=>
$this
->
string
(
512
),
...
...
@@ -26,16 +26,24 @@ class m160903_101233_theme extends Migration
$this
->
createTable
(
'{{%theme_files}}'
,
[
'id'
=>
$this
->
primaryKey
(),
'theme_code'
=>
$this
->
string
(
1
1
)
->
notNull
(),
'file_code'
=>
$this
->
string
(
1
1
)
->
notNull
(),
'theme_code'
=>
$this
->
string
(
1
0
)
->
notNull
(),
'file_code'
=>
$this
->
string
(
1
0
)
->
notNull
(),
'created_at'
=>
$this
->
integer
(),
'updated_at'
=>
$this
->
integer
()
],
$tableOptions
);
$this
->
createIndex
(
'idx_theme_code'
,
'{{%theme}}'
,
'code'
);
$this
->
createIndex
(
'idx_theme_name'
,
'{{%theme}}'
,
'name'
);
$this
->
createIndex
(
'idx_theme_slug'
,
'{{%theme}}'
,
'slug'
);
$this
->
createIndex
(
'idx_theme_files_theme_code'
,
'{{%theme_files}}'
,
'theme_code'
);
$this
->
createIndex
(
'idx_theme_files_file_code'
,
'{{%theme_files}}'
,
'file_code'
);
$this
->
addForeignKey
(
'fk_theme_category'
,
'{{%theme}}'
,
'category_id'
,
'{{%category}}'
,
'id'
,
'cascade'
,
'cascade'
);
$this
->
addForeignKey
(
'fk_theme_files_theme'
,
'{{%theme_files}}'
,
'theme_code'
,
'{{%theme}}'
,
'code'
,
'cascade'
,
'cascade'
);
$this
->
addForeignKey
(
'fk_theme_category_files'
,
'{{%theme_files}}'
,
'file_code'
,
'{{%category_files}}'
,
'code'
,
'cascade'
,
'cascade'
);
$this
->
addForeignKey
(
'fk_theme_category'
,
'{{%theme}}'
,
'category_id'
,
'{{%category}}'
,
'id'
,
'RESTRICT'
,
'RESTRICT'
);
$this
->
addForeignKey
(
'fk_theme_files_theme'
,
'{{%theme_files}}'
,
'theme_code'
,
'{{%theme}}'
,
'code'
,
'RESTRICT'
,
'RESTRICT'
);
$this
->
addForeignKey
(
'fk_theme_files_category_files'
,
'{{%theme_files}}'
,
'file_code'
,
'{{%category_files}}'
,
'code'
,
'cascade'
,
'cascade'
);
}
public
function
safeDown
()
...
...
@@ -44,6 +52,12 @@ class m160903_101233_theme extends Migration
$this
->
dropForeignKey
(
'fk_theme_files_theme'
,
'{{%theme_files}}'
);
$this
->
dropForeignKey
(
'fk_theme_category'
,
'{{%theme}}'
);
$this
->
dropIndex
(
'idx_theme_files_file_code'
,
'{{%theme_files}}'
);
$this
->
dropIndex
(
'idx_theme_files_theme_code'
,
'{{%theme_files}}'
);
$this
->
dropIndex
(
'idx_theme_slug'
,
'{{%theme}}'
);
$this
->
dropIndex
(
'idx_theme_name'
,
'{{%theme}}'
);
$this
->
dropIndex
(
'idx_theme_code'
,
'{{%theme}}'
);
$this
->
dropTable
(
'{{%theme_files}}'
);
$this
->
dropTable
(
'{{%theme}}'
);
}
...
...
common/models/Theme.php
View file @
7f91e429
...
...
@@ -3,6 +3,8 @@
namespace
common\models
;
use
Yii
;
use
yii\behaviors\SluggableBehavior
;
use
yii\behaviors\TimestampBehavior
;
/**
* This is the model class for table "{{%theme}}".
...
...
@@ -33,6 +35,21 @@ class Theme extends \yii\db\ActiveRecord
return
'{{%theme}}'
;
}
public
function
behaviors
()
{
return
[
[
'class'
=>
SluggableBehavior
::
className
(),
'attribute'
=>
'name'
,
'immutable'
=>
true
],
[
'class'
=>
TimestampBehavior
::
className
(),
'createdAtAttribute'
=>
'created_at'
,
'updatedAtAttribute'
=>
'updated_at'
]
];
}
/**
* @inheritdoc
*/
...
...
common/models/ThemeFiles.php
View file @
7f91e429
...
...
@@ -115,4 +115,5 @@ class ThemeFiles extends \yii\db\ActiveRecord
{
return
file_exists
(
self
::
getFilePath
(
$theme_code
,
$file_code
));
}
}
storage/private/theme-assets/ab/a
deleted
100644 → 0
View file @
eba4f238
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