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


PHP comment::set_fullwidth方法代码示例

本文整理汇总了PHP中comment::set_fullwidth方法的典型用法代码示例。如果您正苦于以下问题:PHP comment::set_fullwidth方法的具体用法?PHP comment::set_fullwidth怎么用?PHP comment::set_fullwidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在comment的用法示例。


在下文中一共展示了comment::set_fullwidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: stdClass

 function get_content()
 {
     global $CFG, $PAGE;
     if ($this->content !== NULL) {
         return $this->content;
     }
     if (!$CFG->usecomments) {
         $this->content = new stdClass();
         $this->content->text = '';
         if ($this->page->user_is_editing()) {
             $this->content->text = get_string('disabledcomments');
         }
         return $this->content;
     }
     $this->content = new stdClass();
     $this->content->footer = '';
     $this->content->text = '';
     if (empty($this->instance)) {
         return $this->content;
     }
     list($context, $course, $cm) = get_context_info_array($PAGE->context->id);
     $args = new stdClass();
     $args->context = $PAGE->context;
     $args->course = $course;
     $args->area = 'page_comments';
     $args->itemid = 0;
     $args->component = 'block_comments';
     $args->linktext = get_string('showcomments');
     $args->notoggle = true;
     $args->autostart = true;
     $args->displaycancel = false;
     $comment = new comment($args);
     $comment->set_view_permission(true);
     $comment->set_fullwidth();
     $this->content = new stdClass();
     $this->content->text = $comment->output(true);
     $this->content->footer = '';
     return $this->content;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:39,代码来源:block_comments.php

示例2: render_resources_comments_ratings

/**
 * 
 * 
 * 
 * 
 */
function render_resources_comments_ratings($course, $modules, $modinfo, $section, $page_context)
{
    global $USER, $OUTPUT;
    foreach ($modules as $module) {
        $cm = $modinfo->get_cm($module->id);
        //Avoid comments and ratings for default 'News forum'
        if ($module->section == $section->id && $cm->name != 'News forum') {
            $url = new moodle_url('/mod/resource/view.php?id=' . $module->id);
            echo html_writer::link($url, $cm->name);
            //            echo $cm->name . '<br>';
            $args = new stdClass();
            $args->context = $page_context;
            $args->course = $course;
            $args->area = 'resource';
            $args->itemid = $module->id;
            $args->component = 'block_comments_and_ratings';
            $args->showcount = true;
            $comment = new comment($args);
            $comment->set_fullwidth();
            $comment->output(false);
            echo '<hr>';
            //            $ratingargs = new stdClass;
            //            $ratingargs->context = $page_context;
            //            $ratingargs->component = 'block_comments_and_ratings';
            //            $ratingargs->ratingarea = 'resource';
            //            $ratingargs->items = $modules;
            //            $ratingargs->userid = $USER->id;
            //            $ratingargs->scaleid = 1;
            //            $ratingargs->aggregate = $cm->name;
            //            $rm = new rating_manager();
            //            $modules = $rm->get_ratings($ratingargs);
            //
            //            $output .= $OUTPUT->render($module->rating);
        }
    }
}
开发者ID:Chevijan,项目名称:moodle-plugin,代码行数:42,代码来源:locallib.php


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