本文整理汇总了PHP中Publication::getUrlTypeId方法的典型用法代码示例。如果您正苦于以下问题:PHP Publication::getUrlTypeId方法的具体用法?PHP Publication::getUrlTypeId怎么用?PHP Publication::getUrlTypeId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Publication
的用法示例。
在下文中一共展示了Publication::getUrlTypeId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Template
}
}
$templateObj = new Template($templateId);
if (!isset($_SERVER['SERVER_PORT']))
{
$_SERVER['SERVER_PORT'] = 80;
}
$scheme = $_SERVER['SERVER_PORT'] == 443 ? 'https://' : 'http://';
$siteAlias = new Alias($publicationObj->getDefaultAliasId());
$websiteURL = $scheme.$siteAlias->getName() . $GLOBALS['Campsite']['SUBDIR'];
$accessParams = "LoginUserId=" . $g_user->getUserId() . "&LoginUserKey=" . $g_user->getKeyId()
. "&AdminAccess=all";
if ($publicationObj->getUrlTypeId() == 1) {
$templateObj = new Template($templateId);
$url = "$websiteURL/tpl/" . $templateObj->getName() . "?IdLanguage=$f_language_id"
. "&IdPublication=$f_publication_id&NrIssue=$f_issue_number&NrSection=$f_section_number"
. "&NrArticle=$f_article_number&$accessParams";
} else {
$url = ShortURL::GetURL($f_publication_id, $f_language_selected, null, null, $f_article_number);
if (PEAR::isError($url)) {
$errorStr = $url->getMessage();
}
$url .= '?' . $accessParams;
}
$selectedLanguage = (int)CampRequest::GetVar('f_language_selected');
$url .= "&previewLang=$selectedLanguage";
$siteTitle = (!empty($Campsite['site']['title'])) ? htmlspecialchars($Campsite['site']['title']) : putGS("Newscoop") . $Campsite['VERSION'];
示例2: GetURIInstance
/**
* Returns the appropiate URI instance.
*
* @param string $p_uri
* The URI to work with
* @return CampURI
*/
public static function GetURIInstance()
{
static $uriInstance = null;
if (!is_null($uriInstance)) {
return clone($uriInstance);
}
$alias = new Alias($_SERVER['HTTP_HOST']);
if ($alias->exists()) {
$publication = new Publication($alias->getPublicationId());
$urlType = $publication->getUrlTypeId();
}
// sets url type to default if necessary
if (!isset($urlType)) {
$config = self::GetConfigInstance();
$urlType = $config->getSetting('campsite.url_default_type');
}
// instanciates the corresponding URI object
switch ($urlType) {
case 1:
$uriInstance = new CampURITemplatePath();
break;
case 2:
$uriInstance = new CampURIShortNames();
break;
}
return $uriInstance;
} // fn GetURI