| @@ -574,10 +574,10 @@ discard block | ||
| 574 | 574 | } | 
| 575 | 575 | |
| 576 | 576 | /** | 
| 577 | - * print the static tree with the number of records | |
| 578 | - * | |
| 579 | - * @return string | |
| 580 | - */ | |
| 577 | + * print the static tree with the number of records | |
| 578 | + * | |
| 579 | + * @return string | |
| 580 | + */ | |
| 581 | 581 | public function viewTree() | 
| 582 | 582 |      { | 
| 583 | 583 | global $sids, $PMF_LANG, $plr; | 
| @@ -1225,7 +1225,7 @@ discard block | ||
| 1225 | 1225 | PMF_Db::getTablePrefix(), | 
| 1226 | 1226 | $category_id); | 
| 1227 | 1227 |          if (!$delete_all) { | 
| 1228 | - $query .= " AND lang = '".$category_lang."'"; | |
| 1228 | + $query .= " AND lang = '".$category_lang."'"; | |
| 1229 | 1229 | } | 
| 1230 | 1230 | $this->_config->getDb()->query($query); | 
| 1231 | 1231 | |
| @@ -1249,7 +1249,7 @@ discard block | ||
| 1249 | 1249 | PMF_Db::getTablePrefix(), | 
| 1250 | 1250 | $category_id); | 
| 1251 | 1251 |          if (!$delete_all) { | 
| 1252 | - $query .= " AND category_lang = '".$category_lang."'"; | |
| 1252 | + $query .= " AND category_lang = '".$category_lang."'"; | |
| 1253 | 1253 | } | 
| 1254 | 1254 | $this->_config->getDb()->query($query); | 
| 1255 | 1255 | |
| @@ -1273,7 +1273,7 @@ discard block | ||
| 1273 | 1273 | $translated = array(); | 
| 1274 | 1274 | |
| 1275 | 1275 |          foreach ($existcatlang as $language) { | 
| 1276 | -           $query = sprintf(" | |
| 1276 | +            $query = sprintf(" | |
| 1277 | 1277 | SELECT | 
| 1278 | 1278 | name, description | 
| 1279 | 1279 | FROM | 
| @@ -1282,13 +1282,13 @@ discard block | ||
| 1282 | 1282 | id = %d | 
| 1283 | 1283 | AND | 
| 1284 | 1284 | lang = '%s'", | 
| 1285 | - PMF_Db::getTablePrefix(), | |
| 1286 | - $category_id, | |
| 1287 | - $language); | |
| 1288 | - $result = $this->_config->getDb()->query($query); | |
| 1289 | -           if ($row = $this->_config->getDb()->fetchArray($result)) { | |
| 1290 | -              $translated[$languageCodes[strtoupper($language)]] = $row['name'].('' == $row['description'] ? '' : '  ('.$row['description'].')'); | |
| 1291 | - } | |
| 1285 | + PMF_Db::getTablePrefix(), | |
| 1286 | + $category_id, | |
| 1287 | + $language); | |
| 1288 | + $result = $this->_config->getDb()->query($query); | |
| 1289 | +            if ($row = $this->_config->getDb()->fetchArray($result)) { | |
| 1290 | +                $translated[$languageCodes[strtoupper($language)]] = $row['name'].('' == $row['description'] ? '' : '  ('.$row['description'].')'); | |
| 1291 | + } | |
| 1292 | 1292 | } | 
| 1293 | 1293 | ksort($translated); | 
| 1294 | 1294 | |
| @@ -1342,9 +1342,9 @@ discard block | ||
| 1342 | 1342 | $result = $this->_config->getDb()->query($query); | 
| 1343 | 1343 |          while ($row = $this->_config->getDb()->fetchArray($result)) { | 
| 1344 | 1344 |              if (!array_key_exists($row['id'],$this->categoryName)) { | 
| 1345 | - $this->categoryName[$row['id']] = $row; | |
| 1346 | - $this->categories[] =& $this->categoryName[$row['id']]; | |
| 1347 | - $this->children[$row['parent_id']][$row['id']] =& $this->categoryName[$row['id']]; | |
| 1345 | + $this->categoryName[$row['id']] = $row; | |
| 1346 | + $this->categories[] =& $this->categoryName[$row['id']]; | |
| 1347 | + $this->children[$row['parent_id']][$row['id']] =& $this->categoryName[$row['id']]; | |
| 1348 | 1348 | } | 
| 1349 | 1349 | } | 
| 1350 | 1350 | } | 
| @@ -1540,8 +1540,8 @@ discard block | ||
| 1540 | 1540 | fd.lang = fcr.category_lang | 
| 1541 | 1541 | ORDER BY | 
| 1542 | 1542 | fcr.category_id, fd.id', | 
| 1543 | - PMF_Db::getTablePrefix(), | |
| 1544 | - PMF_Db::getTablePrefix()); | |
| 1543 | + PMF_Db::getTablePrefix(), | |
| 1544 | + PMF_Db::getTablePrefix()); | |
| 1545 | 1545 | $result = $this->_config->getDb()->query($query); | 
| 1546 | 1546 | |
| 1547 | 1547 |          if ($this->_config->getDb()->numRows($result) > 0) { | 
| @@ -232,9 +232,9 @@ discard block | ||
| 232 | 232 | |
| 233 | 233 |          while ($row = $this->_config->getDb()->fetchArray($result)) { | 
| 234 | 234 | $this->categoryName[$row['id']] = $row; | 
| 235 | - $this->categories[] =& $this->categoryName[$row['id']]; | |
| 236 | - $this->children[$row['parent_id']][$row['id']] =& $this->categoryName[$row['id']]; | |
| 237 | - $this->owner[$row['id']] =& $row['user_id']; | |
| 235 | + $this->categories[] = & $this->categoryName[$row['id']]; | |
| 236 | + $this->children[$row['parent_id']][$row['id']] = & $this->categoryName[$row['id']]; | |
| 237 | + $this->owner[$row['id']] = & $row['user_id']; | |
| 238 | 238 | } | 
| 239 | 239 | |
| 240 | 240 | return $this->categories; | 
| @@ -398,8 +398,8 @@ discard block | ||
| 398 | 398 | $symbol = 'minus'; | 
| 399 | 399 |          } else { | 
| 400 | 400 | $temp = isset($this->children[$thisParent_id]) ? array_keys($this->children[$thisParent_id]) : array(); | 
| 401 | -            if (isset($temp[count($temp)-1])) { | |
| 402 | - $symbol = ($id == $temp[count($temp)-1]) ? 'angle' : 'medium'; | |
| 401 | +            if (isset($temp[count($temp) - 1])) { | |
| 402 | + $symbol = ($id == $temp[count($temp) - 1]) ? 'angle' : 'medium'; | |
| 403 | 403 | } | 
| 404 | 404 | } | 
| 405 | 405 | |
| @@ -472,7 +472,7 @@ discard block | ||
| 472 | 472 | $childs = array(); | 
| 473 | 473 | |
| 474 | 474 |          if (isset($this->children[$id])) { | 
| 475 | -            foreach(array_keys($this->children[$id]) as $childId) { | |
| 475 | +            foreach (array_keys($this->children[$id]) as $childId) { | |
| 476 | 476 | $childs = array_merge($childs, array($childId)); | 
| 477 | 477 | $childs = array_merge($childs, $this->getChildNodes($childId)); | 
| 478 | 478 | } | 
| @@ -625,7 +625,7 @@ discard block | ||
| 625 | 625 | $open = 0; | 
| 626 | 626 | $this->expandAll(); | 
| 627 | 627 | |
| 628 | -        for ($y = 0 ;$y < $this->height(); $y = $this->getNextLineTree($y)) { | |
| 628 | +        for ($y = 0; $y < $this->height(); $y = $this->getNextLineTree($y)) { | |
| 629 | 629 | |
| 630 | 630 | list($categoryName, $parent, $description) = $this->getLineDisplay($y); | 
| 631 | 631 | $level = $this->treeTab[$y]['level']; | 
| @@ -667,14 +667,14 @@ discard block | ||
| 667 | 667 | $num_entries = ''; | 
| 668 | 668 |              } else { | 
| 669 | 669 | $totFaqRecords += $number[$parent]; | 
| 670 | -                $num_entries    = '<span class="rssCategoryLink"> ('.$plr->GetMsg('plmsgEntries',$number[$parent]); | |
| 670 | +                $num_entries    = '<span class="rssCategoryLink"> ('.$plr->GetMsg('plmsgEntries', $number[$parent]); | |
| 671 | 671 | $num_entries .= sprintf( | 
| 672 | 672 | ' <a href="feed/category/rss.php?category_id=%d&category_lang=%s" target="_blank"><img id="category_%d_RSS" src="assets/img/feed.png" width="16" height="16" alt="RSS"></a>', | 
| 673 | 673 | $parent, | 
| 674 | 674 | $this->language, | 
| 675 | 675 | $parent | 
| 676 | 676 | ); | 
| 677 | - $num_entries .= ')</span>'; | |
| 677 | + $num_entries .= ')</span>'; | |
| 678 | 678 | } | 
| 679 | 679 | |
| 680 | 680 | $url = sprintf( | 
| @@ -688,7 +688,7 @@ discard block | ||
| 688 | 688 | $oLink->text = $categoryName; | 
| 689 | 689 | $oLink->tooltip = $description; | 
| 690 | 690 | |
| 691 | - $output .= $oLink->toHtmlAnchor() . $num_entries; | |
| 691 | + $output .= $oLink->toHtmlAnchor().$num_entries; | |
| 692 | 692 | $open = $level; | 
| 693 | 693 | } | 
| 694 | 694 | |
| @@ -731,7 +731,7 @@ discard block | ||
| 731 | 731 | return $l + 1; | 
| 732 | 732 |          } else { | 
| 733 | 733 |              for ($i = $l + 1; $i < $this->height(); $i++) { | 
| 734 | -                if ($this->treeTab[$i]["level"]<=$this->treeTab[$l]["level"]) { | |
| 734 | +                if ($this->treeTab[$i]["level"] <= $this->treeTab[$l]["level"]) { | |
| 735 | 735 | return $i; | 
| 736 | 736 | } | 
| 737 | 737 | } | 
| @@ -771,7 +771,7 @@ discard block | ||
| 771 | 771 | ); | 
| 772 | 772 | |
| 773 | 773 | $oLink = new PMF_Link($url, $this->_config); | 
| 774 | - $oLink->id = 'category_' . $categoryId; | |
| 774 | + $oLink->id = 'category_'.$categoryId; | |
| 775 | 775 | $oLink->itemTitle = $categoryName; | 
| 776 | 776 | $oLink->text = $categoryName; | 
| 777 | 777 | |
| @@ -852,7 +852,7 @@ discard block | ||
| 852 | 852 | return sprintf( | 
| 853 | 853 | '<ul class="%s">%s</ul>', | 
| 854 | 854 | $useCssClass, | 
| 855 | -                implode('<li class="divider">' . $separator . '</li>', $temp) | |
| 855 | +                implode('<li class="divider">'.$separator.'</li>', $temp) | |
| 856 | 856 | ); | 
| 857 | 857 |          } else { | 
| 858 | 858 | return implode($separator, $temp); | 
| @@ -1302,7 +1302,7 @@ discard block | ||
| 1302 | 1302 |                  if ($lang == $selected_lang) { | 
| 1303 | 1303 | $output .= " selected=\"selected\""; | 
| 1304 | 1304 | } | 
| 1305 | - $output .= ">".$langname."</option>\n"; | |
| 1305 | + $output .= ">".$langname."</option>\n"; | |
| 1306 | 1306 | } | 
| 1307 | 1307 | } | 
| 1308 | 1308 | |
| @@ -1329,10 +1329,10 @@ discard block | ||
| 1329 | 1329 | $query .= ' ORDER BY id'; | 
| 1330 | 1330 | $result = $this->_config->getDb()->query($query); | 
| 1331 | 1331 |          while ($row = $this->_config->getDb()->fetchArray($result)) { | 
| 1332 | -            if (!array_key_exists($row['id'],$this->categoryName)) { | |
| 1332 | +            if (!array_key_exists($row['id'], $this->categoryName)) { | |
| 1333 | 1333 | $this->categoryName[$row['id']] = $row; | 
| 1334 | - $this->categories[] =& $this->categoryName[$row['id']]; | |
| 1335 | - $this->children[$row['parent_id']][$row['id']] =& $this->categoryName[$row['id']]; | |
| 1334 | + $this->categories[] = & $this->categoryName[$row['id']]; | |
| 1335 | + $this->children[$row['parent_id']][$row['id']] = & $this->categoryName[$row['id']]; | |
| 1336 | 1336 | } | 
| 1337 | 1337 | } | 
| 1338 | 1338 | } |