Dotclear

Changeset 543


Ignore:
Timestamp:
11/03/08 14:50:39 (15 years ago)
Author:
bruno
google:author:
dsls@morefnu.org
Message:

Added MyMetaListItemValue? tag

Location:
plugins/mymeta
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/mymeta/_define.php

    r459 r543  
    2727     /* Description*/         "User-defined metadata management in posts", 
    2828     /* Author */             "Bruno Hondelatte", 
    29      /* Version */            '0.3', 
     29     /* Version */            '0.3.1', 
    3030     /* Permissions */        'usage,contentadmin', 
    3131     /* Priority */           1001 
  • plugins/mymeta/_public.php

    r459 r543  
    2626$core->tpl->addValue('MyMetaTypePrompt',array('tplMyMeta','MyMetaTypePrompt')); 
    2727$core->tpl->addValue('MyMetaValue',array('tplMyMeta','MyMetaValue')); 
     28$core->tpl->addValue('MyMetaListItemValue',array('tplMyMeta','MyMetaListItemValue')); 
    2829$core->tpl->addValue('MyMetaURL',array('tplMyMeta','MyMetaURL')); 
    2930$core->tpl->addBlock('MyMetaIf',array('tplMyMeta','MyMetaIf')); 
     
    115116          "echo \$objMeta->getMetaStr(\$_ctx->posts->post_meta,'".$type."'); ". 
    116117          '?>'; 
     118          return $res; 
     119     } 
     120     public static function MyMetaListItemValue($attr) { 
     121          if (isset($attr['type'])) 
     122               $type = addslashes($attr['type']); 
     123          else 
     124               return ""; 
     125          $res = 
     126          "<?php\n". 
     127          '$objMeta = new dcMeta($core); '. 
     128          '$objMyMeta = new myMeta($core); '. 
     129          '$theMeta = $objMyMeta->get(\''.$type.'\');'. 
     130          'if ($theMeta->enabled && $theMeta->type == "list") {'. 
     131          '   $value = $objMeta->getMetaStr($_ctx->posts->post_meta,\''.$type.'\'); '. 
     132          '   echo array_search($value,$theMeta->values);'. 
     133          '}?>'; 
    117134          return $res; 
    118135     } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map