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


PHP cm_info::get_custom_data方法代码示例

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


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

示例1: resource_cm_info_view

/**
 * Called when viewing course page. Shows extra details after the link if
 * enabled.
 *
 * @param cm_info $cm Course module information
 */
function resource_cm_info_view(cm_info $cm) {
    $details = $cm->get_custom_data();
    if ($details) {
        $cm->set_after_link(' ' . html_writer::tag('span', $details,
                array('class' => 'resourcelinkdetails')));
    }
}
开发者ID:nutanrajmalanai,项目名称:moodle,代码行数:13,代码来源:lib.php

示例2: folder_cm_info_view

/**
 * Overwrites the content in the course-module object with the folder files list
 * if folder.display == FOLDER_DISPLAY_INLINE
 *
 * @param cm_info $cm
 */
function folder_cm_info_view(cm_info $cm)
{
    global $PAGE;
    if ($cm->uservisible && $cm->get_custom_data() && has_capability('mod/folder:view', $cm->context)) {
        // Restore folder object from customdata.
        // Note the field 'customdata' is not empty IF AND ONLY IF we display contens inline.
        // Otherwise the content is default.
        $folder = $cm->get_custom_data();
        $folder->id = (int) $cm->instance;
        $folder->course = (int) $cm->course;
        $folder->display = FOLDER_DISPLAY_INLINE;
        $folder->name = $cm->name;
        if (empty($folder->intro)) {
            $folder->intro = '';
        }
        if (empty($folder->introformat)) {
            $folder->introformat = FORMAT_MOODLE;
        }
        // display folder
        $renderer = $PAGE->get_renderer('mod_folder');
        $cm->set_content($renderer->display_folder($folder));
    }
}
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:29,代码来源:lib.php

示例3: get_type_from_modinfo_info

 /**
  * Obtains the forum type based on its 'info' object in modinfo (e.g. from
  * $modinfo->instances['forumng'][1234]). Usually this comes from the
  * custom data in the cm_info object.
  *
  * @param object $info Info object (either cm_info or something else)
  * @return string Forum type
  */
 private static function get_type_from_modinfo_info(cm_info $info)
 {
     if (isset($info->forumtype)) {
         // Only set when using get_modinfo_special for shared activity modules.
         return $info->forumtype;
     }
     return $info->get_custom_data()->type;
 }
开发者ID:nadavkav,项目名称:Moodle2-Hebrew-plugins,代码行数:16,代码来源:mod_forumng.php


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