Commit 5e1b18fe authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files
parents 6a266df2 af2f2b58
......@@ -129,7 +129,7 @@ postlist.rowfunction = function(d, n, gd) {
var filerows = [TR(null, TD({'colSpan':3}, {$enc_files}))];
for (var i = 0; i < d.files.length; i++) {
filerows.push(TR({'class':'r'+((i+1)%2)},
TD(null, IMG({'src':get_themeurl(d.files[i].artefacttype + '.gif')})),
TD(null, IMG({'src':get_themeurl('images/' + d.files[i].artefacttype + '.gif')})),
TD(null, A({'href':config.wwwroot+'artefact/file/download.php?file='+d.files[i].file},
d.files[i].title)),
TD(null, d.files[i].description)));
......
......@@ -36,7 +36,9 @@ $blog = new ArtefactTypeBlog($id);
// This javascript is used to generate a list of blog posts.
$js = require('index.js.php');
$smarty = smarty(array('tablerenderer'));
$images = array('themepaths' => array('images/file.gif', 'images/image.gif'));
$smarty = smarty(array('tablerenderer'), array(), array(), $images);
$smarty->assign_by_ref('blog', $blog);
$smarty->assign_by_ref('editform', $form);
$smarty->assign_by_ref('INLINEJAVASCRIPT', $js);
......
......@@ -156,6 +156,7 @@ function profileform_submit(Pieform $form, $values) {
'firstname' => $USER->get('firstname'),
'lastname' => $USER->get('lastname'),
'preferredname' => $USER->get('preferredname'),
'admin' => $USER->get('admin'),
'email' => $email,
),
null,
......
......@@ -97,22 +97,22 @@ switch ($type) {
}
break;
case 'members':
$sql = 'SELECT u.*, c.tutor
FROM ' . $prefix . 'usr u JOIN ' . $prefix . 'community_member c
$select = 'SELECT u.*,c.tutor ';
$sql = ' FROM ' . $prefix . 'usr u JOIN ' . $prefix . 'community_member c
ON c.member = u.id
WHERE c.community = ?';
if (empty($pending)) { // default behaviour - actual members
$count = count_records('community_member', 'community', $id);
$data = get_records_sql_array($sql, array($id), $offset, $limit);
$data = get_records_sql_array($select . $sql, array($id), $offset, $limit);
}
else {
if ($membership == COMMUNITY_MEMBERSHIP_MEMBER) {
community_json_empty();
}
$sql = str_replace('community_member', 'community_member_request', $sql);
$sql = str_replace(',c.tutor', ',1 AS request, c.reason', $sql);
$select = 'SELECT u.*, 1 AS request, c.reason';
$count = count_records('community_member_request', 'community', $id);
$data = get_records_sql_array($sql, array($id), $offset, $limit);
$data = get_records_sql_array($select . $sql, array($id), $offset, $limit);
}
if (empty($data)) {
$data = array();
......
......@@ -40,6 +40,8 @@ $remove = get_string('removefromfriendslist');
$accept = get_string('accept');
$reject = get_string('reject');
$allviews = get_string('allviews');
$removeheader = get_string('remove');
$reasonheader = get_string('reason');
$friendcontrolfailed = get_string('friendlistfailure');
$enc_confirm_remove = json_encode(get_string('confirmremovefriend'));
......@@ -160,10 +162,23 @@ function expandViews(views, id) {
return false;
}
function pendingChange() {
$('messagediv').innerHTML='';
var pending = $('pendingopts').options[$('pendingopts').selectedIndex].value;
friendslist.doupdate({'pending': pending});
if (pending == 1) {
hideElement('viewsheader');
$('removeorreason').innerHTML = '{$reasonheader}';
}
else {
showElement('viewsheader');
$('removeorreason').innerHTML = '{$removeheader}';
}
}
EOF;
$smarty = smarty(array('tablerenderer'));
$smarty->assign('pendingchange', '$(\'messagediv\').innerHTML=\'\';friendslist.doupdate({\'pending\':this.options[this.selectedIndex].value});');
$smarty->assign('INLINEJAVASCRIPT', $inlinejs);
$smarty->display('contacts/index.tpl');
......
......@@ -169,7 +169,7 @@ function set_profile_field($userid, $field, $value) {
// specified one
if ($field == 'email') {
try {
$email = artefact_instance_from_type('email');
$email = artefact_instance_from_type('email', $userid);
}
catch (ArtefactNotFoundException $e) {
$email = new ArtefactTypeEmail();
......
......@@ -178,6 +178,11 @@ EOF;
foreach ($themepaths['mahara'] as $themepath) {
$theme_list[$themepath] = theme_get_url($themepath);
}
if (isset($extraconfig['themepaths']) && is_array($extraconfig['themepaths'])) {
foreach ($extraconfig['themepaths'] as $themepath) {
$theme_list[$themepath] = theme_get_url($themepath);
}
}
$stringjs = '<script type="text/javascript">';
$stringjs .= 'var strings = ' . json_encode($strings) . ';';
......
......@@ -372,7 +372,7 @@ function register_validate(Pieform $form, $values) {
// The e-mail address cannot already be in the system
if (!$form->get_error('email')
&& (record_exists('usr', 'email', $values['email'])
|| record_exists('usr_registration', 'email', $values['email']))) {
|| record_exists('artefact_internal_profile_email', 'email', $values['email']))) {
$form->set_error('email', get_string('emailalreadytaken', 'auth.internal'));
}
......@@ -403,6 +403,7 @@ function register_submit(Pieform $form, $values) {
insert_record('usr_registration', $values);
$user =(object) $values;
$user->admin = 0;
email_user($user, null,
get_string('registeredemailsubject', 'auth.internal', get_config('sitename')),
get_string('registeredemailmessagetext', 'auth.internal', $values['firstname'], get_config('sitename'), $values['key'], get_config('sitename')),
......
......@@ -105,7 +105,7 @@ input.submit, input.submitcancel, input.cancelbackcreate, input.button, button {
height: 24px;
margin: 5px 2px 0 0;
padding: 0 5px;
color: #eef7d4;
color: #eef7d4;
font-size: 11px;
font-weight: bold;
border: 1px solid #696;
......
......@@ -6,7 +6,7 @@
{include file="columnleftstart.tpl"}
<h2>{str tag="myfriends"}</h2>
<form>
<select name="pending" onChange="{$pendingchange}">
<select id="pendingopts" name="pending" onChange="pendingChange();">
<option value="0">{str tag='currentfriends'}</option>
<option value="1">{str tag='pendingfriends'}</option>
</select>
......@@ -17,8 +17,8 @@
<tr>
<th>{str tag="profileicon"}</th>
<th>{str tag="friend"}</th>
<th>{str tag="views"}</th>
<th>{str tag="remove"}</th>
<th id="viewsheader">{str tag="views"}</th>
<th id="removeorreason">{str tag="remove"}</th>
<tr>
</thead>
<tbody>
......
......@@ -30,6 +30,17 @@
{/foreach}
</ul></td></tr></tbody></table>
{/if}
{if $USERCOMMUNITIES}
<table id="userview_communities"><thead><tr><th colspan=2>
{str section=mahara tag=communities}
</td></tr></thead>
<tbody>
{foreach from=$USERCOMMUNITIES item=item}
<tr><td><a href="{$WWWROOT}contacts/communities/view.php?id={$item->id}">{$item->name}</a></td><td>{$item->type}</td></tr>
{/foreach}
</tbody></table>
{/if}
<br>
{$INVITEFORM}
{$ADDFORM}
......
......@@ -295,6 +295,9 @@ $smarty->assign('INLINEJAVASCRIPT', $inlinejs);
$smarty->assign('NAME',$name);
$smarty->assign('USERID', $userid);
$smarty->assign('USERFIELDS',$userfields);
if ($USER->get('admin')) {
$smarty->assign('USERCOMMUNITIES',$userassoccommunities);
}
$smarty->assign('VIEWS',$views);
$smarty->display('user/view.tpl');
......
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