function edit_form(&$form, &$form_state) {
    parent::edit_form($form, $form_state);

    $form['category'] = array(
      '#type' => 'textfield',
      '#title' => t('Category'),
      '#description' => t('What category this content should appear in. If left blank the category will be "Miscellaneous".'),
      '#default_value' => $form_state['item']->category,
    );

    $form['title'] = array(
      '#type' => 'textfield',
      '#default_value' => $form_state['item']->settings['title'],
      '#title' => t('Title'),
    );

    $form['body_field']['body'] = array(
      '#title' => t('Body'),
      '#type' => 'textarea',
      '#default_value' => $form_state['item']->settings['body'],
    );
    $parents[] = 'format';
    $form['body_field']['format'] = filter_form($form_state['item']->settings['format'], 1, $parents);

    $form['substitute'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use context keywords'),
      '#description' => t('If checked, context keywords will be substituted in this content.'),
      '#default_value' => !empty($form_state['item']->settings['substitute']),
    );
  }
Example #2
0
function compare_aux($select_name, $xset_name, $snap)
{
    global $top_unit, $course_id, $filter, $filter_cat;
    global $breakdown, $breakdown_cat;
    get_filters_from_form();
    $select_unit = lookup_unit($top_unit, $select_name);
    if (!$select_unit) {
        error_page("no select unit");
    }
    admin_page_head("Unit comparison");
    echo "\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . URL_BASE . "bolt_admin.css\">\n\t\tThe following compares the alternatives of\n\t\t<b>{$select_name}</b> with respect to <b>{$xset_name}</b>.\n\t\t<p>\n\t";
    echo "<table class=\"bolt_box\">";
    if ($breakdown) {
        echo "<tr class=bolt_head1><td colspan=2>Total</td></tr>";
    }
    compare_case(null, $select_unit, $snap, $filter, $filter_cat, null, null);
    if ($breakdown) {
        echo "<tr class=bolt_head1><td colspan=2>Breakdown by " . $breakdown->name() . "</td></tr>";
        foreach ($breakdown->categories() as $c) {
            compare_case($c, $select_unit, $snap, $filter, $filter_cat, $breakdown, $c);
            echo "<p>";
        }
    }
    echo "</table>";
    echo "\n\t\t<form action=bolt_compare.php>\n\t\t<input type=hidden name=action value=compare>\n\t\t<input type=hidden name=course_id value={$course_id}>\n\t\t<input type=hidden name=select_name value=\"{$select_name}\">\n\t\t<input type=hidden name=xset_name value=\"{$xset_name}\">\n\t\t<table width=600><tr><td>\n\t";
    filter_form($filter ? $filter->name() : "", $filter_cat);
    echo "</td><td>";
    breakdown_form($breakdown ? $breakdown->name() : "");
    echo "\n\t\t</td></tr></table>\n\t\t<p>\n\t\t<input type=submit value=OK>\n\t\t</form>\n\t";
    admin_page_tail();
}
Example #3
0
function show_map()
{
    global $snap, $course_id, $top_unit, $filter, $filter_cat, $breakdown;
    global $course;
    get_filters_from_form();
    admin_page_head("Course map for '{$course->name}'");
    bolt_style();
    $snap = read_map_snapshot($course_id);
    start_table();
    echo "\n\t\t<tr>\n\t\t\t<th>Name</th>\n\t\t\t<th>Type</th>\n\t";
    if ($breakdown) {
        echo "<th>Group</th>";
    }
    echo "\n\t\t\t<th>Views</th>\n\t\t\t<th>Questions</th>\n\t\t\t<th>Outcome<br>\n\t\t\t\t<span class=green>Next</span>\n\t\t\t\t<span class=yellow>Back</span>\n\t\t\t\t<span class=red>None</span>\n\t\t\t</th>\n\t\t\t<th>Score</th>\n\t\t\t<th>Time</th>\n\t\t</tr>\n\t";
    show_unit_recurse($top_unit, 0);
    echo "\n\t\t</table>\n\t\t<form action=bolt_map.php>\n\t\t<input type=hidden name=action value=map>\n\t\t<input type=hidden name=course_id value={$course_id}>\n\t\t<table width=600><tr><td valign=top>\n\t";
    filter_form($filter ? $filter->name() : "", $filter_cat);
    echo "</td><td valign=top>";
    breakdown_form($breakdown ? $breakdown->name() : "");
    echo "\n\t\t</td></tr></table>\n\t\t<p>\n\t\t<input type=submit value=OK>\n\t\t</form>\n\t";
    admin_page_tail();
}