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


PHP Rank::getRanks方法代码示例

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


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

示例1: createView

 private function createView()
 {
     $this->oView->addData('titre', Language::translate('RANKS_ADMIN_TABLE_TITLE'));
     $oTable = new TableGenerator();
     $oTable->setId(md5('ranks'));
     $oTable->addColumn(Language::translate('RANKS_ADMIN_TABLE_NAME'));
     $oTable->addColumn(Language::translate('RANKS_ADMIN_TABLE_DEFAULT'));
     $oTable->addColumn('');
     $aRanks = Rank::getRanks();
     foreach ($aRanks as $oRank) {
         if ($oRank->isDefault()) {
             $sType = 'success';
             $sText = Language::translate('RANKS_ADMIN_TABLE_YES');
         } else {
             $sType = 'danger';
             $sText = Language::translate('RANKS_ADMIN_TABLE_NO');
         }
         $oLabel = new View('label');
         $oLabel->addData('text', $sText);
         $oLabel->addData('type', $sType);
         $oLabel->create();
         $oTable->addLine(array($oRank->getName(), $oLabel->getCode(), $this->createEditPopup($oRank)));
     }
     $oTable->setBottom($this->createAddPopup());
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->Create();
 }
开发者ID:Jatax,项目名称:TKS,代码行数:28,代码来源:adminranks.controller.php

示例2: createView

 /**
  * Create view
  */
 private function createView()
 {
     $this->oView->addData('titre', Language::translate('PERMISSIONS_ADMIN_TABLE_TITLE'));
     $oTable = new TableGenerator();
     $oTable->setId(md5('Access'));
     $aRanks = Rank::getRanks();
     $oTable->addColumn('');
     foreach ($aRanks as $oRank) {
         $oTable->addColumn($oRank->getName());
     }
     $aModules = Permission::getModules();
     foreach ($aModules as $iId => $sName) {
         $aBuffer = array();
         $aBuffer[] = $sName;
         foreach ($aRanks as $oRank) {
             if ($oRank->checkAccess($sName)) {
                 $sIcon = 'fa-check';
                 $sStyle = 'success';
                 $sNewValue = 'false';
             } else {
                 $sIcon = 'fa-times';
                 $sStyle = 'danger';
                 $sNewValue = 'true';
             }
             $oLabel = new View('minibutton');
             $oLabel->addData('icon', $sIcon);
             $oLabel->addData('style', $sStyle);
             $oLabel->addData('link', 'index.php?p=adminpermissions&m=' . $iId . '&r=' . $oRank->getId() . '&v=' . $sNewValue);
             $oLabel->create();
             $aBuffer[] = $oLabel->getCode();
         }
         $oTable->addLine($aBuffer);
     }
     $oTable->setBottom('');
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->Create();
 }
开发者ID:Jatax,项目名称:TKS,代码行数:41,代码来源:adminpermissions.controller.php

示例3: foreach

                    }
                }
                ?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th><label for="name">Name:</label></th>
                    <td><input type="text" id="name" name="name" required /></td>
                </tr>
                <tr>
                    <th><label for="rank">Rank:</label></th>
                    <td>
                        <select id="rank" name="rank">
                            <?php 
                foreach (Rank::getRanks($_SESSION['user']) as $rank) {
                    echo '<option value=' . $rank->getRank() . '>' . $rank->getName() . '</option>';
                }
                ?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td colspan="2"><button id="create" name="create" class="btn btn-primary" type="button" onclick="createUser()">Create</button></td>
                </tr>
            </table>
        </form>
        <div id="error" class="alert alert-danger" role="alert" style="display: none">

        </div>
        <?php 
开发者ID:Keshaun1222,项目名称:IRIN,代码行数:31,代码来源:users.php


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