|
Revision 176, 1.7 kB
(checked in by cedenoj, 10 months ago)
|
refs #2827 Adding forum plugin for elgg
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
global $page_owner; |
|---|
| 4 |
global $PAGE; |
|---|
| 5 |
|
|---|
| 6 |
global $CFG; |
|---|
| 7 |
|
|---|
| 8 |
include($CFG->dirroot . 'mod/forum/config.php'); |
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
if ((logged_on) && run("users:type:get", $page_owner) == "community") |
|---|
| 12 |
{ |
|---|
| 13 |
$forum_title = __gettext("Blog/Forum View:"); |
|---|
| 14 |
$forumRules = __gettext("Set this to 'yes' if you would like to default this user/community blog to a 'forum' view."); |
|---|
| 15 |
|
|---|
| 16 |
$body = <<< END |
|---|
| 17 |
|
|---|
| 18 |
<h2>$forum_title</h2> |
|---|
| 19 |
<p> |
|---|
| 20 |
$forumRules |
|---|
| 21 |
</p> |
|---|
| 22 |
|
|---|
| 23 |
END; |
|---|
| 24 |
$forum=""; |
|---|
| 25 |
$forum = user_flag_get('forum', $page_owner); |
|---|
| 26 |
|
|---|
| 27 |
if ($forum=="") |
|---|
| 28 |
{ |
|---|
| 29 |
|
|---|
| 30 |
if ($forum_default == 0){ |
|---|
| 31 |
$forum = "yes"; |
|---|
| 32 |
} else { |
|---|
| 33 |
$forum = "no"; |
|---|
| 34 |
} |
|---|
| 35 |
} |
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
if ($forum == "no") |
|---|
| 39 |
{ |
|---|
| 40 |
|
|---|
| 41 |
$body .= templates_draw( array( |
|---|
| 42 |
'context' => 'databox', |
|---|
| 43 |
'name' => __gettext("Default Blog View to 'Forum' type: "), |
|---|
| 44 |
'column1' => "<label><input type=\"radio\" name=\"forum\" value=\"yes\" /> " . __gettext("Yes") . "</label> <label><input type=\"radio\" name=\"forum\" value=\"no\" checked=\"checked\"/> " . __gettext("No") . "</label>" |
|---|
| 45 |
) |
|---|
| 46 |
); |
|---|
| 47 |
} else |
|---|
| 48 |
{ |
|---|
| 49 |
|
|---|
| 50 |
$body .= templates_draw( array( |
|---|
| 51 |
'context' => 'databox', |
|---|
| 52 |
'name' => __gettext("Default Blog View to 'Forum' type: "), |
|---|
| 53 |
'column1' => "<label><input type=\"radio\" name=\"forum\" value=\"yes\" checked=\"checked\" /> " . __gettext("Yes") . "</label> <label><input type=\"radio\" name=\"forum\" value=\"no\" /> " . __gettext("No") . "</label>" |
|---|
| 54 |
) |
|---|
| 55 |
); |
|---|
| 56 |
} |
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
$run_result .= $body; |
|---|
| 60 |
|
|---|
| 61 |
} |
|---|
| 62 |
|
|---|
| 63 |
?> |
|---|