Commit ff53e73e authored by Evan Goldenberg's avatar Evan Goldenberg Committed by Richard Mansfield

add information about mahara to the index page

A global admin option allows site administrators to disable the
information entirely, though it is enabled by default for all new and
existing sites.

Users can opt not to show the information, and an account setting is
present if they wish to have it shown again. The information is shown
between the home page text set by the admin, and the user's dashboard
view.
Signed-off-by: default avatarEvan Goldenberg <evang@catalyst.net.nz>
parent 0d38e2cf
......@@ -179,6 +179,19 @@ if (get_config('userscanhiderealnames')) {
'defaultvalue' => $prefs->hiderealname,
);
}
if (get_config('homepageinfo')) {
$elements['showhomeinfo'] = array(
'type' => 'radio',
'options' => array(
1 => get_string('on', 'account'),
0 => get_string('off', 'account'),
),
'defaultvalue' => $prefs->showhomeinfo,
'title' => get_string('showhomeinfo', 'account'),
'separator' => '<br>',
'help' => 'true'
);
}
$elements['submit'] = array(
'type' => 'submit',
'value' => get_string('save')
......
......@@ -282,6 +282,12 @@ $siteoptionform = array(
'description' => get_string('anonymouscommentsdescription', 'admin'),
'defaultvalue' => get_config('anonymouscomments'),
),
'homepageinfo' => array(
'type' => 'checkbox',
'title' => get_string('homepageinfo', 'admin'),
'description' => get_string('homepageinfodescription', 'admin'),
'defaultvalue' => get_config('homepageinfo'),
),
)
);
......@@ -308,6 +314,7 @@ function siteoptions_submit(Pieform $form, $values) {
'showselfsearchsideblock', 'showtagssideblock',
'tagssideblockmaxtags', 'country', 'viewmicroheaders', 'userscanchooseviewthemes',
'remoteavatars', 'userscanhiderealnames', 'antispam', 'spamhaus', 'surbl', 'anonymouscomments',
'homepageinfo',
);
$oldlanguage = get_config('lang');
$oldtheme = get_config('theme');
......
......@@ -93,6 +93,7 @@ class User {
'sesskey' => '',
'ctime' => null,
'views' => array(),
'showhomeinfo' => 1,
);
$this->attributes = array();
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package mahara
* @subpackage core
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
define('INTERNAL', 1);
define('JSON', 1);
require('init.php');
$showhomeinfo = (int) param_boolean('showhomeinfo');
$result = array();
$USER->set_account_preference('showhomeinfo', $showhomeinfo);
$result['error'] = false;
$result['message'] = false;
json_headers();
echo json_encode($result);
?>
......@@ -60,6 +60,25 @@ if ($USER->is_logged_in()) {
)
);
if ($USER->get_account_preference('showhomeinfo')) {
// allow the user to choose never to see the info boxes again
$js = <<<JAVASCRIPT
function hideinfo() {
slideUp($('home-info'));
}
function nevershow() {
var data = {'showhomeinfo' : 0};
sendjsonrequest('homeinfo.json.php', data, 'POST', hideinfo);
}
addLoadEvent(function () {
$('hideinfo').onclick = nevershow;
});
JAVASCRIPT;
$smarty->assign('INLINEJAVASCRIPT', $js);
}
$smarty->assign('dashboardview', true);
$smarty->assign('viewcontent', $view->build_columns());
$smarty->assign('viewid', $view->get('id'));
......
......@@ -67,6 +67,8 @@ $string['disablemultipleblogserror'] = 'You cannot disable multiple blogs unless
$string['hiderealname'] = 'Hide real name';
$string['hiderealnamedescription'] = 'Check this box if you have set a display name and you do not want other users to be able to find you by your real name in user searches.';
$string['showhomeinfo'] = 'Show information about Mahara on the home page';
$string['prefssaved'] = 'Preferences saved';
$string['prefsnotsaved'] = 'Failed to save your Preferences!';
......
......@@ -202,6 +202,8 @@ $string['defaultaccountlifetimedescription'] = 'If set, user accounts will expir
$string['embeddedcontent'] = 'Embedded content';
$string['embeddedcontentdescription'] = 'If you would like users to be able to embed videos or other outside content into their portfolios, you can choose which sites to trust below.';
$string['Everyone'] = 'Everyone';
$string['homepageinfo'] = 'Show home page information';
$string['homepageinfodescription'] = 'If enabled, information about Mahara and how it is used will be displayed on the Mahara home page. Logged in users will have the option to disable it.';
$string['institutionautosuspend'] = 'Auto-suspend expired institutions';
$string['institutionautosuspenddescription'] = 'If checked, expired institutions will be automatically suspended';
$string['institutionexpirynotification'] = 'Warning time for institution expiry';
......
<h3>Show information about Mahara on the home page</h3>
<p>If "On", information about Mahara and what can be done with it will be displayed on the home page, above your dashboard view.</p>
......@@ -105,6 +105,7 @@
<FIELD NAME="quotaused" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" />
<FIELD NAME="authinstance" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1" />
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="false" />
<FIELD NAME="showhomeinfo" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" />
......
......@@ -1727,5 +1727,10 @@ function xmldb_core_upgrade($oldversion=0) {
}
}
if ($oldversion < 2010042603) {
execute_sql('ALTER TABLE {usr} ADD COLUMN showhomeinfo SMALLINT NOT NULL DEFAULT 1');
set_config('homepageinfo', 1);
}
return $status;
}
......@@ -683,6 +683,7 @@ function core_install_firstcoredata_defaults() {
set_config('viewmicroheaders', 1);
set_config('userscanchooseviewthemes', 1);
set_config('anonymouscomments', 1);
set_config('homepageinfo', 1);
// install the applications
$app = new StdClass;
......
......@@ -205,6 +205,7 @@ function expected_account_preferences() {
'tagssideblockmaxtags' => get_config('tagssideblockmaxtags'),
'hiderealname' => 0,
'multipleblogs' => 0,
'showhomeinfo' => 1,
);
}
......
......@@ -28,7 +28,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2010042602;
$config->version = 2010042603;
$config->release = '1.3.0dev';
$config->minupgradefrom = 2008040200;
$config->minupgraderelease = '1.0.0 (release tag 1.0.0_RELEASE)';
......
......@@ -866,4 +866,15 @@ ul.groupuserstatus li,
/* Settings > Institution membership */
#requestmembership_studentid_container label {
}
\ No newline at end of file
}
/* Home page info boxes */
.home-info {
border: solid 2px #cccccc;
background: #eeeeee;
}
.home-info p.subtitle {
border-top: solid 1px #cccccc;
border-bottom: solid 1px #cccccc;
}
......@@ -815,3 +815,14 @@ ul.groupuserstatus li,
/* Settings > Institution membership */
#requestmembership_studentid_container label {
}
/* Home page info boxes */
.home-info {
border: solid 2px #cccccc;
background: #eeeeee;
}
.home-info p.subtitle {
border-top: solid 1px #cccccc;
border-bottom: solid 1px #cccccc;
}
......@@ -931,3 +931,14 @@ ul.groupuserstatus li,
/* Settings > Institution membership */
#requestmembership_studentid_container label {
}
/* Home page info boxes */
.home-info {
border: solid 2px #cccccc;
background: #0C2839;
}
.home-info p.subtitle {
border-top: solid 1px #cccccc;
border-bottom: solid 1px #cccccc;
}
......@@ -1589,3 +1589,46 @@ form#search input.text {
.help, .help a, .help a img {
vertical-align: top;
}
/* Home page info boxes */
.home-info-table td {
width: 1%;
padding: 0;
}
.home-info {
padding: 10px;
margin: 1.7em 4px 0 4px;
height: 250px;
}
.home-info.first {
margin: 1.7em 4px 0 0;
}
.home-info.last {
margin: 1.7em 0 0 4px;
}
.home-info a,
.home-info a:hover,
.home-info a:active {
text-decoration: none;
}
.home-info table {
width: 100%;
text-align: center;
}
.home-info td {
width: 1%;
vertical-align: top;
white-space: nowrap;
}
#accessdesc {
background: url(../images/access.png) no-repeat left;
padding-left: 40px;
margin: 15px 10px 0 10px;
}
.home-info .organise {
padding-bottom: 15px;
}
.help, .help a, .help a img {
vertical-align: top;
}
<div id="home-info" class="rel">
{if $USER->is_logged_in()}
<div class="rbuttons"><a id="hideinfo" class="btn-del">Don't show this</a></div>
{/if}
<table class="home-info-table">
<tr>
<td>
<div class="home-info">
<h3 class="center">Create and Collect</h3>
<p class="subtitle center">Develop your portfolio</p>
<table>
<tr>
<td>
{if $USER->is_logged_in()}<a href="/artefact/internal">{/if}
<img src="{theme_url filename='images/profile.png'}" alt="" />
{if $USER->is_logged_in()}</a>{/if}
</td>
<td>
{if $USER->is_logged_in()}<a href="/artefact/file">{/if}
<img src="{theme_url filename='images/files.png'}" alt="" />
{if $USER->is_logged_in()}</a>{/if}
</td>
</tr>
<tr>
<td>
Update your
{if $USER->is_logged_in()}<a href="/artefact/internal">{/if}
Profile
{if $USER->is_logged_in()}</a>{/if}
</td>
<td>
Upload your
{if $USER->is_logged_in()}<a href="/artefact/file">{/if}
Files
{if $USER->is_logged_in()}</a>{/if}
</td>
</tr>
<tr>
<td>
{if $USER->is_logged_in()}<a href="/artefact/resume">{/if}
<img src="{theme_url filename='images/resume.png'}" alt="" />
{if $USER->is_logged_in()}</a>{/if}
</td>
<td>
{if $USER->is_logged_in()}<a href="/artefact/blog">{/if}
<img src="{theme_url filename='images/blog.png'}" alt="" />
{if $USER->is_logged_in()}</a>{/if}
</td>
</tr>
<tr>
<td>
Create your
{if $USER->is_logged_in()}<a href="/artefact/resume">{/if}
Resume
{if $USER->is_logged_in()}</a>{/if}
</td>
<td>
Publish a
{if $USER->is_logged_in()}<a href="/artefact/blog">{/if}
Blog
{if $USER->is_logged_in()}</a>{/if}
</td>
</tr>
</table>
</div>
</td>
<td>
<div class="home-info">
<h3 class="center">Organise</h3>
<p class="subtitle center">Showcase your portfolio with views</p>
<div class="center">
{if $USER->is_logged_in()}<a href="/view">{/if}
<img class="organise" src="{theme_url filename='images/organise.png'}" alt="" />
{if $USER->is_logged_in()}</a>{/if}
</div>
Organise your portfolio into
{if $USER->is_logged_in()}<a href="/view">{/if}
Views.
{if $USER->is_logged_in()}</a>{/if}
Create different views for different audiences - you choose the elements to include.
</div>
</td>
<td>
<div class="home-info">
<h3 class="center">Share and Network</h3>
<p class="subtitle center">Meet friends and join groups</p>
<table>
<tr>
<td>
{if $USER->is_logged_in()}<a href="/user/find.php">{/if}
<img src="{theme_url filename='images/friends.png'}" alt="" />
{if $USER->is_logged_in()}</a>{/if}
</td>
<td>
{if $USER->is_logged_in()}<a href="/group/find.php">{/if}
<img src="{theme_url filename='images/groups.png'}" alt="" />
{if $USER->is_logged_in()}</a>{/if}
</td>
</tr>
<tr>
<td>
Find
{if $USER->is_logged_in()}<a href="/user/find.php">{/if}
Friends
{if $USER->is_logged_in()}</a>{/if}
</td>
<td>
Join
{if $USER->is_logged_in()}<a href="/group/find.php">{/if}
Groups
{if $USER->is_logged_in()}</a>{/if}
</td>
</tr>
</table>
<div id="accessdesc">
You can fine-tune who has access to each view, and for how long.
</div>
</div>
</td>
</tr>
</table>
</div>
{include file="header.tpl"}
{$page_content|clean_html}
{if get_config('homepageinfo') && (!$USER->is_logged_in() || $USER->get_account_preference('showhomeinfo'))}
{include file="homeinfo.tpl"}
{/if}
{if $dashboardview}
{include file="user/dashboard.tpl"}
{include file="user/dashboard.tpl"}
{/if}
{include file="footer.tpl"}
......@@ -879,3 +879,14 @@ ul.groupuserstatus li,
#requestmembership_studentid_container label {
}
/* Home page info boxes */
.home-info {
border: solid 2px #cccccc;
background: #eeeeee;
}
.home-info p.subtitle {
border-top: solid 1px #cccccc;
border-bottom: solid 1px #cccccc;
}
......@@ -886,3 +886,14 @@ ul.groupuserstatus li,
/* Settings > Institution membership */
#requestmembership_studentid_container label {
}
/* Home page info boxes */
.home-info {
border: solid 2px #cccccc;
background: #eeeeee;
}
.home-info p.subtitle {
border-top: solid 1px #cccccc;
border-bottom: solid 1px #cccccc;
}
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