Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
1cfe7200
Commit
1cfe7200
authored
Dec 16, 2008
by
Nigel McNie
Browse files
Add a button to create a template on all View listing pages.
parent
edbecdd6
Changes
7
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/site/views.php
View file @
1cfe7200
...
...
@@ -59,6 +59,7 @@ $smarty->assign('views', $data->data);
$smarty
->
assign
(
'institution'
,
'mahara'
);
$smarty
->
assign
(
'pagination'
,
$pagination
[
'html'
]);
$smarty
->
assign
(
'createviewform'
,
pieform
(
create_view_form
(
null
,
'mahara'
)));
$smarty
->
assign
(
'createtemplateform'
,
pieform
(
create_template_form
(
null
,
'mahara'
)));
$smarty
->
display
(
'view/index.tpl'
);
...
...
htdocs/lang/en.utf8/view.php
View file @
1cfe7200
...
...
@@ -30,6 +30,7 @@ $string['createview'] = 'Create View';
$string
[
'createviewstepone'
]
=
'Create View Step One: Layout'
;
$string
[
'createviewsteptwo'
]
=
'Create View Step Two: Details'
;
$string
[
'createviewstepthree'
]
=
'Create View Step Three: Access'
;
$string
[
'createtemplate'
]
=
'Create Template'
;
$string
[
'editviewdetails'
]
=
'Edit Details for View "%s"'
;
$string
[
'editblocksforview'
]
=
'Edit View "%s"'
;
$string
[
'editaccessforview'
]
=
'Edit Access for View "%s"'
;
...
...
htdocs/lib/view.php
View file @
1cfe7200
...
...
@@ -2259,6 +2259,8 @@ function create_view_form($group=null, $institution=null, $template=null) {
function
createview_submit
(
Pieform
$form
,
$values
)
{
global
$SESSION
;
$values
[
'template'
]
=
!
empty
(
$values
[
'istemplate'
])
?
1
:
0
;
// Named 'istemplate' in the form to prevent confusion with 'usetemplate'
if
(
isset
(
$values
[
'usetemplate'
]))
{
$templateid
=
$values
[
'usetemplate'
];
unset
(
$values
[
'usetemplate'
]);
...
...
@@ -2286,6 +2288,17 @@ function createview_cancel_submit(Pieform $form, $values) {
redirect
(
get_config
(
'wwwroot'
)
.
'view/'
);
}
function
create_template_form
(
$group
=
null
,
$institution
=
null
)
{
$form
=
create_view_form
(
$group
,
$institution
,
null
);
$form
[
'name'
]
=
'createtemplate'
;
$form
[
'elements'
][
'istemplate'
]
=
array
(
'type'
=>
'hidden'
,
'value'
=>
1
,
);
$form
[
'elements'
][
'submit'
][
'value'
]
=
get_string
(
'createtemplate'
,
'view'
);
return
$form
;
}
function
add_feedback_form
(
$attachments
=
false
)
{
global
$USER
;
...
...
htdocs/theme/default/templates/view/index.tpl
View file @
1cfe7200
...
...
@@ -5,6 +5,7 @@
<div>
<span
class=
"addicon fr"
>
{
$createviewform
}
{
$createtemplateform
}
<form
method=
"post"
action=
"
{
$WWWROOT
}
view/choosetemplate.php"
>
<input
type=
"submit"
class=
"submit"
value=
"
{
str
tag
=
"copyaview"
section
=
"view"
}
"
>
{
if
$GROUP
}
...
...
htdocs/view/groupviews.php
View file @
1cfe7200
...
...
@@ -79,6 +79,7 @@ $smarty->assign('member', $member);
$smarty
->
assign
(
'views'
,
$data
->
data
);
$smarty
->
assign
(
'pagination'
,
$pagination
[
'html'
]);
$smarty
->
assign
(
'createviewform'
,
pieform
(
create_view_form
(
$group
->
id
)));
$smarty
->
assign
(
'createtemplateform'
,
pieform
(
create_template_form
(
$group
->
id
)));
if
(
$can_edit
)
{
// && !$shared) {
$smarty
->
display
(
'view/index.tpl'
);
...
...
htdocs/view/index.php
View file @
1cfe7200
...
...
@@ -120,6 +120,7 @@ $smarty->assign('views', $data->data);
$smarty
->
assign
(
'pagination'
,
$pagination
[
'html'
]);
$smarty
->
assign
(
'heading'
,
get_string
(
'myviews'
));
$smarty
->
assign
(
'createviewform'
,
pieform
(
create_view_form
()));
$smarty
->
assign
(
'createtemplateform'
,
pieform
(
create_template_form
()));
$smarty
->
display
(
'view/index.tpl'
);
?>
htdocs/view/institutionviews.php
View file @
1cfe7200
...
...
@@ -78,6 +78,7 @@ $smarty->assign('views', $data->data);
$smarty
->
assign
(
'institution'
,
$institution
);
$smarty
->
assign
(
'pagination'
,
$pagination
[
'html'
]);
$smarty
->
assign
(
'createviewform'
,
pieform
(
create_view_form
(
null
,
$institution
)));
$smarty
->
assign
(
'createtemplateform'
,
pieform
(
create_template_form
(
null
,
$institution
)));
$smarty
->
display
(
'view/index.tpl'
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment