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

PHP get_scales_menu函数代码示例

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

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



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

示例1: onQuickFormEvent

 /**
  * Called by HTML_QuickForm whenever form event is made on this element
  *
  * @param     string    $event  Name of event
  * @param     mixed     $arg    event arguments
  * @param     object    $caller calling object
  * @since     1.0
  * @access    public
  * @return    mixed
  */
 function onQuickFormEvent($event, $arg, &$caller)
 {
     global $COURSE, $CFG;
     switch ($event) {
         case 'createElement':
             // Need to call superclass first because we want the constructor
             // to run.
             $result = parent::onQuickFormEvent($event, $arg, $caller);
             $strscale = get_string('scale');
             $strscales = get_string('scales');
             $scales = get_scales_menu($COURSE->id);
             foreach ($scales as $i => $scalename) {
                 $grades[-$i] = $strscale . ': ' . $scalename;
             }
             if (!$this->_hidenograde) {
                 $grades[0] = get_string('nograde');
             }
             for ($i = 100; $i >= 1; $i--) {
                 $grades[$i] = $i;
             }
             $this->load($grades);
             $linkobject = '<span class="helplink"><img height="17" width="17" alt="' . $strscales . '" src="' . $CFG->pixpath . '/help.gif" /></span>';
             $this->setHelpButton(array('/course/scales.php?id=' . $COURSE->id . '&amp;list=true', 'ratingscales', $linkobject, 400, 500, $strscales, 'none', true), 'link_to_popup_window');
             return $result;
     }
     return parent::onQuickFormEvent($event, $arg, $caller);
 }
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:37,代码来源:modgrade.php


示例2: onQuickFormEvent

 /**
  * Called by HTML_QuickForm whenever form event is made on this element
  *
  * @param string $event Name of event
  * @param mixed $arg event arguments
  * @param object $caller calling object
  * @return mixed
  */
 function onQuickFormEvent($event, $arg, &$caller)
 {
     global $COURSE, $CFG, $OUTPUT;
     switch ($event) {
         case 'createElement':
             // Need to call superclass first because we want the constructor
             // to run.
             $result = parent::onQuickFormEvent($event, $arg, $caller);
             $strscale = get_string('scale');
             $strscales = get_string('scales');
             $scales = get_scales_menu($COURSE->id);
             foreach ($scales as $i => $scalename) {
                 $grades[-$i] = $strscale . ': ' . $scalename;
             }
             if (!$this->_hidenograde) {
                 $grades[0] = get_string('nograde');
             }
             for ($i = 100; $i >= 1; $i--) {
                 $grades[$i] = $i;
             }
             $this->load($grades);
             //TODO: rewrite mod grading support in modforms
             return $result;
     }
     return parent::onQuickFormEvent($event, $arg, $caller);
 }
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:34,代码来源:modgrade.php


