UPDATE-RATE

Die Test-Installation wird aktuell zwischen 8:00 und 18:00 Uhr stündlich zur vollen Stunde aktualisiert.

Alles neu macht der Mai

ILIAS 9 ist da! Alle Infos zu den Highlights der neuen Version gibt es hier!

Documentation

Kitchen Sink documentation of style: 'Delos' of skin: 'ILIAS'

Custom

Description

Purpose
ILIAS allows users to upload icons for repository objects. Those, in opposite to the standard icons, need to be constructed with a path.
Composition
An Icon is rendered as image-tag.

Rivals

Standard Icon
Standard Icons MUST be used for core-objects.

Rules

Usage
  1. Custom Icons MAY still use an abbreviation.
Style
  1. Custom Icons MUST use SVG as graphic.
  2. Icons MUST have a transparent background so they could be put on all kinds of backgrounds.
  3. Images used for Custom Icons SHOULD have equal width and height (=be quadratic) in order not to be distorted.

Example 1: Custom icon

Example Small Custom Icon

Example Medium Custom Icon

Example Large Custom Icon

Example Small Custom Icon with Abbreviation

Example Medium Custom Icon with Abbreviation

Example Large Custom Icon with Abbreviation
<?php
 
declare(strict_types=1);
 
namespace ILIAS\UI\examples\Symbol\Icon\Custom;
 
function custom_icon()
{
    global $DIC;
    $f = $DIC->ui()->factory();
    $renderer = $DIC->ui()->renderer();
 
    $buffer = array();
 
    $path = './src/UI/examples/Symbol/Icon/Custom/my_custom_icon.svg';
    $ico = $f->symbol()->icon()->custom($path, 'Example');
 
    $buffer[] = $renderer->render($ico)
        . ' Small Custom Icon';
 
    $buffer[] = $renderer->render($ico->withSize('medium'))
        . ' Medium Custom Icon';
 
    $buffer[] = $renderer->render($ico->withSize('large'))
        . ' Large Custom Icon';
 
 
    //Note that the svg needs to contain strictly valid xml to work with abbreviations.
    //Some exports e.g. form illustrator seem to be not properly formatted by default.
    $path = './templates/default/images/standard/icon_fold.svg';
    $ico = $f->symbol()->icon()->custom($path, 'Example')
        ->withAbbreviation('FD');
 
    $buffer[] = $renderer->render($ico)
        . ' Small Custom Icon with Abbreviation';
 
    $buffer[] = $renderer->render($ico->withSize('medium'))
        . ' Medium Custom Icon with Abbreviation';
 
    $buffer[] = $renderer->render($ico->withSize('large'))
        . ' Large Custom Icon with Abbreviation';
 
 
    return implode('<br><br>', $buffer);
}
 

Relations

Parents
  1. UIComponent
  2. Symbol
  3. Icon