当前位置: 首页>>代码示例>>PHP>>正文


PHP Widgets::get_id方法代码示例

本文整理汇总了PHP中Widgets::get_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Widgets::get_id方法的具体用法?PHP Widgets::get_id怎么用?PHP Widgets::get_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Widgets的用法示例。


在下文中一共展示了Widgets::get_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displayDashboard

function displayDashboard()
{
    global $tool, $propertyForm;
    echo "<form method='post' action='' style='width:1024px;'>";
    echo "<table id=\"sortDataTable\" class='sortable' cellspacing=\"0\" cellpadding=\"0\" border=\"1\" style='width:100%; clear:left;'>\n\t\t<thead>\n\t\t<tr><th style='text-align:left;'>Dashboard widgets</th>\n\t\t\t<th style='text-align:left;'>Description</th>\n\t\t\t<th style='text-align:left;'>Version</th></tr>\n\t\t</thead>\n\t\t<tbody>";
    $widgets = Widgets::get_widgets();
    $curUser = new DashboardUsers($_SESSION['userid']);
    $userWidgets = $curUser->get_users_widgets();
    foreach ($widgets as $id => $value) {
        $curWidget = new Widgets($id);
        if ($curWidget->get_enabled()) {
            echo "<tr>";
            $enabled = false;
            foreach ($userWidgets as $widgetID => $userID) {
                if ($widgetID == $curWidget->get_id()) {
                    echo "<td><input type='checkbox' checked name='list[]' value='" . $curWidget->get_id() . "' />" . $curWidget->get_name() . "</td>";
                    $enabled = true;
                    break;
                }
            }
            if (!$enabled) {
                echo "<td><input type='checkbox' name='list[]' value='" . $curWidget->get_id() . "' />" . $curWidget->get_name() . "</td>";
            }
            echo "<td>" . $curWidget->get_description() . "</td>";
            echo "<td>" . $curWidget->get_version() . "</td>";
            echo "</tr>";
        } else {
            $curUser->set_widget_id($id);
            $curUser->remove_widget();
        }
    }
    echo "</tbody>\n\t</table>";
    echo "<input type='submit' name='saveDashboard' value='Save widget settings' style='float:left; clear:left; margin-bottom:5px;' />";
    echo "</form>";
}
开发者ID:precurse,项目名称:netharbour,代码行数:35,代码来源:userSettings.php

示例2: displayDashboard

function displayDashboard()
{
    global $tool, $propertyForm;
    echo "<form method='post' action='' style='width:1024px;'>";
    echo "<table id=\"sortDataTable\" class='sortable' cellspacing=\"0\" cellpadding=\"0\" border=\"1\" style='width:100%; clear:left;'>\n\t\t<thead>\n\t\t<tr><th style='text-align:left;'>Dashboard widgets</th>\n\t\t\t<th style='text-align:left;'>Description</th>\n\t\t\t<th style='text-align:left;'>Version</th></tr>\n\t\t</thead>\n\t\t<tbody>";
    if ($_GET['mode'] == refreshWidgets) {
        $dir = "widgets/";
        $status = checkDirForWidget($dir);
        if ($status != true) {
            $propertyForm->warning("Failed to refresh. Reason: " . $status);
        }
    }
    $widgets = Widgets::get_widgets();
    foreach ($widgets as $id => $value) {
        echo "<tr>";
        $curWidget = new Widgets($id);
        $fileExists = fopen($curWidget->get_filename(), 'r');
        if ($fileExists) {
            if ($curWidget->get_enabled()) {
                echo "<td><input type='checkbox' checked name='list[]' value='" . $curWidget->get_id() . "' />" . $curWidget->get_name() . "</td>";
            } else {
                echo "<td><input type='checkbox' name='list[]' value='" . $curWidget->get_id() . "' />" . $curWidget->get_name() . "</td>";
            }
            echo "<td>" . $curWidget->get_description() . "</td>";
            echo "<td>" . $curWidget->get_version() . "</td>";
            echo "</tr>";
        } else {
            if (!$curWidget->remove_widget()) {
                $propertyForm->warning("You widget does not exist, but we failed to remove it from the database. Reason: " . $curWidget->get_error());
            }
        }
    }
    echo "</tbody>\n\t</table>";
    echo "<input type='submit' name='saveDashboard' value='Enable checked widgets for users' style='float:left; clear:left; margin-bottom:5px;' />";
    echo "<input type='button' name='refresh' value='Refresh widgets' onclick=\"return LoadPage('configurations.php?action=dashWidgets&mode=refreshWidgets', 'settingsInfo')\" style='float:right; margin-bottom:5px;' />";
    echo "</form>";
}
开发者ID:precurse,项目名称:netharbour,代码行数:37,代码来源:configurations.php


注:本文中的Widgets::get_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。