Add custom select field
This commit is contained in:
parent
1c3670c180
commit
5664ff0b93
1 changed files with 24 additions and 5 deletions
|
@ -369,6 +369,18 @@ echo Bootstrap::formOpen(array(
|
||||||
'class'=>'mb-2',
|
'class'=>'mb-2',
|
||||||
'labelClass'=>'mb-2 pb-2 border-bottom text-uppercase w-100'
|
'labelClass'=>'mb-2 pb-2 border-bottom text-uppercase w-100'
|
||||||
));
|
));
|
||||||
|
} elseif ($options['type']=="select") {
|
||||||
|
if (isset($options['options']) ){
|
||||||
|
$options['options'] = explode(',',','.$options['options']);
|
||||||
|
}
|
||||||
|
echo Bootstrap::formSelect(array(
|
||||||
|
'name'=>'custom['.$field.']',
|
||||||
|
'label'=>(isset($options['label'])?$options['label']:''),
|
||||||
|
'options'=>((isset($options['options']))?$options['options']:''),
|
||||||
|
'selected'=>(isset($options['default'])?$options['default']:''),
|
||||||
|
'class'=>'mb-2',
|
||||||
|
'tip'=>(isset($options['tips'])?$options['tips']:''),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -409,6 +421,18 @@ echo Bootstrap::formOpen(array(
|
||||||
'class'=>'mt-2',
|
'class'=>'mt-2',
|
||||||
'labelClass'=>'mb-2 pb-2 border-bottom text-uppercase w-100'
|
'labelClass'=>'mb-2 pb-2 border-bottom text-uppercase w-100'
|
||||||
));
|
));
|
||||||
|
} elseif ($options['type']=="select") {
|
||||||
|
if (isset($options['options']) ){
|
||||||
|
$options['options'] = explode(',',','.$options['options']);
|
||||||
|
}
|
||||||
|
echo Bootstrap::formSelect(array(
|
||||||
|
'name'=>'custom['.$field.']',
|
||||||
|
'label'=>(isset($options['label'])?$options['label']:''),
|
||||||
|
'options'=>((isset($options['options']))?$options['options']:''),
|
||||||
|
'selected'=>(isset($options['default'])?$options['default']:''),
|
||||||
|
'class'=>'mb-2',
|
||||||
|
'tip'=>(isset($options['tips'])?$options['tips']:''),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -434,11 +458,6 @@ $(document).ready(function() {
|
||||||
$("#jseditor").val($('#jseditor').val()+'<img src="'+filename+'" alt="">');
|
$("#jseditor").val($('#jseditor').val()+'<img src="'+filename+'" alt="">');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (typeof editorInsertLinkedMedia != "function") {
|
|
||||||
window.editorInsertLinkedMedia = function(filename, link){
|
|
||||||
$("#jseditor").val($('#jseditor').val()+'<a href="'+link+'"><img src="'+filename+'" alt=""></a>');
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Button switch
|
// Button switch
|
||||||
$("#jsbuttonSwitch").on("click", function() {
|
$("#jsbuttonSwitch").on("click", function() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue