Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-block_uwservices
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
uw-moodle
moodle-block_uwservices
Commits
24844c10
Commit
24844c10
authored
11 years ago
by
Matt Petro
Browse files
Options
Downloads
Plain Diff
Merging missing capability fix from trunk
parents
fd8447fc
0dc2c119
Branches
main
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
block_uwservices.php
+15
-15
15 additions, 15 deletions
block_uwservices.php
db/access.php
+8
-0
8 additions, 0 deletions
db/access.php
with
23 additions
and
15 deletions
block_uwservices.php
+
15
−
15
View file @
24844c10
...
...
@@ -3,7 +3,7 @@
* UW Madison Services Block
*
* Display roster to Moodle associations and course information.
*
*
* Author: Nick Koeppen
******************************************************************************/
class
block_uwservices
extends
block_list
{
...
...
@@ -15,14 +15,14 @@ class block_uwservices extends block_list {
// Default case: the block can be used in courses and site index, but not in activities
return
array
(
'all'
=>
true
,
'site'
=>
true
);
}
function
has_config
()
{
return
true
;
}
function
get_content
()
{
global
$USER
,
$OUTPUT
;
if
(
$this
->
content
!==
NULL
)
{
return
$this
->
content
;
}
...
...
@@ -41,32 +41,32 @@ class block_uwservices extends block_list {
$uwservices
=
array
();
$uwservices
[]
=
array
(
'service'
=>
'MyUW'
,
'relayurl'
=>
'https://my.wisc.edu/portal'
,
'relayurl'
=>
'https://my.wisc.edu/portal'
,
'icon_name'
=>
'myuw'
);
$uwservices
[]
=
array
(
'service'
=>
'WiscMail'
,
'relayurl'
=>
'https://wiscmail.wisc.edu'
,
'relayurl'
=>
'https://wiscmail.wisc.edu'
,
'icon_name'
=>
'wiscmail'
);
$domain
=
strstr
(
$USER
->
email
,
'@'
);
if
(
$domain
!=
"@wisc.edu"
){
$uwservices
[]
=
array
(
'service'
=>
'WiscMailPlus'
,
'relayurl'
=>
'https://wiscmail.wisc.edu/mailplus/'
,
'relayurl'
=>
'https://wiscmail.wisc.edu/mailplus/'
,
'icon_name'
=>
'wiscmailplus'
);
}
$uwservices
[]
=
array
(
'service'
=>
'WiscCal'
,
'relayurl'
=>
'http://webcal.services.wisc.edu'
,
'relayurl'
=>
'http://webcal.services.wisc.edu'
,
'icon_name'
=>
'wisccal'
);
$uwservices
[]
=
array
(
'service'
=>
'Learn@UW'
,
'relayurl'
=>
'http://learnuw.wisc.edu'
,
'icon_name'
=>
'learnuw'
);
'relayurl'
=>
'http://learnuw.wisc.edu'
,
'icon_name'
=>
'learnuw'
);
$uwservices
[]
=
array
(
'service'
=>
'GoogleDocs'
,
'relayurl'
=>
'http://docs.google.com/a/wisc.edu'
,
'relayurl'
=>
'http://docs.google.com/a/wisc.edu'
,
'icon_name'
=>
'googledocs'
);
/* Determine origin of settings */
$config
=
get_config
(
'blocks/uwservices'
);
if
(
!
$config
->
sitesettings
){
...
...
@@ -76,12 +76,12 @@ class block_uwservices extends block_list {
if
(
!
isset
(
$config
)){
$config
->
display
=
"text"
;
}
/* Display links */
$target
=
'target=\"_new\"'
;
//Link target
foreach
(
$uwservices
as
$s
)
{
$link
=
"<a "
.
$target
.
". title=
\"
"
.
$s
[
'service'
]
.
"
\"
href=
\"
"
.
$s
[
'relayurl'
]
.
"
\"
> "
;
/* Add icons if not text only */
if
(
$config
->
display
!=
"text"
){
if
(
$config
->
display
==
"both"
){
...
...
@@ -94,13 +94,13 @@ class block_uwservices extends block_list {
$link
.
=
'<img src="'
.
$url
.
'" alt="'
.
$s
[
'service'
]
.
'" />'
;
}
}
/* Add text if not only icons */
if
(
$config
->
display
!=
"icons"
){
$link
.
=
$s
[
'service'
];
}
$link
.
=
'</a>'
;
$this
->
content
->
items
[]
=
$link
;
}
...
...
This diff is collapsed.
Click to expand it.
db/access.php
+
8
−
0
View file @
24844c10
...
...
@@ -25,7 +25,15 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$capabilities
=
array
(
'block/uwservices:myaddinstance'
=>
array
(
'captype'
=>
'write'
,
'contextlevel'
=>
CONTEXT_SYSTEM
,
'archetypes'
=>
array
(
'user'
=>
CAP_ALLOW
),
'clonepermissionsfrom'
=>
'moodle/my:manageblocks'
),
'block/uwservices:addinstance'
=>
array
(
'riskbitmask'
=>
RISK_SPAM
|
RISK_XSS
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment