本文整理汇总了PHP中common::AbsoluteUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP common::AbsoluteUrl方法的具体用法?PHP common::AbsoluteUrl怎么用?PHP common::AbsoluteUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common
的用法示例。
在下文中一共展示了common::AbsoluteUrl方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Result
function Result()
{
global $page;
if ($this->from_page && $this->title) {
if (!$this->show_popup) {
$url = common::AbsoluteUrl($this->title, '', true, false);
$page->ajaxReplace[] = array('eval', '', 'window.location="' . $url . '";');
}
return true;
}
return $this->show_popup;
}
示例2: CopyPage
/**
* Perform a page copy
*
*/
function CopyPage()
{
global $gp_index, $gp_titles, $page, $langmessage;
//existing page info
$from_title = $_POST['from_title'];
if (!isset($gp_index[$from_title])) {
message($langmessage['OOPS_TITLE']);
return false;
}
$from_index = $gp_index[$from_title];
$info = $gp_titles[$from_index];
//check the new title
$title = $_POST['title'];
$title = admin_tools::CheckPostedNewPage($title, $message);
if ($title === false) {
message($message);
return false;
}
//get the existing content
$from_file = gpFiles::PageFile($from_title);
$contents = file_get_contents($from_file);
//add to $gp_index first!
$index = common::NewFileIndex();
$gp_index[$title] = $index;
$file = gpFiles::PageFile($title);
if (!gpFiles::Save($file, $contents)) {
message($langmessage['OOPS'] . ' (File not saved)');
return false;
}
//add to gp_titles
$new_titles = array();
$new_titles[$index]['label'] = admin_tools::PostedLabel($_POST['title']);
$new_titles[$index]['type'] = $info['type'];
$gp_titles += $new_titles;
if (!admin_tools::SavePagesPHP()) {
message($langmessage['OOPS'] . ' (CP2)');
return false;
}
message($langmessage['SAVED']);
if (isset($_REQUEST['redir'])) {
$url = common::AbsoluteUrl($title, '', true, false);
$page->ajaxReplace[] = array('eval', '', 'window.setTimeout(function(){window.location="' . $url . '"},15000);');
message(sprintf($langmessage['will_redirect'], common::Link_Page($title)));
}
return $index;
}
示例3: IdUrl
static function IdUrl($request_cmd = 'cv')
{
global $config, $dataDir, $gpLayouts;
$path = addon_browse_path . '/Resources?';
//command
$args['cmd'] = $request_cmd;
$_SERVER += array('SERVER_SOFTWARE' => '');
//checkin
//$args['uniq'] = $config['gpuniq'];
$args['mdu'] = substr(md5($config['gpuniq']), 0, 20);
$args['site'] = common::AbsoluteUrl('');
//keep full path for backwards compat
$args['gpv'] = gpversion;
$args['php'] = phpversion();
$args['se'] =& $_SERVER['SERVER_SOFTWARE'];
$args['data'] = $dataDir;
$args['zlib'] = (int) function_exists('gzcompress');
if (defined('service_provider_id') && is_numeric(service_provider_id)) {
$args['provider'] = service_provider_id;
}
//plugins
$addon_ids = array();
if (isset($config['addons']) && is_array($config['addons'])) {
foreach ($config['addons'] as $addon => $addon_info) {
if (!isset($addon_info['id'])) {
continue;
}
$addon_id = $addon_info['id'];
if (isset($addon_info['order'])) {
$addon_id .= '.' . $addon_info['order'];
}
$addon_ids[] = $addon_id;
}
}
//themes
if (isset($config['themes']) && is_array($config['themes'])) {
foreach ($config['themes'] as $addon => $addon_info) {
if (!isset($addon_info['id'])) {
continue;
}
$addon_id = $addon_info['id'];
if (isset($addon_info['order'])) {
$addon_id .= '.' . $addon_info['order'];
}
$addon_ids[] = $addon_id;
}
}
//layouts
if (is_array($gpLayouts)) {
foreach ($gpLayouts as $layout_info) {
if (!isset($layout_info['addon_id'])) {
continue;
}
$addon_ids[] = $layout_info['addon_id'];
}
}
$addon_ids = array_unique($addon_ids);
$args['as'] = implode('-', $addon_ids);
return $path . http_build_query($args, '', '&');
}
示例4: TestResponse
/**
* Try to fetch a response using RemoteGet to see if we're getting a 500 error
*
* @access public
* @static
* @since 1.7
*
* @return boolean
*/
static function TestResponse()
{
//get url, force gp_rewrite to $new_gp_rewrite
$rewrite_before = $_SERVER['gp_rewrite'];
$_SERVER['gp_rewrite'] = true;
common::SetLinkPrefix();
$abs_url = common::AbsoluteUrl('Site_Map', '', true, false);
$_SERVER['gp_rewrite'] = $rewrite_before;
common::SetLinkPrefix();
$result = gpRemoteGet::Get_Successful($abs_url);
if (!$result) {
return false;
}
return true;
}
示例5: IdUrl
function IdUrl($request_cmd = 'cv')
{
global $config, $gpversion, $addonBrowsePath;
$path = $addonBrowsePath . '/Special_Resources?';
//command
$args['cmd'] = $request_cmd;
$_SERVER += array('SERVER_SOFTWARE' => '');
//checkin
//$args['uniq'] = $config['gpuniq'];
$args['mdu'] = substr(md5($config['gpuniq']), 0, 20);
$args['site'] = common::AbsoluteUrl('');
//keep full path for backwards compat
$args['gpv'] = $gpversion;
$args['php'] = phpversion();
$args['se'] =& $_SERVER['SERVER_SOFTWARE'];
if (defined('service_provider_id') && is_numeric(service_provider_id)) {
$args['provider'] = service_provider_id;
}
//plugins
$addon_ids = array();
if (isset($config['addons']) && is_array($config['addons'])) {
foreach ($config['addons'] as $addon => $addon_info) {
if (isset($addon_info['id'])) {
$addon_id = $addon_info['id'];
if (isset($addon_info['order'])) {
$addon_id .= '.' . $addon_info['order'];
}
$addon_ids[] = $addon_id;
}
}
}
//themes
if (isset($config['themes']) && is_array($config['themes'])) {
foreach ($config['themes'] as $addon => $addon_info) {
if (isset($addon_info['id'])) {
$addon_id = $addon_info['id'];
if (isset($addon_info['order'])) {
$addon_id .= '.' . $addon_info['order'];
}
$addon_ids[] = $addon_id;
}
}
}
$args['as'] = implode('-', $addon_ids);
return $path . http_build_query($args, '', '&');
}
示例6: HiddenSaved
/**
* Message or redirect when file is saved
*
*/
public function HiddenSaved($new_index)
{
global $langmessage;
msg($langmessage['SAVED']);
$this->search_page = 0;
//take user back to first page where the new page will be displayed
if (isset($_REQUEST['redir'])) {
$title = common::IndexToTitle($new_index);
$url = common::AbsoluteUrl($title, '', true, false);
$page->ajaxReplace[] = array('location', $url, 0);
}
}
示例7: TestResponse
/**
* Try to fetch a response using RemoteGet to see if we're getting a 500 error
*
* @access public
* @static
* @since 1.7
*
* @return boolean
*/
public static function TestResponse($new_rewrite = true)
{
//get url, force gp_rewrite to $new_gp_rewrite
$rewrite_before = $_SERVER['gp_rewrite'];
$_SERVER['gp_rewrite'] = $new_rewrite;
common::SetLinkPrefix();
$abs_url = common::AbsoluteUrl('Site_Map', '', true, false);
//can't be special_site_map, otherwise common::IndexToTitle() will be called during install
$_SERVER['gp_rewrite'] = $rewrite_before;
common::SetLinkPrefix();
return self::ConfirmGet($abs_url, false);
}