• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP popup_form函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: print_header

 function print_header()
 {
     global $CFG;
     popup_form('admin.php?type=' . $this->type . '&path=', $this->current_assignments, 'path_selector', $this->path, 'Year/College/Major', '', '', false, 'self', get_string('academic_current', 'block_student_gradeviewer'));
     // Once we have everything we need, then we can load the javascript
     // for the auto complete
     echo '<script type="text/javascript">';
     foreach ($this->fields as $field => $values) {
         echo data_reduce($field, $values);
     }
     echo '</script>';
     // Get all the libraries required for the yui stuff
     require_js(array($CFG->wwwroot . '/lib/yui/yahoo/yahoo-min.js', $CFG->wwwroot . '/lib/yui/event/event-min.js', $CFG->wwwroot . '/lib/yui/animation/animation-min.js', $CFG->wwwroot . '/lib/yui/yahoo-dom-event/yahoo-dom-event.js', $CFG->wwwroot . '/lib/yui/autocomplete/autocomplete-min.js', $CFG->wwwroot . '/blocks/student_gradeviewer/admin/functions.js'));
     // The yui autocomplete has to have the most complicated html setup
     echo '<div class="admin_header">
             <div class="yui-skin-sam">
               <form method="post">
                 <div class="admin_inputs">
               ' . array_reduce($this->input_fields, array($this, 'input_reduce'), ' ') . '
                 </div>
                 <div class="submit_button">
                 <input type="submit" value="' . get_string('submit') . '">
                 </div>
               </form>
             </div>
           </div>';
     $this->print_errors();
     $header_strings = array_reduce($this->input_fields, array($this, 'header_strings'), '');
     $assigning = get_string('admin_assigning', 'block_student_gradeviewer');
     $this->header_string($assigning . $header_strings);
 }
开发者ID:rrusso,项目名称:EARS,代码行数:31,代码来源:admin_academics.php


示例2: print_header

 function print_header()
 {
     popup_form('admin.php?type=' . $this->type . '&amp;path=', $this->mentors, 'mentor_selector', $this->path, 'choose', '', '', false, 'self', get_string('person_assign', 'block_student_gradeviewer'));
     $this->print_errors();
     if (isset($this->mentors[$this->path])) {
         $a->person = $this->mentors[$this->path];
     }
     $header = $this->path == 0 ? get_string('person_select', 'block_student_gradeviewer') : get_string('person_mentors', 'block_student_gradeviewer', $a);
     $this->header_string($header);
 }
开发者ID:rrusso,项目名称:EARS,代码行数:10,代码来源:admin_person.php


示例3: print_header

 function print_header()
 {
     global $CFG;
     popup_form('admin.php?type=' . $this->type . '&amp;path=', $this->sports, 'sport_selector', $this->path, '', '', '', false, 'self', get_string('sports_assign', 'block_student_gradeviewer'));
     if ($this->path != 'NA') {
         echo ' <a href="admin.php?type=name&amp;path=' . $this->path . '"><img src="' . $CFG->pixpath . '/i/edit.gif"/></a>';
     }
     // Any validation errors should be printed first
     $this->print_errors();
     $this->header_string(get_string('admin_assigning', 'block_student_gradeviewer') . $this->get_sport());
 }
开发者ID:rrusso,项目名称:EARS,代码行数:11,代码来源:admin_sports.php


示例4: update_student_status_menu

function update_student_status_menu($userid, $courseid)
{
    global $CFG;
    $userid = optional_param('userid', 0, PARAM_INT);
    if ($userid > 0) {
        $user = get_record('user', 'id', $userid);
    } else {
        $user = $USER;
    }
    if (!($post = get_record('ilpconcern_status', 'userid', $user->id))) {
        $post->status = 0;
    }
    $options = array(get_string('green', 'ilpconcern'), get_string('amber', 'ilpconcern'), get_string('red', 'ilpconcern'));
    popup_form($CFG->wwwroot . '/mod/ilpconcern/concerns_view.php?' . ($courseid > 1 ? 'courseid=' . $courseid . '&amp;' : '') . '&amp;userid=' . $userid . '&amp;action=updatestatus&amp;studentstatus=', $options, "studentstatus", $post->status, "", "", "", false, 'self', get_string('updatestatus', 'ilpconcern'));
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:15,代码来源:lib.php


示例5: report_stats_mode_menu

function report_stats_mode_menu($course, $mode, $time, $url)
{
    global $CFG;
    /*        
    $reportoptions = stats_get_report_options($course->id, $mode);
    $timeoptions = report_stats_timeoptions($mode);
    if (empty($timeoptions)) {
        print_error('nostatstodisplay', '', $CFG->wwwroot.'/course/view.php?id='.$course->id);
    }
    */
    $options = array();
    $options[STATS_MODE_GENERAL] = get_string('statsmodegeneral');
    $options[STATS_MODE_DETAILED] = get_string('statsmodedetailed');
    if (has_capability('coursereport/stats:view', get_context_instance(CONTEXT_SYSTEM))) {
        $options[STATS_MODE_RANKED] = get_string('reports');
    }
    return popup_form($url . "?course={$course->id}&amp;time={$time}&amp;mode=", $options, 'switchmode', $mode, '', '', '', true);
}
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:18,代码来源:lib.php


示例6: get_content

 function get_content()
 {
     global $CFG, $ME, $COURSE;
     //get list of themes
     $themes = get_list_of_themes();
     if ($this->content !== NULL) {
         return $this->content;
     }
     $this->content->footer = '';
     $this->content->text = '';
     $context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
     if (has_capability('block/session_theme:switchthemes', $context)) {
         $this->content->text .= popup_form($ME . '?id=' . $COURSE->id . '&amp;theme=', $themes, 'sessionthemeform', current_theme(), 'choose', '', '', true);
         $this->content->footer .= '';
     } else {
         $this->content = '';
     }
     return $this->content;
 }
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:19,代码来源:block_session_theme.php


示例7: print_header

 function print_header($title)
 {
     global $USER, $CFG;
     $replacements = array('%fullname%' => get_string('mymoodle', 'my'));
     foreach ($replacements as $search => $replace) {
         $title = str_replace($search, $replace, $title);
     }
     $site = get_site();
     $button = update_mymoodle_icon($USER->id);
     $nav = get_string('mymoodle', 'my');
     $header = $site->shortname . ': ' . $nav;
     $navlinks = array(array('name' => $nav, 'link' => '', 'type' => 'misc'));
     $navigation = build_navigation($navlinks);
     $loggedinas = user_login_string($site);
     if (empty($CFG->langmenu)) {
         $langmenu = '';
     } else {
         $currlang = current_language();
         $langs = get_list_of_languages();
         $langlabel = get_accesshide(get_string('language'));
         $langmenu = popup_form($CFG->wwwroot . '/my/index.php?lang=', $langs, 'chooselang', $currlang, '', '', '', true, 'self', $langlabel);
     }
     print_header($title, $header, $navigation, '', '', true, $button, $loggedinas . $langmenu);
 }
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:24,代码来源:pagelib.php


示例8: menuitems_to_html

 protected function menuitems_to_html($menuitems, $depth = 0)
 {
     if (empty($menuitems)) {
         return '';
     }
     $options = array();
     $children = array();
     $selected = '';
     foreach ($menuitems as $menuitem) {
         $options[$menuitem->url] = $menuitem->title;
         if ($menuitem->childtree) {
             // Sort of hackish, but works
             $selected = $menuitem->url;
             $children[] = $this->menuitems_to_html($menuitem->childtree, $depth + 1);
         }
         // This selected takes priority
         if (!empty($menuitem->active)) {
             $selected = $menuitem->url;
         }
     }
     $html = popup_form('', $options, "pagemenudropdown{$depth}", $selected, 'choose', '', '', true);
     $html .= "<br /><br />\n" . implode("<br /><br />\n", $children);
     return $html;
 }
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:24,代码来源:select.class.php


示例9: IN

                                             FROM ' . $CFG->prefix . 'user
                                             WHERE ' . $select . '
                                             AND id NOT IN (
                                                 SELECT u.id
                                                 FROM ' . $CFG->prefix . 'role_assignments r,
                                                 ' . $CFG->prefix . 'user u
                                                 WHERE r.contextid = ' . $contextid . '
                                                 AND u.id = r.userid
                                                 AND r.roleid = ' . $roleid . '
                                                 ' . $selectsql . ')
                                             ORDER BY lastname ASC, firstname ASC');
     $usercount = $availableusers->_numOfRows;
 }
 echo '<div class="selector">';
 $assignableroles = array('0' => get_string('listallroles', 'role') . '...') + $assignableroles;
 popup_form("{$CFG->wwwroot}/{$CFG->admin}/roles/assign.php?userid={$userid}&amp;courseid={$courseid}&amp;contextid={$contextid}&amp;roleid=", $assignableroles, 'switchrole', $roleid, '', '', '', false, 'self', $strroletoassign);
 echo '</div>';
 print_simple_box_start('center');
 include 'assign.html';
 print_simple_box_end();
 if (!empty($errors)) {
     $msg = '<p>';
     foreach ($errors as $e) {
         $msg .= $e . '<br />';
     }
     $msg .= '</p>';
     print_simple_box_start('center');
     notify($msg);
     print_simple_box_end();
 }
 //Back to Assign Roles button
开发者ID:kai707,项目名称:ITSA-backup,代码行数:31,代码来源:assign.php


示例10: array

    }
    $rolenames = array(-1 => $strallsiteusers) + $rolenames;
}
/// If there are multiple Roles in the course, then show a drop down menu for switching
if (count($rolenames) > 1) {
    echo '<div class="rolesform">';
    echo '<label for="rolesform_jump">' . get_string('currentrole', 'role') . '&nbsp;</label>';
    if ($context->id != $frontpagectx->id) {
        $rolenames = array(0 => get_string('all')) + $rolenames;
    } else {
        if (!$CFG->defaultfrontpageroleid) {
            // we do not want "All users with role" - we already have all users in defualt frontpage role option
            $rolenames = array(0 => get_string('userswithrole', 'role')) + $rolenames;
        }
    }
    popup_form("{$CFG->wwwroot}/user/index.php?contextid={$context->id}&amp;sifirst=&amp;silast=&amp;roleid=", $rolenames, 'rolesform', $roleid, '');
    echo '</div>';
} else {
    if (count($rolenames) == 1) {
        // when all users with the same role - print its name
        echo '<div class="rolesform">';
        echo get_string('role') . ': ';
        $rolename = reset($rolenames);
        echo $rolename;
        echo '</div>';
    }
}
if ($roleid > 0) {
    if (!($currentrole = $DB->get_record('role', array('id' => $roleid)))) {
        print_error('invalidroleid');
    }
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:index.php


示例11: action_default

 function action_default()
 {
     // Get parameters
     $sort = optional_param('sort', 'name', PARAM_ALPHA);
     $dir = optional_param('dir', 'ASC', PARAM_ALPHA);
     $page = optional_param('page', 0, PARAM_INT);
     $perpage = optional_param('perpage', 30, PARAM_INT);
     // how many per page
     $namesearch = trim(optional_param('search', '', PARAM_TEXT));
     $alpha = optional_param('alpha', '', PARAM_ALPHA);
     $parent = $this->optional_param('id', 0, PARAM_INT);
     $classification = $this->optional_param('classification', NULL, PARAM_SAFEDIR);
     if ($parent) {
         $this->print_tabs('subclusters', array('id' => $parent));
     }
     // Define columns
     $columns = array('name' => get_string('cluster_name', 'block_curr_admin'), 'display' => get_string('cluster_description', 'block_curr_admin'));
     $extrafilters = array('contexts' => clusterpage::get_contexts('block/curr_admin:cluster:view'), 'parent' => $parent, 'classification' => $classification);
     $items = cluster_get_listing($sort, $dir, $page * $perpage, $perpage, $namesearch, $alpha, $extrafilters);
     $numitems = cluster_count_records($namesearch, $alpha, $extrafilters);
     clusterpage::get_contexts('block/curr_admin:cluster:edit');
     clusterpage::get_contexts('block/curr_admin:cluster:delete');
     $this->print_list_view($items, $numitems, $columns, $filter = null, $alphaflag = true, $searchflag = true);
     if ($this->optional_param('id', 0, PARAM_INT)) {
         //get the non-parent clusters that are accessible based on the edit capability
         $contexts = clusterpage::get_contexts('block/curr_admin:cluster:edit');
         $non_parent_clusters = cluster_get_possible_sub_clusters($this->optional_param('id', 0, PARAM_INT), $contexts);
         //display the dropdown if there are one or more available clusters
         if (count($non_parent_clusters) > 0) {
             echo '<div align="center">';
             echo get_string('cluster_subcluster_prompt', 'block_curr_admin') . ': ';
             $url = $this->get_new_page(array('action' => 'subcluster', 'id' => $this->optional_param('id', 0, PARAM_INT)))->get_url() . '&amp;subclusterid=';
             popup_form($url, $non_parent_clusters, 'assignsubcluster', '', 'Choose...');
             echo '</div>';
         }
     }
 }
开发者ID:remotelearner,项目名称:elis.cm,代码行数:37,代码来源:clusterpage.class.php


示例12: question_list

/**
* Prints the table of questions in a category with interactions
*
* @param object $course   The course object
* @param int $categoryid  The id of the question category to be displayed
* @param int $quizid      The quiz id if we are in the context of a particular quiz, 0 otherwise
* @param int $recurse     This is 1 if subcategories should be included, 0 otherwise
* @param int $page        The number of the page to be displayed
* @param int $perpage     Number of questions to show per page
* @param boolean $showhidden   True if also hidden questions should be displayed
* @param boolean $showquestiontext whether the text of each question should be shown in the list
*/
function question_list($course, $categoryid, $quizid = 0, $recurse = 1, $page = 0, $perpage = 100, $showhidden = false, $sortorder = 'qtype, name ASC', $showquestiontext = false)
{
    global $USER, $CFG, $THEME;
    $qtypemenu = question_type_menu();
    if ($rqp_types = get_records('question_rqp_types')) {
        foreach ($rqp_types as $type) {
            $qtypemenu['rqp_' . $type->id] = $type->name;
        }
    }
    $strcategory = get_string("category", "quiz");
    $strquestion = get_string("question", "quiz");
    $straddquestions = get_string("addquestions", "quiz");
    $strimportquestions = get_string("importquestions", "quiz");
    $strexportquestions = get_string("exportquestions", "quiz");
    $strnoquestions = get_string("noquestions", "quiz");
    $strselect = get_string("select", "quiz");
    $strselectall = get_string("selectall", "quiz");
    $strselectnone = get_string("selectnone", "quiz");
    $strcreatenewquestion = get_string("createnewquestion", "quiz");
    $strquestionname = get_string("questionname", "quiz");
    $strdelete = get_string("delete");
    $stredit = get_string("edit");
    $straction = get_string("action");
    $strrestore = get_string('restore');
    $straddtoquiz = get_string("addtoquiz", "quiz");
    $strtype = get_string("type", "quiz");
    $strcreatemultiple = get_string("createmultiple", "quiz");
    $strpreview = get_string("preview", "quiz");
    if (!$categoryid) {
        echo "<p style=\"text-align:center;\"><b>";
        print_string("selectcategoryabove", "quiz");
        echo "</b></p>";
        if ($quizid) {
            echo "<p>";
            print_string("addingquestions", "quiz");
            echo "</p>";
        }
        return;
    }
    if (!($category = get_record('question_categories', 'id', $categoryid))) {
        notify('Category not found!');
        return;
    }
    $canedit = has_capability('moodle/question:manage', get_context_instance(CONTEXT_COURSE, $category->course));
    $editingquiz = false;
    if ($quizid) {
        $cm = get_coursemodule_from_instance('quiz', $quizid);
        $editingquiz = has_capability('mod/quiz:manage', get_context_instance(CONTEXT_MODULE, $cm->id));
    }
    echo '<div class="boxaligncenter">';
    $formatoptions = new stdClass();
    $formatoptions->noclean = true;
    echo format_text($category->info, FORMAT_MOODLE, $formatoptions, $course->id);
    echo '<table><tr>';
    // check if editing questions in this category is allowed
    if ($canedit) {
        echo "<td valign=\"top\"><b>{$strcreatenewquestion}:</b></td>";
        echo '<td valign="top" align="right">';
        popup_form("{$CFG->wwwroot}/question/question.php?category={$category->id}&amp;qtype=", $qtypemenu, "addquestion", "", "choose", "", "", false, "self");
        echo '</td><td valign="top" align="right">';
        helpbutton("questiontypes", $strcreatenewquestion, "quiz");
        echo '</td>';
    } else {
        echo '<td>';
        print_string("publishedit", "quiz");
        echo '</td>';
    }
    echo '</tr></table>';
    echo '</div>';
    $categorylist = $recurse ? question_categorylist($category->id) : $category->id;
    // hide-feature
    $showhidden = $showhidden ? '' : " AND hidden = '0'";
    if (!($totalnumber = count_records_select('question', "category IN ({$categorylist}) AND parent = '0' {$showhidden}"))) {
        echo "<p style=\"text-align:center;\">";
        print_string("noquestions", "quiz");
        echo "</p>";
        return;
    }
    if (!($questions = get_records_select('question', "category IN ({$categorylist}) AND parent = '0' {$showhidden}", $sortorder, '*', $page * $perpage, $perpage))) {
        // There are no questions on the requested page.
        $page = 0;
        if (!($questions = get_records_select('question', "category IN ({$categorylist}) AND parent = '0' {$showhidden}", $sortorder, '*', 0, $perpage))) {
            // There are no questions at all
            echo "<p style=\"text-align:center;\">";
            print_string("noquestions", "quiz");
            echo "</p>";
            return;
        }
//.........这里部分代码省略.........
开发者ID:veritech,项目名称:pare-project,代码行数:101,代码来源:editlib.php


示例13: rand

                 }
                 if ($section < $course->numsections) {
                     // Add a arrow to move section down
                     echo '<a href="view.php?id=' . $course->id . '&amp;random=' . rand(1, 10000) . '&amp;section=' . $section . '&amp;move=1&amp;sesskey=' . $USER->sesskey . '#section-' . ($section + 1) . '" title="' . $strmovedown . '">' . '<img src="' . $CFG->pixpath . '/t/down.gif" class="iconsmall down" alt="' . $strmovedown . '" /></a><br />';
                 }
             }
             echo '</td></tr>';
             echo '<tr class="section separator"><td colspan="3" class="spacer"></td></tr>';
         }
         $section++;
         $weekdate = $nextweekdate;
     }
     echo '</table>';
     if (!empty($sectionmenu)) {
         echo '<div class="jumpmenu">';
         echo popup_form($CFG->wwwroot . '/course/view.php?id=' . $course->id . '&amp;', $sectionmenu, 'sectionmenu', '', get_string('jumpto'), '', '', true);
         echo '</div>';
     }
     print_container_end();
     echo '</td>';
     break;
 case 'right':
     // The right column
     if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
         echo '<td style="width: ' . $preferred_width_right . 'px;" id="right-column">';
         print_container_start();
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
         print_container_end();
         echo '</td>';
     }
     break;
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:31,代码来源:format.php


