当前位置: 首页>>代码示例>>PHP>>正文


PHP show_event函数代码示例

本文整理汇总了PHP中show_event函数的典型用法代码示例。如果您正苦于以下问题:PHP show_event函数的具体用法?PHP show_event怎么用?PHP show_event使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了show_event函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: set_coursemodule_visible

/**
 * Set the visibility of a module and inherent properties.
 *
 * From 2.4 the parameter $prevstateoverrides has been removed, the logic it triggered
 * has been moved to {@link set_section_visible()} which was the only place from which
 * the parameter was used.
 *
 * @param int $id of the module
 * @param int $visible state of the module
 * @return bool false when the module was not found, true otherwise
 */
function set_coursemodule_visible($id, $visible)
{
    global $DB, $CFG;
    require_once $CFG->libdir . '/gradelib.php';
    // Trigger developer's attention when using the previously removed argument.
    if (func_num_args() > 2) {
        debugging('Wrong number of arguments passed to set_coursemodule_visible(), $prevstateoverrides
            has been removed.', DEBUG_DEVELOPER);
    }
    if (!($cm = $DB->get_record('course_modules', array('id' => $id)))) {
        return false;
    }
    // Create events and propagate visibility to associated grade items if the value has changed.
    // Only do this if it's changed to avoid accidently overwriting manual showing/hiding of student grades.
    if ($cm->visible == $visible) {
        return true;
    }
    if (!($modulename = $DB->get_field('modules', 'name', array('id' => $cm->module)))) {
        return false;
    }
    if ($events = $DB->get_records('event', array('instance' => $cm->instance, 'modulename' => $modulename))) {
        foreach ($events as $event) {
            if ($visible) {
                show_event($event);
            } else {
                hide_event($event);
            }
        }
    }
    // Hide the associated grade items so the teacher doesn't also have to go to the gradebook and hide them there.
    $grade_items = grade_item::fetch_all(array('itemtype' => 'mod', 'itemmodule' => $modulename, 'iteminstance' => $cm->instance, 'courseid' => $cm->course));
    if ($grade_items) {
        foreach ($grade_items as $grade_item) {
            $grade_item->set_hidden(!$visible);
        }
    }
    // Updating visible and visibleold to keep them in sync. Only changing a section visibility will
    // affect visibleold to allow for an original visibility restore. See set_section_visible().
    $cminfo = new stdClass();
    $cminfo->id = $id;
    $cminfo->visible = $visible;
    $cminfo->visibleold = $visible;
    $DB->update_record('course_modules', $cminfo);
    rebuild_course_cache($cm->course, true);
    return true;
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:57,代码来源:lib.php

示例2: set_coursemodule_visible

/**
* $prevstateoverrides = true will set the visibility of the course module
* to what is defined in visibleold. This enables us to remember the current
* visibility when making a whole section hidden, so that when we toggle
* that section back to visible, we are able to return the visibility of
* the course module back to what it was originally.
*/
function set_coursemodule_visible($id, $visible, $prevstateoverrides = false)
{
    global $DB, $CFG;
    require_once $CFG->libdir . '/gradelib.php';
    if (!($cm = $DB->get_record('course_modules', array('id' => $id)))) {
        return false;
    }
    if (!($modulename = $DB->get_field('modules', 'name', array('id' => $cm->module)))) {
        return false;
    }
    if ($events = $DB->get_records('event', array('instance' => $cm->instance, 'modulename' => $modulename))) {
        foreach ($events as $event) {
            if ($visible) {
                show_event($event);
            } else {
                hide_event($event);
            }
        }
    }
    // hide the associated grade items so the teacher doesn't also have to go to the gradebook and hide them there
    $grade_items = grade_item::fetch_all(array('itemtype' => 'mod', 'itemmodule' => $modulename, 'iteminstance' => $cm->instance, 'courseid' => $cm->course));
    if ($grade_items) {
        foreach ($grade_items as $grade_item) {
            $grade_item->set_hidden(!$visible);
        }
    }
    if ($prevstateoverrides) {
        if ($visible == '0') {
            // Remember the current visible state so we can toggle this back.
            $DB->set_field('course_modules', 'visibleold', $cm->visible, array('id' => $id));
        } else {
            // Get the previous saved visible states.
            return $DB->set_field('course_modules', 'visible', $cm->visibleold, array('id' => $id));
        }
    }
    return $DB->set_field("course_modules", "visible", $visible, array("id" => $id));
}
开发者ID:numbas,项目名称:moodle,代码行数:44,代码来源:lib.php

示例3: set_coursemodule_visible

/**
* $prevstateoverrides = true will set the visibility of the course module
* to what is defined in visibleold. This enables us to remember the current
* visibility when making a whole section hidden, so that when we toggle
* that section back to visible, we are able to return the visibility of
* the course module back to what it was originally.
*/
function set_coursemodule_visible($id, $visible, $prevstateoverrides = false)
{
    if (!($cm = get_record('course_modules', 'id', $id))) {
        return false;
    }
    if (!($modulename = get_field('modules', 'name', 'id', $cm->module))) {
        return false;
    }
    if ($events = get_records_select('event', "instance = '{$cm->instance}' AND modulename = '{$modulename}'")) {
        foreach ($events as $event) {
            if ($visible) {
                show_event($event);
            } else {
                hide_event($event);
            }
        }
    }
    if ($prevstateoverrides) {
        if ($visible == '0') {
            // Remember the current visible state so we can toggle this back.
            set_field('course_modules', 'visibleold', $cm->visible, 'id', $id);
        } else {
            // Get the previous saved visible states.
            return set_field('course_modules', 'visible', $cm->visibleold, 'id', $id);
        }
    }
    return set_field("course_modules", "visible", $visible, "id", $id);
}
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:35,代码来源:lib.php

示例4: show_event

                            </div> <!-- /.widget-inner -->
                        </div> <!-- /.widget-main -->
                    </div> <!-- /col-md-6 -->

                    <!-- Show Latest Events List -->
                    <div class="col-md-6">
                        <div class="widget-main">
                            
                        <div class="border"></div>
                        
                            <div class="widget-main-title">
                                <h4 class="widget-title">Events</h4>
                            </div> <!-- /.widget-main-title -->
                            <div class='widget-inner'>
                                <?php 
show_event();
?>
                            </div> <!-- /.widget-inner -->
                        </div> <!-- /.widget-main -->
                    </div> <!-- /.col-md-6 -->
                    
                </div> <!-- /.row -->

            </div> <!-- /.col-md-8 -->
            
            <!-- Here begin Sidebar -->
            
            <div class="col-md-4">
            <div class="widget-main">
                    <div class="border"></div>
                            <div class="widget-main-title">
开发者ID:ViditTiwari,项目名称:cms,代码行数:31,代码来源:index.php

示例5: set_coursemodule_visible

/**
* $prevstateoverrides = true will set the visibility of the course module
* to what is defined in visibleold. This enables us to remember the current
* visibility when making a whole section hidden, so that when we toggle
* that section back to visible, we are able to return the visibility of
* the course module back to what it was originally.
*/
function set_coursemodule_visible($id, $visible, $prevstateoverrides=false) {
    global $DB, $CFG;
    require_once($CFG->libdir.'/gradelib.php');

    if (!$cm = $DB->get_record('course_modules', array('id'=>$id))) {
        return false;
    }

    // Create events and propagate visibility to associated grade items if the value has changed.
    // Only do this if it's changed to avoid accidently overwriting manual showing/hiding of student grades.
    if ($cm->visible == $visible) {
        return true;
    }

    if (!$modulename = $DB->get_field('modules', 'name', array('id'=>$cm->module))) {
        return false;
    }
    if ($events = $DB->get_records('event', array('instance'=>$cm->instance, 'modulename'=>$modulename))) {
        foreach($events as $event) {
            if ($visible) {
                show_event($event);
            } else {
                hide_event($event);
            }
        }
    }

    // Hide the associated grade items so the teacher doesn't also have to go to the gradebook and hide them there.
    $grade_items = grade_item::fetch_all(array('itemtype'=>'mod', 'itemmodule'=>$modulename, 'iteminstance'=>$cm->instance, 'courseid'=>$cm->course));
    if ($grade_items) {
        foreach ($grade_items as $grade_item) {
            $grade_item->set_hidden(!$visible);
        }
    }

    $cminfo = new stdClass();
    $cminfo->id = $id;
    $cminfo->visible = $visible;

    if ($prevstateoverrides) {
        // If we making whole section visiblility change..
        if ($visible == 0) {
            // Retain previous visibility state.
            $cminfo->visibleold = $cm->visible;
        } else {
            // Restore previous visibility state.
            $cminfo->visible = $cm->visibleold;
        }
    } else {
        $cminfo->visibleold = $visible;
    }
    return $DB->update_record('course_modules', $cminfo);
}
开发者ID:ncsu-delta,项目名称:moodle,代码行数:60,代码来源:lib.php

示例6: set_coursemodule_visible

/**
* $prevstateoverrides = true will set the visibility of the course module
* to what is defined in visibleold. This enables us to remember the current
* visibility when making a whole section hidden, so that when we toggle
* that section back to visible, we are able to return the visibility of
* the course module back to what it was originally.
*/
function set_coursemodule_visible($id, $visible, $prevstateoverrides = false)
{
    global $DB;
    if (!($cm = $DB->get_record('course_modules', array('id' => $id)))) {
        return false;
    }
    if (!($modulename = $DB->get_field('modules', 'name', array('id' => $cm->module)))) {
        return false;
    }
    if ($events = $DB->get_records('event', array('instance' => $cm->instance, 'modulename' => $modulename))) {
        foreach ($events as $event) {
            if ($visible) {
                show_event($event);
            } else {
                hide_event($event);
            }
        }
    }
    if ($prevstateoverrides) {
        if ($visible == '0') {
            // Remember the current visible state so we can toggle this back.
            $DB->set_field('course_modules', 'visibleold', $cm->visible, array('id' => $id));
        } else {
            // Get the previous saved visible states.
            return $DB->set_field('course_modules', 'visible', $cm->visibleold, array('id' => $id));
        }
    }
    return $DB->set_field("course_modules", "visible", $visible, array("id" => $id));
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:36,代码来源:lib.php

示例7: dirname

<?php

include dirname(__FILE__) . '/../modeles/evenement/rating.php';
include dirname(__FILE__) . '/../modeles/evenement/evenement.php';
$mon_event = show_event();
//var_dump($mon_event);
/*déclaration variables !!!*/
$rating = show_rating($_GET['id']);
$sum = $rating['0']['SUM(valeur)'];
$count = $rating['0']['COUNT(valeur)'];
function show_adr($adr, $dep, $ville)
{
    $mon_adresse = $adr . ", " . $dep . ", " . $ville;
    return $mon_adresse;
}
$resultat_adr = recuperer_adr();
foreach ($resultat_adr as $n) {
    $tab_adr[] = show_adr($n[12], $n[11], $n[10]);
}
print_r($tab_adr);
//show_adr($mon_event[12], $mon_event[11], $mon_event[10]);
$verif_user_vote = verif_user($_SESSION['prenom'], $_GET['id']);
//print_r($verif_user_vote[0]);
/* calcul de la moyenne du rating*/
if ($count == 0) {
    $rating_star = 0;
} else {
    $arrondi = round($sum / $count);
    $rating_star = intval($arrondi);
}
/*verification + ajout d'un vote */
开发者ID:A1G3E,项目名称:event2,代码行数:31,代码来源:evenement2.php


注:本文中的show_event函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。