From b9ee743f9dc760919d187918901419b188d79746 Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Thu, 15 Sep 2011 02:37:40 +0200 Subject: [PATCH] Improve active project in sidebar --- application/models/project.php | 13 +++----- application/views/header.php | 57 +++++++++++++++++++++++++--------- 2 files changed, 47 insertions(+), 23 deletions(-) diff --git a/application/models/project.php b/application/models/project.php index 6a24d27..bb8d894 100644 --- a/application/models/project.php +++ b/application/models/project.php @@ -143,16 +143,13 @@ class Project extends CI_Model { } /** - * Get all available configurations from a specific project. + * Counts all experiments for the specified project. * - * @param array $project_id The project to get the configuration from. + * @param string $projectId + * @return integer */ - public function getConfigurations($project_id) { - $query = $this->db->get_where('configurations', array('project_id' => $project_id)); - - $configurations = $query->result_array(); - - return $configurations; + public function countExperiments($projectId) { + return $this->db->get_where('experiments', array('project_id' => $projectId))->num_rows(); } /** diff --git a/application/views/header.php b/application/views/header.php index 72a1ab7..e02b453 100644 --- a/application/views/header.php +++ b/application/views/header.php @@ -34,7 +34,7 @@