Пример #1
0
 public static function AttachmentIf($attr, $content)
 {
     $if = array();
     $operator = isset($attr['operator']) ? dcTemplate::getOperator($attr['operator']) : '&&';
     if (isset($attr['is_image'])) {
         $sign = (bool) $attr['is_image'] ? '' : '!';
         $if[] = $sign . '$attach_f->media_image';
     }
     if (isset($attr['has_thumb'])) {
         $sign = (bool) $attr['has_thumb'] ? '' : '!';
         $if[] = $sign . 'isset($attach_f->media_thumb[\'sq\'])';
     }
     if (isset($attr['is_mp3'])) {
         $sign = (bool) $attr['is_mp3'] ? '==' : '!=';
         $if[] = '$attach_f->type ' . $sign . ' "audio/mpeg3"';
     }
     if (isset($attr['is_flv'])) {
         $sign = (bool) $attr['is_flv'] ? '' : '!';
         $if[] = $sign . '($attach_f->type == "video/x-flv" || ' . '$attach_f->type == "video/mp4" || ' . '$attach_f->type == "video/x-m4v")';
     }
     if (count($if) != 0) {
         return '<?php if(' . implode(' ' . $operator . ' ', (array) $if) . ') : ?>' . $content . '<?php endif; ?>';
     } else {
         return $content;
     }
 }
Пример #2
0
 public static function TagIf($attr, $content)
 {
     $if = array();
     $operateur = isset($attr['operator']) ? dcTemplate::getOperator($attr['operator']) : '&&';
     if (isset($attr['has_entries'])) {
         $sign = (bool) $attr['has_entries'] ? '' : '!';
         $if[] = $sign . '$_ctx->meta->count';
     }
     if (!empty($if)) {
         return '<?php if(' . implode(' ' . $operateur . ' ', $if) . ') : ?>' . $content . '<?php endif; ?>';
     } else {
         return $content;
     }
 }
Пример #3
0
 public function getData($________)
 {
     # --BEHAVIOR-- tplBeforeData
     if ($this->core->hasBehavior('tplBeforeData')) {
         self::$_r = $this->core->callBehavior('tplBeforeData', $this->core);
         if (self::$_r) {
             return self::$_r;
         }
     }
     parent::getData($________);
     # --BEHAVIOR-- tplAfterData
     if ($this->core->hasBehavior('tplAfterData')) {
         $this->core->callBehavior('tplAfterData', $this->core, self::$_r);
     }
     return self::$_r;
 }