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
f263f64b
Commit
f263f64b
authored
Feb 03, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clear column CoBlocks
parent
646c7008
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
16 deletions
+32
-16
common/modules/content/models/CoBlocks.php
common/modules/content/models/CoBlocks.php
+4
-16
common/modules/content/models/CoBlocksLang.php
common/modules/content/models/CoBlocksLang.php
+12
-0
console/migrations/m160203_090311_drop_column_blocks.php
console/migrations/m160203_090311_drop_column_blocks.php
+16
-0
No files found.
common/modules/content/models/CoBlocks.php
View file @
f263f64b
...
...
@@ -86,26 +86,14 @@ class CoBlocks extends \common\components\ActiveRecordModel
* @block string name block
* @return HTML string
*/
public
static
function
printBlock
(
$block
)
{
$model
=
self
::
findOne
([
'name'
=>
$block
]);
return
$model
->
text
;
public
static
function
printBlock
(
$block
)
{
$model
=
self
::
findOne
([
'name'
=>
$block
]);
return
$model
->
lang
->
text
;
}
public
static
function
printStaticBlock
(
$block
,
$addPath
=
false
)
{
return
Yii
::
$app
->
getView
()
->
render
(
'@app/views/layouts/block/'
.
$block
.
'.php'
);
}
public
function
afterFind
()
{
parent
::
afterFind
();
if
(
Yii
::
$app
->
controller
->
id
!=
'block-admin'
)
$this
->
text
=
\common\components\AppManager
::
prepareWidget
(
$this
->
text
);
$this
->
text
=
str_replace
(
'../../../'
,
'/'
,
$this
->
text
);
}
public
function
beforeSave
(
$insert
)
{
$this
->
text
=
str_replace
(
"../../../source/"
,
"http://taskon.soc-zaim.ru/source/"
,
$this
->
text
);
return
parent
::
beforeSave
(
$insert
);
}
}
common/modules/content/models/CoBlocksLang.php
View file @
f263f64b
...
...
@@ -70,6 +70,18 @@ class CoBlocksLang extends \common\components\ActiveRecordModel
];
}
public
function
afterFind
()
{
parent
::
afterFind
();
if
(
Yii
::
$app
->
controller
->
id
!=
'block-admin'
)
{
$this
->
text
=
\common\components\AppManager
::
prepareWidget
(
$this
->
text
);
}
$this
->
text
=
str_replace
(
'../../../'
,
'/'
,
$this
->
text
);
}
/**
* @return \yii\db\ActiveQuery
*/
...
...
console/migrations/m160203_090311_drop_column_blocks.php
0 → 100644
View file @
f263f64b
<?php
use
yii\db\Migration
;
class
m160203_090311_drop_column_blocks
extends
Migration
{
public
function
up
()
{
$this
->
dropColumn
(
'co_blocks'
,
'text'
);
}
public
function
down
()
{
$this
->
createColumn
(
'co_blocks'
,
'text'
,
'longtext NOT NULL'
);
}
}
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