本文整理汇总了PHP中Annotation::get_topic_respond_coll方法的典型用法代码示例。如果您正苦于以下问题:PHP Annotation::get_topic_respond_coll方法的具体用法?PHP Annotation::get_topic_respond_coll怎么用?PHP Annotation::get_topic_respond_coll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Annotation
的用法示例。
在下文中一共展示了Annotation::get_topic_respond_coll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: annotation_thread
//.........这里部分代码省略.........
$type_name = $type_show;
}
// css-type
switch ($css_type) {
case 1:
$css_type = 'importance';
break;
case 2:
$css_type = 'concept';
break;
case 3:
$css_type = 'confusion';
break;
case 4:
$css_type = 'question';
break;
case 5:
$css_type = 'example';
break;
case 6:
$css_type = 'summary';
break;
case 7:
$css_type = 'other';
break;
case 8:
$css_type = 'custom';
break;
default:
$css_type = 'importance';
break;
}
// annotation_respones
$respond_collection = $annotation->get_topic_respond_coll();
$respond_json = array();
foreach ($respond_collection as $respond_annotation) {
$json = array();
$json["annotation_id"] = $respond_annotation->get_id();
$json["user"] = $respond_annotation->get_user()->get_name();
$css_res_type = $respond_annotation->get_type()->get_type_id();
$res_type = $respond_annotation->get_type()->get_name();
if ($res_type != 'annotation.type.custom') {
$res_type_show = $this->lang->line("web_apps." . $res_type);
$res_type = $res_type_show;
} else {
$res_type_show = $this->lang->line("web_apps." . 'annotation.type.other');
$res_type = $res_type_show;
}
switch ($css_res_type) {
case 1:
$css_res_type = 'importance';
break;
case 2:
$css_res_type = 'concept';
break;
case 3:
$css_res_type = 'confusion';
break;
case 4:
$css_res_type = 'question';
break;
case 5:
$css_res_type = 'example';
break;
case 6:
$css_res_type = 'summary';
示例2: _get_respond_annotations
/**
* 取得標註的回覆
* @param Annotation $topic_annotation
*/
private function _get_respond_annotations($topic_annotation)
{
// annotation_respones
$respond_collection = $topic_annotation->get_topic_respond_coll();
$respond_json = array();
$login_user_id = get_context_user_id();
foreach ($respond_collection as $respond_annotation) {
$json = array();
$json["annotation_id"] = $respond_annotation->get_id();
$annotation_user = $respond_annotation->get_user();
$json["user_name"] = $annotation_user->get_name();
$json["is_my"] = FALSE;
//test_msg("res", array($annotation_user->get_id(), $login_user_id, $annotation_user->get_id() === $login_user_id));
if (isset($login_user_id) && $annotation_user->get_id() === $login_user_id) {
$json["is_my"] = TRUE;
}
//$css_res_type = $respond_annotation->get_type()->get_type_id();
/*
$res_type = $respond_annotation->get_type()->get_name();
if ($res_type != 'annotation.type.custom'){
$res_type_show = $this->lang->line("web_apps.". $res_type);
$res_type = $res_type_show;
}
else {
$res_type_show = $this->lang->line("web_apps." . 'annotation.type.other');
$res_type = $res_type_show;
}
switch ($css_res_type) {
case 1:
$css_res_type = 'importance';
break;
case 2:
$css_res_type = 'concept';
break;
case 3:
$css_res_type = 'confusion';
break;
case 4:
$css_res_type = 'question';
break;
case 5:
$css_res_type = 'example';
break;
case 6:
$css_res_type = 'summary';
break;
case 7:
$css_res_type = 'other';
break;
case 8:
$css_res_type = 'custom';
break;
default:
$css_res_type = 'importance';
break;
}
$json["css_type"] = $css_res_type;
$json["type"] = $res_type;
*/
$annotation_type = $respond_annotation->get_type();
$json["type_classname"] = $annotation_type->get_classname();
$json["type_name_lang"] = $this->_get_type_name_lang($annotation_type);
$json["note"] = $respond_annotation->get_note();
$sub_res_timestamp = $respond_annotation->get_update_timestamp();
$json["timestamp"] = $this->_convert_timestamp_to_date($sub_res_timestamp);
$respond_json[] = $json;
}
//$respond_json[0]['user'];
return $respond_json;
}
示例3: _print_respond
/**
* @param Annotation $annotation
*/
private function _print_respond($annotation)
{
$topic_respond_coll = $annotation->get_topic_respond_coll();
$text = '';
foreach ($topic_respond_coll as $respond_annotation) {
$text .= $this->_print_respond_annotation_table($respond_annotation);
}
return $text;
}