Don't like ads? PRO users don't see any ads ;-)

gg, goods in list

By: hobocta on May 2nd, 2012  |  syntax: JavaScript  |  size: 2.88 KB  |  hits: 42  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $f_AdminButtons
  2. ";
  3.  
  4. // Если это первая выводимая запись выводим информацию
  5. if ($RowNum == 0) {
  6.         $result .= "
  7.                 <div class='categoryTitle'>
  8.         ";
  9.                 if (isset($current_cc[Sub_Class_Settings][img_mini][path])) {
  10.                         $result .= "<img src='".$current_cc[Sub_Class_Settings][img_mini][path]."' alt='' />";
  11.                 }
  12.         $result .= "
  13.                         <h2 ".opt($current_cc[Sub_Class_Settings][show] == "on", "class='active'").">
  14.                                 <span>$current_cc[Sub_Class_Name]</span>
  15.                         </h2>
  16.                 </div>
  17.                 <div class='itemWrapp'>
  18.         ";
  19. }
  20. // Отличается ли прошлый класс нагрузки от нынешнего?
  21. $f_scope_compare = "";
  22. if (isset($f_scope_rec)) {
  23.         $f_scope_compare1 = array_diff($f_scope_rec, $f_scope_id);
  24.         $f_scope_compare2 = array_diff($f_scope_id, $f_scope_rec);
  25. }
  26. // Если у текущего товара есть отличие от прошлого в классе нагрузки или областях применения, то выводим новые шапку (с классом и областью)
  27. if ($f_load_class_rec != $f_load_class_id || $f_scope_compare1 || $f_scope_compare2) {
  28.         if ($current_cc[Sub_Class_Settings][noLoadClass] != 'on' ) {
  29.                 $result .= "
  30.                         <div class='features'>
  31.                                 <div class='class class-$f_load_class_id'>$f_load_class</div>
  32.                                 ";
  33.                                 $scope_html = "";
  34.                                 if ($f_scope) {
  35.                                         foreach ($f_scope as $scope_val) {
  36.                                                 $scope_html .= "
  37.                                                         <li>
  38.                                                                 — $scope_val
  39.                                                         </li>
  40.                                                 ";
  41.                                         }
  42.                                         if ($scope_html) {
  43.                                                 $scope_html = "<ul>".$scope_html."</ul>";
  44.                                         }
  45.                                 }
  46.                                 $result .= "
  47.                                 ".opt($scope_html, $scope_html)."
  48.                         </div>
  49.                 ";
  50.         }
  51. }
  52. $result .= "
  53.                         <table class='item'>
  54.                                 <tbody>
  55.                                         <tr>
  56.                                                 <td class='itemPhoto'>
  57.                                                         ";
  58.                                                         // Если оригинал меньше по размеру чем превью, выводим оригинал (т. к. он не растянут)
  59.                                                         $Image_size = getimagesize ($DOCUMENT_ROOT.$f_Image);
  60.                                                         $Preview_size = getimagesize ($DOCUMENT_ROOT.$f_Preview);
  61.                                                         $result .= "
  62.                                                         <a href='$fullLink'>
  63.                                                                 <img src='".opt_case($Image_size[0] < $Preview_size[0], $f_Image, $f_Preview)."' width='200' alt='$f_Name' border='0'>
  64.                                                         </a>
  65.                                                 </td>
  66.                                                 <td>
  67.                                                         <p class='title'>
  68.                                                                 <a href='$fullLink'>$f_Name</a>
  69.                                                         </p>
  70.                                                         <div class='table'>$f_t</div>
  71.                                                 </td>
  72.                                         </tr>
  73.                                 </tbody>
  74.                         </table>
  75. ";
  76. // Если это последний товар, закрываем блок, открытый при первом проходе
  77. if ($RowNum == ($totRows - 1)) {
  78.         $result .= "
  79.                 </div>
  80.         ";
  81. }
  82.  
  83. // Записываем класс нагрузки и область применения для сравнения при следующем проходе
  84. $f_load_class_rec = $f_load_class_id;
  85. $f_scope_rec = $f_scope_id;
  86.  
  87. $result .= "
  88. ".opt($RowNum++, "")."