PageRenderTime 56ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/pdf/code/trunk/administrator/components/com_artofpdf/helpers/artofpdf.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 62 lines | 25 code | 5 blank | 32 comment | 2 complexity | e2230dfb338426c36a96fb19d9f69208 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: artofpdf.php 320 2010-10-18 01:03:30Z eddieajau $
  4. * @package NewLifeInIT
  5. * @subpackage com_artofpdf
  6. * @copyright Copyright 2010 New Life in IT Pty Ltd. All rights reserved.
  7. * @license GNU General Public License version 2 or later.
  8. * @link http://www.theartofjoomla.com
  9. */
  10. // No direct access
  11. defined('_JEXEC') or die;
  12. /**
  13. * ArtofPdf display helper.
  14. *
  15. * @package NewLifeInIT
  16. * @subpackage com_artofpdf
  17. * @since 1.0
  18. */
  19. class ArtofPdfHelper
  20. {
  21. /**
  22. * Configure the Linkbar.
  23. *
  24. * @param string The name of the active view.
  25. *
  26. * @return void
  27. * @since 1.6
  28. */
  29. public static function addSubmenu($vName)
  30. {
  31. JSubMenuHelper::addEntry(
  32. JText::_('COM_ARTOFPDF_PDFS_SUBMENU'),
  33. 'index.php?option=com_artofpdf&view=pdfs',
  34. $vName == 'pdfs'
  35. );
  36. }
  37. /**
  38. * Get any pdf directives from content keywords.
  39. *
  40. * @param string $keywords The meta keywords for the content.
  41. *
  42. * @return array
  43. * @since 1.0.1
  44. */
  45. public function getDirectives($keywords)
  46. {
  47. $result = array();
  48. $words = preg_split('#\s*,\s*#', $keywords);
  49. foreach ($words as $word)
  50. {
  51. if (preg_match('#^pdf-(.*)#i', $word, $m)) {
  52. $result[] = $m[1];
  53. }
  54. }
  55. return $result;
  56. }
  57. }