本文整理汇总了PHP中Action::boolean方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::boolean方法的具体用法?PHP Action::boolean怎么用?PHP Action::boolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Action
的用法示例。
在下文中一共展示了Action::boolean方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onEndEmailSaveForm
/**
* Add a checkbox to turn off email summaries
*
* @param Action $action Action being executed (emailsettings)
*
* @return boolean hook value
*/
function onEndEmailSaveForm($action)
{
$sendSummary = $action->boolean('emailsummary');
$user = common_current_user();
if (!empty($user)) {
$ess = Email_summary_status::staticGet('user_id', $user->id);
if (empty($ess)) {
$ess = new Email_summary_status();
$ess->user_id = $user->id;
$ess->send_summary = $sendSummary;
$ess->created = common_sql_now();
$ess->modified = common_sql_now();
$ess->insert();
} else {
$orig = clone $ess;
$ess->send_summary = $sendSummary;
$ess->modified = common_sql_now();
$ess->update($orig);
}
}
return true;
}
示例2: onEndProfileSaveForm
/**
* Save checkbox value for following everyone
*
* @param Action $action The action being executed
*
* @return boolean hook value
*/
function onEndProfileSaveForm($action)
{
$user = common_current_user();
User_followeveryone_prefs::savePref($user->id, $action->boolean('followeveryone'));
return true;
}
示例3: onEndEmailSaveForm
/**
* Add a checkbox to turn off email summaries
*
* @param Action $action Action being executed (emailsettings)
* @param Profile $scoped Profile for whom settings are configured (current user)
*
* @return boolean hook value
*/
public function onEndEmailSaveForm(Action $action, Profile $scoped)
{
$sendSummary = $action->boolean('emailsummary');
$ess = Email_summary_status::getKV('user_id', $scoped->id);
if (empty($ess)) {
$ess = new Email_summary_status();
$ess->user_id = $scoped->id;
$ess->send_summary = $sendSummary;
$ess->created = common_sql_now();
$ess->modified = common_sql_now();
$ess->insert();
} else {
$orig = clone $ess;
$ess->send_summary = $sendSummary;
$ess->modified = common_sql_now();
$ess->update($orig);
}
return true;
}