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


PHP Lang::sort方法代码示例

本文整理汇总了PHP中Lang::sort方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::sort方法的具体用法?PHP Lang::sort怎么用?PHP Lang::sort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lang的用法示例。


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

示例1: generateContent

 protected function generateContent()
 {
     $conditions = [];
     if (!User::isInGroup(U_GROUP_EMPLOYEE)) {
         $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
     }
     if ($_ = $this->filterObj->getConditions()) {
         $conditions[] = $_;
     }
     $itemsets = new ItemsetList($conditions);
     $this->extendGlobalData($itemsets->getJSGlobals());
     // recreate form selection
     $this->filter = array_merge($this->filterObj->getForm('form'), $this->filter);
     $this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
     $this->filter['fi'] = $this->filterObj->getForm();
     $this->addJS('?data=weight-presets&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
     $lv = array('file' => 'itemset', 'data' => $itemsets->getListviewData(), 'params' => []);
     if (!empty($this->filter['fi']['extraCols'])) {
         $lv['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
     }
     // create note if search limit was exceeded
     if ($itemsets->getMatches() > CFG_SQL_LIMIT_DEFAULT) {
         $lv['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), CFG_SQL_LIMIT_DEFAULT);
         $lv['params']['_truncated'] = 1;
     }
     if ($this->filterObj->error) {
         $lv['params']['_errors'] = '$1';
     }
     $this->lvTabs[] = $lv;
     // sort for dropdown-menus
     Lang::sort('itemset', 'notes', SORT_NATURAL);
     Lang::sort('game', 'si');
 }
开发者ID:saqar,项目名称:aowow,代码行数:33,代码来源:itemsets.php

示例2: generateContent

 protected function generateContent()
 {
     $conditions = [];
     if (!User::isInGroup(U_GROUP_EMPLOYEE)) {
         $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
     }
     // include child categories if current category is empty
     if ($this->category) {
         $conditions[] = ['category', (int) end($this->category)];
     }
     // recreate form selection
     $this->filter = $this->filterObj->getForm('form');
     $this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : null;
     $this->filter['fi'] = $this->filterObj->getForm();
     if ($fiCnd = $this->filterObj->getConditions()) {
         $conditions[] = $fiCnd;
     }
     $acvList = new AchievementList($conditions);
     if (!$acvList->getMatches()) {
         $curCats = $catList = [!empty($this->category) ? (int) end($this->category) : 0];
         while ($curCats) {
             $curCats = DB::Aowow()->SelectCol('SELECT Id FROM ?_achievementcategory WHERE parentCategory IN (?a)', $curCats);
             $catList = array_merge($catList, $curCats);
         }
         $conditions = [];
         if ($fiCnd) {
             $conditions[] = $fiCnd;
         }
         if ($catList) {
             $conditions[] = ['category', $catList];
         }
         $acvList = new AchievementList($conditions);
     }
     $params = $data = [];
     if (!$acvList->error) {
         $data = $acvList->getListviewData();
         // fill g_items, g_titles, g_achievements
         $this->extendGlobalData($acvList->getJSGlobals());
         // if we are have different cats display field
         if ($acvList->hasDiffFields(['category'])) {
             $params['visibleCols'] = "\$['category']";
         }
         if (!empty($this->filter['fi']['extraCols'])) {
             $params['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
         }
         // create note if search limit was exceeded
         if ($acvList->getMatches() > CFG_SQL_LIMIT_DEFAULT) {
             $params['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_achievementsfound', $acvList->getMatches(), CFG_SQL_LIMIT_DEFAULT);
             $params['_truncated'] = 1;
         }
         if ($this->filterObj->error) {
             $params['_errors'] = '$1';
         }
     }
     $this->lvTabs[] = array('file' => 'achievement', 'data' => $data, 'params' => $params);
     // sort for dropdown-menus in filter
     Lang::sort('game', 'si');
 }
开发者ID:saqar,项目名称:aowow,代码行数:58,代码来源:achievements.php

示例3: generateContent

 protected function generateContent()
 {
     $this->addJS('?data=weight-presets.realms&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
     $tDistrib = $this->getTalentDistribution($this->character['talents']['builds'][$this->character['talents']['active']]['talents']);
     $exampleRow = array('id' => 0, 'name' => $this->character['name'], 'achievementpoints' => $this->character['achievementpoints'], 'guild' => $this->character['guild'], 'guildRank' => -1, 'realm' => $this->character['realm'][0], 'realmname' => $this->character['realm'][1], 'battlegroup' => $this->character['battlegroup'][0], 'battlegroupname' => $this->character['battlegroup'][0], 'region' => $this->character['region'][0], 'level' => $this->character['level'], 'race' => $this->character['race'], 'gender' => $this->character['gender'], 'classs' => $this->character['classs'], 'faction' => $this->character['faction'], 'talenttree1' => $tDistrib[0], 'talenttree2' => $tDistrib[1], 'talenttree3' => $tDistrib[2], 'talentspec' => $this->character['talents']['active']);
     // description:'{$curr.description|escape:"javascript"}',
     // icon:'{$curr.icon|escape:"javascript"}',
     // published:1,
     // pinned:1,
     // deleted:1,
     // dont send ID for real chars unless they have some kind of custom avatar
     // on second thought .. ids are required for resync, but the function that generates the icon is faulty
     $this->lvTabs[] = array('file' => 'profile', 'data' => [$exampleRow], 'params' => ['id' => 'characters', 'name' => '$LANG.tab_characters', 'hideCount' => 1, '_truncated' => 1, 'roster' => 3, 'visibleCols' => "\$['race','classs','level','talents','achievementpoints']", 'note' => '$$WH.sprintf(LANG.lvnote_charactersfound, \'20,592,390\', 200) + LANG.dash + LANG.lvnote_tryfiltering.replace(\'<a>\', \'<a href="javascript:;" onclick="fi_toggle()">\')', 'onBeforeCreate' => '$pr_initRosterListview']);
     $this->filter = ['query' => 1, 'fi' => []];
     Lang::sort('game', 'cl');
     Lang::sort('game', 'ra');
 }
开发者ID:saqar,项目名称:aowow,代码行数:17,代码来源:profiles.php

示例4: generateContent

 protected function generateContent()
 {
     $this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
     $conditions = [];
     if (!User::isInGroup(U_GROUP_EMPLOYEE)) {
         $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
     }
     if ($this->category) {
         $conditions[] = ['type', $this->category[0]];
         $this->petFamPanel = $this->category[0] == 1;
     } else {
         $this->petFamPanel = false;
     }
     if ($_ = $this->filterObj->getConditions()) {
         $conditions[] = $_;
     }
     // beast subtypes are selected via filter
     $npcs = new CreatureList($conditions, ['extraOpts' => $this->filterObj->extraOpts]);
     // recreate form selection
     $this->filter = array_merge($this->filterObj->getForm('form'), $this->filter);
     $this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
     $this->filter['fi'] = $this->filterObj->getForm();
     $repCols = $this->filterObj->getForm('reputationCols');
     $tabData = array('data' => array_values($npcs->getListviewData($repCols ? NPCINFO_REP : 0x0)));
     if ($repCols) {
         $tabData['extraCols'] = '$fi_getReputationCols(' . Util::toJSON($repCols) . ')';
     } else {
         if (!empty($this->filter['fi']['extraCols'])) {
             $tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
         }
     }
     if ($this->category) {
         $tabData['hiddenCols'] = ['type'];
     }
     // create note if search limit was exceeded
     if ($npcs->getMatches() > CFG_SQL_LIMIT_DEFAULT) {
         $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_npcsfound', $npcs->getMatches(), CFG_SQL_LIMIT_DEFAULT);
         $tabData['_truncated'] = 1;
     }
     if ($this->filterObj->error) {
         $tabData['_errors'] = 1;
     }
     $this->lvTabs[] = ['creature', $tabData];
     // sort for dropdown-menus
     Lang::sort('game', 'fa');
 }
开发者ID:TrinityCore,项目名称:aowow,代码行数:46,代码来源:npcs.php

示例5: generateContent


//.........这里部分代码省略.........
         if ($upgItemData) {
             if ($grouping == 1) {
                 $upg = array_keys(array_filter($this->filter['upg'], function ($v) use($group) {
                     return $v == $group;
                 }));
                 foreach ($upg as $uId) {
                     $tabData['data'][$uId] = $upgItemData[$uId];
                 }
                 if ($upg) {
                     $tabData['_upgradeIds'] = $upg;
                 }
             } else {
                 if ($grouping) {
                     $upg = array_keys($this->filter['upg']);
                     $tabData['_upgradeIds'] = $upg;
                     foreach ($upgItemData as $uId => $data) {
                         // using numeric keys => cant use array_merge
                         $tabData['data'][$uId] = $data;
                     }
                 }
             }
         }
         if ($grouping) {
             switch ($grouping) {
                 case 1:
                     $tabData['id'] = 'slot-' . $group;
                     break;
                 case 2:
                     $tabData['id'] = $group > 0 ? 'level-' . $group : 'other';
                     break;
                 case 3:
                     $tabData['id'] = $group ? 'source-' . $group : 'unknown';
                     break;
             }
             $tabData['name'] = $nameSource[$group];
             $tabData['tabs'] = '$tabsGroups';
         }
         if (!empty($this->filter['fi']['setWeights'])) {
             if ($items->hasSetFields(['armor'])) {
                 $tabData['visibleCols'][] = 'armor';
             }
         }
         // create note if search limit was exceeded; overwriting 'note' is intentional
         if ($items->getMatches() > $maxResults && count($groups) > 1) {
             $tabData['_truncated'] = 1;
             $cls = isset($this->category[0]) ? '=' . $this->category[0] : '';
             $override = ['gb' => ''];
             if ($upg) {
                 $override['upg'] = implode(':', $upg);
             }
             switch ($grouping) {
                 case 1:
                     $override['sl'] = $group;
                     $tabData['note'] = '$$WH.sprintf(LANG.lvnote_viewmoreslot, \'' . $cls . '\', \'' . $this->filterObj->urlize($override) . '\')';
                     break;
                 case 2:
                     if ($group > 0) {
                         $override['minle'] = $group;
                         $override['maxle'] = $group;
                     } else {
                         $override['maxle'] = abs($group) - 1;
                     }
                     $tabData['note'] = '$$WH.sprintf(LANG.lvnote_viewmorelevel, \'' . $cls . '\', \'' . $this->filterObj->urlize($override) . '\')';
                     break;
                 case 3:
                     if ($_ = [null, 3, 4, 5, 6, 7, 9, 10, 11][$group]) {
                         $tabData['note'] = '$$WH.sprintf(LANG.lvnote_viewmoresource, \'' . $cls . '\', \'' . $this->filterObj->urlize($override, ['cr' => 128, 'crs' => $_, 'crv' => 0]) . '\')';
                     }
                     break;
             }
         } else {
             if ($items->getMatches() > $maxResults) {
                 $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsfound', $items->getMatches(), CFG_SQL_LIMIT_DEFAULT);
                 $tabData['_truncated'] = 1;
             }
         }
         foreach ($tabData as $k => $p) {
             if (!$p && $k != 'data') {
                 unset($tabData[$k]);
             }
         }
         if ($grouping) {
             $tabData['hideCount'] = 1;
         }
         $tabData['data'] = array_values($tabData['data']);
         $this->lvTabs[] = ['item', $tabData];
     }
     // reformat for use in template
     if (!empty($this->filter['upg'])) {
         $this->filter['upg'] = implode(':', array_keys($this->filter['upg']));
     }
     // whoops, we have no data? create emergency content
     if (empty($this->lvTabs)) {
         $this->forceTabs = false;
         $this->lvTabs[] = ['item', ['data' => []]];
     }
     // sort for dropdown-menus
     Lang::sort('game', 'ra');
     Lang::sort('game', 'cl');
 }
开发者ID:TrinityCore,项目名称:aowow,代码行数:101,代码来源:items.php

示例6: generateContent


//.........这里部分代码省略.........
                 if (isset($this->category[2])) {
                     $conditions[] = ['OR', ['s.skillLine1', $this->category[2]], ['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $this->category[2]]]];
                 } else {
                     if (isset($this->category[1])) {
                         $conditions[] = ['OR', ['s.skillLine1', $this->validCats[7][$this->category[1]]], ['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $this->validCats[7][$this->category[1]]]]];
                     }
                 }
                 break;
             case 9:
                 // Secondary Skills
                 array_push($visibleCols, 'source');
                 $conditions[] = ['s.typeCat', 9];
                 if (isset($this->category[1])) {
                     $conditions[] = ['OR', ['s.skillLine1', $this->category[1]], ['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $this->category[1]]]];
                     if (!empty($this->shortFilter[$this->category[1]])) {
                         $sf = $this->shortFilter[$this->category[1]];
                         $txt = '';
                         if ($sf[0] && $sf[1]) {
                             $txt = sprintf(Lang::spell('relItems', 'crafted'), $sf[0]) . Lang::spell('relItems', 'link') . sprintf(Lang::spell('relItems', 'recipes'), $sf[1]);
                         } else {
                             if ($sf[0]) {
                                 $txt = sprintf(Lang::spell('relItems', 'crafted'), $sf[0]);
                             } else {
                                 if ($sf[1]) {
                                     $txt = sprintf(Lang::spell('relItems', 'recipes'), $sf[1]);
                                 }
                             }
                         }
                         $note = Lang::spell('cat', $this->category[0], $this->category[1]);
                         if (is_array($note)) {
                             $note = $note[0];
                         }
                         $tabData['note'] = sprintf(Lang::spell('relItems', 'base'), $txt, $note);
                         $tabData['sort'] = ['skill', 'name'];
                     }
                 }
                 break;
             case 11:
                 // Professions
                 array_push($visibleCols, 'source');
                 $conditions[] = ['s.typeCat', 11];
                 if (isset($this->category[2])) {
                     if ($this->category[2] == 9787) {
                         // general weaponsmithing
                         $conditions[] = ['s.reqSpellId', [9787, 17039, 17040, 17041]];
                     } else {
                         $conditions[] = ['s.reqSpellId', $this->category[2]];
                     }
                 } else {
                     if (isset($this->category[1])) {
                         $conditions[] = ['s.skillLine1', $this->category[1]];
                     }
                 }
                 if (isset($this->category[1])) {
                     $conditions[] = ['s.skillLine1', $this->category[1]];
                     if (!empty($this->shortFilter[$this->category[1]])) {
                         $sf = $this->shortFilter[$this->category[1]];
                         $txt = '';
                         if ($sf[0] && $sf[1]) {
                             $txt = sprintf(Lang::spell('relItems', 'crafted'), $sf[0]) . Lang::spell('relItems', 'link') . sprintf(Lang::spell('relItems', 'recipes'), $sf[1]);
                         } else {
                             if ($sf[0]) {
                                 $txt = sprintf(Lang::spell('relItems', 'crafted'), $sf[0]);
                             } else {
                                 if ($sf[1]) {
                                     $txt = sprintf(Lang::spell('relItems', 'recipes'), $sf[1]);
开发者ID:TrinityCore,项目名称:aowow,代码行数:67,代码来源:spells.php


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