• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP models\Setting类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中humhub\models\Setting的典型用法代码示例。如果您正苦于以下问题:PHP Setting类的具体用法?PHP Setting怎么用?PHP Setting使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Setting类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * Broadcast a message to all users
  */
 public function run()
 {
     //Send GCM notifications
     $model = new $this->modelClass();
     $records = $model->findBySql("SELECT * FROM gcm_relation")->all();
     $params = Yii::$app->getRequest()->getBodyParams();
     $data = array('message' => $params['message'], 'url' => $params['url']);
     $results = array();
     foreach ($records as $record) {
         if ($record->register_key) {
             //Enviar missatge
             $gcm = new GoogleCloudMessage();
             $gcm->apiKey = Setting::Get('gcmAPIKey', 'gcm');
             $gcm->url = Setting::Get('gcmURL', 'gcm');
             $result = $gcm->send($data, array($record->register_key));
             $results[$record->register_key] = $result;
         }
     }
     //Send mail notificacion
     $users = User::find()->distinct()->joinWith(['httpSessions', 'profile'])->where(['status' => User::STATUS_ENABLED]);
     Yii::setAlias('@gcmmodule', Yii::$app->getModule('gcm')->getBasePath());
     foreach ($users->each() as $user) {
         $mail = Yii::$app->mailer->compose(['html' => '@gcmmodule/views/emails/NewMessage'], ['message' => $params['message'], 'url' => $params['url']]);
         $mail->setFrom([Setting::Get('systemEmailAddress', 'mailing') => Setting::Get('systemEmailName', 'mailing')]);
         $mail->setTo($user->email);
         $mail->setSubject('Nova notícia al web: ' . $params['message']);
         $mail->send();
     }
     return true;
 }
开发者ID:ravalnet,项目名称:humhub-Gedi,代码行数:33,代码来源:BroadcastAction.php


