本文整理汇总了PHP中Publication::commentsArticleDefaultEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP Publication::commentsArticleDefaultEnabled方法的具体用法?PHP Publication::commentsArticleDefaultEnabled怎么用?PHP Publication::commentsArticleDefaultEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Publication
的用法示例。
在下文中一共展示了Publication::commentsArticleDefaultEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
if (!isset($articles[$articleNumber][$tmpLanguageId])) {
continue;
}
// Grab the first article - it doesnt matter which one.
$tmpArticle = $articles[$articleNumber][$tmpLanguageId];
// Copy all the translations requested.
$newArticles = $tmpArticle->copy($f_destination_publication_id, $f_destination_issue_number, $f_destination_section_number, $g_user->getUserId(), $languageArray);
// Set properties for each new copy.
foreach ($newArticles as $newArticle) {
// Set the name of the new copy
$newArticle->setTitle($articleNames[$articleNumber][$newArticle->getLanguageId()]);
// Set the default "comment enabled" status based
// on the publication config settings.
if ($f_destination_publication_id > 0) {
$tmpPub = new Publication($f_destination_publication_id);
$commentDefault = $tmpPub->commentsArticleDefaultEnabled();
$newArticle->setCommentsEnabled($commentDefault);
}
foreach ($events as $event) {
//$repo->add($timeSet, $articleId, 'schedule');
$newEvent = $ArticleDatetimeRepository->getEmpty();
$newEvent->setArticleId($newArticle->getArticleNumber());
$newEvent->setArticleType($event->getArticleType());
$newEvent->setStartDate($event->getStartDate());
$newEvent->setStartTime($event->getStartTime());
$newEvent->setEndDate($event->getEndDate());
$newEvent->setEndTime($event->getEndTime());
$newEvent->setRecurring($event->getRecurring());
$newEvent->setFieldName($event->getFieldName());
$em->persist($newEvent);
}
示例2: Author
} else {
$articleObj->create($f_article_type, $f_article_name, $publication_id, $issue_number, $section_number);
}
if ($articleObj->exists()) {
$author = $this->_helper->service('user')->getCurrentUser()->getAuthorId();
if (empty($author)) {
$articleObj->setCreatorId($g_user->getUserId());
$authorObj = new Author($g_user->getRealName());
if (!$authorObj->exists()) {
$authorData = Author::ReadName($g_user->getRealName());
$authorData['email'] = $g_user->getEmail();
$authorObj->create($authorData);
}
} else {
$authorObj = new Author($author);
}
if ($authorObj->exists()) {
$articleObj->setAuthor($authorObj);
}
$articleObj->setIsPublic(true);
if ($publication_id > 0) {
$commentDefault = $publicationObj->commentsArticleDefaultEnabled();
$articleObj->setCommentsEnabled($commentDefault);
}
camp_html_add_msg(getGS("Article created."), "ok");
camp_html_goto_page(camp_html_article_url($articleObj, $f_language_id, "edit.php"), false);
ArticleIndex::RunIndexer(3, 10, true);
exit;
} else {
camp_html_display_error("Could not create article.");
}