Commit b3bcd169 authored by Nigel McNie's avatar Nigel McNie
Browse files

Merge branch 'master' into theme-1.0

parents 0076b835 eef8ddb7
......@@ -31,7 +31,7 @@ define('SECTION_PLUGINNAME', 'internal');
define('SECTION_PAGE', 'index');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('profile','artefact.internal'));
define('TITLE', get_string('editprofile','artefact.internal'));
require_once('pieforms/pieform.php');
safe_require('artefact', 'internal');
......@@ -124,21 +124,21 @@ $elements = array(
'legend' => get_string('aboutme', 'artefact.internal'),
'collapsible' => true,
'collapsed' => $fieldset != 'aboutme',
'elements' => get_desired_fields(&$items, array('firstname', 'lastname', 'studentid', 'preferredname', 'introduction')),
'elements' => get_desired_fields(&$items, array('firstname', 'lastname', 'studentid', 'preferredname', 'introduction'), 'about'),
),
'contact' => array(
'type' => 'fieldset',
'legend' => get_string('contact', 'artefact.internal'),
'collapsible' => true,
'collapsed' => $fieldset != 'contact',
'elements' => get_desired_fields(&$items, array('email', 'officialwebsite', 'personalwebsite', 'blogaddress', 'address', 'town', 'city', 'country', 'homenumber', 'businessnumber', 'mobilenumber', 'faxnumber')),
'elements' => get_desired_fields(&$items, array('email', 'officialwebsite', 'personalwebsite', 'blogaddress', 'address', 'town', 'city', 'country', 'homenumber', 'businessnumber', 'mobilenumber', 'faxnumber'), 'contact'),
),
'messaging' => array(
'type' => 'fieldset',
'legend' => get_string('messaging', 'artefact.internal'),
'collapsible' => true,
'collapsed' => $fieldset != 'messaging',
'elements' => get_desired_fields(&$items, array('icqnumber', 'msnnumber', 'aimscreenname', 'yahoochat', 'skypeusername', 'jabberusername')),
'elements' => get_desired_fields(&$items, array('icqnumber', 'msnnumber', 'aimscreenname', 'yahoochat', 'skypeusername', 'jabberusername'), 'messaging'),
),
'general' => array(
'type' => 'fieldset',
......@@ -163,8 +163,13 @@ $profileform = pieform(array(
'autofocus' => false,
));
function get_desired_fields($allfields, $desiredfields) {
$return = array();
function get_desired_fields($allfields, $desiredfields, $section) {
$return = array(
"{$section}description" => array(
'type' => 'html',
'value' => get_string("{$section}description", 'artefact.internal')
)
);
foreach ($desiredfields as $field) {
if (isset($allfields[$field])) {
$return[$field] = $allfields[$field];
......@@ -380,7 +385,7 @@ $smarty = smarty(array(), array(), array(
$smarty->assign('profileform', $profileform);
$smarty->assign('heading', get_string('profile', 'artefact.internal'));
$smarty->assign('heading', get_string('editprofile', 'artefact.internal'));
$smarty->display('artefact:internal:index.tpl');
......
......@@ -35,6 +35,11 @@ $string['mandatory'] = 'Mandatory';
$string['public'] = 'Public';
$string['profileiconsize'] = 'Icon size';
$string['aboutdescription'] = 'Enter your real first and last name here. If you want to show a different name to people in the system, put that name in as your preferred name.';
$string['contactdescription'] = 'All of this information is private, unless you choose to put it in a view.';
$string['messagingdescription'] = 'Like your contact information, this information is private.';
$string['viewmyprofile'] = 'View my profile';
// profile categories
$string['aboutme'] = 'About me';
$string['contact'] = 'Contact information';
......
<h3>Introduction</h3>
<p>Your optional brief introduction might include information such as your area of study, professional expertise, interests; or how and why you are using Mahara.</p>
<p>Tell everyone about yourself! This will be on your profile page and other people will see this introduction when you appear in their search results, so make it good!</p>
......@@ -143,6 +143,7 @@ function postSubmit(form, data) {
quotaUpdate();
if (!data.error) {
$(form).reset();
$('upload_title').value = '';
}
}
......
......@@ -3,9 +3,11 @@
{include file="columnleftstart.tpl"}
<div class="fr"><span class="viewicon"><a href="{$WWWROOT}user/view.php?id={$USER->get('id')}">{str tag="viewmyprofile" section="artefact.internal"}</a></span></div>
<div style="position: relative;">
<div style="position: absolute; top: 3.5em; right: 0;"><a href="{$WWWROOT}artefact/internal/profileicons.php"><img src="{$WWWROOT}thumb.php?type=profileicon&maxsize=100&id={$USER->get('id')}" alt=""></a></div>
</div>
{$profileform}
{include file="columnleftend.tpl"}
{include file="footer.tpl"}
......@@ -196,9 +196,12 @@ function sendjsonrequest(script, data, rtype, successcallback, errorcallback, qu
orig_arguments = arguments;
}
document.documentElement.style.cursor = 'wait';
var d = doXHR(script, xhrOptions);
d.addCallbacks(function (result) {
document.documentElement.style.cursor = '';
var data = evalJSONRequest(result);
var errtype = false;
if (!data.error) {
......@@ -236,6 +239,7 @@ function sendjsonrequest(script, data, rtype, successcallback, errorcallback, qu
}
},
function (e) {
document.documentElement.style.cursor = '';
if (e instanceof MochiKit.Async.XMLHttpRequestError) {
log(e);
}
......@@ -591,7 +595,6 @@ function create_tags_control(name, value, options) {
// this function takes an existing input element and augments it
function augment_tags_control(elem, returnContainer) {
elem = getElement(elem);
log('augment_tags_control(', elem, ')');
var tagContainer = DIV();
// setElementDimensions(tagContainer, {'w': getElementDimensions(elem).w});
......@@ -603,34 +606,53 @@ function augment_tags_control(elem, returnContainer) {
replaceChildNodes(tagContainer, get_string('loading') + ' ', IMG({'src':get_themeurl('images/loading.gif')}));
sendjsonrequest(config.wwwroot + 'json/taglist.php', {}, 'GET', function (data) {
replaceChildNodes(tagContainer);
forEach(data, function(tag) {
var tagLink = A({'href':''}, tag.tag);
connect(tagLink, 'onclick', function(e) {
e.stop();
if (some(elem.value.split(/ *, */), function(t) { return t == tag.tag; })) {
return;
}
if (elem.value.match(/^ *$/) || elem.value.match(/, *$/)) {
elem.value += tag.tag;
}
else {
elem.value += ', ' + tag.tag;
}
if (data.length == 0) {
appendChildNodes(tagContainer, get_string('youhavenottaggedanythingyet'));
}
else {
var tagData = [];
forEach(data, function(tag) {
var tagLink = A({'href':''}, tag.tag);
connect(tagLink, 'onclick', function(e) {
e.stop();
if (some(elem.value.split(/ *, */), function(t) { return t == tag.tag; })) {
// If at the start of the string, remove it and the comma/spaces after
elem.value = elem.value.replace(new RegExp('^' + tag.tag + ',? *'), '');
// Otherwise, remove the comma/spaces before it
elem.value = elem.value.replace(new RegExp(', *' + tag.tag), '');
return;
}
if (elem.value.match(/^ *$/) || elem.value.match(/, *$/)) {
elem.value += tag.tag;
}
else {
elem.value += ', ' + tag.tag;
}
});
tagData.push([tagLink, '\u00A0(', tag.count, ')']);
tagData.push(', ');
//appendChildNodes(tagContainer, tagLink, '\u00A0(', tag.count, ')');
});
// Remove the last comma
tagData.pop();
forEach(tagData, function(i) {
appendChildNodes(tagContainer, i);
});
appendChildNodes(tagContainer, tagLink, '\u00A0(', tag.count, '), ');
});
}
});
});
if (typeof(returnContainer) == 'boolean' && returnContainer) {
return tagContainer;
}
var help = getFirstElementByTagAndClassName('span', 'help', elem.parentNode);
var newNode = DIV();
swapDOM(elem, newNode);
appendChildNodes(newNode, tagContainer, elem);
appendChildNodes(newNode, tagContainer, elem, ' ', help);
};
function quotaUpdate(quotaused, quota) {
......
......@@ -73,7 +73,8 @@ $string['select'] = 'Select';
$string['tags'] = 'Tags';
$string['tagsdesc'] = 'Enter comma separated tags for this item.';
$string['tagsdescprofile'] = 'Enter comma separated tags for this item. Items tagged with \'profile\' are displayed in the sidebar.';
$string['tagsdescprofile'] = 'Enter comma separated tags for this item. Items tagged with \'profile\' are displayed in your sidebar.';
$string['youhavenottaggedanythingyet'] = 'You have not tagged anything yet';
$string['selfsearch'] = 'Search My Portfolio';
$string['ssopeers'] = 'SSO Peers';
......
......@@ -196,13 +196,13 @@ $string['moveblockright'] = 'Move this block right';
$string['configureblock'] = 'Configure this block';
$string['removeblock'] = 'Remove this block';
$string['viewlayout'] = 'View layout';
$string['viewlayoutdescription'] = 'You can change the widths of the columns in your view.';
$string['changemyviewlayout'] = 'Change My View Layout';
$string['viewcolumnspagedescription'] = 'First, select the number of columns in your view. In the next step, you will be able to change the widths of the columns.';
$string['viewlayoutpagedescription'] = 'Select how you would like the columns in your view to be layed out.';
$string['changeviewlayout'] = 'Change my view layout';
$string['backtoyourview'] = 'Back to my view';
$string['viewlayoutchanged'] = 'View layout changed';
$string['selectnumberofcolumns'] = 'Select the number of columns in your view';
$string['changeviewcolumns'] = 'Change my view columns';
$string['numberofcolumns'] = 'Number of columns';
$string['by'] = 'by';
......
......@@ -53,7 +53,7 @@ function pieform_element_tags(Pieform $form, $element) {
}
if (!isset($element['size'])) {
$element['size'] = 70;
$element['size'] = 60;
}
$smarty->assign('name', $element['name']);
......
......@@ -143,7 +143,7 @@ EOF;
mode: "textareas",
editor_selector: 'tinywysiwyg',
theme: "advanced",
plugins: "fullscreen",
plugins: "fullscreen,inlinepopups",
theme_advanced_buttons1 : "bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull",
theme_advanced_buttons2 : "bullist,numlist,separator,link,unlink,separator,code,fullscreen",
theme_advanced_buttons3 : "",
......@@ -458,6 +458,7 @@ function jsstrings() {
'sessiontimedout',
'loginfailed',
'home',
'youhavenottaggedanythingyet',
),
),
'tablerenderer' => array(
......
......@@ -3,6 +3,9 @@
{include file="columnfullstart.tpl"}
<h2>{$heading}</h2>
<p>{str tag="viewcolumnspagedescription" section="view"}</p>
{$form}
{include file="columnfullend.tpl"}
......
......@@ -2,9 +2,9 @@
{include file="columnfullstart.tpl"}
<h2>{str tag='viewlayout' section='view'}</h2>
<h2>{str tag='changemyviewlayout' section='view'}</h2>
<p>{str tag='viewlayoutdescription' section='view'}</p>
<p>{str tag='viewlayoutpagedescription' section='view'}</p>
{$form_start_tag}
......
......@@ -29,7 +29,7 @@ define('MENUITEM', 'viewlayout');
require_once(dirname(dirname(__FILE__)) . '/init.php');
require_once('pieforms/pieform.php');
require_once('view.php');
define('TITLE', get_string('changeviewcolumns', 'view'));
define('TITLE', get_string('changemyviewlayout', 'view'));
$id = param_integer('id');
$new = param_boolean('new');
......@@ -50,7 +50,7 @@ $columnsform = pieform(array(
'elements' => array(
'numcolumns' => array(
'type' => 'select',
'title' => get_string('selectnumberofcolumns', 'view'),
'title' => get_string('numberofcolumns', 'view'),
'options' => array( 1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5'),
'defaultvalue' => $numcolumns,
),
......
......@@ -31,7 +31,7 @@ define('MENUITEM', 'viewlayout');
require_once(dirname(dirname(__FILE__)) . '/init.php');
require_once('pieforms/pieform.php');
require_once('view.php');
define('TITLE', get_string('viewlayout', 'view'));
define('TITLE', get_string('changemyviewlayout', 'view'));
$id = param_integer('id');
$new = param_boolean('new');
......
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