示例2: init

 public function init()
 {
     $this->addItemGroup(array('id' => 'manage', 'label' => \Yii::t('AdminModule.widgets_AdminMenuWidget', '<strong>Administration</strong> menu'), 'sortOrder' => 100));
     $this->addItem(array('label' => \Yii::t('AdminModule.widgets_AdminMenuWidget', 'Users'), 'url' => Url::toRoute(['/admin/user']), 'icon' => '<i class="fa fa-user"></i>', 'group' => 'manage', 'sortOrder' => 200, 'isActive' => \Yii::$app->controller->module && \Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'user', 'isVisible' => \Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'User approval'), 'id' => 'approval', 'url' => Url::toRoute('/admin/approval'), 'icon' => '<i class="fa fa-check-circle"></i>', 'group' => 'manage', 'sortOrder' => 201, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'approval', 'isVisible' => Setting::Get('needApproval', 'authentication_internal') && Yii::$app->user->getIdentity()->canApproveUsers()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Groups'), 'id' => 'groups', 'url' => Url::toRoute('/admin/group'), 'icon' => '<i class="fa fa-group"></i>', 'group' => 'manage', 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'group', 'sortOrder' => 300, 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Spaces'), 'id' => 'spaces', 'url' => Url::toRoute('/admin/space'), 'icon' => '<i class="fa fa-inbox"></i>', 'group' => 'manage', 'sortOrder' => 400, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'space', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Modules'), 'id' => 'modules', 'url' => Url::toRoute('/admin/module'), 'icon' => '<i class="fa fa-rocket"></i>', 'sortOrder' => 500, 'group' => 'manage', 'newItemCount' => 0, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'module', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'About'), 'url' => Url::toRoute('/admin/about'), 'icon' => '<i class="fa fa-info-circle"></i>', 'sortOrder' => 10000, 'group' => 'manage', 'newItemCount' => 0, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'about', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItemGroup(array('id' => 'settings', 'label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Settings'), 'sortOrder' => 200));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Basic'), 'url' => Url::toRoute('/admin/setting/index'), 'icon' => '<i class="fa fa-cogs"></i>', 'group' => 'settings', 'sortOrder' => 100, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'setting' && Yii::$app->controller->action->id == 'basic', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Design'), 'url' => Url::toRoute('/admin/setting/design'), 'icon' => '<i class="fa fa-magic"></i>', 'group' => 'settings', 'sortOrder' => 200, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'setting' && Yii::$app->controller->action->id == 'design', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Authentication'), 'url' => Url::toRoute('/admin/setting/authentication'), 'icon' => '<i class="fa fa-lock"></i>', 'group' => 'settings', 'sortOrder' => 500, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'setting' && (Yii::$app->controller->action->id == 'authentication' || Yii::$app->controller->action->id == 'authenticationLdap'), 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'User profiles'), 'url' => Url::toRoute('/admin/user-profile/index'), 'icon' => '<i class="fa fa-wrench"></i>', 'group' => 'settings', 'sortOrder' => 500, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'user-profile', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Mailing'), 'url' => Url::toRoute('/admin/setting/mailing'), 'icon' => '<i class="fa fa-envelope"></i>', 'group' => 'settings', 'sortOrder' => 600, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'setting' && Yii::$app->controller->action->id == 'mailing', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Caching'), 'url' => Url::toRoute(['/admin/setting/caching']), 'icon' => '<i class="fa fa-dashboard"></i>', 'group' => 'settings', 'sortOrder' => 800, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'setting' && Yii::$app->controller->action->id == 'caching', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Files'), 'url' => Url::toRoute('/admin/setting/file'), 'icon' => '<i class="fa fa-file"></i>', 'group' => 'settings', 'sortOrder' => 800, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'setting' && Yii::$app->controller->action->id == 'file', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Proxy'), 'url' => Url::toRoute('/admin/setting/proxy'), 'icon' => '<i class="fa fa-sitemap"></i>', 'group' => 'settings', 'sortOrder' => 800, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'setting' && Yii::$app->controller->action->id == 'proxy', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Statistics'), 'url' => Url::toRoute('/admin/setting/statistic'), 'icon' => '<i class="fa fa-bar-chart-o"></i>', 'group' => 'settings', 'sortOrder' => 900, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'setting' && Yii::$app->controller->action->id == 'statistic', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Cron jobs'), 'url' => Url::toRoute('/admin/setting/cronjob'), 'icon' => '<i class="fa fa-history"></i>', 'group' => 'settings', 'sortOrder' => 1000, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'setting' && Yii::$app->controller->action->id == 'cronjob', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Logging'), 'url' => Url::toRoute('/admin/logging'), 'icon' => '<i class="fa fa-keyboard-o"></i>', 'group' => 'settings', 'sortOrder' => 1100, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'logging', 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'OEmbed Provider'), 'url' => Url::toRoute('/admin/setting/oembed'), 'icon' => '<i class="fa fa-cloud"></i>', 'group' => 'settings', 'sortOrder' => 1200, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'setting' && (Yii::$app->controller->action->id == 'oembed' || Yii::$app->controller->action->id == 'oembedEdit'), 'isVisible' => Yii::$app->user->isAdmin()));
     $this->addItem(array('label' => Yii::t('AdminModule.widgets_AdminMenuWidget', 'Self test & update'), 'url' => Url::toRoute('/admin/setting/self-test'), 'icon' => '<i class="fa fa-warning"></i>', 'group' => 'settings', 'sortOrder' => 1300, 'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'setting' && Yii::$app->controller->action->id == 'selftest', 'isVisible' => Yii::$app->user->isAdmin()));
     parent::init();
 }
开发者ID:gautamkrishnar,项目名称:humhub-openshift-quickstart,代码行数:25,代码来源:AdminMenu.php


示例3: actionAuto

 public function actionAuto()
 {
     $this->stdout("Install:\n\n", Console::FG_YELLOW);
     \humhub\modules\installer\libs\InitialData::bootstrap();
     Setting::Set('name', "HumHub Test");
     Setting::Set('systemEmailName', "[email protected]", 'mailing');
     Setting::Set('systemEmailName', "[email protected]", 'mailing');
     Setting::Set('secret', \humhub\libs\UUID::v4());
     $user = new User();
     $user->group_id = 1;
     $user->username = "Admin";
     $user->auth_mode = 'local';
     $user->email = '[email protected]';
     $user->status = User::STATUS_ENABLED;
     $user->language = '';
     $user->last_activity_email = new \yii\db\Expression('NOW()');
     if (!$user->save()) {
         throw new \yii\base\Exception("Could not save user");
     }
     $user->profile->title = "System Administration";
     $user->profile->firstname = "John";
     $user->profile->lastname = "Doe";
     $user->profile->save();
     $password = new Password();
     $password->user_id = $user->id;
     $password->setPassword('test');
     $password->save();
     return self::EXIT_CODE_NORMAL;
 }
开发者ID:SimonBaeumer,项目名称:humhub,代码行数:29,代码来源:InstallController.php


示例4: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (Setting::Get('defaultDateInputFormat', 'admin') != '') {
         $this->dateInputFormat = Setting::Get('defaultDateInputFormat', 'admin');
     }
 }
开发者ID:weison-tech,项目名称:humhub,代码行数:10,代码来源:Formatter.php


示例5: actionDownloadZippedFolder

 /**
  * Action to download a folder defined by request param "fid" as a zip file.
  *
  * @throws HttpException
  */
 public function actionDownloadZippedFolder()
 {
     // cleanup all old files
     $this->cleanup();
     // init output directory
     $outputPath = $this->getZipOutputPath();
     // check validity of currentFolder
     $currentFolder = $this->getCurrentFolder();
     if (empty($currentFolder)) {
         throw new HttpException(404, Yii::t('CfilesModule.base', 'The folder with the id %id% does not exist.', ['%id%' => (int) Yii::$app->request->get('fid')]));
     }
     // zip the current folder
     $zipTitle = $this->zipDir($currentFolder, $outputPath);
     $zipPath = $outputPath . DIRECTORY_SEPARATOR . $zipTitle;
     // check if the zip was created
     if (!file_exists($zipPath)) {
         throw new HttpException(404, Yii::t('CfilesModule.base', 'The archive could not be created.'));
     }
     // deliver the zip
     $options = ['inline' => false, 'mimeType' => FileHelper::getMimeTypeByExtension($zipPath)];
     if (!Setting::Get('useXSendfile', 'file')) {
         Yii::$app->response->sendFile($zipPath, $zipTitle, $options);
     } else {
         if (strpos($_SERVER['SERVER_SOFTWARE'], 'nginx') === 0) {
             // set nginx specific X-Sendfile header name
             $options['xHeader'] = 'X-Accel-Redirect';
             // make path relative to docroot
             $docroot = rtrim($_SERVER['DOCUMENT_ROOT'], DIRECTORY_SEPARATOR);
             if (substr($zipPath, 0, strlen($docroot)) == $docroot) {
                 $zipPath = substr($zipPath, strlen($docroot));
             }
         }
         Yii::$app->response->xSendFile($zipPath, null, $options);
     }
 }
开发者ID:pkdevboxy,项目名称:humhub-modules-cfiles,代码行数:40,代码来源:ZipController.php


示例6: beforeAction

 /**
  * @inheritdoc
  */
 public function beforeAction($action)
 {
     $identity = Yii::$app->user->getIdentity();
     if ($identity != null && !$identity->isActive()) {
         Yii::$app->user->logout();
         Yii::$app->response->redirect(Yii::$app->urlManager->createUrl('user/auth/login'));
     }
     if (Yii::$app->user->isGuest) {
         if (!$this->loggedInOnly && !$this->adminOnly) {
             return true;
         }
         if (in_array($action->id, $this->guestAllowedActions) && Setting::Get('allowGuestAccess', 'authentication_internal') == 1) {
             return true;
         }
         Yii::$app->user->loginRequired();
         return false;
     }
     if ($this->adminOnly && !Yii::$app->user->isAdmin()) {
         $this->forbidden();
     }
     if ($this->loggedInOnly) {
         return true;
     }
     return false;
 }
开发者ID:gautamkrishnar,项目名称:humhub-openshift-quickstart,代码行数:28,代码来源:AccessControl.php


示例7: getMailUpdate

 public function getMailUpdate(User $user, $interval)
 {
     $output = "";
     foreach (Session::find()->where(['<', 'expire', time()])->all() as $session) {
         $session->delete();
     }
     $receive_email_notifications = $user->getSetting("receive_email_notifications", 'core', Setting::Get('receive_email_notifications', 'mailing'));
     // Never receive notifications
     if ($receive_email_notifications == User::RECEIVE_EMAIL_NEVER) {
         return "";
     }
     // We are in hourly mode and user wants daily
     if ($interval == CronController::EVENT_ON_HOURLY_RUN && $receive_email_notifications == User::RECEIVE_EMAIL_DAILY_SUMMARY) {
         return "";
     }
     // We are in daily mode and user dont wants daily reports
     if ($interval == CronController::EVENT_ON_DAILY_RUN && $receive_email_notifications != User::RECEIVE_EMAIL_DAILY_SUMMARY) {
         return "";
     }
     // User wants only when offline and is online
     if ($interval == CronController::EVENT_ON_HOURLY_RUN) {
         $isOnline = count($user->httpSessions) > 0;
         if ($receive_email_notifications == User::RECEIVE_EMAIL_WHEN_OFFLINE && $isOnline) {
             return "";
         }
     }
     $query = Notification::find()->where(['user_id' => $user->id])->andWhere(['!=', 'seen', 1])->andWhere(['!=', 'emailed', 1]);
     foreach ($query->all() as $notification) {
         $output .= $notification->getClass()->render(BaseNotification::OUTPUT_MAIL);
         $notification->emailed = 1;
         $notification->save();
     }
     return $output;
 }
开发者ID:happyfredo,项目名称:humhub,代码行数:34,代码来源:Module.php


示例8: actionIndex

 /**
  * Configuration Action for Super Admins.
  */
 public function actionIndex()
 {
     $post = $this->getPost(array('SmsProviderConfigureForm', 'AnySmsConfigureForm', 'ClickatellConfigureForm', 'SpryngConfigureForm'));
     if ($post != null) {
         $provider = $post['provider'];
         $form = $this->getSmsProviderForm($provider);
         // provider changed => just change the provider setting and reload the correct form
         if ($provider != Setting::Get('provider', 'sms')) {
             $form = new \humhub\modules\sms\forms\SmsProviderConfigureForm();
         } else {
             $form = $this->getSmsProviderForm($provider);
         }
         $form->setAttributes($post);
         if ($form->validate()) {
             foreach ($form->attributeNames() as $attributeName) {
                 Setting::Set($attributeName, $form->{$attributeName}, 'sms');
             }
             return $this->redirect(['/sms/config']);
         }
     } else {
         $provider = Setting::Get('provider', 'sms');
         $form = $this->getSmsProviderForm($provider);
         foreach ($form->attributeNames() as $attributeName) {
             $form->{$attributeName} = Setting::Get($attributeName, 'sms');
         }
     }
     return $this->render('index', array('model' => $form));
 }
开发者ID:pkdevboxy,项目名称:humhub-modules-sms,代码行数:31,代码来源:ConfigController.php


示例9: isConfigured

 /**
  * Checks if the application is already configured.
  */
 public function isConfigured()
 {
     if (\humhub\models\Setting::Get('secret') != "") {
         return true;
     }
     return false;
 }
开发者ID:SimonBaeumer,项目名称:humhub,代码行数:10,代码来源:Module.php


示例10: actionIndex

 public function actionIndex()
 {
     $keyword = Yii::$app->request->get('keyword', "");
     $scope = Yii::$app->request->get('scope', "");
     $page = (int) Yii::$app->request->get('page', 1);
     $limitSpaceGuids = Yii::$app->request->get('limitSpaceGuids', "");
     $limitSpaces = array();
     if ($limitSpaceGuids !== "") {
         foreach (explode(",", $limitSpaceGuids) as $guid) {
             $guid = trim($guid);
             if ($guid != "") {
                 $space = Space::findOne(['guid' => trim($guid)]);
                 if ($space !== null) {
                     $limitSpaces[] = $space;
                 }
             }
         }
     }
     $options = ['page' => $page, 'sort' => $keyword == '' ? 'title' : null, 'pageSize' => Setting::Get('paginationSize'), 'limitSpaces' => $limitSpaces];
     if ($scope == self::SCOPE_CONTENT) {
         $options['type'] = \humhub\modules\search\engine\Search::DOCUMENT_TYPE_CONTENT;
     } elseif ($scope == self::SCOPE_SPACE) {
         $options['model'] = Space::className();
     } elseif ($scope == self::SCOPE_USER) {
         $options['model'] = User::className();
     } else {
         $scope = self::SCOPE_ALL;
     }
     $searchResultSet = Yii::$app->search->find($keyword, $options);
     $pagination = new \yii\data\Pagination();
     $pagination->totalCount = $searchResultSet->total;
     $pagination->pageSize = $searchResultSet->pageSize;
     return $this->render('index', array('scope' => $scope, 'keyword' => $keyword, 'results' => $searchResultSet->getResultInstances(), 'pagination' => $pagination, 'totals' => $this->getTotals($keyword, $options), 'limitSpaceGuids' => $limitSpaceGuids));
 }
开发者ID:SimonBaeumer,项目名称:humhub,代码行数:34,代码来源:SearchController.php


