本文整理汇总了PHP中Setting::makeURL方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::makeURL方法的具体用法?PHP Setting::makeURL怎么用?PHP Setting::makeURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::makeURL方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<div class="topbar">
<div class="topbar-inner">
<div class="container-fluid">
<a class="brand" href="index.php">Tattle </a>
<ul class="nav">
<?
$current_url = fURL::getWithQueryString();
echo '<li' . ($current_url == '' ? ' class="active"' : '') . '><a href="index.php">Alerts</a></li>'. "\n";
$check_list = Check::makeURL('list');
echo '<li' . ($current_url == $check_list ? ' class="active"' : '') . '><a href="' . $check_list . '" >Checks</a></li>' . "\n";
$subscription_list = Subscription::makeURL('list');
echo '<li' . ($current_url == $subscription_list ? ' class="active"' : '') .'><a href="' . $subscription_list . '" >Subscriptions</a></li>' . "\n";
$dashboard_list = Dashboard::makeURL('list');
echo '<li' . ($current_url == $dashboard_list ? ' class="active"' : '') . '><a href="' . $dashboard_list . '">Dashboards</a></li>';
$setting_list = Setting::makeURL('list');
echo '<li' . ($current_url == $setting_list ? ' class="active"' : '') . '><a href="' . $setting_list . '" >Settings</a></li>' . "\n";
if (fAuthorization::checkAuthLevel('admin')) {
$user_list = User::makeURL('list');
echo '<li><a href="' . User::makeURL('list') . '" >Users</a></li>';
}
?>
</ul>
<?php
if (is_numeric(fSession::get('user_id'))) {
?>
<p class="pull-right">
Logged in as <a href="<?php
echo User::makeUrl('edit', fSession::get('user_id'));
?>
"><?php
示例2: catch
$first = TRUE;
foreach ($list_plugin_settings as $setting_name => $setting) {
?>
<tr>
<td><?=$setting['friendly_name']; ?></td>
<td><?=(isset($setting['value']) ? $setting['value'] : 'Default'); ?></td>
<td><?=$setting['default']; ?></td>
<td><?php
if (!isset($owner_id)) {
$owner_id = NULL;
}
if (isset($setting['value'])) {
echo '<a href="' . Setting::makeURL('edit',$setting_type,$setting_name,$owner_id) . '">Update</a> | ';
echo '<a href="' . Setting::makeURL('delete',$setting_type,$setting_name,$owner_id) . '">Delete</a>';
} else {
echo '<a href="' . Setting::makeURL('add',$setting_type,$setting_name,$owner_id) . '">Override</a>';
} ?>
</td>
</tr>
<?php } ?>
</tbody></table>
<?
} catch (fEmptySetException $e) {
?>
<p class="info">No settings? uh-oh</p>
<?php
}
?>
</div>
<?php $tmpl->place('footer') ?>
示例3:
$current_url = '?' . fURL::getQueryString();
echo '<li' . (fURL::is_menu_active('index') ? ' class="active"' : '') . '><a href="index.php">Alerts</a></li>' . "\n";
$threshold_check_list = Check::makeURL('list', 'threshold');
echo '<li' . (fURL::is_menu_active('check', 'type=threshold') ? ' class="active"' : '') . '><a href="' . $threshold_check_list . '" >Threshold Checks</a></li>' . "\n";
$predictive_check_list = Check::makeURL('list', 'predictive');
echo '<li' . (fURL::is_menu_active('check', 'type=predictive') ? ' class="active"' : '') . '><a href="' . $predictive_check_list . '" >Predictive Checks</a></li>' . "\n";
$subscription_list = Subscription::makeURL('list');
echo '<li' . (fURL::is_menu_active('subscription') ? ' class="active"' : '') . '><a href="' . $subscription_list . '" >Subscriptions</a></li>' . "\n";
$dashboard_list = Dashboard::makeURL('list');
echo '<li' . (fURL::is_menu_active('dashboard') ? ' class="active"' : '') . '><a href="' . $dashboard_list . '">Dashboards</a></li>';
$group_list = Group::makeURL('list');
echo '<li' . (fURL::is_menu_active('group') ? ' class="active"' : '') . '><a href="' . $group_list . '">Groups</a></li>';
$setting_list = Setting::makeURL('list', 'user');
echo '<li' . (fURL::is_menu_active('setting', 'type=user') ? ' class="active"' : '') . '><a href="' . $setting_list . '" >Settings</a></li>' . "\n";
if (fAuthorization::checkAuthLevel('admin')) {
$setting_list = Setting::makeURL('list', 'system');
echo '<li' . (fURL::is_menu_active('setting', 'type=system') ? ' class="active"' : '') . '><a href="' . $setting_list . '" >System Settings</a></li>' . "\n";
$user_list = User::makeURL('list');
echo '<li' . (fURL::is_menu_active('user') ? ' class="active"' : '') . '><a href="' . User::makeURL('list') . '" >Users</a></li>';
}
?>
</ul>
<?php
if (is_numeric(fSession::get('user_id'))) {
?>
<p class="navbar-text navbar-right">
<a href="<?php
echo User::makeUrl('edit', fSession::get('user_id'));
?>
">
<span style="color:white;">Logged in as</span>
示例4: catch
fURL::redirect(Setting::makeUrl('list'));
} catch (fExpectedException $e) {
fMessaging::create('error', fURL::get(), $e->getMessage());
}
include VIEW_PATH . '/delete.php';
// --------------------------------- //
} elseif ('edit' == $action) {
try {
$setting = new Setting(array('name' => $setting_name, 'owner_id' => $owner_id));
if (fRequest::isPost()) {
$setting->populate();
fRequest::validateCSRFToken(fRequest::get('token'));
$setting->store();
fMessaging::create('affected', fURL::get(), $setting->getFriendlyName());
fMessaging::create('success', fURL::get(), 'The setting ' . $setting->getFriendlyName() . ' was successfully updated');
fURL::redirect(Setting::makeURL('list', $setting_type, NULL, $owner_id));
}
} catch (fNotFoundException $e) {
fMessaging::create('error', fURL::get(), 'The Setting requested, ' . fHTML::encode($setting_name) . ', could not be found');
fURL::redirect(Setting::makeUrl('list'));
} catch (fExpectedException $e) {
fMessaging::create('error', fURL::get(), $e->getMessage());
}
include VIEW_PATH . '/add_edit_setting.php';
// --------------------------------- //
} elseif ('add' == $action) {
$setting = new Setting();
if ('user' == $setting_type) {
$list_plugin_settings = $plugin_user_settings;
} else {
$list_plugin_settings = $plugin_settings;
示例5: if
<thead>
<tr>
<th>Username</th>
<th>Email</th>
<th>Action</th>
</tr></thead><tbody>
<?php
$first = TRUE;
foreach ($users as $user) {
?>
<tr>
<td><?=$user->prepareUsername(); ?></td>
<td><?=$user->prepareEmail(); ?></td>
<td><?php if (fSession::get('user_id') == $user->getUserId() || fAuthorization::checkAuthLevel('admin')) {
echo '<a href="' . User::makeUrl('edit',$user) . '">Edit</a> | ';
echo '<a href="' . Setting::makeURL('list','user',NULL,$user->getUserId()) . '">Settings</a>';
} ?>
<?php if (fAuthorization::checkAuthLevel('admin') && $user->getUserId() != 1) {
?> <a href="<?=User::makeUrl('delete',$user); ?>">Delete</a></td>
<?php } ?>
</tr>
<?php } ?>
</tbody></table>
<?
} catch (fEmptySetException $e) {
?>
<p class="info">There are currently no Tattle users? <a href="<?=User::makeUrl('add'); ?>">Add one now</a></p>
<?php
}
?>
</div>
示例6: array
<?php
$page_title = $action == 'add' ? 'Override setting' : 'Edit Setting';
$tmpl->set('title', $page_title);
$breadcrumbs[] = array('name' => 'Settings', 'url' => Setting::makeURL('list'), 'active' => false);
$breadcrumbs[] = array('name' => $page_title, 'url' => '?' . fURL::getQueryString(), 'active' => true);
//$tmpl->set('breadcrumbs',$breadcrumbs);
$tmpl->place('header');
$query_string = '';
if (isset($setting_name)) {
$query_string = "&setting_name={$setting_name}";
}
if (isset($user_id)) {
$query_string .= "&user_id={$user_id}";
}
if (isset($setting_type)) {
$query_string .= "&setting_type={$setting_type}";
}
?>
<div class="row">
<div class="col-md-6">
<form action="?action=<?php
echo $action . $query_string;
?>
" method="post" class="form-horizontal">
<div class="form-group">
<label for="line-friendly_name" class="col-sm-2 control-label">Name<em>*</em></label>
<div class="col-sm-10">
<?php
echo $setting->encodeFriendlyName();
?>