Skip to content
GitLab
Menu
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
c95ad3eb
Commit
c95ad3eb
authored
Aug 10, 2009
by
Richard Mansfield
Browse files
Display profile view in iframe
parent
bdaf4ff6
Changes
5
Hide whitespace changes
Inline
Side-by-side
htdocs/theme/raw/templates/user/view.tpl
View file @
c95ad3eb
...
...
@@ -29,12 +29,5 @@
</div>
{/
if
}
</div>
<div
id=
"view"
class=
"cl"
>
<div
id=
"bottom-pane"
>
<div
id=
"column-container"
>
{
$viewcontent
}
<div
class=
"cb"
></div>
</div>
</div>
</div>
<iframe
id=
"viewframe"
src=
"
{
$WWWROOT
}
/view/view.php?id=
{
$profileviewid
}
&profileframe=1"
width=
"100%"
frameborder=
"0"
marginheight=
"0"
marginwidth=
"0"
></iframe>
{
include
file
=
"footer.tpl"
}
htdocs/theme/raw/templates/viewmicroheader.tpl
View file @
c95ad3eb
...
...
@@ -2,6 +2,7 @@
<html>
{
include
file
=
"header/head.tpl"
}
<body>
{
if
!
$profileframe
}
<div
class=
"viewheader center rel"
>
<div
class=
"rbuttons"
>
<a
class=
"small-logo"
href=
"
{
$WWWROOT
}
"
><img
src=
"
{
theme_url
filename
=
'images/site-logo.png'
}
"
alt=
"
{
$sitename
|
escape
}
"
></a>
...
...
@@ -18,6 +19,7 @@
</div>
{
if
!
$new
}
<a
href=
"
{
$WWWROOT
}
view/view.php?id=
{
$viewid
}
"
>
{/
if
}{
$viewtitle
|
escape
}{
if
!
$new
}
</a>
{/
if
}{
if
$ownername
}
{
str
tag
=
by
section
=
view
}
<a
href=
"
{
$WWWROOT
}{
$ownerlink
}
"
>
{
$ownername
|
escape
}
</a>
{/
if
}
</div>
{/
if
}
<div
id=
"containerX"
>
<div
id=
"loading-box"
style=
"display: none;"
></div>
<div
id=
"top-wrapper"
>
...
...
htdocs/user/view.php
View file @
c95ad3eb
...
...
@@ -25,11 +25,6 @@
*/
define
(
'INTERNAL'
,
1
);
define
(
'PUBLIC'
,
1
);
// Technically these are lies, but we set them like this to hook in the right
// plugin stylesheet. This file should be provided by artefact/internal anyway.
define
(
'SECTION_PLUGINTYPE'
,
'artefact'
);
define
(
'SECTION_PLUGINNAME'
,
'internal'
);
define
(
'SECTION_PAGE'
,
'view'
);
require
(
dirname
(
dirname
(
__FILE__
))
.
'/init.php'
);
require_once
(
'group.php'
);
...
...
@@ -65,26 +60,20 @@ if (!$view || !can_view_view($view->get('id'))) {
throw
new
AccessDeniedException
(
get_string
(
'youcannotviewthisusersprofile'
));
}
// Set up theme
list
(
$basetheme
,
$viewtheme
)
=
$view
->
get_theme
();
if
(
$THEME
->
basename
!=
$basetheme
)
{
$THEME
=
new
Theme
(
$basetheme
);
}
$stylesheets
=
array
(
// Basic structure CSS
'<link rel="stylesheet" type="text/css" href="'
.
get_config
(
'wwwroot'
)
.
'theme/views.css">'
,
// Extra CSS for the view theme
'<link rel="stylesheet" type="text/css" href="'
.
get_config
(
'wwwroot'
)
.
'theme/'
.
$basetheme
.
'/viewthemes/'
.
$viewtheme
.
'/views.css">'
,
);
$name
=
display_name
(
$user
);
define
(
'TITLE'
,
$name
);
$smarty
=
smarty
(
array
(
'lib/pieforms/static/core/pieforms.js'
),
$stylesheets
array
(),
array
(),
array
(
'sidebars'
=>
false
)
);
$js
=
<<<EOF
function resizeFrame(h) {
setStyle('viewframe', {'height': h});
}
EOF;
$smarty
->
assign
(
'INLINEJAVASCRIPT'
,
$js
);
$sql
=
"SELECT g.*, a.type FROM
{
group
}
g JOIN (
SELECT gm.group, 'invite' AS type
...
...
@@ -266,7 +255,8 @@ if (!empty($loggedinid) && $loggedinid != $userid) {
$smarty
->
assign
(
'relationship'
,
$relationship
);
}
else
if
(
!
empty
(
$loggedinid
))
{
// Move to edit profile page ...
/* else if (!empty($loggedinid)) {
if (get_config('allowpublicprofiles')) {
$public = array_filter($view->get_access(),
create_function(
...
...
@@ -291,7 +281,7 @@ else if (!empty($loggedinid)) {
));
$smarty->assign('togglepublic', $togglepublic);
}
}
}
*/
if
(
$userid
!=
$USER
->
get
(
'id'
)
&&
$USER
->
is_admin_for_user
(
$user
)
&&
is_null
(
$USER
->
get
(
'parentuser'
)))
{
$loginas
=
get_string
(
'loginasuser'
,
'admin'
,
hsc
(
$user
->
username
));
...
...
@@ -307,7 +297,8 @@ $smarty->assign('institutions', get_institution_string_for_user($userid));
$smarty
->
assign
(
'canmessage'
,
can_send_message
(
$loggedinid
,
$userid
));
$smarty
->
assign
(
'NAME'
,
$name
);
$smarty
->
assign
(
'USERID'
,
$userid
);
$smarty
->
assign
(
'viewcontent'
,
$view
->
build_columns
());
$smarty
->
assign
(
'profileviewid'
,
$view
->
get
(
'id'
));
//$smarty->assign('viewcontent', $view->build_columns());
$smarty
->
assign
(
'PAGEHEADING'
,
hsc
(
TITLE
));
$smarty
->
display
(
'user/view.tpl'
);
...
...
@@ -356,7 +347,7 @@ function approve_deny_friendrequest_submit(Pieform $form, $values) {
}
}
function
togglepublic_submit
(
Pieform
$form
,
$values
)
{
/*
function togglepublic_submit(Pieform $form, $values) {
global $SESSION, $userid, $view;
$access = array(
array(
...
...
@@ -377,6 +368,6 @@ function togglepublic_submit(Pieform $form, $values) {
$SESSION->add_ok_msg(get_string('viewaccesseditedsuccessfully', 'view'));
redirect('/user/view.php?id=' . $userid);
}
}
*/
?>
htdocs/view/blocks.php
View file @
c95ad3eb
...
...
@@ -116,10 +116,10 @@ if ($category === '') {
$view
->
process_changes
(
$category
,
$new
);
// Set up theme
list
(
$basetheme
,
$viewtheme
)
=
$view
->
get_theme
();
/*
list($basetheme, $viewtheme) = $view->get_theme();
if ($THEME->basename != $basetheme) {
$THEME = new Theme($basetheme);
}
}
*/
$stylesheets
=
array
(
// Basic structure CSS
'<link rel="stylesheet" type="text/css" href="'
...
...
htdocs/view/view.php
View file @
c95ad3eb
...
...
@@ -118,6 +118,15 @@ feedbacklist.statevars.push('view');
feedbacklist.updateOnLoad();
EOF;
if
(
param_boolean
(
'profileframe'
,
false
))
{
$profileframe
=
1
;
$javascript
.
=
<<<EOF
feedbacklist.postupdatecallback = function () {
parent.resizeFrame(document.body.scrollHeight + 'px');
};
EOF;
}
$can_edit
=
$USER
->
can_edit_view
(
$view
)
&&
!
$submittedgroup
&&
!
$view
->
is_submitted
();
$page
=
get_config
(
'wwwroot'
)
.
'view/view.php?id='
.
$viewid
.
(
$new
?
'&new=1'
:
''
);
if
(
$can_edit
)
{
...
...
@@ -176,6 +185,9 @@ if ($can_edit) {
if
(
isset
(
$backurl
))
{
$smarty
->
assign
(
'backurl'
,
$backurl
);
}
if
(
isset
(
$profileframe
))
{
$smarty
->
assign
(
'profileframe'
,
1
);
}
// Provide a link for roaming teachers to return
if
(
$mnetviewlist
=
$SESSION
->
get
(
'mnetviewaccess'
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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