本文整理汇总了PHP中ElggGroup::getPrivateSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggGroup::getPrivateSetting方法的具体用法?PHP ElggGroup::getPrivateSetting怎么用?PHP ElggGroup::getPrivateSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ElggGroup
的用法示例。
在下文中一共展示了ElggGroup::getPrivateSetting方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAccessToken
/**
* Get an access token for signing API requests
*/
public function getAccessToken()
{
if (!elgg_instanceof($this->entity)) {
return false;
}
switch ($this->entity->getType()) {
case 'site':
return StripeClientFactory::getSecretKey();
break;
default:
return $this->entity->getPrivateSetting('stripe_access_token');
break;
}
}
示例2: sendWelcomeMessage
/**
* Send a welcome message to the new user of the group
*
* @param \ElggUser $recipient the new user
* @param \ElggGroup $group the group
*
* @return void
*/
protected static function sendWelcomeMessage(\ElggUser $recipient, \ElggGroup $group)
{
if (!$recipient instanceof \ElggUser || !$group instanceof \ElggGroup) {
return;
}
// get welcome messgae
$welcome_message = $group->getPrivateSetting('group_tools:welcome_message');
$check_message = trim(strip_tags($welcome_message));
if (empty($check_message)) {
return;
}
// replace the place holders
$welcome_message = str_ireplace('[name]', $recipient->name, $welcome_message);
$welcome_message = str_ireplace('[group_name]', $group->name, $welcome_message);
$welcome_message = str_ireplace('[group_url]', $group->getURL(), $welcome_message);
// subject
$subject = elgg_echo('group_tools:welcome_message:subject', [$group->name]);
// notify the user
notify_user($recipient->getGUID(), $group->getGUID(), $subject, $welcome_message);
}
示例3: group_tools_join_motivation_required
/**
* Check the plugin/group setting if join motivation is needed
*
* @param ElggGroup $group (optional) the group to check for
*
* @return bool
*/
function group_tools_join_motivation_required(ElggGroup $group = null)
{
static $plugin_settings;
static $check_group = false;
// load plugin settings
if (!isset($plugin_settings)) {
$plugin_settings = false;
$setting = elgg_get_plugin_setting('join_motivation', 'group_tools', 'no');
switch ($setting) {
case 'yes_off':
$check_group = true;
break;
case 'yes_on':
$check_group = true;
$plugin_settings = true;
break;
case 'required':
$plugin_settings = true;
break;
}
}
// do we need to check the group settings?
if (!$group instanceof ElggGroup || !$check_group) {
return $plugin_settings || $check_group;
}
if ($group->isPublicMembership()) {
// open group, no motivation needed
return false;
}
// get group setting
$group_setting = $group->getPrivateSetting('join_motivation');
switch ($group_setting) {
case 'no':
return false;
break;
case 'yes':
return true;
break;
}
return $plugin_settings;
}