コード例 #1
0
ファイル: userSettings.php プロジェクト: precurse/netharbour
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>";
}
コード例 #2
0
ファイル: index.php プロジェクト: precurse/netharbour
                        echo $widget->get_config();
                        echo "</div>\n\t\t\t\t\t\t\t<div id='mask'></div>\n\t\t\t\t\t\t\t</div>";
                    }
                } else {
                    echo "something is wrong with your file, " . $curWidgetInfo->get_filename();
                }
            }
        }
    }
}
echo "</div>";
echo "<div id='col3' class='infoBox'>";
if ($userWidgets != '') {
    foreach ($userWidgets as $widgetID => $userID) {
        $curWidgetInfo = new Widgets($widgetID);
        $title = $curWidgetInfo->get_name();
        $col = $curUser->get_position_x($widgetID);
        if ($col == 2) {
            if (file_exists($curWidgetInfo->get_filename())) {
                include_once $curWidgetInfo->get_filename();
                $widgetClass = $curWidgetInfo->get_class_name();
                if (class_exists($widgetClass)) {
                    $widget = new $widgetClass();
                    echo "<div class='portlet' id='p_" . $widgetID . "'>\n\t\t\t\t\t\t\t<div id='title' class='portlet-header'>";
                    echo $title;
                    echo "<div class='minimize'></div>";
                    if (method_exists($widget, 'get_config')) {
                        echo "<a name=modal href='#dialog" . $widgetID . "' style='float:right;color:#FFF'>Edit</a>";
                    }
                    echo "</div>\n\t\t\t\t\t\t\t<div id='id" . $widgetID . "' class='portlet-content information'>\n\t\t\t\t\t\t\t<h3> LOADING...</h3>";
                    echo "</div>\n\t\t\t\t\t\t   </div>";
コード例 #3
0
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>";
}