Commit 58098a0c authored by Alan McNatty's avatar Alan McNatty
Browse files

Merge branch 'master' of git://gitorious.org/mahara/mahara

Conflicts:
	htdocs/lib/db/upgrade.php
parents 71f2ced7 456a2f1a
......@@ -672,8 +672,8 @@ class ArtefactTypeBlogPost extends ArtefactType {
$commentcounts = ArtefactTypeComment::count_comments($viewids, array_keys($data));
}
// Format dates properly
foreach ($data as &$post) {
// Format dates properly
if (is_null($viewoptions)) {
// My Blogs area: create forms for publishing & deleting posts.
if (!$post->published) {
......@@ -690,6 +690,12 @@ class ArtefactTypeBlogPost extends ArtefactType {
}
$post->ctime = format_date($post->ctime, 'strftimedaydatetime');
$post->mtime = format_date($post->mtime);
// Ensure images in the post have the right viewid associated with them
if (!empty($viewoptions['viewid'])) {
safe_require('artefact', 'file');
$post->description = ArtefactTypeFolder::append_view_url($post->description, $viewoptions['viewid']);
}
}
$results['data'] = array_values($data);
......@@ -713,7 +719,7 @@ class ArtefactTypeBlogPost extends ArtefactType {
$posts['tablerows'] = $smarty->fetch($template);
if ($posts['limit'] && $pagination) {
$pagination = build_pagination($foo = array(
$pagination = build_pagination(array(
'id' => $pagination['id'],
'class' => 'center',
'datatable' => $pagination['datatable'],
......
......@@ -196,7 +196,11 @@ function attachedImageList() {
var attachments = editpost_filebrowser.selecteddata;
for (var a in attachments) {
if (attachments[a].artefacttype == 'image') {
images.push({'id': attachments[a].id, 'name': attachments[a].title, 'description': attachments[a].description});
images.push({
'id': attachments[a].id,
'name': attachments[a].title,
'description': attachments[a].description ? attachments[a].description : ''
});
}
}
return images;
......
......@@ -15,7 +15,7 @@
<td>
<a href="{$WWWROOT}view/artefact.php?artefact={$file->attachment}&view={$options.viewid}">{$file->title}</a>
({$file->size|display_size})
- <strong><a href="{$WWWROOT}artefact/file/download.php?file={$file->attachment}">{str tag=Download section=artefact.file}</a></strong>
- <strong><a href="{$WWWROOT}artefact/file/download.php?file={$file->attachment}&view={$options.viewid}">{str tag=Download section=artefact.file}</a></strong>
</td>
</tr>
{/foreach}
......
......@@ -64,7 +64,7 @@ $string['makepublicrequestsubject'] = 'Request to change private comment to publ
$string['makepublicrequestbyauthormessage'] = '%s has requested that you make their comment public.';
$string['makepublicrequestbyownermessage'] = '%s has requested that you make your comment public.';
$string['makepublicrequestsent'] = 'A message has been sent to %s to request that the comment be made public.';
$string['messageempty'] = 'Message is empty. Empty message is only allowed if you attached the file.';
$string['messageempty'] = 'Your message is empty. Please enter a message or attach a file.';
$string['Moderate'] = 'Moderate';
$string['moderatecomments'] = 'Moderate comments';
$string['moderatecommentsdescription'] = 'Comments will remain private until they are approved by you.';
......
......@@ -103,6 +103,21 @@ class PluginArtefactComment extends PluginArtefact {
}
return $artefacts;
}
public static function get_cron() {
return array(
(object)array(
'callfunction' => 'clean_feedback_notifications',
'minute' => '35',
'hour' => '22',
),
);
}
public static function clean_feedback_notifications() {
safe_require('notification', 'internal');
PluginNotificationInternal::clean_notifications(array('feedback'));
}
}
class ArtefactTypeComment extends ArtefactType {
......
......@@ -27,7 +27,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2010031900;
$config->version = 2010100702;
$config->release = '0.0.1';
?>
......@@ -420,7 +420,7 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype {
private static function get_download_link(ArtefactTypeFile $artefact, BlockInstance $instance, $wmp=false) {
return get_config('wwwroot') . 'artefact/file/download.php?file='
. $artefact->get('id') . '&amp;view=' . $instance->get('view')
. $artefact->get('id') . '&view=' . $instance->get('view')
. ($wmp ? '&download=1' : '');
}
......
......@@ -250,6 +250,8 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
});
// $(self.id + '_edit_artefact').value = id; // Changes button text in IE
setNodeAttribute(self.id + '_edit_artefact', 'name', self.id + '_update[' + id + ']');
var tags_control_elem = augment_tags_control(self.id + '_edit_tags', true);
swapDOM($(self.id + '_edit_tags').parentNode.firstChild, tags_control_elem);
var edit_row = removeElement(self.id + '_edit_row');
var this_row = getFirstParentByTagAndClassName(this, 'tr');
insertSiblingNodesAfter(this_row, edit_row);
......
......@@ -674,6 +674,21 @@ abstract class ArtefactType {
}
/**
* A dummy method, giving graceful output, if this method is not implemented in the relevant child class
*/
public function render_self($options) {
$smarty = smarty();
$smarty->assign('viewtitle', $this->get('title'));
$smarty->assign('viewdescription', $this->get('description'));
return array(
'html' => $smarty->fetch('view/viewcontent.tpl'),
'javascript'=>''
);
}
/**
* Returns a URL for an icon for the appropriate artefact
*
......
......@@ -119,7 +119,7 @@ class AuthLdap extends Auth {
$ldap_login = @ldap_bind($ldapconnection, $ldap_user_dn, $password);
ldap_close($ldapconnection);
if ($ldap_login) {
if ($update) {
if ($user->id && $update) {
// Define ldap attributes
$ldapattributes = array();
$ldapattributes['firstname'] = $this->config['firstnamefield'];
......
......@@ -363,6 +363,19 @@ abstract class PluginBlocktype extends Plugin {
return false;
}
/**
* Defines if the title should be linked to an artefact view (if possible)
* when viewing the block
*
* This method should be overridden in the child class, if a title link
* is not desired.
*
* @return boolean whether to link the title or not
*/
public static function has_title_link() {
return true;
}
}
abstract class SystemBlockType extends PluginBlockType {
......@@ -653,8 +666,10 @@ class BlockInstance {
// block to be a link to view more information about that artefact
$configdata = $this->get('configdata');
if (!empty($configdata['artefactid'])) {
$smarty->assign('viewartefacturl', get_config('wwwroot') . 'view/artefact.php?artefact='
. $configdata['artefactid'] . '&view=' . $this->get('view'));
if (call_static_method($classname, 'has_title_link')) {
$smarty->assign('viewartefacturl', get_config('wwwroot') . 'view/artefact.php?artefact='
. $configdata['artefactid'] . '&view=' . $this->get('view'));
}
}
if (method_exists($classname, 'feed_url')) {
......
......@@ -72,16 +72,12 @@ class PluginBlocktypeTextbox extends SystemBlocktype {
public static function instance_config_form($instance) {
$configdata = $instance->get('configdata');
if (!$height = get_config('blockeditorheight')) {
$cfheight = param_integer('cfheight', 0);
$height = $cfheight ? $cfheight * 0.7 : 150;
}
return array(
'text' => array(
'type' => 'wysiwyg',
'title' => get_string('blockcontent', 'blocktype.textbox'),
'width' => '100%',
'height' => $height . 'px',
'height' => '150px',
'defaultvalue' => isset($configdata['text']) ? $configdata['text'] : '',
),
);
......
......@@ -630,7 +630,7 @@ class HtmlExportOutputFilter {
// Links to download files
$html = preg_replace_callback(
'#(?<=[\'"])(' . $wwwroot . ')?/?artefact/file/download\.php\?file=(\d+)((&amp;[a-z]+=[x0-9]+)+)*#',
'#(?<=[\'"])(' . $wwwroot . ')?/?artefact/file/download\.php\?file=(\d+)(?:(?:&amp;|&|%26)([a-z]+=[x0-9]+)+)*#',
array($this, 'replace_download_link'),
$html
);
......@@ -711,12 +711,9 @@ class HtmlExportOutputFilter {
}
$options = array();
if (isset($matches[3])) {
$parts = explode('&amp;', substr($matches[3], 5));
foreach ($parts as $part) {
list($key, $value) = explode('=', $part);
$options[$key] = $value;
}
for ($i = 3; $i < count($matches); $i++) {
list($key, $value) = explode('=', $matches[$i]);
$options[$key] = $value;
}
$folderpath = $this->get_folder_path_for_file($artefact);
......
......@@ -2,7 +2,7 @@
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:leap2="http://terms.leapspecs.org/"
xmlns:categories="http://wiki.leapspecs.org/2A/categories"
xmlns:categories="http://wiki.leapspecs.org/2A/categories/"
xmlns:portfolio="{$WWWROOT}export/leap/{$userid}/{$export_time}/"
xmlns:mahara="http://wiki.mahara.org/Developer_Area/Import%2F%2FExport/LEAP_Extensions#"
>
......
......@@ -345,9 +345,19 @@ EOF;
'callfunction' => 'interaction_forum_new_post',
'minute' => '*/30',
),
(object)array(
'callfunction' => 'clean_forum_notifications',
'minute' => '30',
'hour' => '22',
),
);
}
public static function clean_forum_notifications() {
safe_require('notification', 'internal');
PluginNotificationInternal::clean_notifications(array('newpost'));
}
/**
* Subscribes the forum plugin to events
*
......
......@@ -25,7 +25,7 @@
*
*/
$config->version = 2009111200;
$config->version = 2010100702;
$config->release = '1.2.1';
?>
......@@ -30,6 +30,7 @@ function addFeedbackSuccess(form, data) {
}
$('add_feedback_form_' + messageid).value = '';
rewriteCancelButtons();
formSuccess(form, data);
}
function objectionSuccess() {
......@@ -78,6 +79,8 @@ addLoadEvent(function () {
}
removeElementClass('add_feedback_form', 'js-hidden');
removeElementClass('add_feedback_form', 'hidden');
tinymce.EditorManager.get('add_feedback_form_message').plugins.autoresize.autoresize_min_height = 120;
tinymce.EditorManager.get('add_feedback_form_message').execCommand('mceAutoResize');
// IE6 fails to hide tinymce properly after feedback
// submission, so force it to reload the page by disconnecting
......
......@@ -295,11 +295,6 @@ function ViewManager() {
var contentDiv = getFirstElementByTagAndClassName('div', 'blockinstance-content', blockinstance);
var pd = {'id': $('viewid').value, 'change': 1};
if (config.blockeditormaxwidth) {
// Shouldn't have to pass browser window dimensions here, but can't find
// another way to get tinymce elements to use up the available height.
pd['cfheight'] = getViewportDimensions().h - 100;
}
pd[getNodeAttribute(button, 'name')] = 1;
var oldContent = contentDiv.innerHTML;
......@@ -386,12 +381,9 @@ function ViewManager() {
var vpdim = getViewportDimensions();
var h = Math.max(d.h, 200);
var w = Math.max(d.w, 500);
if (config.blockeditormaxwidth && getFirstElementByTagAndClassName('textarea', 'wysiwyg', newblock)) {
style.width = vpdim.w - 80;
style.height = h;
}
else {
style.width = Math.max(d.w, 500);
w = vpdim.w - 80;
}
var tborder = parseFloat(getStyle(newblock, 'border-top-width'));
......@@ -401,7 +393,8 @@ function ViewManager() {
var lborder = parseFloat(getStyle(newblock, 'border-left-width'));
var lpadding = parseFloat(getStyle(newblock, 'padding-left'));
style.left = ((vpdim.w - style.width) / 2 - lborder - lpadding) + 'px';
style.left = ((vpdim.w - w) / 2 - lborder - lpadding) + 'px';
style.width = w + 'px';
setStyle(newblock, style);
......@@ -1027,9 +1020,6 @@ function ViewManager() {
'change': 1,
'blocktype': getFirstElementByTagAndClassName('input', 'blocktype-radio', self.currentlyMovingObject).value
};
if (config.blockeditormaxwidth) {
pd['cfheight'] = getViewportDimensions().h - 100;
}
pd['action_addblocktype_column_' + whereTo['column'] + '_order_' + whereTo['order']] = true;
sendjsonrequest(config['wwwroot'] + 'view/blocks.json.php', pd, 'POST', function(data) {
var div = DIV();
......
......@@ -223,6 +223,7 @@ $string['changeviewlayout'] = 'Change my View\'s column layout';
$string['backtoyourview'] = 'Back to my View';
$string['viewlayoutchanged'] = 'View layout changed';
$string['numberofcolumns'] = 'Number of columns';
$string['changecolumnlayoutfailed'] = 'Could not change the column layout. Someone else may have been editing the layout at the same time.';
$string['by'] = 'by';
......
......@@ -226,14 +226,10 @@ $cfg->leapovermnetloglevel = 0;
// This should normally be set to http://www.gravatar.com/avatar/
//$cfg->remoteavatarbaseurl = 'http://www.gravatar.com/avatar/';
// Options for width/height of wysiwyg editor in block configuration
// Option for width of wysiwyg editor in block configuration
// forms. Workaround for current lack of tinymce fullscreen button.
//
// Make the block config form expand to the full width of browser window
// whenever it contains a tinymce (also increases editor height in
// textbox blocktype):
// $cfg->blockeditormaxwidth = true;
//
// Set a fixed height in pixels for the tinymce editor (currently only
// affects the textbox blocktype):
// $cfg->blockeditorheight = 550;
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