本文整理匯總了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();
}