Подпись к какртинке - источник. Управление фоторамой с клавиатуры.
This commit is contained in:
parent
667d09305c
commit
035c442a8c
|
|
@ -18,5 +18,16 @@ class PhotoLinks extends Model
|
||||||
$parsedUrl = parse_url($url);
|
$parsedUrl = parse_url($url);
|
||||||
App::DB()->query('INSERT INTO photoLinks VALUES ("'.$photo.'","'.$url.'","'.$parsedUrl['host'].'") ON DUPLICATE KEY UPDATE url=url;');
|
App::DB()->query('INSERT INTO photoLinks VALUES ("'.$photo.'","'.$url.'","'.$parsedUrl['host'].'") ON DUPLICATE KEY UPDATE url=url;');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static function getCaption($photo)
|
||||||
|
{
|
||||||
|
$photolink = self::model()->getOne('photo', $photo);
|
||||||
|
|
||||||
|
if (!$photolink) {
|
||||||
|
return 'не определён';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $photolink->host ? $photolink->host : $photolink->url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<h4 class="modal-title" id="imageModalLabel"></h4>
|
<h4 class="modal-title" id="imageModalLabel"></h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body" style="text-align: center;">
|
<div class="modal-body" style="text-align: center;">
|
||||||
<div class="fotorama" data-loop="true" data-auto="false"></div>
|
<div class="fotorama" data-loop="true" data-auto="false" data-keyboard="true"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -39,13 +39,13 @@
|
||||||
<?php if ($photos || $point->img): ?>
|
<?php if ($photos || $point->img): ?>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<div style="text-align: center;">
|
<div style="text-align: center;">
|
||||||
<div class="dfotorama" data-loop="true" data-nav="thumbs" data-thumbwidth="100">
|
<div class="dfotorama" data-loop="true" data-nav="thumbs" data-thumbwidth="100" data-keyboard="true">
|
||||||
<?php if ($point->img): ?>
|
<?php if ($point->img): ?>
|
||||||
<img data-thumb="<?= $point->img ?>" src="<?= $point->img ?>">
|
<img data-thumb="<?= $point->img ?>" src="<?= $point->img ?>">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($photos): ?>
|
<?php if ($photos): ?>
|
||||||
<?php foreach ($photos as $photo): ?>
|
<?php foreach ($photos as $photo): ?>
|
||||||
<img data-thumb="/photos/small/<?= $photo->name ?>" src="/photos/middle/<?= $photo->name ?>">
|
<img data-thumb="/photos/small/<?= $photo->name ?>" data-caption="Источник: <?= PhotoLinks::getCaption($photo->name)?>" src="/photos/middle/<?= $photo->name ?>">
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<span data-thumb="/img/mapThumb.png">
|
<span data-thumb="/img/mapThumb.png">
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ div.header img {height: 89px;}
|
||||||
div.add {cursor: pointer;}
|
div.add {cursor: pointer;}
|
||||||
|
|
||||||
.fotorama {display: inline-block;}
|
.fotorama {display: inline-block;}
|
||||||
|
.fotorama .fotorama__caption{text-align: left; font-size: 9px; margin-bottom: 17px; opacity: 0.7;}
|
||||||
|
|
||||||
#addPointModal .extraImage .button {cursor: pointer; background-color: #eeeeee;}
|
#addPointModal .extraImage .button {cursor: pointer; background-color: #eeeeee;}
|
||||||
#addPointModal .extraImage .remove:hover {background-color: #f4bfbf;}
|
#addPointModal .extraImage .remove:hover {background-color: #f4bfbf;}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue