Initial commit
This commit is contained in:
45
#pma/templates/list/item.phtml
Normal file
45
#pma/templates/list/item.phtml
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Display item of a list.
|
||||
*
|
||||
* $content - mandatory string - Content to display
|
||||
* $id - optional string - Contains the id of li tag
|
||||
* $class - optional string - Contains the class name(s) of li tag
|
||||
* $mysql_help_page - optional string - Related help page
|
||||
* $url - optional array: - href - optional string - Destination page or anchor
|
||||
* - target - optional string - Target of link
|
||||
* - class - optional string - Class of link
|
||||
* - title - optional string - Title of link
|
||||
*/
|
||||
?>
|
||||
<li <?= !empty($id) ? ' id="' . $id . '"' : null ?>
|
||||
<?= !empty($class) ? ' class="' . $class . '"' : null ?>>
|
||||
|
||||
<?php if (isset($url) && is_array($url) && array_filter($url)) : ?>
|
||||
<a<?= !empty($url['href']) ? ' href="' . $url['href'] . '"' : null ?>
|
||||
<?= !empty($url['target'])
|
||||
? ' target="' . $url['target'] . '"'
|
||||
: null;
|
||||
?>
|
||||
<?= !empty($url['target']) && $url['target'] == '_blank'
|
||||
? ' rel="noopener noreferrer"'
|
||||
: null;
|
||||
?>
|
||||
<?= !empty($url['id']) ? ' id="' . $url['id'] . '"' : null; ?>
|
||||
<?= !empty($url['class'])
|
||||
? ' class="' . $url['class'] . '"'
|
||||
: null;
|
||||
?>
|
||||
<?= !empty($url['title'])
|
||||
? ' title="' . $url['title'] . '"'
|
||||
: null;
|
||||
?>>
|
||||
<?php endif; ?>
|
||||
<?= $content ?>
|
||||
<?php if (isset($url) && is_array($url) && array_filter($url)) : ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($mysql_help_page)): ?>
|
||||
<?= PMA\libraries\Util::showMySQLDocu($mysql_help_page) ?>
|
||||
<?php endif; ?>
|
||||
</li>
|
27
#pma/templates/list/unordered.phtml
Normal file
27
#pma/templates/list/unordered.phtml
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Display unordered list.
|
||||
*
|
||||
* $class - optional string - Contains the class name(s) of ul tag
|
||||
* $id - optional string - Contains the id of ul tag
|
||||
* $item - mandatory string|array - If string, this is the content
|
||||
* - Else, see templates/list/item.phtml
|
||||
* $content - mandatory string - Content to display if $item is empty
|
||||
*/
|
||||
?>
|
||||
<ul<?= !empty($class) ? ' class="' . $class . '"' : null ?>
|
||||
<?= !empty($id) ? ' id="' . $id . '"' : null ?>>
|
||||
|
||||
<?php if (!empty($items)): ?>
|
||||
<?php foreach ($items as $item): ?>
|
||||
<?php if (!is_array($item)): ?>
|
||||
<?php $item = array('content' => $item) ?>
|
||||
<?php endif; ?>
|
||||
<?= PMA\libraries\Template::get('list/item')
|
||||
->render($item)
|
||||
?>
|
||||
<?php endforeach; ?>
|
||||
<?php elseif (!empty($content)): ?>
|
||||
<?= $content ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
Reference in New Issue
Block a user