Hello,
I would like to create an admin configuration page for my block "Like", I've created a file settings.php in blocks/like. I've updated the version number and purged cache but the page doesn't appear in Site_Administration/Plugins/Blocks.
Here settings.php content but I think the file is not read at all :
<?php
defined('MOODLE_INTERNAL') || die;
require_once($CFG->dirroot . '/blocks/like/lib.php');
if ($ADMIN->fulltree) {
try {
$settings->add(new admin_setting_configcheckbox(
'block_like/enable_likes',
get_string('enablelikes', 'block_like'),
'',
DEFAULT_LIKE_ENABLELIKES
));
$settings->add(new admin_setting_configcheckbox(
'block_like/enable_custom_like_pix',
get_string('enablecustompix', 'block_like'),
'',
DEFAULT_LIKE_ENABLECUSTOMPIX
));
$settings->add(new admin_setting_configstoredfile(
'block_like/levels_pix',
new lang_string('likepix', 'block_like'),
new lang_string('likepixdesc', 'block_like'),
'preset',
0,
['subdirs' => 0, 'maxfiles' => 20, 'accepted_types' => ['.png', '.jpg']]
));
} catch (coding_exception $e) {
echo 'Exception coding_exception -> blocks/like/settings.php) : ', $e->getMessage(), "\n";
}
}
Best regards,
Quentin F.