示例3: definition

 /**
  * Define the form - called by parent constructor
  */
 public function definition()
 {
     global $PAGE;
     $mform = $this->_form;
     $context = $this->_customdata['context'];
     $framework = $this->get_persistent();
     $mform->addElement('hidden', 'contextid');
     $mform->setType('contextid', PARAM_INT);
     $mform->setConstant('contextid', $context->id);
     $mform->addElement('header', 'generalhdr', get_string('general'));
     // Name.
     $mform->addElement('text', 'shortname', get_string('shortname', 'tool_lp'), 'maxlength="100"');
     $mform->setType('shortname', PARAM_TEXT);
     $mform->addRule('shortname', null, 'required', null, 'client');
     $mform->addRule('shortname', get_string('maximumchars', '', 100), 'maxlength', 100, 'client');
     // Description.
     $mform->addElement('editor', 'description', get_string('description', 'tool_lp'), array('rows' => 4));
     $mform->setType('description', PARAM_RAW);
     // ID number.
     $mform->addElement('text', 'idnumber', get_string('idnumber', 'tool_lp'), 'maxlength="100"');
     $mform->setType('idnumber', PARAM_RAW);
     $mform->addRule('idnumber', null, 'required', null, 'client');
     $mform->addRule('idnumber', get_string('maximumchars', '', 100), 'maxlength', 100, 'client');
     $scales = get_scales_menu();
     $scaleid = $mform->addElement('select', 'scaleid', get_string('scale', 'tool_lp'), $scales);
     $mform->setType('scaleid', PARAM_INT);
     $mform->addHelpButton('scaleid', 'scale', 'tool_lp');
     $mform->addRule('scaleid', null, 'required', null, 'client');
     if ($framework && $framework->has_user_competencies()) {
         // The scale is used so we "freeze" the element. Though, the javascript code for the scale
         // configuration requires this field so we only disable it. It is fine as setting the value
         // as a constant will ensure that nobody can change it. And it's validated in the persistent anyway.
         $scaleid->updateAttributes(array('readonly' => 'readonly'));
         $mform->setConstant('scaleid', $framework->get_scaleid());
     }
     $mform->addElement('button', 'scaleconfigbutton', get_string('configurescale', 'tool_lp'));
     // Add js.
     $mform->addElement('hidden', 'scaleconfiguration', '', array('id' => 'tool_lp_scaleconfiguration'));
     $mform->setType('scaleconfiguration', PARAM_RAW);
     $PAGE->requires->js_call_amd('tool_lp/scaleconfig', 'init', array('#id_scaleid', '#tool_lp_scaleconfiguration', '#id_scaleconfigbutton'));
     $mform->addElement('selectyesno', 'visible', get_string('visible', 'tool_lp'));
     $mform->setDefault('visible', true);
     $mform->addHelpButton('visible', 'visible', 'tool_lp');
     $mform->addElement('static', 'context', get_string('category', 'tool_lp'));
     $mform->setDefault('context', $context->get_context_name(false));
     $mform->addElement('header', 'taxonomyhdr', get_string('taxonomies', 'tool_lp'));
     $taxonomies = \core_competency\competency_framework::get_taxonomies_list();
     $taxdefaults = array();
     $taxcount = max($framework ? $framework->get_depth() : 4, 4);
     for ($i = 1; $i <= $taxcount; $i++) {
         $mform->addElement('select', "taxonomies[{$i}]", get_string('levela', 'tool_lp', $i), $taxonomies);
         $taxdefaults[$i] = \core_competency\competency_framework::TAXONOMY_COMPETENCY;
     }
     // Not using taxonomies[n] here or it would takes precedence over set_data(array('taxonomies' => ...)).
     $mform->setDefault('taxonomies', $taxdefaults);
     $this->add_action_buttons(true, get_string('savechanges', 'tool_lp'));
 }
开发者ID:evltuma,项目名称:moodle,代码行数:60,代码来源:competency_framework.php


示例4: main_upgrade


