fork download
  1. <?php
  2. /**
  3.  * Magento
  4.  *
  5.  * NOTICE OF LICENSE
  6.  *
  7.  * This source file is subject to the Academic Free License (AFL 3.0)
  8.  * that is bundled with this package in the file LICENSE_AFL.txt.
  9.  * It is also available through the world-wide-web at this URL:
  10.  * http://o...content-available-to-author-only...e.org/licenses/afl-3.0.php
  11.  * If you did not receive a copy of the license and are unable to
  12.  * obtain it through the world-wide-web, please send an email
  13.  * to license@magentocommerce.com so we can send you a copy immediately.
  14.  *
  15.  * DISCLAIMER
  16.  *
  17.  * Do not edit or add to this file if you wish to upgrade Magento to newer
  18.  * versions in the future. If you wish to customize Magento for your
  19.  * needs please refer to http://w...content-available-to-author-only...e.com for more information.
  20.  *
  21.  * @category design
  22.  * @package base_default
  23.  * @copyright Copyright (c) 2013 Magento Inc. (http://w...content-available-to-author-only...e.com)
  24.  * @license http://o...content-available-to-author-only...e.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  25.  */
  26. ?>
  27. <div class="form-add">
  28. <h2><?php echo $this->__('Write Your Own Review') ?></h2>
  29. <?php if ($this->getAllowWriteReviewFlag()): ?>
  30. <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
  31. <fieldset>
  32. <?php echo $this->getChildHtml('form_fields_before')?>
  33. <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) {
  34. /* Get the customer data */
  35. $customer = Mage::getSingleton('customer/session')->getCustomer();
  36. /* Get the customer's full name */
  37. $fullname = $customer->getName();
  38. /* Get the customer's first name */
  39. $firstname = $customer->getFirstname();
  40. /* Get the customer's location */
  41. //$location = $customer->getLocation();
  42. /* Get the customer's last name */
  43. $lastname = $customer->getLastname();
  44. /* Get the customer's email address */
  45. $email = $customer->getSummary();
  46.  
  47. }?>
  48. <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
  49. <span id="input-message-box"></span>
  50. <table class="data-table" id="product-review-table">
  51. <tbody>
  52. <?php $count = 0; ?>
  53. <?php foreach ($this->getRatings() as $_rating): ?>
  54. <?php if($count == 0): ?>
  55. <tr>
  56. <th>Overall rating</th>
  57. <?php foreach ($_rating->getOptions() as $_option): ?>
  58. <td class="value"><input type="radio" name="ratings[<?php echo $_rating->getId() ?>]" id="<?php echo $this->escapeHtml($_rating->getRatingCode()) ?>_<?php echo $_option->getValue() ?>" value="<?php echo $_option->getId() ?>" class="radio" /></td>
  59. <?php endforeach; ?>
  60. </tr>
  61. <?php else: ?>
  62. <tr style="display: none;">
  63. <th><?php echo $this->escapeHtml($_rating->getRatingCode()) ?></th>
  64. <?php foreach ($_rating->getOptions() as $_option): ?>
  65. <td class="value"><input type="radio" name="ratings[<?php echo $_rating->getId() ?>]" id="<?php echo $this->escapeHtml($_rating->getRatingCode()) ?>_<?php echo $_option->getValue() ?>" value="<?php echo $_option->getId() ?>" class="radio" /></td>
  66. <?php endforeach; ?>
  67. </tr>
  68. <?php endif; ?>
  69. <?php $count++; ?>
  70. <?php endforeach; ?>
  71. </tbody>
  72. </table>
  73. <div class="rating-alert-msg"></div>
  74. <input type="hidden" name="validate_rating" class="validate-rating" value="" />
  75. <script type="text/javascript">decorateTable('product-review-table')</script>
  76. <?php endif; ?>
  77. <ul class="form-list">
  78. <li>
  79. <label for="nickname_field" class="required"><em>*</em><?php echo $this->__('Nickname') ?></label>
  80. <div class="input-box">
  81. <input type="text" name="nickname" id="nickname_field" class="input-text required-entry" value="<?php if($firstname){ echo $firstname; }else{echo $this->escapeHtml($data->getNickname());} ?>" />
  82. </div>
  83. </li>
  84. <li>
  85. <label for="summary_field" class="required"><em>*</em><?php echo $this->__('Email address') ?></label>
  86. <div class="input-box">
  87. <input type="text" name="title" id="summary_field" class="input-text required-entry" value="<?php if($email){echo $email;}else{echo $this->escapeHtml($data->getTitle());} ?>" />
  88. </div>
  89. </li>
  90. <!--<li>
  91. <label for="location_field" class="required"><em>*</em><?php echo $this->__('Location') ?></label>
  92. <div class="input-box">
  93. <input type="text" name="title" id="location_field" class="input-text required-entry" value="<?php //if($location){echo $location;}else{echo $this->escapeHtml($data->getLocation());} ?>" />
  94. </div>
  95. </li>-->
  96. <li>
  97. <label for="review_field" class="required"><em>*</em><?php echo $this->__('Review') ?></label>
  98. <div class="input-box">
  99. <textarea name="detail" id="review_field" cols="5" rows="3" class="required-entry"><?php echo $this->escapeHtml($data->getDetail()) ?></textarea>
  100. </div>
  101. </li>
  102. </ul>
  103. </fieldset>
  104. <div class="buttons-set">
  105. <button type="submit" title="<?php echo $this->__('Submit Review') ?>" class="button"><span><span><?php echo $this->__('Submit Review') ?></span></span></button>
  106. </div>
  107. </form>
  108. <script>
  109. //<![CDATA[
  110. var radio = $$('.radio');
  111. for(var l = 0; l < radio.length; l++){
  112. Event.observe(radio[l], 'click', checkRadio);
  113. }
  114.  
  115. function checkRadio(e){
  116. if(e && e.currentTarget.checked){
  117. document.getElementsByClassName('rating-alert-msg')[0].innerHTML = "";
  118. var table = $('product-review-table');
  119. var tr = table.select('tr');
  120. var td = tr[0].getElementsByTagName('td');
  121. var count = 0;
  122. for(var i = 0; i < td.length; i++){
  123. var input = td[i].getElementsByTagName('input')[0];
  124. console.log(input.checked);
  125. if(input.checked){
  126. count = i;
  127. console.log(count);
  128. }
  129. }
  130. for(var j = 1; j < tr.length; j++){
  131. console.log(tr[j]);
  132. var oTd = tr[j].getElementsByTagName('td');
  133. var input = oTd[count].getElementsByTagName('input')[0];
  134. console.log(input);
  135. input.checked = true;
  136. }
  137. }
  138. }
  139. //]]>
  140. </script>
  141. <script type="text/javascript">
  142. //<![CDATA[
  143.  
  144. var dataForm = new VarienForm('review-form');
  145. Validation.addAllThese(
  146. [
  147. ['validate-rating', '<?php echo $this->__('Please select one of each of the ratings above') ?>', function(v) {
  148. var table = $('product-review-table');
  149. var tr = table.select('tr');
  150. var td = tr[0].getElementsByTagName('td');
  151. var validateRating = false;
  152. for(var i = 0; i < td.length; i++){
  153. var input = td[i].getElementsByTagName('input')[0];
  154. if(input.checked){
  155. validateRating = true;
  156. }
  157. }
  158. if(!validateRating){
  159. document.getElementsByClassName('rating-alert-msg')[0].innerHTML = "Please provide rating above";
  160. }
  161. var trs = $('product-review-table').select('tr');
  162. var inputs;
  163. var error = 1;
  164.  
  165. for( var j=0; j < trs.length; j++ ) {
  166. var tr = trs[j];
  167. if( j > 0 ) {
  168. inputs = tr.select('input');
  169.  
  170. for( i in inputs ) {
  171. if( inputs[i].checked == true ) {
  172. error = 0;
  173. }
  174. }
  175.  
  176. if( error == 1 ) {
  177. return false;
  178. } else {
  179. error = 1;
  180. }
  181. }
  182. }
  183. return true;
  184. }]
  185. ]
  186. );
  187. //]]>
  188. </script>
  189. <?php else: ?>
  190. <p class="review-nologged" id="review-form">
  191. <?php echo $this->__('Only registered users can write reviews. Please, <a href="%s">log in</a> or <a href="%s">register</a>', $this->getLoginLink(), Mage::helper('customer')->getRegisterUrl()) ?>
  192. </p>
  193. <?php endif ?>
  194. </div>
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
<?php
^
Main.java:27: error: <identifier> expected
<div class="form-add">
          ^
