Commit 01a16c39 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Signed-off-by: Richard Mansfield <richardm@catalyst.net.nz>

Fix merge
Simplify to use normal themes as view themes
Remove view/edit profile page links from menu and add to edit profile page
Add link to edit profile page when editing profile View
Use microheader on view editing pages
parent e0a037c3
<?php
$viewtheme = new stdClass;
$viewtheme->name = 'Sunset';
?>
<?php
$viewtheme = new stdClass;
$viewtheme->name = 'Ultima';
?>
......@@ -87,7 +87,6 @@
text-align: center;
}
<<<<<<< HEAD:htdocs/theme/views.css
/* Between top and bottom pane */
#middle-pane {
width: 100%;
......@@ -95,22 +94,10 @@
#middle-pane td {
width: 33%;
}
=======
>>>>>>> master:htdocs/theme/views.css
<<<<<<< HEAD:htdocs/theme/views.css
/* Bottom half of the page */
#page #bottom-pane {
margin: .5em 0;
border: 5px solid #eee;
}
#column-container {
width: 100%;
=======
/********************** Bottom pane of Edit View *************************/
html>body #column-container {
* width: 100%;
>>>>>>> master:htdocs/theme/views.css
}
#blocksinstruction {
padding: 0 1em .5em;
......@@ -491,8 +478,8 @@ div.artefactchooser-splitter {
padding: 1em;
}
#view-wizard-controls form {
display: inline;
#view-wizard-controls {
padding-bottom: .5em;
}
#view-description {
......
......@@ -67,24 +67,22 @@ if (!$view || !can_view_view($view->get('id'))) {
}
// Set up theme
list($basetheme, $viewtheme) = $view->get_theme();
if ($THEME->basename != $basetheme) {
$THEME = new Theme($basetheme);
$viewtheme = $view->get('theme');
if ($viewtheme && $THEME->basename != $viewtheme) {
$THEME = new Theme($viewtheme);
}
$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">',
);
$stylesheets = array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">');
$name = display_name($user);
define('TITLE', $name);
$smarty = smarty(
array('lib/pieforms/static/core/pieforms.js'),
$stylesheets
$stylesheets,
array(),
array(
'stylesheets' => array('style/views.css'),
'sidebars' => false,
)
);
$sql = "SELECT g.*, a.type FROM {group} g JOIN (
......@@ -309,11 +307,12 @@ $smarty->assign('canmessage', can_send_message($loggedinid, $userid));
$smarty->assign('NAME',$name);
$smarty->assign('USERID', $userid);
$smarty->assign('viewid', $view->get('id'));
$smarty->assign('viewtitle', 'This is the profile of ' . display_name($user) . ' at ' . get_config('sitename'));
$smarty->assign('viewtitle', get_string('usersprofile', 'mahara', display_name($user, null, true)));
if ($loggedinid && $loggedinid == $userid) {
$smarty->assign('edit_url', get_config('wwwroot') . 'view/blocks.php?profile=' . $userid);
$smarty->assign('can_edit', true);
$smarty->assign('edit_profile', true);
}
if (isset($_SERVER['HTTP_REFERER']) && false === strpos($_SERVER['HTTP_REFERER'], get_config('wwwroot') . 'user/view.php?id=' . $userid)) {
if (isset($_SERVER['HTTP_REFERER'])) {
$smarty->assign('backurl', $_SERVER['HTTP_REFERER']);
}
$smarty->assign('viewcontent', $view->build_columns());
......
......@@ -116,39 +116,24 @@ if ($category === '') {
$view->process_changes($category, $new);
// 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">',
$extraconfig = array(
'stylesheets' => array('style/views.css'),
'sidebars' => false,
);
<<<<<<< HEAD:htdocs/view/blocks.php
foreach ($THEME->get_url('style/style.css', true, 'artefact/file') as $sheet) {
=======
// Set up theme
$viewtheme = $view->get('theme');
if ($viewtheme && $THEME->basename != $viewtheme) {
$THEME = new Theme($viewtheme);
}
// Pull in cross-theme view stylesheet and file stylesheets
$stylesheets = array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">');
foreach (array_reverse($THEME->get_url('style/style.css', true, 'artefact/file')) as $sheet) {
>>>>>>> master:htdocs/view/blocks.php
$stylesheets[] = '<link rel="stylesheet" type="text/css" href="' . $sheet . '">';
}
<<<<<<< HEAD:htdocs/view/blocks.php
$smarty = smarty(
array('views', 'tinytinymce', 'paginator', 'tablerenderer', 'artefact/file/js/filebrowser.js', 'lib/pieforms/static/core/pieforms.js'),
$stylesheets,
false,
array('sidebars' => false)
);
=======
$smarty = smarty(array('views', 'tinymce', 'paginator', 'tablerenderer', 'artefact/file/js/filebrowser.js', 'lib/pieforms/static/core/pieforms.js', 'blocktype/creativecommons/js/creativecommons.js'), $stylesheets, false, $extraconfig);
>>>>>>> master:htdocs/view/blocks.php
// The list of categories for the tabbed interface
$smarty->assign('category_list', $view->build_category_list($category, $new));
......@@ -156,9 +141,6 @@ $smarty->assign('category_list', $view->build_category_list($category, $new));
// The list of blocktypes for the default category
$smarty->assign('blocktype_list', $view->build_blocktype_list($category));
$smarty->assign('viewtheme', "$basetheme/$viewtheme");
$smarty->assign('viewthemes', View::get_viewthemes());
// Tell smarty we're editing rather than just rendering
$smarty->assign('editing', true);
......@@ -188,12 +170,21 @@ $smarty->assign('profile', $profile);
$smarty->assign('view', $view->get('id'));
$smarty->assign('groupid', $group);
$smarty->assign('institution', $institution);
$smarty->assign('viewurl', (!empty($profile))
? get_config('wwwroot') . 'user/view.php?id=' . $view->get('owner')
: 'view.php?id=' . $view->get('id') . '&new=' . $new
);
$smarty->assign('can_change_layout', (!$USER->get_account_preference('addremovecolumns') || ($view->get('numcolumns') > 1 && $view->get('numcolumns') < 5)));
$smarty->assign('viewtheme', $viewtheme);
$smarty->assign('viewthemes', get_themes());
$smarty->assign('viewid', $view->get('id'));
$smarty->assign('viewtitle', $view->get('title'));
$owner = $view->get('owner');
if ($owner) {
$smarty->assign('ownerlink', 'user/view.php?id=' . $owner);
}
else if ($group) {
$smarty->assign('ownerlink', 'group/view.php?id=' . $group);
}
$blockid = $view->get_blockinstance_currently_being_configured();
if (!$blockid) {
$blockid = param_integer('block', 0);
......
......@@ -139,34 +139,23 @@ if ($USER->is_logged_in()) {
$objectionform = pieform(objection_form());
}
<<<<<<< HEAD:htdocs/view/view.php
// Set up theme
list($basetheme, $viewtheme) = $view->get_theme();
if ($THEME->basename != $basetheme) {
$THEME = new Theme($basetheme);
$viewtheme = $view->get('theme');
if ($viewtheme && $THEME->basename != $viewtheme) {
$THEME = new Theme($viewtheme);
}
$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">',
);
=======
$stylesheets = array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">');
$can_edit = $USER->can_edit_view($view) && !$submittedgroup && !$view->is_submitted();
>>>>>>> master:htdocs/view/view.php
$smarty = smarty(
<<<<<<< HEAD:htdocs/view/view.php
array('mahara', 'tablerenderer', 'feedbacklist', 'artefact/resume/resumeshowhide.js'),
$stylesheets,
=======
array('paginator', 'feedbacklist', 'artefact/resume/resumeshowhide.js'),
array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">'),
>>>>>>> master:htdocs/view/view.php
$stylesheets,
array(),
array('sidebars' => false)
array(
'stylesheets' => array('style/views.css'),
'sidebars' => false,
)
);
$javascript = <<<EOF
......@@ -179,38 +168,18 @@ EOF;
$smarty->assign('INLINEJAVASCRIPT', $javascript);
$smarty->assign('new', $new);
$smarty->assign('viewid', $viewid);
<<<<<<< HEAD:htdocs/view/view.php
=======
$smarty->assign('viewtitle', $view->get('title'));
$smarty->assign('feedback', $feedback);
>>>>>>> master:htdocs/view/view.php
$owner = $view->get('owner');
<<<<<<< HEAD:htdocs/view/view.php
if ($owner && $USER->get('id') == $owner && !$submittedgroup && !$view->is_submitted()) {
$smarty->assign('edit_url', get_config('wwwroot') . 'view/blocks.php?id=' . $viewid . '&new=' . $new);
}
$ownerlink = '';
=======
$smarty->assign('owner', $owner);
$smarty->assign('tags', $view->get('tags'));
>>>>>>> master:htdocs/view/view.php
if ($owner) {
<<<<<<< HEAD:htdocs/view/view.php
$ownerlink = 'user/view.php?id=' . $owner;
=======
$smarty->assign('ownerlink', 'user/view.php?id=' . $owner);
>>>>>>> master:htdocs/view/view.php
}
else if ($group) {
$ownerlink = 'group/view.php?id=' . $group;
$smarty->assign('ownerlink', 'group/view.php?id=' . $group);
}
<<<<<<< HEAD:htdocs/view/view.php
$smarty->assign('viewtitle', get_string('viewtitle', 'view',
$view->get('title'),
'<a href="' . get_config('wwwroot') . hsc($ownerlink) . '">' . display_name($owner) . '</a>'
));
=======
if ($can_edit) {
$smarty->assign('can_edit', 1);
}
......@@ -220,7 +189,6 @@ if ($USER->is_logged_in() && !empty($_SERVER['HTTP_REFERER'])) {
$smarty->assign('backurl', $_SERVER['HTTP_REFERER']);
}
}
>>>>>>> master:htdocs/view/view.php
// Provide a link for roaming teachers to return
if ($mnetviewlist = $SESSION->get('mnetviewaccess')) {
......@@ -235,9 +203,6 @@ if ($mnetviewlist = $SESSION->get('mnetviewaccess')) {
}
}
}
else if (isset($_SERVER['HTTP_REFERER']) && false === strpos($_SERVER['HTTP_REFERER'], get_config('wwwroot') . 'view/view.php?id=' . $viewid)) {
$smarty->assign('backurl', $_SERVER['HTTP_REFERER']);
}
$smarty->assign('ownername', $view->formatted_owner());
$smarty->assign('viewdescription', $view->get('description'));
......
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