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


PHP check_theme_arrows函数代码示例

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


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

示例1: link_arrow_left

/**
 * Return the left arrow with text ('previous'), and optionally embedded in a link.
 * See function above, check_theme_arrows.
 * @param string $text HTML/plain text label (set to blank only for breadcrumb separator cases).
 * @param string $url An optional link to use in a surrounding HTML anchor.
 * @param bool $accesshide True if text should be hidden (for screen readers only).
 * @param string $addclass Additional class names for the link, or the arrow character.
 * @return string HTML string.
 */
function link_arrow_left($text, $url = '', $accesshide = false, $addclass = '')
{
    global $THEME;
    check_theme_arrows();
    $arrowclass = 'arrow ';
    if (!$url) {
        $arrowclass .= $addclass;
    }
    $arrow = '<span class="' . $arrowclass . '">' . $THEME->larrow . '</span>';
    $htmltext = '';
    if ($text) {
        $htmltext = '&nbsp;<span class="arrow_text">' . $text . '</span>';
        if ($accesshide) {
            $htmltext = get_accesshide($htmltext);
        }
    }
    if ($url) {
        $class = 'arrow_link';
        if ($addclass) {
            $class .= ' ' . $addclass;
        }
        return '<a class="' . $class . '" href="' . $url . '" title="' . preg_replace('/<.*?>/', '', $text) . '">' . $arrow . $htmltext . '</a>';
    }
    return $arrow . $htmltext;
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:34,代码来源:weblib.php

示例2: foreach

        /// add all selected to course list
        foreach ($data->addoutcomes as $add) {
            $add = clean_param($add, PARAM_INT);
            if (!array_key_exists($add, $standardoutcomes)) {
                continue;
            }
            $goc = new object();
            $goc->courseid = $courseid;
            $goc->outcomeid = $add;
            $DB->insert_record('grade_outcomes_courses', $goc);
        }
    } else {
        if (!empty($data->remove) && !empty($data->removeoutcomes)) {
            /// remove all selected from course outcomes list
            foreach ($data->removeoutcomes as $remove) {
                $remove = clean_param($remove, PARAM_INT);
                if (!array_key_exists($remove, $co_standard_notused)) {
                    continue;
                }
                $DB->delete_records('grade_outcomes_courses', array('courseid' => $courseid, 'outcomeid' => $remove));
            }
        }
    }
    redirect('course.php?id=' . $courseid);
    // we must redirect to get fresh data
}
/// Print header
print_grade_page_head($COURSE->id, 'outcome', 'course');
check_theme_arrows();
require 'course_form.html';
print_footer($course);
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:course.php

示例3: quiz_print_randomquestion

/**
 * Print a given random question in quiz for the edit tab of edit.php.
 * Meant to be used from quiz_print_question_list()
 *
 * @param object $question A question object from the database questions table
 * @param object $questionurl The url of the question editing page as a moodle_url object
 * @param object $quiz The quiz in the context of which the question is being displayed
 * @param boolean $quiz_qbanktool Indicate to this function if the question bank window open
 */
function quiz_print_randomquestion(&$question, &$pageurl, &$quiz, $quiz_qbanktool)
{
    global $DB, $QTYPES, $THEME;
    check_theme_arrows();
    echo '<div class="quiz_randomquestion">';
    if (!($category = $DB->get_record('question_categories', array('id' => $question->category)))) {
        notify('Random question category not found!');
        return;
    }
    echo '<div class="randomquestionfromcategory">';
    print_question_icon($question);
    print_random_option_icon($question);
    echo ' ' . get_string('randomfromcategory', 'quiz') . '</div>';
    $a = new stdClass();
    $a->arrow = $THEME->rarrow;
    $strshowcategorycontents = get_string('showcategorycontents', 'quiz', $a);
    $openqbankurl = $pageurl->out(false, array('qbanktool' => 1, 'cat' => $category->id . ',' . $category->contextid));
    $linkcategorycontents = ' <a href="' . $openqbankurl . '">' . $strshowcategorycontents . '</a>';
    echo '<div class="randomquestioncategory">';
    echo '<a href="' . $openqbankurl . '" title="' . $strshowcategorycontents . '">' . $category->name . '</a>';
    echo '<span class="questionpreview">' . quiz_question_preview_button($quiz, $question, true) . '</span>';
    echo '</div>';
    $questionids = $QTYPES['random']->get_usable_questions_from_category($category->id, $question->questiontext == '1', '0');
    $questioncount = count($questionids);
    echo '<div class="randomquestionqlist">';
    if ($questioncount == 0) {
        // No questions in category, give an error plus instructions
        echo '<span class="error">';
        print_string('noquestionsnotinuse', 'quiz');
        echo '</span>';
        echo '<br />';
        // Embed the link into the string with instructions
        $a = new stdClass();
        $a->catname = '<strong>' . $category->name . '</strong>';
        $a->link = $linkcategorycontents;
        echo get_string('addnewquestionsqbank', 'quiz', $a);
    } else {
        // Category has questions
        // Get a sample from the database,
        $toshow = array_slice($questionids, 0, NUM_QS_TO_SHOW_IN_RANDOM);
        $questionidstoshow = array();
        foreach ($toshow as $a) {
            $questionidstoshow[] = $a->id;
        }
        $questionstoshow = $DB->get_records_list('question', 'id', $questionidstoshow, '', 'id,qtype,name,questiontext,questiontextformat');
        // list them,
        echo '<ul>';
        foreach ($questionstoshow as $question) {
            echo '<li>' . quiz_question_tostring($question, true) . '</li>';
        }
        // and then display the total number.
        echo '<li class="totalquestionsinrandomqcategory">';
        if ($questioncount > NUM_QS_TO_SHOW_IN_RANDOM) {
            echo '... ';
        }
        print_string('totalquestionsinrandomqcategory', 'quiz', $questioncount);
        echo ' ' . $linkcategorycontents;
        echo '</li>';
        echo '</ul>';
    }
    echo '</div>';
    echo '<div class="randomquestioncategorycount">';
    echo '</div>';
    echo '</div>';
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:74,代码来源:editlib.php


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