当前位置: 首页>>代码示例>>PHP>>正文


PHP Conversation::setDefaultSubscribedUsers方法代码示例

本文整理汇总了PHP中Conversation::setDefaultSubscribedUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP Conversation::setDefaultSubscribedUsers方法的具体用法?PHP Conversation::setDefaultSubscribedUsers怎么用?PHP Conversation::setDefaultSubscribedUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Conversation的用法示例。


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

示例1: add_users

 public function add_users()
 {
     // Firstly, install the core authentication types
     $cba = AuthenticationType::add('concrete', 'Standard');
     $coa = AuthenticationType::add('community', 'concrete5.org');
     $fba = AuthenticationType::add('facebook', 'Facebook');
     $twa = AuthenticationType::add('twitter', 'Twitter');
     $gat = AuthenticationType::add('google', 'Google');
     $fba->disable();
     $twa->disable();
     $coa->disable();
     $gat->disable();
     \Concrete\Core\Tree\TreeType::add('group');
     \Concrete\Core\Tree\Node\NodeType::add('group');
     $tree = GroupTree::get();
     $tree = GroupTree::add();
     // insert the default groups
     // create the groups our site users
     // specify the ID's since auto increment may not always be +1
     $g1 = Group::add(tc("GroupName", "Guest"), tc("GroupDescription", "The guest group represents unregistered visitors to your site."), false, false, GUEST_GROUP_ID);
     $g2 = Group::add(tc("GroupName", "Registered Users"), tc("GroupDescription", "The registered users group represents all user accounts."), false, false, REGISTERED_GROUP_ID);
     $g3 = Group::add(tc("GroupName", "Administrators"), "", false, false, ADMIN_GROUP_ID);
     // insert admin user into the user table
     if (defined('INSTALL_USER_PASSWORD')) {
         $hasher = new PasswordHash(Config::get('concrete.user.password.hash_cost_log2'), Config::get('concrete.user.password.hash_portable'));
         $uPassword = INSTALL_USER_PASSWORD;
         $uPasswordEncrypted = $hasher->HashPassword($uPassword);
     } else {
         $uPasswordEncrypted = INSTALL_USER_PASSWORD_HASH;
     }
     $uEmail = INSTALL_USER_EMAIL;
     $superuser = UserInfo::addSuperUser($uPasswordEncrypted, $uEmail);
     $u = User::getByUserID(USER_SUPER_ID, true, false);
     MailImporter::add(array('miHandle' => 'private_message'));
     UserPointAction::add('won_badge', t('Won a Badge'), 5, false, true);
     // Install conversation default email
     \Conversation::setDefaultSubscribedUsers(array($superuser));
 }
开发者ID:robertdamoc,项目名称:concrete5,代码行数:38,代码来源:StartingPointPackage.php

示例2: up

 public function up(Schema $schema)
 {
     \Concrete\Core\Database\Schema\Schema::refreshCoreXMLSchema(array('ConversationPermissionAddMessageAccessList', 'ConversationSubscriptions', 'Conversations'));
     // Subscribe admin to conversations by default, if we have no subscriptions
     $users = \Conversation::getDefaultSubscribedUsers();
     if (count($users) == 0) {
         $admin = \UserInfo::getByID(USER_SUPER_ID);
         if (is_object($admin)) {
             $users = array($admin);
             \Conversation::setDefaultSubscribedUsers($users);
         }
     }
     $db = \Database::get();
     $db->Execute('DROP TABLE IF EXISTS PageStatistics');
     $pp = $schema->getTable('PagePaths');
     if (!$pp->hasColumn('ppGeneratedFromURLSlugs')) {
         $db->Execute('alter table PagePaths add column ppGeneratedFromURLSlugs tinyint(1) unsigned not null default 0');
         // we have to do this directly because the page path calls below will die otherwise.
     }
     $bt = BlockType::getByHandle('page_list');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $bt = BlockType::getByHandle('page_title');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $bt = BlockType::getByHandle('form');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $c = \Page::getByPath('/dashboard/system/seo/urls');
     if (is_object($c) && !$c->isError()) {
         $c->update(array('cName' => 'URLs and Redirection'));
     }
     $sp = \Page::getByPath('/dashboard/system/environment/entities');
     if (!is_object($sp) || $sp->isError()) {
         $sp = \SinglePage::add('/dashboard/system/environment/entities');
         $sp->update(array('cName' => 'Database Entities'));
         $sp->setAttribute('meta_keywords', 'database, entities, doctrine, orm');
     }
     $pkx = Category::getByHandle('multilingual_section');
     if (!is_object($pkx)) {
         $pkx = Category::add('multilingual_section');
     }
     $pkx->associateAccessEntityType(Type::getByHandle('group'));
     $pkx->associateAccessEntityType(Type::getByHandle('user'));
     $pkx->associateAccessEntityType(Type::getByHandle('group_combination'));
     $db->Execute("alter table QueueMessages modify column body longtext not null");
     $ms = $schema->getTable('MultilingualSections');
     if (!$ms->hasColumn('msNumPlurals')) {
         $ms->addColumn('msNumPlurals', 'integer', array('notnull' => true, 'unsigned' => true, 'default' => 2));
         $this->updateSectionPlurals = true;
     }
     if (!$ms->hasColumn('msPluralRule')) {
         $ms->addColumn('msPluralRule', 'string', array('notnull' => true, 'length' => 400, 'default' => '(n != 1)'));
         $this->updateSectionPlurals = true;
     }
     if (!$ms->hasColumn('msPluralCases')) {
         $ms->addColumn('msPluralCases', 'string', array('notnull' => true, 'length' => 1000, 'default' => "one@1\nother@0, 2~16, 100, 1000, 10000, 100000, 1000000, …"));
         $this->updateSectionPlurals = true;
     }
     $mt = $schema->getTable('MultilingualTranslations');
     if (!$mt->hasColumn('msgidPlural')) {
         $mt->addColumn('msgidPlural', 'text', array('notnull' => false));
         $this->updateMultilingualTranslations = true;
     }
     if (!$mt->hasColumn('msgstrPlurals')) {
         $mt->addColumn('msgstrPlurals', 'text', array('notnull' => false));
         $this->updateMultilingualTranslations = true;
     }
     $cms = $schema->getTable('ConversationMessages');
     if (!$cms->hasColumn('cnvMessageAuthorName')) {
         $cms->addColumn('cnvMessageAuthorName', 'string', array('notnull' => false, 'length' => 255));
     }
     if (!$cms->hasColumn('cnvMessageAuthorEmail')) {
         $cms->addColumn('cnvMessageAuthorEmail', 'string', array('notnull' => false, 'length' => 255));
     }
     if (!$cms->hasColumn('cnvMessageAuthorWebsite')) {
         $cms->addColumn('cnvMessageAuthorWebsite', 'string', array('notnull' => false, 'length' => 255));
     }
     $this->updatePermissionDurationObjects();
     $key = Key::getByHandle('add_conversation_message');
     if (is_object($key) && !$key->permissionKeyHasCustomClass()) {
         $key->setPermissionKeyHasCustomClass(true);
     }
     $this->installMaintenanceModePermission();
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:88,代码来源:Version20150504000000.php


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