ORIENT/modules/cms/widgets/assetlist/partials/_items.htm

61 lines
2.8 KiB
HTML
Raw Normal View History

2014-08-12 22:01:18 +00:00
<?php
2014-05-14 13:24:20 +00:00
$searchMode = $this->isSearchMode();
2014-08-12 22:01:18 +00:00
if (($upPath = $this->getUpPath()) !== null && !$searchMode):
2014-05-14 13:24:20 +00:00
?>
<p class="parent">
<a href="<?= $upPath ?>" data-path="<?= $upPath ?>" class="link"><?= $this->getCurrentRelativePath() ?></a>
</p>
<?php endif ?>
<div class="list-container animate">
<?php if ($items): ?>
<ul class="list">
<?php foreach ($items as $item):
$dataId = 'asset-'.$this->theme->getDirName().'-'.ltrim($item->path, '/');
?>
<li class="<?= $item->type ?>" <?php if ($item->editable): ?>data-editable<?php endif ?> data-item-path="<?= e(ltrim($item->path, '/')) ?>" data-item-theme="<?= e($this->theme->getDirName()) ?>" data-item-type="asset" data-id="<?= e($dataId) ?>">
<a class="link" target="_blank" data-path="<?= $item->path ?>" href="<?= $this->getThemeFileUrl($item->path) ?>">
<?= e($item->name) ?>
<?php if ($searchMode): ?>
<span class="description">
<?= e(dirname($item->path)) ?>
</span>
<?php endif ?>
</a>
<div class="controls">
2014-08-12 22:01:18 +00:00
<a
2014-05-14 13:24:20 +00:00
href="javascript:;"
class="control icon btn-primary oc-icon-terminal"
2014-08-12 22:01:18 +00:00
title="Rename"
2014-05-14 13:24:20 +00:00
data-control="popup"
data-request-data="renamePath: '<?= e($item->path) ?>'"
data-handler="<?= $this->getEventHandler('onLoadRenamePopup') ?>"
><?= e(trans('cms::lang.asset.rename')) ?></a>
2014-05-14 13:24:20 +00:00
</div>
<input type="hidden" name="file[<?= e($item->path) ?>]" value="0"/>
<div class="checkbox custom-checkbox nolabel">
<?php $cbId = 'cb'.md5($item->path) ?>
<input
2014-08-12 22:01:18 +00:00
id="<?= $cbId ?>"
2014-05-14 13:24:20 +00:00
type="checkbox"
2014-08-12 22:01:18 +00:00
name="file[<?= e($item->path) ?>]"
2014-05-14 13:24:20 +00:00
<?= $this->isFileSelected($item) ? 'checked' : null ?>
data-request="<?= $this->getEventHandler('onSelect') ?>"
value="1">
2014-08-12 22:01:18 +00:00
<label for="<?= $cbId ?>"><?= e(trans('cms::lang.asset.select')) ?></label>
2014-05-14 13:24:20 +00:00
</div>
</li>
<?php endforeach ?>
</ul>
<?php else: ?>
2014-08-12 22:01:18 +00:00
<p class="no-data"><?= e(trans($this->noRecordsMessage)) ?></p>
2014-05-14 13:24:20 +00:00
<?php endif ?>
</div>
<?php if (!isset($nested)): ?>
<input type="hidden" name="theme" value="<?= e($this->theme->getDirName()) ?>">
<?php endif ?>