本文整理汇总了PHP中Skill::get_all方法的典型用法代码示例。如果您正苦于以下问题:PHP Skill::get_all方法的具体用法?PHP Skill::get_all怎么用?PHP Skill::get_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skill
的用法示例。
在下文中一共展示了Skill::get_all方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$interbreadcrumb[] = array('url' => Container::getRouter()->generate('administration'), "name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'skill_list.php', 'name' => get_lang('ManageSkills'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('CreateSkill'));
/* Process data */
$skillParentId = isset($_GET['parent']) ? intval($_GET['parent']) : 0;
$formDefaultValues = [];
$objSkill = new Skill();
$objGradebook = new Gradebook();
if ($skillParentId > 0) {
$skillParentInfo = $objSkill->get_skill_info($skillParentId);
$formDefaultValues = ['parent_id' => $skillParentInfo['id'], 'gradebook_id' => []];
foreach ($skillParentInfo['gradebooks'] as $gradebook) {
$formDefaultValues['gradebook_id'][] = intval($gradebook['id']);
}
}
$allSkills = $objSkill->get_all();
$allGradebooks = $objGradebook->find('all');
$skillList = [0 => get_lang('None')];
$gradebookList = [];
foreach ($allSkills as $skill) {
$skillList[$skill['id']] = $skill['name'];
}
foreach ($allGradebooks as $gradebook) {
$gradebookList[$gradebook['id']] = $gradebook['name'];
}
/* Form */
$createForm = new FormValidator('skill_create');
$createForm->addHeader(get_lang('CreateSkill'));
$createForm->addText('name', get_lang('Name'), true, ['id' => 'name']);
$createForm->addText('short_code', get_lang('ShortCode'), false, ['id' => 'short_code']);
$createForm->addSelect('parent_id', get_lang('Parent'), $skillList, ['id' => 'parent_id']);
示例2: SkillRelProfile
$skill_rel_profile = new SkillRelProfile();
$profile_id = isset($_REQUEST['profile_id']) ? $_REQUEST['profile_id'] : null;
$skills = $skill_rel_profile->get_skills_by_profile($profile_id);
echo json_encode($skills);
break;
case 'get_saved_profiles':
$skill_profile = new SkillProfile();
$profiles = $skill_profile->get_all();
Display::display_no_header();
Display::$global_template->assign('profiles', $profiles);
echo Display::$global_template->fetch('default/skill/profile_item.tpl');
break;
case 'get_skills':
$load_user_data = isset($_REQUEST['load_user_data']) ? $_REQUEST['load_user_data'] : null;
$id = intval($_REQUEST['id']);
$skills = $skill->get_all($load_user_data, false, $id);
echo json_encode($skills);
break;
case 'get_skill_info':
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
$skill_info = $skill->get_skill_info($id);
echo json_encode($skill_info);
break;
case 'get_skill_course_info':
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
$skill_info = $skill->get_skill_info($id);
$courses = $skill->get_courses_by_skill($id);
$sessions = $skill->getSessionsBySkill($id);
$html = '';
if (!empty($courses) || !empty($sessions)) {
Display::display_no_header();
示例3: show_skill_form
/**
* Returns a Form validator Obj
* @todo the form should be auto generated
* @param string url
* @param string action add, edit
* @return obj form validator obj
*/
public function show_skill_form($gradebook_id, $url, $header = null)
{
$form = new FormValidator('gradebook_add_skill', 'POST', $url);
// Setting the form elements
if (!isset($header)) {
$header = get_lang('Add');
}
$form->addElement('header', '', $header);
$id = isset($_GET['id']) ? intval($_GET['id']) : '';
$form->addElement('hidden', 'id', $id);
$skill = new Skill();
$skills = $skill->get_all();
$clean_skill_list = array();
foreach ($skills as $skill) {
$clean_skill_list[$skill['id']] = $skill['name'];
}
$form->addElement('select', 'skill', get_lang('Skills'), $clean_skill_list, array('multiple' => 'multiple'));
$selected_skills = self::get_skills_by_gradebook($gradebook_id);
$clean_selected_skills = array();
if (!empty($selected_skills)) {
foreach ($selected_skills as $skill) {
$clean_selected_skills[] = $skill['id'];
}
}
$form->addButtonCreate(get_lang('Add'), 'submit');
$form->setDefaults(array('skill' => $clean_selected_skills));
return $form;
}
示例4: header
$skill->setUpdatedAt($updatedAt);
$entityManager->persist($skill);
}
$entityManager->flush();
Display::addFlash(Display::return_message(sprintf(get_lang('SkillXDisabled'), $skill->getName()), 'success'));
}
header('Location: ' . api_get_self());
exit;
break;
case 'list':
//no break
//no break
default:
$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
$message = Session::has('message') ? Session::read('message') : null;
$toolbar = Display::toolbarButton(get_lang('CreateSkill'), api_get_path(WEB_CODE_PATH) . 'admin/skill_create.php', 'plus', 'success', ['title' => get_lang('CreateSkill')]);
$toolbar .= Display::toolbarButton(get_lang('SkillsWheel'), api_get_path(WEB_CODE_PATH) . 'admin/skills_wheel.php', 'bullseye', 'primary', ['title' => get_lang('CreateSkill')]);
$toolbar .= Display::toolbarButton(get_lang('BadgesManagement'), api_get_path(WEB_CODE_PATH) . 'admin/skill_badge_list.php', 'shield', 'warning', ['title' => get_lang('BadgesManagement')]);
/* View */
$skill = new Skill();
$skillList = $skill->get_all();
$tpl = new Template(get_lang('ManageSkills'));
$tpl->assign('message', $message);
$tpl->assign('skills', $skillList);
$content = $tpl->fetch('default/skill/list.tpl');
$tpl->assign('actions', $toolbar);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
Session::erase('message');
break;
}
示例5: Template
$htmlHeadXtra[] = api_get_js('d3/d3.v2.min.js');
$htmlHeadXtra[] = api_get_js('d3/colorbrewer.js');
$htmlHeadXtra[] = api_get_js('d3/jquery.xcolor.js');
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/jquery.fcbkcomplete.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<link href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/style.css" rel="stylesheet" type="text/css" />';
$tpl = new Template(null, false, false);
$load_user = api_get_user_id();
$userInfo = api_get_user_info();
$skill = new Skill();
$ranking = $skill->get_user_skill_ranking($load_user);
$countSkill = count($skill->get_all());
$skill_condition = '';
if (isset($_GET['skill_id'])) {
$skill_condition = '&skill_id='.intval($_GET['skill_id']);
$tpl->assign('skill_id_to_load', $_GET['skill_id']);
}
$url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user";
$tpl->assign('wheel_url', $url);
$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
$tpl->assign('url', $url);
$tpl->assign('userInfo', $userInfo);