function AdvisingScreen::display_screen

7.x AdvisingScreen.php AdvisingScreen::display_screen()
6.x AdvisingScreen.php AdvisingScreen::display_screen()

This function generates the HTML to display the screen. Should be used in conjunction with output_to_browser()

Return value

string

File

classes/AdvisingScreen.php, line 2210

Class

AdvisingScreen

Code

function display_screen() 
 {
  // This will generate the html to display the screen.
  $pC = "";

  $school_id = db_get_school_id_for_student_id($this->student->student_id);


  if (!$this->db) {
    $this->db = get_global_database_handler();
  }

  if ($this->bool_hiding_grades && !$this->bool_print && variable_get_for_school("hiding_grades_message", '', $school_id) != "") 
   {
    // Display the message about us hiding grades.
    $pC .= "
          <tr><td colspan='2'>
                <div class='  hypo' style='margin-top: 4px; margin-bottom: 4px; 
                 padding: 2px; border: 1px solid maroon;'>
                <table border='0' cellspacing='0' cellpadding='0'>
                <td valign='top'>
                  <img src='" . fp_theme_location() . "/images/alert_lg.gif' >  
                </td>
                <td valign='middle' class=' ' style='padding-left: 8px;'>
                  " . variable_get_for_school("hiding_grades_message", "", $school_id) . "
                </td>
                </table>
                </div>
          </td></tr>      
      ";
  }


  //$pC .= $this->draw_currently_advising_box();
  $pC .= $this->draw_progress_boxes();

  $pC .= $this->draw_public_note();
  $t = 0;
  foreach ($this->box_array as $index => $box_array_contents) {

    $align = "right";
    if ($this->is_on_left) 
     {
      $pC .= "<tr>";
      $align = "left";
    }
    $css_index = fp_get_machine_readable($index);
    $pC .= "<td valign='top' align='$align' class='fp-boxes fp-boxes-$css_index'>";
    $pC .= $box_array_contents;
    $pC .= "</td>";


    if (!$this->is_on_left) // on right of page
     {
      $pC .= "</tr>";
    }
    $this->is_on_left = !$this->is_on_left;
  }

  if (!$this->is_on_left) // on right of the page.
   { // close up any loose ends.
    $pC .= "</tr>";
  }

  if (user_has_permission("can_advise_students")) 
   {
    if (!$this->bool_print && !$this->bool_blank) 
     {

      $pC .= "<tr>";

      $pC .= "<td class='fp-boxes fp-boxes-blank'>&nbsp;</td>";


      $render = array();
      //$render['html'] = fp_render_button(t("Submit"),"submitSaveActive();");
      $render ['submit_button_html'] = array(
        'value' => "<div class='buttons form-element element-type-submit'>
                            <input type='button' id='mainform_submit_btn' value='" . t("Submit") . "' onClick='submitSaveActive();'>
                           </div>",
        'weight' => 100,
      );

      invoke_hook("content_alter", array(&$render, 'advise_submit_button'));


      $pC .= "<td class='fp-boxes fp-boxes-submit-button' align='center'>
            <div class='  advise_submit_button_wrapper' style='margin-top:35px; margin-bottom:10px; padding: 10px;'>
            " . fp_render_content($render) . "         
            </div>
            </td></tr>
            ";


      //$this->add_to_screen("<input type='button' value='Submit' onClick='submitSaveActive();'>");
    }
  }

  return $pC;

}