function _saveSections() { require_once 'AMP/Content/Section.inc.php'; $section_count = 1; $form =& $this->get_form(); while (isset($this->_request_vars[$this->_get_section_fieldname($section_count)]) && $this->_request_vars[$this->_get_section_fieldname($section_count)]) { $name = $this->_request_vars[$this->_get_section_fieldname($section_count)]; $text = $this->_request_vars[$this->_get_section_fieldname($section_count, 'text')]; $section = new Section(AMP_Registry::getDbcon()); $section->setName($name); $section->setBlurb($text); $section->setParent(); $section->setListType(); if (!($result = $section->save())) { ++$section_count; continue; } $section->publish(); $section->reorder($section_count); $form->setValues(array($this->_get_section_fieldname($section_count) => '', $this->_get_section_fieldname($section_count, 'text') => '')); $this->message(sprintf(AMP_TEXT_DATA_SAVE_SUCCESS, $section->getName())); ++$section_count; } }
$allArticles = Article::GetArticles($f_publication_id, $f_issue_number, $f_section_number, $f_language_selected, $sqlOptions); $numUniqueArticles = $totalArticles; $numUniqueArticlesDisplayed = count($allArticles); } else { // Show articles in all languages. $totalArticles = Article::GetArticles($f_publication_id, $f_issue_number, $f_section_number, null, null, true); $allArticles = Article::GetArticlesGrouped($f_publication_id, $f_issue_number, $f_section_number, null, $f_language_id, $sqlOptions); $numUniqueArticles = Article::GetArticlesGrouped($f_publication_id, $f_issue_number, $f_section_number, null, null, null, true); $numUniqueArticlesDisplayed = count(array_unique(DbObjectArray::GetColumn($allArticles, 'Number'))); } $numArticlesThisPage = count($allArticles); $previousArticleNumber = 0; $pagerUrl = "index.php?f_publication_id=" . $f_publication_id . "&f_issue_number=" . $f_issue_number . "&f_section_number=" . $f_section_number . "&f_language_id=" . $f_language_id . "&f_language_selected=" . $f_language_selected . "&"; $pager = new SimplePager($numUniqueArticles, $ArticlesPerPage, $offsetVarName, $pagerUrl); $topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj, 'Section' => $sectionObj); camp_html_content_top($translator->trans('Article List', array(), 'articles') . ': ' . $this->view->escape($sectionObj->getName()), $topArray); $controller->view->headTitle($translator->trans('Article List', array(), 'articles') . ': ' . $this->view->escape($sectionObj->getName()) . ' - Newscoop Admin', 'SET'); ?> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons" style="padding-top: 5px;"> <TR> <TD><A HREF="/<?php echo $ADMIN; ?> /sections/?Pub=<?php p($f_publication_id); ?> &Issue=<?php p($f_issue_number); ?> &Language=<?php p($f_language_id);
public function update(Section $section) { $this->updateObject('Section', 's_id', $section->getId(), ['u_id' => $section->getUserId(), 's_supe' => $section->getParentId(), 's_name' => $section->getName()]); }
</TR> </TABLE> </TD> </TR> </TABLE> <TABLE BORDER="0" CELLSPACING="1" CELLPADDING="1" WIDTH="100%" class="current_location_table"> <TR> <TD ALIGN="RIGHT" WIDTH="1%" NOWRAP VALIGN="TOP" class="current_location_title"> <?php putGS("Publication"); ?>:</TD> <TD VALIGN="TOP" class="current_location_content"><?php echo htmlspecialchars($publicationObj->getName()); ?></TD> <TD ALIGN="RIGHT" WIDTH="1%" NOWRAP VALIGN="TOP" class="current_location_title"> <?php putGS("Issue"); ?>:</TD> <TD VALIGN="TOP" class="current_location_content"><?php echo $issueObj->getIssueNumber(); ?>. <?php echo htmlspecialchars($issueObj->getName()); ?> (<?php echo htmlspecialchars($issueLanguage->getName()); ?>)</TD> <TD ALIGN="RIGHT" WIDTH="1%" NOWRAP VALIGN="TOP" class="current_location_title"> <?php putGS("Section"); ?>:</TD> <TD VALIGN="TOP" class="current_location_content"><?php echo $sectionObj->getSectionNumber(); ?>. <?php echo htmlspecialchars($sectionObj->getName()); ?></TD> <TD ALIGN="RIGHT" WIDTH="1%" NOWRAP VALIGN="TOP" class="current_location_title"> <?php putGS("Article"); ?>:</TD> <TD VALIGN="TOP" class="current_location_content"><?php echo htmlspecialchars($articleObj->getTitle()); ?> (<?php echo htmlspecialchars($articleLanguage->getName()); ?>)</TD> </TR> </TABLE> <table width="100%" border="0"> <tr> <td style="padding:20px;" align="center"> Here you can upload an article that has been written in Open Office (files with extension ".sxw"). Click <a href="CampsiteArticleTemplate.stw">here</a> to get the template. </td> </tr> </table> <form method="POST" action="CommandProcessor.php" onsubmit="return <?php camp_html_fvalidate(); ?>;" enctype="multipart/form-data">
if (!$sectionObj->exists()) { camp_html_display_error(getGS('No such section.'), $backLink); exit; } $translationSectionObj = new Section($f_publication_id, $f_issue_number, $f_translation_language, $f_section_number); if (!$translationSectionObj->exists()) { 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 {
require_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/sections/section_common.php"; require_once $GLOBALS['g_campsiteDir'] . '/classes/Article.php'; $translator = \Zend_Registry::get('container')->getService('translator'); if (!$g_user->hasPermission('DeleteSection')) { camp_html_display_error($translator->trans('You do not have the right to delete sections.', array(), 'sections')); exit; } $f_publication_id = Input::Get('Pub', 'int', 0); $f_issue_number = Input::Get('Issue', 'int', 0); $f_language_id = Input::Get('Language', 'int', 0); $f_section_number = Input::Get('Section', 'int', 0); $numArticles = count(Article::GetArticles($f_publication_id, $f_issue_number, $f_section_number, $f_language_id)); $publicationObj = new Publication($f_publication_id); $issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number); $sectionObj = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_section_number); $sectionTranslations = Section::GetSections($f_publication_id, $f_issue_number, null, null, $sectionObj->getName(), null); $topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj, 'Section' => $sectionObj); camp_html_content_top($translator->trans('Delete section', array(), 'sections'), $topArray); ?> <P> <FORM METHOD="POST" ACTION="/<?php echo $ADMIN; ?> /sections/do_del.php"> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box"> <?php echo SecurityToken::FormParameter(); ?> <TR> <TD COLSPAN="2" align="center"><?php echo $translator->trans('There are $1 articles in this section.', array('$1' => '<b>' . $numArticles . '</b>'), 'sections');
/** * Append a section to the end of this INI file * * @param Section $section */ public function addSection(Section $section) { $this->sections[$section->getName()] = $section; }
alert('<?php putGS("The section number specified already exists, please specify a different value or use the dropdown to find an existing section."); ?>'); return false; } } } return true; } // fn CustomValidator_DuplicateSection </script> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons" style="padding-top: 5px;"> <TR> <TD><A HREF="/<?php echo $ADMIN; ?>/sections/?Pub=<?php p($f_src_publication_id); ?>&Issue=<?php p($f_src_issue_number); ?>&Language=<?php p($f_language_id); ?>"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/left_arrow.png" BORDER="0"></A></TD> <TD><A HREF="/<?php echo $ADMIN; ?>/sections/?Pub=<?php p($f_src_publication_id); ?>&Issue=<?php p($f_src_issue_number); ?>&Language=<?php p($f_language_id); ?>"><B><?php putGS("Section List"); ?></B></A></TD> <TD style="padding-left: 20px;"><A HREF="/<?php echo $ADMIN; ?>/sections/edit.php?Pub=<?php p($f_src_publication_id); ?>&f_issue_number=<?php p($f_src_issue_number); ?>&f_section_number=<?php p($f_src_section_number); ?>&f_language_id=<?php p($f_language_id); ?>"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/left_arrow.png" BORDER="0"></A></TD> <TD><A HREF="/<?php echo $ADMIN; ?>/sections/edit.php?Pub=<?php p($f_src_publication_id); ?>&Issue=<?php p($f_src_issue_number); ?>&Section=<?php p($f_src_section_number); ?>&Language=<?php p($f_language_id); ?>"><B><?php putGS("Section"); ?>: <?php p(htmlspecialchars($sectionObj->getName())); ?></B></A></TD> </TR> </TABLE> <P> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" class="table_input" style="padding-top: 10px; padding-bottom: 10px; padding-left: 20px; padding-right: 20px;"> <tr> <td> <table BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER" > <TR> <TD colspan="2" style="font-size: 14pt; padding-top: 10px;"><b><?php putGS("Duplicate Section:"); ?> <?php p(htmlspecialchars($sectionObj->getName())); ?></b></TD> </TR> <TR> <td colspan="3"> </TD> </TR> <TR>
$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($translator->trans('You must fill in the $1 field.', array('$1' => '"' . $translator->trans('New section URL name', array(), 'articles') . '"'))); camp_html_goto_page($backLink); } if (!camp_is_valid_url_name($f_section_urlname)) { camp_html_add_msg($translator->trans('The $1 field may only contain letters, digits and underscore (_) character.', array('$1' => '"' . $translator->trans('New section URL name', array(), 'articles') . '"'))); camp_html_goto_page($backLink); } $translationSectionObj->create($f_section_name, $f_section_urlname); if (!$translationSectionObj->exists()) { camp_html_add_msg($translator->trans('Unable to create the section for translation $1.', array('$1' => $translationLanguageObj->getName()), 'articles')); camp_html_goto_page($backLink); } } else { $f_section_name = Input::Get('f_section_name', 'string', $translationSectionObj->getName()); $f_section_urlname = Input::Get('f_section_urlname', 'string', $translationSectionObj->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($translator->trans("There already is an article with the same name. Please change the name and try again.", array(), 'articles'), "ok"); camp_html_goto_page($backLink); exit; } $articleCopy = $articleObj->createTranslation($f_translation_language, $g_user->getUserId(), $f_translation_title); \Zend_Registry::get('container')->getService('dispatcher')->dispatch('article.translate', new \Newscoop\EventDispatcher\Events\GenericEvent($this, array('article' => $articleCopy))); camp_html_add_msg($translator->trans("Article translation created.", array(), 'articles'), "ok"); ArticleIndex::RunIndexer(3, 10, true); camp_html_goto_page(camp_html_article_url($articleCopy, $f_translation_language, 'edit.php'), true);
$allArticles = Article::GetArticles($f_publication_id, $f_issue_number, $f_section_number, $f_language_selected, $sqlOptions); $numUniqueArticles = $totalArticles; $numUniqueArticlesDisplayed = count($allArticles); } else { // Show articles in all languages. $totalArticles = Article::GetArticles($f_publication_id, $f_issue_number, $f_section_number, null, null, true); $allArticles = Article::GetArticlesGrouped($f_publication_id, $f_issue_number, $f_section_number, null, $f_language_id, $sqlOptions); $numUniqueArticles = Article::GetArticlesGrouped($f_publication_id, $f_issue_number, $f_section_number, null, null, null, true); $numUniqueArticlesDisplayed = count(array_unique(DbObjectArray::GetColumn($allArticles, 'Number'))); } $numArticlesThisPage = count($allArticles); $previousArticleNumber = 0; $pagerUrl = "index.php?f_publication_id=" . $f_publication_id . "&f_issue_number=" . $f_issue_number . "&f_section_number=" . $f_section_number . "&f_language_id=" . $f_language_id . "&f_language_selected=" . $f_language_selected . "&"; $pager = new SimplePager($numUniqueArticles, $ArticlesPerPage, $offsetVarName, $pagerUrl); $topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj, 'Section' => $sectionObj); camp_html_content_top($translator->trans('Article List', array(), 'articles') . ': ' . $this->view->escape($sectionObj->getName()), $topArray); ?> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons" style="padding-top: 5px;"> <TR> <TD><A HREF="/<?php echo $ADMIN; ?> /sections/?Pub=<?php p($f_publication_id); ?> &Issue=<?php p($f_issue_number); ?> &Language=<?php p($f_language_id); ?>
$numUniqueArticlesDisplayed = count(array_unique(DbObjectArray::GetColumn($allArticles, 'Number'))); } $numArticlesThisPage = count($allArticles); $previousArticleNumber = 0; $pagerUrl = "index.php?f_publication_id=".$f_publication_id ."&f_issue_number=".$f_issue_number ."&f_section_number=".$f_section_number ."&f_language_id=".$f_language_id ."&f_language_selected=".$f_language_selected."&"; $pager = new SimplePager($numUniqueArticles, $ArticlesPerPage, $offsetVarName, $pagerUrl); $topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj, 'Section' => $sectionObj); camp_html_content_top(getGS('Article List') . ': ' . $sectionObj->getName(), $topArray); ?> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons" style="padding-top: 5px;"> <TR> <TD><A HREF="/<?php echo $ADMIN; ?>/sections/?Pub=<?php p($f_publication_id); ?>&Issue=<?php p($f_issue_number); ?>&Language=<?php p($f_language_id); ?>"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/left_arrow.png" BORDER="0"></A></TD> <TD><A HREF="/<?php echo $ADMIN; ?>/sections/?Pub=<?php p($f_publication_id); ?>&Issue=<?php p($f_issue_number); ?>&Language=<?php p($f_language_id); ?>"><B><?php putGS("Section List"); ?></B></A></TD> <?php if ($g_user->hasPermission('AddArticle')) { ?> <TD style="padding-left: 20px;"><A HREF="add.php?f_publication_id=<?php p($f_publication_id); ?>&f_issue_number=<?php p($f_issue_number); ?>&f_section_number=<?php p($f_section_number); ?>&f_language_id=<?php p($f_language_id); ?>" ><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/add.png" BORDER="0"></A></TD> <TD><A HREF="add.php?f_publication_id=<?php p($f_publication_id); ?>&f_issue_number=<?php p($f_issue_number); ?>&f_section_number=<?php p($f_section_number); ?>&f_language_id=<?php p($f_language_id); ?>" ><B><?php putGS("Add new article"); ?></B></A></TD> <?php } ?> </tr> </TABLE> <?php $articlelist = new ArticleList(); $articlelist->setPublication($f_publication_id);
$topArray = array('Pub' => $srcPublicationObj, 'Issue' => $srcIssueObj, 'Section' => $srcSectionObj); camp_html_content_top(getGS('Duplicating section'), $topArray); ?> <P> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box"> <TR> <TD COLSPAN="2"> <B> <?php putGS("Duplicating section"); ?> </B> <HR NOSHADE SIZE="1" COLOR="BLACK"> </TD> </TR> <TR> <TD COLSPAN="2"> <BLOCKQUOTE> <?php putGS('Section $1 has been duplicated to $2. $3 of $4', '<B>'.$srcSectionObj->getName().'</B>', '<B>'.$dstSectionObj->getIssueNumber().'</B>', '<B>'.$dstIssueObj->getName().' ('.$dstIssueObj->getLanguageName().')</B>', '<B>'.$dstPublicationObj->getName().'</B>'); ?> </BLOCKQUOTE> </TD> </TR> <TR> <TD COLSPAN="2"> <DIV ALIGN="CENTER"> <table> <tr> <td> <b><a href="<?php echo "/$ADMIN/sections/edit.php?Pub=$f_dest_publication_id&Issue=$f_dest_issue_number&Section=$f_dest_section_number&Language=$f_language_id"; ?>"><?php putGS("Go to new section"); ?></a></b> </td> <td style="padding-left: 50px;"> <b><a href="<?php echo "/$ADMIN/sections/edit.php?Pub=$f_src_publication_id&Issue=$f_src_issue_number&Section=$f_src_section_number&Language=$f_language_id"; ?>"><?php putGS("Go to source section"); ?></a></b> </td> </tr>
</B> <HR NOSHADE SIZE="1" COLOR="BLACK"> </TD> </TR> <TR> <TD COLSPAN="2"> <BLOCKQUOTE> <?php if (!$correct) { echo "<LI>"; putGS('Invalid parameters received'); echo "</LI>\n"; } else { ?> <LI><?php putGS('The section $1 could not be duplicated', '<B>' . htmlspecialchars($srcSectionObj->getName()) . '</B>'); ?> </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
/** * Prints a section's header table with name and share links. * @param Section $section */ function printSectionHeader($section) { ?> <div class="course"> <div class="share"> <div class='shareButton emailShare' data-type='Email' data-id='<?php echo $section->getSlug(); ?> '><img src='<?php echo BASE_URL; ?> images/share-email.png'/>Email</div> </div> <div class="text"><?php echo $section->getName(); ?> </div> </div> <?php }
exit; } if (!$g_user->hasPermission('DeleteSection')) { camp_html_display_error($translator->trans('You do not have the right to delete sections.', array(), 'sections')); exit; } $f_publication_id = Input::Get('f_publication_id', 'int', 0); $f_issue_number = Input::Get('f_issue_number', 'int', 0); $f_language_id = Input::Get('f_language_id', 'int', 0); $f_section_number = Input::Get('f_section_number', 'int', 0); $f_delete_all_section_translations = Input::Get('f_delete_all_section_translations', 'string', '', true); $f_delete_all_articles_translations = Input::Get('f_delete_all_articles_translations', 'string', '', true); $publicationObj = new Publication($f_publication_id); $issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number); $sectionObj = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_section_number); $sectionName = $sectionObj->getName(); $articles = Article::GetArticles($f_publication_id, $f_issue_number, $f_section_number, $f_language_id); $numArticles = count($articles); $numArticlesDeleted = 0; $f_delete_all_section_translations = $f_delete_all_section_translations == 'Y' ? true : false; $f_delete_all_articles_translations = $f_delete_all_articles_translations == 'Y' ? true : false; if ($f_delete_all_section_translations == false) { $numArticlesDeleted = $sectionObj->delete(true, $f_delete_all_articles_translations); $cacheService = \Zend_Registry::get('container')->getService('newscoop.cache'); $cacheService->clearNamespace('section'); } else { $sectionTranslations = Section::GetSections($f_publication_id, $f_issue_number, null, null, $sectionObj->getName(), null); foreach ($sectionTranslations as $key => $sectionTranslation) { $numArticlesDeleted += $sectionTranslation->delete(true, $f_delete_all_articles_translations); } }
/** * {@inheritdoc} */ protected function getRendererTemplates() { return array($this->section->getGrid()->getName() . ucfirst($this->section->getName()) . ucfirst($this->type) . 'Row', $this->section->getName() . ucfirst($this->type) . 'Row', $this->type . 'Row', 'row'); }
/** * Sets global values for MM_title, MM_typename, and MM_parent * * @param Section $section the Section whose values are to be globalized */ function _globalizeSectionVars(&$section) { if (!isset($GLOBALS['MM_title'])) { $GLOBALS['MM_title'] = $section->getName(); } $GLOBALS['MM_typename'] = $section->getName(); $GLOBALS['MM_parent'] = $section->getParent(); }
require_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/sections/section_common.php"; require_once $GLOBALS['g_campsiteDir'] . '/classes/Article.php'; if (!$g_user->hasPermission('DeleteSection')) { camp_html_display_error(getGS('You do not have the right to delete sections.')); exit; } $f_publication_id = Input::Get('Pub', 'int', 0); $f_issue_number = Input::Get('Issue', 'int', 0); $f_language_id = Input::Get('Language', 'int', 0); $f_section_number = Input::Get('Section', 'int', 0); $numArticles = count(Article::GetArticles($f_publication_id, $f_issue_number, $f_section_number, $f_language_id)); $numSubscriptions = count(Subscription::GetSubscriptions($f_publication_id)); $publicationObj = new Publication($f_publication_id); $issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number); $sectionObj = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_section_number); $sectionTranslations = Section::GetSections($f_publication_id, $f_issue_number, null, null, $sectionObj->getName(), null); $topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj, 'Section' => $sectionObj); camp_html_content_top(getGS('Delete section'), $topArray); ?> <P> <FORM METHOD="POST" ACTION="/<?php echo $ADMIN; ?> /sections/do_del.php"> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box"> <?php echo SecurityToken::FormParameter(); ?> <TR> <TD COLSPAN="2"> <B> <?php
echo htmlspecialchars($issueObj->getName()); ?> (<?php echo htmlspecialchars($issueLanguage->getName()); ?> )</TD> <TD ALIGN="RIGHT" WIDTH="1%" NOWRAP VALIGN="TOP" class="current_location_title"> <?php echo $translator->trans("Section"); ?> :</TD> <TD VALIGN="TOP" class="current_location_content"><?php echo $sectionObj->getSectionNumber(); ?> . <?php echo htmlspecialchars($sectionObj->getName()); ?> </TD> <TD ALIGN="RIGHT" WIDTH="1%" NOWRAP VALIGN="TOP" class="current_location_title"> <?php echo $translator->trans("Article"); ?> :</TD> <TD VALIGN="TOP" class="current_location_content"><?php echo htmlspecialchars($articleObj->getTitle()); ?> (<?php echo htmlspecialchars($articleLanguage->getName()); ?> )</TD> </TR>
p($f_src_publication_id); ?> &Issue=<?php p($f_src_issue_number); ?> &Section=<?php p($f_src_section_number); ?> &Language=<?php p($f_language_id); ?> "><B><?php putGS("Section"); ?> : <?php p(htmlspecialchars($sectionObj->getName())); ?> </B></A></TD> </TR> </TABLE> <P> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" class="table_input" style="padding-top: 10px; padding-bottom: 10px; padding-left: 20px; padding-right: 20px;"> <tr> <td> <table BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER" > <TR> <TD colspan="2" style="font-size: 14pt; padding-top: 10px;"><b><?php putGS("Duplicate Section:"); ?> <?php
$allArticles = Article::GetArticles($f_publication_id, $f_issue_number, $f_section_number, $f_language_selected, $sqlOptions); $numUniqueArticles = $totalArticles; $numUniqueArticlesDisplayed = count($allArticles); } else { // Show articles in all languages. $totalArticles = Article::GetArticles($f_publication_id, $f_issue_number, $f_section_number, null, null, true); $allArticles = Article::GetArticlesGrouped($f_publication_id, $f_issue_number, $f_section_number, null, $f_language_id, $sqlOptions); $numUniqueArticles = Article::GetArticlesGrouped($f_publication_id, $f_issue_number, $f_section_number, null, null, null, true); $numUniqueArticlesDisplayed = count(array_unique(DbObjectArray::GetColumn($allArticles, 'Number'))); } $numArticlesThisPage = count($allArticles); $previousArticleNumber = 0; $pagerUrl = "index.php?f_publication_id=" . $f_publication_id . "&f_issue_number=" . $f_issue_number . "&f_section_number=" . $f_section_number . "&f_language_id=" . $f_language_id . "&f_language_selected=" . $f_language_selected . "&"; $pager = new SimplePager($numUniqueArticles, $ArticlesPerPage, $offsetVarName, $pagerUrl); $topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj, 'Section' => $sectionObj); camp_html_content_top(getGS('Article List') . ': ' . $this->view->escape($sectionObj->getName()), $topArray); ?> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons" style="padding-top: 5px;"> <TR> <TD><A HREF="/<?php echo $ADMIN; ?> /sections/?Pub=<?php p($f_publication_id); ?> &Issue=<?php p($f_issue_number); ?> &Language=<?php p($f_language_id); ?>
function _checkNewSection($data, $fieldname) { if (!(isset($data['new_section_name']) && $data['new_section_name'])) { if (!isset($data[$fieldname])) { return false; } return $data[$fieldname]; } require_once 'AMP/Content/Section.inc.php'; $section = new Section(AMP_Registry::getDbcon()); $section->setDefaults(); $section->setName($data['new_section_name']); $section->setParent($data['new_section_parent']); if (!($result = $section->save())) { return $data[$fieldname]; } $section->publish(); $flash =& AMP_System_Flash::instance(); $flash->add_message(sprintf(AMP_TEXT_DATA_SAVE_SUCCESS, $section->getName())); return $section->id; }
} if (!$g_user->hasPermission("TranslateArticle")) { $errorStr = getGS('You do not have the right to translate articles.'); camp_html_display_error($errorStr, $BackLink); exit; } // When the user selects a language the form is submitted to the same page (translation.php). // Read article translation form input values for the case when the page has been reloaded // because of language select. $f_translation_title = Input::Get('f_translation_title', 'string', '', true); $f_language_selected = Input::Get('f_translation_language', 'int', 0, true); $f_translation_language = Input::Get('f_translation_language', 'int', 0, true); if ($f_publication_id > 0) { $f_translation_issue_name = Input::Get('f_issue_name', 'string', $issueObj->getName(), true); $f_translation_issue_urlname = Input::Get('f_issue_urlname', 'string', $issueObj->getUrlName(), true); $f_translation_section_name = Input::Get('f_section_name', 'string', $sectionObj->getName(), true); $f_translation_section_urlname = Input::Get('f_section_urlname', 'string', $sectionObj->getUrlName(), true); } $allLanguages = Language::GetLanguages(null, null, null, array(), array(array('field' => 'byname', 'dir' => 'asc')), true); $articleLanguages = $articleObj->getLanguages(); $articleLanguages = DbObjectArray::GetColumn($articleLanguages, "Id"); if ($f_language_selected > 0 && $f_issue_number > 0) { $translationIssueObj = new Issue($f_publication_id, $f_language_selected, $f_issue_number); $translationSectionObj = new Section($f_publication_id, $f_issue_number, $f_language_selected, $f_section_number); } if ($f_publication_id > 0) { $topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj, 'Section' => $sectionObj, 'Article' => $articleObj); camp_html_content_top(getGS('Translate article'), $topArray, true, true); } else { $crumbs = array(); $crumbs[] = array(getGS("Actions"), "");
<tr> <td colspan="2"> <b><?php putGS("Configure section"); ?></b> <hr noshade size="1" color="black"> </td> </tr> <tr> <td align="right"><?php putGS("Number"); ?>:</td> <td> <?php p($sectionObj->getSectionNumber()); ?> </td> </tr> <tr> <td align="right"><?php putGS("Name"); ?>:</td> <td> <input type="text" class="input_text" name="cName" size="32" value="<?php p(htmlspecialchars($sectionObj->getName())); ?>" /> </td> </tr> <tr> <td align="right"><?php putGS("URL Name"); ?>:</td> <td> <input type="text" class="input_text" name="cShortName" size="32" value="<?php p(htmlspecialchars($sectionObj->getUrlName())); ?>" /> </td> </tr> <tr> <td align="right"><?php putGS("Subscriptions"); ?>:</td> <td> <select name="cSubs" class="input_select"> <option value="n"> --- </option> <option value="a"><?php putGS("Add section to all subscriptions."); ?></option> <option value="d"><?php putGS("Delete section from all subscriptions."); ?></option>
echo $translator->trans('Section'); ?> : </TD> <TD valign="middle" ALIGN="LEFT"> <?php if ($f_destination_issue_number > 0 && count($allSections) > 1) { ?> <SELECT NAME="f_destination_section_number" class="input_select" ONCHANGE="this.form.submit();"> <OPTION VALUE="0"><?php echo $translator->trans('---Select section---'); ?> </OPTION> <?php $previousSection = camp_array_peek($allSections); foreach ($allSections as $tmpSection) { camp_html_select_option($tmpSection->getSectionNumber(), $f_destination_section_number, $tmpSection->getName()); } ?> </SELECT> <?php } elseif ($f_destination_issue_number > 0 && count($allSections) == 1) { $tmpSection = camp_array_peek($allSections); p(htmlspecialchars($tmpSection->getName())); ?> <input type="hidden" name="f_destination_section_number" value="<?php p($f_destination_section_number); ?> "> <?php } else { ?>
</B> <HR NOSHADE SIZE="1" COLOR="BLACK"> </TD> </TR> <TR> <TD COLSPAN="2"> <BLOCKQUOTE> <?php if (!$correct) { echo "<LI>"; echo $translator->trans('Invalid parameters received'); echo "</LI>\n"; } else { ?> <LI><?php echo $translator->trans('The section $1 could not be duplicated', array('$1' => '<B>' . htmlspecialchars($srcSectionObj->getName()) . '</B>'), 'sections'); ?> </LI> <?php } ?> </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> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box"> <TR> <TD COLSPAN="2"> <B> <?php echo $translator->trans("Duplicating section", array(), 'sections'); ?> </B> <HR NOSHADE SIZE="1" COLOR="BLACK"> </TD> </TR> <TR> <TD COLSPAN="2"> <BLOCKQUOTE> <?php echo $translator->trans('Section $1 has been duplicated to $2. $3 of $4', array('$1' => '<B>' . $srcSectionObj->getName() . '</B>', '$2' => '<B>' . $dstSectionObj->getIssueNumber() . '</B>', '$3' => '<B>' . $dstIssueObj->getName() . ' (' . $dstIssueObj->getLanguageName() . ')</B>', '$4' => '<B>' . $dstPublicationObj->getName() . '</B>'), 'sections'); ?> </BLOCKQUOTE> </TD> </TR> <TR> <TD COLSPAN="2"> <DIV ALIGN="CENTER"> <table> <tr> <td> <b><a href="<?php echo "/{$ADMIN}/sections/edit.php?Pub={$f_dest_publication_id}&Issue={$f_dest_issue_number}&Section={$f_dest_section_number}&Language={$f_language_id}"; ?> "><?php echo $translator->trans("Go to new section", array(), 'sections');
if (!$g_user->hasPermission('DeleteSection')) { camp_html_display_error(getGS('You do not have the right to delete sections.')); exit; } $f_publication_id = Input::Get('Pub', 'int', 0); $f_issue_number = Input::Get('Issue', 'int', 0); $f_language_id = Input::Get('Language', 'int', 0); $f_section_number = Input::Get('Section', 'int', 0); $numArticles = count(Article::GetArticles($f_publication_id, $f_issue_number, $f_section_number, $f_language_id)); $numSubscriptions = count(Subscription::GetSubscriptions($f_publication_id)); $publicationObj = new Publication($f_publication_id); $issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number); $sectionObj = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_section_number); $sectionTranslations = Section::GetSections($f_publication_id, $f_issue_number, null, null, $sectionObj->getName(), null); $topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj, 'Section' => $sectionObj); camp_html_content_top(getGS('Delete section'), $topArray); ?> <P> <FORM METHOD="POST" ACTION="do_del.php"> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box"> <?php echo SecurityToken::FormParameter(); ?> <TR> <TD COLSPAN="2"> <B> <?php putGS("Delete section"); ?> </B> <HR NOSHADE SIZE="1" COLOR="BLACK"> </TD> </TR> <TR>