本文整理汇总了PHP中GO::createExternalUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP GO::createExternalUrl方法的具体用法?PHP GO::createExternalUrl怎么用?PHP GO::createExternalUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GO
的用法示例。
在下文中一共展示了GO::createExternalUrl方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterLoad
protected function afterLoad(&$response, &$model, &$params)
{
$url = \GO::createExternalUrl('calendar', 'openCalendar', array('calendars' => array($response['data']['id']), 'group_id' => $response['data']['group_id']));
// Show "None" in the Caldav Tasklist selection when tasklist_id is 0
if (empty($response['data']['tasklist_id'])) {
$response['data']['tasklist_id'] = "";
}
$response['data']['url'] = '<a class="normal-link" target="_blank" href="' . $url . '">' . \GO::t('rightClickToCopy', 'calendar') . '</a>';
// Get a link to the ics exporter
//$response['data']['ics_url']='<a class="normal-link" target="_blank" href="'.\GO::url("calendar/calendar/exportIcs", array("calendar_id"=>$response['data']['id'],"months_in_past"=>1)).'">'.\GO::t('rightClickToCopy','calendar').'</a>';
// Get a link to the ics file that is exported
$response['data']['ics_url'] = '<a class="normal-link" target="_blank" href="' . $model->getPublicIcsUrl() . '">' . \GO::t('rightClickToCopy', 'calendar') . '</a>';
return parent::afterLoad($response, $model, $params);
}
示例2: json_encode
echo $module;
?>
.<?php
echo $function;
?>
.call(this, <?php
echo json_encode($funcParams);
?>
);
self.close();
}else
{
win.close();
//the parameters will be handled in default_scripts.inc.php
<?php
\GO::setAfterLoginUrl(\GO::createExternalUrl($module, $function, $funcParams, true));
?>
self.location.href="<?php
echo \GO::config()->host;
?>
";
}
//self.close();
//win.focus();
}
</script>
</head>
<body onload="launchGO();" style="font:12px arial">
示例3: afterLoad
protected function afterLoad(&$response, &$model, &$params)
{
$url = \GO::createExternalUrl('calendar', 'openCalendar', array('view_id' => $response['data']['id']));
$response['data']['url'] = '<a class="normal-link" target="_blank" href="' . $url . '">' . \GO::t('rightClickToCopy', 'calendar') . '</a>';
return parent::afterLoad($response, $model, $params);
}
示例4: sendMeetingRequest
/**
* Sends a meeting request to all participants. If the participant is not a Group-Office user
* or the organizer has no permissions to schedule an event it will include an
* icalendar attachment so the calendar software can schedule it.
*
* @return boolean
* @throws Exception
*/
public function sendMeetingRequest($newParticipantsOnly = false, $update = false)
{
if (!$this->is_organizer) {
throw new \Exception("Meeting request can only be send from the organizer's event");
}
$stmt = $this->participants;
//handle missing user
if (!$this->user) {
$this->user_id = 1;
$this->save(true);
}
while ($participant = $stmt->fetch()) {
if (!$newParticipantsOnly || isset(\GO::session()->values['new_participant_ids']) && in_array($participant->user_id, \GO::session()->values['new_participant_ids'])) {
//don't invite organizer
if ($participant->is_organizer) {
continue;
}
// Set the language of the email to the language of the participant.
$language = false;
if (!empty($participant->user_id)) {
$user = \GO\Base\Model\User::model()->findByPk($participant->user_id);
if ($user) {
\GO::language()->setLanguage($user->language);
}
}
//if participant status is pending then send a new inviation subject. Otherwise send it as update
if (!$update) {
$subject = \GO::t('invitation', 'calendar') . ': ' . $this->name;
$bodyLine = \GO::t('invited', 'calendar');
} else {
$subject = \GO::t('invitation_update', 'calendar') . ': ' . $this->name;
$bodyLine = \GO::t('eventUpdated', 'calendar');
}
//create e-mail message
$message = \GO\Base\Mail\Message::newInstance($subject)->setFrom($this->user->email, $this->user->name)->addTo($participant->email, $participant->name);
//check if we have a Group-Office event. If so, we can handle accepting
//and declining in Group-Office. Otherwise we'll use ICS calendar objects by mail
$participantEvent = $participant->getParticipantEvent();
$body = '<p>' . $bodyLine . ': </p>' . $this->toHtml();
// if(!$participantEvent){
//build message for external program
$acceptUrl = \GO::url("calendar/event/invitation", array("id" => $this->id, 'accept' => 1, 'email' => $participant->email, 'participantToken' => $participant->getSecurityToken()), false);
$declineUrl = \GO::url("calendar/event/invitation", array("id" => $this->id, 'accept' => 0, 'email' => $participant->email, 'participantToken' => $participant->getSecurityToken()), false);
// if($participantEvent){
//hide confusing buttons if user has a GO event.
$body .= '<div class="go-hidden">';
// }
$body .= '<p><br /><b>' . \GO::t('linkIfCalendarNotSupported', 'calendar') . '</b></p>' . '<p>' . \GO::t('acccept_question', 'calendar') . '</p>' . '<a href="' . $acceptUrl . '">' . \GO::t('accept', 'calendar') . '</a>' . ' | ' . '<a href="' . $declineUrl . '">' . \GO::t('decline', 'calendar') . '</a>';
// if($participantEvent){
$body .= '</div>';
// }
$ics = $this->toICS("REQUEST");
$a = \Swift_Attachment::newInstance($ics, \GO\Base\Fs\File::stripInvalidChars($this->name) . '.ics', 'text/calendar; METHOD="REQUEST"');
$a->setEncoder(new Swift_Mime_ContentEncoder_PlainContentEncoder("8bit"));
$a->setDisposition("inline");
$message->attach($a);
//for outlook 2003 compatibility
$a2 = \Swift_Attachment::newInstance($ics, 'invite.ics', 'application/ics');
$a2->setEncoder(new Swift_Mime_ContentEncoder_PlainContentEncoder("8bit"));
$message->attach($a2);
if ($participantEvent) {
$url = \GO::createExternalUrl('calendar', 'openCalendar', array('unixtime' => $this->start_time));
$body .= '<br /><a href="' . $url . '">' . \GO::t('openCalendar', 'calendar') . '</a>';
}
$message->setHtmlAlternateBody($body);
// Set back the original language
if ($language !== false) {
\GO::language()->setLanguage($language);
}
\GO\Base\Mail\Mailer::newGoInstance()->send($message);
}
}
unset(\GO::session()->values['new_participant_ids']);
return true;
}
示例5: process_form
//.........这里部分代码省略.........
if (empty($addresslistModel)) {
throw new Exception('Addresslist not found!');
}
$addresslistModel->addManyMany('contacts', $contactId);
}
}
}
if ($this->contact_id > 0) {
if (isset($_FILES['photo']['tmp_name']) && is_uploaded_file($_FILES['photo']['tmp_name'])) {
$fsFile = new \GO\Base\Fs\File($_FILES['photo']['tmp_name']);
$fsFile->move(new \GO\Base\Fs\Folder(\GO::config()->tmpdir), $_FILES['photo']['name'], false, false);
$contactModel = \GO\Addressbook\Model\Contact::model()->findByPk($contactId);
$contactModel->setPhoto(\GO::config()->tmpdir . $_FILES['photo']['name']);
}
}
if (!isset($_POST['contact_id'])) {
/**
* Send notification of new contact to (1) users specified by 'notify_users'
* in the form itself and to (2) the addressbook owner if so specified.
*/
// Send the email to the admin users in the language of the addressbook owner.
$oldLanguage = \GO::language()->getLanguage();
\GO::language()->setLanguage($addressbookModel->user->language);
$usersToNotify = isset($_POST['notify_users']) ? explode(',', $_POST['notify_users']) : array();
if (!empty($_POST['notify_addressbook_owner'])) {
$usersToNotify[] = $addressbookModel->user_id;
}
$mailTo = array();
foreach ($usersToNotify as $userToNotifyId) {
$userModel = \GO\Base\Model\User::model()->findByPk($userToNotifyId);
$mailTo[] = $userModel->email;
}
if (count($mailTo)) {
$viewContactUrl = \GO::createExternalUrl('addressbook', 'showContact', array($contactId));
$contactModel = \GO\Addressbook\Model\Contact::model()->findByPk($contactId);
$companyModel = \GO\Addressbook\Model\Company::model()->findByPk($contactModel->company_id);
if (!empty($companyModel)) {
$companyName = $companyModel->name;
} else {
$companyName = '';
}
$values = array('address_no', 'address', 'zip', 'city', 'state', 'country');
$formatted_address = nl2br(\GO\Base\Util\Common::formatAddress('{country}', '{address}', '{address_no}', '{zip}', '{city}', '{state}'));
foreach ($values as $val) {
$formatted_address = str_replace('{' . $val . '}', $contactModel->{$val}, $formatted_address);
}
$body = \GO::t('newContactFromSite', 'addressbook') . ':<br />';
$body .= \GO::t('name', 'addressbook') . ': ' . $contactModel->addressbook->name . '<br />';
$body .= "<br />" . $contactModel->name;
$body .= "<br />" . $formatted_address;
if (!empty($contactModel->home_phone)) {
$body .= "<br />" . \GO::t('phone') . ': ' . $contactModel->home_phone;
}
if (!empty($contactModel->cellular)) {
$body .= "<br />" . \GO::t('cellular') . ': ' . $contactModel->cellular;
}
if (!empty($companyName)) {
$body .= "<br /><br />" . $companyName;
}
if (!empty($contactModel->work_phone)) {
$body .= "<br />" . \GO::t('workphone') . ': ' . $contactModel->work_phone;
}
$body .= '<br /><a href="' . $viewContactUrl . '">' . \GO::t('clickHereToView', 'addressbook') . '</a>' . "<br />";
$mailFrom = !empty($_POST['mail_from']) ? $_POST['mail_from'] : \GO::config()->webmaster_email;
$mailMessage = \GO\Base\Mail\Message::newInstance(\GO::t('newContactAdded', 'addressbook'), $body, 'text/html')->setFrom($mailFrom, \GO::config()->title);
foreach ($mailTo as $v) {
示例6: getExternalURL
/**
* Get a URL to show the folder directy in the files module.
*
* @return string
*/
public function getExternalURL()
{
return \GO::createExternalUrl("files", "showFolder", array($this->id));
}