本文整理汇总了PHP中AdminPage::get_admin_token方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminPage::get_admin_token方法的具体用法?PHP AdminPage::get_admin_token怎么用?PHP AdminPage::get_admin_token使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminPage
的用法示例。
在下文中一共展示了AdminPage::get_admin_token方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
$date = date('Y-m-d', $stamp);
// Get and sort the events
$calendar = new reasonCalendar(array('start_date' => $date, 'end_date' => $date, 'view' => 'daily', 'show_statuses' => array('show', 'tentative', 'cancelled')));
$calendar->run();
$events = $calendar->get_all_events();
usort($events, 'compare_times');
// Figure out the URL for the borrow action
parse_str(trim($_REQUEST['params'], '?'), $params);
$editing_id = $params['id'];
$params['cur_module'] = 'DoBorrow';
echo '<h4>Other events for ' . date('l, F jS', $stamp) . ':</h4>';
if (count($events)) {
// Ask the admin page class for the token that will allow us
// to complete the borrow action.
$admin = new AdminPage();
$params['admin_token'] = $admin->get_admin_token();
echo '<p>Click an event to add it to the <em>' . $_REQUEST['site'] . '</em> calendar:</p>';
echo '<ul class="preview_list">';
foreach ($events as $event) {
$classes = array($event->get_value('show_hide') . '_status');
if ($editing_id == $event->get_value('id')) {
$classes[] = 'current';
}
echo '<li class="' . join(' ', $classes) . '">';
$params['id'] = $event->get_value('id');
if (substr($event->get_value('datetime'), 11) != '00:00:00') {
$time = prettify_mysql_datetime($event->get_value('datetime'), 'g:ia');
} else {
$time = 'All day';
}
if ($event->get_value('show_hide') == 'tentative') {