//.........这里部分代码省略.........
        table_column("user", "", "autosubscribe", "integer", "1", "unsigned", "1", "", "htmleditor");
    }
    if ($oldversion < 2003072100) {
        table_column("course", "", "visible", "integer", "1", "unsigned", "1", "", "marker");
    }
    if ($oldversion < 2003072101) {
        table_column("course_sections", "sequence", "sequence", "text", "", "", "", "", "");
    }
    if ($oldversion < 2003072800) {
        print_simple_box("The following database index improves performance, but can be quite large - if you are upgrading and you have problems with a limited quota you may want to delete this index later from the '{$CFG->prefix}log' table in your database", "center", "50%", "{$THEME->cellheading}", "20", "noticebox");
        flush();
        execute_sql(" CREATE INDEX {$CFG->prefix}log_timecoursemoduleaction_idx ON {$CFG->prefix}log (time,course,module,action) ");
        execute_sql(" CREATE INDEX {$CFG->prefix}user_students_courseuserid_idx ON {$CFG->prefix}user_students (course,userid) ");
        execute_sql(" CREATE INDEX {$CFG->prefix}user_teachers_courseuserid_idx ON {$CFG->prefix}user_teachers (course,userid) ");
    }
    if ($oldversion < 2003072802) {
        table_column("course_categories", "", "description", "text", "", "", "");
        table_column("course_categories", "", "parent", "integer", "10", "unsigned");
        table_column("course_categories", "", "sortorder", "integer", "10", "unsigned");
        table_column("course_categories", "", "courseorder", "text", "", "", "");
        table_column("course_categories", "", "visible", "integer", "1", "unsigned", "1");
        table_column("course_categories", "", "timemodified", "integer", "10", "unsigned");
    }
    if ($oldversion < 2003080400) {
        notify("If the following command fails you may want to change the type manually, from TEXT to INTEGER.  Moodle should keep working even if you don't.");
        table_column("course_categories", "courseorder", "courseorder", "integer", "10", "unsigned");
        table_column("course", "", "sortorder", "integer", "10", "unsigned", "0", "", "category");
    }
    if ($oldversion < 2003081502) {
        execute_sql(" CREATE TABLE {$CFG->prefix}scale (\n                         id SERIAL PRIMARY KEY,\n                         courseid integer NOT NULL default '0',\n                         userid integer NOT NULL default '0',\n                         name varchar(255) NOT NULL default '',\n                         scale text,\n                         description text,\n                         timemodified integer NOT NULL default '0'\n                      )");
    }
    if ($oldversion < 2003081503) {
        table_column("forum", "", "scale", "integer", "10", "unsigned", "0", "", "assessed");
        get_scales_menu(0);
        // Just to force the default scale to be created
    }
    if ($oldversion < 2003081600) {
        table_column("user_teachers", "", "editall", "integer", "1", "unsigned", "1", "", "role");
        table_column("user_teachers", "", "timemodified", "integer", "10", "unsigned", "0", "", "editall");
    }
    if ($oldversion < 2003081900) {
        table_column("course_categories", "courseorder", "coursecount", "integer", "10", "unsigned", "0");
    }
    if ($oldversion < 2003080700) {
        notify("Cleaning up categories and course ordering...");
        fix_course_sortorder();
    }
    if ($oldversion < 2003082001) {
        table_column("course", "", "showgrades", "integer", "2", "unsigned", "1", "", "format");
    }
    if ($oldversion < 2003082101) {
        execute_sql(" CREATE INDEX {$CFG->prefix}course_category_idx ON {$CFG->prefix}course (category) ");
    }
    if ($oldversion < 2003082702) {
        execute_sql(" INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'user report', 'user', 'CONCAT(firstname,\" \",lastname)') ");
    }
    if ($oldversion < 2003091000) {
        # Old field that was never added!
        table_column("course", "", "showrecent", "integer", "10", "unsigned", "1", "", "numsections");
    }
    if ($oldversion < 2003091400) {
        table_column("course_modules", "", "indent", "integer", "5", "unsigned", "0", "", "score");
    }
    if ($oldversion < 2003092900) {
        table_column("course", "", "maxbytes", "integer", "10", "unsigned", "0", "", "marker");
    }
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:67,代码来源:postgres7.php


示例5: print_grade_menu

/**
 * Prints a grade menu (as part of an existing form) with help
 * Showing all possible numerical grades and scales
 *
 * @todo Finish documenting this function
 * @todo Deprecate: this is only used in a few contrib modules
 *
 * @global object
 * @param int $courseid The course ID
 * @param string $name
 * @param string $current
 * @param boolean $includenograde Include those with no grades
 * @param boolean $return If set to true returns rather than echo's
 * @return string|bool Depending on value of $return
 */
function print_grade_menu($courseid, $name, $current, $includenograde = true, $return = false)
{
    global $CFG, $OUTPUT;
    $output = '';
    $strscale = get_string('scale');
    $strscales = get_string('scales');
    $scales = get_scales_menu($courseid);
    foreach ($scales as $i => $scalename) {
        $grades[-$i] = $strscale . ': ' . $scalename;
    }
    if ($includenograde) {
        $grades[0] = get_string('nograde');
    }
    for ($i = 100; $i >= 1; $i--) {
        $grades[$i] = $i;
    }
    $output .= html_writer::select($grades, $name, $current, false);
    $linkobject = '<span class="helplink"><img class="iconhelp" alt="' . $strscales . '" src="' . $OUTPUT->pix_url('help') . '" /></span>';
    $link = new moodle_url('/course/scales.php', array('id' => $courseid, 'list' => 1));
    $action = new popup_action('click', $link, 'ratingscales', array('height' => 400, 'width' => 500));
    $output .= $OUTPUT->action_link($link, $linkobject, $action, array('title' => $strscales));
    if ($return) {
        return $output;
    } else {
        echo $output;
    }
}
开发者ID:hatone,项目名称:moodle,代码行数:42,代码来源:weblib.php


