getDisplayName() public méthode

Gets the translation for a given language; default language is the session language. If no translation is set for that language, we return the dbTableName.
public getDisplayName ( $p_lang ) : string
Résultat string
Exemple #1
0
 /**
  * Get the logged in language's translation of the article type.
  * @return string
  */
 public function getTranslateType($p_languageId = null)
 {
     $type = $this->getType();
     $typeObj = new ArticleType($type);
     return $typeObj->getDisplayName($p_languageId);
 }
Exemple #2
0
        ?>
">
                    <?php 
        $tmpAT = new ArticleType($allArticleTypes[0]);
        echo $tmpAT->getDisplayName($f_article_language);
    } else {
        ?>
    				<SELECT NAME="f_article_type" class="input_select" alt="select" emsg="<?php 
        echo $translator->trans('You must fill in the $1 field.', array('$1' => $translator->trans('Article Type', array(), 'articles')));
        ?>
">
	   		      	<option></option>
		  		    <?php 
        foreach ($allArticleTypes as $tmpType) {
            $tmpAT = new ArticleType($tmpType);
            camp_html_select_option($tmpType, $f_article_type, $tmpAT->getDisplayName($f_article_language));
        }
        ?>
				    </SELECT>
               <?php 
    }
    ?>
			</TD>
		</TR>
		<TR>
			<TD ALIGN="RIGHT" ><?php 
    echo $translator->trans("Language");
    ?>
:</TD>
			<TD>
				<script>
