getDisplayName() public method

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
return string
Beispiel #1
0
 /**
  * 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.
  *
  * @param int p_lang
  *
  * @return string
  */
 public function getDisplayName($p_lang = 0)
 {
     $displayName = $this->m_metadata->getDisplayName($p_lang);
     if ($displayName == 'NULL') {
         return $this->m_name;
     }
     return $displayName;
 }
Beispiel #2
0
// Verify the merge rules
$ok = true;
$errMsgs = array();

foreach ($f_src_c as $destColumn => $srcColumn) {
	if ($srcColumn == 'NULL') {
		continue;
	}
	$destATF = new ArticleTypeField($f_dest, $destColumn);
	$srcATF = new ArticleTypeField($f_src, $srcColumn);

	if (!$destATF->isConvertibleFrom($srcATF)) {
        $errMsgs[] = getGS('Cannot merge a $1 field ($2) into a $3 field ($4).',
                            getGS($srcATF->getType()), $srcATF->getDisplayName(),
                            getGS($destATF->getType()), $destATF->getDisplayName());
        $ok = false;
	}
}

//
// if f_action is Merge, do the merge and return them to article_types/ screen (or an error)
//
if ($ok && $f_action == 'Merge') {
	if (!SecurityToken::isValid()) {
		camp_html_display_error(getGS('Invalid security token!'));
		exit;
	}

	$res = ArticleType::merge($f_src, $f_dest, $f_src_c);
    if (!$res) {
Beispiel #3
0
    if (empty($tmp)) {
        $tmp = 'NULL';
    }
    $f_src_c[$destColumn->getPrintName()] = $tmp;
}
// Verify the merge rules
$ok = true;
$errMsgs = array();
foreach ($f_src_c as $destColumn => $srcColumn) {
    if ($srcColumn == 'NULL') {
        continue;
    }
    $destATF = new ArticleTypeField($f_dest, $destColumn);
    $srcATF = new ArticleTypeField($f_src, $srcColumn);
    if (!$destATF->isConvertibleFrom($srcATF)) {
        $errMsgs[] = getGS('Cannot merge a $1 field ($2) into a $3 field ($4).', getGS($srcATF->getType()), $srcATF->getDisplayName(), getGS($destATF->getType()), $destATF->getDisplayName());
        $ok = false;
    }
}
//
// if f_action is Merge, do the merge and return them to article_types/ screen (or an error)
//
if ($ok && $f_action == 'Merge') {
    if (!SecurityToken::isValid()) {
        camp_html_display_error(getGS('Invalid security token!'));
        exit;
    }
    $res = ArticleType::merge($f_src, $f_dest, $f_src_c);
    if (!$res) {
        $errMsgs[] = getGS("Merge failed.");
        $ok = false;
Beispiel #4
0
    if (empty($tmp)) {
        $tmp = 'NULL';
    }
    $f_src_c[$destColumn->getPrintName()] = $tmp;
}
// Verify the merge rules
$ok = true;
$errMsgs = array();
foreach ($f_src_c as $destColumn => $srcColumn) {
    if ($srcColumn == 'NULL') {
        continue;
    }
    $destATF = new ArticleTypeField($f_dest, $destColumn);
    $srcATF = new ArticleTypeField($f_src, $srcColumn);
    if (!$destATF->isConvertibleFrom($srcATF)) {
        $errMsgs[] = $translator->trans('Cannot merge a $1 field ($2) into a $3 field ($4).', array('$1' => $translator->trans($srcATF->getType()), '$2' => $srcATF->getDisplayName(), '$3' => $translator->trans($destATF->getType()), '$4' => $destATF->getDisplayName()), 'article_types');
        $ok = false;
    }
}
//
// if f_action is Merge, do the merge and return them to article_types/ screen (or an error)
//
if ($ok && $f_action == 'Merge') {
    if (!SecurityToken::isValid()) {
        camp_html_display_error($translator->trans('Invalid security token!'));
        exit;
    }
    $res = ArticleType::merge($f_src, $f_dest, $f_src_c);
    if (!$res) {
        $errMsgs[] = $translator->trans("Merge failed.", array(), 'article_types');
        $ok = false;