public function actionControl($ajax) { if (!empty($ajax)) { $wid = new \yii\base\Widget(); $this->options['url'] = $ajax; if (!empty($this->language)) { $this->options['lang'] = $this->language; $languageFile = Yii::$app->assetManager->publish(__DIR__ . "/assets/js/i18n/elfinder." . $this->language . ".js"); $this->getView()->registerJsFile($languageFile[1], ['depends' => elFinderAsset::className()]); } elFinderAsset::register($this->getView()); if (empty($this->options['id'])) { $this->options['id'] = $wid->getId(); } Yii::$app->assetManager->bundles = ['yii\\bootstrap\\BootstrapPluginAsset' => false, 'yii\\bootstrap\\BootstrapAsset' => false, 'yii\\web\\JqueryAsset' => false]; if (!empty($this->options['getFileCallback'])) { $this->options['getFileCallback'] = new \yii\web\JsExpression($this->options['getFileCallback']); } if (!isset($this->options['uiOptions'])) { $this->options['uiOptions'] = $this->options_['uiOptions']; } if (!isset($this->options['uiOptions']['toolbar'])) { $this->options['uiOptions']['toolbar'] = $this->options_['uiOptions']['toolbar']; } if (!isset($this->options['contextmenu'])) { $this->options['contextmenu'] = $this->options_['contextmenu']; } if (!isset($this->options['onlyMimes'])) { $this->options['onlyMimes'] = $this->options_['onlyMimes']; } $this->getView()->registerJs("\$('#" . $this->options['id'] . "').elfinder(" . Json::encode($this->options) . ").elfinder('instance');"); $this->getView()->registerCss("#" . $this->options['id'] . " * {box-sizing: unset;}"); return $this->renderFile(__DIR__ . "/views/client.php", ['content' => '<div id="' . $this->options['id'] . '"></div>']); } }
/** * @inheritdoc */ public function beforeAction($action) { /** * Check if it's already installed - if not force controller module */ if (!$this->params['installed'] && $this->controller->module != null && $this->controller->module->id != 'installer') { $this->controller->redirect(['/installer/index']); return false; } /** * More random widget autoId prefix * Ensures to be unique also on ajax partials */ \yii\base\Widget::$autoIdPrefix = 'h' . mt_rand(1, 999999) . 'w'; return parent::beforeAction($action); }
<?php /* @var $this yii\web\View */ require Yii::getAlias('@vendor') . '/adldap/adLDAP/src/adLDAP.php'; $adldap = \Yii::$app->ldap; yii\base\Widget::widget(); $this->title = 'О нас'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="site-about"> <p>Не много о создателях:</p> <?php if (!\Yii::$app->user->isGuest) { //$result = $adldap->user()->infoCollection(Yii::$app->user->identity->username, array("*")); $result = $adldap->user()->infoCollection("petrenko", array("*")); echo "<br>"; echo $result->displayName; echo "<br>"; echo $result->title; echo "<br>"; echo $result->mail; echo "<br>"; echo $result->department; echo "<br>"; echo $result->samaccountname; echo "<br>"; } ?> <code><?php