1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 21:27:25 +02:00

Fixes #2971 List new plugin with PHP 7

This commit is contained in:
Cameron
2018-01-09 10:00:01 -08:00
parent 6e3b2611b3
commit 1f34b4190e

View File

@@ -536,7 +536,12 @@ class list_admin
*/ */
function parseTemplate($template) function parseTemplate($template)
{ {
return preg_replace("/\{(.*?)\}/e", '$this->row[\'\1\']', $this->parent->template[$template]); $text = preg_replace_callback( '/\{(.*?)\}/', function($matches) {
return($this->row[$matches[1]]);
}, $this->parent->template[$template]);
return $text;
//return preg_replace("/\{(.*?)\}/e", '$this->row[\'\1\']', $this->parent->template[$template]);
} }
/** /**
@@ -551,9 +556,10 @@ class list_admin
$frm = e107::getForm(); $frm = e107::getForm();
$this->row['TOPIC'] = LIST_ADMIN_11; $this->row['TOPIC'] = LIST_ADMIN_11;
$this->row['FIELD'] = $frm->admin_button('update_menu',LIST_ADMIN_2,'update'); $this->row['FIELD'] = $frm->admin_button('update_menu',LIST_ADMIN_2,'update');
return "<tr><td class='buttons-bar center' colspan='2'>".$frm->admin_button('update_menu',LIST_ADMIN_2,'update')."</td></tr>"; return "<tr><td class='buttons-bar center' colspan='2'>".$frm->admin_button('update_menu',LIST_ADMIN_2,'update')."</td></tr>";
return $this->parseTemplate('TOPIC_ROW_NOEXPAND'); // return $this->parseTemplate('TOPIC_ROW_NOEXPAND');
} }
} }