Main.java:27: error: illegal start of type
<div class="form-add">
           ^
Main.java:27: error: <identifier> expected
<div class="form-add">
                     ^
Main.java:27: error: ';' expected
<div class="form-add">
                      ^
Main.java:28: error: <identifier> expected
    <h2><?php echo $this->__('Write Your Own Review') ?></h2>
       ^
Main.java:28: error: <identifier> expected
    <h2><?php echo $this->__('Write Your Own Review') ?></h2>
         ^
Main.java:28: error: '(' expected
    <h2><?php echo $this->__('Write Your Own Review') ?></h2>
                   ^
Main.java:28: error: <identifier> expected
    <h2><?php echo $this->__('Write Your Own Review') ?></h2>
                        ^
Main.java:28: error: illegal start of type
    <h2><?php echo $this->__('Write Your Own Review') ?></h2>
                         ^
Main.java:28: error: unclosed character literal
    <h2><?php echo $this->__('Write Your Own Review') ?></h2>
                             ^
Main.java:28: error: ')' expected
    <h2><?php echo $this->__('Write Your Own Review') ?></h2>
                                            ^
Main.java:28: error: unclosed character literal
    <h2><?php echo $this->__('Write Your Own Review') ?></h2>
                                                   ^
Main.java:28: error: illegal start of type
    <h2><?php echo $this->__('Write Your Own Review') ?></h2>
                                                       ^
