camp_html_add_msg(getGS("Article(s) deleted."), "ok"); break; case "toggle_front_page": foreach ($articleCodes as $articleCode) { $articleObj = new Article($articleCode['language_id'], $articleCode['article_id']); if ($articleObj->userCanModify($g_user)) { $articleObj->setOnFrontPage(!$articleObj->onFrontPage()); } } camp_html_add_msg(getGS("\$1 toggled.", """ . getGS("On Front Page") . """), "ok"); break; case "toggle_section_page": foreach ($articleCodes as $articleCode) { $articleObj = new Article($articleCode['language_id'], $articleCode['article_id']); if ($articleObj->userCanModify($g_user)) { $articleObj->setOnSectionPage(!$articleObj->onSectionPage()); } } camp_html_add_msg(getGS("\$1 toggled.", """ . getGS("On Section Page") . """), "ok"); break; case "toggle_comments": foreach ($articleCodes as $articleCode) { $articleObj = new Article($articleCode['language_id'], $articleCode['article_id']); if ($articleObj->userCanModify($g_user)) { $articleObj->setCommentsEnabled(!$articleObj->commentsEnabled()); } } camp_html_add_msg(getGS("\$1 toggled.", """ . getGS("Comments") . """), "ok"); break; case "copy": foreach ($groupedArticleCodes as $articleNumber => $languageArray) {
$item['status'] = $articleObj->getWorkflowDisplayString(); $items[] = $item; } $return['items'] = $items; $return['code'] = 200; return $return; break; } if ($f_target == 'art_ofp') { $value = $f_value == 'Yes' ? true : false; $success = $articleObj->setOnFrontPage($value); $message = $translator->trans("\$1 toggled.", array('$1' => """ . $translator->trans("On Front Page") . """), 'library'); } if ($f_target == 'art_osp') { $value = $f_value == 'Yes' ? true : false; $success = $articleObj->setOnSectionPage($value); $message = $translator->trans("\$1 toggled.", array('$1' => """ . $translator->trans("On Section Page") . """), 'library'); } if ($f_target == 'art_status') { if (in_array($f_value, array('Published', 'Submitted', 'New'))) { switch ($f_value) { case 'New': $f_value = 'N'; break; case 'Published': $f_value = 'Y'; break; case 'Submitted': $f_value = 'S'; break; }
/** * Execute the action, and mark the action as completed. * @return void */ public function doAction() { $publishAction = $this->getPublishAction(); $frontPageAction = $this->getFrontPageAction(); $sectionPageAction = $this->getSectionPageAction(); $article = new Article($this->m_data['fk_language_id'], $this->m_data['fk_article_number']); if ($publishAction == 'P') { $article->setWorkflowStatus('Y'); } if ($publishAction == 'U') { $article->setWorkflowStatus('S'); } if ($frontPageAction == 'S') { $article->setOnFrontPage(true); } if ($frontPageAction == 'R') { $article->setOnFrontPage(false); } if ($sectionPageAction == 'S') { $article->setOnSectionPage(true); } if ($sectionPageAction == 'R') { $article->setOnSectionPage(false); } $this->setCompleted(); } // fn doAction
$author_type = $f_article_author_type[$i]; $authorObj->setType($author_type); // Links the author to the article $articleAuthorObj = new ArticleAuthor($articleObj->getArticleNumber(), $articleObj->getLanguageId(), $authorObj->getId(), $author_type); if (!$articleAuthorObj->exists()) { $articleAuthorObj->create(); } $i++; } } // Update the article. $articleObj->setOnFrontPage(!empty($f_on_front_page)); $articleObj->setOnSectionPage(!empty($f_on_section_page)); $articleObj->setIsPublic(!empty($f_is_public)); $articleObj->setKeywords($f_keywords); $articleObj->setTitle($f_article_title); $articleObj->setIsIndexed(false); if (!empty($f_comment_status)) { if ($f_comment_status == "enabled" || $f_comment_status == "locked") { $commentsEnabled = true; } else { $commentsEnabled = false; } // If status has changed, then you need to show/hide all the comments // as appropriate. if ($articleObj->commentsEnabled() != $commentsEnabled) { $articleObj->setCommentsEnabled($commentsEnabled); $comments = ArticleComment::GetArticleComments($f_article_number, $f_language_selected);