本文整理汇总了PHP中SugarController::post_save方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarController::post_save方法的具体用法?PHP SugarController::post_save怎么用?PHP SugarController::post_save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarController
的用法示例。
在下文中一共展示了SugarController::post_save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_oauth
protected function action_oauth()
{
if (empty($this->bean->id)) {
return $this->set_redirect('index.php');
}
if (!$this->bean->ACLAccess('save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
return true;
}
if (empty($_REQUEST['oauth_error'])) {
$this->api = ExternalAPIFactory::loadAPI($this->bean->application, true);
$reply = $this->api->checkLogin($this->bean);
if (!$reply['success']) {
return $this->failed(translate('LBL_AUTH_ERROR', $this->bean->module_dir));
} else {
$this->bean->validated();
}
}
// This is a tweak so that we can automatically close windows if requested by the external account system
if (isset($_REQUEST['closeWhenDone']) && $_REQUEST['closeWhenDone'] == 1) {
if (!empty($_REQUEST['callbackFunction']) && !empty($_REQUEST['application'])) {
$js = '<script type="text/javascript">window.opener.' . $_REQUEST['callbackFunction'] . '("' . $_REQUEST['application'] . '"); window.close();</script>';
} else {
if (!empty($_REQUEST['refreshParentWindow'])) {
$js = '<script type="text/javascript">window.opener.location.reload();window.close();</script>';
} else {
$js = '<script type="text/javascript">window.close();</script>';
}
}
echo $js;
return;
}
// redirect to detail view, as in save
return parent::post_save();
}