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


PHP Action::boolean方法代码示例

本文整理汇总了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;
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:29,代码来源:EmailSummaryPlugin.php

示例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;
 }
开发者ID:ronhuang,项目名称:statusnet,代码行数:13,代码来源:FollowEveryonePlugin.php

示例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;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:27,代码来源:EmailSummaryPlugin.php


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