Thanks Soma and RJay.
This would be my module script:
class SiteSettings extends WireData implements Module, ConfigurableModule {
public static function getModuleInfo() {
return array(
'title' => 'Site settings',
'version' => 0.01,
'summary' => 'Store general site settings',
'author' => 'Gayan Virajith',
'singular' => true,
'autoload' => true,
);
}
static public function getDefaultData() {
return array(
'siteLogo' => '',
);
}
public function __construct() {
foreach(self::getDefaultData() as $key => $value) {
$this->$key = $value;
}
}
public function init() {
//do it later
}
public static function getModuleConfigInputfields(array $data) {
$inputfields = new InputfieldWrapper();
// ask site logo image
$field = wire('modules')->get('InputfieldImage');
$field->name = 'siteLogo';
$field->label = "Site Logo";
$field->maxFiles = 1;
if(isset($data['siteLogo'])) $field->value = $data['siteLogo'];
$inputfields->add($field);
return $inputfields;
}
}
I have attached module preview as well. According to Soma's advise, I have to give up.
Thanks every one.