Commit e0a92efd authored by Evonne Cheung evonne@catalyst.net.nz's avatar Evonne Cheung evonne@catalyst.net.nz Committed by Nigel McNie nigel@catalyst.net.nz
Browse files
parents 95b8fa64 25873215
mahara (0.4.4-1) unstable; urgency=low
* Bugfix release
-- Martyn Smith <martyn@catalyst.net.nz> Fri, 26 Jan 2007 10:50:38 +1300
mahara (0.4.3-1) unstable; urgency=low
* Bugfix release
-- Martyn Smith <martyn@catalyst.net.nz> Thu, 25 Jan 2007 11:49:18 +1300
mahara (0.4.2-1) unstable; urgency=low
* Bugfix release
-- Nigel McNie <nigel@catalyst.net.nz> Wed, 24 Jan 2007 15:30:58 +1300
mahara (0.4.1-1) unstable; urgency=low
* Bugfix release
......
......@@ -9,7 +9,7 @@ Package: mahara-apache
Architecture: any
Depends: ${misc:Depends}, apache, libapache-mod-php5, php5-json | libapache-mod-php5 (>= 5.2), php5-pgsql, php5-cli, php5-gd, file, cron
Conflicts: mahara-apache2
Recommends: postgresql-8.1
Recommends: postgresql-8.1, clamav, clamav-daemon
Pre-Depends: m4, perl, postgresql-client-8.1
Description: Mahara is an electronic portfolio, weblog, and resume builder
Established in 2006, Mahara is the result of a collaborative venture funded by
......@@ -42,7 +42,7 @@ Package: mahara-apache2
Architecture: any
Depends: ${misc:Depends}, apache2, libapache2-mod-php5, php5-json | libapache2-mod-php5 (>= 5.2), php5-pgsql, php5-cli, php5-gd, file, cron
Conflicts: mahara-apache
Recommends: postgresql-8.1
Recommends: postgresql-8.1, clamav, clamav-daemon
Pre-Depends: m4, perl, postgresql-client-8.1
Description: Mahara is an electronic portfolio, weblog, and resume builder
Established in 2006, Mahara is the result of a collaborative venture funded by
......
......@@ -89,7 +89,7 @@ if (empty($records)) {
$records = array();
}
$data = array();
$star = theme_get_url('star.png');
$star = theme_get_url('images/star.png');
$unread = get_string('unread', 'activity');
foreach ($records as &$r) {
......
......@@ -44,27 +44,10 @@ if ($stopmonitoring) {
try {
foreach ($_GET as $k => $v) {
if (preg_match('/^stopviews\-(\d+)$/',$k,$m)) {
$recurse = param_boolean($k . '-recurse', null);
if (!empty($recurse)) {
$sql = 'DELETE FROM ' . $prefix . 'usr_watchlist_artefact
WHERE usr = ? AND (artefact IN (
SELECT artefact FROM ' . $prefix . 'artefact_parent_cache WHERE parent IN (
SELECT artefact FROM ' . $prefix . 'view_artefact WHERE view = ? ) )
OR artefact IN (
SELECT artefact FROM ' . $prefix . 'view_artefact WHERE view = ?))';
delete_records_sql($sql, array($userid, $m[1], $m[1]));
}
delete_records('usr_watchlist_view', 'usr', $userid, 'view', $m[1]);
$count++;
}
else if (preg_match('/^stopartefacts\-(\d+)$/',$k,$m)) {
$recurse = param_boolean($k . '-recurse', null);
if (!empty($recurse)) {
$sql = 'DELETE FROM ' . $prefix . 'usr_watchlist_artefact
WHERE usr = ? AND artefact IN (
SELECT artefact FROM ' . $prefix . 'artefact_parent_cache WHERE parent = ?)';
delete_records_sql($sql, array($userid, $m[1]));
}
delete_records('usr_watchlist_artefact', 'usr', $userid, 'artefact', $m[1]);
$count++;
}
......@@ -133,7 +116,7 @@ $records = array();
if ($type == 'views') {
$count = count_records('usr_watchlist_view', 'usr', $userid);
$sql = 'SELECT v.*, v.title AS name
$sql = 'SELECT v.*, v.title AS name, w.recurse
FROM ' . $prefix . 'view v
JOIN ' . $prefix . 'usr_watchlist_view w ON w.view = v.id
WHERE w.usr = ?';
......@@ -157,7 +140,7 @@ else if ($type == 'communities') {
}
else if ($type == 'artefacts') {
$count = count_records('usr_watchlist_artefact', 'usr', $userid);
$sql = 'SELECT a.* , a.title AS name
$sql = 'SELECT a.* , a.title AS name, w.view, w.recurse
FROM ' . $prefix . 'artefact a
JOIN ' . $prefix . 'usr_watchlist_artefact w ON w.artefact = a.id
WHERE w.usr = ?';
......
......@@ -36,36 +36,38 @@ $artefactstring = get_string('artefacts', 'activity');
$monitoredstring = get_string('monitored', 'activity');
$allusersstring = get_string('allusers');
$andchildren = ' * ' . get_string('andchildren', 'activity');
$savefailed = get_string('stopmonitoringfailed', 'activity');
$savesuccess = get_string('stopmonitoringsuccess', 'activity');
$recursestr = '[<a href="" onClick="toggleChecked(\'tocheck-r\'); return false;">'
. get_string('recurseall', 'activity')
. '</a>]';
$recursestrjs = str_replace("'", "\'", $recursestr);
$wwwroot = get_config('wwwroot');
$javascript = <<<JAVASCRIPT
var watchlist = new TableRenderer(
'watchlist',
'index.json.php',
[
function(r) {
if (r.url) {
return TD(null,A({'href': r.url}, r.name));
}
return TD(null, r.name);
function(r, d) {
var url = '';
if (d.type == 'communities') {
url = '{$wwwroot}/contacts/communities/view.php?id=' + r.id;
}
else if (d.type == 'views') {
url = '{$wwwroot}/view/view.php?view=' + r.id;
}
else {
url = '{$wwwroot}/view/view.php?view=' + r.view + '&artefact=' + r.id;
}
var star = '';
if (r.recurse) {
star = ' *';
}
return TD(null, A({'href': url}, r.name), star);
},
function (r, d) {
return TD(null, INPUT({'type' : 'checkbox', 'class': 'tocheck', 'name': 'stop' + d.type + '-' + r.id}));
},
function (r, d) {
if (d.type != 'communities') {
return TD(null, INPUT({'type' : 'checkbox', 'class': 'tocheck-r', 'name': 'stop' + d.type + '-' + r.id + '-recurse'}));
}
else {
return '';
}
}
]
);
......@@ -79,6 +81,12 @@ watchlist.rowfunction = function(r, n) { return TR({'id': r.id, 'class': 'view r
function changeTitle(title) {
var titles = { 'views': '{$viewstring}', 'communities': '{$communitystring}', 'artefacts': '{$artefactstring}' };
$('typeheader').innerHTML = '{$monitoredstring} ' + titles[title];
if (title != 'communities') {
$('typeandchildren').innerHTML = '{$andchildren}';
}
else {
$('typeandchildren').innerHTML = '';
}
}
function stopmonitoring(form) {
......@@ -133,12 +141,10 @@ function statusChange() {
changeTitle(typevalue);
$('messagediv').innerHTML = '';
if (typevalue == 'communities') {
$('recurseheader').innerHTML = '';
$('user').options.length = 0;
$('user').disabled = true;
}
else {
$('recurseheader').innerHTML = '{$recursestrjs}';
var pd = {'userlist': typevalue};
var d = loadJSONDoc('index.json.php', pd);
d.addCallbacks(function (data) {
......@@ -180,7 +186,6 @@ $smarty = smarty(array('tablerenderer'));
$smarty->assign('viewusers', $viewusers);
$smarty->assign('typestr', get_string('views', 'activity'));
$smarty->assign('selectall', 'toggleChecked(\'tocheck\'); return false;');
$smarty->assign('recursestr', $recursestr);
$smarty->assign('stopmonitoring', 'stopmonitoring(this); return false;');
$smarty->assign('INLINEJAVASCRIPT', $javascript);
$smarty->display('account/watchlist/index.tpl');
......
......@@ -92,9 +92,9 @@ foreach (plugin_types() as $plugin) {
}
}
$loadingicon = theme_get_url('loading.gif');
$successicon = theme_get_url('success.gif');
$failureicon = theme_get_url('failure.gif');
$loadingicon = theme_get_url('images/loading.gif');
$successicon = theme_get_url('images/success.gif');
$failureicon = theme_get_url('images/failure.gif');
$loadingstring = get_string('upgradeloading', 'admin');
$successstring = get_string('upgradesuccesstoversion', 'admin');
......
......@@ -58,9 +58,9 @@ foreach (array_keys($alltemplates) as $t) {
$alltemplates[$t]['installed'] = true;
}
}
$loadingicon = theme_get_url('loading.gif');
$successicon = theme_get_url('success.gif');
$failureicon = theme_get_url('failure.gif');
$loadingicon = theme_get_url('images/loading.gif');
$successicon = theme_get_url('images/success.gif');
$failureicon = theme_get_url('images/failure.gif');
$loadingstring = get_string('upgradeloading', 'admin');
$successstring = get_string('upgradesuccess', 'admin');
......
......@@ -31,6 +31,7 @@ define('SUBMENUITEM', 'adminfiles');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
safe_require('artefact', 'file');
define('TITLE', get_string('adminfiles', 'admin'));
$copyright = get_field('site_content', 'content', 'name', 'uploadcopyright');
$wwwroot = get_config('wwwroot');
......
......@@ -29,6 +29,7 @@ define('ADMIN', 1);
define('MENUITEM', 'configsite');
define('SUBMENUITEM', 'sitemenu');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('sitemenu', 'admin'));
$strings = array('edit','delete','update','cancel','add','name','unknownerror');
$adminstrings = array('confirmdeletemenuitem', 'deletefailed','deletingmenuitem','savingmenuitem',
......
......@@ -31,6 +31,7 @@ define('SUBMENUITEM', 'siteoptions');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once('pieforms/pieform.php');
define('TITLE', get_string('siteoptions', 'admin'));
$langoptions = get_languages();
$themeoptions = get_themes();
......
......@@ -30,6 +30,7 @@ define('MENUITEM', 'configsite');
define('SUBMENUITEM', 'sitepages');
require(dirname(dirname(dirname(__FILE__))).'/init.php');
require_once('pieforms/pieform.php');
define('TITLE', get_string('sitepages', 'admin'));
$sitepages = get_records_array('site_content');
$pageoptions = array();
......
......@@ -44,9 +44,9 @@ if (!$upgrades) {
}
$js = 'var todo = ' . json_encode(array_keys($upgrades)) . ";\n";
$loadingicon = theme_get_url('loading.gif');
$successicon = theme_get_url('success.gif');
$failureicon = theme_get_url('failure.gif');
$loadingicon = theme_get_url('images/loading.gif');
$successicon = theme_get_url('images/success.gif');
$failureicon = theme_get_url('images/failure.gif');
$loadingstring = get_string('upgradeloading', 'admin');
$installsuccessstring = get_string('installsuccess', 'admin');
......
......@@ -73,7 +73,7 @@ function adminusers_submit(Pieform $form, $values) {
WHERE id IN (' . join(',', $values['users']) . ')');
db_commit();
$SESSION->add_ok_msg(get_string('adminusersupdated', 'admin'));
redirect(get_config('wwwroot') . 'admin/users/admins.php');
redirect('/admin/users/admins.php');
}
$smarty->assign('adminusersform', pieform($form));
......
......@@ -48,7 +48,7 @@ if ($institution || $add) {
}
function delete_cancel_submit() {
redirect(get_config('wwwroot') . 'admin/users/institutions.php');
redirect('/admin/users/institutions.php');
}
function delete_submit(Pieform $form, $values) {
......@@ -60,7 +60,7 @@ if ($institution || $add) {
db_commit();
$SESSION->add_ok_msg(get_string('institutiondeletedsuccessfully', 'admin'));
redirect('admin/users/institutions.php');
redirect('/admin/users/institutions.php');
}
$form = array(
'name' => 'delete',
......@@ -233,11 +233,11 @@ function institution_submit(Pieform $form, $values) {
$message = ($add) ? 'institutionaddedsuccessfully' : 'institutionupdatedsuccessfully';
$SESSION->add_ok_msg(get_string($message, 'admin'));
redirect(get_config('wwwroot') . 'admin/users/institutions.php');
redirect('/admin/users/institutions.php');
}
function institution_cancel_submit() {
redirect('admin/users/institutions.php');
redirect('/admin/users/institutions.php');
}
$smarty->display('admin/users/institutions.tpl');
......
......@@ -71,7 +71,7 @@ function staffusers_submit(Pieform $form, $values) {
}
db_commit();
$SESSION->add_ok_msg(get_string('staffusersupdated', 'admin'));
redirect(get_config('wwwroot') . 'admin/users/staff.php');
redirect('/admin/users/staff.php');
}
$smarty->assign('staffusersform', pieform($form));
......
......@@ -53,8 +53,9 @@ EOF
);
$form = new Pieform(array(
'name' => 'buttons',
'renderer' => 'oneline',
'name' => 'buttons',
'renderer' => 'oneline',
'autofocus' => false,
'elements' => array(
'unsuspend' => array(
'type' => 'submit',
......@@ -88,14 +89,14 @@ function buttons_submit_unsuspend(Pieform $form, $values) {
}
$SESSION->add_ok_msg(get_string('usersunsuspendedsuccessfully', 'admin'));
redirect('admin/users/suspended.php');
redirect('/admin/users/suspended.php');
}
function buttons_submit_export(Pieform $form, $values) {
global $SESSION;
$ids = get_user_ids_from_post();
$SESSION->add_info_msg(get_string('exportingnotsupportedyet', 'admin'));
redirect('admin/users/suspended.php');
redirect('/admin/users/suspended.php');
}
function buttons_submit_delete(Pieform $form, $values) {
......@@ -107,7 +108,7 @@ function buttons_submit_delete(Pieform $form, $values) {
}
$SESSION->add_ok_msg(get_string('usersdeletedsuccessfully', 'admin'));
redirect('admin/users/suspended.php');
redirect('/admin/users/suspended.php');
}
function get_user_ids_from_post() {
......@@ -121,7 +122,7 @@ function get_user_ids_from_post() {
if (!$ids) {
global $SESSION;
$SESSION->add_info_msg(get_string('nousersselected', 'admin'));
redirect('admin/users/suspended.php');
redirect('/admin/users/suspended.php');
}
return $ids;
......
......@@ -178,7 +178,7 @@ function uploadcsv_submit(Pieform $form, $values) {
log_info('Inserted ' . count($CSVDATA) . ' records');
$SESSION->add_ok_msg(get_string('uploadcsvusersaddedsuccessfully', 'admin'));
redirect('admin/users/uploadcsv.php');
redirect('/admin/users/uploadcsv.php');
}
$smarty = smarty();
......
......@@ -26,6 +26,7 @@
define('INTERNAL', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once('file.php');
$uploadnumber = param_integer('uploadnumber');
$createid = param_variable('createid');
......
......@@ -213,6 +213,8 @@ class ArtefactTypeBlog extends ArtefactType {
? $options['blockid']
: mt_rand();
$this->add_to_render_path($options);
// This uses the above blockid, so needs to be inlcuded after.
$javascript = require(get_config('docroot') . 'artefact/blog/render/blog_listchildren.js.php');
......@@ -245,6 +247,8 @@ class ArtefactTypeBlog extends ArtefactType {
? $options['blockid']
: mt_rand();
$this->add_to_render_path($options);
// This uses the above blockid, so needs to be inlcuded after.
$javascript = require(get_config('docroot') . 'artefact/blog/render/blog_renderfull.js.php');
......@@ -362,6 +366,13 @@ class ArtefactTypeBlog extends ArtefactType {
public function public_feedback_allowed() {
return $this->get('commentsallowed');
}
public function feedback_notify_owner() {
return $this->get('commentsnotify');
}
}
/**
......@@ -459,6 +470,7 @@ class ArtefactTypeBlogPost extends ArtefactType {
$smarty->assign('artefact', $this);
$attachments = $this->get_attached_files();
if ($attachments) {
$this->add_to_render_path($options);
require_once('artefact.php');
foreach ($attachments as &$attachment) {
$f = artefact_instance_from_id($attachment->id);
......@@ -472,6 +484,30 @@ class ArtefactTypeBlogPost extends ArtefactType {
return $smarty->fetch('artefact:blog:render/blogpost_renderfull.tpl');
}
public function attachment_id_list() {
if (!$list = get_column('artefact_blog_blogpost_file', 'file', 'blogpost', $this->get('id'))) {
$list = array();
}
return $list;
}
public function attach_file($artefactid) {
$data = new StdClass;
$data->blogpost = $this->get('id');
$data->file = $artefactid;
insert_record('artefact_blog_blogpost_file', $data);
$data->artefact = $data->file;
$data->parent = $data->blogpost;
$data->dirty = true;
insert_record('artefact_parent_cache', $data);
}
public function detach_file($artefactid) {
delete_records('artefact_blog_blogpost_file', 'blogpost', $this->get('id'), 'file', $artefactid);
delete_records('artefact_parent_cache', 'parent', $this->get('id'), 'artefact', $artefactid);
}
protected function count_attachments() {
return count_records('artefact_blog_blogpost_file', 'blogpost', $this->get('id'));
......@@ -705,15 +741,8 @@ class ArtefactTypeBlogPost extends ArtefactType {
if (!$fileid = ArtefactTypeFile::save_file($path, $data)) {
return false;
}
$data = new StdClass;
$data->blogpost = $this->id;
$data->file = $fileid;
insert_record('artefact_blog_blogpost_file', $data);
$data->artefact = $data->file;
$data->parent = $data->blogpost;
$data->dirty = true;
insert_record('artefact_parent_cache', $data);
$this->attach_file($fileid);
return $fileid;
}
......@@ -770,6 +799,14 @@ class ArtefactTypeBlogPost extends ArtefactType {
}
public function feedback_notify_owner() {
// Notify owner of comments on posts when the blog has
// commentsnotify set to 1;
$parent = get_field('artefact', 'parent', 'id', $this->get('id'));
return get_field('artefact_blog_blog', 'commentsnotify', 'blog', $parent);
}
}
?>
......@@ -96,14 +96,14 @@ function newblog_submit(Pieform $form, $values) {
global $USER;
ArtefactTypeBlog::new_blog($USER, $values);
redirect('artefact/blog/');
redirect('/artefact/blog/');
}
/**
* This function gets called to cancel a submission.
*/
function newblog_cancel_submit() {
redirect('artefact/blog/');
redirect('/artefact/blog/');
}
?>
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