Project

General

Profile

Actions

Bug #59141

closed

incomplete new pages-icon enhancement

Added by Bernd Wilke almost 10 years ago. Updated over 8 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 #1

Updated by Bernd Wilke almost 10 years ago

new version of function calls:

// Defines $icon array()
$pathToExtension = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('myexts');
$icons = array(
    'refpage'      => $pathToExtension . 'Resources/Public/images/refpageicon.png',
    'refpage_hide' => $pathToExtension . 'Resources/Public/images/refpageicon_hide.png',
);

// Gives the $icon array to the sprite manager
\TYPO3\CMS\Backend\Sprite\SpriteManager::addSingleIcons($icons, 'myext');

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

Actions #2

Updated by Mathias Schreiber over 9 years ago

  • Target version changed from next-patchlevel to 7.4 (Backend)
Actions #3

Updated by Susanne Moog over 8 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #4

Updated by Benni Mack over 8 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #5

Updated by Benni Mack over 8 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (7 LTS)

Can you please recheck again? We changed quite some things around the icon API in 7.5.

Actions #6

Updated by Benni Mack over 8 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF