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
78b74de1
Commit
78b74de1
authored
Sep 03, 2016
by
dianc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
File type added in category
parent
762a49eb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
30 deletions
+18
-30
CategoryController.php
backend/modules/theme/controllers/CategoryController.php
+2
-1
_form.php
backend/modules/theme/views/category/_form.php
+0
-12
_form.php
backend/modules/theme/views/file/_form.php
+16
-17
No files found.
backend/modules/theme/controllers/CategoryController.php
View file @
78b74de1
...
@@ -139,6 +139,7 @@ class CategoryController extends Controller
...
@@ -139,6 +139,7 @@ class CategoryController extends Controller
$model
=
$this
->
findModel
(
$id
);
$model
=
$this
->
findModel
(
$id
);
$modelFiles
=
$model
->
categoryFiles
;
$modelFiles
=
$model
->
categoryFiles
;
// $modelFiles->type = $modelFiles::TYPE_JS;
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
()))
{
//&& $model->save()
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
()))
{
//&& $model->save()
...
@@ -235,7 +236,7 @@ class CategoryController extends Controller
...
@@ -235,7 +236,7 @@ class CategoryController extends Controller
}
}
}
}
return
$this
->
render
(
'
create
e'
,
[
return
$this
->
render
(
'
fil
e'
,
[
'model'
=>
$model
,
'model'
=>
$model
,
'modelFiles'
=>
(
empty
(
$modelFiles
))
?
[
new
CategoryFiles
()]
:
$modelFiles
'modelFiles'
=>
(
empty
(
$modelFiles
))
?
[
new
CategoryFiles
()]
:
$modelFiles
]);
]);
...
...
backend/modules/theme/views/category/_form.php
View file @
78b74de1
...
@@ -12,18 +12,6 @@ use trntv\filekit\widget\Upload;
...
@@ -12,18 +12,6 @@ use trntv\filekit\widget\Upload;
<div
class=
"category-form"
>
<div
class=
"category-form"
>
<?php
$form
=
ActiveForm
::
begin
();
?>
<?php
$form
=
ActiveForm
::
begin
();
?>
<!-- <ul id="myTab" class="nav nav-tabs">-->
<!-- <li class="active">-->
<!-- <a href="#info" data-toggle="tab">-->
<!-- Info-->
<!-- </a>-->
<!-- </li>-->
<!-- <li>-->
<!-- <a href="#files" data-toggle="tab">-->
<!-- Files-->
<!-- </a>-->
<!-- </li>-->
<!-- </ul>-->
<div
id=
"myTabContent"
class=
"tab-content"
>
<div
id=
"myTabContent"
class=
"tab-content"
>
<div
class=
"tab-pane fade in active"
id=
"info"
>
<div
class=
"tab-pane fade in active"
id=
"info"
>
...
...
backend/modules/theme/views/file/_form.php
View file @
78b74de1
...
@@ -4,19 +4,12 @@
...
@@ -4,19 +4,12 @@
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
yii\widgets\ActiveForm
;
use
yii\widgets\ActiveForm
;
use
wbraganca\dynamicform\DynamicFormWidget
;
use
wbraganca\dynamicform\DynamicFormWidget
;
?>
?>
<div
class=
"customer-form"
>
<div
class=
"customer-form"
>
<?php
$form
=
ActiveForm
::
begin
([
'id'
=>
'dynamic-form'
]);
?>
<?php
$form
=
ActiveForm
::
begin
([
'id'
=>
'dynamic-form'
]);
?>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<?=
$form
->
field
(
$model
,
'name'
)
->
textInput
([
'maxlength'
=>
true
])
?>
</div>
<div
class=
"col-sm-6"
>
<?=
$form
->
field
(
$model
,
'description'
)
->
textInput
([
'maxlength'
=>
true
])
?>
</div>
</div>
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<div
class=
"panel-heading"
>
...
@@ -36,7 +29,7 @@ use wbraganca\dynamicform\DynamicFormWidget;
...
@@ -36,7 +29,7 @@ use wbraganca\dynamicform\DynamicFormWidget;
'formFields'
=>
[
'formFields'
=>
[
'name'
,
'name'
,
'code'
,
'code'
,
'
category_id
'
,
'
type
'
,
],
],
]);
?>
]);
?>
...
@@ -46,25 +39,31 @@ use wbraganca\dynamicform\DynamicFormWidget;
...
@@ -46,25 +39,31 @@ use wbraganca\dynamicform\DynamicFormWidget;
<div
class=
"panel-heading"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title pull-left"
>
Category Files
</h3>
<h3
class=
"panel-title pull-left"
>
Category Files
</h3>
<div
class=
"pull-right"
>
<div
class=
"pull-right"
>
<button
type=
"button"
class=
"add-item btn btn-success btn-xs"
><i
class=
"glyphicon glyphicon-plus"
></i></button>
<button
type=
"button"
class=
"add-item btn btn-success btn-xs"
><i
<button
type=
"button"
class=
"remove-item btn btn-danger btn-xs"
><i
class=
"glyphicon glyphicon-minus"
></i></button>
class=
"glyphicon glyphicon-plus"
></i></button>
<button
type=
"button"
class=
"remove-item btn btn-danger btn-xs"
><i
class=
"glyphicon glyphicon-minus"
></i></button>
</div>
</div>
<div
class=
"clearfix"
></div>
<div
class=
"clearfix"
></div>
</div>
</div>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<?php
<?php
// necessary for update action.
// necessary for update action.
if
(
!
$modelFile
->
isNewRecord
)
{
if
(
!
$modelFile
->
isNewRecord
)
{
echo
Html
::
activeHiddenInput
(
$modelFile
,
"[
{
$i
}
]category_id"
);
echo
Html
::
activeHiddenInput
(
$modelFile
,
"[
{
$i
}
]category_id"
);
}
}
?>
?>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-
5
"
>
<div
class=
"col-sm-
4
"
>
<?=
$form
->
field
(
$modelFile
,
"[
{
$i
}
]name"
)
->
textInput
([
'maxlength'
=>
true
])
?>
<?=
$form
->
field
(
$modelFile
,
"[
{
$i
}
]name"
)
->
textInput
([
'maxlength'
=>
true
])
?>
</div>
</div>
<div
class=
"col-sm-
5
"
>
<div
class=
"col-sm-
4
"
>
<?=
$form
->
field
(
$modelFile
,
"[
{
$i
}
]code"
)
->
textInput
([
'maxlength'
=>
true
])
?>
<?=
$form
->
field
(
$modelFile
,
"[
{
$i
}
]code"
)
->
textInput
([
'maxlength'
=>
true
])
?>
</div>
</div>
<div
class=
"col-sm-4"
>
<!--
<?
//= $form->field($modelFile, "[{$i}]type")->textInput(['maxlength' => true]) ?> -->
<?=
$form
->
field
(
$modelFile
,
"[
{
$i
}
]type"
)
->
dropDownList
(
$modelFile
::
getfiles
(),
[
'prompt'
=>
''
])
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -75,7 +74,7 @@ use wbraganca\dynamicform\DynamicFormWidget;
...
@@ -75,7 +74,7 @@ use wbraganca\dynamicform\DynamicFormWidget;
</div>
</div>
<div class="form-group">
<div class="form-group">
<?=
Html
::
submitButton
(
'Save'
,
[
'class'
=>
'btn btn-primary'
])
?>
<?=
Html
::
submitButton
(
'Save'
,
[
'class'
=>
'btn btn-primary'
])
?>
</div>
</div>
<?php
ActiveForm
::
end
();
?>
<?php
ActiveForm
::
end
();
?>
...
...
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