Пример #1
0
    public static function item_html($testimonial, $apikey = 0, $alt)
    {
        $asset_url = t_paths::service($apikey, 'url');
        $image = empty($testimonial->image) ? '' : "<img src=\"{$asset_url}/" . t_paths::image_dir . "/{$testimonial->image}\"/>";
        $url = empty($testimonial->url) ? '' : 'http://' . $testimonial->url;
        ?>
<div id="t-<?php 
        echo $testimonial->id;
        ?>
" class="t-wrapper tag-<?php 
        echo $testimonial->tag_id;
        ?>
 <?php 
        echo 0 == $alt % 2 ? 'even' : 'odd';
        ?>
">
  <div class="t-details">
    <div class="image"><?php 
        echo $image;
        ?>
</div>
    
    <div class="t-name">
      <span><?php 
        echo $testimonial->name;
        ?>
</span>
    </div>
    <div class="t-position">
      <span><?php 
        echo $testimonial->c_position;
        ?>
</span>
      , <span><?php 
        echo $testimonial->company;
        ?>
</span>
    </div>
    <div class="t-location">
      <span><?php 
        echo $testimonial->location;
        ?>
</span>
    </div>      
    <div class="link">
      <a href="<?php 
        echo $url;
        ?>
"><?php 
        echo $url;
        ?>
</a>
    </div>
  </div>
  
  <div class="t-content">
    <div class="t-rating _<?php 
        echo $testimonial->rating;
        ?>
" title="Rating: <?php 
        echo $testimonial->rating;
        ?>
 stars">&#160;</div>
    <div class="t-body"><?php 
        echo $testimonial->body;
        ?>
</div>
    <div class="t-date"><?php 
        echo common_build::timeago($testimonial->created);
        ?>
</div>
    <div class="t-tag"><span><?php 
        echo $testimonial->tag->name;
        ?>
</span></div>
  </div>
</div>
    <?php 
    }
Пример #2
0
 private function cache_settings($file)
 {
     $keys = array("\n", "\r", "\t");
     # get the html based on theme.
     $wrapper = new View("testimonials/themes/{$this->theme}/wrapper");
     $wrapper->tag_list = t_build::tag_list($this->tags, $this->active_tag);
     $item_html = new View("testimonials/themes/{$this->theme}/item");
     # create the settings javascript file.
     $settings = new View('testimonials/widget_settings');
     $settings->theme = $this->theme;
     $settings->apikey = $this->apikey;
     $settings->asset_url = t_paths::service($this->apikey, 'url');
     $settings->panda_structure = str_replace($keys, '', $wrapper->render());
     $settings->item_html = str_replace($keys, '', $item_html->render());
     file_put_contents($file, $settings->render() . "\n/*" . date('m.d.y g:ia') . "*/");
     return;
 }