1.9.x
Yannick Warnier 11 years ago
commit b920922e31
  1. 27
      main/inc/lib/plugin.class.php

@ -481,8 +481,9 @@ class Plugin
WHERE variable = 'show_tabs'
AND subkey like 'custom_tab_%'";
$result = Database::query($sql);
$customTabsNum = Database::count_rows($result);
$customTabsNum = Database::num_rows($result);
$tabNum = $customTabsNum + 1;
//Avoid Tab Name Spaces
@ -524,15 +525,15 @@ class Plugin
*/
public function deleteTab($key)
{
$sql = "SELECT * FROM settings_current
WHERE
variable = 'show_tabs' AND
subkey <> '$key'";
$result = Database::query($sql);
$tabs = Database::store_result($result);
$customTabsNum = count($tabs);
//$customTabsNum = Database::count_rows($result);
$resp = false;
$sql = "SELECT *
FROM settings_current
WHERE variable = 'show_tabs'
AND subkey <> '$key'
AND subkey like 'custom_tab_%'
";
$resp = $result = Database::query($sql);
$customTabsNum = Database::num_rows($result);
if (!empty($key)) {
$whereCondition = array(
'variable = ? AND subkey = ?' => array('show_tabs', $key)
@ -540,8 +541,8 @@ class Plugin
$resp = Database::delete('settings_current', $whereCondition);
//if there is more than one tab
//re enumerate them
if ($customTabsNum > 0) {
//reenumerate them
if (!empty($customTabsNum) && $customTabsNum > 0) {
$i = 1;
foreach ($tabs as $row) {
$attributes = array(

Loading…
Cancel
Save