Main.java:28: error: ';' expected
    <h2><?php echo $this->__('Write Your Own Review') ?></h2>
                                                        ^
Main.java:28: error: illegal start of type
    <h2><?php echo $this->__('Write Your Own Review') ?></h2>
                                                         ^
Main.java:28: error: ';' expected
    <h2><?php echo $this->__('Write Your Own Review') ?></h2>
                                                            ^
Main.java:29: error: <identifier> expected
    <?php if ($this->getAllowWriteReviewFlag()): ?>
     ^
Main.java:29: error: <identifier> expected
    <?php if ($this->getAllowWriteReviewFlag()): ?>
         ^
Main.java:29: error: '(' expected
    <?php if ($this->getAllowWriteReviewFlag()): ?>
          ^
Main.java:29: error: illegal start of type
    <?php if ($this->getAllowWriteReviewFlag()): ?>
             ^
Main.java:29: error: ';' expected
    <?php if ($this->getAllowWriteReviewFlag()): ?>
                   ^
Main.java:29: error: invalid method declaration; return type required
    <?php if ($this->getAllowWriteReviewFlag()): ?>
                     ^
Main.java:29: error: ';' expected
    <?php if ($this->getAllowWriteReviewFlag()): ?>
                                              ^
Main.java:30: error: > expected
    <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
         ^
Main.java:30: error: <identifier> expected
    <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
                ^
Main.java:30: error: illegal start of type
    <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
                 ^
Main.java:30: error: ';' expected
    <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
                                                                 ^
Main.java:30: error: <identifier> expected
    <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
                                                                    ^
Main.java:32: error: illegal start of expression
<?php echo $this->getChildHtml('form_fields_before')?>
^
Main.java:32: error: illegal start of expression
<?php echo $this->getChildHtml('form_fields_before')?>
 ^
Main.java:32: error: : expected
<?php echo $this->getChildHtml('form_fields_before')?>
     ^
Main.java:32: error: ';' expected
<?php echo $this->getChildHtml('form_fields_before')?>
          ^
Main.java:32: error: <identifier> expected
<?php echo $this->getChildHtml('form_fields_before')?>
                ^
Main.java:32: error: illegal start of type
<?php echo $this->getChildHtml('form_fields_before')?>
                 ^
Main.java:32: error: unclosed character literal
<?php echo $this->getChildHtml('form_fields_before')?>
                               ^
Main.java:32: error: unclosed character literal
<?php echo $this->getChildHtml('form_fields_before')?>
                                                  ^
Main.java:32: error: illegal start of type
<?php echo $this->getChildHtml('form_fields_before')?>
                                                     ^
Main.java:32: error: ')' expected
<?php echo $this->getChildHtml('form_fields_before')?>
                                                      ^
Main.java:33: error: ';' expected
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
             ^
Main.java:33: error: <identifier> expected
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                 ^
Main.java:33: error: illegal start of type
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                     ^
Main.java:33: error: ';' expected
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                          ^
Main.java:33: error: invalid method declaration; return type required
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                            ^
Main.java:33: error: unclosed character literal
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                                         ^
Main.java:33: error: illegal start of type
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                                                  ^
Main.java:33: error: ')' expected
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                                                   ^
Main.java:33: error: unclosed character literal
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                                                          ^
Main.java:33: error: illegal start of type
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                                                            ^
Main.java:33: error: <identifier> expected
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                                                             ^
Main.java:33: error: ';' expected
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                                                              ^
Main.java:33: error: illegal start of type
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                                                                        ^
Main.java:33: error: <identifier> expected
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                                                                         ^
Main.java:33: error: ';' expected
            <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
                                                                          ^
Main.java:35: error: ';' expected
                $customer = Mage::getSingleton('customer/session')->getCustomer();
                                ^
Main.java:35: error: unclosed character literal
                $customer = Mage::getSingleton('customer/session')->getCustomer();
                                               ^
Main.java:35: error: ';' expected
                $customer = Mage::getSingleton('customer/session')->getCustomer();
                                                 ^
Main.java:35: error: illegal start of expression
                $customer = Mage::getSingleton('customer/session')->getCustomer();
                                                        ^
Main.java:35: error: unclosed character literal
                $customer = Mage::getSingleton('customer/session')->getCustomer();
                                                                ^
Main.java:37: error: illegal start of expression
                $fullname = $customer->getName();
                                      ^
Main.java:39: error: illegal start of expression
                $firstname = $customer->getFirstname();
                                       ^
Main.java:43: error: illegal start of expression
                $lastname = $customer->getLastname();
                                      ^
Main.java:45: error: illegal start of expression
                $email = $customer->getSummary();
                                   ^
Main.java:47: error: illegal start of type
            }?>
             ^
Main.java:47: error: ';' expected
            }?>
              ^
Main.java:48: error: <identifier> expected
            <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
             ^
Main.java:48: error: <identifier> expected
            <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
                 ^
Main.java:48: error: '(' expected
            <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
                  ^
Main.java:48: error: illegal start of type
            <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
                    ^
Main.java:48: error: ';' expected
            <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
                           ^
Main.java:48: error: invalid method declaration; return type required
            <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
                             ^
Main.java:48: error: ';' expected
            <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
                                         ^
Main.java:49: error: > expected
                <span id="input-message-box"></span>
                     ^
Main.java:49: error: <identifier> expected
                <span id="input-message-box"></span>
                        ^
Main.java:49: error: illegal start of type
                <span id="input-message-box"></span>
                         ^
Main.java:49: error: <identifier> expected
                <span id="input-message-box"></span>
                                            ^
Main.java:49: error: ';' expected
                <span id="input-message-box"></span>
                                             ^
Main.java:49: error: illegal start of type
                <span id="input-message-box"></span>
                                              ^
Main.java:49: error: ';' expected
                <span id="input-message-box"></span>
                                                   ^
Main.java:50: error: > expected
                <table class="data-table" id="product-review-table">
                      ^
Main.java:50: error: illegal start of type
                <table class="data-table" id="product-review-table">
                       ^
Main.java:50: error: <identifier> expected
                <table class="data-table" id="product-review-table">
                            ^
Main.java:50: error: '(' expected
                <table class="data-table" id="product-review-table">
                             ^
Main.java:50: error: <identifier> expected
                <table class="data-table" id="product-review-table">
                                            ^
Main.java:52: error: illegal start of expression
                    <?php $count = 0; ?>
                    ^
Main.java:52: error: illegal start of expression
                    <?php $count = 0; ?>
                     ^
Main.java:52: error: : expected
                    <?php $count = 0; ?>
                         ^
Main.java:52: error: illegal start of type
                    <?php $count = 0; ?>
                                      ^
Main.java:52: error: ';' expected
                    <?php $count = 0; ?>
                                       ^
Main.java:53: error: <identifier> expected
                    <?php foreach ($this->getRatings() as $_rating): ?>
                     ^
Main.java:53: error: <identifier> expected
                    <?php foreach ($this->getRatings() as $_rating): ?>
                                        ^
Main.java:53: error: ';' expected
                    <?php foreach ($this->getRatings() as $_rating): ?>
                                         ^
Main.java:53: error: invalid method declaration; return type required
                    <?php foreach ($this->getRatings() as $_rating): ?>
                                          ^
Main.java:53: error: ';' expected
                    <?php foreach ($this->getRatings() as $_rating): ?>
                                                      ^
Main.java:54: error: <identifier> expected
                        <?php if($count == 0): ?>
                         ^
Main.java:54: error: <identifier> expected
                        <?php if($count == 0): ?>
                             ^
Main.java:54: error: '(' expected
                        <?php if($count == 0): ?>
                              ^
Main.java:54: error: illegal start of type
                        <?php if($count == 0): ?>
                                ^
Main.java:54: error: ';' expected
                        <?php if($count == 0): ?>
                                       ^
Main.java:56: error: illegal start of type
                                <th>Overall rating</th>
                                ^
100 errors
stdout
Standard output is empty