예제 #1
0
/**
 * setup HTML for server all Engines information
 *
 * @return string
 */
function PMA_getHtmlForAllServerEngines()
{
    /**
     * Displays the table header
     */
    $html = '<table class="noclick">' . "\n" . '<thead>' . "\n" . '<tr><th>' . __('Storage Engine') . '</th>' . "\n" . '    <th>' . __('Description') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n" . '<tbody>' . "\n";
    /**
     * Listing the storage engines
     */
    $odd_row = true;
    foreach (PMA_StorageEngine::getStorageEngines() as $engine => $details) {
        $html .= '<tr class="' . ($odd_row ? 'odd' : 'even') . ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED' ? ' disabled' : '') . ($details['Support'] == 'DEFAULT' ? ' marked' : '') . '">' . "\n" . '    <td><a rel="newpage" href="server_engines.php' . PMA_URL_getCommon(array('engine' => $engine)) . '">' . "\n" . '            ' . htmlspecialchars($details['Engine']) . "\n" . '        </a></td>' . "\n" . '    <td>' . htmlspecialchars($details['Comment']) . '</td>' . "\n" . '</tr>' . "\n";
        $odd_row = !$odd_row;
    }
    unset($odd_row, $engine, $details);
    $html .= '</tbody>' . "\n" . '</table>' . "\n";
    return $html;
}
예제 #2
0
 /**
  * Constructor
  *
  * @param string $engine The engine ID
  */
 function __construct($engine)
 {
     $storage_engines = PMA_StorageEngine::getStorageEngines();
     if (!empty($storage_engines[$engine])) {
         $this->engine = $engine;
         $this->title = $storage_engines[$engine]['Engine'];
         $this->comment = isset($storage_engines[$engine]['Comment']) ? $storage_engines[$engine]['Comment'] : '';
         switch ($storage_engines[$engine]['Support']) {
             case 'DEFAULT':
                 $this->support = PMA_ENGINE_SUPPORT_DEFAULT;
                 break;
             case 'YES':
                 $this->support = PMA_ENGINE_SUPPORT_YES;
                 break;
             case 'DISABLED':
                 $this->support = PMA_ENGINE_SUPPORT_DISABLED;
                 break;
             case 'NO':
             default:
                 $this->support = PMA_ENGINE_SUPPORT_NO;
         }
     }
 }
     * Displays the table header
     */
    echo '<table>' . "\n"
       . '<thead>' . "\n"
       . '<tr><th>' . $strStorageEngine . '</th>' . "\n"
       . '    <th>' . $strDescription . '</th>' . "\n"
       . '</tr>' . "\n"
       . '</thead>' . "\n"
       . '<tbody>' . "\n";


    /**
     * Listing the storage engines
     */
    $odd_row = true;
    foreach (PMA_StorageEngine::getStorageEngines() as $engine => $details) {
        echo '<tr class="'
           . ($odd_row ? 'odd' : 'even')
           . ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED'
                ? ' disabled'
                : '')
           . '">' . "\n"
           . '    <td><a href="./server_engines.php'
           . PMA_generate_common_url(array('engine' => $engine)) . '">' . "\n"
           . '            ' . htmlspecialchars($details['Engine']) . "\n"
           . '        </a></td>' . "\n"
           . '    <td>' . htmlspecialchars($details['Comment']) . '</td>' . "\n"
           . '</tr>' . "\n";
        $odd_row = !$odd_row;
    }
    unset($odd_row, $engine, $details);
 /**
  * Returns true if given engine name is supported/valid, otherwise false
  *
  * @param string $engine name of engine
  *
  * @static
  * @return boolean whether $engine is valid or not
  */
 public static function isValid($engine)
 {
     if ($engine == "PBMS") {
         return true;
     }
     $storage_engines = PMA_StorageEngine::getStorageEngines();
     return isset($storage_engines[$engine]);
 }