Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
17c3a24f
Commit
17c3a24f
authored
Mar 23, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1070 - Правка верстки в ПУ Контент
parent
b588085e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
4 deletions
+71
-4
backend/web/js/form-load.js
backend/web/js/form-load.js
+3
-2
backend/web/plugins/tinymce/js/tinymce/plugins/infowidgets/plugin.min.js
...gins/tinymce/js/tinymce/plugins/infowidgets/plugin.min.js
+43
-0
common/modules/content/controllers/BlockAdminController.php
common/modules/content/controllers/BlockAdminController.php
+17
-0
common/modules/content/models/CoBlocks.php
common/modules/content/models/CoBlocks.php
+6
-0
common/modules/content/views/block-admin/_form.php
common/modules/content/views/block-admin/_form.php
+1
-1
common/modules/content/views/content-admin/_form.php
common/modules/content/views/content-admin/_form.php
+1
-1
No files found.
backend/web/js/form-load.js
View file @
17c3a24f
...
...
@@ -18,7 +18,8 @@ $(function() {
FormSliderSwitcher
.
init
();
tinymce
.
init
({
selector
:
"
textarea
"
,
theme
:
"
modern
"
,
selector
:
"
textarea
"
,
theme
:
"
modern
"
,
language
:
"
ru
"
,
custom_elements
:
"
emstart,emend,header,main,span
"
,
extended_valid_elements
:
"
span[id|name|class|style],i[id|name|class|style],ul[id|name|class|style],li[id|name|class|style]
"
,
...
...
@@ -27,7 +28,7 @@ $(function() {
plugins
:
[
"
advlist autolink link image code lists charmap print preview hr anchor pagebreak
"
,
"
searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking
"
,
"
table contextmenu directionality emoticons paste textcolor responsivefilemanager codesample
"
"
table contextmenu directionality emoticons paste textcolor responsivefilemanager codesample
infowidgets
"
],
toolbar1
:
"
undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | codesample | styleselect
"
,
toolbar2
:
"
| responsivefilemanager | link unlink anchor | image media | forecolor backcolor | print preview code
"
,
...
...
backend/web/plugins/tinymce/js/tinymce/plugins/infowidgets/plugin.min.js
0 → 100644
View file @
17c3a24f
tinymce
.
PluginManager
.
add
(
'
infowidgets
'
,
function
(
editor
,
url
)
{
editor
.
addMenuItem
(
'
infowidget_button
'
,
{
text
:
'
Инфо-блок
'
,
context
:
'
insert
'
,
menu
:
[],
onPostRender
:
function
()
{
var
ctrl
=
this
,
menu
=
[];
$
.
getJSON
(
'
/content/block-admin/get
'
,
function
(
response
)
{
if
(
response
.
success
)
{
tinymce
.
each
(
response
.
items
,
function
(
blocks
,
category
)
{
var
subMenu
=
[];
tinymce
.
each
(
blocks
,
function
(
name
,
code
)
{
subMenu
.
push
({
text
:
name
,
onclick
:
function
()
{
editor
.
insertContent
(
'
{
'
+
code
+
'
}
'
);
}
});
});
if
(
category
==
''
)
{
category
=
'
(Не определено)
'
;
}
menu
.
push
({
text
:
category
,
menu
:
subMenu
});
});
ctrl
.
state
.
data
.
menu
=
ctrl
.
settings
.
menu
=
menu
;
}
});
}
});
});
\ No newline at end of file
common/modules/content/controllers/BlockAdminController.php
View file @
17c3a24f
...
...
@@ -5,6 +5,8 @@ namespace common\modules\content\controllers;
use
Yii
;
use
common\components\AdminController
;
use
yii\web\NotFoundHttpException
;
use
yii\web\Response
;
use
yii\helpers\ArrayHelper
;
use
yii\filters\VerbFilter
;
use
common\modules\content\models\CoBlocks
;
...
...
@@ -25,6 +27,7 @@ class BlockAdminController extends AdminController
'Copy'
=>
'Копирование блока'
,
'Delete'
=>
'Удаление блока'
,
'View'
=>
'Просмотр блока'
,
'Get'
=>
'Вывод списка блоков'
];
}
...
...
@@ -198,6 +201,20 @@ class BlockAdminController extends AdminController
]);
}
/**
* Lists all CoBlocks models.
* @return mixed
*/
public
function
actionGet
()
{
Yii
::
$app
->
response
->
format
=
Response
::
FORMAT_JSON
;
return
[
'success'
=>
true
,
'items'
=>
ArrayHelper
::
map
(
CoBlocks
::
find
()
->
all
(),
'name'
,
'title'
,
'category.name'
)
];
}
/**
* Deletes an existing CoBlocks model.
* If deletion is successful, the browser will be redirected to the 'index' page.
...
...
common/modules/content/models/CoBlocks.php
View file @
17c3a24f
...
...
@@ -6,6 +6,7 @@ use Yii;
use
common\modules\languages\models\Languages
;
use
common\modules\content\models\CoBlocksLang
;
use
common\modules\content\models\CoCategory
;
/**
* This is the model class for table "co_blocks".
...
...
@@ -78,6 +79,11 @@ class CoBlocks extends \common\components\ActiveRecordModel
];
}
public
function
getCategory
()
{
return
$this
->
hasOne
(
CoCategory
::
className
(),
[
'id'
=>
'category_id'
]);
}
public
function
getLang
(
$lang_id
=
null
)
{
$lang_id
=
(
$lang_id
===
null
)
?
Languages
::
getCurrent
()
->
id
:
$lang_id
;
...
...
common/modules/content/views/block-admin/_form.php
View file @
17c3a24f
...
...
@@ -35,7 +35,7 @@ use common\modules\content\models\CoBlocks;
<?php
endforeach
;
?>
</ul>
<div
class=
"tab-content"
>
<div
class=
"tab-content"
style=
"padding: 15px 0;"
>
<?php
$c
=
0
;
foreach
(
$model
->
getLangsHelper
()
as
$block
)
:
$c
++
;
$lang_id
=
$block
->
lang
->
id
;
?>
<div
class=
"tab-pane fade
<?=
(
$c
==
1
?
'active in'
:
''
)
?>
"
id=
"lang-
<?=
$block
->
lang
->
url
;
?>
"
>
...
...
common/modules/content/views/content-admin/_form.php
View file @
17c3a24f
...
...
@@ -73,7 +73,7 @@ $blocks = \common\modules\content\models\CoBlocks::find()->all();
}
?>
<div
class=
"tab-content"
>
<div
class=
"tab-content"
style=
"padding: 15px 0;"
>
<?php
$c
=
0
;
foreach
(
$model
->
getLangsHelper
()
as
$content
)
:
$c
++
;
$lang_id
=
$content
->
lang
->
id
;
?>
<div
class=
"tab-pane fade
<?=
(
$c
==
1
?
'active in'
:
''
)
?>
"
id=
"lang-
<?=
$content
->
lang
->
url
;
?>
"
>
...
...
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