function Group::load_descriptive_data

6.x Group.php Group::load_descriptive_data()
1 call to Group::load_descriptive_data()

File

classes/Group.php, line 524

Class

Group

Code

function load_descriptive_data() 
 {
  $cur = null;
  static $group_descriptive_data_cache = array();
  if (isset($group_descriptive_data_cache [$this->get_db_group_id()])) {
    $cur = $group_descriptive_data_cache [$this->get_db_group_id()];
  }
  else {
    $table_name = "groups";
    if ($this->bool_use_draft) {
      $table_name = "draft_$table_name";
    }
    // Load information about the group's title, icon, etc.
    $res = db_query("SELECT * 
                       FROM `$table_name`
                       WHERE group_id = ? ", $this->get_db_group_id());
    $cur = db_fetch_array($res);
    $group_descriptive_data_cache [$this->get_db_group_id()] = $cur;
  }

  if ($cur) {

    $this->title = trim($cur ["title"]);
    $this->icon_filename = trim($cur ["icon_filename"]);
    if ($this->icon_filename == "") {
      $this->icon_filename = "major.gif"; // set a default!
    }
    $this->group_name = trim($cur ["group_name"]);
    $this->data_entry_comment = trim($cur ["data_entry_comment"]);
    $this->priority = trim($cur ["priority"]);
    $this->definition = trim($cur ["definition"]);
    $this->db_delete_flag = trim($cur ["delete_flag"]);
    $this->db_catalog_repeat = trim($cur ["catalog_repeat"]);
    $this->catalog_year = trim($cur ["catalog_year"]);
    $this->public_note = trim($cur ["public_note"]);
    $this->school_id = intval($cur ["school_id"]);

  }

  if ($this->group_id == DegreePlan::GROUP_ID_FOR_COURSES_ADDED) 
   {
    $this->title = "Add an Additional Course";
  }


}