Changeset 1381 for plugins

Show
Ignore:
Timestamp:
11/29/08 08:10:03 (6 weeks ago)
Author:
MattRead
Message:

plugin:blogroll add back the xfn_relationships output for rel=""

Location:
plugins/blogroll/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • plugins/blogroll/trunk/blogroll.plugin.php

    r1379 r1381  
    316316        } 
    317317    } 
    318  
     318     
     319    public function filter_post_xfn_relationships( $relationships, Post $post ) 
     320    { 
     321        if ($post->content_type == Post::type(self::CONTENT_TYPE)) { 
     322            $rel = array($relationships); 
     323            foreach( $this->info_fields as $info_field ) { 
     324                if (strpos($info_field, 'xfn_') === 0 && $post->info->$info_field){ 
     325                    if (is_array($post->info->$info_field)) { 
     326                        $rel = array_merge($rel, $post->info->$info_field); 
     327                    } 
     328                    else { 
     329                        $rel[] = $post->info->$info_field; 
     330                    } 
     331                } 
     332            } 
     333            return implode(' ', $rel); 
     334        } 
     335    } 
     336     
    319337    public static function get_info_from_url( $url ) 
    320338    { 
     
    427445    } 
    428446 
    429     public function filter_habminbar( $menu ) 
     447    public function filter_habminbar( array $menu ) 
    430448    { 
    431449        $menu['blogroll']= array( 'Blogroll', URL::get( 'admin', 'page=publish&content_type='.self::CONTENT_TYPE ) ); 
     
    487505    } 
    488506 
    489     public function filter_import_names( $import_names ) 
     507    public function filter_import_names( array $import_names ) 
    490508    { 
    491509        return array_merge( $import_names, array(_t('BlogRoll OPML file', 'blogroll')) ); 
  • plugins/blogroll/trunk/templates/blogroll.php

    r1357 r1381  
    44    <ul> 
    55    <?php if ( ! empty( $blogs ) ) { foreach( $blogs as $blog ) { ?> 
    6         <li class="vcard"><a href="<?php echo $blog->info->url; ?>" class="url" title="<?php echo $blog->content; ?>" rel="<?php echo $blog->info->relationships; ?>"><?php echo $blog->title; ?></a></li> 
     6        <li class="vcard"><a href="<?php echo $blog->info->url; ?>" class="url" title="<?php echo $blog->content; ?>" rel="<?php echo $blog->info->relationship; ?> <?php echo $blog->xfn_relationships; ?>"><?php echo $blog->title; ?></a></li> 
    77    <?php } } ?> 
    88    </ul>