Commit e01fbd1a authored by Олег Гиммельшпах's avatar Олег Гиммельшпах

Merge branch 'master' of git.task-on.com:ktask/task-on.com

parents d23c31ff 879aac7c
...@@ -30,6 +30,7 @@ return [ ...@@ -30,6 +30,7 @@ return [
'school' => ['class' => 'common\modules\school\Module'], 'school' => ['class' => 'common\modules\school\Module'],
'support' => ['class' => 'common\modules\support\Module'], 'support' => ['class' => 'common\modules\support\Module'],
'rbac' => ['class' => 'common\modules\rbac\rbac'], 'rbac' => ['class' => 'common\modules\rbac\rbac'],
'unisender' => ['class' => 'common\modules\unisender\Module'],
], ],
'components' => [ 'components' => [
'session' => [ 'session' => [
......
<?php <?php
namespace common\components; namespace common\components;
use common\models\Settings;
use common\modules\triggers\components\conditions\vendor\ConditionBase; use common\modules\triggers\components\conditions\vendor\ConditionBase;
use yii\helpers\Json; use yii\helpers\Json;
...@@ -53,7 +54,8 @@ class UnisenderAPI { ...@@ -53,7 +54,8 @@ class UnisenderAPI {
* @param bool $Compression * @param bool $Compression
*/ */
function __construct($ApiKey = '5p7mt1be5x6axqniwu937gqohj9k9hn7gbex1efo', $Encoding = 'UTF8', $RetryCount = 4, $Timeout = null, $Compression = false) { function __construct($ApiKey = '5p7mt1be5x6axqniwu937gqohj9k9hn7gbex1efo', $Encoding = 'UTF8', $RetryCount = 4, $Timeout = null, $Compression = false) {
$this->ApiKey = $ApiKey; $key = Settings::getValue('unisender_api_key');
$this->ApiKey = (!is_null($key)) ? $key : $ApiKey;
if (!empty($Encoding)) { if (!empty($Encoding)) {
$this->Encoding = $Encoding; $this->Encoding = $Encoding;
......
<?php
namespace common\modules\unisender;
/**
* unisender module definition class
*/
class Module extends \common\components\WebModule
{
/**
* @inheritdoc
*/
public $controllerNamespace = 'common\modules\unisender\controllers';
public static $active = true;
public $menu_icons = 'fa fa-envelope';
public static function name()
{
return 'Модуль UNISender';
}
public static function description()
{
return 'Управление Unisender';
}
public static function version()
{
return '1.0';
}
public static function adminMenu()
{
return [
'Управление Unisender' => '/unisender/default/index',
];
}
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// custom initialization code goes here
}
}
<?php
namespace common\modules\unisender\controllers;
use common\components\AdminController;
/**
* Default controller for the `unisender` module
*/
class DefaultController extends AdminController
{
/**
* @return array|void
*/
public static function actionsTitles(){
return [
'Index' => 'Главная страница Unisender',
];
}
/**
* Renders the index view for the module
* @return string
*/
public function actionIndex()
{
return $this->render('index');
}
}
<div class="unisender-default-index">
<h1><?= $this->context->action->uniqueId ?></h1>
<p>
This is the view content for action "<?= $this->context->action->id ?>".
The action belongs to the controller "<?= get_class($this->context) ?>"
in the "<?= $this->context->module->id ?>" module.
</p>
<p>
You may customize this page by editing the following file:<br>
<code><?= __FILE__ ?></code>
</p>
</div>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment