Commit 2ef1b708 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Merge commit 'origin/master' into unzip

Conflicts:

	htdocs/artefact/file/theme/raw/form/filelist.tpl
parents f372a1f2 c8ede094
......@@ -32,7 +32,7 @@ define('SECTION_PLUGINNAME', 'blog');
define('SECTION_PAGE', 'new');
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/init.php');
define('TITLE', get_string('newblog','artefact.blog'));
define('TITLE', get_string('newblog','artefact.blog') . ': ' . get_string('blogsettings','artefact.blog'));
require_once('pieforms/pieform.php');
safe_require('artefact', 'blog');
......
{include file="header.tpl"}
<div id="myblogs rel">
<div class="rbuttons">
<a class="btn-add" href="{$WWWROOT}artefact/blog/new/">{str section="artefact.blog" tag="addblog"}</a>
<a class="btn btn-add" href="{$WWWROOT}artefact/blog/new/">{str section="artefact.blog" tag="addblog"}</a>
</div>
{if empty($blogs->data)}
<div>{str tag=youhavenoblogs section=artefact.blog}</div>
......
......@@ -2,9 +2,9 @@
<div id="myblogs rel">
<div class="rbuttons">
<a class="btn-add" href="{$WWWROOT}artefact/blog/post.php?blog={$blog->get('id')}">{str section="artefact.blog" tag="addpost"}</a>
<a class="btn-edit" href="{$WWWROOT}artefact/blog/settings/?id={$blog->get('id')}">{str section="artefact.blog" tag="settings"}</a>
<a class="btn-add" href="{$WWWROOT}artefact/blog/new">{str tag=addblog section=artefact.blog}</a>
<a href="{$WWWROOT}artefact/blog/settings/?id={$blog->get('id')}">{str section="artefact.blog" tag="settings"}</a> |
<a href="{$WWWROOT}artefact/blog/new">{str tag=addblog section=artefact.blog}</a>
<a class="btn btn-add" href="{$WWWROOT}artefact/blog/post.php?blog={$blog->get('id')}">{str section="artefact.blog" tag="addpost"}</a>
</div>
<p>{$blog->get('description')}</p>
......
......@@ -248,9 +248,29 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
}
else if (name[1] == 'delete') {
var id = name[2];
var warn = '';
if (self.filedata[id].attachcount > 0) {
warn += get_string('fileattached', self.filedata[id].attachcount);
}
if (self.filedata[id].viewcount > 0) {
warn += ' ' + get_string('itemappearsinviews', self.filedata[id].viewcount);
}
if (self.filedata[id].artefacttype == 'folder') {
if (self.filedata[id].childcount > 0) {
warn += ' ' + get_string('foldernotempty');
warn += ' ' + get_string('confirmdeletefolderandcontents');
}
else if (warn != '') {
warn += ' ' + get_string('confirmdeletefolder');
}
}
else if (warn != '') {
warn += ' ' + get_string('confirmdeletefile');
}
if (warn != '') {
connect(elem, 'onclick', function (e) {
if (!confirm(get_string('detachfilewarning', self.filedata[id].attachcount))) {
if (!confirm(warn)) {
e.stop();
return false;
}
......
......@@ -40,6 +40,9 @@ $string['copyrightnotice'] = 'Copyright notice';
$string['create'] = 'Create';
$string['Created'] = 'Created';
$string['createfolder'] = 'Create folder';
$string['confirmdeletefile'] = 'Are you sure you want to delete this file?';
$string['confirmdeletefolder'] = 'Are you sure you want to delete this folder?';
$string['confirmdeletefolderandcontents'] = 'Are you sure you want to delete this folder and all its contents?';
$string['customagreement'] = 'Custom Agreement';
$string['Date'] = 'Date';
$string['defaultagreement'] = 'Default Agreement';
......@@ -49,16 +52,16 @@ $string['deletefile?'] = 'Are you sure you want to delete this file?';
$string['deletefolder?'] = 'Are you sure you want to delete this folder?';
$string['Description'] = 'Description';
$string['destination'] = 'Destination';
$string['detachfilewarning'] = 'If you delete this file, it will be detached from %s other item(s) in your portfolio.';
$string['Download'] = 'Download';
$string['downloadfile'] = 'Download %s';
$string['downloadoriginalversion'] = 'Download the original version';
$string['editfile'] = 'Edit file';
$string['editfolder'] = 'Edit folder';
$string['emptyfolder'] = 'Empty folder';
$string['file'] = 'file';
$string['file'] = 'File'; // Capitalised to be consistent with names of all the other artefact types
$string['File'] = 'File';
$string['filealreadyindestination'] = 'The file you moved is already in that folder';
$string['fileattached'] = 'This file is attached to %s other item(s) in your portfolio.';
$string['files'] = 'files';
$string['Files'] = 'Files';
$string['fileexists'] = 'File exists';
......@@ -72,6 +75,7 @@ $string['filewithnameexists'] = 'A file or folder with the name "%s" already exi
$string['folder'] = 'Folder';
$string['Folder'] = 'Folder';
$string['Folders'] = 'Folders';
$string['foldernotempty'] = 'This folder is not empty.';
$string['foldercreated'] = 'Folder created';
$string['foldernamerequired'] = 'Please provide a name for the new folder.';
$string['gotofolder'] = 'Go to %s';
......@@ -80,6 +84,7 @@ $string['home'] = 'Home';
$string['htmlremovedmessage'] = 'You are viewing <strong>%s</strong> by <a href="%s">%s</a>. The file displayed below has been filtered to remove malicious content, and is only a rough representation of the original.';
$string['htmlremovedmessagenoowner'] = 'You are viewing <strong>%s</strong>. The file displayed below has been filtered to remove malicious content, and is only a rough representation of the original.';
$string['image'] = 'Image';
$string['itemappearsinviews'] = 'This item appears in %s of your views.';
$string['lastmodified'] = 'Last Modified';
$string['myfiles'] = 'My Files';
$string['Name'] = 'Name';
......
......@@ -119,11 +119,16 @@ class PluginArtefactFile extends PluginArtefact {
'remove',
),
'artefact.file' => array(
'detachfilewarning',
'confirmdeletefile',
'confirmdeletefolder',
'confirmdeletefolderandcontents',
'editfile',
'editfolder',
'fileattached',
'filewithnameexists',
'foldernamerequired',
'foldernotempty',
'itemappearsinviews',
'nametoolong',
'namefieldisrequired',
'uploadingfiletofolder',
......@@ -277,11 +282,12 @@ abstract class ArtefactTypeFileBase extends ArtefactType {
$select = '
SELECT
a.id, a.artefacttype, a.mtime, f.size, a.title, a.description,
COUNT(c.id) AS childcount, COUNT (aa.artefact) AS attachcount';
COUNT(DISTINCT c.id) AS childcount, COUNT (DISTINCT aa.artefact) AS attachcount, COUNT(DISTINCT va.view) AS viewcount';
$from = '
FROM {artefact} a
LEFT OUTER JOIN {artefact_file_files} f ON f.artefact = a.id
LEFT OUTER JOIN {artefact} c ON c.parent = a.id
LEFT OUTER JOIN {view_artefact} va ON va.artefact = a.id
LEFT OUTER JOIN {artefact_attachment} aa ON aa.attachment = a.id';
if (!empty($filters['artefacttype'])) {
......@@ -1207,6 +1213,7 @@ class ArtefactTypeFolder extends ArtefactTypeFileBase {
$f = new ArtefactTypeFolder(0, $data);
$f->commit();
$folderid = $f->get('id');
return $folderid;
}
return $folders[0]->id;
}
......
......@@ -40,8 +40,8 @@
<td>{$file->mtime}</td>
<td>
{if $editable && !$file->isparent}
{if !isset($file->can_edit) || $file->can_edit !== 0}<input type="submit" class="submit btn-edit s" name="{$prefix}_edit[{$file->id}]" value="{str tag=edit}" />{/if}
{if $file->childcount == 0}<input type="submit" class="submit btn-del s" name="{$prefix}_delete[{$file->id}]" value="{str tag=delete}" />{/if}
{if !isset($file->can_edit) || $file->can_edit !== 0}<input type="submit" class="submit btn-edit s" name="{$prefix}_edit[{$file->id}]" value="{str tag=edit}" />
<input type="submit" class="submit btn-del s" name="{$prefix}_delete[{$file->id}]" value="{str tag=delete}" />{/if}
{if $file->artefacttype == 'archive'}<a href="{$WWWROOT}artefact/file/extract.php?file={$file->id}">{str tag=Unzip section=artefact.file}</a>{/if}
{/if}
{if $selectable && $file->artefacttype != 'folder' && $publishable}
......
......@@ -3,7 +3,7 @@
<h2>{str tag="nameplural" section=interaction.forum}</h2>
{if $admin}
<div id="forumbtns" class="rbuttons">
<a href="{$WWWROOT}interaction/edit.php?group={$groupid|escape}&amp;plugin=forum" class="btn-add">{str tag="newforum" section=interaction.forum}</a>
<a href="{$WWWROOT}interaction/edit.php?group={$groupid|escape}&amp;plugin=forum" class="btn btn-add">{str tag="newforum" section=interaction.forum}</a>
</div>
{/if}
<div class="forummods">
......
......@@ -5,9 +5,9 @@
{if $membership}
<div id="forumbtns" class="rbuttons">
{if $topic->canedit}
<a href="{$WWWROOT}interaction/forum/edittopic.php?id={$topic->id|escape}" class="btn-edittopic s">{str tag=edittopic section=interaction.forum}</a>
<a href="{$WWWROOT}interaction/forum/edittopic.php?id={$topic->id|escape}" class="btn btn-edittopic s">{str tag=edittopic section=interaction.forum}</a>
{if $moderator}
<a href="{$WWWROOT}interaction/forum/deletetopic.php?id={$topic->id|escape}" class="btn-deletetopic s">{str tag=deletetopic section=interaction.forum}</a>
<a href="{$WWWROOT}interaction/forum/deletetopic.php?id={$topic->id|escape}" class="btn btn-deletetopic s">{str tag=deletetopic section=interaction.forum}</a>
{/if}
{/if}
{if !$topic->forumsubscribed}
......
......@@ -3,8 +3,8 @@
<h2>{$subheading|escape}</h2>
<div id="forumbtns" class="rbuttons">
{if $admin}
<a href="{$WWWROOT}interaction/edit.php?id={$forum->id|escape}" class="btn-editforum">{str tag="edittitle" section="interaction.forum"}</a>
<a href="{$WWWROOT}interaction/delete.php?id={$forum->id|escape}" class="btn-deleteforum">{str tag="deleteforum" section="interaction.forum"}</a>
<a href="{$WWWROOT}interaction/edit.php?id={$forum->id|escape}" class="btn btn-editforum">{str tag="edittitle" section="interaction.forum"}</a>
<a href="{$WWWROOT}interaction/delete.php?id={$forum->id|escape}" class="btn btn-deleteforum">{str tag="deleteforum" section="interaction.forum"}</a>
{/if}
{$forum->subscribe}
</div>
......@@ -13,7 +13,7 @@
<h3>{str tag=Topics section="interaction.forum"}</h3>
{if $membership && ($moderator || $forum->newtopicusers != 'moderators') }
<div class="rbuttons">
<a href="{$WWWROOT}interaction/forum/edittopic.php?forum={$forum->id|escape}" class="btn-add s">{str tag="newtopic" section="interaction.forum}</a>
<a href="{$WWWROOT}interaction/forum/edittopic.php?forum={$forum->id|escape}" class="btn btn-add s">{str tag="newtopic" section="interaction.forum}</a>
</div>
{/if}
{if $stickytopics || $regulartopics}
......
......@@ -347,7 +347,8 @@ EOF;
}
// Include rtl.css for right-to-left langs
if (get_string('thisdirection', 'langconfig') == 'rtl') {
$langdirection = get_string('thisdirection', 'langconfig');
if ($langdirection == 'rtl') {
if ($rtlsheets = $THEME->get_url('style/rtl.css', true)) {
$stylesheets = array_merge($stylesheets, array_reverse($rtlsheets));
}
......@@ -513,11 +514,12 @@ EOF;
// Place all sideblocks on the right. If this structure is munged
// appropriately, you can put blocks on the left. In future versions of
// Mahara, we'll make it easy to do this.
$tmp = $SIDEBLOCKS;
$SIDEBLOCKS = array(
'left' => array(),
'right' => $tmp,
);
if ($langdirection == 'rtl') {
$SIDEBLOCKS = array('left' => $SIDEBLOCKS, 'right' => array());
}
else {
$SIDEBLOCKS = array('left' => array(), 'right' => $SIDEBLOCKS);
}
$smarty->assign('userauthinstance', $SESSION->get('authinstance'));
$smarty->assign('MNETUSER', $SESSION->get('mnetuser'));
......
......@@ -128,7 +128,7 @@ input[type=file] {
input.submit,
input.button,
button,*/
div.rbuttons a {
div.rbuttons a.btn {
border-color: #d5ed8a #496000 #496000 #d5ed8a;
background-color: #92b328;
border-style: solid;
......@@ -136,7 +136,7 @@ div.rbuttons a {
color: #FFF;
cursor: pointer;
}
div.rbuttons a:hover {
div.rbuttons a.btn:hover {
text-decoration: none;
}
......
......@@ -351,7 +351,6 @@ div.rbuttons {
position: absolute;
right: 0;
top: 0;
font-weight: bold;
}
* html div.rbuttons {
right: 2em;
......@@ -364,12 +363,13 @@ div.rbuttons {
.listing .rel .rbuttons {
top: 0;
}
.rbuttons a {
.rbuttons a.btn {
border: 1px solid #D1D1D1;
margin: 0 0.25em;
padding: 0.25em 0.5em;
background: #eee;
line-height: 2em;
font-weight: bold;
}
.listing .rbuttons a {
font-size: 1em;
......
{include file="header.tpl"}
{if $tags}
<div class="rbuttons"><a href="{$WWWROOT}tags.php">{str tag=mytags}</a></div>
<div class="rbuttons"><a class="btn" href="{$WWWROOT}tags.php">{str tag=mytags}</a></div>
<div class="edittags mytags">
<div>{str tag=selectatagtoedit}:</div>
{foreach from=$tags item=t}
......
{include file="header.tpl"}
<div class="rbuttons">
<a href="{$WWWROOT}group/create.php" class="btn-link">{str tag="creategroup" section="group"}</a>
<a href="{$WWWROOT}group/create.php" class="btn">{str tag="creategroup" section="group"}</a>
</div>
{$form}
{if $groups}
......
{include file="header.tpl"}
{if $tags}
<div class="rbuttons"><a href="{$WWWROOT}edittags.php">{str tag=edittags}</a></div>
<div class="rbuttons"><a class="btn" href="{$WWWROOT}edittags.php">{str tag=edittags}</a></div>
<ul class="in-page-tabs">
{foreach from=$tagsortoptions key=tagsortfield item=selectedsort name=tagsortoptions}
<li><a href="{$WWWROOT}tags.php?ts={$tagsortfield}" class="tag-sort{if $selectedsort} current-tab{/if}">{str tag=sort$tagsortfield}</a></li>
......@@ -18,7 +18,7 @@
<div id="results_container" class="rel tag-results">
<h2 id="results_heading">{str tag=searchresultsfor} <a class="tag" href="{$WWWROOT}tags.php{if $tag}?tag={$tag|urlencode}{/if}">{if $tag}{$tag|str_shorten_text:50|escape}{else}{str tag=alltags}{/if}</a></h2>
<div class="rbuttons"><a class="edit-tag{if !$tag} hidden{/if}" href="{$WWWROOT}edittags.php?tag={$tag|urlencode}">{str tag=editthistag}</a></div>
<div class="rbuttons"><a class="btn edit-tag{if !$tag} hidden{/if}" href="{$WWWROOT}edittags.php?tag={$tag|urlencode}">{str tag=editthistag}</a></div>
<div id="results_sort">{str tag=sortresultsby}
{foreach from=$results->sortcols item=sortfield name=sortcols}
<a href="{$results->baseurl}&type={$results->filter}&sort={$sortfield}"{if $results->sort == $sortfield} class="selected"{/if}>{str tag=$sortfield}</a>{if !$smarty.foreach.sortcols.last} | {/if}
......
Supports Markdown
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