You are here

AnalyticsServiceExportUI.class.php in Analytics 7

File

lib/export_ui/AnalyticsServiceExportUI.class.php
View source
<?php

class AnalyticsServiceExportUI extends ctools_export_ui {
  function access($op, $item) {

    // Only can add or import new services if there are available services that
    // can be added.
    if (in_array($op, array(
      'add',
      'import',
    )) && !analytics_service_add_service_options()) {
      return FALSE;
    }

    // Disable cloning entirely.
    if ($op == 'clone') {
      return FALSE;
    }
    if (!empty($item->locked)) {
      return FALSE;
    }
    return parent::access($op, $item);
  }
  function build_operations($item) {
    $operations = parent::build_operations($item);
    foreach ($operations as $op => $operation) {
      if ($op == 'enable' || $op == 'disable') {
        continue;
      }
      elseif (!$this
        ->access($op, $item)) {
        unset($operations[$op]);
      }
    }
    return $operations;
  }

}

Classes