id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
218,700 | moodle/moodle | competency/classes/external.php | external.count_templates | public static function count_templates($context, $includes) {
$params = self::validate_parameters(self::count_templates_parameters(), array(
'context' => $context,
'includes' => $includes
));
$context = self::get_context_from_params($params['context']);
self::vali... | php | public static function count_templates($context, $includes) {
$params = self::validate_parameters(self::count_templates_parameters(), array(
'context' => $context,
'includes' => $includes
));
$context = self::get_context_from_params($params['context']);
self::vali... | [
"public",
"static",
"function",
"count_templates",
"(",
"$",
"context",
",",
"$",
"includes",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"count_templates_parameters",
"(",
")",
",",
"array",
"(",
"'context'",
"=>",
... | Count the existing learning plan templates
@param array $context
@param string $includes
@return int | [
"Count",
"the",
"existing",
"learning",
"plan",
"templates"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L1954-L1963 |
218,701 | moodle/moodle | competency/classes/external.php | external.add_competency_to_plan | public static function add_competency_to_plan($planid, $competencyid) {
$params = self::validate_parameters(self::add_competency_to_plan_parameters(), array(
'planid' => $planid,
'competencyid' => $competencyid,
));
$plan = api::read_plan($params['planid']);
self... | php | public static function add_competency_to_plan($planid, $competencyid) {
$params = self::validate_parameters(self::add_competency_to_plan_parameters(), array(
'planid' => $planid,
'competencyid' => $competencyid,
));
$plan = api::read_plan($params['planid']);
self... | [
"public",
"static",
"function",
"add_competency_to_plan",
"(",
"$",
"planid",
",",
"$",
"competencyid",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"add_competency_to_plan_parameters",
"(",
")",
",",
"array",
"(",
"'plan... | add competency to a learning plan.
@param int $planid Plan id.
@param int $competencyid Competency id.
@return int | [
"add",
"competency",
"to",
"a",
"learning",
"plan",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2252-L2262 |
218,702 | moodle/moodle | competency/classes/external.php | external.remove_competency_from_plan | public static function remove_competency_from_plan($planid, $competencyid) {
$params = self::validate_parameters(self::remove_competency_from_plan_parameters(), array(
'planid' => $planid,
'competencyid' => $competencyid,
));
$plan = api::read_plan($params['planid']);
... | php | public static function remove_competency_from_plan($planid, $competencyid) {
$params = self::validate_parameters(self::remove_competency_from_plan_parameters(), array(
'planid' => $planid,
'competencyid' => $competencyid,
));
$plan = api::read_plan($params['planid']);
... | [
"public",
"static",
"function",
"remove_competency_from_plan",
"(",
"$",
"planid",
",",
"$",
"competencyid",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"remove_competency_from_plan_parameters",
"(",
")",
",",
"array",
"("... | Remove a competency from plan.
@param int $planid Plan id.
@param int $competencyid Competency id.
@return int | [
"Remove",
"a",
"competency",
"from",
"plan",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2303-L2312 |
218,703 | moodle/moodle | competency/classes/external.php | external.reorder_plan_competency | public static function reorder_plan_competency($planid, $competencyidfrom, $competencyidto) {
$params = self::validate_parameters(self::reorder_plan_competency_parameters(), array(
'planid' => $planid,
'competencyidfrom' => $competencyidfrom,
'competencyidto' => $competencyid... | php | public static function reorder_plan_competency($planid, $competencyidfrom, $competencyidto) {
$params = self::validate_parameters(self::reorder_plan_competency_parameters(), array(
'planid' => $planid,
'competencyidfrom' => $competencyidfrom,
'competencyidto' => $competencyid... | [
"public",
"static",
"function",
"reorder_plan_competency",
"(",
"$",
"planid",
",",
"$",
"competencyidfrom",
",",
"$",
"competencyidto",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"reorder_plan_competency_parameters",
"(",
... | Change the order of plan competencies.
@param int $planid The plan id
@param int $competencyidfrom The competency to move.
@param int $competencyidto The competency to move to.
@return bool | [
"Change",
"the",
"order",
"of",
"plan",
"competencies",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2383-L2394 |
218,704 | moodle/moodle | competency/classes/external.php | external.user_competency_cancel_review_request | public static function user_competency_cancel_review_request($userid, $competencyid) {
$params = self::validate_parameters(self::user_competency_cancel_review_request_parameters(), array(
'userid' => $userid,
'competencyid' => $competencyid
));
$context = context_user::i... | php | public static function user_competency_cancel_review_request($userid, $competencyid) {
$params = self::validate_parameters(self::user_competency_cancel_review_request_parameters(), array(
'userid' => $userid,
'competencyid' => $competencyid
));
$context = context_user::i... | [
"public",
"static",
"function",
"user_competency_cancel_review_request",
"(",
"$",
"userid",
",",
"$",
"competencyid",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"user_competency_cancel_review_request_parameters",
"(",
")",
"... | External function user_competency_cancel_review_request.
@param int $userid The user ID.
@param int $competencyid The competency ID.
@return boolean | [
"External",
"function",
"user_competency_cancel_review_request",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2424-L2434 |
218,705 | moodle/moodle | competency/classes/external.php | external.user_competency_request_review | public static function user_competency_request_review($userid, $competencyid) {
$params = self::validate_parameters(self::user_competency_request_review_parameters(), array(
'userid' => $userid,
'competencyid' => $competencyid,
));
$context = context_user::instance($para... | php | public static function user_competency_request_review($userid, $competencyid) {
$params = self::validate_parameters(self::user_competency_request_review_parameters(), array(
'userid' => $userid,
'competencyid' => $competencyid,
));
$context = context_user::instance($para... | [
"public",
"static",
"function",
"user_competency_request_review",
"(",
"$",
"userid",
",",
"$",
"competencyid",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"user_competency_request_review_parameters",
"(",
")",
",",
"array",... | External function user_competency_request_review.
@param int $userid The user ID.
@param int $competencyid The competency ID.
@return boolean | [
"External",
"function",
"user_competency_request_review",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2464-L2474 |
218,706 | moodle/moodle | competency/classes/external.php | external.user_competency_start_review | public static function user_competency_start_review($userid, $competencyid) {
$params = self::validate_parameters(self::user_competency_start_review_parameters(), array(
'userid' => $userid,
'competencyid' => $competencyid
));
$context = context_user::instance($params['u... | php | public static function user_competency_start_review($userid, $competencyid) {
$params = self::validate_parameters(self::user_competency_start_review_parameters(), array(
'userid' => $userid,
'competencyid' => $competencyid
));
$context = context_user::instance($params['u... | [
"public",
"static",
"function",
"user_competency_start_review",
"(",
"$",
"userid",
",",
"$",
"competencyid",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"user_competency_start_review_parameters",
"(",
")",
",",
"array",
"... | External function user_competency_start_review.
@param int $userid The user ID.
@param int $competencyid The competency ID.
@return boolean | [
"External",
"function",
"user_competency_start_review",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2504-L2514 |
218,707 | moodle/moodle | competency/classes/external.php | external.user_competency_stop_review | public static function user_competency_stop_review($userid, $competencyid) {
$params = self::validate_parameters(self::user_competency_stop_review_parameters(), array(
'userid' => $userid,
'competencyid' => $competencyid
));
$context = context_user::instance($params['use... | php | public static function user_competency_stop_review($userid, $competencyid) {
$params = self::validate_parameters(self::user_competency_stop_review_parameters(), array(
'userid' => $userid,
'competencyid' => $competencyid
));
$context = context_user::instance($params['use... | [
"public",
"static",
"function",
"user_competency_stop_review",
"(",
"$",
"userid",
",",
"$",
"competencyid",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"user_competency_stop_review_parameters",
"(",
")",
",",
"array",
"("... | External function user_competency_stop_review.
@param int $userid The user ID.
@param int $competencyid The competency ID.
@return boolean | [
"External",
"function",
"user_competency_stop_review",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2544-L2554 |
218,708 | moodle/moodle | competency/classes/external.php | external.create_plan | public static function create_plan($plan) {
global $PAGE;
$params = self::validate_parameters(self::create_plan_parameters(), array('plan' => $plan));
$params = $params['plan'];
$context = context_user::instance($params['userid']);
self::validate_context($context);
$out... | php | public static function create_plan($plan) {
global $PAGE;
$params = self::validate_parameters(self::create_plan_parameters(), array('plan' => $plan));
$params = $params['plan'];
$context = context_user::instance($params['userid']);
self::validate_context($context);
$out... | [
"public",
"static",
"function",
"create_plan",
"(",
"$",
"plan",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"create_plan_parameters",
"(",
")",
",",
"array",
"(",
"'plan'",
"=>",
"$",
... | Create a new learning plan.
@param array $plan List of fields for the plan.
@return array New plan record. | [
"Create",
"a",
"new",
"learning",
"plan",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2652-L2667 |
218,709 | moodle/moodle | competency/classes/external.php | external.update_plan | public static function update_plan($plan) {
global $PAGE;
$params = self::validate_parameters(self::update_plan_parameters(), array('plan' => $plan));
$params = $params['plan'];
$plan = api::read_plan($params['id']);
self::validate_context($plan->get_context());
$outpu... | php | public static function update_plan($plan) {
global $PAGE;
$params = self::validate_parameters(self::update_plan_parameters(), array('plan' => $plan));
$params = $params['plan'];
$plan = api::read_plan($params['id']);
self::validate_context($plan->get_context());
$outpu... | [
"public",
"static",
"function",
"update_plan",
"(",
"$",
"plan",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"update_plan_parameters",
"(",
")",
",",
"array",
"(",
"'plan'",
"=>",
"$",
... | Updates a new learning plan.
@param array $plan Fields for the plan (id is required)
@return mixed | [
"Updates",
"a",
"new",
"learning",
"plan",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2695-L2710 |
218,710 | moodle/moodle | competency/classes/external.php | external.complete_plan | public static function complete_plan($planid) {
$params = self::validate_parameters(self::complete_plan_parameters(), array(
'planid' => $planid
));
return api::complete_plan($params['planid']);
} | php | public static function complete_plan($planid) {
$params = self::validate_parameters(self::complete_plan_parameters(), array(
'planid' => $planid
));
return api::complete_plan($params['planid']);
} | [
"public",
"static",
"function",
"complete_plan",
"(",
"$",
"planid",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"complete_plan_parameters",
"(",
")",
",",
"array",
"(",
"'planid'",
"=>",
"$",
"planid",
")",
")",
"... | Complete Learning plan.
@param int $planid plan id (id is required)
@return boolean | [
"Complete",
"Learning",
"plan",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2742-L2748 |
218,711 | moodle/moodle | competency/classes/external.php | external.reopen_plan | public static function reopen_plan($planid) {
$params = self::validate_parameters(self::reopen_plan_parameters(), array(
'planid' => $planid
));
return api::reopen_plan($params['planid']);
} | php | public static function reopen_plan($planid) {
$params = self::validate_parameters(self::reopen_plan_parameters(), array(
'planid' => $planid
));
return api::reopen_plan($params['planid']);
} | [
"public",
"static",
"function",
"reopen_plan",
"(",
"$",
"planid",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"reopen_plan_parameters",
"(",
")",
",",
"array",
"(",
"'planid'",
"=>",
"$",
"planid",
")",
")",
";",
... | Reopen Learning plan.
@param int $planid plan id (id is required)
@return boolean | [
"Reopen",
"Learning",
"plan",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2780-L2786 |
218,712 | moodle/moodle | competency/classes/external.php | external.read_plan | public static function read_plan($id) {
global $PAGE;
$params = self::validate_parameters(self::read_plan_parameters(), array(
'id' => $id,
));
$plan = api::read_plan($params['id']);
self::validate_context($plan->get_context());
$output = $PAGE->get_renderer... | php | public static function read_plan($id) {
global $PAGE;
$params = self::validate_parameters(self::read_plan_parameters(), array(
'id' => $id,
));
$plan = api::read_plan($params['id']);
self::validate_context($plan->get_context());
$output = $PAGE->get_renderer... | [
"public",
"static",
"function",
"read_plan",
"(",
"$",
"id",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"read_plan_parameters",
"(",
")",
",",
"array",
"(",
"'id'",
"=>",
"$",
"id",
... | Read a plan by id.
@param int $id The id of the plan.
@return \stdClass | [
"Read",
"a",
"plan",
"by",
"id",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2817-L2831 |
218,713 | moodle/moodle | competency/classes/external.php | external.delete_plan | public static function delete_plan($id) {
$params = self::validate_parameters(self::delete_plan_parameters(), array(
'id' => $id,
));
$plan = api::read_plan($params['id']);
self::validate_context($plan->get_context());
return external_api::clean_returnvalue(self::de... | php | public static function delete_plan($id) {
$params = self::validate_parameters(self::delete_plan_parameters(), array(
'id' => $id,
));
$plan = api::read_plan($params['id']);
self::validate_context($plan->get_context());
return external_api::clean_returnvalue(self::de... | [
"public",
"static",
"function",
"delete_plan",
"(",
"$",
"id",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"delete_plan_parameters",
"(",
")",
",",
"array",
"(",
"'id'",
"=>",
"$",
"id",
",",
")",
")",
";",
"$"... | Delete a plan.
@param int $id The plan id
@return boolean | [
"Delete",
"a",
"plan",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2866-L2875 |
218,714 | moodle/moodle | competency/classes/external.php | external.plan_cancel_review_request | public static function plan_cancel_review_request($id) {
$params = self::validate_parameters(self::plan_cancel_review_request_parameters(), array(
'id' => $id
));
$plan = api::read_plan($id);
self::validate_context($plan->get_context());
return api::plan_cancel_revi... | php | public static function plan_cancel_review_request($id) {
$params = self::validate_parameters(self::plan_cancel_review_request_parameters(), array(
'id' => $id
));
$plan = api::read_plan($id);
self::validate_context($plan->get_context());
return api::plan_cancel_revi... | [
"public",
"static",
"function",
"plan_cancel_review_request",
"(",
"$",
"id",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"plan_cancel_review_request_parameters",
"(",
")",
",",
"array",
"(",
"'id'",
"=>",
"$",
"id",
"... | External function plan_cancel_review_request.
@param int $id The plan ID.
@return boolean | [
"External",
"function",
"plan_cancel_review_request",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2903-L2912 |
218,715 | moodle/moodle | competency/classes/external.php | external.plan_request_review | public static function plan_request_review($id) {
$params = self::validate_parameters(self::plan_request_review_parameters(), array(
'id' => $id
));
$plan = api::read_plan($id);
self::validate_context($plan->get_context());
return api::plan_request_review($plan);
... | php | public static function plan_request_review($id) {
$params = self::validate_parameters(self::plan_request_review_parameters(), array(
'id' => $id
));
$plan = api::read_plan($id);
self::validate_context($plan->get_context());
return api::plan_request_review($plan);
... | [
"public",
"static",
"function",
"plan_request_review",
"(",
"$",
"id",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"plan_request_review_parameters",
"(",
")",
",",
"array",
"(",
"'id'",
"=>",
"$",
"id",
")",
")",
"... | External function plan_request_review.
@param int $id The plan ID.
@return boolean | [
"External",
"function",
"plan_request_review",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2940-L2949 |
218,716 | moodle/moodle | competency/classes/external.php | external.plan_start_review | public static function plan_start_review($id) {
$params = self::validate_parameters(self::plan_start_review_parameters(), array(
'id' => $id
));
$plan = api::read_plan($id);
self::validate_context($plan->get_context());
return api::plan_start_review($plan);
} | php | public static function plan_start_review($id) {
$params = self::validate_parameters(self::plan_start_review_parameters(), array(
'id' => $id
));
$plan = api::read_plan($id);
self::validate_context($plan->get_context());
return api::plan_start_review($plan);
} | [
"public",
"static",
"function",
"plan_start_review",
"(",
"$",
"id",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"plan_start_review_parameters",
"(",
")",
",",
"array",
"(",
"'id'",
"=>",
"$",
"id",
")",
")",
";",
... | External function plan_start_review.
@param int $id The plan ID.
@return boolean | [
"External",
"function",
"plan_start_review",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L2977-L2986 |
218,717 | moodle/moodle | competency/classes/external.php | external.plan_stop_review | public static function plan_stop_review($id) {
$params = self::validate_parameters(self::plan_stop_review_parameters(), array(
'id' => $id
));
$plan = api::read_plan($id);
self::validate_context($plan->get_context());
return api::plan_stop_review($plan);
} | php | public static function plan_stop_review($id) {
$params = self::validate_parameters(self::plan_stop_review_parameters(), array(
'id' => $id
));
$plan = api::read_plan($id);
self::validate_context($plan->get_context());
return api::plan_stop_review($plan);
} | [
"public",
"static",
"function",
"plan_stop_review",
"(",
"$",
"id",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"plan_stop_review_parameters",
"(",
")",
",",
"array",
"(",
"'id'",
"=>",
"$",
"id",
")",
")",
";",
... | External function plan_stop_review.
@param int $id The plan ID.
@return boolean | [
"External",
"function",
"plan_stop_review",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3014-L3023 |
218,718 | moodle/moodle | competency/classes/external.php | external.approve_plan | public static function approve_plan($id) {
$params = self::validate_parameters(self::approve_plan_parameters(), array(
'id' => $id,
));
$plan = api::read_plan($id);
self::validate_context($plan->get_context());
return api::approve_plan($plan);
} | php | public static function approve_plan($id) {
$params = self::validate_parameters(self::approve_plan_parameters(), array(
'id' => $id,
));
$plan = api::read_plan($id);
self::validate_context($plan->get_context());
return api::approve_plan($plan);
} | [
"public",
"static",
"function",
"approve_plan",
"(",
"$",
"id",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"approve_plan_parameters",
"(",
")",
",",
"array",
"(",
"'id'",
"=>",
"$",
"id",
",",
")",
")",
";",
"... | External function approve_plan.
@param int $id The plan ID.
@return boolean | [
"External",
"function",
"approve_plan",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3051-L3060 |
218,719 | moodle/moodle | competency/classes/external.php | external.unapprove_plan | public static function unapprove_plan($id) {
$params = self::validate_parameters(self::unapprove_plan_parameters(), array(
'id' => $id,
));
$plan = api::read_plan($id);
self::validate_context($plan->get_context());
return api::unapprove_plan($plan);
} | php | public static function unapprove_plan($id) {
$params = self::validate_parameters(self::unapprove_plan_parameters(), array(
'id' => $id,
));
$plan = api::read_plan($id);
self::validate_context($plan->get_context());
return api::unapprove_plan($plan);
} | [
"public",
"static",
"function",
"unapprove_plan",
"(",
"$",
"id",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"unapprove_plan_parameters",
"(",
")",
",",
"array",
"(",
"'id'",
"=>",
"$",
"id",
",",
")",
")",
";",... | External function unapprove_plan.
@param int $id The plan ID.
@return boolean | [
"External",
"function",
"unapprove_plan",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3088-L3097 |
218,720 | moodle/moodle | competency/classes/external.php | external.list_plan_competencies | public static function list_plan_competencies($id) {
global $PAGE;
$params = self::validate_parameters(self::list_plan_competencies_parameters(), array('id' => $id));
$id = $params['id'];
$plan = api::read_plan($id);
$usercontext = $plan->get_context();
self::validate_co... | php | public static function list_plan_competencies($id) {
global $PAGE;
$params = self::validate_parameters(self::list_plan_competencies_parameters(), array('id' => $id));
$id = $params['id'];
$plan = api::read_plan($id);
$usercontext = $plan->get_context();
self::validate_co... | [
"public",
"static",
"function",
"list_plan_competencies",
"(",
"$",
"id",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"list_plan_competencies_parameters",
"(",
")",
",",
"array",
"(",
"'id'"... | List plan competencies.
@param int $id The plan ID.
@return array | [
"List",
"plan",
"competencies",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3124-L3161 |
218,721 | moodle/moodle | competency/classes/external.php | external.list_plan_competencies_returns | public static function list_plan_competencies_returns() {
$uc = user_competency_exporter::get_read_structure();
$ucp = user_competency_plan_exporter::get_read_structure();
$uc->required = VALUE_OPTIONAL;
$ucp->required = VALUE_OPTIONAL;
return new external_multiple_structure(
... | php | public static function list_plan_competencies_returns() {
$uc = user_competency_exporter::get_read_structure();
$ucp = user_competency_plan_exporter::get_read_structure();
$uc->required = VALUE_OPTIONAL;
$ucp->required = VALUE_OPTIONAL;
return new external_multiple_structure(
... | [
"public",
"static",
"function",
"list_plan_competencies_returns",
"(",
")",
"{",
"$",
"uc",
"=",
"user_competency_exporter",
"::",
"get_read_structure",
"(",
")",
";",
"$",
"ucp",
"=",
"user_competency_plan_exporter",
"::",
"get_read_structure",
"(",
")",
";",
"$",
... | External function return structure.
@return \external_description | [
"External",
"function",
"return",
"structure",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3168-L3182 |
218,722 | moodle/moodle | competency/classes/external.php | external.list_user_plans | 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);
$out... | php | 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);
$out... | [
"public",
"static",
"function",
"list_user_plans",
"(",
"$",
"userid",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"list_user_plans_parameters",
"(",
")",
",",
"array",
"(",
"'userid'",
"=... | External function list_user_plans.
@param int $userid The user ID.
@return boolean | [
"External",
"function",
"list_user_plans",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3201-L3219 |
218,723 | moodle/moodle | competency/classes/external.php | external.request_review_of_user_evidence_linked_competencies | public static function request_review_of_user_evidence_linked_competencies($id) {
$params = self::validate_parameters(self::request_review_of_user_evidence_linked_competencies_parameters(), array(
'id' => $id
));
$userevidence = api::read_user_evidence($id);
self::validate_c... | php | public static function request_review_of_user_evidence_linked_competencies($id) {
$params = self::validate_parameters(self::request_review_of_user_evidence_linked_competencies_parameters(), array(
'id' => $id
));
$userevidence = api::read_user_evidence($id);
self::validate_c... | [
"public",
"static",
"function",
"request_review_of_user_evidence_linked_competencies",
"(",
"$",
"id",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"request_review_of_user_evidence_linked_competencies_parameters",
"(",
")",
",",
"a... | Send user evidence competencies to review.
@param int $id The user evidence id.
@return boolean | [
"Send",
"user",
"evidence",
"competencies",
"to",
"review",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3407-L3416 |
218,724 | moodle/moodle | competency/classes/external.php | external.get_scale_values | public static function get_scale_values($scaleid) {
global $DB;
$params = self::validate_parameters(self::get_scale_values_parameters(),
array(
'scaleid' => $scaleid,
)
);
$context = context_system::instance();
self::validate_context($conte... | php | public static function get_scale_values($scaleid) {
global $DB;
$params = self::validate_parameters(self::get_scale_values_parameters(),
array(
'scaleid' => $scaleid,
)
);
$context = context_system::instance();
self::validate_context($conte... | [
"public",
"static",
"function",
"get_scale_values",
"(",
"$",
"scaleid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_scale_values_parameters",
"(",
")",
",",
"array",
"(",
"'scaleid'",
... | Get the values associated with a scale.
@param int $scaleid Scale ID
@return array Values for a scale. | [
"Get",
"the",
"values",
"associated",
"with",
"a",
"scale",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3449-L3470 |
218,725 | moodle/moodle | competency/classes/external.php | external.add_related_competency | public static function add_related_competency($competencyid, $relatedcompetencyid) {
$params = self::validate_parameters(self::add_related_competency_parameters(), array(
'competencyid' => $competencyid,
'relatedcompetencyid' => $relatedcompetencyid
));
$competency = api:... | php | public static function add_related_competency($competencyid, $relatedcompetencyid) {
$params = self::validate_parameters(self::add_related_competency_parameters(), array(
'competencyid' => $competencyid,
'relatedcompetencyid' => $relatedcompetencyid
));
$competency = api:... | [
"public",
"static",
"function",
"add_related_competency",
"(",
"$",
"competencyid",
",",
"$",
"relatedcompetencyid",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"add_related_competency_parameters",
"(",
")",
",",
"array",
... | Adds a related competency.
@param int $competencyid
@param int $relatedcompetencyid
@return bool | [
"Adds",
"a",
"related",
"competency",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3517-L3526 |
218,726 | moodle/moodle | competency/classes/external.php | external.remove_related_competency | public static function remove_related_competency($competencyid, $relatedcompetencyid) {
$params = self::validate_parameters(self::remove_related_competency_parameters(), array(
'competencyid' => $competencyid,
'relatedcompetencyid' => $relatedcompetencyid
));
$competency ... | php | public static function remove_related_competency($competencyid, $relatedcompetencyid) {
$params = self::validate_parameters(self::remove_related_competency_parameters(), array(
'competencyid' => $competencyid,
'relatedcompetencyid' => $relatedcompetencyid
));
$competency ... | [
"public",
"static",
"function",
"remove_related_competency",
"(",
"$",
"competencyid",
",",
"$",
"relatedcompetencyid",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"remove_related_competency_parameters",
"(",
")",
",",
"arra... | Removes a related competency.
@param int $competencyid
@param int $relatedcompetencyid
@return bool | [
"Removes",
"a",
"related",
"competency",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3567-L3576 |
218,727 | moodle/moodle | competency/classes/external.php | external.set_course_competency_ruleoutcome | public static function set_course_competency_ruleoutcome($coursecompetencyid, $ruleoutcome) {
$params = self::validate_parameters(self::set_course_competency_ruleoutcome_parameters(), array(
'coursecompetencyid' => $coursecompetencyid,
'ruleoutcome' => $ruleoutcome,
));
... | php | public static function set_course_competency_ruleoutcome($coursecompetencyid, $ruleoutcome) {
$params = self::validate_parameters(self::set_course_competency_ruleoutcome_parameters(), array(
'coursecompetencyid' => $coursecompetencyid,
'ruleoutcome' => $ruleoutcome,
));
... | [
"public",
"static",
"function",
"set_course_competency_ruleoutcome",
"(",
"$",
"coursecompetencyid",
",",
"$",
"ruleoutcome",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"set_course_competency_ruleoutcome_parameters",
"(",
")",
... | Change the ruleoutcome of a course competency.
@param int $coursecompetencyid The course competency id
@param int $ruleoutcome The ruleoutcome value
@return bool | [
"Change",
"the",
"ruleoutcome",
"of",
"a",
"course",
"competency",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3619-L3629 |
218,728 | moodle/moodle | competency/classes/external.php | external.grade_competency_parameters | public static function grade_competency_parameters() {
$userid = new external_value(
PARAM_INT,
'User ID',
VALUE_REQUIRED
);
$competencyid = new external_value(
PARAM_INT,
'Competency ID',
VALUE_REQUIRED
);
$... | php | public static function grade_competency_parameters() {
$userid = new external_value(
PARAM_INT,
'User ID',
VALUE_REQUIRED
);
$competencyid = new external_value(
PARAM_INT,
'Competency ID',
VALUE_REQUIRED
);
$... | [
"public",
"static",
"function",
"grade_competency_parameters",
"(",
")",
"{",
"$",
"userid",
"=",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'User ID'",
",",
"VALUE_REQUIRED",
")",
";",
"$",
"competencyid",
"=",
"new",
"external_value",
"(",
"PARAM_INT",
"... | Returns description of external function parameters.
@return \external_function_parameters | [
"Returns",
"description",
"of",
"external",
"function",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3646-L3675 |
218,729 | moodle/moodle | competency/classes/external.php | external.grade_competency | public static function grade_competency($userid, $competencyid, $grade, $note = null) {
global $USER, $PAGE;
$params = self::validate_parameters(self::grade_competency_parameters(), array(
'userid' => $userid,
'competencyid' => $competencyid,
'grade' => $grade,
... | php | public static function grade_competency($userid, $competencyid, $grade, $note = null) {
global $USER, $PAGE;
$params = self::validate_parameters(self::grade_competency_parameters(), array(
'userid' => $userid,
'competencyid' => $competencyid,
'grade' => $grade,
... | [
"public",
"static",
"function",
"grade_competency",
"(",
"$",
"userid",
",",
"$",
"competencyid",
",",
"$",
"grade",
",",
"$",
"note",
"=",
"null",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"validate_para... | Grade a competency.
@param int $userid The user ID.
@param int $competencyid The competency id
@param int $grade The new grade value
@param string $note A note to attach to the evidence
@return bool | [
"Grade",
"a",
"competency",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3686-L3715 |
218,730 | moodle/moodle | competency/classes/external.php | external.grade_competency_in_plan | public static function grade_competency_in_plan($planid, $competencyid, $grade, $note = null) {
global $USER, $PAGE;
$params = self::validate_parameters(self::grade_competency_in_plan_parameters(), array(
'planid' => $planid,
'competencyid' => $competencyid,
'grade' ... | php | public static function grade_competency_in_plan($planid, $competencyid, $grade, $note = null) {
global $USER, $PAGE;
$params = self::validate_parameters(self::grade_competency_in_plan_parameters(), array(
'planid' => $planid,
'competencyid' => $competencyid,
'grade' ... | [
"public",
"static",
"function",
"grade_competency_in_plan",
"(",
"$",
"planid",
",",
"$",
"competencyid",
",",
"$",
"grade",
",",
"$",
"note",
"=",
"null",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"valid... | Grade a competency in a plan.
@param int $planid The plan id
@param int $competencyid The competency id
@param int $grade The new grade value
@param string $note A note to add to the evidence
@return bool | [
"Grade",
"a",
"competency",
"in",
"a",
"plan",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L3771-L3802 |
218,731 | moodle/moodle | competency/classes/external.php | external.grade_competency_in_course | public static function grade_competency_in_course($courseid, $userid, $competencyid, $grade, $note = null) {
global $USER, $PAGE, $DB;
$params = self::validate_parameters(self::grade_competency_in_course_parameters(), array(
'courseid' => $courseid,
'userid' => $userid,
... | php | public static function grade_competency_in_course($courseid, $userid, $competencyid, $grade, $note = null) {
global $USER, $PAGE, $DB;
$params = self::validate_parameters(self::grade_competency_in_course_parameters(), array(
'courseid' => $courseid,
'userid' => $userid,
... | [
"public",
"static",
"function",
"grade_competency_in_course",
"(",
"$",
"courseid",
",",
"$",
"userid",
",",
"$",
"competencyid",
",",
"$",
"grade",
",",
"$",
"note",
"=",
"null",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"PAGE",
",",
"$",
"DB",
";",
... | Grade a competency in a course.
@param int $courseid The course id
@param int $userid The user id
@param int $competencyid The competency id
@param int $grade The new grade value
@param string $note A note to add to the evidence
@return bool | [
"Grade",
"a",
"competency",
"in",
"a",
"course",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L4082-L4115 |
218,732 | moodle/moodle | competency/classes/external.php | external.unlink_plan_from_template | public static function unlink_plan_from_template($planid) {
$params = self::validate_parameters(self::unlink_plan_from_template_parameters(), array(
'planid' => $planid,
));
$plan = new plan($params['planid']);
self::validate_context($plan->get_context());
return ap... | php | public static function unlink_plan_from_template($planid) {
$params = self::validate_parameters(self::unlink_plan_from_template_parameters(), array(
'planid' => $planid,
));
$plan = new plan($params['planid']);
self::validate_context($plan->get_context());
return ap... | [
"public",
"static",
"function",
"unlink_plan_from_template",
"(",
"$",
"planid",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"unlink_plan_from_template_parameters",
"(",
")",
",",
"array",
"(",
"'planid'",
"=>",
"$",
"pl... | Unlink the plan from the template.
@param int $planid The plan id
@return bool | [
"Unlink",
"the",
"plan",
"from",
"the",
"template",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L4150-L4159 |
218,733 | moodle/moodle | competency/classes/external.php | external.template_viewed | public static function template_viewed($id) {
$params = self::validate_parameters(self::view_book_parameters(), array(
'id' => $id
));
$template = api::read_template($params['id']);
self::validate_context($template->get_context());
return api::template_viewed($param... | php | public static function template_viewed($id) {
$params = self::validate_parameters(self::view_book_parameters(), array(
'id' => $id
));
$template = api::read_template($params['id']);
self::validate_context($template->get_context());
return api::template_viewed($param... | [
"public",
"static",
"function",
"template_viewed",
"(",
"$",
"id",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"view_book_parameters",
"(",
")",
",",
"array",
"(",
"'id'",
"=>",
"$",
"id",
")",
")",
";",
"$",
"... | Log the template viewed event.
@param int $id the template id
@return array of warnings and status result
@throws moodle_exception | [
"Log",
"the",
"template",
"viewed",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L4195-L4204 |
218,734 | moodle/moodle | competency/classes/external.php | external.update_course_competency_settings | public static function update_course_competency_settings($courseid, $settings) {
$params = self::validate_parameters(self::update_course_competency_settings_parameters(), array(
'courseid' => $courseid,
'settings' => $settings
));
$context = context_course::instance($par... | php | public static function update_course_competency_settings($courseid, $settings) {
$params = self::validate_parameters(self::update_course_competency_settings_parameters(), array(
'courseid' => $courseid,
'settings' => $settings
));
$context = context_course::instance($par... | [
"public",
"static",
"function",
"update_course_competency_settings",
"(",
"$",
"courseid",
",",
"$",
"settings",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"update_course_competency_settings_parameters",
"(",
")",
",",
"arr... | Update the course competency settings
@param int $courseid the course id
@param stdClass $settings The list of settings (currently only pushratingstouserplans).
@throws moodle_exception | [
"Update",
"the",
"course",
"competency",
"settings"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L4248-L4259 |
218,735 | moodle/moodle | competency/classes/external.php | external.delete_evidence | public static function delete_evidence($id) {
$params = self::validate_parameters(self::delete_evidence_parameters(), array(
'id' => $id
));
$evidence = api::read_evidence($params['id']);
$uc = api::get_user_competency_by_id($evidence->get('usercompetencyid'));
self:... | php | public static function delete_evidence($id) {
$params = self::validate_parameters(self::delete_evidence_parameters(), array(
'id' => $id
));
$evidence = api::read_evidence($params['id']);
$uc = api::get_user_competency_by_id($evidence->get('usercompetencyid'));
self:... | [
"public",
"static",
"function",
"delete_evidence",
"(",
"$",
"id",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"delete_evidence_parameters",
"(",
")",
",",
"array",
"(",
"'id'",
"=>",
"$",
"id",
")",
")",
";",
"$... | External function delete_evidence.
@param int $id The evidence ID.
@return boolean | [
"External",
"function",
"delete_evidence",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/external.php#L4287-L4297 |
218,736 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Socket/Connection/Socket.php | Horde_Imap_Client_Socket_Connection_Socket.write | public function write($data, $eol = false)
{
if ($eol) {
$buffer = $this->_buffer;
$debug = $this->client_debug;
$this->_buffer = '';
$this->client_debug = true;
if (fwrite($this->_stream, $buffer . $data . ($eol ? "\r\n" : '')) === false) {
... | php | public function write($data, $eol = false)
{
if ($eol) {
$buffer = $this->_buffer;
$debug = $this->client_debug;
$this->_buffer = '';
$this->client_debug = true;
if (fwrite($this->_stream, $buffer . $data . ($eol ? "\r\n" : '')) === false) {
... | [
"public",
"function",
"write",
"(",
"$",
"data",
",",
"$",
"eol",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"eol",
")",
"{",
"$",
"buffer",
"=",
"$",
"this",
"->",
"_buffer",
";",
"$",
"debug",
"=",
"$",
"this",
"->",
"client_debug",
";",
"$",
"t... | Writes data to the IMAP output stream.
@param string $data String data.
@param boolean $eol Append EOL?
@throws Horde_Imap_Client_Exception | [
"Writes",
"data",
"to",
"the",
"IMAP",
"output",
"stream",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Socket/Connection/Socket.php#L53-L75 |
218,737 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Socket/Connection/Socket.php | Horde_Imap_Client_Socket_Connection_Socket.writeLiteral | public function writeLiteral($data, $length, $binary = false)
{
$this->_buffer = '';
$success = false;
if ($data instanceof Horde_Stream) {
$data = $data->stream;
}
if (rewind($data)) {
$success = true;
while (!feof($data)) {
... | php | public function writeLiteral($data, $length, $binary = false)
{
$this->_buffer = '';
$success = false;
if ($data instanceof Horde_Stream) {
$data = $data->stream;
}
if (rewind($data)) {
$success = true;
while (!feof($data)) {
... | [
"public",
"function",
"writeLiteral",
"(",
"$",
"data",
",",
"$",
"length",
",",
"$",
"binary",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"_buffer",
"=",
"''",
";",
"$",
"success",
"=",
"false",
";",
"if",
"(",
"$",
"data",
"instanceof",
"Horde_Stre... | Writes literal data to the IMAP output stream.
@param mixed $data Either a stream resource, or Horde_Stream
object.
@param integer $length The literal length.
@param boolean $binary If true, this is binary data.
@throws Horde_Imap_Client_Exception | [
"Writes",
"literal",
"data",
"to",
"the",
"IMAP",
"output",
"stream",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Socket/Connection/Socket.php#L87-L123 |
218,738 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Socket/Connection/Socket.php | Horde_Imap_Client_Socket_Connection_Socket.read | public function read($size = null)
{
$got_data = false;
$literal_len = null;
$token = new Horde_Imap_Client_Tokenize();
do {
if (feof($this->_stream)) {
$this->close();
$this->_params['debug']->info(
'ERROR: Server clos... | php | public function read($size = null)
{
$got_data = false;
$literal_len = null;
$token = new Horde_Imap_Client_Tokenize();
do {
if (feof($this->_stream)) {
$this->close();
$this->_params['debug']->info(
'ERROR: Server clos... | [
"public",
"function",
"read",
"(",
"$",
"size",
"=",
"null",
")",
"{",
"$",
"got_data",
"=",
"false",
";",
"$",
"literal_len",
"=",
"null",
";",
"$",
"token",
"=",
"new",
"Horde_Imap_Client_Tokenize",
"(",
")",
";",
"do",
"{",
"if",
"(",
"feof",
"(",... | Read data from incoming IMAP stream.
@param integer $size UNUSED: The number of bytes to read from the
socket.
@return Horde_Imap_Client_Tokenize The tokenized data.
@throws Horde_Imap_Client_Exception | [
"Read",
"data",
"from",
"incoming",
"IMAP",
"stream",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Socket/Connection/Socket.php#L135-L220 |
218,739 | moodle/moodle | user/files_form.php | user_files_form.definition | public function definition() {
$mform = $this->_form;
$data = $this->_customdata['data'];
$options = $this->_customdata['options'];
$mform->addElement('filemanager', 'files_filemanager', get_string('files'), null, $options);
$mform->addElement('hidden', 'returnurl', $data->retu... | php | public function definition() {
$mform = $this->_form;
$data = $this->_customdata['data'];
$options = $this->_customdata['options'];
$mform->addElement('filemanager', 'files_filemanager', get_string('files'), null, $options);
$mform->addElement('hidden', 'returnurl', $data->retu... | [
"public",
"function",
"definition",
"(",
")",
"{",
"$",
"mform",
"=",
"$",
"this",
"->",
"_form",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"_customdata",
"[",
"'data'",
"]",
";",
"$",
"options",
"=",
"$",
"this",
"->",
"_customdata",
"[",
"'options'... | Add elements to this form. | [
"Add",
"elements",
"to",
"this",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/user/files_form.php#L40-L58 |
218,740 | moodle/moodle | user/files_form.php | user_files_form.validation | public function validation($data, $files) {
$errors = array();
$draftitemid = $data['files_filemanager'];
if (file_is_draft_area_limit_reached($draftitemid, $this->_customdata['options']['areamaxbytes'])) {
$errors['files_filemanager'] = get_string('userquotalimit', 'error');
... | php | public function validation($data, $files) {
$errors = array();
$draftitemid = $data['files_filemanager'];
if (file_is_draft_area_limit_reached($draftitemid, $this->_customdata['options']['areamaxbytes'])) {
$errors['files_filemanager'] = get_string('userquotalimit', 'error');
... | [
"public",
"function",
"validation",
"(",
"$",
"data",
",",
"$",
"files",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"$",
"draftitemid",
"=",
"$",
"data",
"[",
"'files_filemanager'",
"]",
";",
"if",
"(",
"file_is_draft_area_limit_reached",
"(",
... | Validate incoming data.
@param array $data
@param array $files
@return array | [
"Validate",
"incoming",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/user/files_form.php#L67-L75 |
218,741 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._initOb | protected function _initOb()
{
register_shutdown_function(array($this, 'shutdown'));
$this->_alerts = new Horde_Imap_Client_Base_Alerts();
// @todo: Remove (BC)
$this->_alerts->attach($this);
$this->_debug = ($debug = $this->getParam('debug'))
? new Horde_Imap_C... | php | protected function _initOb()
{
register_shutdown_function(array($this, 'shutdown'));
$this->_alerts = new Horde_Imap_Client_Base_Alerts();
// @todo: Remove (BC)
$this->_alerts->attach($this);
$this->_debug = ($debug = $this->getParam('debug'))
? new Horde_Imap_C... | [
"protected",
"function",
"_initOb",
"(",
")",
"{",
"register_shutdown_function",
"(",
"array",
"(",
"$",
"this",
",",
"'shutdown'",
")",
")",
";",
"$",
"this",
"->",
"_alerts",
"=",
"new",
"Horde_Imap_Client_Base_Alerts",
"(",
")",
";",
"// @todo: Remove (BC)",
... | Do initialization tasks. | [
"Do",
"initialization",
"tasks",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L298-L321 |
218,742 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._setInit | public function _setInit($key = null, $val = null)
{
if (is_null($key)) {
$this->_init = array();
} elseif (is_null($val)) {
unset($this->_init[$key]);
} else {
switch ($key) {
case 'capability':
if ($ci = $this->getParam('capab... | php | public function _setInit($key = null, $val = null)
{
if (is_null($key)) {
$this->_init = array();
} elseif (is_null($val)) {
unset($this->_init[$key]);
} else {
switch ($key) {
case 'capability':
if ($ci = $this->getParam('capab... | [
"public",
"function",
"_setInit",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"val",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"_init",
"=",
"array",
"(",
")",
";",
"}",
"elseif",
"(",
"is_null"... | Set an initialization value.
@param string $key The initialization key. If null, resets all keys.
@param mixed $val The cached value. If null, removes the key. | [
"Set",
"an",
"initialization",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L419-L461 |
218,743 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._initCache | protected function _initCache($current = false)
{
$c = $this->getParam('cache');
if (empty($c['fields'])) {
return false;
}
if (is_null($this->_cache)) {
if (isset($c['backend'])) {
$backend = $c['backend'];
} elseif (isset($c['ca... | php | protected function _initCache($current = false)
{
$c = $this->getParam('cache');
if (empty($c['fields'])) {
return false;
}
if (is_null($this->_cache)) {
if (isset($c['backend'])) {
$backend = $c['backend'];
} elseif (isset($c['ca... | [
"protected",
"function",
"_initCache",
"(",
"$",
"current",
"=",
"false",
")",
"{",
"$",
"c",
"=",
"$",
"this",
"->",
"getParam",
"(",
"'cache'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"c",
"[",
"'fields'",
"]",
")",
")",
"{",
"return",
"false",
... | Initialize the Horde_Imap_Client_Cache object, if necessary.
@param boolean $current If true, we are going to update the currently
selected mailbox. Add an additional check to
see if caching is available in current
mailbox.
@return boolean Returns true if caching is enabled. | [
"Initialize",
"the",
"Horde_Imap_Client_Cache",
"object",
"if",
"necessary",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L473-L503 |
218,744 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.getParam | public function getParam($key)
{
/* Passwords may be stored encrypted. */
switch ($key) {
case 'password':
if (isset($this->_params[$key]) &&
($this->_params[$key] instanceof Horde_Imap_Client_Base_Password)) {
return $this->_params[$key]->getPassw... | php | public function getParam($key)
{
/* Passwords may be stored encrypted. */
switch ($key) {
case 'password':
if (isset($this->_params[$key]) &&
($this->_params[$key] instanceof Horde_Imap_Client_Base_Password)) {
return $this->_params[$key]->getPassw... | [
"public",
"function",
"getParam",
"(",
"$",
"key",
")",
"{",
"/* Passwords may be stored encrypted. */",
"switch",
"(",
"$",
"key",
")",
"{",
"case",
"'password'",
":",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_params",
"[",
"$",
"key",
"]",
")",
"&&... | Returns a value from the internal params array.
@param string $key The param key.
@return mixed The param value, or null if not found. | [
"Returns",
"a",
"value",
"from",
"the",
"internal",
"params",
"array",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L512-L537 |
218,745 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.setParam | public function setParam($key, $val)
{
switch ($key) {
case 'password':
if ($val instanceof Horde_Imap_Client_Base_Password) {
break;
}
// DEPRECATED: Encrypt password.
try {
$encrypt_key = $this->_getEncryptKey();
... | php | public function setParam($key, $val)
{
switch ($key) {
case 'password':
if ($val instanceof Horde_Imap_Client_Base_Password) {
break;
}
// DEPRECATED: Encrypt password.
try {
$encrypt_key = $this->_getEncryptKey();
... | [
"public",
"function",
"setParam",
"(",
"$",
"key",
",",
"$",
"val",
")",
"{",
"switch",
"(",
"$",
"key",
")",
"{",
"case",
"'password'",
":",
"if",
"(",
"$",
"val",
"instanceof",
"Horde_Imap_Client_Base_Password",
")",
"{",
"break",
";",
"}",
"// DEPRECA... | Sets a configuration parameter value.
@param string $key The param key.
@param mixed $val The param value. | [
"Sets",
"a",
"configuration",
"parameter",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L545-L567 |
218,746 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._capability | protected function _capability()
{
if (!isset($this->_init['capability'])) {
$this->_initCapability();
}
return ($args = func_num_args())
? $this->_init['capability']->query(func_get_arg(0), ($args > 1) ? func_get_arg(1) : null)
: $this->_init['capability... | php | protected function _capability()
{
if (!isset($this->_init['capability'])) {
$this->_initCapability();
}
return ($args = func_num_args())
? $this->_init['capability']->query(func_get_arg(0), ($args > 1) ? func_get_arg(1) : null)
: $this->_init['capability... | [
"protected",
"function",
"_capability",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_init",
"[",
"'capability'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_initCapability",
"(",
")",
";",
"}",
"return",
"(",
"$",
"args",
"=",
"fu... | Query server capability.
Required because internal code can't call capability via magic method
directly - it may not exist yet, the creation code may call capability
recursively, and __get() doesn't allow recursive calls to the same
property (chicken/egg issue).
@return mixed The capability object if no arguments pr... | [
"Query",
"server",
"capability",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L646-L655 |
218,747 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.login | public function login()
{
if (!$this->_isAuthenticated && $this->_login()) {
if ($this->getParam('id')) {
try {
$this->sendID();
/* ID is queued - force sending the queued command. */
$this->_sendCmd($this->_pipeline());... | php | public function login()
{
if (!$this->_isAuthenticated && $this->_login()) {
if ($this->getParam('id')) {
try {
$this->sendID();
/* ID is queued - force sending the queued command. */
$this->_sendCmd($this->_pipeline());... | [
"public",
"function",
"login",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isAuthenticated",
"&&",
"$",
"this",
"->",
"_login",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getParam",
"(",
"'id'",
")",
")",
"{",
"try",
"{",
"$",
"... | Login to the IMAP server.
@throws Horde_Imap_Client_Exception | [
"Login",
"to",
"the",
"IMAP",
"server",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L831-L854 |
218,748 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.openMailbox | public function openMailbox($mailbox, $mode = Horde_Imap_Client::OPEN_AUTO)
{
$this->login();
$change = false;
$mailbox = Horde_Imap_Client_Mailbox::get($mailbox);
if ($mode == Horde_Imap_Client::OPEN_AUTO) {
if (is_null($this->_selected) ||
!$mailbox->e... | php | public function openMailbox($mailbox, $mode = Horde_Imap_Client::OPEN_AUTO)
{
$this->login();
$change = false;
$mailbox = Horde_Imap_Client_Mailbox::get($mailbox);
if ($mode == Horde_Imap_Client::OPEN_AUTO) {
if (is_null($this->_selected) ||
!$mailbox->e... | [
"public",
"function",
"openMailbox",
"(",
"$",
"mailbox",
",",
"$",
"mode",
"=",
"Horde_Imap_Client",
"::",
"OPEN_AUTO",
")",
"{",
"$",
"this",
"->",
"login",
"(",
")",
";",
"$",
"change",
"=",
"false",
";",
"$",
"mailbox",
"=",
"Horde_Imap_Client_Mailbox"... | Open a mailbox.
@param mixed $mailbox The mailbox to open. Either a
Horde_Imap_Client_Mailbox object or a string
(UTF-8).
@param integer $mode The access mode. Either
- Horde_Imap_Client::OPEN_READONLY
- Horde_Imap_Client::OPEN_READWRITE
- Horde_Imap_Client::OPEN_AUTO
@throws Horde_Imap_Client_Exception | [
"Open",
"a",
"mailbox",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L1026-L1052 |
218,749 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._changeSelected | protected function _changeSelected($mailbox = null, $mode = null)
{
$this->_mode = $mode;
if (is_null($mailbox)) {
$this->_selected = null;
} else {
$this->_selected = clone $mailbox;
$this->_mailboxOb()->reset();
}
} | php | protected function _changeSelected($mailbox = null, $mode = null)
{
$this->_mode = $mode;
if (is_null($mailbox)) {
$this->_selected = null;
} else {
$this->_selected = clone $mailbox;
$this->_mailboxOb()->reset();
}
} | [
"protected",
"function",
"_changeSelected",
"(",
"$",
"mailbox",
"=",
"null",
",",
"$",
"mode",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_mode",
"=",
"$",
"mode",
";",
"if",
"(",
"is_null",
"(",
"$",
"mailbox",
")",
")",
"{",
"$",
"this",
"->",
... | Called when the selected mailbox is changed.
@param mixed $mailbox The selected mailbox or null.
@param integer $mode The access mode. | [
"Called",
"when",
"the",
"selected",
"mailbox",
"is",
"changed",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L1071-L1080 |
218,750 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._mailboxOb | protected function _mailboxOb($mailbox = null)
{
$name = is_null($mailbox)
? strval($this->_selected)
: strval($mailbox);
if (!isset($this->_temp['mailbox_ob'][$name])) {
$this->_temp['mailbox_ob'][$name] = new Horde_Imap_Client_Base_Mailbox();
}
... | php | protected function _mailboxOb($mailbox = null)
{
$name = is_null($mailbox)
? strval($this->_selected)
: strval($mailbox);
if (!isset($this->_temp['mailbox_ob'][$name])) {
$this->_temp['mailbox_ob'][$name] = new Horde_Imap_Client_Base_Mailbox();
}
... | [
"protected",
"function",
"_mailboxOb",
"(",
"$",
"mailbox",
"=",
"null",
")",
"{",
"$",
"name",
"=",
"is_null",
"(",
"$",
"mailbox",
")",
"?",
"strval",
"(",
"$",
"this",
"->",
"_selected",
")",
":",
"strval",
"(",
"$",
"mailbox",
")",
";",
"if",
"... | Return the Horde_Imap_Client_Base_Mailbox object.
@param string $mailbox The mailbox name. Defaults to currently
selected mailbox.
@return Horde_Imap_Client_Base_Mailbox Mailbox object. | [
"Return",
"the",
"Horde_Imap_Client_Base_Mailbox",
"object",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L1090-L1101 |
218,751 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.createMailbox | public function createMailbox($mailbox, array $opts = array())
{
$this->login();
if (!$this->_capability('CREATE-SPECIAL-USE')) {
unset($opts['special_use']);
}
$this->_createMailbox(Horde_Imap_Client_Mailbox::get($mailbox), $opts);
} | php | public function createMailbox($mailbox, array $opts = array())
{
$this->login();
if (!$this->_capability('CREATE-SPECIAL-USE')) {
unset($opts['special_use']);
}
$this->_createMailbox(Horde_Imap_Client_Mailbox::get($mailbox), $opts);
} | [
"public",
"function",
"createMailbox",
"(",
"$",
"mailbox",
",",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"login",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"_capability",
"(",
"'CREATE-SPECIAL-USE'",
")",
")... | Create a mailbox.
@param mixed $mailbox The mailbox to create. Either a
Horde_Imap_Client_Mailbox object or a string
(UTF-8).
@param array $opts Additional options:
- special_use: (array) An array of special-use flags to mark the
mailbox with. The server MUST support RFC 6154.
@throws Horde_Imap_Client_Exception | [
"Create",
"a",
"mailbox",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L1135-L1144 |
218,752 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.deleteMailbox | public function deleteMailbox($mailbox)
{
$this->login();
$mailbox = Horde_Imap_Client_Mailbox::get($mailbox);
$this->_deleteMailbox($mailbox);
$this->_deleteMailboxPost($mailbox);
} | php | public function deleteMailbox($mailbox)
{
$this->login();
$mailbox = Horde_Imap_Client_Mailbox::get($mailbox);
$this->_deleteMailbox($mailbox);
$this->_deleteMailboxPost($mailbox);
} | [
"public",
"function",
"deleteMailbox",
"(",
"$",
"mailbox",
")",
"{",
"$",
"this",
"->",
"login",
"(",
")",
";",
"$",
"mailbox",
"=",
"Horde_Imap_Client_Mailbox",
"::",
"get",
"(",
"$",
"mailbox",
")",
";",
"$",
"this",
"->",
"_deleteMailbox",
"(",
"$",
... | Delete a mailbox.
@param mixed $mailbox The mailbox to delete. Either a
Horde_Imap_Client_Mailbox object or a string
(UTF-8).
@throws Horde_Imap_Client_Exception | [
"Delete",
"a",
"mailbox",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L1167-L1175 |
218,753 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._deleteMailboxPost | protected function _deleteMailboxPost(Horde_Imap_Client_Mailbox $mailbox)
{
/* Delete mailbox caches. */
if ($this->_initCache()) {
$this->_cache->deleteMailbox($mailbox);
}
unset($this->_temp['mailbox_ob'][strval($mailbox)]);
/* Unsubscribe from mailbox. */
... | php | protected function _deleteMailboxPost(Horde_Imap_Client_Mailbox $mailbox)
{
/* Delete mailbox caches. */
if ($this->_initCache()) {
$this->_cache->deleteMailbox($mailbox);
}
unset($this->_temp['mailbox_ob'][strval($mailbox)]);
/* Unsubscribe from mailbox. */
... | [
"protected",
"function",
"_deleteMailboxPost",
"(",
"Horde_Imap_Client_Mailbox",
"$",
"mailbox",
")",
"{",
"/* Delete mailbox caches. */",
"if",
"(",
"$",
"this",
"->",
"_initCache",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_cache",
"->",
"deleteMailbox",
"(",
"$... | Actions to perform after a mailbox delete.
@param Horde_Imap_Client_Mailbox $mailbox The deleted mailbox. | [
"Actions",
"to",
"perform",
"after",
"a",
"mailbox",
"delete",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L1191-L1205 |
218,754 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.renameMailbox | public function renameMailbox($old, $new)
{
// Login will be handled by first listMailboxes() call.
$old = Horde_Imap_Client_Mailbox::get($old);
$new = Horde_Imap_Client_Mailbox::get($new);
/* Check if old mailbox(es) were subscribed to. */
$base = $this->listMailboxes($old... | php | public function renameMailbox($old, $new)
{
// Login will be handled by first listMailboxes() call.
$old = Horde_Imap_Client_Mailbox::get($old);
$new = Horde_Imap_Client_Mailbox::get($new);
/* Check if old mailbox(es) were subscribed to. */
$base = $this->listMailboxes($old... | [
"public",
"function",
"renameMailbox",
"(",
"$",
"old",
",",
"$",
"new",
")",
"{",
"// Login will be handled by first listMailboxes() call.",
"$",
"old",
"=",
"Horde_Imap_Client_Mailbox",
"::",
"get",
"(",
"$",
"old",
")",
";",
"$",
"new",
"=",
"Horde_Imap_Client_... | Rename a mailbox.
@param mixed $old The old mailbox name. Either a
Horde_Imap_Client_Mailbox object or a string (UTF-8).
@param mixed $new The new mailbox name. Either a
Horde_Imap_Client_Mailbox object or a string (UTF-8).
@throws Horde_Imap_Client_Exception | [
"Rename",
"a",
"mailbox",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L1217-L1256 |
218,755 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.subscribeMailbox | public function subscribeMailbox($mailbox, $subscribe = true)
{
$this->login();
$this->_subscribeMailbox(Horde_Imap_Client_Mailbox::get($mailbox), (bool)$subscribe);
} | php | public function subscribeMailbox($mailbox, $subscribe = true)
{
$this->login();
$this->_subscribeMailbox(Horde_Imap_Client_Mailbox::get($mailbox), (bool)$subscribe);
} | [
"public",
"function",
"subscribeMailbox",
"(",
"$",
"mailbox",
",",
"$",
"subscribe",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"login",
"(",
")",
";",
"$",
"this",
"->",
"_subscribeMailbox",
"(",
"Horde_Imap_Client_Mailbox",
"::",
"get",
"(",
"$",
"mailbo... | Manage subscription status for a mailbox.
@param mixed $mailbox The mailbox to [un]subscribe to. Either a
Horde_Imap_Client_Mailbox object or a string
(UTF-8).
@param boolean $subscribe True to subscribe, false to unsubscribe.
@throws Horde_Imap_Client_Exception | [
"Manage",
"subscription",
"status",
"for",
"a",
"mailbox",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L1279-L1283 |
218,756 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.listMailboxes | public function listMailboxes($pattern,
$mode = Horde_Imap_Client::MBOX_ALL,
array $options = array())
{
$this->login();
$pattern = is_array($pattern)
? array_unique($pattern)
: array($pattern);
/* ... | php | public function listMailboxes($pattern,
$mode = Horde_Imap_Client::MBOX_ALL,
array $options = array())
{
$this->login();
$pattern = is_array($pattern)
? array_unique($pattern)
: array($pattern);
/* ... | [
"public",
"function",
"listMailboxes",
"(",
"$",
"pattern",
",",
"$",
"mode",
"=",
"Horde_Imap_Client",
"::",
"MBOX_ALL",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"login",
"(",
")",
";",
"$",
"pattern",
"=",
... | Obtain a list of mailboxes matching a pattern.
@param mixed $pattern The mailbox search pattern(s) (see RFC 3501
[6.3.8] for the format). A UTF-8 string or an
array of strings. If a Horde_Imap_Client_Mailbox
object is given, it is escaped (i.e. wildcard
patterns are converted to return the miminal
number of matches ... | [
"Obtain",
"a",
"list",
"of",
"mailboxes",
"matching",
"a",
"pattern",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L1380-L1436 |
218,757 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.statusMultiple | public function statusMultiple($mailboxes,
$flags = Horde_Imap_Client::STATUS_ALL,
array $opts = array())
{
return $this->status($mailboxes, $flags, $opts);
} | php | public function statusMultiple($mailboxes,
$flags = Horde_Imap_Client::STATUS_ALL,
array $opts = array())
{
return $this->status($mailboxes, $flags, $opts);
} | [
"public",
"function",
"statusMultiple",
"(",
"$",
"mailboxes",
",",
"$",
"flags",
"=",
"Horde_Imap_Client",
"::",
"STATUS_ALL",
",",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"(",
"$",
"mailboxes",
","... | Perform a STATUS call on multiple mailboxes at the same time.
This method leverages the LIST-EXTENDED and LIST-STATUS extensions on
the IMAP server to improve the efficiency of this operation.
@deprecated Use status() instead.
@param array $mailboxes The mailboxes to query. Either
Horde_Imap_Client_Mailbox objects... | [
"Perform",
"a",
"STATUS",
"call",
"on",
"multiple",
"mailboxes",
"at",
"the",
"same",
"time",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L1789-L1794 |
218,758 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.expunge | public function expunge($mailbox, array $options = array())
{
// Open mailbox call will handle the login.
$this->openMailbox($mailbox, Horde_Imap_Client::OPEN_READWRITE);
/* Don't expunge if the mailbox is readonly. */
if ($this->_mode == Horde_Imap_Client::OPEN_READONLY) {
... | php | public function expunge($mailbox, array $options = array())
{
// Open mailbox call will handle the login.
$this->openMailbox($mailbox, Horde_Imap_Client::OPEN_READWRITE);
/* Don't expunge if the mailbox is readonly. */
if ($this->_mode == Horde_Imap_Client::OPEN_READONLY) {
... | [
"public",
"function",
"expunge",
"(",
"$",
"mailbox",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"// Open mailbox call will handle the login.",
"$",
"this",
"->",
"openMailbox",
"(",
"$",
"mailbox",
",",
"Horde_Imap_Client",
"::",
"OPEN_READ... | Expunge deleted messages from the given mailbox.
@param mixed $mailbox The mailbox to expunge. Either a
Horde_Imap_Client_Mailbox object or a string
(UTF-8).
@param array $options Additional options:
- delete: (boolean) If true, will flag all messages in 'ids' as
deleted (since 2.10.0).
DEFAULT: false
- ids: (Horde_... | [
"Expunge",
"deleted",
"messages",
"from",
"the",
"given",
"mailbox",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L1979-L1999 |
218,759 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.copy | public function copy($source, $dest, array $options = array())
{
// Open mailbox call will handle the login.
$this->openMailbox($source, empty($options['move']) ? Horde_Imap_Client::OPEN_AUTO : Horde_Imap_Client::OPEN_READWRITE);
/* SEARCHRES requires server support. */
if (empty($o... | php | public function copy($source, $dest, array $options = array())
{
// Open mailbox call will handle the login.
$this->openMailbox($source, empty($options['move']) ? Horde_Imap_Client::OPEN_AUTO : Horde_Imap_Client::OPEN_READWRITE);
/* SEARCHRES requires server support. */
if (empty($o... | [
"public",
"function",
"copy",
"(",
"$",
"source",
",",
"$",
"dest",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"// Open mailbox call will handle the login.",
"$",
"this",
"->",
"openMailbox",
"(",
"$",
"source",
",",
"empty",
"(",
"$",... | Copy messages to another mailbox.
@param mixed $source The source mailbox. Either a
Horde_Imap_Client_Mailbox object or a string
(UTF-8).
@param mixed $dest The destination mailbox. Either a
Horde_Imap_Client_Mailbox object or a string
(UTF-8).
@param array $options Additional options:
- create: (boolean) Try t... | [
"Copy",
"messages",
"to",
"another",
"mailbox",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L2941-L2976 |
218,760 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.allAclRights | public function allAclRights()
{
$this->login();
$rights = array(
Horde_Imap_Client::ACL_LOOKUP,
Horde_Imap_Client::ACL_READ,
Horde_Imap_Client::ACL_SEEN,
Horde_Imap_Client::ACL_WRITE,
Horde_Imap_Client::ACL_INSERT,
Horde_Imap_... | php | public function allAclRights()
{
$this->login();
$rights = array(
Horde_Imap_Client::ACL_LOOKUP,
Horde_Imap_Client::ACL_READ,
Horde_Imap_Client::ACL_SEEN,
Horde_Imap_Client::ACL_WRITE,
Horde_Imap_Client::ACL_INSERT,
Horde_Imap_... | [
"public",
"function",
"allAclRights",
"(",
")",
"{",
"$",
"this",
"->",
"login",
"(",
")",
";",
"$",
"rights",
"=",
"array",
"(",
"Horde_Imap_Client",
"::",
"ACL_LOOKUP",
",",
"Horde_Imap_Client",
"::",
"ACL_READ",
",",
"Horde_Imap_Client",
"::",
"ACL_SEEN",
... | Return master list of ACL rights available on the server.
@return array A list of ACL rights. | [
"Return",
"master",
"list",
"of",
"ACL",
"rights",
"available",
"on",
"the",
"server",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L3329-L3354 |
218,761 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.resolveIds | public function resolveIds(Horde_Imap_Client_Mailbox $mailbox,
Horde_Imap_Client_Ids $ids, $convert = 0)
{
$map = $this->_mailboxOb($mailbox)->map;
if ($ids->special) {
/* Optimization for ALL sequence searches. */
if (!$convert && $ids->all &&... | php | public function resolveIds(Horde_Imap_Client_Mailbox $mailbox,
Horde_Imap_Client_Ids $ids, $convert = 0)
{
$map = $this->_mailboxOb($mailbox)->map;
if ($ids->special) {
/* Optimization for ALL sequence searches. */
if (!$convert && $ids->all &&... | [
"public",
"function",
"resolveIds",
"(",
"Horde_Imap_Client_Mailbox",
"$",
"mailbox",
",",
"Horde_Imap_Client_Ids",
"$",
"ids",
",",
"$",
"convert",
"=",
"0",
")",
"{",
"$",
"map",
"=",
"$",
"this",
"->",
"_mailboxOb",
"(",
"$",
"mailbox",
")",
"->",
"map"... | Resolves an IDs object into a list of IDs.
@param Horde_Imap_Client_Mailbox $mailbox The mailbox.
@param Horde_Imap_Client_Ids $ids The Ids object.
@param integer $convert Convert to UIDs?
- 0: No
- 1: Only if $ids is not already a UIDs object
- 2: Always
@return Horde_Imap_Client_Ids Th... | [
"Resolves",
"an",
"IDs",
"object",
"into",
"a",
"list",
"of",
"IDs",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L3490-L3550 |
218,762 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.getSyncToken | public function getSyncToken($mailbox)
{
$out = array();
foreach ($this->_syncStatus($mailbox) as $key => $val) {
$out[] = $key . $val;
}
return base64_encode(implode(',', $out));
} | php | public function getSyncToken($mailbox)
{
$out = array();
foreach ($this->_syncStatus($mailbox) as $key => $val) {
$out[] = $key . $val;
}
return base64_encode(implode(',', $out));
} | [
"public",
"function",
"getSyncToken",
"(",
"$",
"mailbox",
")",
"{",
"$",
"out",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_syncStatus",
"(",
"$",
"mailbox",
")",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"$",
"out",
"[... | Returns a unique token for the current mailbox synchronization status.
@since 2.2.0
@param mixed $mailbox A mailbox. Either a Horde_Imap_Client_Mailbox
object or a string (UTF-8).
@return string The sync token.
@throws Horde_Imap_Client_Exception | [
"Returns",
"a",
"unique",
"token",
"for",
"the",
"current",
"mailbox",
"synchronization",
"status",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L3581-L3590 |
218,763 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base.sync | public function sync($mailbox, $token, array $opts = array())
{
if (($token = base64_decode($token, true)) === false) {
throw new Horde_Imap_Client_Exception_Sync('Bad token.', Horde_Imap_Client_Exception_Sync::BAD_TOKEN);
}
$sync = array();
foreach (explode(',', $token)... | php | public function sync($mailbox, $token, array $opts = array())
{
if (($token = base64_decode($token, true)) === false) {
throw new Horde_Imap_Client_Exception_Sync('Bad token.', Horde_Imap_Client_Exception_Sync::BAD_TOKEN);
}
$sync = array();
foreach (explode(',', $token)... | [
"public",
"function",
"sync",
"(",
"$",
"mailbox",
",",
"$",
"token",
",",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"(",
"$",
"token",
"=",
"base64_decode",
"(",
"$",
"token",
",",
"true",
")",
")",
"===",
"false",
")",
... | Synchronize a mailbox from a sync token.
@since 2.2.0
@param mixed $mailbox A mailbox. Either a Horde_Imap_Client_Mailbox
object or a string (UTF-8).
@param string $token A sync token generated by getSyncToken().
@param array $opts Additional options:
- criteria: (integer) Mask of Horde_Imap_Client::SYNC_* cri... | [
"Synchronize",
"a",
"mailbox",
"from",
"a",
"sync",
"token",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L3612-L3631 |
218,764 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._moveCache | protected function _moveCache(Horde_Imap_Client_Mailbox $to, $map,
$uidvalid)
{
if (!$this->_initCache()) {
return;
}
$c = $this->getParam('cache');
if (in_array(strval($to), $c['fetch_ignore'])) {
$this->_debug->info(sprintf... | php | protected function _moveCache(Horde_Imap_Client_Mailbox $to, $map,
$uidvalid)
{
if (!$this->_initCache()) {
return;
}
$c = $this->getParam('cache');
if (in_array(strval($to), $c['fetch_ignore'])) {
$this->_debug->info(sprintf... | [
"protected",
"function",
"_moveCache",
"(",
"Horde_Imap_Client_Mailbox",
"$",
"to",
",",
"$",
"map",
",",
"$",
"uidvalid",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_initCache",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"c",
"=",
"$",
"this",
... | Moves cache entries from the current mailbox to another mailbox.
@param Horde_Imap_Client_Mailbox $to The destination mailbox.
@param array $map Mapping of source UIDs (keys) to
destination UIDs (values).
@param string $uidvalid UIDVALIDITY of destination
mailbox.
@throws Horde_Imap... | [
"Moves",
"cache",
"entries",
"from",
"the",
"current",
"mailbox",
"to",
"another",
"mailbox",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L3753-L3782 |
218,765 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._getSearchCache | protected function _getSearchCache($type, $options)
{
$status = $this->status($this->_selected, Horde_Imap_Client::STATUS_HIGHESTMODSEQ | Horde_Imap_Client::STATUS_UIDVALIDITY);
/* Search caching requires MODSEQ, which may not be active for a
* mailbox. */
if (empty($status['highes... | php | protected function _getSearchCache($type, $options)
{
$status = $this->status($this->_selected, Horde_Imap_Client::STATUS_HIGHESTMODSEQ | Horde_Imap_Client::STATUS_UIDVALIDITY);
/* Search caching requires MODSEQ, which may not be active for a
* mailbox. */
if (empty($status['highes... | [
"protected",
"function",
"_getSearchCache",
"(",
"$",
"type",
",",
"$",
"options",
")",
"{",
"$",
"status",
"=",
"$",
"this",
"->",
"status",
"(",
"$",
"this",
"->",
"_selected",
",",
"Horde_Imap_Client",
"::",
"STATUS_HIGHESTMODSEQ",
"|",
"Horde_Imap_Client",... | Retrieve data from the search cache.
@param string $type The cache type ('search' or 'thread').
@param array $options The options array of the calling function.
@return mixed Returns search cache metadata. If search was retrieved,
data is in key 'data'.
Returns null if caching is not available. | [
"Retrieve",
"data",
"from",
"the",
"search",
"cache",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L3826-L3875 |
218,766 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._setSearchCache | protected function _setSearchCache($data, $sdata)
{
$sdata['metadata'][self::CACHE_SEARCH][$sdata['id']] = $data;
$this->_cache->setMetaData($this->_selected, null, $sdata['metadata']);
if ($this->_debug->debug) {
$this->_debug->info(sprintf(
'SEARCH: Saved %s t... | php | protected function _setSearchCache($data, $sdata)
{
$sdata['metadata'][self::CACHE_SEARCH][$sdata['id']] = $data;
$this->_cache->setMetaData($this->_selected, null, $sdata['metadata']);
if ($this->_debug->debug) {
$this->_debug->info(sprintf(
'SEARCH: Saved %s t... | [
"protected",
"function",
"_setSearchCache",
"(",
"$",
"data",
",",
"$",
"sdata",
")",
"{",
"$",
"sdata",
"[",
"'metadata'",
"]",
"[",
"self",
"::",
"CACHE_SEARCH",
"]",
"[",
"$",
"sdata",
"[",
"'id'",
"]",
"]",
"=",
"$",
"data",
";",
"$",
"this",
"... | Set data in the search cache.
@param mixed $data The cache data to store.
@param string $sdata The search data returned from _getSearchCache(). | [
"Set",
"data",
"in",
"the",
"search",
"cache",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L3883-L3898 |
218,767 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._updateModSeq | protected function _updateModSeq($modseq)
{
if (!$this->_initCache(true)) {
return false;
}
$mbox_ob = $this->_mailboxOb();
$uidvalid = $mbox_ob->getStatus(Horde_Imap_Client::STATUS_UIDVALIDITY);
$md = $this->_cache->getMetaData($this->_selected, $uidvalid, array... | php | protected function _updateModSeq($modseq)
{
if (!$this->_initCache(true)) {
return false;
}
$mbox_ob = $this->_mailboxOb();
$uidvalid = $mbox_ob->getStatus(Horde_Imap_Client::STATUS_UIDVALIDITY);
$md = $this->_cache->getMetaData($this->_selected, $uidvalid, array... | [
"protected",
"function",
"_updateModSeq",
"(",
"$",
"modseq",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_initCache",
"(",
"true",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"mbox_ob",
"=",
"$",
"this",
"->",
"_mailboxOb",
"(",
")",
";",
"... | Updates the cached MODSEQ value.
@param integer $modseq MODSEQ value to store.
@return mixed The MODSEQ of the old value if it was replaced (or false
if it didn't exist or is the same). | [
"Updates",
"the",
"cached",
"MODSEQ",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L3908-L3940 |
218,768 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._cacheFields | protected function _cacheFields()
{
$c = $this->getParam('cache');
$out = $c['fields'];
if (!$this->_capability()->isEnabled('CONDSTORE')) {
unset($out[Horde_Imap_Client::FETCH_FLAGS]);
}
return $out;
} | php | protected function _cacheFields()
{
$c = $this->getParam('cache');
$out = $c['fields'];
if (!$this->_capability()->isEnabled('CONDSTORE')) {
unset($out[Horde_Imap_Client::FETCH_FLAGS]);
}
return $out;
} | [
"protected",
"function",
"_cacheFields",
"(",
")",
"{",
"$",
"c",
"=",
"$",
"this",
"->",
"getParam",
"(",
"'cache'",
")",
";",
"$",
"out",
"=",
"$",
"c",
"[",
"'fields'",
"]",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"_capability",
"(",
")",
"->"... | Provide the list of available caching fields.
@return array The list of available caching fields (fields are in the
key). | [
"Provide",
"the",
"list",
"of",
"available",
"caching",
"fields",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L4005-L4015 |
218,769 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._syncStatus | protected function _syncStatus($mailbox)
{
$status = $this->status(
$mailbox,
Horde_Imap_Client::STATUS_HIGHESTMODSEQ |
Horde_Imap_Client::STATUS_MESSAGES |
Horde_Imap_Client::STATUS_UIDNEXT_FORCE |
Horde_Imap_Client::STATUS_UIDVALIDITY
);
... | php | protected function _syncStatus($mailbox)
{
$status = $this->status(
$mailbox,
Horde_Imap_Client::STATUS_HIGHESTMODSEQ |
Horde_Imap_Client::STATUS_MESSAGES |
Horde_Imap_Client::STATUS_UIDNEXT_FORCE |
Horde_Imap_Client::STATUS_UIDVALIDITY
);
... | [
"protected",
"function",
"_syncStatus",
"(",
"$",
"mailbox",
")",
"{",
"$",
"status",
"=",
"$",
"this",
"->",
"status",
"(",
"$",
"mailbox",
",",
"Horde_Imap_Client",
"::",
"STATUS_HIGHESTMODSEQ",
"|",
"Horde_Imap_Client",
"::",
"STATUS_MESSAGES",
"|",
"Horde_Im... | Return the current mailbox synchronization status.
@param mixed $mailbox A mailbox. Either a Horde_Imap_Client_Mailbox
object or a string (UTF-8).
@return array An array with status data. (This data is not guaranteed
to have any specific format). | [
"Return",
"the",
"current",
"mailbox",
"synchronization",
"status",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L4026-L4051 |
218,770 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Base.php | Horde_Imap_Client_Base._getUidByMessageId | protected function _getUidByMessageId($mailbox, $msgid)
{
if (!$msgid) {
return null;
}
$query = new Horde_Imap_Client_Search_Query();
$query->headerText('Message-ID', $msgid);
$res = $this->search($mailbox, $query, array(
'results' => array(Horde_Ima... | php | protected function _getUidByMessageId($mailbox, $msgid)
{
if (!$msgid) {
return null;
}
$query = new Horde_Imap_Client_Search_Query();
$query->headerText('Message-ID', $msgid);
$res = $this->search($mailbox, $query, array(
'results' => array(Horde_Ima... | [
"protected",
"function",
"_getUidByMessageId",
"(",
"$",
"mailbox",
",",
"$",
"msgid",
")",
"{",
"if",
"(",
"!",
"$",
"msgid",
")",
"{",
"return",
"null",
";",
"}",
"$",
"query",
"=",
"new",
"Horde_Imap_Client_Search_Query",
"(",
")",
";",
"$",
"query",
... | Get a message UID by the Message-ID. Returns the last message in a
mailbox that matches.
@param Horde_Imap_Client_Mailbox $mailbox The mailbox to search
@param string $msgid Message-ID.
@return string UID (null if not found). | [
"Get",
"a",
"message",
"UID",
"by",
"the",
"Message",
"-",
"ID",
".",
"Returns",
"the",
"last",
"message",
"in",
"a",
"mailbox",
"that",
"matches",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Base.php#L4062-L4075 |
218,771 | moodle/moodle | lib/horde/framework/Horde/Exception/Pear.php | Horde_Exception_Pear._getPearTrace | private function _getPearTrace(PEAR_Error $error)
{
$pear_error = '';
$backtrace = $error->getBacktrace();
if (!empty($backtrace)) {
$pear_error .= 'PEAR backtrace:' . "\n\n";
foreach ($backtrace as $frame) {
$pear_error .=
(isset... | php | private function _getPearTrace(PEAR_Error $error)
{
$pear_error = '';
$backtrace = $error->getBacktrace();
if (!empty($backtrace)) {
$pear_error .= 'PEAR backtrace:' . "\n\n";
foreach ($backtrace as $frame) {
$pear_error .=
(isset... | [
"private",
"function",
"_getPearTrace",
"(",
"PEAR_Error",
"$",
"error",
")",
"{",
"$",
"pear_error",
"=",
"''",
";",
"$",
"backtrace",
"=",
"$",
"error",
"->",
"getBacktrace",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"backtrace",
")",
")",
... | Return a trace for the PEAR error.
@param PEAR_Error $error The PEAR error.
@return string The backtrace as a string. | [
"Return",
"a",
"trace",
"for",
"the",
"PEAR",
"error",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Exception/Pear.php#L50-L75 |
218,772 | moodle/moodle | favourites/classes/privacy/provider.php | provider.add_userids_for_context | public static function add_userids_for_context(\core_privacy\local\request\userlist $userlist,
string $itemtype = null) {
if (empty($userlist)) {
return;
}
$params = [
'contextid' => $userlist->get_context()->id,
... | php | public static function add_userids_for_context(\core_privacy\local\request\userlist $userlist,
string $itemtype = null) {
if (empty($userlist)) {
return;
}
$params = [
'contextid' => $userlist->get_context()->id,
... | [
"public",
"static",
"function",
"add_userids_for_context",
"(",
"\\",
"core_privacy",
"\\",
"local",
"\\",
"request",
"\\",
"userlist",
"$",
"userlist",
",",
"string",
"$",
"itemtype",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"userlist",
")",
"... | Add users to a userlist who have favourites within the specified context.
@param \core_privacy\local\request\userlist $userlist The userlist to add the users to.
@param string $itemtype the type of the favourited items.
@return void | [
"Add",
"users",
"to",
"a",
"userlist",
"who",
"have",
"favourites",
"within",
"the",
"specified",
"context",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/favourites/classes/privacy/provider.php#L111-L133 |
218,773 | moodle/moodle | favourites/classes/privacy/provider.php | provider.get_favourites_info_for_user | public static function get_favourites_info_for_user(int $userid, \context $context,
string $component, string $itemtype, int $itemid) {
global $DB;
$params = [
'userid' => $userid,
'component' => $component,
'it... | php | public static function get_favourites_info_for_user(int $userid, \context $context,
string $component, string $itemtype, int $itemid) {
global $DB;
$params = [
'userid' => $userid,
'component' => $component,
'it... | [
"public",
"static",
"function",
"get_favourites_info_for_user",
"(",
"int",
"$",
"userid",
",",
"\\",
"context",
"$",
"context",
",",
"string",
"$",
"component",
",",
"string",
"$",
"itemtype",
",",
"int",
"$",
"itemid",
")",
"{",
"global",
"$",
"DB",
";",... | Get favourites data for the specified user in the specified component, item type and item ID.
@param int $userid The id of the user in scope.
@param \context $context The context to which data is scoped.
@param string $component The favourite's component name.
@param string $itemtype The favourite's item type.
@param ... | [
"Get",
"favourites",
"data",
"for",
"the",
"specified",
"user",
"in",
"the",
"specified",
"component",
"item",
"type",
"and",
"item",
"ID",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/favourites/classes/privacy/provider.php#L145-L167 |
218,774 | moodle/moodle | favourites/classes/privacy/provider.php | provider.delete_favourites_for_all_users | public static function delete_favourites_for_all_users(\context $context, string $component, string $itemtype,
int $itemid = 0) {
global $DB;
$params = [
'component' => $component,
'itemtype' => $itemtype,
'c... | php | public static function delete_favourites_for_all_users(\context $context, string $component, string $itemtype,
int $itemid = 0) {
global $DB;
$params = [
'component' => $component,
'itemtype' => $itemtype,
'c... | [
"public",
"static",
"function",
"delete_favourites_for_all_users",
"(",
"\\",
"context",
"$",
"context",
",",
"string",
"$",
"component",
",",
"string",
"$",
"itemtype",
",",
"int",
"$",
"itemid",
"=",
"0",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params"... | Delete all favourites for all users in the specified contexts, and component area.
@param \context $context The context to which deletion is scoped.
@param string $component The favourite's component name.
@param string $itemtype The favourite's itemtype.
@param int $itemid Optional itemid associated with component.
@... | [
"Delete",
"all",
"favourites",
"for",
"all",
"users",
"in",
"the",
"specified",
"contexts",
"and",
"component",
"area",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/favourites/classes/privacy/provider.php#L178-L195 |
218,775 | moodle/moodle | favourites/classes/privacy/provider.php | provider.delete_favourites_for_userlist | public static function delete_favourites_for_userlist(\core_privacy\local\request\approved_userlist $userlist,
string $itemtype, int $itemid = 0) {
global $DB;
$userids = $userlist->get_userids();
if (empty($userids)) {
retu... | php | public static function delete_favourites_for_userlist(\core_privacy\local\request\approved_userlist $userlist,
string $itemtype, int $itemid = 0) {
global $DB;
$userids = $userlist->get_userids();
if (empty($userids)) {
retu... | [
"public",
"static",
"function",
"delete_favourites_for_userlist",
"(",
"\\",
"core_privacy",
"\\",
"local",
"\\",
"request",
"\\",
"approved_userlist",
"$",
"userlist",
",",
"string",
"$",
"itemtype",
",",
"int",
"$",
"itemid",
"=",
"0",
")",
"{",
"global",
"$... | Delete all favourites for the specified users in the specified context, component area and item type.
@param \core_privacy\local\request\approved_userlist $userlist The approved contexts and user information
to delete information for.
@param string $itemtype The favourite's itemtype.
@param int $itemid Optional itemid... | [
"Delete",
"all",
"favourites",
"for",
"the",
"specified",
"users",
"in",
"the",
"specified",
"context",
"component",
"area",
"and",
"item",
"type",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/favourites/classes/privacy/provider.php#L206-L234 |
218,776 | moodle/moodle | favourites/classes/privacy/provider.php | provider.delete_favourites_for_user | public static function delete_favourites_for_user(approved_contextlist $contextlist, string $component, string $itemtype,
int $itemid = 0) {
global $DB;
$userid = $contextlist->get_user()->id;
list($insql, $inparams) = $DB->get_in_or_equal(... | php | public static function delete_favourites_for_user(approved_contextlist $contextlist, string $component, string $itemtype,
int $itemid = 0) {
global $DB;
$userid = $contextlist->get_user()->id;
list($insql, $inparams) = $DB->get_in_or_equal(... | [
"public",
"static",
"function",
"delete_favourites_for_user",
"(",
"approved_contextlist",
"$",
"contextlist",
",",
"string",
"$",
"component",
",",
"string",
"$",
"itemtype",
",",
"int",
"$",
"itemid",
"=",
"0",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"use... | Delete all favourites for the specified user, in the specified contexts.
@param approved_contextlist $contextlist The approved contexts and user information to delete information for.
@param string $component The favourite's component name.
@param string $itemtype The favourite's itemtype.
@param int $itemid Optional ... | [
"Delete",
"all",
"favourites",
"for",
"the",
"specified",
"user",
"in",
"the",
"specified",
"contexts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/favourites/classes/privacy/provider.php#L246-L269 |
218,777 | moodle/moodle | privacy/classes/output/exported_navigation_page.php | exported_navigation_page.create_navigation | protected function create_navigation(\stdClass $tree) {
if ($this->firstelement) {
$html = \html_writer::start_tag('ul', ['class' => 'treeview parent block_tree list', 'id' => 'my-tree']);
$this->firstelement = false;
} else {
$html = \html_writer::start_tag('ul', ['c... | php | protected function create_navigation(\stdClass $tree) {
if ($this->firstelement) {
$html = \html_writer::start_tag('ul', ['class' => 'treeview parent block_tree list', 'id' => 'my-tree']);
$this->firstelement = false;
} else {
$html = \html_writer::start_tag('ul', ['c... | [
"protected",
"function",
"create_navigation",
"(",
"\\",
"stdClass",
"$",
"tree",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"firstelement",
")",
"{",
"$",
"html",
"=",
"\\",
"html_writer",
"::",
"start_tag",
"(",
"'ul'",
",",
"[",
"'class'",
"=>",
"'treevi... | Creates the navigation list html. Why this and not a template? My attempts at trying to get a recursive template
working failed.
@param \stdClass $tree Full tree to create navigation out of.
@return string navigation html. | [
"Creates",
"the",
"navigation",
"list",
"html",
".",
"Why",
"this",
"and",
"not",
"a",
"template?",
"My",
"attempts",
"at",
"trying",
"to",
"get",
"a",
"recursive",
"template",
"working",
"failed",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/output/exported_navigation_page.php#L61-L86 |
218,778 | moodle/moodle | mod/quiz/backup/moodle2/restore_quiz_stepslib.php | restore_quiz_activity_structure_step.process_quiz_slot_tags | protected function process_quiz_slot_tags($data) {
global $DB;
$data = (object)$data;
$data->slotid = $this->get_new_parentid('quiz_question_instance');
if ($this->task->is_samesite() && $tag = core_tag_tag::get($data->tagid, 'id, name')) {
$data->tagname = $tag->name;
... | php | protected function process_quiz_slot_tags($data) {
global $DB;
$data = (object)$data;
$data->slotid = $this->get_new_parentid('quiz_question_instance');
if ($this->task->is_samesite() && $tag = core_tag_tag::get($data->tagid, 'id, name')) {
$data->tagname = $tag->name;
... | [
"protected",
"function",
"process_quiz_slot_tags",
"(",
"$",
"data",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"data",
"=",
"(",
"object",
")",
"$",
"data",
";",
"$",
"data",
"->",
"slotid",
"=",
"$",
"this",
"->",
"get_new_parentid",
"(",
"'quiz_question... | Process a quiz_slot_tags restore
@param stdClass|array $data The quiz_slot_tags data | [
"Process",
"a",
"quiz_slot_tags",
"restore"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/backup/moodle2/restore_quiz_stepslib.php#L317-L333 |
218,779 | moodle/moodle | lib/adodb/drivers/adodb-borland_ibase.inc.php | ADODB_borland_ibase.SelectLimit | function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
{
if ($nrows > 0) {
if ($offset <= 0) $str = " ROWS $nrows ";
else {
$a = $offset+1;
$b = $offset+$nrows;
$str = " ROWS $a TO $b";
}
} else {
// ok, skip
$a = $offset + 1;
$str = " ROWS $a TO 999999999"; // ... | php | function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
{
if ($nrows > 0) {
if ($offset <= 0) $str = " ROWS $nrows ";
else {
$a = $offset+1;
$b = $offset+$nrows;
$str = " ROWS $a TO $b";
}
} else {
// ok, skip
$a = $offset + 1;
$str = " ROWS $a TO 999999999"; // ... | [
"function",
"SelectLimit",
"(",
"$",
"sql",
",",
"$",
"nrows",
"=",
"-",
"1",
",",
"$",
"offset",
"=",
"-",
"1",
",",
"$",
"inputarr",
"=",
"false",
",",
"$",
"secs2cache",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"nrows",
">",
"0",
")",
"{",
"if"... | SELECT FIRST 5 SKIP 2 col1, col2 FROM TABLE | [
"SELECT",
"FIRST",
"5",
"SKIP",
"2",
"col1",
"col2",
"FROM",
"TABLE"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/drivers/adodb-borland_ibase.inc.php#L54-L74 |
218,780 | moodle/moodle | message/output/airnotifier/externallib.php | message_airnotifier_external.get_user_devices | public static function get_user_devices($appid, $userid = 0) {
global $USER;
$params = self::validate_parameters(
self::get_user_devices_parameters(),
array(
'appid' => $appid,
'userid' => $userid,
)
);
$context = cont... | php | public static function get_user_devices($appid, $userid = 0) {
global $USER;
$params = self::validate_parameters(
self::get_user_devices_parameters(),
array(
'appid' => $appid,
'userid' => $userid,
)
);
$context = cont... | [
"public",
"static",
"function",
"get_user_devices",
"(",
"$",
"appid",
",",
"$",
"userid",
"=",
"0",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_user_devices_parameters",
"(",
")",
... | Return the list of mobile devices that are registered in Moodle for the given user.
@param string $appid app unique id (usually a reversed domain)
@param integer $userid the user id, 0 for current user
@return array warnings and devices
@throws moodle_exception
@since Moodle 3.2 | [
"Return",
"the",
"list",
"of",
"mobile",
"devices",
"that",
"are",
"registered",
"in",
"Moodle",
"for",
"the",
"given",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/output/airnotifier/externallib.php#L238-L292 |
218,781 | moodle/moodle | lib/adodb/adodb-pear.inc.php | DB.factory | function factory($type)
{
include_once(ADODB_DIR."/drivers/adodb-$type.inc.php");
$obj = NewADOConnection($type);
if (!is_object($obj)) $obj = new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1);
return $obj;
} | php | function factory($type)
{
include_once(ADODB_DIR."/drivers/adodb-$type.inc.php");
$obj = NewADOConnection($type);
if (!is_object($obj)) $obj = new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1);
return $obj;
} | [
"function",
"factory",
"(",
"$",
"type",
")",
"{",
"include_once",
"(",
"ADODB_DIR",
".",
"\"/drivers/adodb-$type.inc.php\"",
")",
";",
"$",
"obj",
"=",
"NewADOConnection",
"(",
"$",
"type",
")",
";",
"if",
"(",
"!",
"is_object",
"(",
"$",
"obj",
")",
")... | Create a new DB object for the specified database type
@param $type string database type, for example "mysql"
@return object a newly created DB object, or a DB error code on
error | [
"Create",
"a",
"new",
"DB",
"object",
"for",
"the",
"specified",
"database",
"type"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-pear.inc.php#L110-L116 |
218,782 | moodle/moodle | lib/adodb/adodb-pear.inc.php | DB.connect | function connect($dsn, $options = false)
{
if (is_array($dsn)) {
$dsninfo = $dsn;
} else {
$dsninfo = DB::parseDSN($dsn);
}
switch ($dsninfo["phptype"]) {
case 'pgsql': $type = 'postgres7'; break;
case 'ifx': $type = 'informix9'; break;
default: $type = $dsninfo["phptype"]; break;
}
if ... | php | function connect($dsn, $options = false)
{
if (is_array($dsn)) {
$dsninfo = $dsn;
} else {
$dsninfo = DB::parseDSN($dsn);
}
switch ($dsninfo["phptype"]) {
case 'pgsql': $type = 'postgres7'; break;
case 'ifx': $type = 'informix9'; break;
default: $type = $dsninfo["phptype"]; break;
}
if ... | [
"function",
"connect",
"(",
"$",
"dsn",
",",
"$",
"options",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"dsn",
")",
")",
"{",
"$",
"dsninfo",
"=",
"$",
"dsn",
";",
"}",
"else",
"{",
"$",
"dsninfo",
"=",
"DB",
"::",
"parseDSN",
"("... | Create a new DB object and connect to the specified database
@param $dsn mixed "data source name", see the DB::parseDSN
method for a description of the dsn format. Can also be
specified as an array of the format returned by DB::parseDSN.
@param $options mixed if boolean (or scalar), tells whether
this connection sho... | [
"Create",
"a",
"new",
"DB",
"object",
"and",
"connect",
"to",
"the",
"specified",
"database"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-pear.inc.php#L137-L190 |
218,783 | moodle/moodle | lib/adodb/adodb-pear.inc.php | DB.isError | function isError($value)
{
if (!is_object($value)) return false;
$class = strtolower(get_class($value));
return $class == 'pear_error' || is_subclass_of($value, 'pear_error') ||
$class == 'db_error' || is_subclass_of($value, 'db_error');
} | php | function isError($value)
{
if (!is_object($value)) return false;
$class = strtolower(get_class($value));
return $class == 'pear_error' || is_subclass_of($value, 'pear_error') ||
$class == 'db_error' || is_subclass_of($value, 'db_error');
} | [
"function",
"isError",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"value",
")",
")",
"return",
"false",
";",
"$",
"class",
"=",
"strtolower",
"(",
"get_class",
"(",
"$",
"value",
")",
")",
";",
"return",
"$",
"class",
"==",... | Tell whether a result code from a DB method is an error
@param $value int result code
@return bool whether $value is an error | [
"Tell",
"whether",
"a",
"result",
"code",
"from",
"a",
"DB",
"method",
"is",
"an",
"error"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-pear.inc.php#L209-L215 |
218,784 | moodle/moodle | lib/adodb/adodb-pear.inc.php | DB.parseDSN | function parseDSN($dsn)
{
if (is_array($dsn)) {
return $dsn;
}
$parsed = array(
'phptype' => false,
'dbsyntax' => false,
'protocol' => false,
'hostspec' => false,
'database' => false,
'username' => false,
'password' => false
);
// Find phptype and dbsyntax
if (($pos = strpos($dsn... | php | function parseDSN($dsn)
{
if (is_array($dsn)) {
return $dsn;
}
$parsed = array(
'phptype' => false,
'dbsyntax' => false,
'protocol' => false,
'hostspec' => false,
'database' => false,
'username' => false,
'password' => false
);
// Find phptype and dbsyntax
if (($pos = strpos($dsn... | [
"function",
"parseDSN",
"(",
"$",
"dsn",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"dsn",
")",
")",
"{",
"return",
"$",
"dsn",
";",
"}",
"$",
"parsed",
"=",
"array",
"(",
"'phptype'",
"=>",
"false",
",",
"'dbsyntax'",
"=>",
"false",
",",
"'protoco... | Parse a data source name
@param $dsn string Data Source Name to be parsed
@return array an associative array with the following keys:
phptype: Database backend used in PHP (mysql, odbc etc.)
dbsyntax: Database used with regards to SQL syntax etc.
protocol: Communication protocol to use (tcp, unix etc.)
hostspec: Hos... | [
"Parse",
"a",
"data",
"source",
"name"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-pear.inc.php#L268-L346 |
218,785 | moodle/moodle | lib/adodb/adodb-pear.inc.php | DB.assertExtension | function assertExtension($name)
{
if (!extension_loaded($name)) {
$dlext = (strncmp(PHP_OS,'WIN',3) === 0) ? '.dll' : '.so';
@dl($name . $dlext);
}
if (!extension_loaded($name)) {
return false;
}
return true;
} | php | function assertExtension($name)
{
if (!extension_loaded($name)) {
$dlext = (strncmp(PHP_OS,'WIN',3) === 0) ? '.dll' : '.so';
@dl($name . $dlext);
}
if (!extension_loaded($name)) {
return false;
}
return true;
} | [
"function",
"assertExtension",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"extension_loaded",
"(",
"$",
"name",
")",
")",
"{",
"$",
"dlext",
"=",
"(",
"strncmp",
"(",
"PHP_OS",
",",
"'WIN'",
",",
"3",
")",
"===",
"0",
")",
"?",
"'.dll'",
":",
"'... | Load a PHP database extension if it is not loaded already.
@access public
@param $name the base name of the extension (without the .so or
.dll suffix)
@return bool true if the extension was already or successfully
loaded, false if it could not be loaded | [
"Load",
"a",
"PHP",
"database",
"extension",
"if",
"it",
"is",
"not",
"loaded",
"already",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-pear.inc.php#L359-L369 |
218,786 | moodle/moodle | files/externallib.php | core_files_external.get_files_parameters | public static function get_files_parameters() {
return new external_function_parameters(
array(
'contextid' => new external_value(PARAM_INT, 'context id Set to -1 to use contextlevel and instanceid.'),
'component' => new external_value(PARAM_TEXT, 'component'),
... | php | public static function get_files_parameters() {
return new external_function_parameters(
array(
'contextid' => new external_value(PARAM_INT, 'context id Set to -1 to use contextlevel and instanceid.'),
'component' => new external_value(PARAM_TEXT, 'component'),
... | [
"public",
"static",
"function",
"get_files_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'contextid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'context id Set to -1 to use contextlevel and instanceid.'",
")",... | Returns description of get_files parameters
@return external_function_parameters
@since Moodle 2.2 | [
"Returns",
"description",
"of",
"get_files",
"parameters"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/files/externallib.php#L49-L64 |
218,787 | moodle/moodle | files/externallib.php | core_files_external.get_files_returns | public static function get_files_returns() {
return new external_single_structure(
array(
'parents' => new external_multiple_structure(
new external_single_structure(
array(
'contextid' => new external_value(PARA... | php | public static function get_files_returns() {
return new external_single_structure(
array(
'parents' => new external_multiple_structure(
new external_single_structure(
array(
'contextid' => new external_value(PARA... | [
"public",
"static",
"function",
"get_files_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'parents'",
"=>",
"new",
"external_multiple_structure",
"(",
"new",
"external_single_structure",
"(",
"array",
"(",
"'contextid'",
"=>... | Returns description of get_files returns
@return external_single_structure
@since Moodle 2.9 Returns additional fields for files (timecreated, filesize, author, license)
@since Moodle 2.2 | [
"Returns",
"description",
"of",
"get_files",
"returns"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/files/externallib.php#L199-L235 |
218,788 | moodle/moodle | files/externallib.php | core_files_external.upload_parameters | public static function upload_parameters() {
return new external_function_parameters(
array(
'contextid' => new external_value(PARAM_INT, 'context id', VALUE_DEFAULT, null),
'component' => new external_value(PARAM_COMPONENT, 'component'),
'filearea' =... | php | public static function upload_parameters() {
return new external_function_parameters(
array(
'contextid' => new external_value(PARAM_INT, 'context id', VALUE_DEFAULT, null),
'component' => new external_value(PARAM_COMPONENT, 'component'),
'filearea' =... | [
"public",
"static",
"function",
"upload_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'contextid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'context id'",
",",
"VALUE_DEFAULT",
",",
"null",
")",
","... | Returns description of upload parameters
@return external_function_parameters
@since Moodle 2.2 | [
"Returns",
"description",
"of",
"upload",
"parameters"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/files/externallib.php#L243-L259 |
218,789 | moodle/moodle | files/externallib.php | core_files_external.upload_returns | public static function upload_returns() {
return new external_single_structure(
array(
'contextid' => new external_value(PARAM_INT, ''),
'component' => new external_value(PARAM_COMPONENT, ''),
'filearea' => new external_value(PARAM_AREA, ''),
... | php | public static function upload_returns() {
return new external_single_structure(
array(
'contextid' => new external_value(PARAM_INT, ''),
'component' => new external_value(PARAM_COMPONENT, ''),
'filearea' => new external_value(PARAM_AREA, ''),
... | [
"public",
"static",
"function",
"upload_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'contextid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"''",
")",
",",
"'component'",
"=>",
"new",
"external_value",
"... | Returns description of upload returns
@return external_single_structure
@since Moodle 2.2 | [
"Returns",
"description",
"of",
"upload",
"returns"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/files/externallib.php#L376-L388 |
218,790 | moodle/moodle | user/profile/field/checkbox/classes/privacy/provider.php | provider.get_records | protected static function get_records($userid) {
global $DB;
$sql = "SELECT *
FROM {user_info_data} uda
JOIN {user_info_field} uif ON uda.fieldid = uif.id
WHERE uda.userid = :userid
AND uif.datatype = :datatype";
$param... | php | protected static function get_records($userid) {
global $DB;
$sql = "SELECT *
FROM {user_info_data} uda
JOIN {user_info_field} uif ON uda.fieldid = uif.id
WHERE uda.userid = :userid
AND uif.datatype = :datatype";
$param... | [
"protected",
"static",
"function",
"get_records",
"(",
"$",
"userid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"\"SELECT *\n FROM {user_info_data} uda\n JOIN {user_info_field} uif ON uda.fieldid = uif.id\n WHERE uda.userid... | Get records related to this plugin and user.
@param int $userid The user ID
@return array An array of records. | [
"Get",
"records",
"related",
"to",
"this",
"plugin",
"and",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/user/profile/field/checkbox/classes/privacy/provider.php#L201-L215 |
218,791 | moodle/moodle | mod/lesson/mod_form.php | mod_lesson_mod_form.data_preprocessing | public function data_preprocessing(&$defaultvalues) {
if (isset($defaultvalues['conditions'])) {
$conditions = unserialize($defaultvalues['conditions']);
$defaultvalues['timespent'] = $conditions->timespent;
$defaultvalues['completed'] = $conditions->completed;
$d... | php | public function data_preprocessing(&$defaultvalues) {
if (isset($defaultvalues['conditions'])) {
$conditions = unserialize($defaultvalues['conditions']);
$defaultvalues['timespent'] = $conditions->timespent;
$defaultvalues['completed'] = $conditions->completed;
$d... | [
"public",
"function",
"data_preprocessing",
"(",
"&",
"$",
"defaultvalues",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"defaultvalues",
"[",
"'conditions'",
"]",
")",
")",
"{",
"$",
"conditions",
"=",
"unserialize",
"(",
"$",
"defaultvalues",
"[",
"'conditions'... | Enforce defaults here
@param array $defaultvalues Form defaults
@return void | [
"Enforce",
"defaults",
"here"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/mod_form.php#L359-L377 |
218,792 | moodle/moodle | mod/lesson/renderer.php | mod_lesson_renderer.header | public function header($lesson, $cm, $currenttab = '', $extraeditbuttons = false, $lessonpageid = null, $extrapagetitle = null) {
global $CFG;
$activityname = format_string($lesson->name, true, $lesson->course);
if (empty($extrapagetitle)) {
$title = $this->page->course->shortname."... | php | public function header($lesson, $cm, $currenttab = '', $extraeditbuttons = false, $lessonpageid = null, $extrapagetitle = null) {
global $CFG;
$activityname = format_string($lesson->name, true, $lesson->course);
if (empty($extrapagetitle)) {
$title = $this->page->course->shortname."... | [
"public",
"function",
"header",
"(",
"$",
"lesson",
",",
"$",
"cm",
",",
"$",
"currenttab",
"=",
"''",
",",
"$",
"extraeditbuttons",
"=",
"false",
",",
"$",
"lessonpageid",
"=",
"null",
",",
"$",
"extrapagetitle",
"=",
"null",
")",
"{",
"global",
"$",
... | Returns the header for the lesson module
@param lesson $lesson a lesson object.
@param string $currenttab current tab that is shown.
@param bool $extraeditbuttons if extra edit buttons should be displayed.
@param int $lessonpageid id of the lesson page that needs to be displayed.
@param string $extrapagetitle Str... | [
"Returns",
"the",
"header",
"for",
"the",
"lesson",
"module"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/renderer.php#L39-L76 |
218,793 | moodle/moodle | mod/lesson/renderer.php | mod_lesson_renderer.lesson_inaccessible | public function lesson_inaccessible($message) {
global $CFG;
$output = $this->output->box_start('generalbox boxaligncenter');
$output .= $this->output->box_start('center');
$output .= $message;
$output .= $this->output->box('<a href="'.$CFG->wwwroot.'/course/view.php?id='. $... | php | public function lesson_inaccessible($message) {
global $CFG;
$output = $this->output->box_start('generalbox boxaligncenter');
$output .= $this->output->box_start('center');
$output .= $message;
$output .= $this->output->box('<a href="'.$CFG->wwwroot.'/course/view.php?id='. $... | [
"public",
"function",
"lesson_inaccessible",
"(",
"$",
"message",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"output",
"=",
"$",
"this",
"->",
"output",
"->",
"box_start",
"(",
"'generalbox boxaligncenter'",
")",
";",
"$",
"output",
".=",
"$",
"this",
"->",... | Returns HTML for a lesson inaccessible message
@param string $message
@return <type> | [
"Returns",
"HTML",
"for",
"a",
"lesson",
"inaccessible",
"message"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/renderer.php#L92-L101 |
218,794 | moodle/moodle | mod/lesson/renderer.php | mod_lesson_renderer.login_prompt | public function login_prompt(lesson $lesson, $failedattempt = false) {
global $CFG;
$output = $this->output->box_start('password-form');
$output .= $this->output->box_start('generalbox boxaligncenter');
$output .= '<form id="password" method="post" action="'.$CFG->wwwroot.'/mod/lesson/... | php | public function login_prompt(lesson $lesson, $failedattempt = false) {
global $CFG;
$output = $this->output->box_start('password-form');
$output .= $this->output->box_start('generalbox boxaligncenter');
$output .= '<form id="password" method="post" action="'.$CFG->wwwroot.'/mod/lesson/... | [
"public",
"function",
"login_prompt",
"(",
"lesson",
"$",
"lesson",
",",
"$",
"failedattempt",
"=",
"false",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"output",
"=",
"$",
"this",
"->",
"output",
"->",
"box_start",
"(",
"'password-form'",
")",
";",
"$",
... | Returns HTML to prompt the user to log in
@param lesson $lesson
@param bool $failedattempt
@return string | [
"Returns",
"HTML",
"to",
"prompt",
"the",
"user",
"to",
"log",
"in"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/renderer.php#L109-L128 |
218,795 | moodle/moodle | mod/lesson/renderer.php | mod_lesson_renderer.dependancy_errors | public function dependancy_errors($dependentlesson, $errors) {
$output = $this->output->box_start('generalbox boxaligncenter');
$output .= get_string('completethefollowingconditions', 'lesson', $dependentlesson->name);
$output .= $this->output->box(implode('<br />'.get_string('and', 'lesson').'... | php | public function dependancy_errors($dependentlesson, $errors) {
$output = $this->output->box_start('generalbox boxaligncenter');
$output .= get_string('completethefollowingconditions', 'lesson', $dependentlesson->name);
$output .= $this->output->box(implode('<br />'.get_string('and', 'lesson').'... | [
"public",
"function",
"dependancy_errors",
"(",
"$",
"dependentlesson",
",",
"$",
"errors",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"output",
"->",
"box_start",
"(",
"'generalbox boxaligncenter'",
")",
";",
"$",
"output",
".=",
"get_string",
"(",
"'... | Returns HTML to display dependancy errors
@param object $dependentlesson
@param array $errors
@return string | [
"Returns",
"HTML",
"to",
"display",
"dependancy",
"errors"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/renderer.php#L137-L143 |
218,796 | moodle/moodle | mod/lesson/renderer.php | mod_lesson_renderer.message | public function message($message, single_button $button = null) {
$output = $this->output->box_start('generalbox boxaligncenter');
$output .= $message;
if ($button !== null) {
$output .= $this->output->box($this->output->render($button), 'lessonbutton standardbutton');
}
... | php | public function message($message, single_button $button = null) {
$output = $this->output->box_start('generalbox boxaligncenter');
$output .= $message;
if ($button !== null) {
$output .= $this->output->box($this->output->render($button), 'lessonbutton standardbutton');
}
... | [
"public",
"function",
"message",
"(",
"$",
"message",
",",
"single_button",
"$",
"button",
"=",
"null",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"output",
"->",
"box_start",
"(",
"'generalbox boxaligncenter'",
")",
";",
"$",
"output",
".=",
"$",
... | Returns HTML to display a message
@param string $message
@param single_button $button
@return string | [
"Returns",
"HTML",
"to",
"display",
"a",
"message"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/renderer.php#L151-L159 |
218,797 | moodle/moodle | mod/lesson/renderer.php | mod_lesson_renderer.continue_links | public function continue_links(lesson $lesson, $lastpageseenid) {
global $CFG;
$output = $this->output->box(get_string('youhaveseen','lesson'), 'generalbox boxaligncenter');
$output .= $this->output->box_start('center');
$yeslink = html_writer::link(new moodle_url('/mod/lesson/view.php'... | php | public function continue_links(lesson $lesson, $lastpageseenid) {
global $CFG;
$output = $this->output->box(get_string('youhaveseen','lesson'), 'generalbox boxaligncenter');
$output .= $this->output->box_start('center');
$yeslink = html_writer::link(new moodle_url('/mod/lesson/view.php'... | [
"public",
"function",
"continue_links",
"(",
"lesson",
"$",
"lesson",
",",
"$",
"lastpageseenid",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"output",
"=",
"$",
"this",
"->",
"output",
"->",
"box",
"(",
"get_string",
"(",
"'youhaveseen'",
",",
"'lesson'",
... | Returns HTML to display a continue button
@param lesson $lesson
@param int $lastpageseen
@return string | [
"Returns",
"HTML",
"to",
"display",
"a",
"continue",
"button"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/renderer.php#L167-L183 |
218,798 | moodle/moodle | mod/lesson/renderer.php | mod_lesson_renderer.display_page | public function display_page(lesson $lesson, lesson_page $page, $attempt) {
// We need to buffer here as there is an mforms display call
ob_start();
echo $page->display($this, $attempt);
$output = ob_get_contents();
ob_end_clean();
return $output;
} | php | public function display_page(lesson $lesson, lesson_page $page, $attempt) {
// We need to buffer here as there is an mforms display call
ob_start();
echo $page->display($this, $attempt);
$output = ob_get_contents();
ob_end_clean();
return $output;
} | [
"public",
"function",
"display_page",
"(",
"lesson",
"$",
"lesson",
",",
"lesson_page",
"$",
"page",
",",
"$",
"attempt",
")",
"{",
"// We need to buffer here as there is an mforms display call",
"ob_start",
"(",
")",
";",
"echo",
"$",
"page",
"->",
"display",
"("... | Returns HTML to display a page to the user
@param lesson $lesson
@param lesson_page $page
@param object $attempt
@return string | [
"Returns",
"HTML",
"to",
"display",
"a",
"page",
"to",
"the",
"user"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/renderer.php#L192-L199 |
218,799 | moodle/moodle | mod/lesson/renderer.php | mod_lesson_renderer.display_edit_collapsed | public function display_edit_collapsed(lesson $lesson, $pageid) {
global $DB, $CFG;
$manager = lesson_page_type_manager::get($lesson);
$qtypes = $manager->get_page_type_strings();
$npages = count($lesson->load_all_pages());
$table = new html_table();
$table->head = arra... | php | public function display_edit_collapsed(lesson $lesson, $pageid) {
global $DB, $CFG;
$manager = lesson_page_type_manager::get($lesson);
$qtypes = $manager->get_page_type_strings();
$npages = count($lesson->load_all_pages());
$table = new html_table();
$table->head = arra... | [
"public",
"function",
"display_edit_collapsed",
"(",
"lesson",
"$",
"lesson",
",",
"$",
"pageid",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"CFG",
";",
"$",
"manager",
"=",
"lesson_page_type_manager",
"::",
"get",
"(",
"$",
"lesson",
")",
";",
"$",
"qtype... | Returns HTML to display a collapsed edit form
@param lesson $lesson
@param int $pageid
@return string | [
"Returns",
"HTML",
"to",
"display",
"a",
"collapsed",
"edit",
"form"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/lesson/renderer.php#L208-L248 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.