Пример #1
0
echo sprintf($data['l10n_midcom']->get('edit %s'), $data['l10n']->get('slideshow'));
?>
</h1>

<input type="file" multiple="multiple" id="upload_field" />
<input type="button" id="reverse" value="<?php 
echo $data['l10n']->get('reverse order');
?>
" />

<div id="item_container">
<?php 
foreach ($data['images'] as $image) {
    try {
        $attachment = new midcom_db_attachment($image->thumbnail);
        $url = midcom_db_attachment::get_url($attachment);
        $original = new midcom_db_attachment($image->attachment);
        $name = $original->name;
    } catch (midcom_error $e) {
        $url = MIDCOM_STATIC_URL . '/stock-icons/mime/gnome-text-blank.png';
        $name = $data['l10n']->get('attachment missing');
    }
    ?>
    <div class="entry existing-entry" id="image-&(image.guid);">
      <div class="thumbnail">
        <img src="&(url);" alt="&(name);" />
      </div>
      <div class="details">
        <span class="controls">
          <span class="action image-delete"></span>
          <span class="action image-cancel-delete"></span>
Пример #2
0
 /**
  * Synchronizes the attachments info array with the attachment referenced by the
  * identifier.
  *
  * @param mixed $identifier The identifier of the attachment to update
  */
 protected function _update_attachment_info($identifier)
 {
     // Shortcuts
     $att = $this->attachments[$identifier];
     $stats = $att->stat();
     $info = array();
     $info['filename'] = $att->name;
     $info['description'] = $att->title;
     $info['mimetype'] = $att->mimetype;
     $info['url'] = midcom_db_attachment::get_url($att);
     $info['id'] = $att->id;
     $info['guid'] = $att->guid;
     $info['filesize'] = $stats[7];
     $info['formattedsize'] = midcom_helper_misc::filesize_to_string($stats[7]);
     $info['lastmod'] = $stats[9];
     $info['isoformattedlastmod'] = strftime('%Y-%m-%d %T', $stats[9]);
     $this->_update_attachment_info_additional($info, $att);
     $info['object'] = $this->attachments[$identifier];
     $info['identifier'] = $identifier;
     $this->attachments_info[$identifier] = $info;
 }
Пример #3
0
<?php

$nap = new midcom_helper_nav();
?>
<ul class="slideshow-subfolders">
<?php 
foreach ($data['subfolders'] as $i => $folder) {
    $napdata = $nap->get_node($folder->id);
    echo '<li>';
    echo '<a href="' . $napdata[MIDCOM_NAV_ABSOLUTEURL] . '">';
    if (null !== $data['thumbnails'][$i]) {
        $thumbnail = new midcom_db_attachment($data['thumbnails'][$i]->thumbnail);
        echo '<img src="' . midcom_db_attachment::get_url($thumbnail) . '" alt="' . $folder->title . '"/>';
    }
    echo '<span class="subfolder-title">' . $folder->extra . "</span>\n";
    echo "</a>\n";
    echo "</li>\n";
}
?>
</ul>