| 1 |
<?php |
| 2 |
/** |
| 3 |
* |
| 4 |
*/ |
| 5 |
|
| 6 |
/** |
| 7 |
* No direct access. |
| 8 |
*/ |
| 9 |
defined('ABSPATH') or die("Access denied"); |
| 10 |
|
| 11 |
// Allow view to enqueue scripts and styles. |
| 12 |
$this->enqueueScripts(); |
| 13 |
$this->enqueueStyles(); |
| 14 |
$this->suppressPrintScriptsHook(); |
| 15 |
?> |
| 16 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 17 |
<head> |
| 18 |
<?php wp_print_head_scripts() ?> |
| 19 |
<?php wp_print_styles() ?> |
| 20 |
</head> |
| 21 |
<body> |
| 22 |
<div id="cjtoolbox_popup"> |
| 23 |
<form id="templates-lookup" class="cjt-form"> |
| 24 |
<?php if (empty($this->items)) : ?> |
| 25 |
|
| 26 |
<?php else : ?> |
| 27 |
<div id="templates-list"> |
| 28 |
<?php foreach ($this->items as $type => $authors) : ?> |
| 29 |
<h3 id="#templates-type-header-<?php echo $type ?>"><a href="#"><?php echo cssJSToolbox::getText($type) ?></a></h3> |
| 30 |
<div id="#templates-type-content-<?php echo $type ?>" class="templates-list"> |
| 31 |
<ul class="authors-list"> |
| 32 |
<?php |
| 33 |
foreach ($authors as $author => $templates) : |
| 34 |
$authorIdentifier ="{$type}_" . str_replace(array(' ', '-', '_'), '', $author); |
| 35 |
?> |
| 36 |
<li> |
| 37 |
<span class="author-name"><?php echo cssJSToolbox::getText('User') ?>: <a class="name" href="#<?php echo "{$authorIdentifier}" ?>"><?php echo $author ?></a></span> |
| 38 |
<ul id="<?php echo "{$authorIdentifier}" ?>-author-templates" class="templates"> |
| 39 |
<?php foreach ($templates as $id => $template) : ?> |
| 40 |
<li class="template-item"> |
| 41 |
<div class="title" title="<?php echo $template->description ?>"><?php echo $template->name ?></div> |
| 42 |
<span class="options"> |
| 43 |
<a href="#embedded(<?php echo $id ?>)" class="template-action"><?php echo cssJSToolbox::getText('Embed') ?></a> |
| 44 |
<?php if ($template->linked) : ?> |
| 45 |
| <a href="#unlink(<?php echo $id ?>)" class="template-action unlink-template"><?php echo cssJSToolbox::getText('Unlink') ?></a> |
| 46 |
<?php else : ?> |
| 47 |
| <a href="#link(<?php echo $id ?>)" class="template-action link-template"><?php echo cssJSToolbox::getText('Link') ?></a> |
| 48 |
<?php endif; ?> |
| 49 |
<?php if (!$template->systemTemplate) : // Allow editing noo-system templates only ?> |
| 50 |
| <a href="#edit(<?php echo $id ?>)" class="template-action edit-template"><?php echo cssJSToolbox::getText('Edit') ?></a> |
| 51 |
<?php endif; ?> |
| 52 |
</span> |
| 53 |
</li> |
| 54 |
<?php endforeach; ?> |
| 55 |
</ul> |
| 56 |
</li> |
| 57 |
<?php endforeach; ?> |
| 58 |
</ul> |
| 59 |
</div> |
| 60 |
<?php endforeach; ?> |
| 61 |
</div> |
| 62 |
<?php endif; ?> |
| 63 |
</form> |
| 64 |
<div class="sweep"> |
| 65 |
<span class="wrap"> |
| 66 |
<span class="filters-title"><?php echo cssJSToolbox::getText('Show') ?>: </span> |
| 67 |
<span class="filters"> |
| 68 |
<a href="#linked"><?php echo cssJSToolbox::getText('Linked') ?></a> | |
| 69 |
<a href="#unlinked"><?php echo cssJSToolbox::getText('Unlinked') ?></a> | |
| 70 |
<a href="#all" class="active"><?php echo cssJSToolbox::getText('All') ?></a> |
| 71 |
</span> |
| 72 |
</span> |
| 73 |
<span class="actions"> |
| 74 |
<a href="#unlink-all"><?php echo cssJSToolbox::getText('Unlink All') ?></a> |
| 75 |
</span> |
| 76 |
</div> |
| 77 |
</div> |
| 78 |
<?php wp_print_footer_scripts() ?> |
| 79 |
</body> |
| 80 |
</html> |