1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
<?php
# Lifter002: TODO
# Lifter007: TODO
# Lifter003: TODO
# Lifter010: TODO
/*
* PmWikiConnectedLink.class.php - Provides links to PmWiki Modules
*
* Copyright (C) 2006 - Marco Diedrich (mdiedric@uos.de)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*/
use Studip\Button, Studip\LinkButton;
require_once 'lib/webservices/api/studip_seminar.php';
/**
*
* This class contains methods to generate links to PmWiki-Farm
*
* @author Marco Diedrich <mdiedric@uos.de>
* @access public
* @modulegroup elearning_interface_modules
* @module PmWikiConnectedLink
* @package ELearning-Interface
*/
class PmWikiConnectedLink extends ConnectedLink
{
function __construct($cms)
{
parent::__construct($cms);
$this->cms_link = "pmwiki_referrer.php";
}
/**
* get user module links
*
* returns content module links for user
* @access public
* @return string html-code
*/
function getUserModuleLinks()
{
$range_id = Context::getId();
$username = get_username($GLOBALS['auth']->auth['uid']);
global $connected_cms, $view, $search_key, $cms_select, $current_module;
// hier muss die Authentifizierung mit übergeben werden...
//
if (Context::isCourse()) {
$context = 'seminar';
$status = StudipSeminarHelper::get_user_status($username, $range_id);
} else if (Context::isInstitute()) {
$context = 'institute';
$status = StudipInstituteHelper::get_user_status($username, $range_id);
}
ob_start(); ?>
<form method="post" target="_blank" rel="noopener noreferrer"
action="<?= $connected_cms[$this->cms_type]->content_module[$current_module]->link ?>">
<?= CSRFProtection::tokenTag() ?>
<input type='hidden' name='authid' value='<?= htmlReady($GLOBALS['auth']->auth['uname']) ?>'>
<input type='hidden' name='authpw' value='<?= htmlReady(Token::create()) ?>'>
<input type='hidden' name='_permission' value='<?= htmlReady($status) ?>'>
<input type='hidden' name='_range_id' value='<?= htmlReady($range_id) ?>'>
<input type='hidden' name='_server' value='<?= htmlReady(Config::get()->STUDIP_INSTALLATION_ID) ?>'>
<input type='hidden' name='_context' value='<?= htmlReady($context) ?>'>
<?= Button::createAccept(_('Starten')) ?>
</form>
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
}
/**
* get admin module links
*
* returns links add or remove a module from course
* @access public
* @return string returns html-code
*/
function getAdminModuleLinks()
{
global $connected_cms, $view, $search_key, $cms_select, $current_module;
ob_start(); ?>
<form method="post" action="<?= URLHelper::getLink() ?>">
<?= CSRFProtection::tokenTag() ?>
<input type="hidden" name="view" value="<?= htmlReady($view) ?>">
<input type="hidden" name="search_key" value="<?= htmlReady($search_key) ?>">
<input type="hidden" name="cms_select" value="<?= htmlReady($cms_select) ?>">
<input type="hidden" name="module_type" value="wiki">
<input type="hidden" name="module_id" value="<?= htmlReady($current_module) ?>">
<input type="hidden" name="module_system_type" value="<?= htmlReady($this->cms_type) ?>">
<?php if ($connected_cms[$this->cms_type]->content_module[$current_module]->isConnected()) : ?>
<?= Button::create(_('Entfernen'), 'remove') ?>
<?php else :?>
<?= Button::create(_('Hinzufügen'), 'add') ?>
<?php endif ; ?>
</form>
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
}
}
|