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
{include file="header.tpl"}
<div class="rbuttons">
<a href="{$WWWROOT}user/view.php">{str tag=viewmyprofilepage}</a>&nbsp;
<a class="btn-edit" href="{$WWWROOT}view/blocks.php?profile=1">{str tag=editmyprofilepage}</a>
</div>
{$profileform}
<script type="text/javascript">
{literal} insertSiblingNodesAfter('profileform', DIV({'id': 'profile-loading'}, IMG({'src': config.theme['images/loading.gif'], 'alt': ''}), ' ', get_string('loading')));{/literal}
......
......@@ -184,7 +184,6 @@ $string['siteoptionsset'] = 'Site options have been updated.';
$string['sitethemedescription'] = 'The default theme for the site';
$string['tagssideblockmaxtags'] = 'Maximum Tags in Cloud';
$string['tagssideblockmaxtagsdescription'] = 'The default number of tags to display in user tag clouds';
$string['theme'] = 'Theme';
$string['trustedsites'] = 'Trusted sites';
$string['updatesiteoptions'] = 'Update site options';
$string['usersallowedmultipleinstitutions'] = 'Users allowed multiple institutions';
......
......@@ -474,8 +474,6 @@ $string['findgroups'] = 'Find Groups';
$string['returntosite'] = 'Return to Site';
$string['siteadministration'] = 'Site Administration';
$string['useradministration'] = 'User Administration';
$string['viewmyprofilepage'] = 'View profile page';
$string['editmyprofilepage'] = 'Edit profile page';
$string['unreadmessages'] = 'unread messages';
$string['unreadmessage'] = 'unread message';
......@@ -875,17 +873,17 @@ $string['remotehost'] = 'Remote host %s';
$string['Copyof'] = 'Copy of %s';
// Profie views
// Profile views
$string['loggedinusersonly'] = 'Logged in users only';
$string['allowpublicaccess'] = 'Allow public (non logged in) access';
$string['thisistheprofilepagefor'] = 'This is the profile page for %s';
$string['viewmyprofilepage'] = 'View profile page';
$string['editmyprofilepage'] = 'Edit profile page';
$string['usersprofile'] = "%s's Profile";
$string['pleasedonotreplytothismessage'] = "Please do not reply to this message.";
$string['theme'] = 'Theme';
$string['deleteduser'] = 'Deleted user';
$string['recentupdates'] = 'Recent Updates';
$string['theme'] = 'Theme';
?>
......@@ -514,6 +514,9 @@ function get_language_root($language=null) {
* Return a list of available themes.
*/
function get_themes() {
static $themes = null;
if (is_null($themes)) {
$themes = array();
$themebase = get_config('docroot') . 'theme/';
if (!$themedir = opendir($themebase)) {
......@@ -529,6 +532,8 @@ function get_themes() {
}
}
closedir($themedir);
}
return $themes;
}
......
......@@ -247,7 +247,7 @@ function Pieform(data) {//{{{
self.iframe = createDOM('iframe', {
'name': iframeName,
'id' : iframeName,
'style': 'position: absolute; visibility: hidden; height: 0;'
'style': 'position: absolute; visibility: hidden;'
});
insertSiblingNodesAfter(self.data.name, self.iframe);
}
......
......@@ -486,14 +486,6 @@ class View {
return $this->groupobj;
}
public function get_theme() {
if ($theme = $this->get('theme')) {
return explode('/', $theme, 2);
}
$sitedefault = get_config('theme');
return array($sitedefault, $sitedefault);
}
public function delete() {
db_begin();
......@@ -873,8 +865,7 @@ class View {
}
$viewtheme = param_variable('viewtheme', '');
if ($viewtheme != join('/', $this->get_theme())
&& preg_match('#^[a-z0-9-]+/[a-z0-9-]+$#i', $viewtheme)) {
if ($viewtheme && $viewtheme != $this->get('theme')) {
$this->set('theme', $viewtheme);
}
......@@ -1720,36 +1711,6 @@ class View {
return $baseurl;
}
/**
* Returns the list of avaliable view themes
*/
public static function get_viewthemes() {
static $list = null;
if (is_null($list)) {
foreach (array_keys(get_themes()) as $themename) {
$viewthemebase = get_config('docroot') . 'theme/' . $themename . '/viewthemes/';
if (is_dir($viewthemebase) && $viewthemedir = opendir($viewthemebase)) {
while (false !== ($subdir = readdir($viewthemedir))) {
if ($subdir != "." && $subdir != ".." && is_dir($viewthemebase . $subdir)) {
$configfile = $viewthemebase . $subdir . '/config.php';
if (is_readable($configfile)) {
require($configfile);
$list[] = array(
'id' => $themename . '/' . $subdir,
'name' => $viewtheme->name
);
}
}
}
}
}
}
usort($list, create_function('$a, $b', 'return strnatcasecmp($a["name"], $b["name"]);'));
return $list;
}
/**
* Builds data for the artefact chooser.
*
......
......@@ -1872,18 +1872,6 @@ function mahara_standard_nav() {
'weight' => 40,
'ignore' => !$exportenabled,
),
array(
'path' => 'profile/view',
'url' => 'user/view.php',
'title' => get_string('viewmyprofilepage'),
'weight' => 9,
),
array(
'path' => 'profile/editprofilepage',
'url' => 'view/blocks.php?profile=1',
'title' => get_string('editmyprofilepage'),
'weight' => 9,
),
array(
'path' => 'groups',
'url' => 'group/mygroups.php',
......
<?php
$viewtheme = new stdClass;
$viewtheme->name = 'Aqua';
?>
<?php
$viewtheme = new stdClass;
$viewtheme->name = 'Mahara';
?>
<?php
$viewtheme = new stdClass;
$viewtheme->name = 'Fresh';
?>
......@@ -539,14 +539,6 @@ div.rbuttons .small-logo {
padding: .5em;
margin: 0 .25em 1px;
}
#dropshadow {
background-image: url(../images/dropshadow.png);
background-repeat: repeat-x;
z-index: 1;
height: 15px;
width: 100%;
float: left;
}
.viewheader .small-logo img {
margin: .5em;
padding: 0;
......
......@@ -44,4 +44,3 @@
</div>
</div>
{include file="footer.tpl"}
{include file="header.tpl"}
{include file="viewmicroheader.tpl"}
<h1>{$PAGEHEADING|escape}</h1>
{if $columns}
{str tag="editblockspagedescription" section="view"}
......@@ -19,29 +20,24 @@
<div class="cb"></div>
</div>
<table id="middle-pane">
<tr>
<div id="middle-pane">
<table class="fullwidth"><tr>
<td>
<a id="layout-link" href="columns.php?id={$view}&amp;c={$category}&amp;new={$new}"{if !$can_change_layout} class="disabled"{/if}>{str tag='changeviewlayout' section='view'}</a> {contextualhelp plugintype="core" pluginname="view" section="changeviewlayout"}
</td>
<td class="center">
<select id="viewtheme-select" name="viewtheme">
<option value="">Choose theme...</option>
{foreach from=$viewthemes item=theme}
<option value="{$theme.id|escape}"{if $theme.id == $viewtheme} selected="selected" style="font-weight: bold;"{/if}>{$theme.name|escape}</option>
{foreach from=$viewthemes key=themeid item=themename}
<option value="{$themeid|escape}"{if $themeid == $viewtheme} selected="selected" style="font-weight: bold;"{/if}>{$themename|escape}</option>
{/foreach}
</select>
</td>
<td class="right">
<a id="btn-displaymyview" href="{$viewurl|escape}">{str tag=displaymyview section=view} &raquo;</a>
<a id="btn-displaymyview" href="view.php?id={$view}&amp;new={$new}">{str tag=displaymyview section=view} &raquo;</a></td>
</td>
</tr>
</table>
<a id="btn-displaymyview" class="fr" href="view.php?id={$view}&amp;new={$new}">{str tag=displaymyview section=view} &raquo;</a>
<a id="layout-link" href="columns.php?id={$view}&amp;c={$category}&amp;new={$new}"{if !$can_change_layout} class="disabled"{/if}>{str tag='changeviewlayout' section='view'}</a> {contextualhelp plugintype="core" pluginname="view" section="changeviewlayout"}
<div class="cb"></div>
</tr></table>
</div>
<div id="bottom-pane">
<div id="column-container">
......@@ -95,4 +91,4 @@
</div>
</div>
{/if}
{include file="footer.tpl"}
{include file="microfooter.tpl"}
......@@ -14,12 +14,12 @@
</div>
<div class="lbuttons">
{if $backurl}<a class="btn-reply" href="{$backurl}">{str tag=back}</a>&nbsp;{/if}
{if $can_edit}<a class="btn-edit" href="blocks.php?id={$viewid}&amp;new={$new}">{str tag=edit}</a>{/if}
{if $can_edit}<a class="btn-edit" href="{$WWWROOT}view/blocks.php?id={$viewid}&amp;new={$new}">{str tag=edit}</a>&nbsp;{/if}
{if $edit_profile}<a class="btn-edit" href="{$WWWROOT}artefact/internal/index.php">{str tag=editprofile section=artefact.internal}</a>{/if}
</div>
<div class="center">
{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>
</div>
<!--div id="dropshadow"></div-->
</div>
<div id="main-wrapper">
<div class="main-column">
......
<?php
$viewtheme = new stdClass;
$viewtheme->name = 'Raw';
?>
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