Skip to content

Commit

Permalink
Preprocess data in entry like in table and list
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianheine committed Mar 18, 2010
1 parent 684798b commit 77d8842
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions syntax/entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,20 @@ function render($format, &$renderer, $data) {
* Output the data in a table
*/
function _showData($data,&$R){
global $ID;
$ret = '';

$data['classes'] .= ' ' . $R->startSectionEdit($data['pos'], 'plugin_data');
$ret .= '<div class="inline dataplugin_entry '.$data['classes'].'"><dl>';
foreach($data['data'] as $key => $val){
if($val == '' || !count($val)) continue;
switch ($data['cols'][$key]['type']) {
case 'pageid':
$data['cols'][$key]['type'] = 'title';
case 'wiki':
$val = $ID . '|' . $val;
break;
}

$ret .= '<dt class="' . hsc($key) . '">'.hsc($data['cols'][$key]['title']).'<span class="sep">: </span></dt>';
if(is_array($val)){
Expand Down

0 comments on commit 77d8842

Please sign in to comment.