Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-tool_lifecycle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-tool_lifecycle
Commits
d3271ef5
Unverified
Commit
d3271ef5
authored
8 years ago
by
Tobias Reischmann
Browse files
Options
Downloads
Patches
Plain Diff
Added view.php as first entry in interacting as a teacher
parent
7f2ff2de
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
classes/table/interaction_table.php
+78
-0
78 additions, 0 deletions
classes/table/interaction_table.php
view.php
+33
-0
33 additions, 0 deletions
view.php
with
111 additions
and
0 deletions
classes/table/interaction_table.php
0 → 100644
+
78
−
0
View file @
d3271ef5
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle 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 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Table listing all courses for a specific user and a specific subplugin
*
* @package tool_cleanupcourses
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace
tool_cleanupcourses\table
;
use
tool_cleanupcourses\manager\interaction_manager
;
use
tool_cleanupcourses\manager\step_manager
;
defined
(
'MOODLE_INTERNAL'
)
||
die
;
require_once
(
$CFG
->
libdir
.
'/tablelib.php'
);
class
interaction_table
extends
\table_sql
{
public
function
__construct
(
$uniqueid
,
$stepid
)
{
parent
::
__construct
(
'tool_cleanupcourses_interaction_table'
);
$stepinstance
=
step_manager
::
get_step_instance
(
$stepid
);
global
$PAGE
,
$USER
;
$this
->
set_sql
(
'c.id as courseid, c.fullname as coursename, s.subpluginname as subpluginname '
,
'{tool_cleanupcourses_process} p join '
.
'{course} c on p.courseid = c.id join '
.
'{tool_cleanupcourses_step} s on p.stepid = s.id'
,
"TRUE"
);
$this
->
define_baseurl
(
$PAGE
->
url
);
$this
->
init
();
$capability
=
interaction_manager
::
get_relevant_capability
(
$stepinstance
->
subpluginname
);
$courses
=
get_user_capability_course
(
$capability
,
$USER
,
false
);
}
public
function
init
()
{
$this
->
define_columns
([
'course'
,
'subplugin'
]);
$this
->
define_headers
([
get_string
(
'course'
),
get_string
(
'step'
,
'tool_cleanupcourses'
)]);
$this
->
setup
();
}
/**
* Render course column.
* @param $row
* @return string course link
*/
public
function
col_course
(
$row
)
{
return
\html_writer
::
link
(
course_get_url
(
$row
->
courseid
),
$row
->
coursename
);
}
/**
* Render subplugin column.
* @param $row
* @return string pluginname of the subplugin
*/
public
function
col_subplugin
(
$row
)
{
$subpluginname
=
$row
->
subpluginname
;
return
get_string
(
'pluginname'
,
'cleanupcoursesstep_'
.
$subpluginname
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
view.php
0 → 100644
+
33
−
0
View file @
d3271ef5
<?php
/**
* Display the list of courses relevant for a specific user in a specific step instance.
*
* @package tool_cleanupcourses
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once
(
dirname
(
__FILE__
)
.
'/../../../config.php'
);
use
tool_cleanupcourses\table\interaction_table
;
require_login
();
$PAGE
->
set_context
(
context_system
::
instance
());
$PAGE
->
set_url
(
new
\moodle_url
(
'/admin/tool/cleanupcourses/view.php'
));
$subpluginid
=
required_param
(
'subpluginid'
,
PARAM_INT
);
$action
=
optional_param
(
'action'
,
null
,
PARAM_ALPHA
);
$table
=
new
interaction_table
(
'tool_cleanupcourses_interaction'
);
$PAGE
->
set_title
(
"Title"
);
$PAGE
->
set_heading
(
"Heading"
);
$renderer
=
$PAGE
->
get_renderer
(
'tool_cleanupcourses'
);
echo
$renderer
->
header
();
$table
->
out
(
50000
,
false
);
echo
$renderer
->
footer
();
\ No newline at end of file
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