Esempio n. 1
0
        if (!$g_user->hasPermission("ManageSection")) {
            camp_html_add_msg(getGS('A section must be created for the selected language but you do not have the right to create a section.'));
            camp_html_goto_page($backLink);
        }
        foreach ($sectionObj->getData() as $field => $fieldValue) {
            if ($field != 'IdLanguage') {
                $translationSectionObj->setProperty($field, $fieldValue, false);
            }
        }
        $f_section_name = Input::Get('f_section_name', 'string', $sectionObj->getName());
        $f_section_urlname = Input::Get('f_section_urlname', 'string', $sectionObj->getUrlName());
        if ($f_section_urlname == "") {
            camp_html_add_msg(getGS('You must fill in the $1 field.', '"' . getGS('New section URL name') . '"'));
            camp_html_goto_page($backLink);
        }
        if (!camp_is_valid_url_name($f_section_urlname)) {
            camp_html_add_msg(getGS('The $1 field may only contain letters, digits and underscore (_) character.', '"' . getGS('New section URL name') . '"'));
            camp_html_goto_page($backLink);
        }
        $translationSectionObj->create($f_section_name, $f_section_urlname);
        if (!$translationSectionObj->exists()) {
            camp_html_add_msg(getGS('Unable to create the section for translation $1.', $translationLanguageObj->getName()));
            camp_html_goto_page($backLink);
        }
    } else {
        $f_section_name = Input::Get('f_section_name', 'string', $sectionObj->getName());
        $f_section_urlname = Input::Get('f_section_urlname', 'string', $sectionObj->getUrlName());
        $translationSectionObj->update(array('Name' => $f_section_name, 'ShortName' => $f_section_urlname));
    }
}
if ($articleObj->translationTitleExists($f_translation_title, $f_translation_language)) {
Esempio n. 2
0
if (!$issueObj->exists()) {
	camp_html_display_error(getGS('No such issue.'));
	exit;
}

$correct = true;
$modified = false;

$errors = array();
if ($cName == "") {
	camp_html_add_msg(getGS('You must fill in the $1 field.','"'.getGS('Name').'"'));
}
if ($cShortName == "")  {
	camp_html_add_msg(getGS('You must fill in the $1 field.','"'.getGS('URL Name').'"'));
}
$isValidShortName = camp_is_valid_url_name($cShortName);

if (!$isValidShortName) {
	camp_html_add_msg(getGS('The $1 field may only contain letters, digits and underscore (_) character.', '"' . getGS('URL Name') . '"'));
}

$editUrl = "/$ADMIN/sections/edit.php?Pub=$Pub&Issue=$Issue&Language=$Language&Section=$Section";
if (!camp_html_has_msgs()) {
	$modified = true;
	$modified &= $sectionObj->setName($cName);
	$modified &= $sectionObj->setDescription($cDescription);
	$modified &= $sectionObj->setSectionTemplateId($cSectionTplId);
	$modified &= $sectionObj->setArticleTemplateId($cArticleTplId);

	if ($cSubs == "a") {
	$numSubscriptionsAdded = Subscription::AddSectionToAllSubscriptions($Pub, $Section);
Esempio n. 3
0
    camp_html_display_error($translator->trans('Invalid input: $1', array('$1' => Input::GetErrorString()), 'issues'));
    exit;
}
$publicationObj = new Publication($f_publication_id);
$issueObj = new Issue($f_publication_id, $f_current_language_id, $f_issue_number);
$backLink = "/{$ADMIN}/issues/edit.php?Pub={$f_publication_id}&Issue={$f_issue_number}&Language={$f_current_language_id}";
if ($f_new_language_id == 0) {
    camp_html_add_msg($translator->trans('You must select a language.'));
}
if (empty($f_issue_name)) {
    camp_html_add_msg($translator->trans('You must fill in the $1 field.', array('$1' => "'" . $translator->trans('Name') . "'")));
}
if (empty($f_url_name)) {
    camp_html_add_msg($translator->trans('You must fill in the $1 field.', array('$1' => "'" . $translator->trans('URL Name') . "'")));
}
if (!camp_is_valid_url_name($f_url_name)) {
    camp_html_add_msg($translator->trans('The $1 field may only contain letters, digits and underscore (_) character.', array('$1' => "'" . $translator->trans('URL Name') . "'")));
}
if (camp_html_has_msgs()) {
    camp_html_goto_page($backLink);
}
$changed = true;
$changed &= $issueObj->setName($f_issue_name);
if ($issueObj->getWorkflowStatus() == 'Y') {
    $changed &= $issueObj->setPublicationDate($f_publication_date);
}
//@New theme management
$resourceId = new ResourceId('Publication/Edit');
$themeManagementService = $resourceId->getService(IThemeManagementService::NAME_1);
$outputSettingIssueService = $resourceId->getService(IOutputSettingIssueService::NAME);
$outputService = $resourceId->getService(IOutputService::NAME);