本文整理汇总了PHP中core_competency\api::list_user_plans方法的典型用法代码示例。如果您正苦于以下问题:PHP api::list_user_plans方法的具体用法?PHP api::list_user_plans怎么用?PHP api::list_user_plans使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core_competency\api
的用法示例。
在下文中一共展示了api::list_user_plans方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Construct this renderable.
*
* @param int $userid
*/
public function __construct($userid)
{
$this->userid = $userid;
$this->plans = api::list_user_plans($userid);
$this->context = context_user::instance($userid);
if (plan::can_manage_user($userid) || plan::can_manage_user_draft($userid)) {
$addplan = new single_button(new moodle_url('/admin/tool/lp/editplan.php', array('userid' => $userid)), get_string('addnewplan', 'tool_lp'), 'get');
$this->navigation[] = $addplan;
}
}
示例2: __construct
/**
* Constructor.
* @param stdClass $user The user.
*/
public function __construct($user = null)
{
global $USER;
if (!$user) {
$user = $USER;
}
$this->user = $user;
// Get the plans.
$this->plans = api::list_user_plans($this->user->id);
// Get the competencies to review.
$this->compstoreview = api::list_user_competencies_to_review(0, 3);
// Get the plans to review.
$this->planstoreview = api::list_plans_to_review(0, 3);
}
示例3: list_user_plans
/**
* External function list_user_plans.
*
* @param int $userid The user ID.
* @return boolean
*/
public static function list_user_plans($userid)
{
global $PAGE;
$params = self::validate_parameters(self::list_user_plans_parameters(), array('userid' => $userid));
$context = context_user::instance($params['userid']);
self::validate_context($context);
$output = $PAGE->get_renderer('core');
$response = array();
$plans = api::list_user_plans($params['userid']);
foreach ($plans as $plan) {
$exporter = new plan_exporter($plan, array('template' => $plan->get_template()));
$response[] = $exporter->export($output);
}
return $response;
}