Example #1
0
        }
        $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)) {
    camp_html_add_msg(getGS("There already is an article with the same name. Please change the name and try again."), "ok");
    camp_html_goto_page($backLink);
    exit;
}
$articleCopy = $articleObj->createTranslation($f_translation_language, $g_user->getUserId(), $f_translation_title);
camp_html_add_msg(getGS("Article translation created."), "ok");
ArticleIndex::RunIndexer(3, 10, true);
camp_html_goto_page(camp_html_article_url($articleCopy, $f_translation_language, 'edit.php'), true);