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


PHP blocks_print_group函数代码示例

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


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

示例1: print_container_end

                        break;
                }
                echo '<br />';
            }
            print_container_end();
            echo '</td>';
            break;
        case 'right':
            // The right column
            if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing || $PAGE->user_allowed_editing()) {
                echo '<td style="width: ' . $preferred_width_right . 'px;" id="right-column">';
                print_container_start();
                if ($PAGE->user_allowed_editing()) {
                    echo '<div style="text-align:center">' . update_course_icon($SITE->id) . '</div>';
                    echo '<br />';
                }
                blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
                print_container_end();
                echo '</td>';
            }
            break;
    }
}
?>

  </tr>
</table>

<?php 
print_footer('home');
// Please do not modify this line
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:31,代码来源:index.php

示例2: display_course_blocks_end

 /**
  * Finish displaying the resource with the course blocks
  */
 function display_course_blocks_end()
 {
     global $CFG;
     global $THEME;
     $PAGE = $this->PAGE;
     $pageblocks = blocks_setup($PAGE);
     $blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 210);
     $lt = empty($THEME->layouttable) ? array('left', 'middle', 'right') : $THEME->layouttable;
     foreach ($lt as $column) {
         if ($column != 'middle') {
             array_shift($lt);
         } else {
             if ($column == 'middle') {
                 break;
             }
         }
     }
     foreach ($lt as $column) {
         switch ($column) {
             case 'left':
                 if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) {
                     echo '<td style="width: ' . $blocks_preferred_width . 'px;" id="left-column">';
                     print_container_start();
                     blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
                     print_container_end();
                     echo '</td>';
                 }
                 break;
             case 'middle':
                 echo '</div>';
                 print_container_end();
                 echo '</td>';
                 break;
             case 'right':
                 if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing()) {
                     echo '<td style="width: ' . $blocks_preferred_width . 'px;" id="right-column">';
                     print_container_start();
                     blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
                     print_container_end();
                     echo '</td>';
                 }
                 break;
         }
     }
     echo '</tr></table>';
     print_footer($this->course);
 }
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:50,代码来源:lib.php

示例3: print_footer

 /**
  * Prints the page footer.
  */
 public function print_footer()
 {
     global $PAGE;
     // Can only register if not logged in...
     echo '</td>';
     $blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 210);
     if (blocks_have_content($this->pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing()) {
         echo '<td style="vertical-align: top; width: ' . $blocks_preferred_width . 'px;" id="right-column">';
         blocks_print_group($PAGE, $this->pageblocks, BLOCK_POS_RIGHT);
         echo '</td>';
     }
     /// Finish the page
     echo '</tr></table>';
     print_footer();
 }
开发者ID:benavidesrobert,项目名称:elis.base,代码行数:18,代码来源:page.class.php

示例4: get_string

