当前位置: 首页>>代码示例>>PHP>>正文


PHP Publication::commentsArticleDefaultEnabled方法代码示例

本文整理汇总了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);
     }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:31,代码来源:duplicate.php

示例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.");
}
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:do_add.php


注:本文中的Publication::commentsArticleDefaultEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。