PageRenderTime 41ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/contentmanager/code/trunk/administrator/components/com_contentmanager/libraries/jxtended/form/fields/integers.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 39 lines | 20 code | 4 blank | 15 comment | 1 complexity | 30817c656ce9d00373967706883c9602 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: integers.php 160 2009-07-09 00:06:09Z eddieajau $
  4. * @package JXtended.Libraries
  5. * @subpackage Form
  6. * @copyright Copyright (C) 2008 - 2009 JXtended, LLC. All rights reserved.
  7. * @license GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
  8. * @link http://jxtended.com
  9. */
  10. defined('JPATH_BASE') or die;
  11. jimport('joomla.html.html');
  12. jximport2('jxtended.form.field');
  13. jximport2('jxtended.form.fields.list');
  14. /**
  15. * JXtended Form Field Type Class for a list of integers.
  16. *
  17. * @package JXtended.Libraries
  18. * @subpackage Form
  19. * @version 1.0
  20. */
  21. class JXFieldTypeIntegers extends JXFieldTypeList
  22. {
  23. function _getOptions(&$node)
  24. {
  25. $first = (int) $node->attributes('first');
  26. $last = (int) $node->attributes('last');
  27. $step = (int) max(1, $node->attributes('step'));
  28. $options = array();
  29. for ($i = $first; $i <= $last; $i += $step)
  30. {
  31. $options[] = JHTML::_('select.option', $i);
  32. }
  33. return $options;
  34. }
  35. }