Commit 6cd67623 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Remove pass by reference at call time in artefact chooser

parent 640cdce0
...@@ -126,7 +126,7 @@ class PluginBlocktypeFiledownload extends PluginBlocktype { ...@@ -126,7 +126,7 @@ class PluginBlocktypeFiledownload extends PluginBlocktype {
* artefactchooser element data before it's templated * artefactchooser element data before it's templated
*/ */
public static function artefactchooser_get_element_data($artefact) { public static function artefactchooser_get_element_data($artefact) {
return ArtefactTypeFileBase::artefactchooser_get_file_data(&$artefact); return ArtefactTypeFileBase::artefactchooser_get_file_data($artefact);
} }
} }
......
...@@ -105,7 +105,7 @@ class PluginBlocktypeFolder extends PluginBlocktype { ...@@ -105,7 +105,7 @@ class PluginBlocktypeFolder extends PluginBlocktype {
* artefactchooser element data before it's templated * artefactchooser element data before it's templated
*/ */
public static function artefactchooser_get_element_data($artefact) { public static function artefactchooser_get_element_data($artefact) {
$folderdata = ArtefactTypeFileBase::artefactchooser_folder_data(&$artefact); $folderdata = ArtefactTypeFileBase::artefactchooser_folder_data($artefact);
$artefact->icon = call_static_method(generate_artefact_class_name($artefact->artefacttype), 'get_icon', array('id' => $artefact->id)); $artefact->icon = call_static_method(generate_artefact_class_name($artefact->artefacttype), 'get_icon', array('id' => $artefact->id));
$artefact->hovertitle = $artefact->description; $artefact->hovertitle = $artefact->description;
......
...@@ -126,7 +126,7 @@ class PluginBlocktypeImage extends PluginBlocktype { ...@@ -126,7 +126,7 @@ class PluginBlocktypeImage extends PluginBlocktype {
* artefactchooser element data before it's templated * artefactchooser element data before it's templated
*/ */
public static function artefactchooser_get_element_data($artefact) { public static function artefactchooser_get_element_data($artefact) {
return ArtefactTypeFileBase::artefactchooser_get_file_data(&$artefact); return ArtefactTypeFileBase::artefactchooser_get_file_data($artefact);
} }
} }
......
...@@ -598,7 +598,7 @@ JAVASCRIPT; ...@@ -598,7 +598,7 @@ JAVASCRIPT;
} }
} }
$folderdata = self::artefactchooser_folder_data(&$artefact); $folderdata = self::artefactchooser_folder_data($artefact);
if ($artefact->artefacttype == 'profileicon') { if ($artefact->artefacttype == 'profileicon') {
$artefact->description = str_shorten($artefact->title, 30); $artefact->description = str_shorten($artefact->title, 30);
...@@ -611,7 +611,7 @@ JAVASCRIPT; ...@@ -611,7 +611,7 @@ JAVASCRIPT;
return $artefact; return $artefact;
} }
public static function artefactchooser_folder_data($artefact) { public static function artefactchooser_folder_data(&$artefact) {
// Grab data about all folders the artefact owner has, so we // Grab data about all folders the artefact owner has, so we
// can make full paths to them, and show the artefact owner if // can make full paths to them, and show the artefact owner if
// it's a group or institution. // it's a group or institution.
...@@ -644,7 +644,7 @@ JAVASCRIPT; ...@@ -644,7 +644,7 @@ JAVASCRIPT;
* Works out a full path to a folder, given an ID. Implemented this way so * Works out a full path to a folder, given an ID. Implemented this way so
* only one query is made. * only one query is made.
*/ */
public static function get_full_path($id, $folderdata) { public static function get_full_path($id, &$folderdata) {
$path = ''; $path = '';
while (!empty($id)) { while (!empty($id)) {
$path = $folderdata[$id]->title . '/' . $path; $path = $folderdata[$id]->title . '/' . $path;
......
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