/** * A simple way to get the name of the language the article is * written in. The value is cached in case there are multiple * calls to this function. * * @return string */ public function getLanguageName() { if (is_null($this->m_languageName)) { $language = new Language($this->m_data['IdLanguage']); $this->m_languageName = $language->getNativeName(); } return $this->m_languageName; } // fn getLanguageName
camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString())); exit; } $articleObj = new Article($languageId, $articleNumber); if (!$articleObj->exists()) { camp_html_display_error(getGS('Article does not exist.')); exit; } $translationLanguageObj = new Language($f_translation_language); if (!$translationLanguageObj->exists()) { camp_html_display_error(getGS('Language does not exist.')); exit; } $translationArticle = new Article($f_translation_language, $articleNumber); if ($translationArticle->exists()) { camp_html_add_msg(getGS("The article has already been translated into \$1.", $translationLanguageObj->getNativeName())); camp_html_goto_page($backLink); } $f_publication_id = $articleObj->getPublicationId(); // Only create the translated issue and section if the article has been // categorized. if ($f_publication_id > 0) { $publicationObj = new Publication($f_publication_id); if (!$publicationObj->exists()) { camp_html_display_error(getGS('Publication does not exist.'), $backLink); exit; } $f_issue_number = $articleObj->getIssueNumber(); $issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number); if (!$issueObj->exists()) { camp_html_display_error(getGS('No such issue.'), $backLink);
<P> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box"> <TR> <TD COLSPAN="2"> <B> <?php echo $translator->trans("Delete country", array(), 'country'); ?> </B> <HR NOSHADE SIZE="1" COLOR="BLACK"> </TD> </TR> <TR> <TD COLSPAN="2"> <BLOCKQUOTE> <LI><?php echo $translator->trans('The country $1 could not be deleted.', array('$1' => '<B>' . htmlspecialchars($country->getName()) . '(' . htmlspecialchars($language->getNativeName()) . ')</B>'), 'country'); ?> </LI> </BLOCKQUOTE> </TD> </TR> <TR> <TD COLSPAN="2"> <DIV ALIGN="CENTER"> <INPUT TYPE="button" class="button" NAME="OK" VALUE="<?php echo $translator->trans('OK'); ?> " ONCLICK="location.href='/<?php p($ADMIN); ?> /country/'">
} ?> > <?php p(htmlspecialchars($country->getName())); ?> </TD> <?php } ?> <TD> <?php $language = new Language($country->getLanguageId()); p(htmlspecialchars($language->getNativeName())); ?> </TD> <TD ALIGN="CENTER"> <?php p(htmlspecialchars($country->getCode())); ?> </TD> <?php if ($g_user->hasPermission("ManageCountries")) { ?> <TD ALIGN="CENTER"> <A HREF="/<?php p($ADMIN);
<P> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box"> <TR> <TD COLSPAN="2"> <B> <?php echo $translator->trans("Deleting language", array(), 'languages'); ?> </B> <HR NOSHADE SIZE="1" COLOR="BLACK"> </TD> </TR> <TR> <TD COLSPAN="2"> <BLOCKQUOTE> <LI><?php echo $translator->trans('The language $1 could not be deleted.', array('$1' => '<B>' . $languageObj->getNativeName() . '</B>'), 'languages'); ?> </LI> <?php foreach ($errorMsgs as $error) { ?> <LI><?php p($error); ?> </LI> <?php } ?> </BLOCKQUOTE> </TD> </TR>
$crumbs[] = array(getGS("Deleting language"), ""); echo camp_html_breadcrumbs($crumbs); ?> <P> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box"> <TR> <TD COLSPAN="2"> <B> <?php putGS("Deleting language"); ?> </B> <HR NOSHADE SIZE="1" COLOR="BLACK"> </TD> </TR> <TR> <TD COLSPAN="2"> <BLOCKQUOTE> <LI><?php putGS('The language $1 could not be deleted.','<B>'.$languageObj->getNativeName().'</B>'); ?></LI> <?php foreach ($errorMsgs as $error) { ?> <LI><?php p($error); ?></LI> <?php } ?> </BLOCKQUOTE> </TD> </TR> <TR> <TD COLSPAN="2"> <DIV ALIGN="CENTER"> <INPUT TYPE="button" class="button" NAME="OK" VALUE="<?php putGS('OK'); ?>" ONCLICK="location.href='/<?php p($ADMIN); ?>/languages/'"> </DIV> </TD>
p($currentTopic->getTopicId()); ?> " /> <input type="hidden" name="f_topic_language_id" value="<?php p($topicLanguageId); ?> " /> <fieldset class="subtopic"> <legend><?php putGS("Add subtopic:"); ?> </legend> <label><?php echo $this->view->escape($topicLanguage->getNativeName()); ?> </label> <input type="text" name="f_topic_name" value="" class="input_text" size="15" title="<?php putGS('You must enter a name for the topic.'); ?> " /> <input type="submit" name="f_submit" value="<?php putGS("Add"); ?> " class="button" /> </fieldset> </form> <?php if ($isFirstTranslation) {
<TR <?php if ($color) { $color=0; ?>class="list_row_even"<?php } else { $color=1; ?>class="list_row_odd"<?php } ?>> <?php if ($g_user->hasPermission("ManageCountries")) { ?> <TD <?php if ($previousCountryCode == $country->getCode()) { ?>class="translation_indent"<?php } ?>> <A HREF="/<?php p($ADMIN); ?>/country/edit.php?f_country_code=<?php p(urlencode($country->getCode())); ?>&f_country_language=<?php p(urlencode($country->getLanguageId())); ?>"><?php p(htmlspecialchars($country->getName())); ?> </A> </TD> <?php } else { ?> <TD <?php if ($previousCountryCode == $country->getCode()) { ?>class="translation_indent"<?php } ?>> <?php p(htmlspecialchars($country->getName())); ?> </TD> <?php } ?> <TD> <?php $language = new Language($country->getLanguageId()); p(htmlspecialchars($language->getNativeName())); ?> </TD> <TD ALIGN="CENTER"> <?php p(htmlspecialchars($country->getCode())); ?> </TD> <?php if ($g_user->hasPermission("ManageCountries")) { ?> <TD ALIGN="CENTER"> <A HREF="/<?php p($ADMIN); ?>/country/translate.php?f_country_code=<?php p(urlencode($country->getCode())); ?>&f_country_language=<?php p($country->getLanguageId()); ?>"><?php putGS("Translate"); ?></A> </TD> <?php } if ($g_user->hasPermission("DeleteCountries")) { ?>
camp_html_display_error($translator->trans('Invalid input: $1', array('$1' => Input::GetErrorString()))); exit; } $articleObj = new Article($languageId, $articleNumber); if (!$articleObj->exists()) { camp_html_display_error($translator->trans('Article does not exist.')); exit; } $translationLanguageObj = new Language($f_translation_language); if (!$translationLanguageObj->exists()) { camp_html_display_error($translator->trans('Language does not exist.')); exit; } $translationArticle = new Article($f_translation_language, $articleNumber); if ($translationArticle->exists()) { camp_html_add_msg($translator->trans("The article has already been translated into \$1.", array('$1' => $translationLanguageObj->getNativeName()), 'articles')); camp_html_goto_page($backLink); } $f_publication_id = $articleObj->getPublicationId(); // Only create the translated issue and section if the article has been categorized. if ($f_publication_id > 0) { $publicationObj = new Publication($f_publication_id); if (!$publicationObj->exists()) { camp_html_display_error($translator->trans('Publication does not exist.'), $backLink); exit; } $f_issue_number = $articleObj->getIssueNumber(); $issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number); if (!$issueObj->exists()) { camp_html_display_error($translator->trans('No such issue.'), $backLink); exit;
<fieldset class="name"> <legend><?php putGS("Change topic name"); ?></legend> <input type="text" class="input_text" name="f_name" value="<?php echo htmlspecialchars($topicName); ?>" size="32" maxlength="255" title="<?php putGS('You must fill in the $1 field.',getGS('Name')); ?>" /> <input type="submit" class="button" name="Save" value="<?php putGS('Save'); ?>" /> </fieldset> </form> <form method="post" action="do_add.php" onsubmit="return validate(this);"> <?php echo SecurityToken::FormParameter(); ?> <input type="hidden" name="f_topic_parent_id" value="<?php p($currentTopic->getTopicId()); ?>" /> <input type="hidden" name="f_topic_language_id" value="<?php p($topicLanguageId); ?>" /> <fieldset class="subtopic"> <legend><?php putGS("Add subtopic:"); ?></legend> <label><?php p($topicLanguage->getNativeName()); ?></label> <input type="text" name="f_topic_name" value="" class="input_text" size="15" title="<?php putGS('You must enter a name for the topic.'); ?>" /> <input type="submit" name="f_submit" value="<?php putGS("Add"); ?>" class="button" /> </fieldset> </form> <?php if ($isFirstTranslation) { $isFirstTranslation = false; ?> <form method="post" action="do_add.php" onsubmit="return validate(this);"> <?php echo SecurityToken::FormParameter(); ?> <input type="hidden" name="f_topic_id" value="<?php p($currentTopic->getTopicId()); ?>" /> <fieldset class="translate"> <legend><?php putGS("Add translation:"); ?></legend> <select name="f_topic_language_id" class="input_select" title="<?php putGS("You must select a language."); ?>">
echo camp_html_breadcrumbs($crumbs); ?> <P> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box"> <TR> <TD COLSPAN="2"> <B> <?php putGS("Delete country"); ?> </B> <HR NOSHADE SIZE="1" COLOR="BLACK"> </TD> </TR> <TR> <TD COLSPAN="2"> <BLOCKQUOTE> <LI><?php putGS('The country $1 could not be deleted.' ,'<B>'.htmlspecialchars($country->getName()).'('.htmlspecialchars($language->getNativeName()).')</B>'); ?></LI> </BLOCKQUOTE> </TD> </TR> <TR> <TD COLSPAN="2"> <DIV ALIGN="CENTER"> <INPUT TYPE="button" class="button" NAME="OK" VALUE="<?php putGS('OK'); ?>" ONCLICK="location.href='/<?php p($ADMIN); ?>/country/'"> </DIV> </TD> </TR> </TABLE> <P> <?php camp_html_copyright_notice(); ?>