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


PHP UsersHelper::isAdmin方法代码示例

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


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

示例1: isset

?>
"
                                        name="address_country"
                                        value="<?php 
echo isset($this->company->address_country) ? $this->company->address_country : "";
?>
"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="tab-pane fade in" id="Assignment">
            <?php 
if (UsersHelper::getRole() == 'exec' || UsersHelper::getRole() == "manager" || !($this->company->id > 0) || array_key_exists('owner_id', $this->company) && UsersHelper::getUserId() == $this->company->owner_id || UsersHelper::isAdmin()) {
    ?>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="control-label" for="">
                            <?php 
    echo ucwords(TextHelper::_('COBALT_COMPANY_OWNER'));
    ?>
                        </label>
                        <div class="controls">
                            <?php 
    echo DropdownHelper::generateDropdown('owner', $ownerId, 'company');
    ?>
                        </div>
                    </div>
开发者ID:houzhenggang,项目名称:cobalt,代码行数:31,代码来源:edit.php

示例2:

        <div class="page-header">
            <!-- ACTIONS -->
            <div class="btn-group pull-right">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">
                    <?php 
echo TextHelper::_('COBALT_ACTION_BUTTON');
?>
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li><a role="button" href="#companyModal" data-toggle="modal"><?php 
echo TextHelper::_('COBALT_EDIT_BUTTON');
?>
</a></li>
                    <?php 
if (UsersHelper::isAdmin()) {
    ?>
                        <li><a href="index.php?task=trash&item_id=<?php 
    echo $company['id'];
    ?>
&item_type=companies&page_redirect=companies" onclick="deleteProfileItem(this)"><?php 
    echo TextHelper::_('COBALT_DELETE');
    ?>
</a></li>
                    <?php 
}
?>
                    <li>
                        <a href="index.php?view=print&item_id=<?php 
echo $company['id'];
?>
开发者ID:houzhenggang,项目名称:cobalt,代码行数:31,代码来源:company.php

示例3:

 if ($event['type'] == 'task') {
     $due_date = $event['due_date'] != '0000-00-00 00:00:00' ? DateHelper::formatDate($event['due_date']) : TextHelper::_('COBALT_NA');
     $time = $event['due_date_hour'];
 } else {
     $due_date = DateHelper::formatDate($event['start_time']);
     $time = $event['start_time_hour'];
 }
 $id = (array_key_exists('parent_id', $event) && $event['parent_id']) != 0 ? $event['parent_id'] : $event['id'];
 echo '<tr id="list_row_' . $id . '" class="cobalt_row_' . $k . '">';
 if ($event['completed'] == 1) {
     $completed = "line-through";
 } else {
     $completed = "";
 }
 echo '<td>';
 if (UsersHelper::getLoggedInUser()->id == $event['owner_id'] || UsersHelper::getLoggedInUser()->id == $event['assignee_id'] || UsersHelper::isAdmin() || UsersHelper::getRole() == "exec") {
     echo '<input type="checkbox" name="ids[]" value="' . $id . '" />';
 }
 echo '</td>';
 echo '<td><div class="dropdown"><a data-toggle="dropdown" role="button" class="dropdown-toggle ' . $completed . '" id="event_menu_' . $event['id'] . '_link" >';
 echo $event['name'];
 echo '</a>';
 echo '<ul class="dropdown-menu" role="menu" aria-labelledby="event_menu_' . $event['id'] . '_link">';
 if ($event['completed'] == 1) {
     echo '<li><a href="javascript:void(0);" onclick="Calendar.markEventIncomplete(this)" >' . TextHelper::_('COBALT_MARK_INCOMPLETE') . '</a></li>';
 } else {
     echo '<li><a href="javascript:void(0);" onclick="Calendar.markEventComplete(this)" >' . TextHelper::_('COBALT_MARK_COMPLETE') . '</a></li>';
     echo '<li><a href="javascript:void(0);" onclick="Calendar.postponeEvent(this,1)" >' . TextHelper::_('COBALT_POSTPONE_1_DAY') . '</a></li>';
     echo '<li><a href="javascript:void(0);" onclick="Calendar.postponeEvent(this,7)" >' . TextHelper::_('COBALT_POSTPONE_7_DAYS') . '</a></li>';
 }
 $id = (array_key_exists('parent_id', $event) && $event['parent_id']) != 0 ? $event['parent_id'] : $event['id'];
开发者ID:houzhenggang,项目名称:cobalt,代码行数:31,代码来源:list.php


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