示例11: run

 /**
  * Executes the widgets
  */
 public function run()
 {
     if (Yii::$app->user->isGuest) {
         return;
     }
     // Active tour flag not set
     if (!isset($_GET['tour'])) {
         return;
     }
     // Tour only possible when we are in a module
     if (Yii::$app->controller->module === null) {
         return;
     }
     // Check if tour is activated by admin and users
     if (Setting::Get('enable', 'tour') == 0 || Yii::$app->user->getIdentity()->getSetting("hideTourPanel", "tour") == 1) {
         return;
     }
     // save current module and controller id's
     $currentModuleId = Yii::$app->controller->module->id;
     $currentControllerId = Yii::$app->controller->id;
     if ($currentModuleId == "dashboard" && $currentControllerId == "dashboard") {
         return $this->render('guide_interface');
     } elseif ($currentModuleId == "space" && $currentControllerId == "space") {
         return $this->render('guide_spaces', array());
     } elseif ($currentModuleId == "user" && $currentControllerId == "profile") {
         return $this->render('guide_profile', array());
     } elseif ($currentModuleId == "admin" && $currentControllerId == "module") {
         return $this->render('guide_administration', array());
     }
 }
开发者ID:SimonBaeumer,项目名称:humhub,代码行数:33,代码来源:Tour.php


示例12: actionIndex

 public function actionIndex()
 {
     if (!Setting::Get('apiKey', 'dropbox')) {
         return $this->render('errorMissingKey', array());
     }
     $model = new CreateDropboxPostForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         $dropboxPost = new DropboxPost();
         $dropboxPost->message = $model->message;
         $dropboxPost->content->container = $this->contentContainer;
         $dropboxPost->content->visibility = $this->contentContainer->visibility;
         $dropboxPost->save();
         $dropboxFileIds = explode(",", $model->dropboxFileId);
         foreach ($dropboxFileIds as $dropboxFileId) {
             if ($dropboxFileId != null) {
                 $dropboxFile = DropboxFile::findOne(['id' => $dropboxFileId]);
                 if ($dropboxFile->object_model != DropboxPost::className() || $dropboxFile->object_id != $dropboxPost->id) {
                     $dropboxFile->object_model = DropboxPost::className();
                     $dropboxFile->object_id = $dropboxPost->id;
                     $dropboxFile->save();
                 }
             }
         }
         return $this->htmlRedirect($this->contentContainer->createUrl());
     }
     return $this->render('index', array('model' => $model));
 }
开发者ID:pkdevboxy,项目名称:humhub-modules-dropbox,代码行数:27,代码来源:CreateController.php


示例13: up

 public function up()
 {
     if (\humhub\models\Setting::isInstalled()) {
         $this->alterColumn('profile', 'zip', 'VARCHAR(10) DEFAULT NULL');
         $this->update('profile_field', array('field_type_class' => 'ProfileFieldTypeText', 'field_type_config' => '{"minLength":null,"maxLength":10,"validator":null,"default":null,"regexp":null,"regexpErrorMessage":null}'), 'internal_name="zip"');
     }
 }
开发者ID:VasileGabriel,项目名称:humhub,代码行数:7,代码来源:m140907_140822_zip_field_to_text.php


示例14: request

 /**
  * HumHub API
  * 
  * @param string $action
  * @param array $params
  * @return array
  */
 public static function request($action, $params = [])
 {
     if (!Yii::$app->params['humhub']['apiEnabled']) {
         return [];
     }
     $url = Yii::$app->params['humhub']['apiUrl'] . '/' . $action;
     $params['version'] = urlencode(Yii::$app->version);
     $params['installId'] = Setting::Get('installationId', 'admin');
     $url .= '?';
     foreach ($params as $name => $value) {
         $url .= urlencode($name) . '=' . urlencode($value) . "&";
     }
     try {
         $http = new \Zend\Http\Client($url, array('adapter' => '\\Zend\\Http\\Client\\Adapter\\Curl', 'curloptions' => CURLHelper::getOptions(), 'timeout' => 30));
         $response = $http->send();
         $json = $response->getBody();
     } catch (\Zend\Http\Client\Adapter\Exception\RuntimeException $ex) {
         Yii::error('Could not connect to HumHub API! ' . $ex->getMessage());
         return [];
     } catch (Exception $ex) {
         Yii::error('Could not get HumHub API response! ' . $ex->getMessage());
         return [];
     }
     try {
         return Json::decode($json);
     } catch (\yii\base\InvalidParamException $ex) {
         Yii::error('Could not parse HumHub API response! ' . $ex->getMessage());
         return [];
     }
 }