示例14: blocks_print_adminblock

function blocks_print_adminblock(&$page, &$pageblocks)
{
    global $USER;
    $missingblocks = blocks_get_missing($page, $pageblocks);
    if (!empty($missingblocks)) {
        $strblocks = '<div class="title"><h2>';
        $strblocks .= get_string('blocks');
        $strblocks .= '</h2></div>';
        $stradd = get_string('add');
        foreach ($missingblocks as $blockid) {
            $block = blocks_get_record($blockid);
            $blockobject = block_instance($block->name);
            if ($blockobject === false) {
                continue;
            }
            if (!$blockobject->user_can_addto($page)) {
                continue;
            }
            $menu[$block->id] = $blockobject->get_title();
        }
        asort($menu);
        $target = $page->url_get_full(array('sesskey' => $USER->sesskey, 'blockaction' => 'add'));
        $content = popup_form($target . '&amp;blockid=', $menu, 'add_block', '', $stradd . '...', '', '', true);
        print_side_block($strblocks, $content, NULL, NULL, NULL, array('class' => 'block_adminblock'));
    }
}
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:26,代码来源:blocklib.php


示例15: question_list

/**
* Prints the table of questions in a category with interactions
*
* @param object $course   The course object
* @param int $categoryid  The id of the question category to be displayed
* @param int $cm      The course module record if we are in the context of a particular module, 0 otherwise
* @param int $recurse     This is 1 if subcategories should be included, 0 otherwise
* @param int $page        The number of the page to be displayed
* @param int $perpage     Number of questions to show per page
* @param boolean $showhidden   True if also hidden questions should be displayed
* @param boolean $showquestiontext whether the text of each question should be shown in the list
*/
function question_list($contexts, $pageurl, $categoryandcontext, $cm = null, $recurse = 1, $page = 0, $perpage = 100, $showhidden = false, $sortorder = 'typename', $sortorderdecoded = 'qtype, name ASC', $showquestiontext = false, $addcontexts = array())
{
    global $USER, $CFG, $THEME, $COURSE;
    $lastchangedid = optional_param('lastchanged', 0, PARAM_INT);
    list($categoryid, $contextid) = explode(',', $categoryandcontext);
    $qtypemenu = question_type_menu();
    $strcategory = get_string("category", "quiz");
    $strquestion = get_string("question", "quiz");
    $straddquestions = get_string("addquestions", "quiz");
    $strimportquestions = get_string("importquestions", "quiz");
    $strexportquestions = get_string("exportquestions", "quiz");
    $strnoquestions = get_string("noquestions", "quiz");
    $strselect = get_string("select", "quiz");
    $strselectall = get_string("selectall", "quiz");
    $strselectnone = get_string("selectnone", "quiz");
    $strcreatenewquestion = get_string("createnewquestion", "quiz");
    $strquestionname = get_string("questionname", "quiz");
    $strdelete = get_string("delete");
    $stredit = get_string("edit");
    $strmove = get_string('moveqtoanothercontext', 'question');
    $strview = get_string("view");
    $straction = get_string("action");
    $strrestore = get_string('restore');
    $strtype = get_string("type", "quiz");
    $strcreatemultiple = get_string("createmultiple", "quiz");
    $strpreview = get_string("preview", "quiz");
    if (!$categoryid) {
        echo "<p style=\"text-align:center;\"><b>";
        print_string("selectcategoryabove", "quiz");
        echo "</b></p>";
        return;
    }
    if (!($category = get_record('question_categories', 'id', $categoryid, 'contextid', $contextid))) {
        notify('Category not found!');
        return;
    }
    $catcontext = get_context_instance_by_id($contextid);
    $canadd = has_capability('moodle/question:add', $catcontext);
    //check for capabilities on all questions in category, will also apply to sub cats.
    $caneditall = has_capability('moodle/question:editall', $catcontext);
    $canuseall = has_capability('moodle/question:useall', $catcontext);
    $canmoveall = has_capability('moodle/question:moveall', $catcontext);
    if ($cm and $cm->modname == 'quiz') {
        $quizid = $cm->instance;
    } else {
        $quizid = 0;
    }
    $returnurl = $pageurl->out();
    $questionurl = new moodle_url("{$CFG->wwwroot}/question/question.php", array('returnurl' => $returnurl));
    if ($cm !== null) {
        $questionurl->param('cmid', $cm->id);
    } else {
        $questionurl->param('courseid', $COURSE->id);
    }
    $questionmoveurl = new moodle_url("{$CFG->wwwroot}/question/contextmoveq.php", array('returnurl' => $returnurl));
    if ($cm !== null) {
        $questionmoveurl->param('cmid', $cm->id);
    } else {
        $questionmoveurl->param('courseid', $COURSE->id);
    }
    echo '<div class="boxaligncenter">';
    $formatoptions = new stdClass();
    $formatoptions->noclean = true;
    echo format_text($category->info, FORMAT_MOODLE, $formatoptions, $COURSE->id);
    echo '<table><tr>';
    if ($canadd) {
        echo '<td valign="top" align="right">';
        popup_form($questionurl->out(false, array('category' => $category->id)) . '&amp;qtype=', $qtypemenu, "addquestion", "", "choose", "", "", false, "self", "<strong>{$strcreatenewquestion}</strong>");
        echo '</td><td valign="top" align="right">';
        helpbutton("questiontypes", $strcreatenewquestion, "quiz");
        echo '</td>';
    } else {
        echo '<td>';
        print_string('nopermissionadd', 'question');
        echo '</td>';
    }
    echo '</tr></table>';
    echo '</div>';
    $categorylist = $recurse ? question_categorylist($category->id) : $category->id;
    // hide-feature
    $showhidden = $showhidden ? '' : " AND hidden = '0'";
    if (!($totalnumber = count_records_select('question', "category IN ({$categorylist}) AND parent = '0' {$showhidden}"))) {
        echo "<p style=\"text-align:center;\">";
        print_string("noquestions", "quiz");
        echo "</p>";
        return;
    }
    if (!($questions = get_records_select('question', "category IN ({$categorylist}) AND parent = '0' {$showhidden}", $sortorderdecoded, '*', $page * $perpage, $perpage))) {
//.........这里部分代码省略.........
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:101,代码来源:editlib.php


示例16: print_header

    print_header("{$site->shortname}: {$category->name}", "{$site->fullname}: {$strcourses}", $navigation, "", "", true, $navbaritem);
}
/// Print button to turn editing off
if ($adminediting) {
    echo '<div class="categoryediting button">' . update_category_button($category->id) . '</div>';
}
/// Print link to roles
if (has_capability('moodle/role:assign', $context)) {
    echo '<div class="rolelink"><a href="' . $CFG->wwwroot . '/' . $CFG->admin . '/roles/assign.php?contextid=' . $context->id . '">' . get_string('assignroles', 'role') . '</a></div>';
}
/// Print the category selector
$displaylist = array();
$parentlist = array();
make_categories_list($displaylist, $parentlist, "");
echo '<div class="categorypicker">';
popup_form('category.php?id=', $displaylist, 'switchcategory', $category->id, '', '', '', false, 'self', $strcategories . ':');
echo '</div>';
/// Print current category description
if (!$creatorediting && $category->description) {
    print_box_start();
    echo format_text($category->description);
    // for multilang filter
    print_box_end();
}
/// Editing functions
if ($creatorediting) {
    /// Move a specified course to a new category
    if (!empty($deletecourses) and $data = data_submitted() and confirm_sesskey()) {
        // Some courses are being moved
        // user must have category update in both cats to perform this
        require_capability('moodle/category:update', $context);
开发者ID:r007,项目名称:PMoodle,代码行数:31,代码来源:category.php


示例17: navmenu


//.........这里部分代码省略.........
    } else {
        $strsection = get_string('topic');
    }
    $strjumpto = get_string('jumpto');
    $modinfo = get_fast_modinfo($course);
    $context = get_context_instance(CONTEXT_COURSE, $course->id);
    $section = -1;
    $selected = '';
    $url = '';
    $previousmod = NULL;
    $backmod = NULL;
    $nextmod = NULL;
    $selectmod = NULL;
    $logslink = NULL;
    $flag = false;
    $menu = array();
    $menustyle = array();
    $sections = $DB->get_records('course_sections', array('course' => $course->id), 'section', 'section,visible,summary');
    if (!empty($THEME->makenavmenulist)) {
        /// A hack to produce an XHTML navmenu list for use in themes
        $THEME->navmenulist = navmenulist($course, $sections, $modinfo, $strsection, $strjumpto, $width, $cm);
    }
    foreach ($modinfo->cms as $mod) {
        if ($mod->modname == 'label') {
            continue;
        }
        if ($mod->sectionnum > $course->numsections) {
            /// Don't show excess hidden sections
            break;
        }
        if (!$mod->uservisible) {
            // do not icnlude empty sections at all
            continue;
        }
        if ($mod->sectionnum > 0 and $section != $mod->sectionnum) {
            $thissection = $sections[$mod->sectionnum];
            if ($thissection->visible or !$course->hiddensections or has_capability('moodle/course:viewhiddensections', $context)) {
                $thissection->summary = strip_tags(format_string($thissection->summary, true));
                if ($course->format == 'weeks' or empty($thissection->summary)) {
                    $menu[] = '--' . $strsection . " " . $mod->sectionnum;
                } else {
                    if (strlen($thissection->summary) < $width - 3) {
                        $menu[] = '--' . $thissection->summary;
                    } else {
                        $menu[] = '--' . substr($thissection->summary, 0, $width) . '...';
                    }
                }
                $section = $mod->sectionnum;
            } else {
                // no activities from this hidden section shown
                continue;
            }
        }
        $url = $mod->modname . '/view.php?id=' . $mod->id;
        if ($flag) {
            // the current mod is the "next" mod
            $nextmod = $mod;
            $flag = false;
        }
        $localname = $mod->name;
        if ($cm == $mod->id) {
            $selected = $url;
            $selectmod = $mod;
            $backmod = $previousmod;
            $flag = true;
            // set flag so we know to use next mod for "next"
            $localname = $strjumpto;
            $strjumpto = '';
        } else {
            $localname = strip_tags(format_string($localname, true));
            $tl = textlib_get_instance();
            if ($tl->strlen($localname) > $width + 5) {
                $localname = $tl->substr($localname, 0, $width) . '...';
            }
            if (!$mod->visible) {
                $localname = '(' . $localname . ')';
            }
        }
        $menu[$url] = $localname;
        if (empty($THEME->navmenuiconshide)) {
            $menustyle[$url] = 'style="background-image: url(' . $CFG->modpixpath . '/' . $mod->modname . '/icon.gif);"';
            // Unfortunately necessary to do this here
        }
        $previousmod = $mod;
    }
    //Accessibility: added Alt text, replaced &gt; &lt; with 'silent' character and 'accesshide' text.
    if ($selectmod and has_capability('coursereport/log:view', $context)) {
        $logstext = get_string('alllogs');
        $logslink = '<li>' . "\n" . '<a title="' . $logstext . '" ' . $CFG->frametarget . 'onclick="this.target=\'' . $CFG->framename . '\';"' . ' href="' . $CFG->wwwroot . '/course/report/log/index.php?chooselog=1&amp;user=0&amp;date=0&amp;id=' . $course->id . '&amp;modid=' . $selectmod->id . '">' . '<img class="icon log" src="' . $CFG->pixpath . '/i/log.gif" alt="' . $logstext . '" /></a>' . "\n" . '</li>';
    }
    if ($backmod) {
        $backtext = get_string('activityprev', 'access');
        $backmod = '<li><form action="' . $CFG->wwwroot . '/mod/' . $backmod->modname . '/view.php" ' . 'onclick="this.target=\'' . $CFG->framename . '\';"' . '><fieldset class="invisiblefieldset">' . '<input type="hidden" name="id" value="' . $backmod->id . '" />' . '<button type="submit" title="' . $backtext . '">' . link_arrow_left($backtext, $url = '', $accesshide = true) . '</button></fieldset></form></li>';
    }
    if ($nextmod) {
        $nexttext = get_string('activitynext', 'access');
        $nextmod = '<li><form action="' . $CFG->wwwroot . '/mod/' . $nextmod->modname . '/view.php"  ' . 'onclick="this.target=\'' . $CFG->framename . '\';"' . '><fieldset class="invisiblefieldset">' . '<input type="hidden" name="id" value="' . $nextmod->id . '" />' . '<button type="submit" title="' . $nexttext . '">' . link_arrow_right($nexttext, $url = '', $accesshide = true) . '</button></fieldset></form></li>';
    }
    return '<div class="navigation">' . "\n" . '<ul>' . $logslink . $backmod . '<li>' . popup_form($CFG->wwwroot . '/mod/', $menu, 'navmenupopup', $selected, $strjumpto, '', '', true, $targetwindow, '', $menustyle) . '</li>' . $nextmod . '</ul>' . "\n" . '</div>';
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:101,代码来源:weblib.php


示例18: redirect

    redirect(get_login_url());
} else {
    if ($user = $mform_signup->get_data()) {
        $user->confirmed = 0;
        $user->lang = current_language();
        $user->firstaccess = time();
        $user->mnethostid = $CFG->mnet_localhost_id;
        $user->secret = random_string(15);
        $user->auth = $CFG->registerauth;
        $authplugin->user_signup($user, true);
        // prints notice and link to login/index.php
        exit;
        //never reached
    }
}
$newaccount = get_string('newaccount');
$login = get_string('login');
if (empty($CFG->langmenu)) {
    $langmenu = '';
} else {
    $currlang = current_language();
    $langs = get_list_of_languages();
    $langmenu = popup_form("{$CFG->wwwroot}/login/signup.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
}
$navlinks = array();
$navlinks[] = array('name' => $login, 'link' => "index.php", 'type' => 'misc');
$navlinks[] = array('name' => $newaccount, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header($newaccount, $newaccount, $navigation, $mform_signup->focus(), "", true, "<div class=\"langmenu\">{$langmenu}</div>");
$mform_signup->display();
print_footer();
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:signup.php


示例19: array

         $groups = array(forum::ALL_GROUPS => get_string('allparticipants'));
         $groups = $groups + $oldgroups;
     }
     // Get label for selector
     if ($course->groupmode == VISIBLEGROUPS) {
         $grouplabel = get_string('groupsvisible');
     } else {
         $grouplabel = get_string('groupsseparate');
     }
     // Draw group selector
     $url = $CFG->wwwroot . "/mod/forumng/feature/userposts/list.php?" . $forum->get_link_params(forum::PARAM_HTML);
     if (count($groups) == 1) {
         print '<div class="groupselector">' . $grouplabel . ': ' . end($groups) . '</div>';
     } else {
         // do only if we have more than one group
         $popupform = popup_form($url . '&amp;group=', $groups, 'forumng-groupselector', $groupid, '', '', '', false, 'self', $grouplabel);
     }
 }
 print '<div class="clearer"></div>';
 // Get all users
 if (!($users = $forum->get_monitored_users($groupid))) {
     print_string('nothingtodisplay', 'forumng');
     // Display link to the discussion
     print link_arrow_left($forum->get_name(), '../../view.php?id=' . $cmid);
     // Display footer
     print_footer($course);
     return;
 }
 $data = array();
 foreach ($users as $id => $u) {
     // Set table-row colour to gray for users without data (default)
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP popup_header函数代码示例发布时间:2022-05-15
下一篇:
PHP popup_error函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap