本文整理汇总了PHP中Access::hasPrivilege方法的典型用法代码示例。如果您正苦于以下问题:PHP Access::hasPrivilege方法的具体用法?PHP Access::hasPrivilege怎么用?PHP Access::hasPrivilege使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Access
的用法示例。
在下文中一共展示了Access::hasPrivilege方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prayerhistory
/**
* Loads prayer history page.
*/
public function prayerhistory($lang = 'ch')
{
if (!Access::hasPrivilege(Access::PRI_READ_PRAYER)) {
// TODO: show authentication error.
show_404();
}
if (!file_exists('application/views/' . $lang . '/request/requesthistory.php')) {
// Whoops, we don't have a page for that!
show_404();
}
$this->load->model('request_model', 'request');
$data['requests'] = $this->request->get_requests($lang);
$this->loadHeader($lang);
$this->load->view($lang . '/request/requesthistory', $data);
$this->load->view('templates/footer');
}
示例2: delete_album
/**
* Deletes an album.
*
* @param string $album_id Album ID that used for deleting an album.
*
* @return void
*/
public function delete_album($album_id)
{
if (!Access::hasPrivilege(Access::PRI_UPDATE_ALBUM)) {
// TODO: show authentication error.
show_404();
}
$this->load->model('album_model', 'album');
$this->album->delete_album($album_id);
}
示例3:
echo $album['title'];
?>
</a></li>
</ol>
<div class="page-header">
<h1><?php
echo $album['title'];
?>
</h1>
</div>
<?php
# Only display the buttons when the loggin user has the update album privilege.
?>
<?php
if (Access::hasPrivilege(Access::PRI_UPDATE_ALBUM)) {
?>
<div class="col-lg-12">
<a href="<?php
echo site_url() . '/gallery/update_album/' . $album['id'];
?>
" class="btn btn-primary" role="button">更改照片</a>
<a href="<?php
echo site_url() . '/gallery/update_album_info/' . $album['id'];
?>
" class="btn btn-warning" role="button">更改信息</a>
<a href="#" class="btn btn-danger" role="button">删除相册</a>
</div>
<hr class="mvccc-hr"/>
<?php
}
示例4: doDeleteEvent
public function doDeleteEvent($id)
{
if (!Access::hasPrivilege(Access::PRI_UPDATE_CALENDER)) {
// TODO: show authentication error.
show_404();
}
$this->load->model('event_model', 'event');
$data['events'] = $this->event->delete_event($id);
}
示例5: site_url
<li><a href="<?php
echo site_url();
?>
/pages/resources/donate">捐贈須知</a></li>
<li><a href="<?php
echo site_url();
?>
/pages/resources/links">重要鏈接</a></li>
<li><a href="<?php
echo site_url();
?>
/gallery/home">照片集錦</a></li>
<li><a href="#">錄音錄像</a></li>
</ul>
</li>
<?php
if (Access::hasPrivilege(Access::PRI_READ_PRAYER)) {
printf('<li class="dropdown">');
printf('<a href="#" class="dropdown-toggle" data-toggle="dropdown">同工服務<b class="caret"></b></a>');
printf('<ul class="dropdown-menu">');
printf('<li><a href="%s">代禱贊美</a></li>', site_url() . "/prayer/prayerList");
printf('<li><a href="%s">差傳事工</a></li>', site_url() . "/pages/missions");
printf('</ul>');
printf('</li>');
}
?>
</ul>
</div><!-- /.nav-collapse -->
</div><!-- /.container -->
</div><!-- /.navbar -->
示例6: site_url
$video_url = site_url() . '/worship/video/' . $video['id'];
$audio_url = site_url() . '/worship/audio/' . $video['id'];
$download_url = site_url() . '/worship/direct_download/' . $video['audio_name'];
printf("<tr id='sundaymessage-%s'>", $video['id']);
printf("<td>%s</td>", $video['date']);
printf("<td>%s</td>", $video['title']);
printf("<td>%s</td>", Bible::convertEngRangesToCh($video['scripture']));
printf("<td>%s</td>", $video['speaker']);
printf("<td><a href=\"%s\">", $download_url);
printf(" <span class=\"glyphicon glyphicon-volume-up\"></span></a></td>");
printf("<td><a href=\"%s\">", $audio_url);
printf(" <span class=\"glyphicon glyphicon-headphones\"></span></a></td>");
printf("<td><a href=\"%s\">", $video_url);
printf(" <span class=\"glyphicon glyphicon-facetime-video\"></span></a></td>");
// update/delete buttons
if (Access::hasPrivilege(Access::PRI_UPDATE_WORSHIP)) {
$url = site_url() . '/worship/updateSundayMessage/' . $video['id'];
printf('<td><span class="pull-right"><a href="%s" class="btn btn-info btn-xs" role="button">更改</a>', $url);
$delete_url = site_url() . '/worship/deleteSundayMessage/' . $video['id'];
# Delete button
printf(' <button class="btn btn-danger btn-xs" data-toggle="modal" data-target="#%s" data-id="%s">刪除</button></span></td>', $video['id'], $video['id']);
# Delete modal
printf('<div class="modal fade" id="%s" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">', $video['id']);
printf('<div class="modal-dialog">');
printf('<div class="modal-content">');
printf('<div class="modal-body">');
printf('刪除主日信息: ' . $video['title']);
printf('</div>');
printf('<div class="modal-footer">');
printf('<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>');
printf('<button type="button" class="btn btn-danger" name="delete-sundaymessage" data-dismiss="modal" target-id="%s" url="%s">確認</button>', $video['id'], $delete_url);
示例7: deleteSundayMessage
/**
* Delete a Sunday message
*/
public function deleteSundayMessage($id, $lang = 'ch')
{
if (!Access::hasPrivilege(Access::PRI_UPDATE_WORSHIP)) {
// TODO: show authentication error.
show_404();
}
$this->video->delete_video($id);
redirect('/worship/index');
die;
}
示例8: printf
printf('<div class="modal-content">');
printf('<div class="modal-header">');
printf('<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>');
printf('<h4 class="modal-title" id="myModalLabel">%s</h4>', $event['title']);
printf('</div>');
printf('<div class="modal-body">');
printf('<small>%s | %s</small>', $weekDay, $event['start_time']);
printf('<p>%s</p>', $event['content']);
printf('</div>');
printf('<div class="modal-footer">');
printf('<button type="button" class="btn btn-default" data-dismiss="modal">%s</button>', $this->lang->line('button_close'));
printf('</div>');
printf('</div>');
printf('</div>');
printf('</div>');
if (Access::hasPrivilege(Access::PRI_UPDATE_CALENDER)) {
# Update button
printf(' ');
printf('<a href="%s" class="btn btn-warning" role="button">%s</a>', $updateEventUrl, $this->lang->line('button_update'));
printf(' ');
# Delete button
printf('<button class="btn btn-danger" data-toggle="modal" data-target="#%s">%s</button>', $event['id'], $this->lang->line('button_delete'));
# Delete modal
printf('<div class="modal fade" id="%s" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">', $event['id']);
printf('<div class="modal-dialog">');
printf('<div class="modal-content">');
printf('<div class="modal-header">');
printf('<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>');
printf('<h4 class="modal-title" id="myModalLabel">%s</h4>', $event['title']);
printf('</div>');
printf('<div class="modal-body">');