$stridle = get_string('idle', 'chat');
$strcurrentusers = get_string('currentusers', 'chat');
$strnextsession = get_string('nextsession', 'chat');
if ($edit != -1 and $PAGE->user_allowed_editing()) {
    $USER->editing = $edit;
}
$PAGE->print_header($course->shortname . ': %fullname%');
echo '<table id="layout-table"><tr>';
$lt = empty($THEME->layouttable) ? array('left', 'middle', 'right') : $THEME->layouttable;
foreach ($lt as $column) {
    switch ($column) {
        case 'left':
            if (!empty($CFG->showblocksonmodpages) && (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) {
                echo '<td style="width: ' . $blocks_preferred_width . 'px;" id="left-column">';
                print_container_start();
                blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
                print_container_end();
                echo '</td>';
            }
            break;
        case 'middle':
            echo '<td id="middle-column">';
            print_container_start();
            /// Check to see if groups are being used here
            $groupmode = groups_get_activity_groupmode($cm);
            $currentgroup = groups_get_activity_group($cm, true);
            groups_print_activity_menu($cm, "view.php?id={$cm->id}");
            if ($currentgroup) {
                $groupselect = " AND groupid = '{$currentgroup}'";
                $groupparam = "&amp;groupid={$currentgroup}";
            } else {
开发者ID:r007,项目名称:PMoodle,代码行数:31,代码来源:view.php

示例5: page_create_instance

$CFG->pagepath = $CFG->wwwroot . '/my/index.php';
$PAGE = page_create_instance($USER->id);
if ($section = optional_param('section', '', PARAM_ALPHAEXT)) {
    $PAGE->section = $section;
}
$pageblocks = blocks_setup($PAGE, BLOCKS_PINNED_BOTH);
/// Make sure that the curriculum block is actually on this user's My Moodle page instance.
if ($cablockid = get_field('block', 'id', 'name', 'curr_admin')) {
    //        if (!record_exists('block_instance', 'blockid', $cablockid, 'pageid', $USER->id,
    //                           'pagetype', 'my-index')) {
    if (!record_exists('block_pinned', 'blockid', $cablockid, 'pagetype', 'my-index')) {
        //print_object('cablockid: ' . $cablockid);
        blocks_execute_action($PAGE, $pageblocks, 'add', (int) $cablockid, true, false);
    }
}
if ($edit != -1 and $PAGE->user_allowed_editing()) {
    $USER->editing = $edit;
}
$PAGE->print_header($mymoodlestr);
echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">';
echo '<tr valign="top">';
$blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), 210);
if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) {
    echo '<td style="vertical-align: top; width: ' . $blocks_preferred_width . 'px;" id="left-column">';
    blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
    echo '</td>';
}
echo '<td valign="top" id="middle-column">';
if (blocks_have_content($pageblocks, BLOCK_POS_CENTRE) || $PAGE->user_is_editing()) {
    blocks_print_group($PAGE, $pageblocks, BLOCK_POS_CENTRE);
}
开发者ID:remotelearner,项目名称:elis.cm,代码行数:31,代码来源:mymoodlepagestart.php

示例6: display_course_blocks_end

 /**
  * Finish displaying the resource with the course blocks
  */
 function display_course_blocks_end()
 {
     global $CFG;
     $PAGE = $this->PAGE;
     $pageblocks = blocks_setup($PAGE);
     $blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 210);
     echo '</div>';
     if (!empty($THEME->customcorners)) {
         print_custom_corners_end();
     }
     echo '</td>';
     if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing()) {
         echo '<td style="width: ' . $blocks_preferred_width . 'px;" id="right-column">';
         if (!empty($THEME->customcorners)) {
             print_custom_corners_start();
         }
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
         if (!empty($THEME->customcorners)) {
             print_custom_corners_end();
         }
         echo '</td>';
     }
     echo '</tr></table>';
     print_footer($this->course);
 }
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:28,代码来源:lib.php

示例7: wiki_footer

function wiki_footer()
{
    global $COURSE, $CFG;
    ///document	ending
    $PAGE = wiki_page_info('PAGE');
    $pageblocks = wiki_page_info('pageblocks');
    $editing = $PAGE->user_is_editing();
    wiki_table_end();
    /// The right column
    //if there are not blocks on the right part then don't enter in this condition
    if (!empty($pageblocks[BLOCK_POS_RIGHT])) {
        //to work out the default widths need to check all blocks
        $preferred_width_right = optional_param('preferred_width_right', blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), PARAM_INT);
        //preferred_width_right sizes
        //should be between BLOCK_x_MAX_WIDTH and BLOCK_x_MIN_WIDTH.
        $preferred_width_right = min($preferred_width_right, BLOCK_R_MAX_WIDTH);
        $preferred_width_right = max($preferred_width_right, BLOCK_R_MIN_WIDTH);
    }
    //if there are blocks on the right part, then they are placed
    if (!empty($pageblocks[BLOCK_POS_RIGHT])) {
        //checks if there are blocks to place on the right-hand side
        if (!empty($CFG->showblocksonmodpages) && (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing)) {
            $prop = new stdClass();
            $prop->id = "right-column";
            $prop->class = "blockcourse";
            wiki_change_column($prop);
            $prop = new stdClass();
            $prop->width = $preferred_width_right . 'px';
            wiki_table_start($prop);
            blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
            wiki_table_end();
            $prop = new stdClass();
        }
    }
    wiki_table_end();
    // select the teacher
    $cm = wiki_param('cm');
    $dfwiki = wiki_param('dfwiki');
    wiki_print_teacher_selection($cm, $dfwiki);
    wiki_div_end();
    // content wrapper end
    /// Finish the page
    print_footer($COURSE);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:44,代码来源:web.lib.php

示例8: tao_local_header_hook

/**
* hook function from inside the theme.
* in this case, detect lack of $PAGE and do a horrible hack
* to get a consistent page format.
*/
function tao_local_header_hook()
{
    global $CFG;
    require_once $CFG->libdir . '/blocklib.php';
    require_once $CFG->libdir . '/pagelib.php';
    global $PAGE;
    if (!empty($PAGE)) {
        return true;
    }
    if (defined('ADMIN_STICKYBLOCKS')) {
        return true;
    }
    if (optional_param('inpopup')) {
        return true;
    }
    $lmin = empty($THEME->block_l_min_width) ? 100 : $THEME->block_l_min_width;
    $lmax = empty($THEME->block_l_max_width) ? 210 : $THEME->block_l_max_width;
    $rmin = empty($THEME->block_r_min_width) ? 100 : $THEME->block_r_min_width;
    $rmax = empty($THEME->block_r_max_width) ? 210 : $THEME->block_r_max_width;
    !defined('BLOCK_L_MIN_WIDTH') && define('BLOCK_L_MIN_WIDTH', $lmin);
    !defined('BLOCK_L_MAX_WIDTH') && define('BLOCK_L_MAX_WIDTH', $lmax);
    !defined('BLOCK_R_MIN_WIDTH') && define('BLOCK_R_MIN_WIDTH', $rmin);
    !defined('BLOCK_R_MAX_WIDTH') && define('BLOCK_R_MAX_WIDTH', $rmax);
    $PAGE = new tao_page_class_hack();
    $pageblocks = blocks_setup($PAGE, true);
    // we could replace this with a stickyblocks implementation, this is a proof of concept.
    $preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), BLOCK_L_MAX_WIDTH);
    echo '<table id="layout-table" summary="layout">
      <tr>
    ';
    echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
    ob_start();
    blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
    $blockscontent = ob_get_clean();
    if (!$blockscontent) {
        $rec = (object) array('id' => 0, 'blockid' => 0, 'pageid' => 0, 'pagetype' => tao_page_class_hack::get_type(), 'position' => BLOCK_POS_LEFT, 'visible' => true, 'configdata' => '', 'weight' => 0);
        $pageblocks = array(BLOCK_POS_LEFT => array(0 => $rec));
        $pageblocks[BLOCK_POS_LEFT][0]->rec = $rec;
        $pageblocks[BLOCK_POS_LEFT][0]->obj = new tao_dummy_block($rec);
        blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
    } else {
        echo $blockscontent;
    }
    echo '</td>';
    echo '<td id="middle-column">';
    define('TAO_HEADER_OVERRIDDEN', 1);
}
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:52,代码来源:tao.php

示例9: admin_externalpage_print_footer

function admin_externalpage_print_footer($adminroot)
{
    global $CFG, $PAGE, $SITE, $THEME;
    if (!empty($SITE->fullname)) {
        $pageblocks = blocks_setup($PAGE);
        $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), BLOCK_R_MAX_WIDTH);
        $lt = empty($THEME->layouttable) ? array('left', 'middle', 'right') : $THEME->layouttable;
        foreach ($lt as $column) {
            if ($column != 'middle') {
                array_shift($lt);
            } else {
                if ($column == 'middle') {
                    break;
                }
            }
        }
        foreach ($lt as $column) {
            switch ($column) {
                case 'left':
                    echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
                    if (!empty($THEME->customcorners)) {
                        print_custom_corners_start();
                    }
                    blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
                    if (!empty($THEME->customcorners)) {
                        print_custom_corners_end();
                    }
                    echo '</td>';
                    break;
                case 'middle':
                    if (!empty($THEME->customcorners)) {
                        print_custom_corners_end();
                    }
                    echo '</td>';
                    break;
                case 'right':
                    if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT)) {
                        echo '<td style="width: ' . $preferred_width_right . 'px;" id="right-column">';
                        if (!empty($THEME->customcorners)) {
                            print_custom_corners_start();
                        }
                        blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
                        if (!empty($THEME->customcorners)) {
                            print_custom_corners_end();
                        }
                        echo '</td>';
                    }
                    break;
            }
        }
        echo '</tr></table>';
    }
    print_footer();
}
开发者ID:veritech,项目名称:pare-project,代码行数:54,代码来源:adminlib.php


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