From e9643d4a4f1078881daba0c141b2b1517e2c0394 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Thu, 25 Mar 2021 17:48:37 +0100 Subject: [PATCH] Cosmetic --- html/css/style-classic7.css | 6 +++++- include/lib/ac_common.php | 7 +++++-- include/lib/html_input.class.php | 2 +- include/lib/icon_action.class.php | 28 ++++++++++++++++++++++++---- include/lib/inplace_edit.class.php | 4 ++-- include/lib/iposte.class.php | 11 +++++++++-- scenario/icon_actionTest.php | 18 ++++++++++++++---- 7 files changed, 60 insertions(+), 16 deletions(-) diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css index 3b7abb2cb..5d3947528 100644 --- a/html/css/style-classic7.css +++ b/html/css/style-classic7.css @@ -54,7 +54,11 @@ input:focus { color:orangered; font-style: italic; background-color:transparent; - + font-size: 115%; + font-weight: 0; + padding: 5px; + margin: 5px; + font-family: sans-serif; } a.mtitle span.notice { text-decoration: underline; diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php index dde53df18..87c11f5b0 100644 --- a/include/lib/ac_common.php +++ b/include/lib/ac_common.php @@ -39,7 +39,10 @@ function h($p_string) { return htmlspecialchars($p_string,ENT_QUOTES|ENT_HTML5,'UTF-8',true); } - +function p($p_string) +{ + return '

'.$p_string."

"; +} function span($p_string, $p_extra='') { return '' . $p_string . ''; @@ -1571,4 +1574,4 @@ function add_http_link($text) return $ret; -} \ No newline at end of file +} diff --git a/include/lib/html_input.class.php b/include/lib/html_input.class.php index 63433cdee..de5372919 100755 --- a/include/lib/html_input.class.php +++ b/include/lib/html_input.class.php @@ -238,7 +238,7 @@ class HtmlInput */ static function button_anchor($p_label, $p_value, $p_name="", - $p_javascript="", $p_class="button") + $p_javascript="", $p_class="smallbutton") { $href=""; if ($p_value!="") diff --git a/include/lib/icon_action.class.php b/include/lib/icon_action.class.php index ddf9df9d6..8ba3468db 100644 --- a/include/lib/icon_action.class.php +++ b/include/lib/icon_action.class.php @@ -211,7 +211,20 @@ class Icon_Action static function hide($action, $javascript) { $r=''; - $r.=''.$action.''; + $r.=''.$action.''; + return $r; + } + /** + * Return a html string with an anchor to hide a div, put it in the right corner + * @param $action action action to perform (message) + * @param $javascript javascript + * @note not protected against html + * @see Acc_Ledger::display_search_form + */ + static function hide_icon( $p_id,$javascript) + { + $r=''; + $r.=''."".''; return $r; } /** @@ -219,9 +232,9 @@ class Icon_Action * @param type $javascript * @return string */ - static function notvisible($javascript) { + static function show_icon($p_id,$javascript) { $r=''; - $r.=''; + $r.=''; return $r; } @@ -281,7 +294,14 @@ class Icon_Action } static function more($p_id,$p_javascript) { - $r=sprintf('', + $r=sprintf('', + $p_id, + $p_javascript); + return $r; + } + static function less($p_id,$p_javascript) + { + $r=sprintf('', $p_id, $p_javascript); return $r; diff --git a/include/lib/inplace_edit.class.php b/include/lib/inplace_edit.class.php index 1868061b2..5b224a311 100644 --- a/include/lib/inplace_edit.class.php +++ b/include/lib/inplace_edit.class.php @@ -78,8 +78,8 @@ class Inplace_Edit if ($this->input instanceof ITextarea) { echo '
'; } - echo ''._('ok').''; - echo ''._('cancel').''; + echo Icon_Action::validate("inplace_edit_ok".$this->input->id,""); + echo Icon_Action::cancel("inplace_edit_cancel".$this->input->id, ""); echo << $('{$this->input->id}edit').addClassName('inplace_edit_input'); diff --git a/include/lib/iposte.class.php b/include/lib/iposte.class.php index cb7460f84..8a429c979 100644 --- a/include/lib/iposte.class.php +++ b/include/lib/iposte.class.php @@ -78,6 +78,7 @@ $text->set_attribute('account','field'); */ class IPoste extends HtmlInput { + var $nb_row; // number of row, default 1 function __construct($p_name="",$p_value="",$p_id="") { @@ -90,9 +91,10 @@ class IPoste extends HtmlInput $this->disabled=false; $this->javascript=""; $this->extra2="all"; + $this->extra=""; $this->attribute=array(); $this->id=$p_id; - + $this->nb_row=1; } @@ -148,7 +150,12 @@ class IPoste extends HtmlInput $this->id=($this->id=="")?$this->name:$this->id; /* create the text */ - $itext=new IText($this->name,$this->value,$this->id); + if ( $this->nb_row ==1 ) { + $itext=new IText($this->name,$this->value,$this->id); + }else { + $itext=new ITextarea($this->name, $this->value, $this->id); + $itext->style=$this->extra; + } if ( isset ($this->css_size)) $itext->css_size=$this->css_size; diff --git a/scenario/icon_actionTest.php b/scenario/icon_actionTest.php index c9037a14d..f5020ec7c 100644 --- a/scenario/icon_actionTest.php +++ b/scenario/icon_actionTest.php @@ -48,8 +48,17 @@ include_once NOALYSS_INCLUDE."/lib/icon_action.class.php";

warnbulle

+

+ hide - +

+

+ + hide_icon +

+

+ show_icon +

trash

@@ -62,12 +71,13 @@ include_once NOALYSS_INCLUDE."/lib/icon_action.class.php";

validate

-

- detail -

+

more

+

+ less +

Lock