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"} {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} {$profileform}
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -184,7 +184,6 @@ $string['siteoptionsset'] = 'Site options have been updated.'; ...@@ -184,7 +184,6 @@ $string['siteoptionsset'] = 'Site options have been updated.';
$string['sitethemedescription'] = 'The default theme for the site'; $string['sitethemedescription'] = 'The default theme for the site';
$string['tagssideblockmaxtags'] = 'Maximum Tags in Cloud'; $string['tagssideblockmaxtags'] = 'Maximum Tags in Cloud';
$string['tagssideblockmaxtagsdescription'] = 'The default number of tags to display in user tag clouds'; $string['tagssideblockmaxtagsdescription'] = 'The default number of tags to display in user tag clouds';
$string['theme'] = 'Theme';
$string['trustedsites'] = 'Trusted sites'; $string['trustedsites'] = 'Trusted sites';
$string['updatesiteoptions'] = 'Update site options'; $string['updatesiteoptions'] = 'Update site options';
$string['usersallowedmultipleinstitutions'] = 'Users allowed multiple institutions'; $string['usersallowedmultipleinstitutions'] = 'Users allowed multiple institutions';
......
...@@ -474,8 +474,6 @@ $string['findgroups'] = 'Find Groups'; ...@@ -474,8 +474,6 @@ $string['findgroups'] = 'Find Groups';
$string['returntosite'] = 'Return to Site'; $string['returntosite'] = 'Return to Site';
$string['siteadministration'] = 'Site Administration'; $string['siteadministration'] = 'Site Administration';
$string['useradministration'] = 'User Administration'; $string['useradministration'] = 'User Administration';
$string['viewmyprofilepage'] = 'View profile page';
$string['editmyprofilepage'] = 'Edit profile page';
$string['unreadmessages'] = 'unread messages'; $string['unreadmessages'] = 'unread messages';
$string['unreadmessage'] = 'unread message'; $string['unreadmessage'] = 'unread message';
...@@ -875,17 +873,17 @@ $string['remotehost'] = 'Remote host %s'; ...@@ -875,17 +873,17 @@ $string['remotehost'] = 'Remote host %s';
$string['Copyof'] = 'Copy of %s'; $string['Copyof'] = 'Copy of %s';
// Profie views // Profile views
$string['loggedinusersonly'] = 'Logged in users only'; $string['loggedinusersonly'] = 'Logged in users only';
$string['allowpublicaccess'] = 'Allow public (non logged in) access'; $string['allowpublicaccess'] = 'Allow public (non logged in) access';
$string['thisistheprofilepagefor'] = 'This is the profile page for %s'; $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['pleasedonotreplytothismessage'] = "Please do not reply to this message.";
$string['theme'] = 'Theme';
$string['deleteduser'] = 'Deleted user'; $string['deleteduser'] = 'Deleted user';
$string['recentupdates'] = 'Recent Updates'; $string['recentupdates'] = 'Recent Updates';
$string['theme'] = 'Theme';
?> ?>
...@@ -514,21 +514,26 @@ function get_language_root($language=null) { ...@@ -514,21 +514,26 @@ function get_language_root($language=null) {
* Return a list of available themes. * Return a list of available themes.
*/ */
function get_themes() { function get_themes() {
$themes = array(); static $themes = null;
$themebase = get_config('docroot') . 'theme/';
if (!$themedir = opendir($themebase)) { if (is_null($themes)) {
throw new SystemException('Unable to read theme directory '.$themebase); $themes = array();
} $themebase = get_config('docroot') . 'theme/';
while (false !== ($subdir = readdir($themedir))) { if (!$themedir = opendir($themebase)) {
if ($subdir != "." && $subdir != ".." && is_dir($themebase . $subdir)) { throw new SystemException('Unable to read theme directory '.$themebase);
$config_path = $themebase . $subdir . '/themeconfig.php'; }
if (is_readable($config_path)) { while (false !== ($subdir = readdir($themedir))) {
require($config_path); if ($subdir != "." && $subdir != ".." && is_dir($themebase . $subdir)) {
$themes[$subdir] = isset($theme->displayname) ? $theme->displayname : $subdir; $config_path = $themebase . $subdir . '/themeconfig.php';
if (is_readable($config_path)) {
require($config_path);
$themes[$subdir] = isset($theme->displayname) ? $theme->displayname : $subdir;
}
} }
} }
closedir($themedir);
} }
closedir($themedir);
return $themes; return $themes;
} }
......
...@@ -247,7 +247,7 @@ function Pieform(data) {//{{{ ...@@ -247,7 +247,7 @@ function Pieform(data) {//{{{
self.iframe = createDOM('iframe', { self.iframe = createDOM('iframe', {
'name': iframeName, 'name': iframeName,
'id' : iframeName, 'id' : iframeName,
'style': 'position: absolute; visibility: hidden; height: 0;' 'style': 'position: absolute; visibility: hidden;'
}); });
insertSiblingNodesAfter(self.data.name, self.iframe); insertSiblingNodesAfter(self.data.name, self.iframe);
} }
......
...@@ -486,14 +486,6 @@ class View { ...@@ -486,14 +486,6 @@ class View {
return $this->groupobj; 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() { public function delete() {
db_begin(); db_begin();
...@@ -873,8 +865,7 @@ class View { ...@@ -873,8 +865,7 @@ class View {
} }
$viewtheme = param_variable('viewtheme', ''); $viewtheme = param_variable('viewtheme', '');
if ($viewtheme != join('/', $this->get_theme()) if ($viewtheme && $viewtheme != $this->get('theme')) {
&& preg_match('#^[a-z0-9-]+/[a-z0-9-]+$#i', $viewtheme)) {
$this->set('theme', $viewtheme); $this->set('theme', $viewtheme);
} }
...@@ -1720,36 +1711,6 @@ class View { ...@@ -1720,36 +1711,6 @@ class View {
return $baseurl; 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. * Builds data for the artefact chooser.
* *
......
...@@ -1872,18 +1872,6 @@ function mahara_standard_nav() { ...@@ -1872,18 +1872,6 @@ function mahara_standard_nav() {
'weight' => 40, 'weight' => 40,
'ignore' => !$exportenabled, '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( array(
'path' => 'groups', 'path' => 'groups',
'url' => 'group/mygroups.php', '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 { ...@@ -539,14 +539,6 @@ div.rbuttons .small-logo {
padding: .5em; padding: .5em;
margin: 0 .25em 1px; 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 { .viewheader .small-logo img {
margin: .5em; margin: .5em;
padding: 0; padding: 0;
......
...@@ -44,4 +44,3 @@ ...@@ -44,4 +44,3 @@
</div> </div>
</div> </div>
{include file="footer.tpl"} {include file="footer.tpl"}
{include file="header.tpl"} {include file="viewmicroheader.tpl"}
<h1>{$PAGEHEADING|escape}</h1>
{if $columns} {if $columns}
{str tag="editblockspagedescription" section="view"} {str tag="editblockspagedescription" section="view"}
...@@ -19,29 +20,24 @@ ...@@ -19,29 +20,24 @@
<div class="cb"></div> <div class="cb"></div>
</div> </div>
<table id="middle-pane"> <div id="middle-pane">
<tr> <table class="fullwidth"><tr>
<td> <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"} <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>
<td class="center"> <td class="center">
<select id="viewtheme-select" name="viewtheme"> <select id="viewtheme-select" name="viewtheme">
<option value="">Choose theme...</option> <option value="">Choose theme...</option>
{foreach from=$viewthemes item=theme} {foreach from=$viewthemes key=themeid item=themename}
<option value="{$theme.id|escape}"{if $theme.id == $viewtheme} selected="selected" style="font-weight: bold;"{/if}>{$theme.name|escape}</option> <option value="{$themeid|escape}"{if $themeid == $viewtheme} selected="selected" style="font-weight: bold;"{/if}>{$themename|escape}</option>
{/foreach} {/foreach}
</select> </select>
</td> </td>
<td class="right"> <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> </td>
</tr> </tr></table>
</table> </div>
<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>
<div id="bottom-pane"> <div id="bottom-pane">
<div id="column-container"> <div id="column-container">
...@@ -95,4 +91,4 @@ ...@@ -95,4 +91,4 @@
</div> </div>
</div> </div>
{/if} {/if}
{include file="footer.tpl"} {include file="microfooter.tpl"}
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
</div> </div>
<div class="lbuttons"> <div class="lbuttons">
{if $backurl}<a class="btn-reply" href="{$backurl}">{str tag=back}</a>&nbsp;{/if} {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>
<div class="center"> <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> {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>
<!--div id="dropshadow"></div-->
</div> </div>
<div id="main-wrapper"> <div id="main-wrapper">
<div class="main-column"> <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