-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create I18nContent component class, Pass some configuration params th…
…rough it Now you can include `i18ncontent` module in backend, but include it in component
- Loading branch information
1 parent
c3aaa8a
commit 7c370b6
Showing
6 changed files
with
72 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
/** | ||
* User: zura | ||
* Date: 3/24/18 | ||
* Time: 3:28 PM | ||
*/ | ||
namespace centigen\i18ncontent; | ||
|
||
use yii\base\Component; | ||
use yii\helpers\Url; | ||
|
||
/** | ||
* Class I18nContent | ||
* | ||
* @author Zura Sekhniashvili <[email protected]> | ||
* @package centigen\i18ncontent | ||
*/ | ||
class I18nContent extends Component | ||
{ | ||
|
||
/** | ||
* Identity User class name | ||
* | ||
* @var string | ||
*/ | ||
public $userClass = null; | ||
|
||
/** | ||
* In texts which may contain <img> or other media object tags (texts which come from WYSIWYG editors) | ||
* `$mediaUrlPrefix` strings are replaced with `$mediaUrlReplacement` string when calling `Html::encodeMediaItemUrls` | ||
* and vice versa when calling `Html::decodeMediaItemUrls` | ||
* | ||
* @author Zura Sekhniashvili <[email protected]> | ||
* @var string | ||
*/ | ||
public $mediaUrlPrefix = null; | ||
|
||
/** | ||
* See `$mediaUrlPrefix` | ||
* | ||
* @author Zura Sekhniashvili <[email protected]> | ||
* @var string | ||
*/ | ||
public $mediaUrlReplacement = '{{media_item_url_prefix}}'; | ||
|
||
public function init() | ||
{ | ||
parent::init(); | ||
if (!$this->mediaUrlPrefix){ | ||
$this->mediaUrlPrefix = Url::base(true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,6 @@ | |
*/ | ||
class Module extends \yii\base\Module | ||
{ | ||
/** | ||
* Identity User class name | ||
* | ||
* @var string | ||
*/ | ||
public $userClass = null; | ||
|
||
/** | ||
* Default layout which will be used in all actions | ||
|
@@ -24,32 +18,6 @@ class Module extends \yii\base\Module | |
*/ | ||
public $defaultLayout = null; | ||
|
||
/** | ||
* In texts which may contain <img> or other media object tags (texts which come from WYSIWYG editors) | ||
* `$mediaUrlPrefix` strings are replaced with `$mediaUrlReplacement` string when calling `Html::encodeMediaItemUrls` | ||
* and vice versa when calling `Html::decodeMediaItemUrls` | ||
* | ||
* @author Zura Sekhniashvili <[email protected]> | ||
* @var string | ||
*/ | ||
public $mediaUrlPrefix = null; | ||
|
||
/** | ||
* See `$mediaUrlPrefix` | ||
* | ||
* @author Zura Sekhniashvili <[email protected]> | ||
* @var string | ||
*/ | ||
public $mediaUrlReplacement = '{{media_item_url_prefix}}'; | ||
|
||
public function __construct($id, $parent = null, $config = []) | ||
{ | ||
parent::__construct($id, $parent, $config); | ||
if (!$this->mediaUrlPrefix){ | ||
$this->mediaUrlPrefix = Url::base(true); | ||
} | ||
} | ||
|
||
public function missingTranslation() | ||
{ | ||
// @todo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters