public function show() { Util::get_js(Get::rel_path('lms') . '/views/kb/kb.js', true, true); Util::get_js(Get::rel_path('base') . '/addons/yui/stylesheet/stylesheet-min.js', true, true); $filter_text = Get::req('filter_text', DOTY_STRING, ""); require_once _lms_ . '/lib/lib.kbres.php'; $kbres = new KbRes(); $kb_model = new KbAlms(); $initial_folders = $kbres->getKbFolders(0, 1); // 0 = root $tag_count = $kbres->getTagUseCount(); // --- set tag cloud data ------------ $min = false; $max = false; $tot = 0; $tag_cloud = array(); foreach ($tag_count as $tag_id => $tag_info) { $tot += $tag_info['use_count']; $min = $min > $tag_info['use_count'] ? $tag_info['use_count'] : $min; $max = $max < $tag_info['use_count'] ? $tag_info['use_count'] : $max; } $min_class_size = 1; $max_class_size = 7; foreach ($tag_count as $tag_id => $tag_info) { $uc = $tag_info['use_count']; $range = $max - $min + 1; $pos = $range / $uc; $class_size = round($max_class_size / $pos); $tag_cloud[$tag_id] = array('tag_name' => $tag_info['tag_name'], 'class_size' => $class_size); } $course_filter_arr[-1] = Lang::t('_FILTER', 'kb'); $course_filter_arr += $kb_model->getCoursesVisibleToUser(); $this->render('show', array('filter_text' => $filter_text, 'initial_folders' => $initial_folders, 'tag_cloud' => $tag_cloud, 'course_filter_arr' => $course_filter_arr, 'url_select_folder' => 'ajax.server.php?r=kb/selFolder&folder_id=')); }