示例6: main_upgrade


//.........这里部分代码省略.........
        table_column("course", "", "sortorder", "integer", "10", "unsigned", "0", "", "category");
    }
    if ($oldversion < 2003080700) {
        notify("Cleaning up categories and course ordering...");
        fix_course_sortorder();
    }
    if ($oldversion < 2003081001) {
        table_column("course", "format", "format", "varchar", "10", "", "topics");
    }
    if ($oldversion < 2003081500) {
        //        print_simple_box("Some important changes have been made to how course creators work.  Formerly, they could create new courses and assign teachers, and teachers could edit courses.  Now, ordinary teachers can no longer edit courses - they <b>need to be a teacher of a course AND a course creator</b>.  A new site-wide configuration variable allows you to choose whether to allow course creators to create new courses as well (by default this is off).  <p>The following update will automatically convert all your existing teachers into course creators, to maintain backward compatibility.  Make sure you look at your upgraded site carefully and understand these new changes.", "center", "50%", "$THEME->cellheading", "20", "noticebox");
        //        $count = 0;
        //        $errorcount = 0;
        //        if ($teachers = get_records("user_teachers")) {
        //            foreach ($teachers as $teacher) {
        //                if (! record_exists("user_coursecreators", "userid", $teacher->userid)) {
        //                    $creator = NULL;
        //                    $creator->userid = $teacher->userid;
        //                    if (!insert_record("user_coursecreators", $creator)) {
        //                        $errorcount++;
        //                    } else {
        //                        $count++;
        //                    }
        //                }
        //            }
        //        }
        //        print_simple_box("$count teachers were upgraded to course creators (with $errorcount errors)", "center", "50%", "$THEME->cellheading", "20", "noticebox");
    }
    if ($oldversion < 2003081501) {
        execute_sql(" CREATE TABLE `{$CFG->prefix}scale` (\n                         `id` int(10) unsigned NOT NULL auto_increment,\n                         `courseid` int(10) unsigned NOT NULL default '0',\n                         `userid` int(10) unsigned NOT NULL default '0',\n                         `name` varchar(255) NOT NULL default '',\n                         `scale` text NOT NULL,\n                         `description` text NOT NULL,\n                         `timemodified` int(10) unsigned NOT NULL default '0',\n                         PRIMARY KEY  (id)\n                       ) TYPE=MyISAM COMMENT='Defines grading scales'");
    }
    if ($oldversion < 2003081503) {
        table_column("forum", "", "scale", "integer", "10", "unsigned", "0", "", "assessed");
        get_scales_menu(0);
        // Just to force the default scale to be created
    }
    if ($oldversion < 2003081600) {
        table_column("user_teachers", "", "editall", "integer", "1", "unsigned", "1", "", "role");
        table_column("user_teachers", "", "timemodified", "integer", "10", "unsigned", "0", "", "editall");
    }
    if ($oldversion < 2003081900) {
        table_column("course_categories", "courseorder", "coursecount", "integer", "10", "unsigned", "0");
    }
    if ($oldversion < 2003082001) {
        table_column("course", "", "showgrades", "integer", "2", "unsigned", "1", "", "format");
    }
    if ($oldversion < 2003082101) {
        execute_sql(" ALTER TABLE `{$CFG->prefix}course` ADD INDEX category (category) ");
    }
    if ($oldversion < 2003082702) {
        execute_sql(" INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'user report', 'user', 'CONCAT(firstname,\" \",lastname)') ");
    }
    if ($oldversion < 2003091400) {
        table_column("course_modules", "", "indent", "integer", "5", "unsigned", "0", "", "score");
    }
    if ($oldversion < 2003092900) {
        table_column("course", "", "maxbytes", "integer", "10", "unsigned", "0", "", "marker");
    }
    if ($oldversion < 2003102700) {
        table_column("user_students", "", "timeaccess", "integer", "10", "unsigned", "0", "", "time");
        table_column("user_teachers", "", "timeaccess", "integer", "10", "unsigned", "0", "", "timemodified");
        $db->debug = false;
        $CFG->debug = 0;
        notify("Calculating access times.  Please wait - this may take a long time on big sites...", "green");
        flush();
        if ($courses = get_records_select("course", "category > 0")) {
开发者ID:veritech,项目名称:pare-project,代码行数:67,代码来源:mysql.php


示例7: validate_scale

 /**
  * Determines whether a given value is a valid scale selection.
  *
  * @param string|int $val The value to test.
  * @return bool Valid or invalid
  */
 protected function validate_scale($val)
 {
     global $COURSE;
     $scales = get_scales_menu($COURSE->id);
     return !empty($val) && isset($scales[(int) $val]) ? true : false;
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:12,代码来源:modgrade.php


示例8: print_scale_menu

/**
 * Prints a scale menu (as part of an existing form) including help button
 * Just like {@link print_grade_menu()} but without the numeric grades
 *
 * @param int $courseid ?
 * @param string $name ?
 * @param string $current ?
 * @todo Finish documenting this function
 */
function print_scale_menu($courseid, $name, $current, $return = false)
{
    global $CFG;
    $output = '';
    $strscales = get_string('scales');
    $output .= choose_from_menu(get_scales_menu($courseid), $name, $current, '', '', 0, true);
    $linkobject = '<span class="helplink"><img class="iconhelp" alt="' . $strscales . '" src="' . $CFG->pixpath . '/help.gif" /></span>';
    $output .= link_to_popup_window('/course/scales.php?id=' . $courseid . '&amp;list=true', 'ratingscales', $linkobject, 400, 500, $strscales, 'none', true);
    if ($return) {
        return $output;
    } else {
        echo $output;
    }
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:23,代码来源:weblib.php


示例9: array

     $lnoptions = array(0 => get_string('user'));
     $userprofiles = $DB->get_records('user_info_field');
     foreach ($userprofiles as $profile) {
         $lnoptions[$profile->id] = get_string('profilefield', 'admin') . ': ' . $profile->name;
     }
     $settings->add(new admin_setting_configselect('turnitintooltwo/pseudolastname', get_string('pseudolastname', 'turnitintooltwo'), get_string('pseudolastname_desc', 'turnitintooltwo'), 0, $lnoptions));
     $settings->add(new admin_setting_configselect('turnitintooltwo/lastnamegen', get_string('psuedolastnamegen', 'turnitintooltwo'), get_string('psuedolastnamegen_desc', 'turnitintooltwo'), 0, $ynoptions));
     $settings->add(new admin_setting_configtext('turnitintooltwo/pseudosalt', get_string('pseudoemailsalt', 'turnitintooltwo'), get_string('pseudoemailsalt_desc', 'turnitintooltwo'), ''));
     $settings->add(new admin_setting_configtext('turnitintooltwo/pseudoemaildomain', get_string('pseudoemaildomain', 'turnitintooltwo'), get_string('pseudoemaildomain_desc', 'turnitintooltwo'), ''));
 }
 // Following are default values for new instance.
 $settings->add(new admin_setting_heading('turnitintooltwo/defaults', get_string('defaults', 'turnitintooltwo'), get_string('defaults_desc', 'turnitintooltwo')));
 $settings->add(new admin_setting_configselect('turnitintooltwo/default_type', get_string('type', 'turnitintooltwo'), '', 0, turnitintooltwo_filetype_array()));
 $settings->add(new admin_setting_configselect('turnitintooltwo/default_numparts', get_string('numberofparts', 'turnitintooltwo'), '', 1, array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5)));
 $options = array();
 $scales = get_scales_menu();
 foreach ($scales as $value => $scale) {
     $options[-$value] = $scale;
 }
 for ($i = 100; $i >= 1; $i--) {
     $options[$i] = $i;
 }
 $settings->add(new admin_setting_configselect('turnitintooltwo/default_grade', get_string('overallgrade', 'turnitintooltwo'), '', 100, $options));
 if (!empty($config->useanon) && $current_section == 'modsettingturnitintooltwo') {
     $settings->add(new admin_setting_configselect('turnitintooltwo/default_anon', get_string('anon', 'turnitintooltwo'), '', 0, $ynoptions));
 }
 if (!empty($config->transmatch) && $current_section == 'modsettingturnitintooltwo') {
     $settings->add(new admin_setting_configselect('turnitintooltwo/default_transmatch', get_string('transmatch', 'turnitintooltwo'), '', 0, $ynoptions));
 }
 $settings->add(new admin_setting_configselect('turnitintooltwo/default_studentreports', get_string('studentreports', 'turnitintooltwo'), '', 0, $ynoptions));
 $gradedisplayoptions = array(1 => get_string('displaygradesaspercent', 'turnitintooltwo'), 2 => get_string('displaygradesasfraction', 'turnitintooltwo'));
开发者ID:Dextirpe,项目名称:moodle-mod_turnitintooltwo,代码行数:31,代码来源:settings.php


示例10: definition

 /**
  * Define the form - called by parent constructor
  */
 public function definition()
 {
     global $PAGE, $OUTPUT;
     $mform = $this->_form;
     $framework = $this->_customdata['competencyframework'];
     $parent = $this->_customdata['parent'];
     $pagecontextid = $this->_customdata['pagecontextid'];
     $competency = $this->get_persistent();
     $mform->addElement('hidden', 'competencyframeworkid');
     $mform->setType('competencyframeworkid', PARAM_INT);
     $mform->setConstant('competencyframeworkid', $framework->get_id());
     $mform->addElement('header', 'generalhdr', get_string('general'));
     $mform->addElement('static', 'frameworkdesc', get_string('competencyframework', 'tool_lp'), s($framework->get_shortname()));
     $mform->addElement('hidden', 'parentid', '', array('id' => 'tool_lp_parentcompetency'));
     $mform->setType('parentid', PARAM_INT);
     $mform->setConstant('parentid', $parent ? $parent->get_id() : 0);
     $parentlevel = $parent ? $parent->get_level() : 0;
     $parentname = $parent ? $parent->get_shortname() : get_string('competencyframeworkroot', 'tool_lp');
     $parentlabel = $competency->get_id() ? get_string('taxonomy_parent_' . $framework->get_taxonomy($parentlevel), 'tool_lp') : get_string('parentcompetency', 'tool_lp');
     $editaction = '';
     if (!$competency->get_id()) {
         $icon = $OUTPUT->pix_icon('t/editinline', get_string('parentcompetency_edit', 'tool_lp'));
         $editaction = $OUTPUT->action_link('#', $icon, null, array('id' => 'id_parentcompetencybutton'));
     }
     $mform->addElement('static', 'parentdesc', $parentlabel, "<span id='id_parentdesc'>{$parentname}</span>&nbsp;" . $editaction);
     // Set the picker competency when adding new competency.
     if (!$competency->get_id()) {
         // Call the parentcompetency_form init to initialize the competency picker for parent competency.
         $PAGE->requires->js_call_amd('tool_lp/parentcompetency_form', 'init', array('#id_parentcompetencybutton', '#tool_lp_parentcompetency', '#id_parentdesc', $framework->get_id(), $pagecontextid));
     }
     // Name.
     $mform->addElement('text', 'shortname', get_string('shortname', 'tool_lp'), 'maxlength="100"');
     $mform->setType('shortname', PARAM_TEXT);
     $mform->addRule('shortname', null, 'required', null, 'client');
     $mform->addRule('shortname', get_string('maximumchars', '', 100), 'maxlength', 100, 'client');
     // Description.
     $mform->addElement('editor', 'description', get_string('description', 'tool_lp'), array('rows' => 4));
     $mform->setType('description', PARAM_RAW);
     // ID number.
     $mform->addElement('text', 'idnumber', get_string('idnumber', 'tool_lp'), 'maxlength="100"');
     $mform->setType('idnumber', PARAM_RAW);
     $mform->addRule('idnumber', null, 'required', null, 'client');
     $mform->addRule('idnumber', get_string('maximumchars', '', 100), 'maxlength', 100, 'client');
     $scales = array(null => get_string('inheritfromframework', 'tool_lp')) + get_scales_menu();
     $scaleid = $mform->addElement('select', 'scaleid', get_string('scale', 'tool_lp'), $scales);
     $mform->setType('scaleid', PARAM_INT);
     $mform->addHelpButton('scaleid', 'scale', 'tool_lp');
     $mform->addElement('hidden', 'scaleconfiguration', '', array('id' => 'tool_lp_scaleconfiguration'));
     $mform->setType('scaleconfiguration', PARAM_RAW);
     $mform->addElement('button', 'scaleconfigbutton', get_string('configurescale', 'tool_lp'));
     $PAGE->requires->js_call_amd('tool_lp/scaleconfig', 'init', array('#id_scaleid', '#tool_lp_scaleconfiguration', '#id_scaleconfigbutton'));
     if ($competency && $competency->has_user_competencies()) {
         // The scale is used so we "freeze" the element. Though, the javascript code for the scale
         // configuration requires this field so we only disable it. It is fine as setting the value
         // as a constant will ensure that nobody can change it. And it's validated in the persistent anyway.
         $scaleid->updateAttributes(array('disabled' => 'disabled'));
         $mform->setConstant('scaleid', $competency->get_scaleid());
     }
     // Disable short forms.
     $mform->setDisableShortforms();
     $this->add_action_buttons(true, get_string('savechanges', 'tool_lp'));
 }
开发者ID:gabrielrosset,项目名称:moodle,代码行数:65,代码来源:competency.php


示例11: print_grade_menu

/**
 * Prints a grade menu (as part of an existing form) with help
 * Showing all possible numerical grades and scales
 *
 * @todo Finish documenting this function
 * @todo Deprecate: this is only used in a few contrib modules
 *
 * @global object
 * @param int $courseid The course ID
 * @param string $name
 * @param string $current
 * @param boolean $includenograde Include those with no grades
 * @param boolean $return If set to true returns rather than echo's
 * @return string|bool Depending on value of $return
 */
function print_grade_menu($courseid, $name, $current, $includenograde = true, $return = false)
{
    global $CFG, $OUTPUT;
    $output = '';
    $strscale = get_string('scale');
    $strscales = get_string('scales');
    $scales = get_scales_menu($courseid);
    foreach ($scales as $i => $scalename) {
        $grades[-$i] = $strscale . ': ' . $scalename;
    }
    if ($includenograde) {
        $grades[0] = get_string('nograde');
    }
    for ($i = 100; $i >= 1; $i--) {
        $grades[$i] = $i;
    }
    $output .= $OUTPUT->select(html_select::make($grades, $name, $current, false));
    $linkobject = '<span class="helplink"><img class="iconhelp" alt="' . $strscales . '" src="' . $OUTPUT->old_icon_url('help') . '" /></span>';
    $link = html_link::make('/course/scales.php?id=' . $courseid . '&list=true', $linkobject);
    $link->add_action(new popup_action('click', $link->url, 'ratingscales', array('height' => 400, 'width' => 500)));
    $link->title = $strscales;
    $output .= $OUTPUT->link($link);
    if ($return) {
        return $output;
    } else {
        echo $output;
    }
}
开发者ID:ajv,项目名称:Offline-Caching,代码行数:43,代码来源:weblib.php


示例12: print_string

 /> <?php 
print_string('moodlescale', 'brainstorm');
?>
            <?php 
helpbutton('operatorrouter.html&amp;operator=scale&amp;helpitem=quantifiertype', get_string('quantifiertype', 'brainstorm'), 'brainstorm');
?>
        </td>
    </tr>
    <tr>
        <td align="left"><b><?php 
print_string('moodlescale', 'brainstorm');
?>
:</b></td>
        <td align="right">
            <?php 
$scale_menu = get_scales_menu();
choose_from_menu($scale_menu, 'config_scale', $currentoperator->configdata->scale);
helpbutton('operatorrouter.html&amp;operator=scale&amp;helpitem=scale', get_string('scale', 'brainstorm'), 'brainstorm');
?>
        </td>
    </tr>
</table>
<?php 
if (has_capability('mod/brainstorm:manage', $context)) {
    ?>
<fieldset class="privateform">
<legend><?php 
    print_string('foradminsonly', 'brainstorm');
    ?>
</legend>
<table cellspacing="10">
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:prepare.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_schema_markup函数代码示例发布时间:2022-05-15
下一篇:
PHP get_save_path函数代码示例发布时间: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