Exemple #3
0
        echo camp_html_breadcrumbs($crumbs);

        ?>
        <P>
        <FORM NAME="dialog" METHOD="POST" ACTION="merge3.php?f_src=<?php print $f_src; ?>&f_dest=<?php print $f_dest; ?>">
		<?php echo SecurityToken::FormParameter(); ?>
        <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="box_table">
        <TR>
        	<TD COLSPAN="2">
        		<b><?php putGS("Merge Article Types: Step $1 of $2", "3", "3"); ?></b>
				<HR NOSHADE SIZE="1" COLOR="BLACK">
        	</TD>
        </TR>
        <TR>
        	<TD COLSPAN="2">
        		<b><?php putGS("Merge configuration for merging $1 into $2.", $src->getDisplayName(), $dest->getDisplayName()); ?></b>
        	<BR>
        	<UL>
        	<?php
        	foreach ($f_src_c as $destColumn => $srcColumn) {
        		$tmp = array_keys($f_src_c, $srcColumn);

        		if ($srcColumn == 'NULL') {
        			?>
        			<LI><FONT COLOR="TAN"><?php putGS("Merge $1 into $2", "<b>".getGS("NOTHING")."</b>", "<b>". $destColumn ."</b>"); ?> <?php putGS("(Null merge warning.)"); ?></FONT></LI>
        			<?php
        		} else if (count($tmp) > 1) {
        			?>
        			<LI><FONT COLOR="TAN"><?php putGS("Merge $1 into $2", "<b>".$srcColumn."</b>", "<b>". $destColumn ."</b>"); ?> <?php putGS("(Duplicate warning.)"); ?></FONT></LI>
        			<?php
        		} else {
Exemple #4
0
        echo SecurityToken::FormParameter();
        ?>
        <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="box_table">
        <TR>
        	<TD COLSPAN="2">
        		<b><?php 
        putGS("Merge Article Types: Step \$1 of \$2", "3", "3");
        ?>
</b>
				<HR NOSHADE SIZE="1" COLOR="BLACK">
        	</TD>
        </TR>
        <TR>
        	<TD COLSPAN="2">
        		<b><?php 
        putGS("Merge configuration for merging \$1 into \$2.", $src->getDisplayName(), $dest->getDisplayName());
        ?>
</b>
        	<BR>
        	<UL>
        	<?php 
        foreach ($f_src_c as $destColumn => $srcColumn) {
            $tmp = array_keys($f_src_c, $srcColumn);
            if ($srcColumn == 'NULL') {
                ?>
        			<LI><FONT COLOR="TAN"><?php 
                putGS("Merge \$1 into \$2", "<b>" . getGS("NOTHING") . "</b>", "<b>" . $destColumn . "</b>");
                ?>
 <?php 
                putGS("(Null merge warning.)");
                ?>
Exemple #5
0
		$commentImage = "is_shown.png";
	} else {
		$commentChangeText = getGS('activate');
		$commentImage = "is_hidden.png";
	}
    ?>
    <TR <?php  if ($color) { $color=0; ?>class="list_row_even"<?php  } else { $color=1; ?>class="list_row_odd"<?php  } ?>>
	<TD>
		<A HREF="/<?php p($ADMIN); ?>/article_types/rename.php?f_name=<?php  print htmlspecialchars($articleType); ?>"><?php print htmlspecialchars($articleType); ?></A>&nbsp;
	</TD>
	<TD ALIGN="CENTER">
		<A HREF="/<?php p($ADMIN); ?>/article_types/fields/?f_article_type=<?php  print urlencode($articleType); ?>"><?php  putGS('Fields'); ?></A>
	</TD>

	<TD>
		<?php  print $currentArticleType->getDisplayName(); ?> <?php print $currentArticleType->getDisplayNameLanguageCode(); ?>&nbsp;
	</TD>

	<td>
		<a href="javascript: void(0);" onclick="HideAll(type_ids); ShowElement('translate_type_<?php p($i); ?>');"><img src="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/localizer.png" alt="<?php putGS("Translate"); ?>" title="<?php putGS("Translate"); ?>" border="0"></a>
	</td>

	<TD ALIGN="CENTER">
		<A HREF="/<?php p($ADMIN); ?>/article_types/do_hide.php?f_article_type=<?php  print urlencode($articleType); ?>&f_status=<?php print $hideShowStatus; ?>&<?php echo SecurityToken::URLParameter(); ?>" onclick="return confirm('<?php putGS('Are you sure you want to $1 the article type $2?', $hideShowText, "\'".htmlspecialchars($articleType)."\'"); ?>');"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/<?php echo $hideShowImage; ?>" BORDER="0" ALT="<?php  putGS('$1 article type $2', ucfirst($hideShowText), htmlspecialchars($articleType)); ?>" TITLE="<?php  putGS('$1 article type $2', ucfirst($hideShowText), htmlspecialchars($articleType)); ?>" ></A>
	</TD>

	<TD ALIGN="CENTER">
		<A HREF="/<?php p($ADMIN); ?>/article_types/do_comment_activation.php?f_article_type=<?php  print urlencode($articleType); ?>&<?php echo SecurityToken::URLParameter(); ?>" onclick="return confirm('<?php putGS('Are you sure you want to $1 comments for article type $2?', $commentChangeText, "\'".htmlspecialchars($articleType)."\'"); ?>');"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/<?php echo $commentImage; ?>" BORDER="0" ALT="<?php  putGS('$1 comments for article type $1', ucfirst($commentChangeText), htmlspecialchars($articleType)); ?>" TITLE="<?php  putGS('$1 comments for article type $2', ucfirst($commentChangeText), htmlspecialchars($articleType)); ?>" ></A>
	</TD>

	<?php  if ($g_user->hasPermission("DeleteArticleTypes")) { ?>
Exemple #6
0
putGS("Destination Article Type");
?>
</u>
			</TD>
		</TR>
		<tr>
			<td align="right">
				 <b><?php 
print $src->getDisplayName();
?>
</b>
			</td>
			<td>-&gt;</td>
			<td align="left">
				<b><?php 
print $dest->getDisplayName();
?>
</b>
			</td>
		</tr>
		<?php 
foreach ($dest->getUserDefinedColumns(null, true, true) as $destColumn) {
    ?>
		<TR>
			<TD align="right">
				<SELECT CLASS="input_select" NAME="f_src_<?php 
    print $destColumn->getPrintName();
    ?>
">
				<?php 
    $selected = false;
 /**
  * Process item
  * @param  Article $article
  * @return array
  */
 public function processItem($article)
 {
     global $g_user, $Campsite;
     $translator = \Zend_Registry::get('container')->getService('translator');
     $editorService = \Zend_Registry::get('container')->getService('newscoop.editor');
     $articleLink = $editorService->getLink($article);
     $articleLinkParams = $editorService->getLinkParameters($article);
     $articleLinkParamsTranslate = $articleLinkParams . '&amp;f_action=translate&amp;f_action_workflow=' . $article->getWorkflowStatus() . '&amp;f_article_code=' . $article->getArticleNumber() . '_' . $article->getLanguageId();
     $previewLink = $Campsite['WEBSITE_URL'] . '/admin/articles/preview.php' . $editorService->getLinkParameters($article);
     $htmlPreviewLink = '<a href="' . $previewLink . '" target="_blank" title="' . $translator->trans('Preview') . '">' . $translator->trans('Preview') . '</a>';
     $translateLink = $Campsite['WEBSITE_URL'] . '/admin/articles/translate.php' . $articleLinkParamsTranslate;
     $htmlTranslateLink = '<a href="' . $translateLink . '" target="_blank" title="' . $translator->trans('Translate') . '">' . $translator->trans('Translate') . '</a>';
     $lockInfo = '';
     $lockHighlight = false;
     $timeDiff = camp_time_diff_str($article->getLockTime());
     if ($article->isLocked() && $timeDiff['days'] <= 0) {
         $lockUser = new User($article->getLockedByUser());
         if ($timeDiff['hours'] > 0) {
             $lockInfo = $translator->trans('The article has been locked by $1 ($2) $3 hour(s) and $4 minute(s) ago.', array('$1' => htmlspecialchars($lockUser->getRealName()), '$2' => htmlspecialchars($lockUser->getUserName()), '$3' => $timeDiff['hours'], '$4' => $timeDiff['minutes']), 'articles');
         } else {
             $lockInfo = $translator->trans('The article has been locked by $1 ($2) $3 minute(s) ago.', array('$1' => htmlspecialchars($lockUser->getRealName()), '$2' => htmlspecialchars($lockUser->getUserName()), '$3' => $timeDiff['minutes']), 'articles');
         }
         if ($article->getLockedByUser() != $g_user->getUserId()) {
             $lockHighlight = true;
         }
     }
     $tmpUser = new User($article->getCreatorId());
     $tmpArticleType = new ArticleType($article->getType());
     $tmpAuthor = new Author();
     $articleAuthors = ArticleAuthor::GetAuthorsByArticle($article->getArticleNumber(), $article->getLanguageId());
     foreach ((array) $articleAuthors as $author) {
         if (strtolower($author->getAuthorType()->getName()) == 'author') {
             $tmpAuthor = $author;
             break;
         }
     }
     if (!$tmpAuthor->exists() && isset($articleAuthors[0])) {
         $tmpAuthor = $articleAuthors[0];
     }
     $onFrontPage = $article->onFrontPage() ? $translator->trans('Yes') : $translator->trans('No');
     $onSectionPage = $article->onSectionPage() ? $translator->trans('Yes') : $translator->trans('No');
     $imagesNo = (int) ArticleImage::GetImagesByArticleNumber($article->getArticleNumber(), true);
     $topicsNo = (int) ArticleTopic::GetArticleTopics($article->getArticleNumber(), true);
     $commentsNo = '';
     if ($article->commentsEnabled()) {
         global $controller;
         $repositoryComments = $controller->getHelper('entity')->getRepository('Newscoop\\Entity\\Comment');
         $filter = array('thread' => $article->getArticleNumber(), 'language' => $article->getLanguageId());
         $params = array('sFilter' => $filter);
         $commentsNo = $repositoryComments->getCount($params);
     } else {
         $commentsNo = 'No';
     }
     // get language code
     $language = new Language($article->getLanguageId());
     return array($article->getArticleNumber(), $article->getLanguageId(), $article->getOrder(), sprintf('%s <a href="%s" title="%s %s">%s</a>', $article->isLocked() ? '<span class="ui-icon ui-icon-locked' . (!$lockHighlight ? ' current-user' : '') . '" title="' . $lockInfo . '"></span>' : '', $articleLink, $translator->trans('Edit'), htmlspecialchars($article->getName() . " ({$article->getLanguageName()})"), htmlspecialchars($article->getName() . (empty($_REQUEST['language']) ? " ({$language->getCode()})" : ''))), htmlspecialchars($article->getSection()->getName()), $article->getWebcode(), htmlspecialchars($tmpArticleType->getDisplayName()), htmlspecialchars($tmpUser->getRealName()), htmlspecialchars($tmpAuthor->getName()), $article->getWorkflowStatus(), $onFrontPage, $onSectionPage, $imagesNo, $topicsNo, $commentsNo, (int) $article->getReads(), Geo_Map::GetArticleMapId($article) != null ? $translator->trans('Yes') : $translator->trans('No'), (int) sizeof(Geo_Map::GetLocationsByArticle($article)), $article->getCreationDate(), $article->getPublishDate(), $article->getLastModified(), $htmlPreviewLink, $htmlTranslateLink);
 }
Exemple #8
0
	<TD ALIGN="CENTER">
		<A HREF="/<?php 
        p($ADMIN);
        ?>
/article_types/fields/?f_article_type=<?php 
        print urlencode($articleType);
        ?>
"><?php 
        echo $translator->trans('Fields');
        ?>
</A>
	</TD>

	<TD>
		<?php 
        print $currentArticleType->getDisplayName($languageObj->getLanguageId());
        ?>
 <?php 
        print $currentArticleType->getDisplayNameLanguageCode($languageObj->getLanguageId());
        ?>
&nbsp;
	</TD>

	<td>
		<a href="javascript: void(0);" onclick="HideAll(type_ids); ShowElement('translate_type_<?php 
        p($i);
        ?>
');"><img src="<?php 
        echo $Campsite["ADMIN_IMAGE_BASE_URL"];
        ?>
/localizer.png" alt="<?php 
Exemple #9
0
			<TD align="right">
				<u><?php putGS("Source Article Type");?></u>
			</TD>
			<td>
			</td>
			<TD align="left" style="padding-left: 2px;">
				<u><?php putGS("Destination Article Type"); ?></u>
			</TD>
		</TR>
		<tr>
			<td align="right">
				 <b><?php print $src->getDisplayName(); ?></b>
			</td>
			<td>-&gt;</td>
			<td align="left">
				<b><?php print $dest->getDisplayName(); ?></b>
			</td>
		</tr>
		<?php foreach ($dest->getUserDefinedColumns(null, true, true) as $destColumn) { ?>
		<TR>
			<TD align="right">
				<SELECT CLASS="input_select" NAME="f_src_<?php print $destColumn->getPrintName(); ?>">
				<?php
				$selected = false;
				foreach ($src->getUserDefinedColumns(null, true, true) as $srcColumn) {
					if (!$destColumn->isConvertibleFrom($srcColumn)) {
						continue;
					}
					$selected = ($srcColumn->getType() == $destColumn->getType()
					|| $destColumn->getPrintName() == $srcColumn->getPrintName()) && !$selected;
				?>
Exemple #10
0
	<TD ALIGN="CENTER">
		<A HREF="/<?php 
        p($ADMIN);
        ?>
/article_types/fields/?f_article_type=<?php 
        print urlencode($articleType);
        ?>
"><?php 
        putGS('Fields');
        ?>
</A>
	</TD>

	<TD>
		<?php 
        print $currentArticleType->getDisplayName();
        ?>
 <?php 
        print $currentArticleType->getDisplayNameLanguageCode();
        ?>
&nbsp;
	</TD>

	<td>
		<a href="javascript: void(0);" onclick="HideAll(type_ids); ShowElement('translate_type_<?php 
        p($i);
        ?>
');"><img src="<?php 
        echo $Campsite["ADMIN_IMAGE_BASE_URL"];
        ?>
/localizer.png" alt="<?php 
Exemple #11
0
	/**
	 * Process item
	 * @param Article $article
	 * @return array
	 */
	public function processItem(Article $article)
	{
		global $g_user, $Campsite;

		$articleLinkParams = '?f_publication_id=' . $article->getPublicationId()
		. '&amp;f_issue_number=' . $article->getIssueNumber() . '&amp;f_section_number=' . $article->getSectionNumber()
		. '&amp;f_article_number=' . $article->getArticleNumber() . '&amp;f_language_id=' . $article->getLanguageId()
		. '&amp;f_language_selected=' . $article->getLanguageId();
		$articleLink = $Campsite['WEBSITE_URL'].'/admin/articles/edit.php' . $articleLinkParams;
		$previewLink = $Campsite['WEBSITE_URL'].'/admin/articles/preview.php' . $articleLinkParams;

		$lockInfo = '';
		$lockHighlight = false;
		$timeDiff = camp_time_diff_str($article->getLockTime());
		if ($article->isLocked() && ($timeDiff['days'] <= 0)) {
			$lockUser = new User($article->getLockedByUser());
			if ($timeDiff['hours'] > 0) {
				$lockInfo = getGS('The article has been locked by $1 ($2) $3 hour(s) and $4 minute(s) ago.',
				htmlspecialchars($lockUser->getRealName()),
				htmlspecialchars($lockUser->getUserName()),
				$timeDiff['hours'], $timeDiff['minutes']);
			} else {
				$lockInfo = getGS('The article has been locked by $1 ($2) $3 minute(s) ago.',
				htmlspecialchars($lockUser->getRealName()),
				htmlspecialchars($lockUser->getUserName()),
				$timeDiff['minutes']);
			}
			if ($article->getLockedByUser() != $g_user->getUserId()) {
				$lockHighlight = true;
			}
		}

		$tmpUser = new User($article->getCreatorId());
		$tmpArticleType = new ArticleType($article->getType());

		$tmpAuthor = new Author();
		$articleAuthors = ArticleAuthor::GetAuthorsByArticle($article->getArticleNumber(), $article->getLanguageId());
		foreach((array) $articleAuthors as $author) {
			if (strtolower($author->getAuthorType()->getName()) == 'author') {
				$tmpAuthor = $author;
				break;
			}
		}
		if (!$tmpAuthor->exists() && isset($articleAuthors[0])) {
			$tmpAuthor = $articleAuthors[0];
		}

		$onFrontPage = $article->onFrontPage() ? getGS('Yes') : getGS('No');
		$onSectionPage = $article->onSectionPage() ? getGS('Yes') : getGS('No');

		$imagesNo = (int) ArticleImage::GetImagesByArticleNumber($article->getArticleNumber(), true);
		$topicsNo = (int) ArticleTopic::GetArticleTopics($article->getArticleNumber(), true);
		$commentsNo = '';
		if ($article->commentsEnabled()) {
			$commentsNo = (int) ArticleComment::GetArticleComments($article->getArticleNumber(), $article->getLanguageId(), null, true);
		} else {
			$commentsNo = 'No';
		}

		// get language code
		$language = new Language($article->getLanguageId());

		return array(
		$article->getArticleNumber(),
		$article->getLanguageId(),
		$article->getOrder(),
		sprintf('%s <a href="%s" title="%s %s">%s</a>',
		$article->isLocked() ? '<span class="ui-icon ui-icon-locked' . (!$lockHighlight ? ' current-user' : '' ) . '" title="' . $lockInfo . '"></span>' : '',
		$articleLink,
		getGS('Edit'), $article->getName() . " ({$article->getLanguageName()})",
		$article->getName() . (empty($_REQUEST['language']) ? " ({$language->getCode()})" : '')),
		$tmpArticleType->getDisplayName(),
		$tmpUser->getRealName(),
		$tmpAuthor->getName(),
		$article->getWorkflowStatus(),
		$onFrontPage,
		$onSectionPage,
		$imagesNo,
		$topicsNo,
		$commentsNo,
		(int) $article->getReads(),
		Geo_Map::GetArticleMapId($article) != NULL ? getGS('Yes') : getGS('No'),
		(int) sizeof(Geo_Map::GetLocationsByArticle($article)),
		$article->getCreationDate(),
		$article->getPublishDate(),
		$article->getLastModified(),
		);
	}
Exemple #12
0
        echo SecurityToken::FormParameter();
        ?>
        <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="box_table">
        <TR>
        	<TD COLSPAN="2">
        		<b><?php 
        echo $translator->trans("Merge Article Types: Step \$1 of \$2", array('$1' => 3, '$2' => 3), 'article_types');
        ?>
</b>
				<HR NOSHADE SIZE="1" COLOR="BLACK">
        	</TD>
        </TR>
        <TR>
        	<TD COLSPAN="2">
        		<b><?php 
        echo $translator->trans("Merge configuration for merging \$1 into \$2.", array('$1' => $src->getDisplayName(), '$2' => $dest->getDisplayName()), 'article_types');
        ?>
</b>
        	<BR>
        	<UL>
        	<?php 
        foreach ($f_src_c as $destColumn => $srcColumn) {
            $tmp = array_keys($f_src_c, $srcColumn);
            if ($srcColumn == 'NULL') {
                ?>
        			<LI><FONT COLOR="TAN"><?php 
                echo $translator->trans("Merge \$1 into \$2", array('$1' => "<b>" . $translator->trans("NOTHING", array(), 'article_types') . "</b>", '$2' => "<b>" . $destColumn . "</b>"), 'article_types');
                ?>
 <?php 
                echo $translator->trans("(Null merge warning.)", array(), 'article_types');
                ?>