chart = JRequest :: getString('chart', self :: ACCESS_MODE); $model = $this -> getModel(self :: MODEL); mb_internal_encoding('UTF-8'); switch ($this -> chart) { case self :: ACCESS_MODE: $this -> publicationsByCategory = $model -> getPublicationsByAccessMode(); break; case self :: PROGRAMME: $this -> publicationsByCategory = $model -> getPublicationsByProgramme(self :: LIMIT); foreach ($this -> publicationsByCategory as $publicationsByCategory) { if ($publicationsByCategory -> acronym == NULL) $publicationsByCategory -> acronym = $publicationsByCategory -> name; if (strlen($publicationsByCategory -> acronym) > self :: MAX_ACRONYM) $publicationsByCategory -> acronym = mb_substr($publicationsByCategory -> acronym, 0, self :: MAX_ACRONYM - strlen(self :: ACRONYM_SUFFIX)) . self :: ACRONYM_SUFFIX; } $this -> chartTitle = JText :: _('PUBLICATIONS_PROJECTS_PER_PROGRAMME'); break; case self :: SCIENTIFIC_AREA: $this -> publicationsByCategory = $model -> getPublicationsByScientificArea(self :: LIMIT); foreach ($this -> publicationsByCategory as $publicationsByCategory) { if ($publicationsByCategory -> acronym == NULL) $publicationsByCategory -> acronym = $publicationsByCategory -> name; if (strlen($publicationsByCategory -> acronym) > self :: MAX_ACRONYM) $publicationsByCategory -> acronym = mb_substr($publicationsByCategory -> acronym, 0, self :: MAX_ACRONYM - strlen(self :: ACRONYM_SUFFIX)) . self :: ACRONYM_SUFFIX; } $this -> chartTitle = JText :: _('PUBLICATIONS_PROJECTS_PER_SCIENTIFIC_AREA'); break; case self :: COUNTRY: $this -> publicationsByCategory = $model -> getPublicationsByCountry(self :: LIMIT); foreach ($this -> publicationsByCategory as $publicationsByCategory) { if ($publicationsByCategory -> acronym == NULL) $publicationsByCategory -> acronym = $publicationsByCategory -> name; if (strlen($publicationsByCategory -> acronym) > self :: MAX_ACRONYM) $publicationsByCategory -> acronym = mb_substr($publicationsByCategory -> acronym, 0, self :: MAX_ACRONYM - strlen(self :: ACRONYM_SUFFIX)) . self :: ACRONYM_SUFFIX; } $this -> chartTitle = JText :: _('PUBLICATIONS_PROJECTS_PER_COUNTRY'); break; case self :: INSTITUTION: $this -> publicationsByCategory = $model -> getPublicationsByInstitution(self :: LIMIT); foreach ($this -> publicationsByCategory as $publicationsByCategory) { if ($publicationsByCategory -> acronym == NULL) $publicationsByCategory -> acronym = $publicationsByCategory -> name; if (strlen($publicationsByCategory -> acronym) > self :: MAX_ACRONYM) $publicationsByCategory -> acronym = mb_substr($publicationsByCategory -> acronym, 0, self :: MAX_ACRONYM - strlen(self :: ACRONYM_SUFFIX)) . self :: ACRONYM_SUFFIX; } $this -> chartTitle = JText :: _('PUBLICATIONS_PROJECTS_PER_INSTITUTION'); } if (count($errors = $this -> get('Errors')) > 0) { JLog :: add('Error viewing chart: ' . implode("\n", $errors), JLog :: ERROR, self :: LOG); return FALSE; } parent :: display($template); } }