本文整理汇总了PHP中GO::url方法的典型用法代码示例。如果您正苦于以下问题:PHP GO::url方法的具体用法?PHP GO::url怎么用?PHP GO::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GO
的用法示例。
在下文中一共展示了GO::url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeRun
protected function beforeRun($action, $params, $render)
{
$this->client = new \GO\Googledrive\Client();
$this->client->setRedirectUri(\GO::url($this->getRoute("connect"), array(), false, false, false));
$this->service = new Google_DriveService($this->client);
$token = \GO::config()->get_setting('googledrive_token', \GO::user()->id);
if ($token) {
$this->client->setAccessToken($token);
}
return parent::beforeRun($action, $params, $render);
}
示例2: actionRenderJupload
protected function actionRenderJupload($params)
{
//$cookieParams = session_get_cookie_params();
$sessionCookie = 'Cookie: ' . session_name() . '=' . session_id();
//TODO: Check if code below is necessary
// if(!empty($cookieParams['domain']))
// $sessionCookie .= '; Domain='.$cookieParams['domain'];
//
// $sessionCookie .= '; Path='.$cookieParams['path'];
//
// if(!empty($cookieParams['lifetime']))
// $sessionCookie .= '; Expires='.gmdate('D, d M Y H:i:s \G\M\T', time()+$cookieParams['lifetime']);
//
// if($cookieParams['secure'])
// $sessionCookie .= '; Secure';
//
// if($cookieParams['httponly'])
// $sessionCookie .= '; HttpOnly';
$afterUploadScript = '
<script type="text/javascript">
function afterUpload(success){
// opener.GO.files.juploadFileBrowser.sendOverwrite({upload:true});
if(success){
window.uploadSuccess=true;
setTimeout("self.close();", 1000);
}
}
</script>
';
$appletCode = '
<applet
code="wjhk.jupload2.JUploadApplet"
name="JUpload"
archive="' . \GO::config()->host . 'go/vendor/jupload/wjhk.jupload.jar' . '"
width="640"
height="480"
mayscript="true"
alt="The java pugin must be installed.">
<param name="lang" value="' . \GO::user()->language . '" />
<param name="readCookieFromNavigator" value="false" />
<!--<param name="lookAndFeel" value="system" />-->
<param name="postURL" value="' . \GO::url('files/jupload/handleUploads') . '" />
<param name="afterUploadURL" value="javascript:afterUpload(%success%);" />
<param name="showLogWindow" value="false" />
<param name="maxChunkSize" value="1048576" />
<param name="specificHeaders" value="' . $sessionCookie . '" />
<param name="maxFileSize" value="' . intval(\GO::config()->max_file_size) . '" />
<param name="nbFilesPerRequest" value="5" />
<!--<param name="debugLevel" value="99" />-->
Java 1.5 or higher plugin required.
</applet>';
$this->render('jupload', array('applet' => $appletCode, 'afterUploadScript' => $afterUploadScript));
}
示例3: getThumbURL
protected function getThumbURL()
{
if ($this->logo != '') {
if ($this->public_icon == '1') {
return \GO::modules()->host . 'modules/bookmarks/' . $this->logo;
} else {
return \GO::url('core/thumb', array('src' => $this->logo, 'w' => 16, 'h' => 16));
}
} else {
return false;
}
}
示例4: afterDisplay
protected function afterDisplay(&$response, &$model, &$params)
{
$response['data']['path'] = $model->path;
$response['data']['size'] = \GO\Base\Util\Number::formatSize($model->fsFile->size());
$response['data']['extension'] = strtolower($model->fsFile->extension());
$response['data']['type'] = \GO::t($response['data']['extension'], 'base', 'filetypes');
$response['data']['locked_user_name'] = $model->lockedByUser ? $model->lockedByUser->name : '';
$response['data']['locked'] = $model->isLocked();
$response['data']['unlock_allowed'] = $model->unlockAllowed();
if (!empty($model->random_code) && time() < $model->expire_time) {
$response['data']['expire_time'] = \GO\Base\Util\Date::get_timestamp(\GO\Base\Util\Date::date_add($model->expire_time, -1), false);
$response['data']['download_link'] = $model->emailDownloadURL;
} else {
$response['data']['expire_time'] = "";
$response['data']['download_link'] = "";
}
$response['data']['url'] = \GO::url('files/file/download', array('id' => $model->id), false, true);
if ($model->fsFile->isImage()) {
$response['data']['thumbnail_url'] = $model->thumbURL;
} else {
$response['data']['thumbnail_url'] = "";
}
$response['data']['handler'] = 'startjs:function(){' . $model->getDefaultHandler()->getHandler($model) . '}:endjs';
try {
if (\GO::modules()->filesearch) {
$filesearch = \GO\Filesearch\Model\Filesearch::model()->findByPk($model->id);
// if(!$filesearch){
// $filesearch = \GO\Filesearch\Model\Filesearch::model()->createFromFile($model);
// }
if ($filesearch) {
$response['data'] = array_merge($filesearch->getAttributes('formatted'), $response['data']);
if (!empty($params['query_params'])) {
$qp = json_decode($params['query_params'], true);
if (isset($qp['content_all'])) {
$c = new \GO\Filesearch\Controller\FilesearchController();
$response['data']['text'] = $c->highlightSearchParams($qp, $response['data']['text']);
}
}
} else {
$response['data']['text'] = \GO::t('notIndexedYet', 'filesearch');
}
}
} catch (\Exception $e) {
\GO::debug((string) $e);
$response['data']['text'] = "Index out of date. Please rebuild it using the admin tools.";
}
return parent::afterDisplay($response, $model, $params);
}
示例5: actionDownloadWin7
protected function actionDownloadWin7($params)
{
$url = \GO::url('email/message/mailto', array('mailto' => '-mailto-'), false, false, false);
//this is necessary because we don't want %1 to be urlencoded.
$url = str_replace('-mailto-', '%1', $url);
$data = 'Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\\mailto]
@="URL:MailTo Protocol"
"EditFlags"=hex:02,00,00,00
"URL Protocol"=""
[HKEY_CLASSES_ROOT\\mailto\\DefaultIcon]
@=""
[HKEY_CLASSES_ROOT\\mailto\\shell]
[HKEY_CLASSES_ROOT\\mailto\\shell\\open]
[HKEY_CLASSES_ROOT\\mailto\\shell\\open\\command]
@="rundll32.exe url.dll,FileProtocolHandler ' . $url . '\\"
[HKEY_CLASSES_ROOT\\Group-Office.Url.mailto]
@="MailTo Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\\Group-Office.Url.mailto\\DefaultIcon]
@=""
[HKEY_CLASSES_ROOT\\Group-Office.Url.mailto\\shell]
[HKEY_CLASSES_ROOT\\Group-Office.Url.mailto\\shell\\open]
"FriendlyAppName"="Group-Office"
[HKEY_CLASSES_ROOT\\Group-Office.Url.mailto\\shell\\open\\command]
@="rundll32.exe url.dll,FileProtocolHandler ' . $url . '"
[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto]
[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice]
"Progid"="Group-Office.Url.mailto"
';
\GO\Base\Util\Http::downloadFile(new \GO\Base\Fs\MemoryFile('Group-Office_email.reg', $data));
}
示例6: getZipOfAttachmentsUrl
public function getZipOfAttachmentsUrl()
{
return \GO::url("savemailas/linkedEmail/zipOfAttachments", array("tmpdir" => str_replace(\GO::config()->tmpdir, '', $this->_getTempDir())));
}
示例7:
<li><a href="<?php
echo GO::url("email/responsive/load");
?>
">Address book</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="<?php
echo GO::url('setttings/edit');
?>
"><span class="glyphicon glyphicon-user"></span> <?php
echo GO::user()->name;
?>
</a></li>
<li><a href="<?php
echo GO::url('auth/logout');
?>
"><?php
echo GO::t('logout');
?>
</a></li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container-fluid -->
</div>
<?php
}
?>
<div id="goMessageContainer"></div>
<div id="go-module-container">
示例8: getHandler
public function getHandler(\GO\Files\Model\File $file)
{
return 'window.open("' . \GO::url("webodf/file/edit", array('id' => $file->id)) . '");';
}
示例9: getUrl
public function getUrl()
{
if ($this->hasTempFile()) {
return parent::getUrl();
} else {
$params = array("account_id" => $this->account->id, "mailbox" => $this->mailbox, "uid" => $this->uid, "number" => $this->number, "encoding" => $this->encoding, "filename" => $this->name);
}
$nameArr = explode('.', $this->name);
if (\GO::modules()->isInstalled('addressbook') && $nameArr[count($nameArr) - 1] == 'vcf') {
return \GO::url('addressbook/contact/handleAttachedVCard', $params);
}
return \GO::url('email/message/attachment', $params);
}
示例10: actionBatchSend
protected function actionBatchSend($params)
{
$this->requireCli();
$this->_sentEmails = array();
\GO::$disableModelCache = true;
$mailing = \GO\Addressbook\Model\SentMailing::model()->findByPk($params['mailing_id']);
if (!$mailing) {
throw new \Exception("Mailing not found!\n");
}
\GO::session()->runAs($mailing->user_id);
echo 'Status: ' . $mailing->status . "\n";
if (empty($mailing->status)) {
echo "Starting mailing at " . \GO\Base\Util\Date::get_timestamp(time()) . "\n";
$mailing->reset();
} elseif (!empty($params['restart'])) {
echo "Restarting mailing at " . \GO\Base\Util\Date::get_timestamp(time()) . "\n";
$mailing->reset();
} elseif ($mailing->status == \GO\Addressbook\Model\SentMailing::STATUS_PAUSED) {
echo "Resuming mailing at " . \GO\Base\Util\Date::get_timestamp(time()) . "\n";
$mailing->status = \GO\Addressbook\Model\SentMailing::STATUS_RUNNING;
$mailing->save();
}
$htmlToText = new \GO\Base\Util\Html2Text();
//$addresslist = \GO\Addressbook\Model\Addresslist::model()->findByPk($mailing->addresslist_id);
$mimeData = file_get_contents(\GO::config()->file_storage_path . $mailing->message_path);
$message = \GO\Base\Mail\Message::newInstance()->loadMimeMessage($mimeData);
$joinCriteria = \GO\Base\Db\FindCriteria::newInstance()->addRawCondition('t.id', 'a.account_id');
$findParams = \GO\Base\Db\FindParams::newInstance()->single()->join(\GO\Email\Model\Alias::model()->tableName(), $joinCriteria, 'a')->criteria(\GO\Base\Db\FindCriteria::newInstance()->addCondition('id', $mailing->alias_id, '=', 'a'));
if ($mailing->campaign_id > 0 && \GO::modules()->isAvailable('campaigns')) {
$account = new \GO\Email\Model\Account();
$account->username = \GO::config()->campaigns_imap_user;
$account->password = \GO::config()->campaigns_imap_pass;
$account->host = \GO::config()->campaigns_imap_server;
$account->port = \GO::config()->campaigns_imap_port;
$account->smtp_username = \GO::config()->campaigns_smtp_user;
$account->smtp_password = \GO::config()->campaigns_smtp_pass;
$account->smtp_host = \GO::config()->campaigns_smtp_server;
$account->smtp_port = \GO::config()->campaigns_smtp_port;
$message->setFrom(\GO::config()->campaigns_from);
} else {
$account = \GO\Email\Model\Account::model()->find($findParams);
if (!$account->store_password && !empty($mailing->temp_pass)) {
$account->smtp_password = $mailing->temp_pass;
}
}
$mailer = \GO\Base\Mail\Mailer::newGoInstance(\GO\Email\Transport::newGoInstance($account));
echo "Will send emails from " . $account->username . ".\n";
if (empty(\GO::config()->mailing_messages_per_minute)) {
\GO::config()->mailing_messages_per_minute = 30;
}
//Rate limit to 100 emails per-minute
$mailer->registerPlugin(new \Swift_Plugins_ThrottlerPlugin(\GO::config()->mailing_messages_per_minute, \Swift_Plugins_ThrottlerPlugin::MESSAGES_PER_MINUTE));
// Use AntiFlood to re-connect after 50 emails
$mailer->registerPlugin(new \Swift_Plugins_AntiFloodPlugin(\GO::config()->mailing_messages_per_minute));
echo 'Sending a maximum of ' . \GO::config()->mailing_messages_per_minute . ' messages per minute' . "\n";
$failedRecipients = array();
$bodyWithTags = $message->getBody();
foreach ($mailing->contacts as $contact) {
$sentMailingContactModel = \GO\Addressbook\Model\SentMailingContact::model()->findSingleByAttributes(array('sent_mailing_id' => $mailing->id, 'contact_id' => $contact->id));
if (!$sentMailingContactModel->sent) {
$errors = 1;
$unsubscribeHref = \GO::url('addressbook/sentMailing/unsubscribe', array('addresslist_id' => $mailing->addresslist_id, 'contact_id' => $contact->id, 'token' => md5($contact->ctime . $contact->addressbook_id . $contact->firstEmail)), false, true);
$body = str_replace('%unsubscribe_href%', $unsubscribeHref, $bodyWithTags);
//curly brackets don't work inside links in browser wysiwyg editors.
$templateModel = \GO\Addressbook\Model\Template::model();
$templateModel->htmlSpecialChars = false;
$body = $templateModel->replaceCustomTags($body, array('unsubscribe_link' => '<a href="' . $unsubscribeHref . '" target="_blank">' . \GO::t("unsubscription", "addressbook") . '</a>'), true);
$templateModel->htmlSpecialChars = true;
try {
if (!$contact->email_allowed) {
echo "Skipping contact " . $contact->firstEmail . " because newsletter sending is disabled in the addresslists tab.\n\n";
} elseif (empty($contact->firstEmail)) {
echo "Skipping contact " . $contact->name . " no e-mail address was set.\n\n";
} else {
$body = \GO\Addressbook\Model\Template::model()->replaceContactTags($body, $contact);
$message->setTo($contact->firstEmail, $contact->name);
$message->setBody($body);
$plainTextPart = $message->findPlainTextBody();
if ($plainTextPart) {
$htmlToText->set_html($body);
$plainTextPart->setBody($htmlToText->get_text());
}
// Check mail limit
$nSentMails = \GO::config()->get_setting('campaigns_number_sent_mails', 0);
if ($mailing->campaign_id > 0 && $nSentMails >= \GO::config()->campaigns_max_mails_per_period) {
$this->_pauseMailing($mailing->id);
echo "Error for " . $contact->firstEmail . ": \n";
echo str_replace('%maxMails', \GO::config()->campaigns_max_mails_per_period, \GO::t('sentMailLimitReached', 'campaigns'));
exit;
}
$this->_sendmail($message, $contact, $mailer, $mailing);
\GO::config()->save_setting('campaigns_number_sent_mails', $nSentMails + 1, 0);
$errors = 0;
}
} catch (\Exception $e) {
echo "Error for " . $contact->firstEmail . ": " . $e->getMessage() . "\n";
}
if ($errors) {
$mailing->errors++;
$mailing->save();
//.........这里部分代码省略.........
示例11: getUrl
/**
* Get the download URL
* @return string
*/
public function getUrl()
{
if ($this->getExtension() == 'dat') {
return \GO::url('email/message/tnefAttachmentFromTempFile', array('tmp_file' => $this->getTempFile()));
} else {
return \GO::url('core/downloadTempFile', array('path' => $this->getTempFile()));
}
}
示例12: actionCheckLanguage
/**
* Action to be called from browser address bar. It compares all the language
* fields of lang1 and lang2 in the current Group-Office installation, and
* echoes the fields that are in one language but not the other.
* @param type $params MUST contain $params['lang1'] AND $params['lang2']
*/
protected function actionCheckLanguage($params)
{
header('Content-Type: text/html; charset=UTF-8');
$lang1code = empty($params['lang1']) ? 'en' : $params['lang1'];
$lang2code = empty($params['lang2']) ? 'nl' : $params['lang2'];
$commonLangFolder = new \GO\Base\Fs\Folder(\GO::config()->root_path . 'language/');
$commonLangFolderContentArr = $commonLangFolder->ls();
$moduleModelArr = \GO::modules()->getAllModules();
echo "<h1>Translate tool</h1>";
echo '<p><a href="' . \GO::url("maintenance/zipLanguage", array("lang" => $lang2code)) . '">Download zip file for ' . $lang2code . '</a></p>';
foreach ($commonLangFolderContentArr as $commonContentEl) {
if (get_class($commonContentEl) == 'GO\\Base\\Fs\\Folder') {
echo '<h3>' . $commonContentEl->path() . '</h3>';
echo $this->_compareLangFiles($commonContentEl->path() . '/' . $lang1code . '.php', $commonContentEl->path() . '/' . $lang2code . '.php');
echo '<hr>';
} else {
// $commonContentEl = new \GO\Base\Fs\File();
// $langFileContentString = $commonContentEl->getContents();
}
}
foreach ($moduleModelArr as $moduleModel) {
echo '<h3>' . $moduleModel->path . '</h3>';
echo $this->_compareLangFiles($moduleModel->path . 'language/' . $lang1code . '.php', $moduleModel->path . 'language/' . $lang2code . '.php');
echo '<hr>';
}
}
示例13: getThumbURL
protected function getThumbURL()
{
$params = array('src' => $this->path, 'foldericon' => $this->acl_id ? 'folder_public.png' : 'folder.png', 'lw' => 100, 'ph' => 100, 'zc' => 1, 'filemtime' => $this->mtime);
return \GO::url('core/thumb', $params);
}
示例14: getZipOfAttachmentsUrl
public function getZipOfAttachmentsUrl()
{
// return \GO::config()->host.'modules/email/'.
// 'zip_attachments.php?account_id='.$this->account->id.
// '&mailbox='.urlencode($this->mailbox).
// '&uid='.$this->uid.'&filename='.urlencode($this->subject);
//
$params = array("account_id" => $this->account->id, "mailbox" => $this->mailbox, "uid" => $this->uid);
return \GO::url('email/message/zipAllAttachments', $params);
}
示例15: actionRemoveDuplicates
public function actionRemoveDuplicates($params)
{
\GO::setMaxExecutionTime(300);
\GO::setMemoryLimit(1024);
$this->render('externalHeader');
$tasklist = \GO\Tasks\Model\Tasklist::model()->findByPk($params['tasklist_id']);
if (!$tasklist) {
throw new \GO\Base\Exception\NotFound();
}
\GO\Base\Fs\File::setAllowDeletes(false);
//VERY IMPORTANT:
\GO\Files\Model\Folder::$deleteInDatabaseOnly = true;
\GO::session()->closeWriting();
//close writing otherwise concurrent requests are blocked.
$checkModels = array("GO\\Tasks\\Model\\Task" => array('name', 'start_time', 'due_time', 'rrule', 'user_id', 'tasklist_id'));
foreach ($checkModels as $modelName => $checkFields) {
if (empty($params['model']) || $modelName == $params['model']) {
echo '<h1>' . \GO::t('removeDuplicates') . '</h1>';
$checkFieldsStr = 't.' . implode(', t.', $checkFields);
$findParams = \GO\Base\Db\FindParams::newInstance()->ignoreAcl()->select('t.id, count(*) AS n, ' . $checkFieldsStr)->group($checkFields)->having('n>1');
$findParams->getCriteria()->addCondition('tasklist_id', $tasklist->id);
$stmt1 = \GO::getModel($modelName)->find($findParams);
echo '<table border="1">';
echo '<tr><td>ID</th><th>' . implode('</th><th>', $checkFields) . '</th></tr>';
$count = 0;
while ($dupModel = $stmt1->fetch()) {
$select = 't.id';
if (\GO::getModel($modelName)->hasFiles()) {
$select .= ', t.files_folder_id';
}
$findParams = \GO\Base\Db\FindParams::newInstance()->ignoreAcl()->select($select . ', ' . $checkFieldsStr)->order('id', 'ASC');
$findParams->getCriteria()->addCondition('tasklist_id', $tasklist->id);
foreach ($checkFields as $field) {
$findParams->getCriteria()->addCondition($field, $dupModel->getAttribute($field));
}
$stmt = \GO::getModel($modelName)->find($findParams);
$first = true;
while ($model = $stmt->fetch()) {
echo '<tr><td>';
if (!$first) {
echo '<span style="color:red">';
}
echo $model->id;
if (!$first) {
echo '</span>';
}
echo '</th>';
foreach ($checkFields as $field) {
echo '<td>' . $model->getAttribute($field, 'html') . '</td>';
}
echo '</tr>';
if (!$first) {
if (!empty($params['delete'])) {
if ($model->hasLinks() && $model->countLinks()) {
echo '<tr><td colspan="99">' . \GO::t('skippedDeleteHasLinks') . '</td></tr>';
} elseif (($filesFolder = $model->getFilesFolder(false)) && ($filesFolder->hasFileChildren() || $filesFolder->hasFolderChildren())) {
echo '<tr><td colspan="99">' . \GO::t('skippedDeleteHasFiles') . '</td></tr>';
} else {
$model->delete();
}
}
$count++;
}
$first = false;
}
}
echo '</table>';
echo '<p>' . sprintf(\GO::t('foundDuplicates'), $count) . '</p>';
echo '<br /><br /><a href="' . \GO::url('tasks/tasklist/removeDuplicates', array('delete' => true, 'tasklist_id' => $tasklist->id)) . '">' . \GO::t('clickToDeleteDuplicates') . '</a>';
}
}
$this->render('externalFooter');
}