Changeset 922:74e3b2ee29f3
- Timestamp:
- 10/27/12 15:11:14 (13 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/tags/_public.php
r904 r922 23 23 $core->tpl->addBlock('TagsFooter',array('tplTags','TagsFooter')); 24 24 $core->tpl->addBlock('EntryTags',array('tplTags','EntryTags')); 25 $core->tpl->addBlock('TagIf',array('tplTags','TagIf')); 25 26 $core->tpl->addValue('TagID',array('tplTags','TagID')); 27 $core->tpl->addValue('TagCount',array('tplTags','TagCount')); 26 28 $core->tpl->addValue('TagPercent',array('tplTags','TagPercent')); 27 29 $core->tpl->addValue('TagRoundPercent',array('tplTags','TagRoundPercent')); … … 153 155 return $res; 154 156 } 155 157 158 public static function TagIf($attr,$content) 159 { 160 $if = array(); 161 $operateur = isset($attr['operator']) ? dcTemplate::getOperator($attr['operator']) : '&&'; 162 163 if (isset($attr['has_entries'])) { 164 $sign = (boolean) $attr['has_entries'] ? '' : '!'; 165 $if[] = $sign.'$_ctx->meta->count'; 166 } 167 168 if (!empty($if)) { 169 return '<?php if('.implode(' '.$operateur.' ',$if).') : ?>'.$content.'<?php endif; ?>'; 170 } else { 171 return $content; 172 } 173 } 174 156 175 public static function TagID($attr) 157 176 { … … 160 179 } 161 180 181 public static function TagCount($attr) 182 { 183 return '<?php echo $_ctx->meta->count; ?>'; 184 } 185 162 186 public static function TagPercent($attr) 163 187 {
Note: See TracChangeset
for help on using the changeset viewer.