Commit 5382157b authored by Nigel McNie's avatar Nigel McNie
Browse files

Revert "Display profile view in iframe"

This reverts commit c95ad3eb.
parent c95ad3eb
......@@ -29,5 +29,12 @@
</div>
{/if}
</div>
<iframe id="viewframe" src="{$WWWROOT}/view/view.php?id={$profileviewid}&profileframe=1" width="100%" frameborder="0" marginheight="0" marginwidth="0"></iframe>
<div id="view" class="cl">
<div id="bottom-pane">
<div id="column-container">
{$viewcontent}
<div class="cb"></div>
</div>
</div>
</div>
{include file="footer.tpl"}
......@@ -2,7 +2,6 @@
<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>
......@@ -19,7 +18,6 @@
</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">
......
......@@ -25,6 +25,11 @@
*/
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');
......@@ -60,20 +65,26 @@ 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'),
array(),
array(),
array('sidebars' => false)
$stylesheets
);
$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
......@@ -255,8 +266,7 @@ if (!empty($loggedinid) && $loggedinid != $userid) {
$smarty->assign('relationship', $relationship);
}
// Move to edit profile page ...
/* else if (!empty($loggedinid)) {
else if (!empty($loggedinid)) {
if (get_config('allowpublicprofiles')) {
$public = array_filter($view->get_access(),
create_function(
......@@ -281,7 +291,7 @@ if (!empty($loggedinid) && $loggedinid != $userid) {
));
$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));
......@@ -297,8 +307,7 @@ $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('profileviewid', $view->get('id'));
//$smarty->assign('viewcontent', $view->build_columns());
$smarty->assign('viewcontent', $view->build_columns());
$smarty->assign('PAGEHEADING', hsc(TITLE));
$smarty->display('user/view.tpl');
......@@ -347,7 +356,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(
......@@ -368,6 +377,6 @@ function approve_deny_friendrequest_submit(Pieform $form, $values) {
$SESSION->add_ok_msg(get_string('viewaccesseditedsuccessfully', 'view'));
redirect('/user/view.php?id=' . $userid);
}*/
}
?>
......@@ -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="'
......
......@@ -118,15 +118,6 @@ 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) {
......@@ -185,9 +176,6 @@ 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')) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment