Esempio n. 1
0
 public static function prepareEntityData($entity)
 {
     sfLoader::loadHelpers(array("Asset", "Url"));
     $primary_ext = @$entity["primary_ext"] ? $entity["primary_ext"] : (strpos($entity["url"], "person") === false ? "Org" : "Person");
     $entity["primary_ext"] = $primary_ext;
     if (@$entity["image"] && strpos(@$entity["image"], "netmap") === false && strpos(@$entity["image"], "anon") === false) {
         $image_path = $entity["image"];
     } elseif (@$entity["filename"]) {
         $image_path = image_path(ImageTable::getPath($entity['filename'], 'profile'));
     } else {
         $image_path = $primary_ext == "Person" ? image_path("system/netmap-person.png") : image_path("system/netmap-org.png");
     }
     try {
         $url = url_for(EntityTable::generateRoute($entity));
     } catch (Exception $e) {
         $url = 'http://littlesis.org/' . strtolower($primary_ext) . '/' . $entity['id'] . '/' . LsSlug::convertNameToSlug($entity['name']);
     }
     if (@$entity["blurb"]) {
         $description = $entity["blurb"];
     } else {
         $description = @$entity["description"];
     }
     return array("id" => self::integerize(@$entity["id"]), "name" => $entity["name"], "image" => $image_path, "url" => $url, "description" => $description, "x" => @$entity["x"], "y" => @$entity["y"], "fixed" => true);
 }
Esempio n. 2
0
    echo link_to('search', 'http://google.com/images?q=' . urlencode($entity['name']), 'target=_blank');
    ?>
    </td>
    
    <td>
      <?php 
    echo entity_link($entity);
    ?>
    </td>
    
    <td>
      <?php 
    if ($image = $entity['Image'][0]['filename']) {
        ?>
        <?php 
        echo link_to(image_tag(ImageTable::getPath($image, 'profile'), array('alt' => '', 'style' => 'height: 80px; border: 0;')), EntityTable::getInternalUrl($entity));
        ?>
      <?php 
    }
    ?>
    </td>

    <td>
      <?php 
    echo $entity['summary'];
    ?>
    </td>
    
  </tr>
    <?php 
    $row++;
Esempio n. 3
0
<?php 
$col = -1;
?>
  <tr>
<?php 
foreach ($entities as $entity) {
    ?>
  <?php 
    if ($col == 4) {
        ?>
  </tr>
  <tr>
  <?php 
    }
    ?>
    <td style="vertical-align: top; text-align: center; padding: 0.8em; padding-bottom: 1.2em;">
      <?php 
    echo link_to(image_tag(ImageTable::getPath($entity['Image'][0]['filename'], 'profile'), array('alt' => '', 'style' => 'height: 100px; border: 0;')), EntityTable::getInternalUrl($entity));
    ?>
      <br />
      <br />
      <?php 
    echo entity_link($entity, null);
    ?>
    </td>
  <?php 
    $col = ($col + 1) % 5;
}
?>
  </tr>
</table>
Esempio n. 4
0
<?php

use_helper('LsText');
?>

<?php 
if ($entity) {
    ?>
<div class="entity-carousel">
  <div class="entity-carousel-image" style="background-image: url(<?php 
    echo image_path(ImageTable::getPath($entity['image_path'], 'square'));
    ?>
);">
  </div>

  <div class="entity-carousel-text">
    <?php 
    echo entity_link($entity, 'entity-carousel-name');
    ?>
<br />
  
    <?php 
    if ($entity['blurb']) {
        ?>
      <span class="entity-carousel-description"><?php 
        echo $entity['blurb'];
        ?>
<br /></span>
    <?php 
    }
    ?>
 function downloadLarge($filename)
 {
     $url = ImageTable::generateS3Url(ImageTable::getPath($filename, 'large'));
     return $this->downloadToTmp($url, $filename);
 }
Esempio n. 6
0
" style="position: absolute; top: 0; right: 0; display: none; height: 16px; width: 16px;">
    <div style="background-color: #fff;">
      <?php 
echo image_tag('system/edit-pencil.png');
?>
    </div>
  </a>
<?php 
$image = EntityTable::getProfileImageById($entity['id']);
if ($image) {
    ?>
	<?php 
    echo link_to(image_tag(ImageTable::getPath($image, 'profile'), array('alt' => '')), EntityTable::getInternalUrl($entity, 'images'));
    ?>
  <?php 
    slot('share_image', ImageTable::getPath($image, 'profile'));
} else {
    ?>
  <?php 
    $file = $entity['primary_ext'] == 'Person' ? 'anon.png' : 'anons.png';
    ?>
	<?php 
    echo link_to(image_tag('system' . DIRECTORY_SEPARATOR . $file, array('alt' => 'Upload Image')), EntityTable::getInternalUrl($entity, 'uploadImage'));
}
?>

<?php 
if ($image['caption']) {
    ?>
  <div class="image_caption"><?php 
    echo $image['caption'];
Esempio n. 7
0
 public function getSmallPath()
 {
     return ImageTable::getPath($this, 'small');
 }