public function is_allowed_in_context($typeid, $courseid) {
        global $DB;

        // Check if it is a Course tool for this course or a Site tool.
        $type = $DB->get_record('lti_types', array('id' => $typeid));

        return $type && ($type->course == $courseid || $type->course == SITEID);
    }
public function is_allowed_in_context($typeid, $courseid) {
        global $DB;

        // Check if it is a Course tool for this course or a Site tool.
        $type = $DB->get_record('lti_types', array('id' => $typeid));

        return $type && ($type->course == $courseid || $type->course == SITEID);
    }
public function is_allowed_in_context ( $ typeid , $ courseid ) { global $ DB ; // Check if it is a Course tool for this course or a Site tool. $ type = $ DB -> get_record ( 'lti_types' , array ( 'id' => $ typeid ) ) ; return $ type && ( $ type -> course == $ courseid || $ type -> course == SITEID ) ; }
Checks if there is a site tool or a course tool for this site.

@param int $typeid The tool lti type id.
@param int $courseid The course id.
@return bool returns True if tool is allowed in context, false otherwise.
Checks if there is a site tool or a course tool for this site .