本文整理汇总了PHP中WT_I18N::strcasecmp方法的典型用法代码示例。如果您正苦于以下问题:PHP WT_I18N::strcasecmp方法的具体用法?PHP WT_I18N::strcasecmp怎么用?PHP WT_I18N::strcasecmp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WT_I18N
的用法示例。
在下文中一共展示了WT_I18N::strcasecmp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tagSort
public static function tagSort($x, $y)
{
list($x1) = explode(':', $x . ':');
list($y1) = explode(':', $y . ':');
$tmp = WT_I18N::strcasecmp(WT_Gedcom_Tag::getLabel($x1), WT_Gedcom_Tag::getLabel($y1));
if ($tmp) {
return $tmp;
} else {
return WT_I18N::strcasecmp(WT_Gedcom_Tag::getLabel($x), WT_Gedcom_Tag::getLabel($y));
}
}
示例2: event_sort
function event_sort($a, $b)
{
if ($a['jd'] == $b['jd']) {
if ($a['anniv'] == $b['anniv']) {
return WT_I18N::strcasecmp($a['fact'], $b['fact']);
} else {
return $a['anniv'] - $b['anniv'];
}
} else {
return $a['jd'] - $b['jd'];
}
}
示例3: print_add_new_fact
/**
* Print a new fact box on details pages
*
* @param string $id the id of the person, family, source etc the fact will be added to
* @param array $usedfacts an array of facts already used in this record
* @param string $type the type of record INDI, FAM, SOUR etc
*/
function print_add_new_fact($id, $usedfacts, $type)
{
global $WT_SESSION;
// -- Add from clipboard
if ($WT_SESSION->clipboard) {
$newRow = true;
foreach (array_reverse($WT_SESSION->clipboard, true) as $fact_id => $fact) {
if ($fact["type"] == $type || $fact["type"] == 'all') {
if ($newRow) {
$newRow = false;
echo '<tr><td class="descriptionbox">';
echo WT_I18N::translate('Add from clipboard'), '</td>';
echo '<td class="optionbox wrap"><form method="get" name="newFromClipboard" action="?" onsubmit="return false;">';
echo '<select id="newClipboardFact">';
}
echo '<option value="', WT_Filter::escapeHtml($fact_id), '">', WT_Gedcom_Tag::getLabel($fact['fact']);
// TODO use the event class to store/parse the clipboard events
if (preg_match('/^2 DATE (.+)/m', $fact['factrec'], $match)) {
$tmp = new WT_Date($match[1]);
echo '; ', $tmp->minDate()->format('%Y');
}
if (preg_match('/^2 PLAC ([^,\\n]+)/m', $fact['factrec'], $match)) {
echo '; ', $match[1];
}
echo '</option>';
}
}
if (!$newRow) {
echo '</select>';
echo ' <input type="button" value="', WT_I18N::translate('Add'), "\" onclick=\"return paste_fact('{$id}', '#newClipboardFact');\"> ";
echo '</form></td></tr>', "\n";
}
}
// -- Add from pick list
switch ($type) {
case "INDI":
$addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'INDI_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
$uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'INDI_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
$quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'INDI_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
break;
case "FAM":
$addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'FAM_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
$uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'FAM_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
$quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'FAM_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
break;
case "SOUR":
$addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
$uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
$quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
break;
case "NOTE":
$addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'NOTE_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
$uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'NOTE_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
$quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'NOTE_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
break;
case "REPO":
$addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'REPO_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
$uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'REPO_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
$quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'REPO_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
break;
default:
return;
}
$addfacts = array_merge(CheckFactUnique($uniquefacts, $usedfacts, $type), $addfacts);
$quickfacts = array_intersect($quickfacts, $addfacts);
$translated_addfacts = array();
foreach ($addfacts as $addfact) {
$translated_addfacts[$addfact] = WT_Gedcom_Tag::getLabel($addfact);
}
uasort($translated_addfacts, function ($x, $y) {
return WT_I18N::strcasecmp(WT_I18N::translate($x), WT_I18N::translate($y));
});
echo '<tr><td class="descriptionbox">';
echo WT_I18N::translate('Fact or event');
echo help_link('add_facts'), '</td>';
echo '<td class="optionbox wrap">';
echo '<form method="get" name="newfactform" action="?" onsubmit="return false;">';
echo '<select id="newfact" name="newfact">';
echo '<option value="" disabled selected>' . WT_I18N::translate('<select>') . '</option>';
foreach ($translated_addfacts as $fact => $fact_name) {
echo '<option value="', $fact, '">', $fact_name, '</option>';
}
if ($type == 'INDI' || $type == 'FAM') {
echo '<option value="FACT">', WT_I18N::translate('Custom fact'), '</option>';
echo '<option value="EVEN">', WT_I18N::translate('Custom event'), '</option>';
}
echo '</select>';
echo '<input type="button" value="', WT_I18N::translate('Add'), '" onclick="add_record(\'' . $id . '\', \'newfact\');">';
echo '<span class="quickfacts">';
foreach ($quickfacts as $fact) {
echo '<a href="#" onclick="add_new_record(\'' . $id . '\', \'' . $fact . '\');return false;">', WT_Gedcom_Tag::getLabel($fact), '</a>';
}
echo '</span></form>';
//.........这里部分代码省略.........
示例4: Compare
public static function Compare($x, $y)
{
if ($x->canShowName()) {
if ($y->canShowName()) {
return WT_I18N::strcasecmp($x->getSortName(), $y->getSortName());
} else {
return -1;
// only $y is private
}
} else {
if ($y->canShowName()) {
return 1;
// only $x is private
} else {
return 0;
// both $x and $y private
}
}
}