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
37ea8297
Commit
37ea8297
authored
Sep 24, 2016
by
Junaid Rahman pv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixing
parent
5975a46b
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
163 additions
and
57 deletions
+163
-57
DistrictController.php
backend/modules/location/controllers/DistrictController.php
+10
-0
StateController.php
backend/modules/location/controllers/StateController.php
+10
-0
CategoryController.php
backend/modules/theme/controllers/CategoryController.php
+13
-14
ThemeController.php
backend/modules/theme/controllers/ThemeController.php
+19
-1
ThemeFileController.php
backend/modules/theme/controllers/ThemeFileController.php
+66
-12
index.php
backend/modules/theme/views/category/index.php
+6
-11
_form.php
backend/modules/theme/views/file/_form.php
+1
-2
_form.php
backend/modules/theme/views/theme-file/_form.php
+5
-1
upload.php
backend/modules/theme/views/theme-file/upload.php
+5
-2
_form.php
backend/modules/theme/views/theme/_form.php
+1
-1
index.php
backend/modules/theme/views/theme/index.php
+12
-5
common.php
backend/views/layouts/common.php
+4
-3
m160830_105840_category.php
common/migrations/db/m160830_105840_category.php
+3
-3
Category.php
common/models/Category.php
+1
-0
CategoryFiles.php
common/models/CategoryFiles.php
+1
-0
ThemeFiles.php
common/models/ThemeFiles.php
+6
-2
No files found.
backend/modules/location/controllers/DistrictController.php
View file @
37ea8297
...
@@ -70,6 +70,16 @@ class DistrictController extends Controller
...
@@ -70,6 +70,16 @@ class DistrictController extends Controller
$states
=
ArrayHelper
::
map
(
State
::
find
()
->
all
(),
'id'
,
'name'
);
$states
=
ArrayHelper
::
map
(
State
::
find
()
->
all
(),
'id'
,
'name'
);
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
())
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
())
{
Yii
::
$app
->
getSession
()
->
setFlash
(
'districtCreate'
,
[
'type'
=>
'success'
,
'duration'
=>
5000
,
'icon'
=>
'fa fa-map'
,
'message'
=>
' New District added'
,
'showSeparator'
=>
true
,
'title'
=>
' District'
,
'positonY'
=>
'top'
,
'positonX'
=>
'right'
]);
return
$this
->
redirect
([
'view'
,
'id'
=>
$model
->
id
]);
return
$this
->
redirect
([
'view'
,
'id'
=>
$model
->
id
]);
}
else
{
}
else
{
return
$this
->
render
(
'create'
,
[
return
$this
->
render
(
'create'
,
[
...
...
backend/modules/location/controllers/StateController.php
View file @
37ea8297
...
@@ -66,6 +66,16 @@ class StateController extends Controller
...
@@ -66,6 +66,16 @@ class StateController extends Controller
$model
=
new
State
();
$model
=
new
State
();
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
())
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
())
{
Yii
::
$app
->
getSession
()
->
setFlash
(
'stateCreate'
,
[
'type'
=>
'success'
,
'duration'
=>
5000
,
'icon'
=>
'fa fa-map'
,
'message'
=>
' New State added'
,
'showSeparator'
=>
true
,
'title'
=>
' State'
,
'positonY'
=>
'top'
,
'positonX'
=>
'right'
]);
return
$this
->
redirect
([
'view'
,
'id'
=>
$model
->
id
]);
return
$this
->
redirect
([
'view'
,
'id'
=>
$model
->
id
]);
}
else
{
}
else
{
return
$this
->
render
(
'create'
,
[
return
$this
->
render
(
'create'
,
[
...
...
backend/modules/theme/controllers/CategoryController.php
View file @
37ea8297
...
@@ -72,11 +72,11 @@ class CategoryController extends Controller
...
@@ -72,11 +72,11 @@ class CategoryController extends Controller
Yii
::
$app
->
getSession
()
->
setFlash
(
'success'
,
[
Yii
::
$app
->
getSession
()
->
setFlash
(
'success'
,
[
'type'
=>
'success'
,
'type'
=>
'success'
,
'duration'
=>
5000
,
'duration'
=>
5000
,
'icon'
=>
'fa fa-
envira
'
,
'icon'
=>
'fa fa-
sitemap
'
,
'message'
=>
'New
Theme Category
Created! '
,
'message'
=>
'New
Category '
.
$model
->
name
.
' is
Created! '
,
'title'
=>
'Category'
,
'title'
=>
'Category'
,
'positonY'
=>
'top'
,
'positonY'
=>
'top'
,
'positonX'
=>
'
right
'
'positonX'
=>
'
center
'
]);
]);
return
$this
->
redirect
([
'files'
,
'id'
=>
$model
->
id
]);
return
$this
->
redirect
([
'files'
,
'id'
=>
$model
->
id
]);
}
}
...
@@ -99,7 +99,16 @@ class CategoryController extends Controller
...
@@ -99,7 +99,16 @@ class CategoryController extends Controller
$model
=
$this
->
findModel
(
$id
);
$model
=
$this
->
findModel
(
$id
);
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
()
&&
$model
->
validate
())
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
()
&&
$model
->
validate
())
{
return
$this
->
redirect
([
'view'
,
'id'
=>
$model
->
id
]);
Yii
::
$app
->
getSession
()
->
setFlash
(
'success'
,
[
'type'
=>
'success'
,
'duration'
=>
5000
,
'icon'
=>
'fa fa-sitemap'
,
'message'
=>
'Category '
.
$model
->
name
.
' Updated! '
,
'title'
=>
'Category'
,
'positonY'
=>
'top'
,
'positonX'
=>
'right'
]);
return
$this
->
redirect
([
'files'
,
'id'
=>
$model
->
id
]);
}
}
return
$this
->
render
(
'update'
,
[
return
$this
->
render
(
'update'
,
[
...
@@ -139,7 +148,6 @@ class CategoryController extends Controller
...
@@ -139,7 +148,6 @@ class CategoryController extends Controller
if
(
Model
::
loadMultiple
(
$models
,
Yii
::
$app
->
request
->
post
()))
{
if
(
Model
::
loadMultiple
(
$models
,
Yii
::
$app
->
request
->
post
()))
{
$deletedIDs
=
array_diff
(
$oldIDs
,
array_filter
(
ArrayHelper
::
map
(
$models
,
'id'
,
'id'
)));
$deletedIDs
=
array_diff
(
$oldIDs
,
array_filter
(
ArrayHelper
::
map
(
$models
,
'id'
,
'id'
)));
if
(
Model
::
validateMultiple
(
$models
))
{
if
(
Model
::
validateMultiple
(
$models
))
{
$transaction
=
\Yii
::
$app
->
db
->
beginTransaction
();
$transaction
=
\Yii
::
$app
->
db
->
beginTransaction
();
...
@@ -159,15 +167,6 @@ class CategoryController extends Controller
...
@@ -159,15 +167,6 @@ class CategoryController extends Controller
if
(
$flag
)
{
if
(
$flag
)
{
$transaction
->
commit
();
$transaction
->
commit
();
Yii
::
$app
->
getSession
()
->
setFlash
(
'success'
,
[
'type'
=>
'success'
,
'duration'
=>
5000
,
'icon'
=>
'fa fa-file'
,
'message'
=>
'New File is added to Category Files list! '
,
'title'
=>
'Category Files'
,
'positonY'
=>
'top'
,
'positonX'
=>
'right'
]);
}
}
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
$transaction
->
rollBack
();
$transaction
->
rollBack
();
...
...
backend/modules/theme/controllers/ThemeController.php
View file @
37ea8297
...
@@ -73,7 +73,16 @@ class ThemeController extends Controller
...
@@ -73,7 +73,16 @@ class ThemeController extends Controller
$model
=
new
Theme
();
$model
=
new
Theme
();
$model
->
status
=
$model
::
STATUS_ACTIVE
;
$model
->
status
=
$model
::
STATUS_ACTIVE
;
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
())
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
())
{
return
$this
->
redirect
([
'view'
,
'id'
=>
$model
->
id
]);
Yii
::
$app
->
getSession
()
->
setFlash
(
'success'
,
[
'type'
=>
'success'
,
'duration'
=>
5000
,
'icon'
=>
'fa fa-envira'
,
'message'
=>
'New Theme '
.
$model
->
name
.
' is Created! '
,
'title'
=>
' Theme'
,
'positonY'
=>
'top'
,
'positonX'
=>
'center'
]);
return
$this
->
redirect
([
'files'
,
'id'
=>
$model
->
id
]);
}
}
return
$this
->
render
(
'create'
,
[
return
$this
->
render
(
'create'
,
[
'model'
=>
$model
,
'model'
=>
$model
,
...
@@ -94,6 +103,15 @@ class ThemeController extends Controller
...
@@ -94,6 +103,15 @@ class ThemeController extends Controller
$model
=
$this
->
findModel
(
$id
);
$model
=
$this
->
findModel
(
$id
);
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
())
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
())
{
Yii
::
$app
->
getSession
()
->
setFlash
(
'success'
,
[
'type'
=>
'success'
,
'duration'
=>
5000
,
'icon'
=>
'fa fa-envira'
,
'message'
=>
'Theme '
.
$model
->
name
.
' Updated! '
,
'title'
=>
'Theme'
,
'positonY'
=>
'top'
,
'positonX'
=>
'right'
]);
return
$this
->
redirect
([
'view'
,
'id'
=>
$model
->
id
]);
return
$this
->
redirect
([
'view'
,
'id'
=>
$model
->
id
]);
}
else
{
}
else
{
return
$this
->
render
(
'update'
,
[
return
$this
->
render
(
'update'
,
[
...
...
backend/modules/theme/controllers/ThemeFileController.php
View file @
37ea8297
...
@@ -4,7 +4,6 @@ namespace backend\modules\theme\controllers;
...
@@ -4,7 +4,6 @@ namespace backend\modules\theme\controllers;
use
common\models\ThemeFiles
;
use
common\models\ThemeFiles
;
use
yii
;
use
yii
;
use
common\models\Theme
;
use
yii\web\NotFoundHttpException
;
use
yii\web\NotFoundHttpException
;
use
yii\web\UploadedFile
;
use
yii\web\UploadedFile
;
...
@@ -14,6 +13,7 @@ class ThemeFileController extends \yii\web\Controller
...
@@ -14,6 +13,7 @@ class ThemeFileController extends \yii\web\Controller
{
{
return
$this
->
render
(
'index'
);
return
$this
->
render
(
'index'
);
}
}
public
function
actionUpload
()
public
function
actionUpload
()
{
{
$model
=
new
ThemeFiles
();
$model
=
new
ThemeFiles
();
...
@@ -24,37 +24,91 @@ class ThemeFileController extends \yii\web\Controller
...
@@ -24,37 +24,91 @@ class ThemeFileController extends \yii\web\Controller
// the following data will return an array
// the following data will return an array
$theme_file
=
UploadedFile
::
getInstance
(
$model
,
'file'
);
$theme_file
=
UploadedFile
::
getInstance
(
$model
,
'file'
);
$model
->
file
=
$theme_file
;
$ext
=
$model
->
file
->
extension
;
$allowed
=
array
(
'js'
,
'css'
,
'html'
);
if
(
in_array
(
$ext
,
$allowed
))
{
// the path to save file,
// the path to save file,
$folderPath
=
yii
::
getAlias
(
'@storage/private/theme-assets/'
)
.
$model
->
theme_code
;
$folderPath
=
yii
::
getAlias
(
'@storage/private/theme-assets/'
)
.
$model
->
theme_code
;
if
(
!
is_dir
(
$folderPath
))
{
if
(
!
is_dir
(
$folderPath
))
{
mkdir
(
$folderPath
);
mkdir
(
$folderPath
);
}
}
$path
=
$folderPath
.
'/'
.
$model
->
file_code
;
$path
=
$folderPath
.
'/'
.
$model
->
file_code
;
if
(
$model
->
save
(
false
))
{
if
(
$model
->
save
(
false
))
{
$theme_file
->
saveAs
(
$path
);
$model
->
file
->
saveAs
(
$path
);
Yii
::
$app
->
getSession
()
->
setFlash
(
$model
->
file_code
,
[
'type'
=>
'warning'
,
'duration'
=>
4000
,
'icon'
=>
'fa fa-file'
,
'message'
=>
''
.
$model
->
file_code
.
' Uploading...'
,
'showSeparator'
=>
true
,
'title'
=>
' File Upload'
,
'showProgressbar'
=>
true
,
'positonY'
=>
'top'
,
'positonX'
=>
'right'
]);
Yii
::
$app
->
getSession
()
->
setFlash
(
'success'
,
[
'type'
=>
'success'
,
'duration'
=>
5000
,
'icon'
=>
'fa fa-file'
,
'message'
=>
' File successfully Uploaded'
,
'showSeparator'
=>
true
,
'title'
=>
' File Upload'
,
'delay'
=>
4000
,
'positonY'
=>
'top'
,
'positonX'
=>
'right'
]);
}
else
{
}
else
{
echo
'Error'
;
echo
'Error'
;
exit
();
exit
();
}
}
}
else
{
Yii
::
$app
->
getSession
()
->
setFlash
(
'alert'
,
[
'type'
=>
'danger'
,
'duration'
=>
5000
,
'icon'
=>
'fa fa-envira'
,
'message'
=>
'File type miss match! '
,
'showSeparator'
=>
true
,
'title'
=>
'Error'
,
'showProgressbar'
=>
true
,
'positonY'
=>
'top'
,
'positonX'
=>
'right'
]);
}
}
}
return
$this
->
redirect
([
'theme/
index'
]);
return
$this
->
redirect
([
'theme/
files'
,
'id'
=>
$model
->
theme_id
]);
}
}
public
function
actionEditor
(
$id
)
public
{
function
actionEditor
(
$id
)
{
$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
=
yii
::
getAlias
(
'@storage/private/theme-assets/'
)
.
$model
->
theme_code
.
'/'
.
$model
->
file_code
;
file_put_contents
(
$file
,
$model
->
fileContent
);
file_put_contents
(
$file
,
$model
->
fileContent
);
Yii
::
$app
->
getSession
()
->
setFlash
(
'success'
,
[
'type'
=>
'success'
,
'duration'
=>
5000
,
'icon'
=>
'fa fa-file'
,
'message'
=>
' File Saved'
,
'showSeparator'
=>
true
,
'title'
=>
' Code Editor'
,
'positonY'
=>
'top'
,
'positonX'
=>
'right'
]);
}
}
return
$this
->
render
(
'editor'
,[
return
$this
->
render
(
'editor'
,
[
'model'
=>
$model
,
'model'
=>
$model
,
]);
]);
}
}
protected
function
findModel
(
$id
)
protected
{
function
findModel
(
$id
)
{
if
((
$model
=
ThemeFiles
::
findOne
(
$id
))
!==
null
)
{
if
((
$model
=
ThemeFiles
::
findOne
(
$id
))
!==
null
)
{
return
$model
;
return
$model
;
}
else
{
}
else
{
...
...
backend/modules/theme/views/category/index.php
View file @
37ea8297
...
@@ -45,19 +45,14 @@ $this->params['breadcrumbs'][] = $this->title;
...
@@ -45,19 +45,14 @@ $this->params['breadcrumbs'][] = $this->title;
[
[
'class'
=>
'yii\grid\ActionColumn'
,
'class'
=>
'yii\grid\ActionColumn'
,
'template'
=>
'{update} {delete}'
,
'template'
=>
'{update} {
files} {
delete}'
,
'buttons'
=>
[
'buttons'
=>
[
'download'
=>
function
(
$url
)
{
'files'
=>
function
(
$url
)
{
return
Html
::
a
(
return
Html
::
a
(
'<span class="fa fa-file"></span>'
,
$url
,
[
'<span class="glyphicon glyphicon-arrow-download"></span>'
,
'title'
=>
Yii
::
t
(
'yii'
,
'Files'
),
$url
,
]);
[
}
'title'
=>
'Download'
,
'data-pjax'
=>
'0'
,
]
]
);
},
],
],
],
],
],
]);
?>
]);
?>
...
...
backend/modules/theme/views/file/_form.php
View file @
37ea8297
...
@@ -75,8 +75,7 @@ use wbraganca\dynamicform\DynamicFormWidget;
...
@@ -75,8 +75,7 @@ use wbraganca\dynamicform\DynamicFormWidget;
</div>
</div>
<div
class=
"col-sm-4"
>
<div
class=
"col-sm-4"
>
<?=
$form
->
field
(
$model
,
"[
{
$i
}
]type"
)
->
dropDownList
(
$model
::
getfiles
(),
<?=
$form
->
field
(
$model
,
"[
{
$i
}
]type"
)
->
dropDownList
(
$model
::
getfiles
())
?>
[
'prompt'
=>
''
])
?>
</div>
</div>
</div>
</div>
...
...
backend/modules/theme/views/theme-file/_form.php
View file @
37ea8297
...
@@ -65,7 +65,11 @@ use yii\bootstrap\Modal;
...
@@ -65,7 +65,11 @@ use yii\bootstrap\Modal;
<div
id=
'modalContent'
<?=
$value
[
'id'
]
?>
style=
"text-align: center"
>
<div
id=
'modalContent'
<?=
$value
[
'id'
]
?>
style=
"text-align: center"
>
<?=
$this
->
render
(
'upload'
,
[
'model'
=>
$modelFiles
[
0
],])
?>
<?=
$this
->
render
(
'upload'
,
[
'model'
=>
$modelFiles
[
0
],
'ThemeId'
=>
$model
->
id
,
])
?>
</div>
</div>
...
...
backend/modules/theme/views/theme-file/upload.php
View file @
37ea8297
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
*/
*/
/* @var $model common\models\ThemeFiles */
/* @var $model common\models\ThemeFiles */
/* @var $ThemeId id of theme */
use
yii\widgets\ActiveForm
;
use
yii\widgets\ActiveForm
;
use
yii\bootstrap\Html
;
use
yii\bootstrap\Html
;
...
@@ -26,18 +27,20 @@ use yii\bootstrap\Html;
...
@@ -26,18 +27,20 @@ use yii\bootstrap\Html;
<?=
$form
->
field
(
$model
,
'file'
)
->
fileInput
([
'class'
=>
'btn btn-default'
])
?>
<?=
$form
->
field
(
$model
,
'file'
)
->
fileInput
([
'class'
=>
'btn btn-default'
])
?>
</div>
</div>
<div
class=
"col-md-11"
>
<div
class=
"col-md-11"
>
<?=
$form
->
field
(
$model
,
'file_code'
)
->
hiddenInput
([
'value'
=>
$model
->
file_code
])
->
label
(
false
)
?>
<?=
$form
->
field
(
$model
,
'file_code'
)
->
hiddenInput
([
'value'
=>
$model
->
file_code
])
->
label
(
false
)
?>
</div>
</div>
<div
class=
"col-md-11"
>
<div
class=
"col-md-11"
>
<?=
$form
->
field
(
$model
,
'theme_code'
)
->
hiddenInput
([
'value'
=>
$model
->
theme_code
])
->
label
(
false
)
?>
<?=
$form
->
field
(
$model
,
'theme_code'
)
->
hiddenInput
([
'value'
=>
$model
->
theme_code
])
->
label
(
false
)
?>
</div>
<div
class=
"col-md-11"
>
<?=
$form
->
field
(
$model
,
'theme_id'
)
->
hiddenInput
([
'value'
=>
$ThemeId
])
->
label
(
false
)
?>
</div>
</div>
</div>
</div>
...
...
backend/modules/theme/views/theme/_form.php
View file @
37ea8297
...
@@ -57,7 +57,7 @@ use yii\bootstrap\ActiveForm;
...
@@ -57,7 +57,7 @@ use yii\bootstrap\ActiveForm;
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<?=
$form
->
field
(
$model
,
'status'
)
->
dropDownList
(
$model
::
statuses
()
,
[
'prompt'
=>
''
]
)
?>
<?=
$form
->
field
(
$model
,
'status'
)
->
dropDownList
(
$model
::
statuses
())
?>
</div>
</div>
</div>
</div>
...
...
backend/modules/theme/views/theme/index.php
View file @
37ea8297
...
@@ -19,7 +19,7 @@ $this->params['breadcrumbs'][] = $this->title;
...
@@ -19,7 +19,7 @@ $this->params['breadcrumbs'][] = $this->title;
<
p
>
<
p
>
<?=
Html
::
a
(
Yii
::
t
(
'backend'
,
'Create {modelClass}'
,
[
<?=
Html
::
a
(
Yii
::
t
(
'backend'
,
'Create {modelClass}'
,
[
'modelClass'
=>
'Theme'
,
'modelClass'
=>
'Theme'
,
]),
[
'create'
],
[
'class'
=>
'btn btn-success'
])
?>
]),
[
'create'
],
[
'class'
=>
'btn btn-success'
])
?>
</p>
</p>
<?=
GridView
::
widget
([
<?=
GridView
::
widget
([
...
@@ -44,11 +44,18 @@ $this->params['breadcrumbs'][] = $this->title;
...
@@ -44,11 +44,18 @@ $this->params['breadcrumbs'][] = $this->title;
// 'created_at',
// 'created_at',
// 'updated_at',
// 'updated_at',
[
'class'
=>
'yii\grid\ActionColumn'
[
'class'
=>
'yii\grid\ActionColumn'
,
'template'
=>
'{update} {files} {delete}'
,
'buttons'
=>
[
'files'
=>
function
(
$url
)
{
return
Html
::
a
(
'<span class="fa fa-file"></span>'
,
$url
,
[
'title'
=>
Yii
::
t
(
'yii'
,
'Files'
),
]);
}
]
],
],
// ['class' => 'yii\grid\ActionColumn',
// 'template' => '{update}{delete}'],
],
],
]);
?>
]);
?>
...
...
backend/views/layouts/common.php
View file @
37ea8297
...
@@ -342,12 +342,13 @@ $bundle = BackendAsset::register($this);
...
@@ -342,12 +342,13 @@ $bundle = BackendAsset::register($this);
<?php
foreach
(
Yii
::
$app
->
session
->
getAllFlashes
()
as
$message
)
:
;
?>
<?php
foreach
(
Yii
::
$app
->
session
->
getAllFlashes
()
as
$message
)
:
;
?>
<?=
Growl
::
widget
([
<?=
Growl
::
widget
([
'type'
=>
(
!
empty
(
$message
[
'type'
]))
?
$message
[
'type'
]
:
'danger'
,
'type'
=>
(
!
empty
(
$message
[
'type'
]))
?
$message
[
'type'
]
:
'danger'
,
'title'
=>
(
!
empty
(
$message
[
'title'
]))
?
Html
::
encode
(
$message
[
'title'
])
:
'
Title Not Set
!'
,
'title'
=>
(
!
empty
(
$message
[
'title'
]))
?
Html
::
encode
(
$message
[
'title'
])
:
'
Libromi Web
!'
,
'icon'
=>
(
!
empty
(
$message
[
'icon'
]))
?
$message
[
'icon'
]
:
'fa fa-info'
,
'icon'
=>
(
!
empty
(
$message
[
'icon'
]))
?
$message
[
'icon'
]
:
'fa fa-info'
,
'body'
=>
(
!
empty
(
$message
[
'message'
]))
?
Html
::
encode
(
$message
[
'message'
])
:
'
Message Not Set
!'
,
'body'
=>
(
!
empty
(
$message
[
'message'
]))
?
Html
::
encode
(
$message
[
'message'
])
:
'
Welcome to Libromi Web
!'
,
'showSeparator'
=>
true
,
'showSeparator'
=>
true
,
'delay'
=>
1
,
//This delay is how long before the message shows
'delay'
=>
(
!
empty
(
$message
[
'delay'
]))
?
Html
::
encode
(
$message
[
'delay'
])
:
1
,
//This delay is how long before the message shows
'pluginOptions'
=>
[
'pluginOptions'
=>
[
'showProgressbar'
=>
(
!
empty
(
$message
[
'showProgressbar'
]))
?
Html
::
encode
(
$message
[
'showProgressbar'
])
:
false
,
'delay'
=>
(
!
empty
(
$message
[
'duration'
]))
?
$message
[
'duration'
]
:
3000
,
//This delay is how long the message shows for
'delay'
=>
(
!
empty
(
$message
[
'duration'
]))
?
$message
[
'duration'
]
:
3000
,
//This delay is how long the message shows for
'placement'
=>
[
'placement'
=>
[
'from'
=>
(
!
empty
(
$message
[
'positonY'
]))
?
$message
[
'positonY'
]
:
'top'
,
'from'
=>
(
!
empty
(
$message
[
'positonY'
]))
?
$message
[
'positonY'
]
:
'top'
,
...
...
common/migrations/db/m160830_105840_category.php
View file @
37ea8297
...
@@ -40,13 +40,13 @@ class m160830_105840_category extends Migration
...
@@ -40,13 +40,13 @@ class m160830_105840_category extends Migration
$this
->
createIndex
(
'idx_category_files_code'
,
'{{%category_files}}'
,
'code'
);
$this
->
createIndex
(
'idx_category_files_code'
,
'{{%category_files}}'
,
'code'
);
$this
->
createIndex
(
'idx_category_files_name'
,
'{{%category_files}}'
,
'name'
);
$this
->
createIndex
(
'idx_category_files_name'
,
'{{%category_files}}'
,
'name'
);
$this
->
addForeignKey
(
'fk_category
'
,
'{{%category_files}}'
,
'category_id'
,
'{{%category}}'
,
'id'
,
'RESTRICT
'
,
$this
->
addForeignKey
(
'fk_category
_files_category'
,
'{{%category_files}}'
,
'category_id'
,
'{{%category}}'
,
'id'
,
'cascade
'
,
'
RESTRICT
'
);
'
cascade
'
);
}
}
public
function
safeDown
()
public
function
safeDown
()
{
{
$this
->
dropForeignKey
(
'fk_category'
,
'{{%category_files}}'
);
$this
->
dropForeignKey
(
'fk_category
_files_category
'
,
'{{%category_files}}'
);
$this
->
dropIndex
(
'idx_category_files_name'
,
'{{%category_files}}'
);
$this
->
dropIndex
(
'idx_category_files_name'
,
'{{%category_files}}'
);
$this
->
dropIndex
(
'idx_category_files_code'
,
'{{%category_files}}'
);
$this
->
dropIndex
(
'idx_category_files_code'
,
'{{%category_files}}'
);
...
...
common/models/Category.php
View file @
37ea8297
...
@@ -137,4 +137,5 @@ class Category extends \yii\db\ActiveRecord
...
@@ -137,4 +137,5 @@ class Category extends \yii\db\ActiveRecord
];
];
}
}
}
}
common/models/CategoryFiles.php
View file @
37ea8297
...
@@ -93,4 +93,5 @@ class CategoryFiles extends \yii\db\ActiveRecord
...
@@ -93,4 +93,5 @@ class CategoryFiles extends \yii\db\ActiveRecord
self
::
TYPE_HTML_BLOCK
=>
Yii
::
t
(
'common'
,
'HTML BLOCK'
),
self
::
TYPE_HTML_BLOCK
=>
Yii
::
t
(
'common'
,
'HTML BLOCK'
),
];
];
}
}
}
}
common/models/ThemeFiles.php
View file @
37ea8297
...
@@ -27,6 +27,10 @@ class ThemeFiles extends \yii\db\ActiveRecord
...
@@ -27,6 +27,10 @@ class ThemeFiles extends \yii\db\ActiveRecord
*/
*/
public
$file
;
public
$file
;
/*
/*
* @var theme_id using to render file page
*/
public
$theme_id
;
/*
* @var file upload
* @var file upload
*/
*/
public
$fileContent
;
public
$fileContent
;
...
@@ -56,10 +60,10 @@ class ThemeFiles extends \yii\db\ActiveRecord
...
@@ -56,10 +60,10 @@ class ThemeFiles extends \yii\db\ActiveRecord
return
[
return
[
[[
'theme_code'
,
'file_code'
,
'file'
],
'required'
],
[[
'theme_code'
,
'file_code'
,
'file'
],
'required'
],
[[
'theme_code'
,
'file_code'
,
'fileContent'
],
'string'
],
[[
'theme_code'
,
'file_code'
,
'fileContent'
],
'string'
],
[[
'created_at'
,
'updated_at'
],
'integer'
],
[[
'created_at'
,
'updated_at'
,
'theme_id'
],
'integer'
],
[[
'file_code'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
CategoryFiles
::
className
(),
'targetAttribute'
=>
[
'file_code'
=>
'id'
]],
[[
'file_code'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
CategoryFiles
::
className
(),
'targetAttribute'
=>
[
'file_code'
=>
'id'
]],
[[
'theme_code'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
Theme
::
className
(),
'targetAttribute'
=>
[
'theme_code'
=>
'id'
]],
[[
'theme_code'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
Theme
::
className
(),
'targetAttribute'
=>
[
'theme_code'
=>
'id'
]],
[[
'file'
],
'file'
],
[[
'file'
],
'file'
,
'skipOnEmpty'
=>
false
,
'extensions'
=>
'js,css,html'
],
];
];
}
}
...
...
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