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


PHP URLHelper::setBaseURL方法代码示例

本文整理汇总了PHP中URLHelper::setBaseURL方法的典型用法代码示例。如果您正苦于以下问题:PHP URLHelper::setBaseURL方法的具体用法?PHP URLHelper::setBaseURL怎么用?PHP URLHelper::setBaseURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在URLHelper的用法示例。


在下文中一共展示了URLHelper::setBaseURL方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: absolute_url_for

 public function absolute_url_for($to)
 {
     $old_base = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']);
     $args = func_get_args();
     $url = call_user_func_array(array($this, 'url_for'), $args);
     URLHelper::setBaseURL($old_base);
     return $url;
 }
开发者ID:studip,项目名称:PluginMarket,代码行数:8,代码来源:market_controller.php

示例2: getURL

 public function getURL($absolute_url = false)
 {
     if ($absolute_url) {
         $old_base = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']);
     }
     $url = URLHelper::getURL("plugins.php/pluginmarket/presenting/image/" . $this->getId(), array(), true);
     if ($absolute_url) {
         URLHelper::setBaseURL($old_base);
     }
     return $url;
 }
开发者ID:studip,项目名称:PluginMarket,代码行数:11,代码来源:MarketImage.class.php

示例3: ob_start

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
// +---------------------------------------------------------------------------+
ob_start();
require '../lib/bootstrap.php';
page_open(array("sess" => "Seminar_Session", "auth" => "Seminar_Default_Auth", "perm" => "Seminar_Perm", "user" => "Seminar_User"));
require_once 'lib/datei.inc.php';
//basename() needs setlocale()
init_i18n($_SESSION['_language']);
// Set Base URL, otherwise links will fail on SENDFILE_LINK_MODE = rewrite
URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']);
$file_id = escapeshellcmd(basename(Request::get('file_id')));
$type = Request::int('type');
if ($type < 0 || $type > 7) {
    $type = 0;
}
$document = new StudipDocument($file_id);
$object_id = $document->getValue('seminar_id');
$no_access = true;
//download from course or institute or document is a message attachement
if ($object_id && in_array($type, array(0, 6, 7))) {
    $no_access = !$document->checkAccess($GLOBALS['user']->id);
}
//download from archive, allowed if former participant
if ($type == 1) {
    $query = "SELECT seminar_id FROM archiv WHERE archiv_file_id = ?";
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:sendfile.php

示例4: testSetBaseURL

 public function testSetBaseURL()
 {
     $this->assertEquals('foo/bar', URLHelper::getLink('foo/bar'));
     $this->assertEquals('/foo/bar', URLHelper::getLink('/foo/bar'));
     $this->assertEquals('http://www.studip.de/foo/bar', URLHelper::getLink('http://www.studip.de/foo/bar'));
     URLHelper::setBaseURL('/dir/');
     $this->assertEquals('/dir/foo/bar', URLHelper::getLink('foo/bar'));
     $this->assertEquals('/foo/bar', URLHelper::getLink('/foo/bar'));
     $this->assertEquals('http://www.studip.de/foo/bar', URLHelper::getLink('http://www.studip.de/foo/bar'));
     URLHelper::setBaseURL('http://cnn.com/test/');
     $this->assertEquals('http://cnn.com/test/foo/bar', URLHelper::getLink('foo/bar'));
     $this->assertEquals('http://cnn.com/foo/bar', URLHelper::getLink('/foo/bar'));
     $this->assertEquals('http://www.studip.de/foo/bar', URLHelper::getLink('http://www.studip.de/foo/bar'));
 }
开发者ID:ratbird,项目名称:hope,代码行数:14,代码来源:UrlHelperTest.php

示例5: getDownloadLink

 public function getDownloadLink($inline = false, $absolute = false)
 {
     if ($absolute) {
         $old_base_url = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']);
     }
     $url = $inline ? URLHelper::getURL('dispatch.php/document/download/' . $this->id . '/inline', array(), true) : URLHelper::getURL('dispatch.php/document/download/' . $this->id, array(), true);
     if ($absolute) {
         URLHelper::setBaseURL($old_base_url);
     }
     return $url;
 }
开发者ID:ratbird,项目名称:hope,代码行数:11,代码来源:DirectoryEntry.php

示例6: getPluginText

 function getPluginText($plugin, $range_id, $r_data, $m_name)
 {
     $base_url = URLHelper::setBaseURL('');
     $nav = $plugin->getIconNavigation($range_id, $r_data['visitdate'], $GLOBALS['user']->id);
     UrlHelper::setBaseURl($base_url);
     if ($nav instanceof Navigation && $nav->isVisible(true)) {
         if ($nav->getBadgeNumber()) {
             $url = 'seminar_main.php?again=yes&auswahl=' . $range_id . '&redirect_to=' . strtr($nav->getURL(), '?', '&');
             $icon = $nav->getImage();
             $tab = array_pop($plugin->getTabNavigation());
             if ($tab instanceof Navigation && $tab->isVisible()) {
                 $text = $tab->getTitle();
             }
             if (!$text) {
                 $text = $this->registered_modules[$m_name]['name'];
             }
             if ($nav->getBadgeNumber() == 1) {
                 $text .= ' - ' . _("Ein neuer Beitrag:");
             } else {
                 $text .= ' - ' . sprintf(_("%s neue Beiträge:"), $nav->getBadgeNumber());
             }
             return compact('text', 'url', 'icon', 'range_id');
         } else {
             return null;
         }
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:27,代码来源:ModulesNotification.class.php


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