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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
28 deletions
+16
-28
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
+14
-15
No files found.
backend/modules/theme/controllers/CategoryController.php
View file @
78b74de1
...
...
@@ -139,6 +139,7 @@ class CategoryController extends Controller
$model
=
$this
->
findModel
(
$id
);
$modelFiles
=
$model
->
categoryFiles
;
// $modelFiles->type = $modelFiles::TYPE_JS;
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
()))
{
//&& $model->save()
...
...
@@ -235,7 +236,7 @@ class CategoryController extends Controller
}
}
return
$this
->
render
(
'
create
e'
,
[
return
$this
->
render
(
'
fil
e'
,
[
'model'
=>
$model
,
'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;
<div
class=
"category-form"
>
<?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
class=
"tab-pane fade in active"
id=
"info"
>
...
...
backend/modules/theme/views/file/_form.php
View file @
78b74de1
...
...
@@ -4,19 +4,12 @@
use
yii\helpers\Html
;
use
yii\widgets\ActiveForm
;
use
wbraganca\dynamicform\DynamicFormWidget
;
?>
<div
class=
"customer-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-heading"
>
...
...
@@ -36,7 +29,7 @@ use wbraganca\dynamicform\DynamicFormWidget;
'formFields'
=>
[
'name'
,
'code'
,
'
category_id
'
,
'
type
'
,
],
]);
?>
...
...
@@ -46,25 +39,31 @@ use wbraganca\dynamicform\DynamicFormWidget;
<div
class=
"panel-heading"
>
<h3
class=
"panel-title pull-left"
>
Category Files
</h3>
<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=
"remove-item btn btn-danger btn-xs"
><i
class=
"glyphicon glyphicon-minus"
></i></button>
<button
type=
"button"
class=
"add-item btn btn-success btn-xs"
><i
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
class=
"clearfix"
></div>
</div>
<div
class=
"panel-body"
>
<?php
// necessary for update action.
if
(
!
$modelFile
->
isNewRecord
)
{
if
(
!
$modelFile
->
isNewRecord
)
{
echo
Html
::
activeHiddenInput
(
$modelFile
,
"[
{
$i
}
]category_id"
);
}
?>
<div
class=
"row"
>
<div
class=
"col-sm-
5
"
>
<div
class=
"col-sm-
4
"
>
<?=
$form
->
field
(
$modelFile
,
"[
{
$i
}
]name"
)
->
textInput
([
'maxlength'
=>
true
])
?>
</div>
<div
class=
"col-sm-
5
"
>
<div
class=
"col-sm-
4
"
>
<?=
$form
->
field
(
$modelFile
,
"[
{
$i
}
]code"
)
->
textInput
([
'maxlength'
=>
true
])
?>
</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>
...
...
@@ -75,7 +74,7 @@ use wbraganca\dynamicform\DynamicFormWidget;
</div>
<div class="form-group">
<?=
Html
::
submitButton
(
'Save'
,
[
'class'
=>
'btn btn-primary'
])
?>
<?=
Html
::
submitButton
(
'Save'
,
[
'class'
=>
'btn btn-primary'
])
?>
</div>
<?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