本文整理汇总了PHP中Dashboard::loadAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Dashboard::loadAll方法的具体用法?PHP Dashboard::loadAll怎么用?PHP Dashboard::loadAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dashboard
的用法示例。
在下文中一共展示了Dashboard::loadAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dashboard_plugin_preference_page
function dashboard_plugin_preference_page()
{
global $myUser, $_, $conf;
if (isset($_['section']) && $_['section'] == 'preference' && @$_['block'] == 'dashboard') {
if ($myUser != false) {
require_once dirname(__FILE__) . '/Dashboard.class.php';
$dashManager = new Dashboard();
$dashes = $dashManager->loadAll(array('user' => $myUser->getId()));
?>
<div class="span9 userBloc">
<legend>Dashboard disponibles</legend>
<form style="margin:0;" action="action.php?action=DASH_ADD_VIEW" method="POST">
<div class="input-append">
<input type="text" name="viewName" placeholder="Salon,cuisine...">
<button type="submit" class="btn">Ajouter la vue</button>
</div>
</form>
<table class="table table-striped table-bordered">
<tr>
<th>Nom</th>
<th>Options</th>
</tr>
<?php
foreach ($dashes as $dash) {
?>
<tr class="command" data-id="<?php
echo $dash->id;
?>
">
<td><?php
echo $dash->label;
?>
</td>
<td><a class="btn" href="action.php?action=DASH_DELETE_VIEW&id=<?php
echo $dash->id;
?>
"><i class="fa fa-times"></i></a></td>
</tr>
<?php
}
?>
<tr>
<td colspan="3"><div class="btn" onclick="plugin_vocalinfo_save();">Enregistrer</div></td>
</tr>
</table>
</div>
<?php
} else {
?>
<div id="main" class="wrapper clearfix">
<article>
<h3>Vous devez être connecté</h3>
</article>
</div>
<?php
}
}
}
示例2: dashboard_plugin_home
function dashboard_plugin_home()
{
global $_, $myUser;
if (!isset($_['module'])) {
require_once 'Dashboard.class.php';
$dashManager = new Dashboard();
$dashes = $dashManager->loadAll(array('user' => $myUser->getId()));
echo '<form style="margin:0;" action="action.php?action=DASH_ADD_VIEW" method="POST">';
echo '<select id="dashboard_switch" onchange="plugin_dashboard_load_view($(this).val());"><option value="">-</option>';
foreach ($dashes as $dash) {
echo '<option ' . ($dash->default == '1' ? 'selected="selected"' : '') . ' value="' . $dash->id . '">' . $dash->label . '</option>';
}
echo '</select>
<div class="input-append">
<input type="text" name="viewName" placeholder="Salon,cuisine...">
<button type="submit" class="btn">Ajouter la vue</button>
</div>
</form>
';
echo '<div id="dashboard"></div>';
}
}