ada form->color and datatable row action icon no-wrap fixed
This commit is contained in:
+25
-17
@@ -6,9 +6,9 @@
|
||||
Desc. : v3 - Form Generator (jQuery & Bootstrap)
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : February 27th, 2008.
|
||||
Last Modified : January 19th, 2024.
|
||||
Last Modified : December 9th, 2025.
|
||||
|
||||
(c) 2008 - 2024, 3FONIA Software; WWW.3FONIA.COM.
|
||||
(c) 2008 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
@@ -142,28 +142,27 @@ final class Form {
|
||||
$_enab = ($benable==true) ? "" : ' disabled=true';
|
||||
$_req = ($breq==true) ? " required=true" : "";
|
||||
$_change = ' onchange="this.value=(this.checked)?\''.$avalue[0].'\':\''.$avalue[1].'\';'.($tchange==null?'':$tchange).'"';
|
||||
$tout = '<div class="form-check form-check-inline mr-1"><input type="checkbox" class="form-check-input" id="'.$tfield.'" name="'.$tfield.'" value="'.($bhasil?$avalue[1]:$avalue[0]).'"'.$_enab.$_change.$_req;
|
||||
$tout = '<input type="checkbox" class="form-check-input" id="'.$tfield.'" name="'.$tfield.'" value="'.($bhasil?$avalue[1]:$avalue[0]).'"'.$_enab.$_change.$_req;
|
||||
$tout .= ($bhasil==false) ? ' checked="checked"' : '';
|
||||
$tout .= '>';
|
||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function switch($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $aarr=array(), $thelp="", $tchange=null) {
|
||||
$_key = array_keys($aarr); $_val = array_values($aarr);
|
||||
$_enab = ($benable==true) ? "" : ' disabled=true';
|
||||
$_req = ($breq==true) ? " required=true" : "";
|
||||
$_change = ($tchange==null) ? ' onchange="this.value=(this.checked)?\''.$_key[0].'\':\''.$_key[1].'\';"' : ' onchange="this.value=(this.checked)?\''.$_key[0].'\':\''.$_key[1].'\';'.$tchange.'"';
|
||||
$tout = '<div class="form-check form-switch"><input class="form-check-input me-0" id="'.$tfield.'" name="'.$tfield.'" type="checkbox" role="switch" value="'.$tvalue.'"'.$_enab.$_change.$_req;
|
||||
$tout .= ($_key[0] == $tvalue) ? ' checked="checked"' : '';
|
||||
$tout .= '></div>';
|
||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
//todo: perlu test lagi !!
|
||||
public function switch_sq($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $aarr=array(), $thelp="", $tchange=null) {
|
||||
$_key = array_keys($aarr); $_val = array_values($aarr);
|
||||
$_enab = ($benable==true) ? "" : ' disabled=true';
|
||||
$_req = ($breq==true) ? " required=true" : "";
|
||||
$_change = ($tchange==null) ? ' onchange="this.value=(this.checked)?\''.$_key[0].'\':\''.$_key[1].'\';"' : ' onchange="this.value=(this.checked)?\''.$_key[0].'\':\''.$_key[1].'\';'.$tchange.'"';
|
||||
$tout = '<div class="form-check form-switch form-switch-lg"><input class="form-check-input me-0" id="'.$tfield.'" name="'.$tfield.'" type="checkbox" value="'.$tvalue.'"'.$_enab.$_change.$_req;
|
||||
$tout .= ($_key[0] == $tvalue) ? ' checked="checked"' : '';
|
||||
$tout .= '><label class="form-check-label fw-semibold small" for="'.$tfield.'"> </label></div>';
|
||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
//todo: belum diupgrade !!
|
||||
public function form_group_cbox($tfield, $tkey=null, $tclass=null, $ttable=null, $afield=null, $ncol=2) {
|
||||
public function group_cbox($tfield, $tkey=null, $tclass=null, $ttable=null, $afield=null, $ncol=2) {
|
||||
if ($ttable==null) return;
|
||||
$avalue = explode(",", $tkey);
|
||||
$afield = ($afield==null) ? array("ID", "Nama") : $afield;
|
||||
@@ -260,6 +259,15 @@ final class Form {
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function color($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $thelp="", $tchange=null) {
|
||||
$_enab = ($benable==true) ? "" : ' disabled=true';
|
||||
$_req = ($breq==true) ? " required=true" : "";
|
||||
$_change = ($tchange==null) ? '' : ' onchange="'.$tchange.'"';
|
||||
$tout = '<input type="color" class="form-control form-control-color" id="'.$tfield.'" name="'.$tfield.'" value="'.$tvalue.'"'.$_enab.$_change.$_req.' />';
|
||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function hidden($tfield, $tvalue="", $tclass="text") {
|
||||
$tout = '<input type="hidden" id="'.$tfield.'" value="'.$tvalue.'" class="'.$tclass.'" />';
|
||||
$this->__ahide[$tfield] = $tout;
|
||||
|
||||
Reference in New Issue
Block a user