From a7889db127f8c15a6609ed2344e94d0a9f068a9e Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sun, 29 May 2016 18:10:15 +0200 Subject: Reduce overall width with line breaks and font size --- api/img_adt_svc_relais.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'api') diff --git a/api/img_adt_svc_relais.php b/api/img_adt_svc_relais.php index a8ee294..f1f9d1b 100644 --- a/api/img_adt_svc_relais.php +++ b/api/img_adt_svc_relais.php @@ -60,6 +60,12 @@ EOD; function node_adt($adherent_id, $shape, $adt, $adt_title) { $adt_title = htmlentities($adt_title); + foreach ( [ 10, 30 ] as $limit ) { + $breakpos = strpos($adt_title, ' ', $limit); + if ( $breakpos !== FALSE ) { + $adt_title = substr($adt_title, 0, $breakpos) . '
' . substr($adt_title, $breakpos); + } + } return << @@ -79,7 +85,7 @@ function node_equipement($eid, $img, $label, $ip) { "e$eid" [ margin=0, shape=none, label=< - +
$label
$sub
$label
$sub
>, URL="/gestion/equipements/view/$eid"]; -- cgit v1.1