本文整理汇总了PHP中Alias::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Alias::getName方法的具体用法?PHP Alias::getName怎么用?PHP Alias::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alias
的用法示例。
在下文中一共展示了Alias::getName方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetURL
public static function GetURL($p_publicationId, $p_languageId = null, $p_issueNo = null, $p_sectionNo = null, $p_articleNo = NULL, $p_port = null)
{
global $g_ado_db;
global $_SERVER;
if (is_null($p_port)) {
if (!isset($_SERVER['SERVER_PORT'])) {
$_SERVER['SERVER_PORT'] = 80;
}
$p_port = $_SERVER['SERVER_PORT'];
}
$publicationObj = new Publication($p_publicationId);
if (!$publicationObj->exists()) {
return new PEAR_Error(getGS('Publication does not exist.'));
}
if (!isset($p_languageId)) {
$p_languageId = $publicationObj->getDefaultLanguageId();
}
$scheme = $_SERVER['SERVER_PORT'] == 443 ? 'https://' : 'http://';
$defaultAlias = new Alias($publicationObj->getDefaultAliasId());
$uri = ShortURL::GetURI($p_publicationId, $p_languageId, $p_issueNo, $p_sectionNo, $p_articleNo);
if (!is_string($uri) && PEAR::isError($uri)) {
return $uri;
}
return $scheme . $defaultAlias->getName() . $uri;
}
示例2: getDefaultSiteName
protected function getDefaultSiteName()
{
$defaultAlias = new Alias($this->m_dbObject->getDefaultAliasId());
if (!$defaultAlias->exists()) {
return null;
}
$subdir = CampConfig::singleton()->getSetting('SUBDIR');
return $defaultAlias->getName() . $subdir;
}
示例3: getGS
$errorStr = getGS('There was an error reading the issue parameter.');
}
if ($errorStr == "" && ($templateId = $issueObj->getIssueTemplateId()) == 0)
$errorStr = 'This issue cannot be previewed. Please make sure it has the front page template selected.';
if ($errorStr != "") {
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 = "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";
示例4: p
<TD>
<A HREF="/<?php
echo $ADMIN;
?>
/issues/?Pub=<?php
p($pub->getPublicationId());
?>
"><?php
p(htmlspecialchars($pub->getName()));
?>
</A>
</TD>
<TD>
<?php
$aliasObj = new Alias($pub->getDefaultAliasId());
p(htmlspecialchars($aliasObj->getName()));
?>
</TD>
<TD>
<?php
$languageObj = new Language($pub->getDefaultLanguageId());
p(htmlspecialchars($languageObj->getName()));
?>
</TD>
<?php
if ($g_user->hasPermission("ManagePub")) {
?>
<TD align="center">
<?php
示例5: testAlias
public function testAlias()
{
$alias = new Alias('test', 't');
$this->assertEquals('test', $alias->getName());
$this->assertEquals('t', $alias->getAlias());
}
示例6: Publication
}
$publicationObj = new Publication($f_publication_id);
$correct = true;
$errorMsgs = array();
if (empty($f_name)) {
$correct = false;
$errorMsgs[] = getGS('You must fill in the $1 field.', '<B>Name</B>');
}
$alias = new Alias($f_alias_id);
$aliases = 0;
if ($correct) {
if ($alias->getName() != $f_name) {
$aliasDups = count(Alias::GetAliases(null, null, $f_name));
if ($aliasDups <= 0) {
$success = $alias->setName($f_name);
if ($success) {
$logtext = getGS('The site alias for publication "$1" has been modified to "$2".',
$publicationObj->getName(), $f_name);
Log::Message($logtext, $g_user->getUserId(), 153);
}
}
else {
$errorMsgs[] = getGS('Another alias with the same name exists already.');
$correct = false;
}
}
}
示例7: array
// Check permissions
if (!$g_user->hasPermission('ManagePub')) {
camp_html_display_error($translator->trans("You do not have the right to manage publications.", array(), 'pub'));
exit;
}
$Pub = Input::Get('Pub', 'int', 0);
$Alias = Input::Get('Alias', 'int', 0);
if (!Input::IsValid()) {
camp_html_display_error($translator->trans('Invalid input: $1', array('$1' => Input::GetErrorString())), $_SERVER['REQUEST_URI']);
exit;
}
$publicationObj = new Publication($Pub);
$aliasObj = new Alias($Alias);
$errorMsgs = array();
if ($publicationObj->getDefaultAliasId() != $Alias) {
$aliasName = $aliasObj->getName();
$deleted = $aliasObj->delete();
$cacheService = \Zend_Registry::get('container')->getService('newscoop.cache');
$cacheService->clearNamespace('publication');
if ($deleted) {
camp_html_goto_page("/{$ADMIN}/pub/aliases.php?Pub={$Pub}");
} else {
$errorMsgs[] = $translator->trans('The alias $1 could not be deleted.', array('$1' => '<B>' . $aliasObj->getName() . '</B>'), 'pub');
}
} else {
$errorMsgs[] = $translator->trans('$1 is the default publication alias, it can not be deleted.', array('$1' => '<B>' . $aliasObj->getName() . '</B>'), 'pub');
}
$crumbs = array($translator->trans("Publication Aliases", array(), 'pub') => "aliases.php?Pub={$Pub}");
camp_html_content_top($translator->trans("Deleting alias", array(), 'pub'), array("Pub" => $publicationObj), true, false, $crumbs);
?>
<P>
示例8: htmlspecialchars
<INPUT TYPE="hidden" NAME="f_publication_id" VALUE="<?php
p($f_publication_id);
?>
">
<INPUT TYPE="hidden" NAME="f_alias_id" VALUE="<?php
p($f_alias_id);
?>
">
<TR>
<TD ALIGN="RIGHT" ><?php
putGS("Name");
?>
:</TD>
<TD>
<INPUT TYPE="TEXT" NAME="f_name" VALUE="<?php
echo htmlspecialchars($alias->getName());
?>
" SIZE="32" MAXLENGTH="255" class="input_text">
</TD>
</TR>
<TR>
<TD COLSPAN="2" align="center">
<INPUT TYPE="submit" class="button" NAME="Save" VALUE="<?php
putGS('Save');
?>
">
</TD>
</TR>
</TABLE>
</FORM>
<P>
示例9: trim
$f_name = trim(Input::Get('f_name'));
if (!Input::IsValid()) {
camp_html_display_error($translator->trans('Invalid input: $1', array('$1' => Input::GetErrorString())), $_SERVER['REQUEST_URI']);
exit;
}
$publicationObj = new Publication($f_publication_id);
$correct = true;
$errorMsgs = array();
if (empty($f_name)) {
$correct = false;
$errorMsgs[] = $translator->trans('You must fill in the $1 field.', array('$1' => '<B>Name</B>'));
}
$alias = new Alias($f_alias_id);
$aliases = 0;
if ($correct) {
if ($alias->getName() != $f_name) {
$aliasDups = count(Alias::GetAliases(null, null, $f_name));
if ($aliasDups <= 0) {
$success = $alias->setName($f_name);
} else {
$errorMsgs[] = $translator->trans('Another alias with the same name exists already.', array(), 'pub');
$correct = false;
}
}
}
if ($correct) {
$cacheService = \Zend_Registry::get('container')->getService('newscoop.cache');
$cacheService->clearNamespace('publication');
camp_html_goto_page("/{$ADMIN}/pub/aliases.php?Pub={$f_publication_id}&Alias={$f_alias_id}");
exit;
} else {
示例10: putGS
<P>
<FORM name="edit_alias" METHOD="POST" ACTION="do_edit_alias.php">
<?php echo SecurityToken::FormParameter(); ?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="box_table">
<TR>
<TD COLSPAN="2">
<B><?php putGS("Edit alias"); ?></B>
<HR NOSHADE SIZE="1" COLOR="BLACK">
</TD>
</TR>
<INPUT TYPE="hidden" NAME="f_publication_id" VALUE="<?php p($f_publication_id); ?>">
<INPUT TYPE="hidden" NAME="f_alias_id" VALUE="<?php p($f_alias_id); ?>">
<TR>
<TD ALIGN="RIGHT" ><?php putGS("Name"); ?>:</TD>
<TD>
<INPUT TYPE="TEXT" NAME="f_name" VALUE="<?php echo htmlspecialchars($alias->getName()); ?>" SIZE="32" MAXLENGTH="255" class="input_text">
</TD>
</TR>
<TR>
<TD COLSPAN="2" align="center">
<INPUT TYPE="submit" class="button" NAME="Save" VALUE="<?php putGS('Save'); ?>">
</TD>
</TR>
</TABLE>
</FORM>
<P>
<script>
document.edit_alias.f_name.focus();
</script>
<?php camp_html_copyright_notice(); ?>
示例11: Publication
}
$Pub = Input::Get('Pub', 'int', 0);
$Alias = Input::Get('Alias', 'int', 0);
if (!Input::IsValid()) {
camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']);
exit;
}
$publicationObj = new Publication($Pub);
$aliasObj = new Alias($Alias);
$errorMsgs = array();
if ($publicationObj->getDefaultAliasId() != $Alias) {
$aliasName = $aliasObj->getName();
$deleted = $aliasObj->delete();
if ($deleted) {
$logtext = getGS('The alias "$1" has been deleted from publication "$2".',
$aliasName, $publicationObj->getName());
Log::Message($logtext, $g_user->getUserId(), 152);
camp_html_goto_page("/$ADMIN/pub/aliases.php?Pub=$Pub");
} else {
$errorMsgs[] = getGS('The alias $1 could not be deleted.','<B>'.$aliasObj->getName().'</B>');
}
} else {
$errorMsgs[] = getGS('$1 is the default publication alias, it can not be deleted.', '<B>'.$aliasObj->getName().'</B>');
}
$crumbs = array(getGS("Publication Aliases") => "aliases.php?Pub=$Pub");
示例12: getDefaultSiteName
protected function getDefaultSiteName()
{
$publicationService = \Zend_Registry::get('container')->getService('newscoop.publication_service');
if ($publicationService->getPublicationAlias()) {
if ($publicationService->getPublicationAlias()->getId() == $this->m_dbObject->getDefaultAliasId()) {
return $publicationService->getPublicationAlias()->getName();
}
}
$defaultAlias = new Alias($this->m_dbObject->getDefaultAliasId());
if (!$defaultAlias->exists()) {
return null;
}
return $defaultAlias->getName();
}