container->db; $query = $db->getQuery(true) ->select(array( $db->qn('id') . ' as ' . $db->qn('value'), $db->qn('description') . ' as ' . $db->qn('text'), ))->from($db->qn('#__ak_profiles')); $db->setQuery($query); $records = $db->loadAssocList(); $ret = array(); if (!empty($records)) { foreach ($records as $profile) { $ret[] = Select::option($profile['value'], $profile['text']); } } return $ret; } /** * Read a changelog file and returns its HTML beautified rendering * * @param string $file The file to read the changelog from * @param boolean $onlyLast If true we'll only show the last version * * @return string The HTML beautified rendering of the changelog */ public function coloriseChangelog($file, $onlyLast = false) { $ret = ''; $lines = @file($file); if (empty($lines)) { return $ret; } array_shift($lines); foreach ($lines as $line) { $line = trim($line); if (empty($line)) { continue; } $type = substr($line, 0, 1); $safeTrimmed = htmlentities(trim(substr($line, 2))); switch ($type) { case '=': continue; break; case '+': $ret .= <<< HTML
  • $safeTrimmed
  • HTML; break; case '-': $ret .= <<< HTML
  • $safeTrimmed
  • HTML; break; case '~': $ret .= <<< HTML
  • $safeTrimmed
  • HTML; break; case '!': $ret .= <<< HTML
  • $safeTrimmed
  • HTML; break; case '#': $ret .= <<< HTML
  • $safeTrimmed
  • HTML; break; default: if (!empty($ret)) { $ret .= ""; if ($onlyLast) { return $ret; } } if (!$onlyLast) { $ret .= "

    $line

    \n"; } $ret .= "