Changeset 863:88e1ebd4efa0
- Timestamp:
- 08/03/12 23:22:56 (13 years ago)
- Branch:
- default
- Children:
- 864:73d1af790506, 1025:f86362da37de
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/public/class.dc.template.php
r833 r863 2802 2802 current_mode CDATA #IMPLIED -- tests if current URL mode is the one given in parameter 2803 2803 has_tpl CDATA #IMPLIED -- tests if a named template exists 2804 has_tag CDATA #IMPLIED -- tests if a named template tag exists (see Tag plugin for code)2804 has_tag CDATA #IMPLIED -- tests if a named template block or value exists 2805 2805 blog_id CDATA #IMPLIED -- tests if current blog ID is the one given in parameter 2806 2806 comments_active (0|1) #IMPLIED -- test if comments are enabled blog-wide … … 2856 2856 } 2857 2857 $if[] = $sign."\$core->tpl->getFilePath('".addslashes($attr['has_tpl'])."') !== false"; 2858 } 2859 2860 if (isset($attr['has_tag'])) { 2861 $sign = 'true'; 2862 if (substr($attr['has_tag'],0,1) == '!') { 2863 $sign = 'false'; 2864 $attr['has_tag'] = substr($attr['has_tag'],1); 2865 } 2866 $if[] = "\$core->tpl->tagExists('".addslashes($attr['has_tag'])."') === ".$sign; 2858 2867 } 2859 2868 -
plugins/tags/_public.php
r816 r863 44 44 45 45 $core->addBehavior('templateBeforeBlock',array('behaviorsTags','templateBeforeBlock')); 46 $core->addBehavior('tplSysIfConditions',array('behaviorsTags','tplSysIfConditions'));47 46 $core->addBehavior('publicBeforeDocument',array('behaviorsTags','addTplPath')); 48 47 … … 70 69 "\$params['sql'] .= \"AND META.meta_id = '\".\$core->con->escape(\$_ctx->meta->meta_id).\"' \";\n". 71 70 "} ?>\n"; 72 }73 }74 75 public static function tplSysIfConditions($tag, $attr,$content,$if)76 {77 if ($tag == 'Sys' && isset($attr['has_tag'])) {78 $sign = '';79 if (substr($attr['has_tag'],0,1) == '!') {80 $sign = '!';81 $attr['has_tag'] = substr($attr['has_tag'],1);82 }83 $if[] = $sign."(\$core->tpl->tagExists('".addslashes($attr['has_tag'])."') )";84 71 } 85 72 }
Note: See TracChangeset
for help on using the changeset viewer.