本文整理汇总了PHP中cm_info::set_available方法的典型用法代码示例。如果您正苦于以下问题:PHP cm_info::set_available方法的具体用法?PHP cm_info::set_available怎么用?PHP cm_info::set_available使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cm_info
的用法示例。
在下文中一共展示了cm_info::set_available方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mod_forumng_cm_info_dynamic
/**
* Sets the module uservisible to false if the user has not got the view capability
* @param cm_info $cm
*/
function mod_forumng_cm_info_dynamic(cm_info $cm)
{
if (!has_capability('mod/forumng:view', context_module::instance($cm->id))) {
$cm->uservisible = false;
$cm->set_available(false);
}
}
示例2: ouwiki_cm_info_dynamic
/**
* Sets the module uservisible to false if the user has not got the view capability
* @param cm_info $cm
*/
function ouwiki_cm_info_dynamic(cm_info $cm)
{
if (!has_capability('mod/ouwiki:view', context_module::instance($cm->id))) {
$cm->set_user_visible(false);
$cm->set_available(false);
}
}
示例3: ouwiki_cm_info_dynamic
/**
* Sets the module uservisible to false if the user has not got the view capability
* @param cm_info $cm
*/
function ouwiki_cm_info_dynamic(cm_info $cm)
{
if (!has_capability('mod/ouwiki:view', get_context_instance(CONTEXT_MODULE, $cm->id))) {
$cm->uservisible = false;
$cm->set_available(false);
}
}
示例4: subpage_cm_info_dynamic
/**
* Sets the module uservisible to false if the user has not got the view
* capability.
* @param cm_info $cm Module data
*/
function subpage_cm_info_dynamic(cm_info $cm)
{
if (!has_capability('mod/subpage:view', get_context_instance(CONTEXT_MODULE, $cm->id))) {
$cm->set_available(false);
}
}
示例5: oublog_cm_info_dynamic
/**
* Sets the module uservisible to false if the user has not got the view capability
* @param cm_info $cm
*/
function oublog_cm_info_dynamic(cm_info $cm)
{
$capability = 'mod/oublog:view';
if ($cm->course == SITEID && $cm->instance == 1) {
// Is global blog (To save DB call we make suspect assumption it is instance 1)?
$capability = 'mod/oublog:viewpersonal';
}
if (!has_capability($capability, context_module::instance($cm->id))) {
$cm->set_user_visible(false);
$cm->set_available(false);
}
}
示例6: subpage_cm_info_dynamic
/**
* Sets the module uservisible to false if the user has not got the view
* capability.
* @param cm_info $cm Module data
*/
function subpage_cm_info_dynamic(cm_info $cm)
{
if (!has_capability('mod/subpage:view', context_module::instance($cm->id))) {
$cm->set_available(false);
}
}
示例7: oublog_cm_info_dynamic
/**
* Sets the module uservisible to false if the user has not got the view capability
* @param cm_info $cm
*/
function oublog_cm_info_dynamic(cm_info $cm)
{
global $remoteuserid, $USER;
$userid = $USER;
if (isset($remoteuserid) && !empty($remoteuserid)) {
// Hack using dodgy global. The actual user id for specific user e.g. from webservice.
$userid = $remoteuserid;
}
$capability = 'mod/oublog:view';
if ($cm->course == SITEID && $cm->instance == 1) {
// Is global blog (To save DB call we make suspect assumption it is instance 1)?
$capability = 'mod/oublog:viewpersonal';
}
if (!has_capability($capability, context_module::instance($cm->id), $userid)) {
$cm->set_user_visible(false);
$cm->set_available(false);
}
}