本文整理汇总了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;
}
示例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;
}
示例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 = ?";
示例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'));
}
示例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;
}
示例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;
}
}
}