PageRenderTime 88ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/administrator/components/com_widgetkit/plugins/widgets/switcher/views/widget.php

https://gitlab.com/vnsoftdev/amms
PHP | 61 lines | 45 code | 14 blank | 2 comment | 13 complexity | f2631d6b22a3cbc967ed8cca4226daac MD5 | raw file
Possible License(s): LGPL-2.1, GPL-3.0, GPL-2.0
  1. <?php
  2. // Id
  3. $settings['id'] = substr(uniqid(), -3);
  4. // Width
  5. $nav_width = 'uk-width-medium-' . $settings['width'];
  6. switch ($settings['width']) {
  7. case '1-5':
  8. $content_width = '4-5';
  9. break;
  10. case '1-4':
  11. $content_width = '3-4';
  12. break;
  13. case '3-10':
  14. $content_width = '7-10';
  15. break;
  16. case '1-3':
  17. $content_width = '2-3';
  18. break;
  19. case '2-5':
  20. $content_width = '3-5';
  21. break;
  22. case '1-2':
  23. $content_width = '1-2';
  24. break;
  25. }
  26. $content_width = 'uk-width-medium-' . $content_width;
  27. ?>
  28. <?php if ($settings['position'] == 'top' || $settings['position'] == 'bottom') : ?>
  29. <div<?php if ($settings['class']) echo ' class="' . $settings['class'] . '"'; ?>>
  30. <?php if ($settings['position'] == 'top') : ?>
  31. <?php echo $this->render('plugins/widgets/' . $widget->getConfig('name') . '/views/_nav.php', compact('items', 'settings')); ?>
  32. <?php endif ?>
  33. <?php echo $this->render('plugins/widgets/' . $widget->getConfig('name') . '/views/_content.php', compact('items', 'settings')); ?>
  34. <?php if ($settings['position'] == 'bottom') : ?>
  35. <?php echo $this->render('plugins/widgets/' . $widget->getConfig('name') . '/views/_nav.php', compact('items', 'settings')); ?>
  36. <?php endif ?>
  37. </div>
  38. <?php else : ?>
  39. <div class="uk-grid uk-grid-match <?php echo $settings['class']; ?>" data-uk-grid-match="{target:'> div > ul'}" data-uk-grid-margin>
  40. <div class="<?php echo $nav_width ?><?php if ($settings['position'] == 'right') echo ' uk-float-right uk-flex-order-last-medium' ?>">
  41. <?php echo $this->render('plugins/widgets/' . $widget->getConfig('name') . '/views/_nav.php', compact('items', 'settings')); ?>
  42. </div>
  43. <div class="<?php echo $content_width ?>">
  44. <?php echo $this->render('plugins/widgets/' . $widget->getConfig('name') . '/views/_content.php', compact('items', 'settings')); ?>
  45. </div>
  46. </div>
  47. <?php endif ?>