當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。