Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
skeeks
/
cms-module-form
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Merge Requests
0
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
20fec362
authored
Apr 21, 2015
by
semenov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'release'
Master See merge request
!9
parents
72b19657
7dcac8ea
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
3 deletions
+66
-3
CHANGELOG.md
+7
-0
Module.php
+1
-1
migrations/m150405_230558_alter_table__form_field.php
+23
-0
models/FormField.php
+2
-1
models/FormSendMessage.php
+1
-1
models/FormValidateModel.php
+19
-0
views/admin-form/_form.php
+5
-0
widgets/ActiveForm.php
+8
-0
No files found.
CHANGELOG.md
0 → 100644
View file @
20fec362
Процесс разработки модуля.
==============
1.
0.3
-----------------
*
У полей формы добавлено значение активности.
Module.php
View file @
20fec362
...
...
@@ -23,7 +23,7 @@ class Module extends CmsModule
protected
function
_descriptor
()
{
return
array_merge
(
parent
::
_descriptor
(),
[
"version"
=>
"1.0.
2
"
,
"version"
=>
"1.0.
3
"
,
"name"
=>
"Модуль конструктор форм"
,
"description"
=>
"Модуль прорабатывает модель данных игрового портала. Поставляет модели Игра, Игровой жанр, Игровая платформа, Игровая компания (разработчик, издатель)"
,
...
...
migrations/m150405_230558_alter_table__form_field.php
0 → 100644
View file @
20fec362
<?php
/**
* @author Semenov Alexander <semenov@skeeks.com>
* @link http://skeeks.com/
* @copyright 2010 SkeekS (СкикС)
* @date 03.04.2015
*/
use
yii\db\Schema
;
use
yii\db\Migration
;
class
m150405_230558_alter_table__form_field
extends
Migration
{
public
function
safeUp
()
{
$this
->
execute
(
"ALTER TABLE
{
{%form_field}
}
ADD `active` TINYINT(1) NOT NULL DEFAULT '1' ;"
);
}
public
function
down
()
{
echo
"m150122_273205_alter_table__cms_user__emails_adn_phones cannot be reverted.
\n
"
;
return
false
;
}
}
models/FormField.php
View file @
20fec362
...
...
@@ -64,7 +64,7 @@ class FormField extends Core
public
function
rules
()
{
return
array_merge
(
parent
::
rules
(),
[
[[
'created_by'
,
'updated_by'
,
'created_at'
,
'updated_at'
,
'form_id'
],
'integer'
],
[[
'created_by'
,
'updated_by'
,
'created_at'
,
'updated_at'
,
'form_id'
,
'active'
],
'integer'
],
[[
'hint'
],
'string'
],
[[
'element_config'
],
'safe'
],
[[
'priority'
],
'integer'
],
...
...
@@ -114,6 +114,7 @@ class FormField extends Core
'hint'
=>
\Yii
::
t
(
'app'
,
'Небольшая подсказка элемента'
),
'name'
=>
\Yii
::
t
(
'app'
,
'Название'
),
'label'
=>
\Yii
::
t
(
'app'
,
'Label элемента'
),
'active'
=>
\Yii
::
t
(
'app'
,
'Активность'
),
]);
}
...
...
models/FormSendMessage.php
View file @
20fec362
...
...
@@ -182,7 +182,7 @@ class FormSendMessage extends Core
'form'
=>
$form
,
'formSendMessage'
=>
$this
])
->
setFrom
([
\Yii
::
$app
->
params
[
'supportEmail'
]
=>
\Yii
::
$app
->
name
])
->
setFrom
([
\Yii
::
$app
->
cms
->
adminEmail
=>
\Yii
::
$app
->
name
])
->
setTo
(
$formEmail
->
value
)
->
setSubject
(
"Отправка формы «
{
$form
->
name
}
» #"
.
$this
->
id
)
->
send
();
...
...
models/FormValidateModel.php
View file @
20fec362
...
...
@@ -237,4 +237,22 @@ class FormValidateModel extends Model
return
$result
;
}
/**
* @inheritdoc
*/
public
function
attributeLabelsValues
()
{
$result
=
[];
foreach
(
$this
->
modelForm
->
fields
()
as
$field
)
{
if
(
$this
->
getAttribute
(
$field
->
attribute
))
{
$result
[
$field
->
normalName
()]
=
$this
->
getAttribute
(
$field
->
attribute
);
}
}
return
$result
;
}
}
\ No newline at end of file
views/admin-form/_form.php
View file @
20fec362
...
...
@@ -76,9 +76,14 @@ use common\models\User;
'sortable'
=>
true
,
'columns'
=>
[
//['class' => 'yii\grid\SerialColumn'],
'attribute'
,
'name'
,
'label'
,
'hint'
,
[
'class'
=>
\skeeks\cms\grid\BooleanColumn
::
className
(),
'attribute'
=>
'active'
],
],
],
]);
?>
...
...
widgets/ActiveForm.php
View file @
20fec362
...
...
@@ -83,6 +83,14 @@ class ActiveForm extends \skeeks\cms\base\widgets\ActiveForm
sx.notify.error(response.message);
}
if (data.redirect)
{
_.delay(function()
{
window.location.href = data.redirect;
}, 200);
}
})
.execute();
...
...
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