示例#1
0
     $communityDao->description = $data->conteudo;
     $communityDao->close_community = $data->close_community;
     $realfilename = $mform->get_new_filename('video');
     // this gets the name of the file
     $random = rand();
     // generate some random number
     $new_file = $random . '_' . $realfilename;
     //add some random string to the file
     $dst = $CFG->dataroot . "/blocks/webgd_community/{$new_file}";
     // directory name+ new filename
     if ($mform->save_file('video', $dst, true)) {
         $communuty->video = $dst;
     }
     if ($id = $DB->update_record(TableResouces::$TABLE_PAGE_COMMUNITY, $communityDao)) {
         $msg = 'Comunidade editada com sucesso';
         $communityParticipants = $webgdDao->findCommunityParticipantsById($data->id);
         foreach ($communityParticipants as $participantes => $pt) {
             if ($pt->id != $USER->id) {
                 $DB->delete_records(TableResouces::$TABLE_PAGE_COMMUNITY, array('id' => $pt->id));
             }
         }
         $users = optional_param_array('users', 0, PARAM_INT);
         foreach ($users as $idUser) {
             $communutyUser = new stdClass();
             $communutyUser->community = $data->id;
             $communutyUser->admin = 0;
             $communutyUser->userid = $idUser;
             $DB->insert_record(TableResouces::$TABLE_PAGE_COMMUNITY_USER, $communutyUser);
         }
     }
 }
示例#2
0
$PAGE->set_url('/course/index.php');
$PAGE->set_context(context_system::instance());
$PAGE->set_pagelayout('standard');
$PAGE->requires->css(CssResources::HOME_COMMUNITY);
$PAGE->requires->css(CssResources::BOOTSTRAP);
$PAGE->requires->js(JsResources::HOME_COMMUNITY);
$idMenu = optional_param('option', 0, PARAM_INTEGER);
$idSubOption = optional_param('suboption', 0, PARAM_INTEGER);
$idCommunity = optional_param('community', '', PARAM_INTEGER);
$confirm = optional_param('confirm', 0, PARAM_INTEGER);
$cam = optional_param('cam', 0, PARAM_INTEGER);
$filter = optional_param('filter', '', PARAM_ALPHAEXT);
echo $OUTPUT->header('themeselector');
$webgdDao = new WebgdCommunityDao();
$community = $webgdDao->findCommunityById($idCommunity);
$communityParticipants = $webgdDao->findCommunityParticipantsById($idCommunity);
$communityEmails = $webgdDao->findCommunityEmailById($idCommunity);
$emaillist = "";
foreach ($communityEmails as $participant => $pt) {
    $emaillist .= $pt->email . ",";
}
?>

<style>
    .iconeBt {
        margin-top: 5px;
    }
</style>


<?php