/** Datei: plugins/rest/hooks/database/attribute/options/get.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * * @hook database.attribute.options::get * @param array $option Option * * @since 1.0.0 File is created */ if( isset( $option["emoji"] ) && !empty( $option["emoji"] ) ) return $option; if( !defined( "REST_ICON_EMOJIS_MAP" ) ) { $filename = PLUGINS_DIR . "/rest/assets/icon_emoji.json"; $filename = realpath( $filename ); if( file_exists( $filename ) ) { $iconmap = file_get_contents( $filename ); $iconmap = json_decode( $iconmap, TRUE ); if( $iconmap ) { define( "REST_ICON_EMOJIS_MAP", $iconmap ); } } } if( defined( "REST_ICON_EMOJIS_MAP" ) ) { if( isset( $option["icon"] ) ) { if( is_a( $option["icon"], ARUNOX\Plugins\REST\Generator\Config\Icon::class ) ) { $option["emoji"] = $option["icon"]->emoji(); } else if( preg_match('/\b(bi-[a-z0-9-]+)/i', $option["icon"], $matches ) ) { if( key_exists( $matches[1], REST_ICON_EMOJIS_MAP ) ) { $option["emoji"] = REST_ICON_EMOJIS_MAP[ $matches[1] ]; } } } } return $option;