Пример #1
0
    if (preg_match('/\\([0-9]\\)|\\([.]{3}\\)/i', $message)) {
        $actor = $templates->botCommandForm($command, '', '!' . $command);
    } else {
        $actor = $templates->botCommandButton($command, '!' . $command, 'default btn-block');
    }
    if (array_key_exists($command, $commandPriceIni)) {
        if (intval($commandPriceIni[$command]) < 1 || intval($commandPriceIni[$command]) > 1) {
            $price = $commandPriceIni[$command] . ' ' . $pointNames[0];
        } else {
            $price = $commandPriceIni[$command] . ' ' . $pointNames[1];
        }
    } else {
        $price = '0 ' . $pointNames[0];
    }
    if (array_key_exists($command, $commandCooldown)) {
        $cooldown = $functions->secondsToTime(intval($commandCooldown[$command]));
    } else {
        $cooldown = $functions->secondsToTime(0);
    }
    $customCommandsTableRows .= '<tr>' . $templates->addTooltip('<td class="command-actor">' . $actor . '</td>', '<span class="message ' . $msgClass . '">' . $message . '</span>', ['position' => \PBPanel\Util\ComponentTemplates::TOOLTIP_POS_RIGHT, 'offsetY' => strlen($message) < 50 ? 17 : (strlen($message) > 90 ? -17 : 0)]) . '<td>' . '<span class="text-muted">Group:</span>&nbsp;' . $perm . '<br />' . '<span class="text-muted">Price:</span>&nbsp;' . $price . '<br />' . '<span class="text-muted">Cooldown:</span>&nbsp;' . $cooldown . '</td>' . '<td>' . join(', ', $commandAliases) . '</td>' . '<td class="actions">' . $templates->botCommandButton('delcom ' . $command, '<span class="fa fa-trash"></span>', 'danger', 'Are you sure you want to delete !' . $command . '?', true) . '</td>' . '</tr>';
}
array_walk($commandPermIni, function ($value) use($defaultCommands) {
    $defaultCommands[] = str_replace('_recursive', '', $value);
});
$defaultCommands = array_unique(array_merge($defaultCommands, array_keys($commandPriceIni), array_values($commandAliasIni), array_keys($commandCooldown)));
sort($defaultCommands);
foreach ($defaultCommands as $command) {
    if (array_key_exists($command, $commandAliasIni) || array_key_exists($command, $customCommandsIni)) {
        continue;
    }
    $commandAliases = [];
Пример #2
0
}
if (array_key_exists('time', $filter)) {
    if ($filter['time'] == 'ASC') {
        asort($time, SORT_NATURAL);
    }
    if ($filter['time'] == 'DESC') {
        arsort($time, SORT_NATURAL);
    }
}
if (array_key_exists('username', $filter)) {
    if ($filter['username'] == 'DESC') {
        krsort($time, SORT_NATURAL);
    }
}
foreach ($time as $username => $amount) {
    $timeTableRows .= '<tr><td>' . ucfirst($username) . '</td><td>' . $functions->secondsToTime($amount) . '</td></tr>';
}
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Time System
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('timeSystem.js'));
?>
      </h3>
    </div>