Ejemplo n.º 1
0
 /**
  * This method should be overriden if you want to include a special heading or some other
  * html on a question editing page besides the question editing form.
  *
  * @param question_edit_form $mform a child of question_edit_form
  * @param object $question
  * @param string $wizardnow is '' for first page.
  */
 function display_question_editing_page(&$mform, $question, $wizardnow)
 {
     list($heading, $langmodule) = $this->get_heading(empty($question->id));
     print_heading_with_help($heading, $this->name(), $langmodule);
     $permissionstrs = array();
     if (!empty($question->id)) {
         if ($question->formoptions->canedit) {
             $permissionstrs[] = get_string('permissionedit', 'question');
         }
         if ($question->formoptions->canmove) {
             $permissionstrs[] = get_string('permissionmove', 'question');
         }
         if ($question->formoptions->cansaveasnew) {
             $permissionstrs[] = get_string('permissionsaveasnew', 'question');
         }
     }
     if (!$question->formoptions->movecontext && count($permissionstrs)) {
         print_heading(get_string('permissionto', 'question'), 'center', 3);
         $html = '<ul>';
         foreach ($permissionstrs as $permissionstr) {
             $html .= '<li>' . $permissionstr . '</li>';
         }
         $html .= '</ul>';
         print_box($html, 'boxwidthnarrow boxaligncenter generalbox');
     }
     $mform->display();
 }
Ejemplo n.º 2
0
    /**
     * This method should be overriden if you want to include a special heading or some other
     * html on a question editing page besides the question editing form.
     *
     * @param question_edit_form $mform a child of question_edit_form
     * @param object $question
     * @param string $wizardnow is '' for first page.
     */
    public function display_question_editing_page($mform, $question, $wizardnow) {
        global $OUTPUT;
        $heading = $this->get_heading(empty($question->id));

        echo $OUTPUT->heading_with_help($heading, 'pluginname', $this->plugin_name());

        $permissionstrs = array();
        if (!empty($question->id)) {
            if ($question->formoptions->canedit) {
                $permissionstrs[] = get_string('permissionedit', 'question');
            }
            if ($question->formoptions->canmove) {
                $permissionstrs[] = get_string('permissionmove', 'question');
            }
            if ($question->formoptions->cansaveasnew) {
                $permissionstrs[] = get_string('permissionsaveasnew', 'question');
            }
        }
        if (count($permissionstrs)) {
            echo $OUTPUT->heading(get_string('permissionto', 'question'), 3);
            $html = '<ul>';
            foreach ($permissionstrs as $permissionstr) {
                $html .= '<li>'.$permissionstr.'</li>';
            }
            $html .= '</ul>';
            echo $OUTPUT->box($html, 'boxwidthnarrow boxaligncenter generalbox');
        }
        $mform->display();
    }
 /**
  * This method should be overriden if you want to include a special heading or some other
  * html on a question editing page besides the question editing form.
  *
  * @param question_edit_form $mform a child of question_edit_form
  * @param object $question
  * @param string $wizardnow is '' for first page.
  */
 public function display_question_editing_page($mform, $question, $wizardnow)
 {
     global $OUTPUT;
     $heading = $this->get_heading(empty($question->id));
     echo $OUTPUT->heading_with_help($heading, 'pluginname', $this->plugin_name());
     $mform->display();
 }
 /**
  * This method should be overriden if you want to include a special heading or some other
  * html on a question editing page besides the question editing form.
  *
  * @param question_edit_form $mform a child of question_edit_form
  * @param object $question
  * @param string $wizardnow is '' for first page.
  */
 public function display_question_editing_page($mform, $question, $wizardnow)
 {
     global $OUTPUT;
     $heading = $this->get_heading(empty($question->id));
     if (get_string_manager()->string_exists('pluginname_help', $this->plugin_name())) {
         echo $OUTPUT->heading_with_help($heading, 'pluginname', $this->plugin_name());
     } else {
         echo $OUTPUT->heading_with_help($heading, $this->name(), $this->plugin_name());
     }
     //Who cares about that:
     //        $permissionstrs = array();
     //        if (!empty($question->id)) {
     //            if ($question->formoptions->canedit) {
     //                $permissionstrs[] = get_string('permissionedit', 'question');
     //            }
     //            if ($question->formoptions->canmove) {
     //                $permissionstrs[] = get_string('permissionmove', 'question');
     //            }
     //            if ($question->formoptions->cansaveasnew) {
     //                $permissionstrs[] = get_string('permissionsaveasnew', 'question');
     //            }
     //        }
     //        if (!$question->formoptions->movecontext  && count($permissionstrs)) {
     //            echo $OUTPUT->heading(get_string('permissionto', 'question'), 3);
     //            $html = '<ul>';
     //            foreach ($permissionstrs as $permissionstr) {
     //                $html .= '<li>'.$permissionstr.'</li>';
     //            }
     //            $html .= '</ul>';
     //            echo $OUTPUT->box($html, 'boxwidthnarrow boxaligncenter generalbox');
     //        }
     $mform->display();
 }
Ejemplo n.º 5
0
 /**
  * This method should be overriden if you want to include a special heading or some other
  * html on a question editing page besides the question editing form.
  *
  * @param question_edit_form $mform a child of question_edit_form
  * @param object $question
  * @param string $wizardnow is '' for first page.
  */
 function display_question_editing_page(&$mform, $question, $wizardnow)
 {
     list($heading, $langmodule) = $this->get_heading();
     print_heading_with_help($heading, $this->name(), $langmodule);
     $mform->display();
 }