本文整理匯總了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;
}