Source for file CssQuery.class.php

Documentation is available at CssQuery.class.php

  1. <?php
  2. /**
  3. * XOAD HTML DOM cssQuery file.
  4. *
  5. * <p>This file defines the {@link XOAD_HTML_DOM_CssQuery} Class.</p>
  6. *
  7. * @author Stanimir Angeloff
  8. *
  9. * @package XOAD
  10. *
  11. * @subpackage XOAD_HTML
  12. *
  13. * @version 0.6.0.0
  14. *
  15. */
  16.  
  17. /**
  18. * Loads the file that defines the base class for {@link XOAD_HTML_DOM_CssQuery}.
  19. */
  20. require_once(XOAD_HTML_BASE . '/classes/DOM/BaseElement.class.php');
  21.  
  22. /**
  23. * XOAD HTML DOM cssQuery Class.
  24. *
  25. * @author Stanimir Angeloff
  26. *
  27. * @package XOAD
  28. *
  29. * @subpackage XOAD_HTML
  30. *
  31. * @version 0.6.0.0
  32. *
  33. */
  34. class XOAD_HTML_DOM_CssQuery extends XOAD_HTML_DOM_BaseElement
  35. {
  36. /**
  37. * Creates a new instance of the {@link XOAD_HTML_DOM_CssQuery} class.
  38. *
  39. * @param string $query String representing the value of
  40. * the cssQuery.
  41. *
  42. * @access public
  43. *
  44. */
  45. function XOAD_HTML_DOM_CssQuery($query)
  46. {
  47. parent::XOAD_HTML_DOM_BaseElement();
  48.  
  49. $this->query = $query;
  50.  
  51. $this->skipKeys[] = 'query';
  52. }
  53.  
  54. /**
  55. * Returns the JavaScript name of the elements.
  56. *
  57. * @access public
  58. *
  59. * @return string The JavaScript name of the elements.
  60. *
  61. */
  62. function getElement()
  63. {
  64. return '__' . md5(uniqid(rand(), true));
  65. }
  66.  
  67. /**
  68. * Returns the JavaScript code of the cssQuery elements.
  69. *
  70. * <p>You should not call this method directly.</p>
  71. *
  72. * @access public
  73. *
  74. * @return string JavaScript source code for the cssQuery elements.
  75. *
  76. * @static
  77. *
  78. */
  79. function process()
  80. {
  81. $element = $this->getElement();
  82.  
  83. $returnValue = $element . 's=cssQuery("' . addslashes($this->query) . '");';
  84.  
  85. $returnValue .= 'for(' . $element . 'sIterator=0;';
  86. $returnValue .= $element . 'sIterator<' . $element . 's.length;';
  87. $returnValue .= $element . 'sIterator++){';
  88. $returnValue .= $element . '=' . $element . 's[' . $element . 'sIterator];';
  89.  
  90. $returnValue .= parent::process($element);
  91.  
  92. $returnValue .= '}';
  93.  
  94. return $returnValue;
  95. }
  96. }
  97. ?>

Documentation generated on Sat, 12 Nov 2005 20:24:00 +0200 by phpDocumentor 1.3.0RC3