From d529672a314e188d9effdc14a30c37a990f80ebe Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Sun, 4 Aug 2013 17:05:20 +0200 Subject: Some changes to the way reviews work - custom styles! --- lib/list/inc_process.php | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'lib/list/inc_process.php') diff --git a/lib/list/inc_process.php b/lib/list/inc_process.php index d4656b5..0c7dd82 100644 --- a/lib/list/inc_process.php +++ b/lib/list/inc_process.php @@ -1,16 +1,28 @@ array(), "items" => array()); - - $columns = explode('|', $models); - foreach ($columns as $c) { - if ($c[0] == '!') { - $data['columns'][] = array("question" => false, "name" => substr($c, 1)); - } else { - $data['columns'][] = array("question" => true, "name" => $c); + global $list_models; + + $data = array("columns" => array(), "items" => array(), "questions" => array()); + + if ($models[0] == '*') { + $model = $list_models[substr($models, 1)]; + + $columns = $data['columns'] = $model['columns']; + $data['questions'] = $model['questions']; + } else { + $columns = explode('|', $models); + + foreach ($columns as $k => $c) { + if ($c[0] == '!') { + $data['columns'][] = substr($c, 1); + } else { + $data['columns'][] = $c; + $data['questions'][] = array('col' => $k); + } } } -- cgit v1.2.3