You are here

public function FrxReport::link in Forena Reports 7.3

Same name and namespace in other branches
  1. 7.4 FrxReport.inc \FrxReport::link()

Convert a relative link to appropriately rendered html return html A properly formatted anchor tag

1 call to FrxReport::link()
FrxReport::format in ./FrxReport.inc

File

./FrxReport.inc, line 389
Basic report provider. Controls the rendering of the report.

Class

FrxReport

Code

public function link($title, $path, $options = array()) {

  // check if we have
  $l = '';
  if (strpos($path, ':') === FALSE) {
    switch ($this->link_mode) {
      case 'remove':
        $l = '';
        break;
      case 'no-link':
      case 'text':
        $valid = drupal_valid_path($path, FALSE);
        $l = $valid ? l($title, $path, $options) : $title;
        break;
      case 'disable':
        $valid = drupal_valid_path($path, FALSE);
        if (!$valid) {
          $options['attributes']['class'][] = 'disabled';
          $l = '<a ' . drupal_attributes($options['attributes']) . '>' . check_plain($title) . '</a>';
        }
        else {
          $l = l($title, $path, $options);
        }
        break;
      default:
        $l = l($title, $path, $options);
    }
  }
  else {
    $l = l($title, $path, $options);
  }
  return $l;
}