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


PHP Bookmark::is_node_bookmarkedFN方法代码示例

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


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

示例1: class_explode_nodes_iterativeFN

 function class_explode_nodes_iterativeFN($depth, $id_parent, $id_profile, $order, $expand = 1)
 {
     //  this version is intended for  tutor  or author use only
     // returns an array
     $sess_id_course_instance = $_SESSION['sess_id_course_instance'];
     $sess_id_user = $_SESSION['sess_id_user'];
     $sess_id_course = $_SESSION['sess_id_course'];
     $sess_id_course_instance = $_SESSION['sess_id_course_instance'];
     $sess_id_node = $_SESSION['sess_id_node'];
     $id_course = $GLOBALS['id_course'];
     $dh = $GLOBALS['dh'];
     $debug = $GLOBALS['debug'];
     $hide_visits = $GLOBALS['hide_visits'];
     $tot_notes = 0;
     $childnumber = 0;
     $indexAr = array();
     $out_fields_ar = array('nome', 'tipo');
     $clause = "";
     $childrenAr = $dh->find_course_nodes_list($out_fields_ar, $clause, $sess_id_course);
     $childrenAr = masort($childrenAr, 1);
     // il campo 1 �il nome del nodo
     foreach ($childrenAr as $nodeHa) {
         $index_item = "";
         $id_child = $nodeHa[0];
         if (!empty($id_child)) {
             $childnumber++;
             $child_dataHa = $dh->get_node_info($id_child);
             $node_instance = $child_dataHa['instance'];
             $id_node_parent = $child_dataHa['parent_id'];
             $node_keywords = $child_dataHa['title'];
             $parent_dataHa = $dh->get_node_info($id_node_parent);
             if (!AMA_datahandler::isError($parent_dataHa) && $parent_dataHa['type'] >= ADA_STANDARD_EXERCISE_TYPE) {
                 $node_type = 'answer';
             } else {
                 $node_type = $child_dataHa['type'];
             }
             switch ($node_type) {
                 // exercises?
                 case 'answer':
                     break;
                 case ADA_LEAF_TYPE:
                     //node
                     $alt = translateFN("Nodo inferiore");
                     $icon = "_nodo.png";
                     if (!isset($hide_visits) or $hide_visits == 0) {
                         $visit_count = User::is_visited_by_userFN($id_child, $sess_id_course_instance, $sess_id_user);
                     }
                     if (empty($visit_count)) {
                         $index_item = "<img name=\"nodo\" alt=\"{$alt}\" src=\"img/{$icon}\">&nbsp;<b><a href=view.php?id_node=" . $id_child . ">" . $child_dataHa['name'] . "</a></b>\n";
                     } else {
                         $index_item = "<img name=\"nodo\" alt=\"{$alt}\" src=\"img/{$icon}\">&nbsp;<a href=view.php?id_node=" . $id_child . ">" . $child_dataHa['name'] . "</a> ({$visit_count})\n";
                     }
                     // has user bookmarked this node?
                     $id_bk = Bookmark::is_node_bookmarkedFN($sess_id_user, $id_child);
                     if ($id_bk) {
                         $index_item .= "&nbsp;<a href=\"bookmarks.php?op=zoom&id_bk={$id_bk}\"><img name=\"bookmark\" alt=\"bookmark\" src=\"img/check.png\"  border=\"0\"></a>";
                     }
                     break;
                 case ADA_GROUP_TYPE:
                     //group
                     $alt = translateFN("Approfondimento");
                     $icon = "_gruppo.png";
                     if (!isset($hide_visits) or $hide_visits == 0) {
                         $visit_count = User::is_visited_by_userFN($id_child, $sess_id_course_instance, $sess_id_user);
                     }
                     if (empty($visit_count)) {
                         $index_item .= "<img name=\"nodo\" alt={$alt} src=\"img/{$icon}\">&nbsp;<b><a href=view.php?id_node=" . $id_child . ">" . $child_dataHa['name'] . "</a></b>\n";
                     } else {
                         $index_item .= "<img name=\"nodo\" alt={$alt} src=\"img/{$icon}\">&nbsp;<a href=view.php?id_node=" . $id_child . ">" . $child_dataHa['name'] . "</a>({$visit_count})";
                     }
                     // is user visiting this node?
                     if ($id_child == $sess_id_node) {
                         $index_item .= "&nbsp;<img  name=\"attuale\" alt=\"attuale\" src=\"img/_anchor.png\">&nbsp;";
                     }
                     // has user bookmarked this node?
                     $id_bk = Bookmark::is_node_bookmarkedFN($sess_id_user, $id_child);
                     if ($id_bk) {
                         $index_item .= "<a href=\"bookmarks.php?op=zoom&id_bk={$id_bk}\"><img name=\"bookmark\" alt=\"bookmark\" src=\"img/check.png\" border=\"0\"></a>&nbsp;";
                     }
                     break;
                 case ADA_NOTE_TYPE:
                     // note added by users
                 // note added by users
                 case ADA_PRIVATE_NOTE_TYPE:
                     // private note added by users
                     $index_item = "";
                     break;
                 default:
                     // ?
                     $index_item = "";
                     break;
             }
             // end case
         }
         // end if
         if (!empty($index_item)) {
             $indexAr[] = $index_item;
         }
     }
     // end foreach
//.........这里部分代码省略.........
开发者ID:eguicciardi,项目名称:ada,代码行数:101,代码来源:courses_classes.inc.php

示例2: studentCallback

 /**
  * function studentCallback, used to generete an html string for a node
  *
  * @param array $params				- an array of parameters passed to this function from function struct()
  * @param array $external_params	- an array of parameters passed to this function from struct()'s caller
  * @return string
  */
 public static function studentCallback($params = array(), $external_params = array())
 {
     $http_root_dir = $GLOBALS['http_root_dir'];
     $show_visits = !$GLOBALS['hide_visits'];
     $css_classname = self::getClassNameForNodeType($params['node']['tipo']);
     //    /*
     //     * If current node can be viewed by the student, create a link to the node,
     //     * else display only node name.
     //     */
     //    /*
     //     * Display student visits to this node if required.
     //     */
     $list_item = CDOMElement::create('span', "class:{$css_classname}");
     $list_item->addChild(self::getDisclosureElement($params, $external_params));
     //vito 12 gennaio 2009
     //$icon = CDOMElement::create('img', "src:img/{$params['node']['icona']}");
     //$list_item->addChild($icon);
     if (isset($params['node']['livello']) && $external_params['user_level'] >= $params['node']['livello']) {
         preg_match("/^([0-9]+)_/", $params['node']['id_nodo'], $match);
         $id_course = $match[1];
         $node_type_family = $params['node']['tipo'][0];
         if ($node_type_family >= ADA_STANDARD_EXERCISE_TYPE and $node_type_family <= ADA_OPEN_UPLOAD_EXERCISE_TYPE) {
             $node_element = CDOMElement::create('a', "href:{$http_root_dir}/browsing/exercise.php?id_node={$params['node']['id_nodo']}");
         } elseif ($node_type_family == ADA_PERSONAL_EXERCISE_TYPE) {
             $node_element = CDOMElement::create('a', "href:{$http_root_dir}/browsing/exercise_player.php?id_node={$params['node']['id_nodo']}");
         } else {
             $node_element = CDOMElement::create('a', "href:{$http_root_dir}/browsing/view.php?id_node={$params['node']['id_nodo']}&id_course={$id_course}");
         }
         //      $node_element = CDOMElement::create('a', "href:$http_root_dir/browsing/view.php?id_node={$params['node']['id_nodo']}");
         $node_element->addChild(new CText($params['node']['nome']));
         $list_item->addChild($node_element);
     } else {
         $list_item->addChild(new CText($params['node']['nome']));
     }
     if (isset($show_visits) && $show_visits == TRUE) {
         $visits = 0;
         if (isset($params['node']['numero_visite']) && $params['node']['numero_visite'] > 0) {
             $visits = $params['node']['numero_visite'];
         }
         $list_item->addChild(new CText(translateFN("Visite") . " {$visits}"));
     }
     $id_bk = Bookmark::is_node_bookmarkedFN($external_params['user_id'], $params['node']['id_nodo']);
     if ($id_bk) {
         // vito 13 gennaio 2009
         //  $link = CDOMElement::create('a', "href: bookmarks.php?op=zoom&id_bk=$id_bk");
         $link = CDOMElement::create('a', "href: tags.php?op=zoom&id_bk={$id_bk}");
         $icon = CDOMElement::create('img', 'name:bookmark, alt:bookmark, src:img/check.png, border:0');
         $link->addChild($icon);
         $list_item->addChild($link);
     }
     if (isset($params['node']['is_someone_there']) && $params['node']['is_someone_there'] >= 1) {
         $icon = CDOMElement::create('img', 'src:img/_student.png');
         $icon->setAttribute('name', translateFN('altri'));
         $icon->setAttribute('alt', translateFN('altri'));
         $list_item->addChild($icon);
     }
     return $list_item;
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:65,代码来源:CourseViewer.inc.php


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