开发者ID:gautamkrishnar,项目名称:humhub-openshift-quickstart,代码行数:37,代码来源:HumHubAPI.php


示例15: up

 public function up()
 {
     $this->dropTable(UserChatMessage::tableName());
     $this->createTable(UserChatMessage::tableName(), ['id' => $this->primaryKey(), 'message' => $this->text()->notNull(), 'created_at' => $this->dateTime()->notNull(), 'created_by' => $this->integer()->notNull()]);
     Setting::Set('theme', 'theme_bright.css', 'humhubchat');
     Setting::Set('timeout', '1', 'humhubchat');
 }
开发者ID:petersmithca,项目名称:humhub-basic-chat,代码行数:7,代码来源:m160219_120621_usage_of_humhub_stuff.php


示例16: onCronDailyRun

 /**
  * Check if there is a new Humhub Version available and sends a notification
  * to super admins
  *
  * @param \yii\base\Event $event
  */
 public static function onCronDailyRun($event)
 {
     $controller = $event->sender;
     if (!Yii::$app->getModule('admin')->dailyCheckForNewVersion) {
         return;
     }
     if (!Yii::$app->params['humhub']['apiEnabled']) {
         return;
     }
     $controller->stdout("Checking for new HumHub version... ");
     $latestVersion = libs\HumHubAPI::getLatestHumHubVersion();
     if ($latestVersion != "") {
         $adminUserQuery = User::find()->where(['super_admin' => 1]);
         $latestNotifiedVersion = Setting::Get('lastVersionNotify', 'admin');
         $adminsNotified = !($latestNotifiedVersion == "" || version_compare($latestVersion, $latestNotifiedVersion, ">"));
         $newVersionAvailable = version_compare($latestVersion, Yii::$app->version, ">");
         $updateNotification = new notifications\NewVersionAvailable();
         // Cleanup existing notifications
         if (!$newVersionAvailable || $newVersionAvailable && !$adminsNotified) {
             foreach ($adminUserQuery->all() as $admin) {
                 $updateNotification->delete($admin);
             }
         }
         // Create new notification
         if ($newVersionAvailable && !$adminsNotified) {
             $updateNotification->sendBulk($adminUserQuery);
             Setting::Set('lastVersionNotify', $latestVersion, 'admin');
         }
     }
     $controller->stdout('done. ' . PHP_EOL, \yii\helpers\Console::FG_GREEN);
 }
开发者ID:1resu,项目名称:humhub,代码行数:37,代码来源:Events.php


示例17:

 function __construct()
 {
     $this->baseUrl = "http://api.clickatell.com/http/sendmsg";
     $this->api_id = Setting::Get('apiid_clickatell', 'sms');
     $this->user_id = Setting::Get('username_clickatell', 'sms');
     $this->pass = Setting::Get('password_clickatell', 'sms');
 }
开发者ID:pkdevboxy,项目名称:humhub-modules-sms,代码行数:7,代码来源:Clickatell.php


示例18: up

 public function up()
 {
     if (Setting::isInstalled()) {
         $this->insert('setting', array('name' => 'enable_html5_desktop_notifications', 'value' => 0, 'module_id' => 'notification'));
     }
     $this->addColumn('notification', 'desktop_notified', 'tinyint(1) DEFAULT 0');
     $this->update('notification', array('desktop_notified' => 1));
 }
开发者ID:VasileGabriel,项目名称:humhub,代码行数:8,代码来源:m150204_103433_html5_notified.php


示例19: actionIndex

 /**
  * Dashboard Index
  *
  * Show recent wall entries for this user
  */
 public function actionIndex()
 {
     if (Yii::$app->user->isGuest) {
         return $this->render('index_guest', array());
     } else {
         return $this->render('index', array('showProfilePostForm' => Setting::Get('showProfilePostForm', 'dashboard')));
     }
 }
开发者ID:SimonBaeumer,项目名称:humhub,代码行数:13,代码来源:DashboardController.php


示例20: run

 public function run()
 {
     $users = ActiveUser::find()->limit((int) Setting::Get('noUsers', 'mostactiveusers'))->all();
     if (count($users) == 0) {
         return;
     }
     return $this->render('sidebar', array('users' => $users));
 }
开发者ID:Ardnived,项目名称:humhub-modules-randomspace,代码行数:8,代码来源:Sidebar.php



注:本文中的humhub\models\Setting类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP models\Space类代码示例发布时间:2022-05-23
下一篇:
PHP behaviors\AccessControl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap