/** * Create blog article * * @param string $title * @param Section $section * @return Article */ public function createBlog($title, \Section $section) { $article = new \Article($section->getLanguageId()); $article->create($this->config['article_type'], $title, $section->getPublicationId(), $section->getIssueNumber(), $section->getSectionNumber()); return $article; }
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 { ?>
$correct = false; $errors[] = getGS('The section number $1 was already in use.', $f_number); } if ($correct) { $newSection = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_number); $columns = array(); $columns['Description'] = $f_description; $created = $newSection->create($f_name, $f_url_name, $columns); if ($created) { if ($f_add_subscriptions) { $numSubscriptionsAdded = Subscription::AddSectionToAllSubscriptions($f_publication_id, $f_number); if ($numSubscriptionsAdded == -1) { $errors[] = getGS('Error updating subscriptions.'); } } camp_html_goto_page("/$ADMIN/sections/edit.php?Pub=$f_publication_id&Issue=$f_issue_number&Language=$f_language_id&Section=".$newSection->getSectionNumber()); } } $tmpArray = array('Pub' => $publicationObj, 'Issue' => $issueObj); camp_html_content_top(getGS('Adding new section'), $tmpArray); ?> <P> <CENTER> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box" ALIGN="CENTER"> <TR> <TD COLSPAN="2"> <B> <?php putGS("Adding new section"); ?> </B> <HR NOSHADE SIZE="1" COLOR="BLACK"> </TD>
/** * Create blog article * * @param string $title * @param Section $section * @return Article */ public function createBlog($title, \Section $section) { $article = new \Article($section->getLanguageId()); $article->create($this->config['article_type'], $title, $section->getPublicationId(), $section->getIssueNumber(), $section->getSectionNumber()); $qb = $this->em->createQueryBuilder(); $qb->select('atf')->from('\\Newscoop\\Entity\\ArticleTypeField', 'atf')->where("atf.typeHack = ?1 AND atf.name IS NOT NULL AND atf.name = 'NULL'")->setParameter(1, $this->config['article_type']); $articleTypeField = $qb->getQuery()->getOneOrNullResult(); $article->setCommentsEnabled($articleTypeField->getCommentsEnabled()); return $article; }
</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">
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 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());
?> "><b><?php putGS("Section List"); ?> </b></a></td> <td style="padding-left: 20px;"><a href="/<?php echo $ADMIN; ?> /articles/?f_publication_id=<?php p($Pub); ?> &f_issue_number=<?php p($sectionObj->getIssueNumber()); ?> &f_section_number=<?php p($sectionObj->getSectionNumber()); ?> &f_language_id=<?php p($sectionObj->getLanguageId()); ?> "><b><?php putGS("Go To Articles"); ?> </b></a></td> <td><a href="/<?php echo $ADMIN; ?> /articles/?f_publication_id=<?php p($Pub); ?> &f_issue_number=<?php
$languageObj = new Language($Language); if (!is_object($languageObj)) { $languageObj = new Language(1); } //$editorLanguage = camp_session_get('TOL_Language', $languageObj->getCode()); $editorLanguage = !empty($_COOKIE['TOL_Language']) ? $_COOKIE['TOL_Language'] : $languageObj->getCode(); editor_load_tinymce('cDescription', $g_user, 0, $editorLanguage, 'section'); ?> <script type="text/javascript" src="<?php echo $Campsite['WEBSITE_URL']; ?>/js/campsite.js"></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($Pub); ?>&Issue=<?php p($issueObj->getIssueNumber()); ?>&Language=<?php p($issueObj->getLanguageId()); ?>"><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($Pub); ?>&Issue=<?php p($issueObj->getIssueNumber()); ?>&Language=<?php p($issueObj->getLanguageId()); ?>"><b><?php putGS("Section List"); ?></b></a></td> <td style="padding-left: 20px;"><a href="/<?php echo $ADMIN; ?>/articles/?f_publication_id=<?php p($Pub); ?>&f_issue_number=<?php p($sectionObj->getIssueNumber()); ?>&f_section_number=<?php p($sectionObj->getSectionNumber()); ?>&f_language_id=<?php p($sectionObj->getLanguageId()); ?>"><b><?php putGS("Go To Articles"); ?></b></a></td> <td><a href="/<?php echo $ADMIN; ?>/articles/?f_publication_id=<?php p($Pub); ?>&f_issue_number=<?php p($sectionObj->getIssueNumber()); ?>&f_section_number=<?php p($sectionObj->getSectionNumber()); ?>&f_language_id=<?php p($sectionObj->getLanguageId()); ?>"><img src="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/go_to.png" border="0" /></a></td> </tr> </table> <p> <table border="0" cellspacing="0" cellpadding="1" class="action_buttons"> <tr> <td><a href="add.php?<?php p($url_args1); ?>"><img src="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/add.png" border="0" /></a></td> <td><a href="add.php?<?php p($url_args1); ?>"><b><?php putGS("Add new section"); ?></b></a></td> <td style="padding-left: 20px;"><a href="duplicate.php?<?php p($url_args2); ?>"><img src="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/duplicate.png" border="0" /></a></td> <td><a href="duplicate.php?<?php p($url_args2); ?>" ><b><?php putGS("Duplicate"); ?></b></a></td> <td style="padding-left: 20px;"><a href="del.php?<?php p($url_args2); ?>"><img src="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/delete.png" border="0" /></a></td> <td><a href="del.php?<?php p($url_args2); ?>" ><b><?php putGS("Delete"); ?></b></a></td> </tr> </table>
$correct = false; $errors[] = getGS('The section number $1 was already in use.', $f_number); } if ($correct) { $newSection = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_number); $columns = array(); $columns['Description'] = $f_description; $created = $newSection->create($f_name, $f_url_name, $columns); if ($created) { if ($f_add_subscriptions) { $numSubscriptionsAdded = Subscription::AddSectionToAllSubscriptions($f_publication_id, $f_number); if ($numSubscriptionsAdded == -1) { $errors[] = getGS('Error updating subscriptions.'); } } camp_html_goto_page("/{$ADMIN}/sections/edit.php?Pub={$f_publication_id}&Issue={$f_issue_number}&Language={$f_language_id}&Section=" . $newSection->getSectionNumber()); } } $tmpArray = array('Pub' => $publicationObj, 'Issue' => $issueObj); camp_html_content_top(getGS('Adding new section'), $tmpArray); ?> <P> <CENTER> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box" ALIGN="CENTER"> <TR> <TD COLSPAN="2"> <B> <?php putGS("Adding new section"); ?> </B>