Project

General

Profile

Actions

Bug #59141

closed

incomplete new pages-icon enhancement

Added by Bernd Wilke over 10 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2014-05-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

when enhancing the page-icons with the following code for pages which show content from another page, the new icons are not displayed at every location in the BE.

ext_tables.php:

// Defines $icon array()
$pathToExtension = t3lib_extMgm::extRelPath('myext');
$icons = array(
    'refpage' => $pathToExtension . 'Resources/Public/images/icons/refpageicon.png',
    'refpage_hide' => $pathToExtension . 'Resources/Public/images/icons/refpageicon_hide.png',
);
// Gives the $icon array to the sprite manager
t3lib_SpriteManager::addSingleIcons($icons, 'myext');

// Register userfunc for page icon
$TCA['pages']['ctrl']['typeicon_classes']['userFunc'] = 'tx_myext_iconClass->getPageIcon';

Classes/class.tx_myext_iconClass.php:

<?php
class tx_myext_iconClass {

  /**
   * Determines icon class for pages which display content from another page
   *
   * @param array $parameters array with record
   * @param string $ref Unused reference parameters
   * @return string Class name of page
   */
  public function getPageIcon($parameters, $ref) {
    $iconClass = '';
    $row = $parameters['row'];
    if ($row['content_from_pid']) {
      $iconClass = 'extensions-myext-refpage';
      if ((int)$row['nav_hide'] === 1) {
        $iconClass .= '_hide';
      }
    }
    return $iconClass;
  }
}

new icon:
  • page tree (middle-column)
  • access module IF top page
  • info-module: pagetree overview
  • info module: localzation overview IF top page
old icon:
  • access module IF subpage
  • list module: pages records
  • info module: localzation overview IF subpage
  • info module: realURL management
  • TYPO3 Element Browser
Actions

Also available in: Atom PDF