当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_supportedDecompressions函数代码示例

本文整理汇总了PHP中PMA_supportedDecompressions函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_supportedDecompressions函数的具体用法?PHP PMA_supportedDecompressions怎么用?PHP PMA_supportedDecompressions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_supportedDecompressions函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_selectUploadFile

/**
 * Display the form used to select a file to import from the server upload directory
 *
 * @param array  $import_list array of import types
 * @param string $uploaddir   upload directory
 *
 * @return nothing
 */
function PMA_selectUploadFile($import_list, $uploaddir)
{
    echo '<label for="radio_local_import_file">' . sprintf(__("Select from the web server upload directory <b>%s</b>:"), htmlspecialchars(PMA_userDir($uploaddir))) . '</label>';
    $extensions = '';
    foreach ($import_list as $key => $val) {
        if (!empty($extensions)) {
            $extensions .= '|';
        }
        $extensions .= $val['extension'];
    }
    $matcher = '@\\.(' . $extensions . ')(\\.(' . PMA_supportedDecompressions() . '))?$@';
    $active = isset($timeout_passed) && $timeout_passed && isset($local_import_file) ? $local_import_file : '';
    $files = PMA_getFileSelectOptions(PMA_userDir($uploaddir), $matcher, $active);
    if ($files === false) {
        PMA_Message::error(__('The directory you set for upload work cannot be reached'))->display();
    } elseif (!empty($files)) {
        echo "\n";
        echo '    <select style="margin: 5px" size="1" name="local_import_file" id="select_local_import_file">' . "\n";
        echo '        <option value="">&nbsp;</option>' . "\n";
        echo $files;
        echo '    </select>' . "\n";
    } elseif (empty($files)) {
        echo '<i>' . __('There are no files to upload') . '</i>';
    }
}
开发者ID:AmberWish,项目名称:laba_web,代码行数:33,代码来源:common.lib.php

示例2: PMA_getHtmlForSqlQueryFormUpload

/**
 * return HTML for Sql Query Form Upload
 *
 * @return string
 *
 * @usedby  PMA_getHtmlForSqlQueryForm()
 */
function PMA_getHtmlForSqlQueryFormUpload()
{
    global $timeout_passed, $local_import_file;
    $errors = array();
    // we allow only SQL here
    $matcher = '@\\.sql(\\.(' . PMA_supportedDecompressions() . '))?$@';
    if (!empty($GLOBALS['cfg']['UploadDir'])) {
        $files = PMA_getFileSelectOptions(PMA_Util::userDir($GLOBALS['cfg']['UploadDir']), $matcher, isset($timeout_passed) && $timeout_passed && isset($local_import_file) ? $local_import_file : '');
    } else {
        $files = '';
    }
    // start output
    $html = '<fieldset id="">';
    $html .= '<legend>';
    $html .= __('Browse your computer:') . '</legend>';
    $html .= '<div class="formelement">';
    $html .= '<input type="file" name="sql_file" class="textfield" /> ';
    $html .= PMA_Util::getFormattedMaximumUploadSize($GLOBALS['max_upload_size']);
    // some browsers should respect this :)
    $html .= PMA_Util::generateHiddenMaxFileSize($GLOBALS['max_upload_size']) . "\n";
    $html .= '</div>';
    if ($files === false) {
        $errors[] = PMA_Message::error(__('The directory you set for upload work cannot be reached.'));
    } elseif (!empty($files)) {
        $html .= '<div class="formelement">';
        $html .= '<strong>' . __('web server upload directory:') . '</strong>';
        $html .= '<select size="1" name="sql_localfile">' . "\n";
        $html .= '<option value="" selected="selected"></option>' . "\n";
        $html .= $files;
        $html .= '</select>' . "\n";
        $html .= '</div>';
    }
    $html .= '<div class="clearfloat"></div>' . "\n";
    $html .= '</fieldset>';
    $html .= '<fieldset id="" class="tblFooters">';
    $html .= __('Character set of the file:') . "\n";
    $html .= PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', null, 'utf8', false);
    $html .= '<input type="submit" name="SQL" value="' . __('Go') . '" />' . "\n";
    $html .= '<div class="clearfloat"></div>' . "\n";
    $html .= '</fieldset>';
    foreach ($errors as $error) {
        $html .= $error->getDisplay();
    }
    return $html;
}
开发者ID:ecssjapan,项目名称:guiding-you-afteropen,代码行数:52,代码来源:sql_query_form.lib.php

示例3: getSelectUploadFileBlock

 /**
  * Prepare the form used to select a file to import from the server upload
  * directory
  *
  * @param ImportPlugin[] $import_list array of import plugins
  * @param string         $uploaddir   upload directory
  *
  * @return String
  */
 public static function getSelectUploadFileBlock($import_list, $uploaddir)
 {
     $block_html = '';
     $block_html .= '<label for="radio_local_import_file">' . sprintf(__("Select from the web server upload directory <b>%s</b>:"), htmlspecialchars(self::userDir($uploaddir))) . '</label>';
     $extensions = '';
     foreach ($import_list as $import_plugin) {
         if (!empty($extensions)) {
             $extensions .= '|';
         }
         $extensions .= $import_plugin->getProperties()->getExtension();
     }
     $matcher = '@\\.(' . $extensions . ')(\\.(' . PMA_supportedDecompressions() . '))?$@';
     $active = isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($GLOBALS['local_import_file']) ? $GLOBALS['local_import_file'] : '';
     $files = PMA_getFileSelectOptions(self::userDir($uploaddir), $matcher, $active);
     if ($files === false) {
         PMA_Message::error(__('The directory you set for upload work cannot be reached.'))->display();
     } elseif (!empty($files)) {
         $block_html .= "\n" . '    <select style="margin: 5px" size="1" ' . 'name="local_import_file" ' . 'id="select_local_import_file">' . "\n" . '        <option value="">&nbsp;</option>' . "\n" . $files . '    </select>' . "\n";
     } elseif (empty($files)) {
         $block_html .= '<i>' . __('There are no files to upload!') . '</i>';
     }
     return $block_html;
 }
开发者ID:altesien,项目名称:FinalProject,代码行数:32,代码来源:Util.class.php

示例4: PMA_sqlQueryFormUpload

/**
 * prints bookmark fieldset
 *
 * @usedby  PMA_sqlQueryForm()
 * @uses    $GLOBALS['cfg']['GZipDump']
 * @uses    $GLOBALS['cfg']['BZipDump']
 * @uses    $GLOBALS['cfg']['UploadDir']
 * @uses    $GLOBALS['cfg']['AvailableCharsets']
 * @uses    $GLOBALS['cfg']['AllowAnywhereRecoding']
 * @uses    $GLOBALS['strAutodetect']
 * @uses    $GLOBALS['strBzip']
 * @uses    $GLOBALS['strCharsetOfFile']
 * @uses    $GLOBALS['strCompression']
 * @uses    $GLOBALS['strError']
 * @uses    $GLOBALS['strGo']
 * @uses    $GLOBALS['strGzip']
 * @uses    $GLOBALS['strLocationTextfile']
 * @uses    $GLOBALS['strWebServerUploadDirectory']
 * @uses    $GLOBALS['strWebServerUploadDirectoryError']
 * @uses    $GLOBALS['allow_recoding']
 * @uses    $GLOBALS['charset']
 * @uses    $GLOBALS['max_upload_size']
 * @uses    PMA_supportedDecompressions()
 * @uses    PMA_getFileSelectOptions()
 * @uses    PMA_displayMaximumUploadSize()
 * @uses    PMA_generateCharsetDropdownBox()
 * @uses    PMA_generateHiddenMaxFileSize()
 * @uses    PMA_MYSQL_INT_VERSION
 * @uses    PMA_CSDROPDOWN_CHARSET
 * @uses    empty()
 */
