Example #1
0
}
$publicationObj = new Publication($cPub);
$backLink = "/{$ADMIN}/pub/add_alias.php?Pub={$cPub}";
$correct = true;
$created = false;
$errorMsgs = array();
if (empty($cName)) {
    $correct = false;
    $errorMsgs[] = $translator->trans('You must fill in the $1 field.', array('$1' => '<B>Name</B>'));
}
$aliases = 0;
if ($correct) {
    $aliasDups = count(Alias::GetAliases(null, null, $cName));
    if ($aliasDups <= 0) {
        $newAlias = new Alias();
        $created = $newAlias->create(array('Name' => "{$cName}", "IdPublication" => "{$cPub}"));
        if ($created) {
            $cacheService = \Zend_Registry::get('container')->getService('newscoop.cache');
            $cacheService->clearNamespace('publication');
            camp_html_goto_page("/{$ADMIN}/pub/aliases.php?Pub={$cPub}");
        }
    } else {
        $errorMsgs[] = $translator->trans('Another alias with the same name exists already.', array(), 'pub');
    }
}
if (!$created && !$correct) {
    $errorMsgs[] = $translator->trans('The site alias $1 could not be added.', array('$1' => '<B>' . $cName . '</B>'), 'pub');
}
$crumbs = array($translator->trans("Publication Aliases", array(), 'pub') => "aliases.php?Pub={$cPub}");
camp_html_content_top($translator->trans("Adding new alias", array(), 'pub'), array("Pub" => $publicationObj), true, false, $crumbs);
?>
Example #2
0
$backLink = "/$ADMIN/pub/add_alias.php?Pub=$cPub";

$correct = true;
$created = false;
$errorMsgs = array();
if (empty($cName)) {
	$correct = false;
	$errorMsgs[] = getGS('You must fill in the $1 field.', '<B>Name</B>');
}

$aliases = 0;
if ($correct) {
	$aliasDups = count(Alias::GetAliases(null, null, $cName));
	if ($aliasDups <= 0) {
		$newAlias = new Alias();
		$created = $newAlias->create(array('Name' => "$cName", "IdPublication" => "$cPub"));
		if ($created) {
			$logtext = getGS('The site alias "$1" has been added to publication "$2".',
						$cName, $publicationObj->getName());
			Log::Message($logtext, $g_user->getUserId(), 151);
			camp_html_goto_page("/$ADMIN/pub/aliases.php?Pub=$cPub");
		}
	}
	else {
		$errorMsgs[] = getGS('Another alias with the same name exists already.');
	}
}

if (!$created && !$correct) {
	$errorMsgs[] = getGS('The site alias $1 could not be added.', '<B>'.$cName.'</B>');
}
Example #3
0
if (empty($f_default_alias)) {
	camp_html_add_msg(getGS('You must fill in the $1 field.','<B>'.getGS('Site').'</B>'));
}

if (camp_html_has_msgs()) {
	camp_html_goto_page($backLink);
}

camp_is_alias_conflicting($f_default_alias);
camp_is_publication_conflicting($f_name);
if (camp_html_has_msgs()) {
      camp_html_goto_page($backLink);
}

$alias = new Alias();
$alias->create(array('Name' => $f_default_alias));
$publicationObj = new Publication();
$columns = array('Name' => $f_name,
				 'IdDefaultAlias'=> $alias->getId(),
				 'IdDefaultLanguage' => $f_language,
				 'IdURLType' => $f_url_type,
				 'url_error_tpl_id' => $f_url_error_tpl_id,
				 'TimeUnit' => $f_time_unit,
				 'PaidTime' => $f_paid,
				 'TrialTime' => $f_trial,
				 'UnitCost' => $f_unit_cost,
				 'UnitCostAllLang' => $f_unit_cost_all_lang,
				 'Currency' => $f_currency,
                 'comments_enabled' => $f_comments_enabled,
			     'comments_article_default_enabled'=> $f_comments_article_default,
			     'comments_subscribers_moderated' => $f_comments_subscribers_moderated,