diff options
| author | Christian Fowler <spider@viovio.com> | 2009-09-02 16:44:18 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2009-09-02 16:44:18 +0000 |
| commit | 8997af177d1b5218e8f862e884bfd8cf7ddd6383 (patch) | |
| tree | 4fadcf88e925c9d194160577cdffefab63d5dacf | |
| parent | fbca59a4aedbed10a4eb81fd6d2f0e838137be9d (diff) | |
| download | feed-8997af177d1b5218e8f862e884bfd8cf7ddd6383.tar.gz feed-8997af177d1b5218e8f862e884bfd8cf7ddd6383.tar.bz2 feed-8997af177d1b5218e8f862e884bfd8cf7ddd6383.zip | |
add action icon
| -rw-r--r-- | feed_lib.php | 19 | ||||
| -rw-r--r-- | modules/mod_feed.tpl | 2 | ||||
| -rw-r--r-- | templates/center_feed.tpl | 10 |
3 files changed, 18 insertions, 13 deletions
diff --git a/feed_lib.php b/feed_lib.php index d2620a5..68b9b32 100644 --- a/feed_lib.php +++ b/feed_lib.php @@ -14,19 +14,24 @@ function feed_get_actions( $pListHash ) { $conjugationQuery = "SELECT * FROM feed_conjugation"; $overrides = $gBitDb->getAssoc( $conjugationQuery ); - foreach( array_keys( $actions ) as $k ){ + foreach( array_keys( $actions ) as $k ) { if( $content = LibertyContent::getLibertyObject($actions[$k]['content_id']) ) { - $contentType = get_class($content); - - $actions[$k]['real_log'] = BitUser::getDisplayName( empty( $pParams['nolink'] ), $actions[$k] ); + $contentType = $content->getContentType(); + $actions[$k]['real_log'] .= BitUser::getDisplayName( empty( $pParams['nolink'] ), $actions[$k] ).' '; if(!empty($overrides[strtolower($contentType)])){ - $actions[$k]['real_log'] .= $overrides[strtolower($contentType)]['conjugation_phrase']; - if($overrides[strtolower($contentType)]['is_target_linked'] == 't'){ + $actions[$k]['real_log'] .= $overrides[$contentType]['conjugation_phrase']; + if($overrides[$contentType]['is_target_linked'] == 'y'){ $actions[$k]['real_log'] .= ' <a href="'.$content->getDisplayUrl().'">'.$content->getTitle().'</a>'; } + if( !empty( $overrides[$contentType]['feed_icon_url'] ) ) { + $actions[$k]['feed_icon_url'] = $overrides[$contentType]['feed_icon_url']; + } }else{ - $actions[$k]['real_log'] .= ' '.tra( 'edited' ).' <a href="'.$content->getDisplayUrl().'">'.$content->getTitle().'</a>'; + $actions[$k]['real_log'] .= tra( 'edited' ).' <a href="'.$content->getDisplayUrl().'">'.$content->getTitle().'</a>'; } + if( empty( $actions[$k]['feed_icon_url'] ) ) { + $actions[$k]['feed_icon_url'] = FEED_PKG_URL.'icons/pixelmixerbasic/pencil_16.png'; + } } else { unset( $actions[$k] ); } diff --git a/modules/mod_feed.tpl b/modules/mod_feed.tpl index a7001f5..c7513a5 100644 --- a/modules/mod_feed.tpl +++ b/modules/mod_feed.tpl @@ -1,7 +1,7 @@ <div class="span-8" style="margin-top:10px;"> {foreach from=$actions item='action'} <div> - {*{$action.icon}*} {$action.real_log} on {$action.last_modified|date_format} + {if $action.feed_icon_url}<img src="{$action.feed_icon_url}" alt="{$action.conjugation_phrase|escape}" />{/if} {$action.real_log} on {$action.last_modified|date_format} </div> {/foreach} </div> diff --git a/templates/center_feed.tpl b/templates/center_feed.tpl index 696ff0e..38d7852 100644 --- a/templates/center_feed.tpl +++ b/templates/center_feed.tpl @@ -1,7 +1,7 @@ -<div style="margin-top:10px;"> +<ul class="data feed"> {foreach from=$actions item='action'} - <div> - {*{$action.icon}*} {$action.real_log} on {$action.last_modified|date_format} - </div> + <li class="item"> + {if $action.feed_icon_url}<img src="{$action.feed_icon_url}" alt="{$action.conjugation_phrase|escape}" />{/if} {$action.real_log} on {$action.last_modified|date_format} + </li> {/foreach} -</div> +</ul> |
