Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
ea894ba6
Commit
ea894ba6
authored
Oct 24, 2007
by
Nigel McNie
Browse files
Removed a bunch of unnecessary methods - get_metadata, file_url etc. for artefacts
parent
3a3cf5e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/blog/lib.php
View file @
ea894ba6
...
...
@@ -461,21 +461,6 @@ class ArtefactTypeBlogPost extends ArtefactType {
}
protected
function
get_metadata
(
$options
=
array
())
{
$data
=
parent
::
get_metadata
(
$options
);
unset
(
$data
[
'description'
]);
unset
(
$data
[
'size'
]);
$data
[
'type'
][
'value'
]
=
get_string
(
$this
->
get
(
'artefacttype'
),
'artefact.blog'
);
$data
[
'attachments'
]
=
array
(
'name'
=>
get_string
(
'attachments'
,
'artefact.blog'
),
'value'
=>
$this
->
count_attachments
()
.
' '
.
get_string
(
'files'
,
'artefact.file'
));
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
;
}
public
static
function
get_icon
(
$id
=
0
)
{
}
...
...
htdocs/artefact/file/lib.php
View file @
ea894ba6
...
...
@@ -676,27 +676,6 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
return
floor
((
$bytes
/
1048576
)
*
10
+
0.5
)
/
10
.
'M'
;
}
private
function
file_url
(
$options
)
{
$result
=
get_config
(
'wwwroot'
)
.
'artefact/file/download.php?file='
.
$this
->
get
(
'id'
);
if
(
isset
(
$options
[
'viewid'
]))
{
$result
.
=
'&view='
.
$options
[
'viewid'
];
}
return
$result
;
}
public
function
linkself
()
{
return
'<a href="'
.
$this
->
file_url
()
.
'">'
.
get_string
(
'download'
,
'artefact.file'
)
.
'</a>'
;
}
protected
function
get_metadata
(
$options
=
array
())
{
$data
=
parent
::
get_metadata
(
$options
);
$data
[
'size'
]
=
array
(
'name'
=>
get_string
(
'size'
,
'artefact.file'
),
'value'
=>
$this
->
get
(
'size'
)
.
' '
.
get_string
(
'bytes'
,
'artefact.file'
));
$data
[
'download'
]
=
array
(
'name'
=>
get_string
(
'download'
,
'artefact.file'
),
'value'
=>
make_link
(
$this
->
file_url
(
$options
)));
return
$data
;
}
public
static
function
get_links
(
$id
)
{
$wwwroot
=
get_config
(
'wwwroot'
);
...
...
@@ -795,13 +774,6 @@ class ArtefactTypeFolder extends ArtefactTypeFileBase {
return
$record
->
id
;
}
protected
function
get_metadata
(
$options
=
array
())
{
$data
=
parent
::
get_metadata
(
$options
);
$data
[
'size'
]
=
array
(
'name'
=>
get_string
(
'size'
,
'artefact.file'
),
'value'
=>
$this
->
count_children
()
.
' '
.
get_string
(
'files'
,
'artefact.file'
));
return
$data
;
}
public
static
function
get_links
(
$id
)
{
$wwwroot
=
get_config
(
'wwwroot'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment