本文整理汇总了PHP中natcasesort函数的典型用法代码示例。如果您正苦于以下问题:PHP natcasesort函数的具体用法?PHP natcasesort怎么用?PHP natcasesort使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了natcasesort函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUpgrades
/**
* Returns an array of all possible upgrade files as an array with
* the upgrade's key and version
*
* This first looks for all .php files in the versions directory.
* The files should have the format of VERSION_NUMBER (e.g. 1.0.0__1).
* The project is then checked to see if
*/
public function getUpgrades()
{
if (!$this->_upgrades) {
$this->_upgrades = array();
$versions = array();
$dir = dirname(__FILE__) . '/versions';
$files = sfFinder::type('file')->name('*.php')->in($dir);
foreach ($files as $file) {
$info = pathinfo($file);
if (strpos($info['filename'], '__') === false) {
throw new sfException(sprintf('Invalid upgrade filename format for file "%s" - must contain a double underscore - VERSION__NUMBER (e.g. 1.0.0__1) ', $info['filename']));
}
$e = explode('__', $info['filename']);
$version = $e[0];
$number = $e[1];
if ($this->_isVersionNew($info['filename'])) {
$versions[] = array('version' => $version, 'number' => $number);
$this->_upgrades[] = $version . '__' . $number;
}
}
natcasesort($this->_upgrades);
foreach ($this->_upgrades as $key => $version) {
$this->_upgrades[$key] = $versions[$key];
}
}
return $this->_upgrades;
}
示例2: fileTree
/**
*
* @return string
*/
public static function fileTree()
{
$root = JchPlatformPaths::rootPath();
$dir = urldecode(JchPlatformUtility::get('dir', '', 'string', 'post'));
$dir = JchPlatformUtility::decrypt($dir);
$response = '';
if (file_exists($root . $dir)) {
$files = scandir($root . $dir);
natcasesort($files);
if (count($files) > 2) {
/* The 2 accounts for . and .. */
$response .= '<ul class="jqueryFileTree" style="display: none; ">';
// All dirs
foreach ($files as $file) {
if (file_exists($root . $dir . $file) && $file != '.' && $file != '..' && is_dir($root . $dir . $file)) {
$response .= '<li class="directory collapsed"><a href="#" rel="' . JchPlatformUtility::encrypt($dir . $file . '/') . '">' . htmlentities($file) . '</a></li>';
}
}
// All files
foreach ($files as $file) {
if (file_exists($root . $dir . $file) && $file != '.' && $file != '..' && !is_dir($root . $dir . $file)) {
$ext = preg_replace('/^.*\\./', '', $file);
$response .= '<li class="file ext_' . $ext . '"><a href="#" rel="' . JchPlatformUtility::encrypt($dir . $file) . '">' . htmlentities($file) . '</a></li>';
}
}
$response .= '</ul>';
}
}
return $response;
}
示例3: doParsing
/**
* Do the parsing of the yaml files and return the final parsed array
*
* @return array $array
*/
public function doParsing()
{
$recursiveMerge = Doctrine_Manager::getInstance()->getAttribute(Doctrine_Core::ATTR_RECURSIVE_MERGE_FIXTURES);
$mergeFunction = $recursiveMerge === true ? 'array_merge_recursive' : 'array_merge';
$directory = $this->getDirectory();
$array = array();
if ($directory !== null) {
foreach ((array) $directory as $dir) {
$e = explode('.', $dir);
// If they specified a specific yml file
if (end($e) == 'yml') {
$array = $mergeFunction($array, Doctrine_Parser::load($dir, $this->getFormat()));
// If they specified a directory
} else {
if (is_dir($dir)) {
$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::LEAVES_ONLY);
$filesOrdered = array();
foreach ($it as $file) {
$filesOrdered[] = $file;
}
// force correct order
natcasesort($filesOrdered);
foreach ($filesOrdered as $file) {
$e = explode('.', $file->getFileName());
if (in_array(end($e), $this->getFormats())) {
$array = $mergeFunction($array, Doctrine_Parser::load($file->getPathName(), $this->getFormat()));
}
}
}
}
}
}
return $array;
}
示例4: getTaxaFilterList
public function getTaxaFilterList()
{
$returnArr = array();
$sql = "SELECT DISTINCT nt.UnitName1, ts.Family ";
if ($this->clid && $this->clType == "static") {
$sql .= "FROM (taxstatus ts INNER JOIN taxa nt ON ts.tid = nt.tid) INNER JOIN fmchklsttaxalink cltl ON nt.TID = cltl.TID " . "WHERE (cltl.CLID = " . $this->clid . ") ";
} else {
if ($this->dynClid) {
$sql .= "FROM (taxstatus ts INNER JOIN taxa nt ON ts.tid = nt.tid) INNER JOIN fmdyncltaxalink dcltl ON nt.TID = dcltl.TID " . "WHERE (dcltl.dynclid = " . $this->dynClid . ") ";
} else {
$sql .= "FROM (((taxstatus ts INNER JOIN taxa nt ON ts.tid = nt.tid) " . "INNER JOIN fmchklsttaxalink cltl ON nt.TID = cltl.TID) " . "INNER JOIN fmchecklists cl ON cltl.CLID = cl.CLID) " . "INNER JOIN fmchklstprojlink clpl ON cl.CLID = clpl.clid " . "WHERE (clpl.pid = " . $this->pid . ") ";
}
}
$sql .= 'AND (ts.taxauthid = 1)';
//echo $sql.'<br/>'; exit;
$result = $this->keyCon->query($sql);
while ($row = $result->fetch_object()) {
$genus = $row->UnitName1;
$family = $row->Family;
if ($genus) {
$returnArr[] = $genus;
}
if ($family) {
$returnArr[] = $family;
}
}
$result->free();
$returnArr = array_unique($returnArr);
natcasesort($returnArr);
array_unshift($returnArr, "--------------------------");
array_unshift($returnArr, "All Species");
return $returnArr;
}
示例5: getRootDirContent
public function getRootDirContent()
{
$path = PHPFOX_DIR;
if (file_exists($path)) {
if (is_dir($path)) {
$this->files = scandir($path);
//folders
natcasesort($this->files);
//All dirs
foreach ($this->files as $file) {
if (file_exists($path . $file) && $file != '.' && $file != '..' && is_dir($path . $file)) {
$full_path = htmlentities($path . $file) . "/";
$this->filesforzip[] = str_replace('\\', '/', realpath($full_path) . "/");
$file = htmlentities($file);
}
}
foreach ($this->files as $file) {
if (file_exists($path . $file) && $file != '.' && $file != '..' && !is_dir($path . $file)) {
$full_path = htmlentities($path . $file);
$this->filesforzip[] = str_replace('\\', '/', realpath($full_path));
$file = htmlentities($file);
}
}
} else {
$this->filesforzip[] = $path;
//files
}
}
//convert to string
$comma_separated = implode(",", $this->filesforzip);
//add taken content to db
Phpfox::getService('backuprestore.backuprestore')->addBTDBSetting('included_paths', serialize($comma_separated));
}
示例6: compo_cloud
function compo_cloud()
{
global $wpdb;
$topurl = get_bloginfo("url");
$start = 10;
$total = 24;
$query = "SELECT {$wpdb->terms}.term_id, {$wpdb->terms}.name, {$wpdb->term_taxonomy}.count, {$wpdb->terms}.slug FROM (({$wpdb->term_relationships} INNER JOIN {$wpdb->posts} ON {$wpdb->term_relationships}.object_id = {$wpdb->posts}.ID) INNER JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id) INNER JOIN {$wpdb->terms} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id WHERE ((({$wpdb->term_taxonomy}.taxonomy)='post_tag') AND (({$wpdb->posts}.post_status)='publish')) GROUP BY {$wpdb->terms}.name ORDER BY count DESC, {$wpdb->terms}.name";
# LIMIT $start,$total";
$terms = $wpdb->get_results($query);
shuffle($terms);
$data = array();
foreach ($terms as $e) {
if ($e->count < 2) {
continue;
}
$data[] = "{$e->count}|{$e->name}|{$e->slug}";
if (count($data) >= $total) {
break;
}
}
natcasesort($data);
$out = array();
$n = 0;
foreach ($data as $v) {
$z = intval(8 + $n * 0.5);
list($x, $name, $slug) = explode("|", $v);
// $name = htmlentities($name);
$out[] = "<a href='{$topurl}/tag/{$slug}' style='font-size:{$z}px'>{$name}</a>";
$n += 1;
}
shuffle($out);
echo implode(" ", $out);
}
示例7: listFiles
function listFiles($dir)
{
global $cfg;
$list = array();
$full = $cfg['root'] . trim($dir, '/\\') . DIR_SEP;
$thumb = $cfg['root'] . $cfg['thumb']['dir'] . DIR_SEP . trim($dir, '/\\') . DIR_SEP;
$files = scandir($full);
natcasesort($files);
for ($i = -1, $iCount = count($files); ++$i < $iCount;) {
$ext = substr($files[$i], strrpos($files[$i], '.') + 1);
if (!in_array($files[$i], $cfg['hide']['file']) && !in_array($ext, $cfg['deny'][$cfg['type']]) && in_array($ext, $cfg['allow'][$cfg['type']]) && is_file($full . $files[$i])) {
$imgSize = array(0, 0);
if (in_array($ext, $cfg['allow']['image'])) {
if ($cfg['thumb']['auto'] && !file_exists($thumb . $files[$i])) {
create_thumbnail($full . $files[$i], $thumb . $files[$i]);
}
$imgSize = getimagesize($full . $files[$i]);
}
$stats = getSize($full . $files[$i]);
$list[] = array('name' => $files[$i], 'ext' => $ext, 'width' => $imgSize[0], 'height' => $imgSize[1], 'size' => $stats['_size'], 'date' => date($cfg['thumb']['date'], $stats['mtime']), 'r_size' => $stats['size'], 'mtime' => $stats['mtime'], 'thumb' => '/' . $cfg['url'] . '/' . $cfg['thumb']['dir'] . '/' . $dir . $files[$i]);
}
}
switch ($cfg['sort']) {
case 'size':
usort($list, 'sortSize');
break;
case 'date':
usort($list, 'sortDate');
break;
default:
//name
break;
}
return $list;
}
示例8: getImagesFromFolder
static function getImagesFromFolder(&$params)
{
if (!is_numeric($max = $params->get('max_images'))) {
$max = 20;
}
$folder = $params->get('image_folder');
if (!($dir = @opendir($folder))) {
return null;
}
while (false !== ($file = readdir($dir))) {
if (preg_match('/.+\\.(jpg|jpeg|gif|png)$/i', $file)) {
// check with getimagesize() which attempts to return the image mime-type
if (getimagesize(JPATH_ROOT . DS . $folder . DS . $file) !== FALSE) {
$files[] = $file;
}
}
}
closedir($dir);
if ($params->get('sort_by')) {
natcasesort($files);
} else {
shuffle($files);
}
$images = array_slice($files, 0, $max);
$target = modDJImageSliderHelper::getSlideTarget($params->get('link'));
foreach ($images as $image) {
$slides[] = (object) array('title' => '', 'description' => '', 'image' => $folder . '/' . $image, 'link' => $params->get('link'), 'alt' => $image, 'target' => $target);
}
return $slides;
}
示例9: wikiplugin_sort
function wikiplugin_sort($data, $params)
{
global $tikilib;
extract($params, EXTR_SKIP);
$sort = isset($sort) ? $sort : "asc";
$lines = preg_split("/\n+/", $data, -1, PREG_SPLIT_NO_EMPTY);
// separate lines into array
// $lines = array_filter( $lines, "chop" ); // remove \n
srand((double) microtime() * 1000000);
// needed for shuffle;
if ($sort == "asc") {
natcasesort($lines);
} else {
if ($sort == "desc") {
natcasesort($lines);
$lines = array_reverse($lines);
} else {
if ($sort == "reverse") {
$lines = array_reverse($lines);
} else {
if ($sort == "shuffle") {
shuffle($lines);
}
}
}
}
reset($lines);
if (is_array($lines)) {
$data = implode("\n", $lines);
}
$data = trim($data);
return $data;
}
示例10: render
public function render()
{
$conpherence = $this->getConpherence();
$widget_data = $conpherence->getWidgetData();
$viewer = $this->getUser();
$participants = $conpherence->getParticipants();
$handles = $conpherence->getHandles();
$head_handles = array_select_keys($handles, array($viewer->getPHID()));
$handle_list = mpull($handles, 'getName');
natcasesort($handle_list);
$handles = mpull($handles, null, 'getName');
$handles = array_select_keys($handles, $handle_list);
$head_handles = mpull($head_handles, null, 'getName');
$handles = $head_handles + $handles;
$can_edit = PhabricatorPolicyFilter::hasCapability($viewer, $conpherence, PhabricatorPolicyCapability::CAN_EDIT);
$body = array();
foreach ($handles as $handle) {
$user_phid = $handle->getPHID();
if ($user_phid == $viewer->getPHID() || $can_edit) {
$icon = id(new PHUIIconView())->setIcon('fa-times lightbluetext');
$remove_html = javelin_tag('a', array('class' => 'remove', 'sigil' => 'remove-person', 'meta' => array('remove_person' => $user_phid, 'action' => 'remove_person')), $icon);
} else {
$remove_html = null;
}
$body[] = phutil_tag('div', array('class' => 'person-entry grouped'), array(phutil_tag('a', array('class' => 'pic', 'href' => $handle->getURI()), phutil_tag('img', array('src' => $handle->getImageURI()), '')), $handle->renderLink(), $remove_html));
}
return $body;
}
示例11: generatePage
public static function generatePage(&$tpl, &$session, &$account, &$mj)
{
if (!isset($_POST['db_id']) && isset($_GET['id'])) {
$_POST['db_id'] = $_GET['id'];
}
if (!isset($_POST['db_id'])) {
return fctErrorMSG('Vous devez sélectionner un objet.');
}
$dbMgr = DbManager::getInstance();
//Instancier le gestionnaire
$db = $dbMgr->getConn('game');
//Demander la connexion existante
if (isset($_POST['save'])) {
self::save();
die("<script>location.href='?mj=Item_Livre';</script>");
}
$tpl->set('ACTIONTYPETXT', "Modifier");
$tpl->set('SUBMITNAME', 'Mod');
$tpl->set('SHOWID', true);
$query = 'SELECT `db_id`,' . ' `db_nom`,' . ' `db_desc`,' . ' `db_pass`,' . ' `db_img`,' . ' `db_pr`,' . ' `db_param`,' . ' `db_valeur`,' . ' `db_resistance`,' . ' `db_notemj`' . ' FROM `' . DB_PREFIX . 'item_db`' . ' WHERE `db_id` = :db_id;';
$prep = $db->prepare($query);
$prep->bindValue(':db_id', $_POST['db_id'], PDO::PARAM_INT);
$prep->execute($db, __FILE__, __LINE__);
$arr = $prep->fetch();
$prep->closeCursor();
$prep = NULL;
$tpl->set('ITEM', $arr);
//lister le dossier d'image
$dir2 = dir($account->getSkinRemotePhysicalPath() . "../_common/items/");
$counter = 0;
$arrurl = array();
$arr = array();
while ($url = $dir2->read()) {
$arrurl[$counter++] = $url;
}
natcasesort($arrurl);
$arrurl = array_values($arrurl);
for ($i = 0; $i < count($arrurl); $i++) {
if ($arrurl[$i] != '' && substr($arrurl[$i], 0, 1) != '.') {
$arr[$i] = $arrurl[$i];
}
}
$tpl->set('IMGS', $arr);
//Générer la liste des actions associable à un lieu
$query = 'SELECT `id`, `url`, `caption`' . ' FROM `' . DB_PREFIX . 'item_menu`' . ' WHERE `item_dbid` = :db_id;';
$prep = $db->prepare($query);
$prep->bindValue(':db_id', $_POST['db_id'], PDO::PARAM_INT);
$prep->execute($db, __FILE__, __LINE__);
$result = $prep->fetchAll();
$prep->closeCursor();
$prep = NULL;
if (count($result) > 0) {
$ACTIONS = array();
foreach ($result as $arr) {
$ACTIONS[] = $arr;
}
$tpl->set('ACTIONS', $ACTIONS);
}
return $tpl->fetch($account->getSkinRemotePhysicalPath() . 'html/Mj/Item/Livre_Addmod.htm');
}
示例12: _loadTerms
/**
* Load terms and try to sort it by names
*
* @return $this
*/
protected function _loadTerms()
{
if (empty($this->_terms)) {
$this->_terms = [];
$terms = $this->_queryCollectionFactory->create()->setPopularQueryFilter($this->_storeManager->getStore()->getId())->setPageSize(100)->load()->getItems();
if (count($terms) == 0) {
return $this;
}
$this->_maxPopularity = reset($terms)->getPopularity();
$this->_minPopularity = end($terms)->getPopularity();
$range = $this->_maxPopularity - $this->_minPopularity;
$range = $range == 0 ? 1 : $range;
foreach ($terms as $term) {
if (!$term->getPopularity()) {
continue;
}
$term->setRatio(($term->getPopularity() - $this->_minPopularity) / $range);
$temp[$term->getName()] = $term;
$termKeys[] = $term->getName();
}
natcasesort($termKeys);
foreach ($termKeys as $termKey) {
$this->_terms[$termKey] = $temp[$termKey];
}
}
return $this;
}
示例13: filelist
public function filelist()
{
$mp3s = $directories = $current = array();
if (!empty($_GET['dir'])) {
$currentDir = urldecode($_GET['dir']);
} else {
$currentDir = '';
}
$contents = mpc::ls($currentDir);
natcasesort($contents);
foreach ($contents as $value) {
if (strpos($value, '/') > 0) {
$value = substr($value, strrpos($value, '/') + 1);
}
if (strtolower(substr($value, -4)) == ".mp3") {
$mp3s[] = $value;
} else {
$directories[$value] = $currentDir . '/' . $value;
}
}
if (!empty($currentDir)) {
$directories = array('up' => substr($currentDir, 0, strrpos($currentDir, '/'))) + $directories;
}
return array('files' => $mp3s, 'directories' => $directories, 'currentDir' => $currentDir);
}
示例14: getStandardList
/**
* Get an array of all two-letter country code => country name pairs.
*
* @return array
* An array of country code => country name pairs.
*/
public static function getStandardList()
{
$countries = array('AC' => t('Ascension Island'), 'AD' => t('Andorra'), 'AE' => t('United Arab Emirates'), 'AF' => t('Afghanistan'), 'AG' => t('Antigua and Barbuda'), 'AI' => t('Anguilla'), 'AL' => t('Albania'), 'AM' => t('Armenia'), 'AN' => t('Netherlands Antilles'), 'AO' => t('Angola'), 'AQ' => t('Antarctica'), 'AR' => t('Argentina'), 'AS' => t('American Samoa'), 'AT' => t('Austria'), 'AU' => t('Australia'), 'AW' => t('Aruba'), 'AX' => t('Åland Islands'), 'AZ' => t('Azerbaijan'), 'BA' => t('Bosnia and Herzegovina'), 'BB' => t('Barbados'), 'BD' => t('Bangladesh'), 'BE' => t('Belgium'), 'BF' => t('Burkina Faso'), 'BG' => t('Bulgaria'), 'BH' => t('Bahrain'), 'BI' => t('Burundi'), 'BJ' => t('Benin'), 'BL' => t('Saint Barthélemy'), 'BM' => t('Bermuda'), 'BN' => t('Brunei'), 'BO' => t('Bolivia'), 'BQ' => t('Caribbean Netherlands'), 'BR' => t('Brazil'), 'BS' => t('Bahamas'), 'BT' => t('Bhutan'), 'BV' => t('Bouvet Island'), 'BW' => t('Botswana'), 'BY' => t('Belarus'), 'BZ' => t('Belize'), 'CA' => t('Canada'), 'CC' => t('Cocos [Keeling] Islands'), 'CD' => t('Congo - Kinshasa'), 'CF' => t('Central African Republic'), 'CG' => t('Congo - Brazzaville'), 'CH' => t('Switzerland'), 'CI' => t('Côte d’Ivoire'), 'CK' => t('Cook Islands'), 'CL' => t('Chile'), 'CM' => t('Cameroon'), 'CN' => t('China'), 'CO' => t('Colombia'), 'CP' => t('Clipperton Island'), 'CR' => t('Costa Rica'), 'CU' => t('Cuba'), 'CV' => t('Cape Verde'), 'CW' => t('Curaçao'), 'CX' => t('Christmas Island'), 'CY' => t('Cyprus'), 'CZ' => t('Czech Republic'), 'DE' => t('Germany'), 'DG' => t('Diego Garcia'), 'DJ' => t('Djibouti'), 'DK' => t('Denmark'), 'DM' => t('Dominica'), 'DO' => t('Dominican Republic'), 'DZ' => t('Algeria'), 'EA' => t('Ceuta and Melilla'), 'EC' => t('Ecuador'), 'EE' => t('Estonia'), 'EG' => t('Egypt'), 'EH' => t('Western Sahara'), 'ER' => t('Eritrea'), 'ES' => t('Spain'), 'ET' => t('Ethiopia'), 'FI' => t('Finland'), 'FJ' => t('Fiji'), 'FK' => t('Falkland Islands'), 'FM' => t('Micronesia'), 'FO' => t('Faroe Islands'), 'FR' => t('France'), 'GA' => t('Gabon'), 'GB' => t('United Kingdom'), 'GD' => t('Grenada'), 'GE' => t('Georgia'), 'GF' => t('French Guiana'), 'GG' => t('Guernsey'), 'GH' => t('Ghana'), 'GI' => t('Gibraltar'), 'GL' => t('Greenland'), 'GM' => t('Gambia'), 'GN' => t('Guinea'), 'GP' => t('Guadeloupe'), 'GQ' => t('Equatorial Guinea'), 'GR' => t('Greece'), 'GS' => t('South Georgia and the South Sandwich Islands'), 'GT' => t('Guatemala'), 'GU' => t('Guam'), 'GW' => t('Guinea-Bissau'), 'GY' => t('Guyana'), 'HK' => t('Hong Kong SAR China'), 'HM' => t('Heard Island and McDonald Islands'), 'HN' => t('Honduras'), 'HR' => t('Croatia'), 'HT' => t('Haiti'), 'HU' => t('Hungary'), 'IC' => t('Canary Islands'), 'ID' => t('Indonesia'), 'IE' => t('Ireland'), 'IL' => t('Israel'), 'IM' => t('Isle of Man'), 'IN' => t('India'), 'IO' => t('British Indian Ocean Territory'), 'IQ' => t('Iraq'), 'IR' => t('Iran'), 'IS' => t('Iceland'), 'IT' => t('Italy'), 'JE' => t('Jersey'), 'JM' => t('Jamaica'), 'JO' => t('Jordan'), 'JP' => t('Japan'), 'KE' => t('Kenya'), 'KG' => t('Kyrgyzstan'), 'KH' => t('Cambodia'), 'KI' => t('Kiribati'), 'KM' => t('Comoros'), 'KN' => t('Saint Kitts and Nevis'), 'KP' => t('North Korea'), 'KR' => t('South Korea'), 'KW' => t('Kuwait'), 'KY' => t('Cayman Islands'), 'KZ' => t('Kazakhstan'), 'LA' => t('Laos'), 'LB' => t('Lebanon'), 'LC' => t('Saint Lucia'), 'LI' => t('Liechtenstein'), 'LK' => t('Sri Lanka'), 'LR' => t('Liberia'), 'LS' => t('Lesotho'), 'LT' => t('Lithuania'), 'LU' => t('Luxembourg'), 'LV' => t('Latvia'), 'LY' => t('Libya'), 'MA' => t('Morocco'), 'MC' => t('Monaco'), 'MD' => t('Moldova'), 'ME' => t('Montenegro'), 'MF' => t('Saint Martin'), 'MG' => t('Madagascar'), 'MH' => t('Marshall Islands'), 'MK' => t('Macedonia'), 'ML' => t('Mali'), 'MM' => t('Myanmar [Burma]'), 'MN' => t('Mongolia'), 'MO' => t('Macau SAR China'), 'MP' => t('Northern Mariana Islands'), 'MQ' => t('Martinique'), 'MR' => t('Mauritania'), 'MS' => t('Montserrat'), 'MT' => t('Malta'), 'MU' => t('Mauritius'), 'MV' => t('Maldives'), 'MW' => t('Malawi'), 'MX' => t('Mexico'), 'MY' => t('Malaysia'), 'MZ' => t('Mozambique'), 'NA' => t('Namibia'), 'NC' => t('New Caledonia'), 'NE' => t('Niger'), 'NF' => t('Norfolk Island'), 'NG' => t('Nigeria'), 'NI' => t('Nicaragua'), 'NL' => t('Netherlands'), 'NO' => t('Norway'), 'NP' => t('Nepal'), 'NR' => t('Nauru'), 'NU' => t('Niue'), 'NZ' => t('New Zealand'), 'OM' => t('Oman'), 'PA' => t('Panama'), 'PE' => t('Peru'), 'PF' => t('French Polynesia'), 'PG' => t('Papua New Guinea'), 'PH' => t('Philippines'), 'PK' => t('Pakistan'), 'PL' => t('Poland'), 'PM' => t('Saint Pierre and Miquelon'), 'PN' => t('Pitcairn Islands'), 'PR' => t('Puerto Rico'), 'PS' => t('Palestinian Territories'), 'PT' => t('Portugal'), 'PW' => t('Palau'), 'PY' => t('Paraguay'), 'QA' => t('Qatar'), 'QO' => t('Outlying Oceania'), 'RE' => t('Réunion'), 'RO' => t('Romania'), 'RS' => t('Serbia'), 'RU' => t('Russia'), 'RW' => t('Rwanda'), 'SA' => t('Saudi Arabia'), 'SB' => t('Solomon Islands'), 'SC' => t('Seychelles'), 'SD' => t('Sudan'), 'SE' => t('Sweden'), 'SG' => t('Singapore'), 'SH' => t('Saint Helena'), 'SI' => t('Slovenia'), 'SJ' => t('Svalbard and Jan Mayen'), 'SK' => t('Slovakia'), 'SL' => t('Sierra Leone'), 'SM' => t('San Marino'), 'SN' => t('Senegal'), 'SO' => t('Somalia'), 'SR' => t('Suriname'), 'SS' => t('South Sudan'), 'ST' => t('São Tomé and Príncipe'), 'SV' => t('El Salvador'), 'SX' => t('Sint Maarten'), 'SY' => t('Syria'), 'SZ' => t('Swaziland'), 'TA' => t('Tristan da Cunha'), 'TC' => t('Turks and Caicos Islands'), 'TD' => t('Chad'), 'TF' => t('French Southern Territories'), 'TG' => t('Togo'), 'TH' => t('Thailand'), 'TJ' => t('Tajikistan'), 'TK' => t('Tokelau'), 'TL' => t('Timor-Leste'), 'TM' => t('Turkmenistan'), 'TN' => t('Tunisia'), 'TO' => t('Tonga'), 'TR' => t('Turkey'), 'TT' => t('Trinidad and Tobago'), 'TV' => t('Tuvalu'), 'TW' => t('Taiwan'), 'TZ' => t('Tanzania'), 'UA' => t('Ukraine'), 'UG' => t('Uganda'), 'UM' => t('U.S. Outlying Islands'), 'US' => t('United States'), 'UY' => t('Uruguay'), 'UZ' => t('Uzbekistan'), 'VA' => t('Vatican City'), 'VC' => t('Saint Vincent and the Grenadines'), 'VE' => t('Venezuela'), 'VG' => t('British Virgin Islands'), 'VI' => t('U.S. Virgin Islands'), 'VN' => t('Vietnam'), 'VU' => t('Vanuatu'), 'WF' => t('Wallis and Futuna'), 'WS' => t('Samoa'), 'XK' => t('Kosovo'), 'YE' => t('Yemen'), 'YT' => t('Mayotte'), 'ZA' => t('South Africa'), 'ZM' => t('Zambia'), 'ZW' => t('Zimbabwe'));
// Sort the list.
natcasesort($countries);
return $countries;
}
示例15: wpdm_odir_tree
function wpdm_odir_tree()
{
if (!isset($_GET['task']) || $_GET['task'] != 'wpdm_odir_tree') {
return;
}
if (!current_user_can('access_server_browser')) {
echo "<ul><li>" . __('Not Allowed!', 'wpdmpro') . "</li></ul>";
die;
}
$_POST['dir'] = isset($_POST['dir']) ? urldecode($_POST['dir']) : '';
$root = '';
if (file_exists($root . $_POST['dir'])) {
$files = scandir($root . $_POST['dir']);
natcasesort($files);
if (count($files) > 2) {
/* The 2 accounts for . and .. */
echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
// All dirs
foreach ($files as $file) {
if (file_exists($root . $_POST['dir'] . $file) && $file != '.' && $file != '..' && is_dir($root . $_POST['dir'] . $file)) {
echo "<li class=\"directory collapsed\"><a onclick=\"odirpath(this)\" class=\"odir\" href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "/\">" . htmlentities($file) . "</a></li>";
}
}
echo "</ul>";
}
}
die;
}