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


PHP Issue::getUrlName方法代码示例

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


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

示例1: GetURI

 public static function GetURI($p_publicationId, $p_languageId, $p_issueNo = null, $p_sectionNo = null, $p_articleNo = null)
 {
     $languageObj = new Language($p_languageId);
     if (!$languageObj->exists()) {
         return new PEAR_Error(getGS('Language does not exist.'));
     }
     $uri = $GLOBALS['Campsite']['SUBDIR'] . '/' . $languageObj->getCode() . '/';
     if (!is_null($p_issueNo) && is_null($p_articleNo)) {
         $issueObj = new Issue($p_publicationId, $p_languageId, $p_issueNo);
         if (!$issueObj->exists()) {
             return new PEAR_Error(getGS('Issue does not exist.'));
         }
         $uri .= $issueObj->getUrlName() . '/';
     }
     if (!is_null($p_sectionNo) && is_null($p_articleNo)) {
         $sectionObj = new Section($p_publicationId, $p_issueNo, $p_languageId, $p_sectionNo);
         if (!$sectionObj->exists()) {
             return new PEAR_Error(getGS('Section does not exist.'));
         }
         $uri .= $sectionObj->getUrlName() . '/';
     }
     if (!is_null($p_articleNo)) {
         $articleObj = new Article($p_languageId, $p_articleNo);
         if (!$articleObj->exists()) {
             return new PEAR_Error(getGS('Article does not exist.'));
         }
         $issueObj = new Issue($p_publicationId, $p_languageId, $articleObj->getIssueNumber());
         $sectionObj = new Section($p_publicationId, $articleObj->getIssueNumber(), $p_languageId, $articleObj->getSectionNumber());
         $uri .= $issueObj->getUrlName() . '/';
         $uri .= $sectionObj->getUrlName() . '/';
         $uri .= $articleObj->getUrlName() . '/';
     }
     return $uri;
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:34,代码来源:ShortURL.php

示例2: GetURI

 public static function GetURI($p_publicationId, $p_languageId, $p_issueNo = null, $p_sectionNo = null, $p_articleNo = null)
 {
     $translator = \Zend_Registry::get('container')->getService('translator');
     $languageObj = new Language($p_languageId);
     if (!$languageObj->exists()) {
         return new PEAR_Error($translator->trans('Language does not exist.'));
     }
     $uri = '/' . $languageObj->getCode() . '/';
     if (!is_null($p_issueNo) && is_null($p_articleNo)) {
         $issueObj = new Issue($p_publicationId, $p_languageId, $p_issueNo);
         if (!$issueObj->exists()) {
             return new PEAR_Error($translator->trans('Issue does not exist.'));
         }
         $uri .= $issueObj->getUrlName() . '/';
     }
     if (!is_null($p_sectionNo) && is_null($p_articleNo)) {
         $sectionObj = new Section($p_publicationId, $p_issueNo, $p_languageId, $p_sectionNo);
         if (!$sectionObj->exists()) {
             return new PEAR_Error($translator->trans('Section does not exist.'));
         }
         $uri .= $sectionObj->getUrlName() . '/';
     }
     if (!is_null($p_articleNo)) {
         $articleObj = new Article($p_languageId, $p_articleNo);
         if (!$articleObj->exists()) {
             return new PEAR_Error($translator->trans('Article does not exist.'));
         }
         $issueObj = new Issue($p_publicationId, $p_languageId, $articleObj->getIssueNumber());
         $sectionObj = new Section($p_publicationId, $articleObj->getIssueNumber(), $p_languageId, $articleObj->getSectionNumber());
         $uri .= $issueObj->getUrlName() . '/';
         $uri .= $sectionObj->getUrlName() . '/';
         $uri .= $articleObj->getUrlName() . '/';
     }
     return $uri;
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:35,代码来源:ShortURL.php

示例3: Alias

	$_SERVER['SERVER_PORT'] = 80;
}
$scheme = $_SERVER['SERVER_PORT'] == 443 ? 'https://' : 'http://';
$siteAlias = new Alias($publicationObj->getDefaultAliasId());
$websiteURL = $scheme.$siteAlias->getName();

$accessParams = "LoginUserId=" . $g_user->getUserId() . "&LoginUserKey=" . $g_user->getKeyId()
				. "&AdminAccess=all";
$urlType = $publicationObj->getProperty('IdURLType');
if ($urlType == 1) {
	$templateObj = new Template($templateId);
	$url = "$websiteURL"  . $Campsite['SUBDIR'] . "/tpl/" . $templateObj->getName()
		. "?IdLanguage=$Language&IdPublication=$Pub&NrIssue=$Issue&$accessParams";
} else {
	$url = "$websiteURL" . $Campsite['SUBDIR'] . '/' . $languageObj->getCode()
		. "/" . $issueObj->getUrlName() . "?$accessParams";
}

$selectedLanguage = (int)CampRequest::GetVar('Language');
$url .= "&previewLang=$selectedLanguage";

if ($g_user->hasPermission("ManageTempl") || $g_user->hasPermission("DeleteTempl")) {
	// Show dual-pane view for those with template management priviledges
?>
<FRAMESET ROWS="60%,*" BORDER="1">
	<FRAME SRC="<?php echo "$url&preview=on"; ?>" NAME="body" FRAMEBORDER="1">
	<FRAME NAME="e" SRC="empty.php" FRAMEBORDER="1">
</FRAMESET>
<?php
} else {
	// Show single pane for everyone else.
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:preview.php

示例4: foreach

 }
 if (!$translationIssueObj->exists()) {
     if (!$g_user->hasPermission("ManageIssue")) {
         camp_html_add_msg(getGS('An issue must be created for the selected language but you do not have the right to create an issue.'));
         camp_html_goto_page($backLink);
     }
     foreach ($issueObj->getData() as $field => $fieldValue) {
         if ($field != 'IdLanguage') {
             $translationIssueObj->setProperty($field, $fieldValue, false);
         }
     }
     $f_issue_name = Input::Get('f_issue_name', 'string', '');
     if ($f_issue_name != '') {
         $translationIssueObj->setName($f_issue_name);
     }
     $f_issue_urlname = Input::Get('f_issue_urlname', 'string', $issueObj->getUrlName());
     if ($f_issue_urlname == "") {
         camp_html_add_msg(getGS('You must fill in the $1 field.', '"' . getGS('New issue URL name') . '"'));
         camp_html_goto_page($backLink);
     }
     if (!camp_is_valid_url_name($f_issue_urlname)) {
         camp_html_add_msg(getGS('The $1 field may only contain letters, digits and underscore (_) character.', '"' . getGS('New issue URL name') . '"'));
         camp_html_goto_page($backLink);
     }
     $translationIssueObj->create($f_issue_urlname);
     if (!$translationIssueObj->exists()) {
         camp_html_add_msg(getGS('Unable to create the issue for translation $1.', $translationLanguageObj->getName()));
         camp_html_goto_page($backLink);
     }
 } else {
     $f_issue_name = Input::Get('f_issue_name', 'string', $issueObj->getName());
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:do_translate.php

示例5: getGS

    }
}
if (!$g_user->hasPermission("TranslateArticle")) {
    $errorStr = getGS('You do not have the right to translate articles.');
    camp_html_display_error($errorStr, $BackLink);
    exit;
}
// When the user selects a language the form is submitted to the same page (translation.php).
// Read article translation form input values for the case when the page has been reloaded
// because of language select.
$f_translation_title = Input::Get('f_translation_title', 'string', '', true);
$f_language_selected = Input::Get('f_translation_language', 'int', 0, true);
$f_translation_language = Input::Get('f_translation_language', 'int', 0, true);
if ($f_publication_id > 0) {
    $f_translation_issue_name = Input::Get('f_issue_name', 'string', $issueObj->getName(), true);
    $f_translation_issue_urlname = Input::Get('f_issue_urlname', 'string', $issueObj->getUrlName(), true);
    $f_translation_section_name = Input::Get('f_section_name', 'string', $sectionObj->getName(), true);
    $f_translation_section_urlname = Input::Get('f_section_urlname', 'string', $sectionObj->getUrlName(), true);
}
$allLanguages = Language::GetLanguages(null, null, null, array(), array(array('field' => 'byname', 'dir' => 'asc')), true);
$articleLanguages = $articleObj->getLanguages();
$articleLanguages = DbObjectArray::GetColumn($articleLanguages, "Id");
if ($f_language_selected > 0 && $f_issue_number > 0) {
    $translationIssueObj = new Issue($f_publication_id, $f_language_selected, $f_issue_number);
    $translationSectionObj = new Section($f_publication_id, $f_issue_number, $f_language_selected, $f_section_number);
}
if ($f_publication_id > 0) {
    $topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj, 'Section' => $sectionObj, 'Article' => $articleObj);
    camp_html_content_top(getGS('Translate article'), $topArray, true, true);
} else {
    $crumbs = array();
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:translate.php

示例6: htmlspecialchars

	<TD>
	<INPUT TYPE="TEXT" class="input_text" NAME="f_name" SIZE="32" alt="blank" emsg="<?php 
echo $translator->trans('You must fill in the $1 field.', array('$1' => $translator->trans('Name')));
?>
">
	</TD>
</TR>

<TR>
	<TD ALIGN="RIGHT" ><?php 
echo $translator->trans("URL Name");
?>
:</TD>
	<TD>
	<INPUT TYPE="TEXT" class="input_text" NAME="f_url_name" size="32" value="<?php 
echo htmlspecialchars($issueObj->getUrlName());
?>
" alt="blank" emsg="<?php 
echo $translator->trans('You must fill in the $1 field.', array('$1' => $translator->trans('URL Name')));
?>
">
	</TD>
</TR>

<TR>
	<TD ALIGN="RIGHT" ><?php 
echo $translator->trans("Language");
?>
:</TD>
	<TD>
		<SELECT NAME="f_new_language_id" class="input_select"><?php 
开发者ID:sourcefabric,项目名称:newscoop,代码行数:31,代码来源:translate.php

示例7: array

if (!$templateId) {
    $errorStr = $translator->trans('This issue cannot be previewed. Please make sure it has the front template selected.', array(), 'issues');
    camp_html_display_error($errorStr, null, true);
}
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();
$accessParams = "";
$urlType = $publicationObj->getProperty('IdURLType');
if ($urlType == 1) {
    $url = "{$websiteURL}" . "/tpl/" . $templateObj->getName() . "?IdLanguage={$Language}&IdPublication={$Pub}&NrIssue={$Issue}&{$accessParams}";
} else {
    $url = "{$websiteURL}" . '/' . $languageObj->getCode() . "/" . $issueObj->getUrlName() . "?{$accessParams}";
}
$selectedLanguage = (int) CampRequest::GetVar('Language');
$url .= "&previewLang={$selectedLanguage}";
if ($g_user->hasPermission("ManageTempl") || $g_user->hasPermission("DeleteTempl")) {
    // Show dual-pane view for those with template management priviledges
    ?>
<FRAMESET ROWS="60%,*" BORDER="1">
	<FRAME SRC="<?php 
    echo "{$url}&preview=on";
    ?>
" NAME="body"
		FRAMEBORDER="1">
	<FRAME NAME="e" SRC="empty.php" FRAMEBORDER="1">
</FRAMESET>
	<?php 
开发者ID:sourcefabric,项目名称:newscoop,代码行数:31,代码来源:preview.php

示例8: p

			<TD>
				<?php  p($issueObj->getIssueNumber()); ?>
			</TD>
		</TR>

		<TR>
			<TD ALIGN="RIGHT" ><?php  putGS("Name"); ?>:</TD>
			<TD>
			<INPUT TYPE="TEXT" class="input_text" NAME="f_issue_name" SIZE="32" value="<?php  p(htmlspecialchars($issueObj->getName())); ?>" alt="blank" emsg="<?php putGS('You must fill in the $1 field.',"'".getGS('Name')."'"); ?>">
			</TD>
		</TR>

		<TR>
			<TD ALIGN="RIGHT"><?php  putGS("URL Name"); ?>:</TD>
			<TD>
			<INPUT TYPE="TEXT" class="input_text" NAME="f_url_name" SIZE="32" value="<?php  p(htmlspecialchars($issueObj->getUrlName())); ?>" alt="alnum|1|A|true|false|_" emsg="<?php putGS('The $1 field may only contain letters, digits and underscore (_) character.', "'" . getGS('URL Name') . "'"); ?>">
			</TD>
		</TR>

		<TR>
			<TD ALIGN="RIGHT" ><?php  putGS("Language"); ?>:</TD>
			<TD>
			    <SELECT NAME="f_new_language_id" class="input_select">
				<?php
				foreach ($allLanguages as $tmpLanguage) {
					$langId = $tmpLanguage->getLanguageId();
					if (($langId == $issueObj->getLanguageId()) || !in_array($langId, $excludeLanguageIds)) {
						camp_html_select_option($langId, $issueObj->getLanguageId(), $tmpLanguage->getNativeName());
					}
			    }
				?>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:edit.php

示例9: array

     if ($f_issue_urlname == "") {
         camp_html_add_msg($translator->trans('You must fill in the $1 field.', array('$1' => '"' . $translator->trans('New issue URL name', array(), 'articles') . '"')));
         camp_html_goto_page($backLink);
     }
     if (!camp_is_valid_url_name($f_issue_urlname)) {
         camp_html_add_msg($translator->trans('The $1 field may only contain letters, digits and underscore (_) character.', array('$1' => '"' . $translator->trans('New issue URL name', array(), 'articles') . '"')));
         camp_html_goto_page($backLink);
     }
     $translationIssueObj->create($f_issue_urlname);
     if (!$translationIssueObj->exists()) {
         camp_html_add_msg($translator->trans('Unable to create the issue for translation $1.', array('$1' => $translationLanguageObj->getName()), 'articles'));
         camp_html_goto_page($backLink);
     }
 } else {
     $f_issue_name = Input::Get('f_issue_name', 'string', $translationIssueObj->getName());
     $f_issue_urlname = Input::Get('f_issue_urlname', 'string', $translationIssueObj->getUrlName());
     $translationIssueObj->update(array('Name' => $f_issue_name, 'ShortName' => $f_issue_urlname));
 }
 $f_section_number = $articleObj->getSectionNumber();
 $sectionObj = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_section_number);
 if (!$sectionObj->exists()) {
     camp_html_display_error($translator->trans('No such section.', array(), 'articles'), $backLink);
     exit;
 }
 $translationSectionObj = new Section($f_publication_id, $f_issue_number, $f_translation_language, $f_section_number);
 if (!$translationSectionObj->exists()) {
     if (!$g_user->hasPermission("ManageSection")) {
         camp_html_add_msg($translator->trans('A section must be created for the selected language but you do not have the right to create a section.', array(), 'articles'));
         camp_html_goto_page($backLink);
     }
     foreach ($sectionObj->getData() as $field => $fieldValue) {
开发者ID:sourcefabric,项目名称:newscoop,代码行数:31,代码来源:do_translate.php

示例10: putGS

		}
		?>
	</TD>
</TR>

<TR>
	<TD ALIGN="RIGHT" ><?php  putGS("Name"); ?>:</TD>
	<TD>
	<INPUT TYPE="TEXT" class="input_text" NAME="f_name" SIZE="32" alt="blank" emsg="<?php  putGS('You must fill in the $1 field.',getGS('Name')); ?>">
	</TD>
</TR>

<TR>
	<TD ALIGN="RIGHT" ><?php  putGS("URL Name"); ?>:</TD>
	<TD>
	<INPUT TYPE="TEXT" class="input_text" NAME="f_url_name" size="32" value="<?php echo htmlspecialchars($issueObj->getUrlName()); ?>" alt="blank" emsg="<?php  putGS('You must fill in the $1 field.',getGS('URL Name')); ?>">
	</TD>
</TR>

<TR>
	<TD ALIGN="RIGHT" ><?php  putGS("Language"); ?>:</TD>
	<TD>
		<SELECT NAME="f_new_language_id" class="input_select"><?php
		foreach ($unusedLanguages as $tmpLanguage) {
			camp_html_select_option($tmpLanguage->getLanguageId(),'',htmlspecialchars($tmpLanguage->getNativeName()));
        }
	    ?>
		</SELECT>
	</TD>
</TR>
<TR>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:translate.php


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