Commit 493e16c9 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files
parents 5e3d1e83 dfc8576e
......@@ -74,6 +74,7 @@ $string['name'] = 'Name';
$string['newattachmentsexceedquota'] = 'The total size of the new files that you have uploaded to this post would exceed your quota. You may be able to save the post if you remove some of the attachments you have just added.';
$string['newblog'] = 'New Blog';
$string['newblogpost'] = 'New Blog Post';
$string['noimageshavebeenattachedtothispost'] = 'No images have been attached to this post. You need to upload or attach an image to the post before you can insert it.';
$string['nofilesattachedtothispost'] = 'No attached files';
$string['noresults'] = 'No results';
$string['postbody'] = 'Body';
......
......@@ -256,7 +256,7 @@ class ArtefactTypeBlog extends ArtefactType {
return $smarty->fetch('artefact:blog:render/blog_renderfull.tpl');
}
protected function get_metadata() {
protected function get_metadata($options = array()) {
$data = parent::get_metadata();
$data['description'] = array('name' => get_string('description'),
'value' => $this->get('description'));
......@@ -264,12 +264,17 @@ class ArtefactTypeBlog extends ArtefactType {
$data['size'] = array('name' => get_string('size'),
'value' => $this->count_children() . ' '
. get_string('posts', 'artefact.blog'));
if (isset($options['viewid']) && artefact_in_view($id = $this->get('id'), $options['viewid'])) {
$data['title']['value'] = '<a href="' . get_config('wwwroot') . 'view/view.php?view=' . $options['viewid'] . '&artefact=' . $id . '">' . $data['title']['value'] . '</a>';
}
return $data;
}
protected function render_metadata($options) {
$smarty = smarty();
$smarty->assign('PROPERTIES', $this->get_metadata());
$smarty->assign('PROPERTIES', $this->get_metadata($options));
return $smarty->fetch('artefact:blog:render/blog_rendermetadata.tpl');
}
......
......@@ -434,6 +434,8 @@ function insertImage() {
var height = form.height.value;
var width = form.width.value;
var align = form.align.value;
// Insert image doesn't work in IE without first focusing the editor:
tinyMCE.execCommand('mceFocus', false, 'mce_editor_0');
tinyMCE.themes['advanced']._insertImage(src, alt, border, hspace, vspace,
width, height, align, '', '', '');
replaceChildNodes('insertimage', null);
......@@ -505,7 +507,7 @@ function imageSelector(src) {
var imageid = imageIdFromSrc(src);
var imagefiles = attachedImageList();
if (imagefiles.length == 0) {
return SPAN({'id':'imageselector'}, {$getstring['noimageshavebeenattachedtothispost']});
return false;
}
else {
var sel = SELECT({'class':'select', 'id':'imageselector'});
......@@ -560,10 +562,15 @@ function blogpostExecCommandHandler(editor_id, elm, command, user_interface, val
switch (command) {
case "mceImage":
a = getSelectedImgAttributes(editor_id);
var sel = imageSelector(a.src);
if (!sel) {
alert({$getstring['noimageshavebeenattachedtothispost']});
return true;
}
var tbody = TBODY(null,
TR(null, TH({'colSpan':2}, LABEL(null,{$getstring['insertimage']}))),
TR(null, TH(null, LABEL(null,{$getstring['name']})),
TD(null, imageSelector(a.src))),
TD(null, sel)),
TR(null, TH(null, LABEL(null,{$getstring['alignment']})),
TD(null, alignSelector(a.align))),
TR(null, TH(null, LABEL(null,{$getstring['dimensions']})),
......
......@@ -301,6 +301,13 @@ MochiKit.Base.update(MochiKit.DOM, {
if (typeof(node) == 'undefined' || node === null) {
return null;
}
// this is a safari childNodes object, avoiding crashes w/ attr
// lookup
if (typeof(node) == "function" &&
typeof(node.length) == "number" &&
!(node instanceof Function)) {
node = im.list(node);
}
if (typeof(node.nodeType) != 'undefined' && node.nodeType > 0) {
return node;
}
......
......@@ -415,11 +415,19 @@ MochiKit.Base.update(MochiKit.Iter, {
/** @id MochiKit.Iter.list */
list: function (iterable) {
// Fast-path for Array and Array-like
var m = MochiKit.Base;
if (typeof(iterable.slice) == 'function') {
var rval;
if (iterable instanceof Array) {
return iterable.slice();
} else if (m.isArrayLike(iterable)) {
return m.concat(iterable);
}
// this is necessary to avoid a Safari crash
if (typeof(iterable) == "function" &&
!(iterable instanceof Function) &&
typeof(iterable.length) == 'number') {
rval = [];
for (var i = 0; i < iterable.length; i++) {
rval.push(iterable[i]);
}
return rval;
}
var self = MochiKit.Iter;
......
......@@ -244,3 +244,15 @@ MochiKit.Base.update(MochiKit.Position, {
return new MochiKit.Style.Coordinates(valueL, valueT);
}
});
MochiKit.Position.__new__ = function (win) {
var m = MochiKit.Base;
this.EXPORT_TAGS = {
':common': this.EXPORT,
':all': m.concat(this.EXPORT, this.EXPORT_OK)
};
m.nameFunctions(this);
};
MochiKit.Position.__new__(this);
\ No newline at end of file
......@@ -424,4 +424,12 @@ function activity_set_defaults($user_id) {
}
function activity_process_queue() {
// stub for cronjob.
}
?>
......@@ -831,12 +831,14 @@
<SENTENCE TEXT="(callfunction, minute, hour, day, month, dayofweek)
VALUES ('rebuild_artefact_parent_cache_dirty', '*', '*', '*', '*', '*')" />
<SENTENCE TEXT="(callfunction, minute, hour, day, month, dayofweek)
VALUES ('rebuild_artefact_parent_cache_complete', '*', '4', '*', '*', '*')" />
VALUES ('rebuild_artefact_parent_cache_complete', '0', '4', '*', '*', '*')" />
<SENTENCE TEXT="(callfunction, minute, hour, day, month, dayofweek)
VALUES ('auth_clean_partial_registrations', '5', '0', '*', '*', '*')"/>
<SENTENCE TEXT="(callfunction, minute, hour, day, month, dayofweek)
VALUES ('auth_handle_account_expiries', '5', '10', '*', '*', '*')"/>
</SENTENCES>
<SENTENCE TEXT="(callfunction, minute, hour, day, month, dayofweek)
VALUES ('activity_process_queue', '*/5', '*', '*', '*', '*')"/>
</SENTENCES>
</STATEMENT>
<STATEMENT NAME="insert template categories" TYPE="insert" TABLE="template_category">
<SENTENCES>
......
......@@ -172,6 +172,15 @@ function xmldb_core_upgrade($oldversion=0) {
execute_sql('UPDATE ' . get_config('dbprefix') . 'usr SET quota=10485760');
}
if ($oldversion < 2007012300) {
// fix up a broken cron entry...
set_field('cron', 'minute', '0', 'callfunction', 'rebuild_artefact_parent_cache_complete');
$c = new StdClass;
$c->callfunction = 'activity_process_queue';
$c->minute = '*/5';
insert_record('cron', $c);
}
return $status;
}
......
......@@ -27,7 +27,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2007011600;
$config->version = 2007012300;
$config->release = '0.4.0';
$config->minupgradefrom = 2006121501;
$config->minupgraderelease = '0.1 (build tag BUILD_20061215)';
......
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