<?php
class xorgBlogOwnerWidget {
- public static function behavior_adminBlogPreferencesForm(&$core) {
+ public static function behavior_adminBlogPreferencesForm($core) {
if ($core->auth->isSuperAdmin()) {
if (isset($_GET['id'])) {
$settings = new dcSettings($core, $_GET['id']);
}
$types = array('user' => array('text' => 'Blog d\'utilisateur',
'selected' => false),
+ 'connected' => array('text' => 'Blog de groupe, édition par toute personne connectée',
+ 'selected' => false),
'group-member' => array('text' => 'Blog de groupe, édition par les membres',
'selected' => false),
'group-admin' => array('text' => 'Blog de groupe, édition par les administrateurs',
'selected' => false));
- $type = $settings->get('xorg_blog_type');
+ $type = $settings->xorgauth->get('xorg_blog_type');
if (!$type) {
$type = 'user';
}
<p>
<label>
Propriétaire du blog (*) :
- <input type="text" name="xorg_blog_owner" value="<?php echo $settings->get('xorg_blog_owner'); ?> " />
+ <input type="text" name="xorg_blog_owner" value="<?php echo $settings->xorgauth->get('xorg_blog_owner'); ?> " />
</label>
</p>
<p>
}
}
- public static function behavior_adminBeforeBlogSettingsUpdate(&$settings) {
+ public static function behavior_adminBeforeBlogSettingsUpdate($settings) {
+ self::setXorgOwner($settings, $_POST['xorg_blog_type'], $_POST['xorg_blog_owner']);
+ }
+
+ public static function setXorgOwner($settings, $type, $owner) {
global $core;
if ($core->auth->isSuperAdmin()) {
- $settings->put('xorg_blog_type', $_POST['xorg_blog_type'], 'string', 'Type de blog X.org');
- $settings->put('xorg_blog_owner', $_POST['xorg_blog_owner'], 'string', 'Propriétaire X.org du blog');
+ $settings->xorgauth->put('xorg_blog_type', $type, 'string', 'Type de blog X.org');
+ $settings->xorgauth->put('xorg_blog_owner', $owner, 'string', 'Propriétaire X.org du blog');
}
}
+
}
?>