mecha-cms / x.panel

Control panel feature.
Other
6 stars 0 forks source link

Alert and Icon Definition as Associative Array #31

Closed taufik-nurrohman closed 10 months ago

taufik-nurrohman commented 2 years ago

Alert

Potential to be able to add action links right after the alert message.

$_['alert']['info'][] = [
    'description' => 'Page <b>Lorem Ipsum</b> successfully updated.',
    'tasks' => [
        'view' => [],
        'dismiss' => []
    ],
    'stack' => 10
];

Icon

Potential to create richer SVG content, also potential to add new attributes to the <svg> elements.

[
    'type' => 'link',
    'title' => 'Edit',
    'icon' => [
        '2' => [
            'height' => 24,
            'version' => '1.1',
            'width' => 24
        ],
        'path' => 'M5,3C3.89,3 3,3.89 ... 17.78,4M15.37,6.12L8,13.5V16H10.5L17.87,8.62L15.37,6.12Z'
    ]
]
taufik-nurrohman commented 10 months ago

https://github.com/mecha-cms/x.panel/blob/a7e36065131c4571863648853a55e49a6aebc5f3/index/panel.php#L136-L180

https://github.com/mecha-cms/x.panel/blob/a7e36065131c4571863648853a55e49a6aebc5f3/engine/f/lot/type.php#L710-L744