Dotclear

Changeset 3615:b9ac15edad1c for inc


Ignore:
Timestamp:
12/11/17 11:12:57 (8 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Reduce close region of message box as it prevents to copy the content, single error message are not more listed as list but paragraph.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.error.php

    r3074 r3615  
    3030     /** @var string HTML error item pattern */ 
    3131     protected $html_item = "<li>%s</li>\n"; 
     32     /** @var string HTML error single pattern */ 
     33     protected $html_single = "<p>%s</p>\n"; 
    3234 
    3335     /** 
     
    9496     * @param string     $item          HTML error item pattern 
    9597     */ 
    96      public function setHTMLFormat($list,$item) 
     98     public function setHTMLFormat($list,$item,$single=null) 
    9799     { 
    98100          $this->html_list = $list; 
    99101          $this->html_item = $item; 
     102          if ($single) { 
     103               $this->html_single = $single; 
     104          } 
    100105     } 
    101106 
     
    111116          if ($this->flag) 
    112117          { 
    113                foreach ($this->errors as $msg) 
    114                { 
    115                     $res .= sprintf($this->html_item,$msg); 
     118               if (count($this->errors == 1)) { 
     119                    $res = sprintf($this->html_single,$this->errors[0]); 
     120               } else { 
     121                    foreach ($this->errors as $msg) { 
     122                         $res .= sprintf($this->html_item,$msg); 
     123                    } 
     124                    $res = sprintf($this->html_list,$res); 
    116125               } 
    117  
    118                $res = sprintf($this->html_list,$res); 
    119126          } 
    120127 
Note: See TracChangeset for help on using the changeset viewer.

Sites map