function PMA_sqlQueryFormUpload()
{
    $errors = array();
    $matcher = '@\\.sql(\\.(' . PMA_supportedDecompressions() . '))?$@';
    // we allow only SQL here
    if (!empty($GLOBALS['cfg']['UploadDir'])) {
        $files = PMA_getFileSelectOptions(PMA_userDir($GLOBALS['cfg']['UploadDir']), $matcher, isset($timeout_passed) && $timeout_passed && isset($local_import_file) ? $local_import_file : '');
    } else {
        $files = '';
    }
    // start output
    echo '<fieldset id="">';
    echo '<legend>';
    echo $GLOBALS['strLocationTextfile'] . '</legend>';
    echo '<div class="formelement">';
    echo '<input type="file" name="sql_file" class="textfield" /> ';
    echo PMA_displayMaximumUploadSize($GLOBALS['max_upload_size']);
    // some browsers should respect this :)
    echo PMA_generateHiddenMaxFileSize($GLOBALS['max_upload_size']) . "\n";
    echo '</div>';
    if ($files === FALSE) {
        $errors[$GLOBALS['strError']] = $GLOBALS['strWebServerUploadDirectoryError'];
    } elseif (!empty($files)) {
        echo '<div class="formelement">';
        echo '<strong>' . $GLOBALS['strWebServerUploadDirectory'] . ':</strong>' . "\n";
        echo '<select size="1" name="sql_localfile">' . "\n";
        echo '<option value="" selected="selected"></option>' . "\n";
        echo $files;
        echo '</select>' . "\n";
        echo '</div>';
    }
    echo '<div class="clearfloat"></div>' . "\n";
    echo '</fieldset>';
    echo '<fieldset id="" class="tblFooters">';
    if (PMA_MYSQL_INT_VERSION < 40100 && $GLOBALS['cfg']['AllowAnywhereRecoding'] && $GLOBALS['allow_recoding']) {
        echo $GLOBALS['strCharsetOfFile'] . "\n" . '<select name="charset_of_file" size="1">' . "\n";
        foreach ($GLOBALS['cfg']['AvailableCharsets'] as $temp_charset) {
            echo '<option value="' . $temp_charset . '"';
            if ($temp_charset == $GLOBALS['charset']) {
                echo ' selected="selected"';
            }
            echo '>' . $temp_charset . '</option>' . "\n";
        }
        echo '</select>' . "\n";
    } elseif (PMA_MYSQL_INT_VERSION >= 40100) {
        echo $GLOBALS['strCharsetOfFile'] . "\n";
        echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', null, 'utf8', FALSE);
    }
    // end if (recoding)
    echo '<input type="submit" name="SQL" value="' . $GLOBALS['strGo'] . '" />' . "\n";
    echo '<div class="clearfloat"></div>' . "\n";
    echo '</fieldset>';
    foreach ($errors as $error => $message) {
        echo '<div>' . $error . '</div>';
        echo '<div>' . $message . '</div>';
    }
}
开发者ID:hoogle,项目名称:ttt,代码行数:88,代码来源:sql_query_form.lib.php

示例5: foreach

} else {
    echo '<div class="warning">' . "\n";
    echo $strUploadsNotAllowed . "\n";
}
?>
        </div>
<?php 
if (!empty($cfg['UploadDir'])) {
    $extensions = '';
    foreach ($import_list as $key => $val) {
        if (!empty($extensions)) {
            $extensions .= '|';
        }
        $extensions .= $val['extension'];
    }
    $matcher = '@\\.(' . $extensions . ')(\\.(' . PMA_supportedDecompressions() . '))?$@';
    $files = PMA_getFileSelectOptions(PMA_userDir($cfg['UploadDir']), $matcher, isset($timeout_passed) && $timeout_passed && isset($local_import_file) ? $local_import_file : '');
    echo '<div class="formelementrow">' . "\n";
    if ($files === FALSE) {
        echo '    <div class="warning">' . "\n";
        echo '        <strong>' . $strError . '</strong>: ' . "\n";
        echo '        ' . $strWebServerUploadDirectoryError . "\n";
        echo '    </div>' . "\n";
    } elseif (!empty($files)) {
        echo "\n";
        echo '    <i>' . $strOr . '</i><br/><label for="select_local_import_file">' . $strWebServerUploadDirectory . '</label>&nbsp;: ' . "\n";
        echo '    <select style="margin: 5px" size="1" name="local_import_file" onchange="match_file(this.value)" id="select_local_import_file">' . "\n";
        echo '        <option value=""></option>' . "\n";
        echo $files;
        echo '    </select>' . "\n";
    }
开发者ID:BGCX261,项目名称:zhe-project-agri-hg-to-git,代码行数:31,代码来源:display_import.lib.php


注:本文中的PMA_supportedDecompressions函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。