1 layout.admin.inc _layout_settings_get_group_operations($template_info, $is_default)

Given a path, return a list of operations for a group of layouts.

File

core/modules/layout/layout.admin.inc, line 3390
Admin page callbacks for the Layout module.

Code

function _layout_settings_get_group_operations($template_info, $is_default) {
  $links = array();

  if (!empty($template_info['flexible'])) {
    if (user_access('administer flexible templates')) {
      $links['configure'] = array(
        'title' => t('Configure regions'),
        'href' => 'admin/structure/layouts/settings/flexible-template/' . $template_info['name'] . '/configure',
      );
      $links['edit'] = array(
        'title' => t('Configure name'),
        'href' => 'admin/structure/layouts/settings/flexible-template/' . $template_info['name'] . '/edit',
      );
    }
    if (module_exists('config') && user_access('synchronize configuration')) {
      $links['export'] = array(
        'title' => t('Export'),
        'href' => 'admin/config/development/configuration/single/export',
        'query' => array(
          'group' => t('Flexible layout templates'),
          'name' => 'layout.flexible.' . $template_info['name'],
        ),
      );
    }
    if (user_access('administer flexible templates')) {
      $links['delete'] = array(
        'title' => t('Delete'),
        'href' => 'admin/structure/layouts/settings/flexible-template/' . $template_info['name'] . '/delete',
      );
    }
  }
  if ($is_default) {
    $links['disable'] = array(
      'title' => t('Disable'),
      'href' => 'admin/structure/layouts/settings/toggle/' . $template_info['name'] . '/disable',
      'query' => array('token' => backdrop_get_token('layout-template-' . $template_info['name'])),
    );
  }
  else {
    $links['enable'] = array(
      'title' => t('Enable'),
      'href' => 'admin/structure/layouts/settings/toggle/' . $template_info['name'] . '/enable',
      'query' => array('token' => backdrop_get_token('layout-template-' . $template_info['name'])),
    );
  }

  return $links;
}