public function getFolderParents($node_id) { $kb_model = new KbAlms(); return $kb_model->getFolderParents($node_id); }
public function play() { require_once _lms_ . '/lib/lib.kbres.php'; $kbres = new KbRes(); $kb_model = new KbAlms(); $from_adm = Get::req('from_adm', DOTY_INT, 0); $back_url = $from_adm ? Get::rel_path('adm') . '/index.php?r=alms/kb/show' : 'index.php?r=kb/show'; $res_id = Get::req('id', DOTY_INT, 0); if ($kb_model->checkResourcePerm($res_id)) { $kbres->playResource($res_id, $back_url); } else { echo "You can't access"; } }
public function KbSearch($id_user, $params) { require_once _lms_ . '/lib/lib.course.php'; $output = array(); $output['success'] = true; $filter_text = !empty($params['search']) ? $params['search'] : ""; $course_filter = !empty($params['course_filter']) ? (int) $params['course_filter'] : -1; $start_index = !empty($params['start_index']) ? (int) $params['start_index'] : false; $results = !empty($params['results']) ? (int) $params['results'] : false; //TODO: call getSearchFilter() $kb_model = new KbAlms(); $sf = $kb_model->getSearchFilter($id_user, $filter_text, $course_filter); $res_arr = $kb_model->getResources(0, $start_index, $results, false, false, $sf['where'], $sf['search'], false, true, $sf['show_what']); foreach ($res_arr["data"] as $key => $content_info) { $output[]['content_info'] = $content_info; } return $output; }