public static function load($po_request)
 {
     if (!DashboardManager::$opo_instance) {
         DashboardManager::$opo_instance = new DashboardManager($po_request);
     }
     DashboardManager::$opo_instance->setRequest($po_request);
     return DashboardManager::$opo_instance;
 }
Exemple #2
0
            } else {
                echo '<div id="column1" class="col-md-6">';
                echo '&nbsp;';
                echo '</div>';
            }
            // blocks for column 2
            if (in_array('column_2', $columns_name)) {
                // blocks for column 1
                echo '<div id="column2" class="col-md-6">';
                foreach ($columns['column_2'] as $content) {
                    echo $content;
                }
                echo '</div>';
            } else {
                echo '<div id="column2" class="col-md-6">';
                echo '&nbsp;';
                echo '</div>';
            }
        }
        echo '</div>';
    } else {
        echo '<div style="margin-top:20px;">' . get_lang('YouHaveNotEnabledBlocks') . '</div>';
    }
} else {
    // block dashboard list
    if (isset($success)) {
        Display::display_confirmation_message(get_lang('BlocksHaveBeenUpdatedSuccessfully'));
    }
    $user_id = api_get_user_id();
    DashboardManager::display_user_dashboard_list($user_id);
}
Exemple #3
0
require_once 'block.class.php';
// protect script
api_block_anonymous_users();
// defining constants
// current section
$this_section = SECTION_DASHBOARD;
unset($_SESSION['this_section']);
//for hmtl editor repository
// get actions
$actions = array('listing', 'store_user_block', 'disable_block');
$action = 'listing';
if (isset($_GET['action']) && in_array($_GET['action'], $actions)) {
    $action = $_GET['action'];
}
// load styles from dashboard plugins
$dashboar_plugin_styles = DashboardManager::get_links_for_styles_from_dashboard_plugins();
$htmlHeadXtra[] = $dashboar_plugin_styles;
// interbreadcrumb
//$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('Dashboard'));
// course description controller object
$dashboard_controller = new DashboardController();
if (isset($_GET['path'])) {
    $path = $_GET['path'];
}
// distpacher actions to controller
switch ($action) {
    case 'listing':
        $dashboard_controller->display();
        break;
    case 'store_user_block':
        $dashboard_controller->store_user_block();
 /**
  * This method is used when you close a block from dashboard block interface
  * render to dashboard.php view
  */
 public function close_user_block($path)
 {
     $user_id = $this->user_id;
     $result = DashboardManager::close_user_block($user_id, $path);
     $this->display($result);
 }
Exemple #5
0
     echo '<script>
         $(function(){
             $("#tabs").tabs();
         });
         </script>';
     echo '<div id="tabs">';
     echo '<ul>';
     echo '<li><a href="#tabs-1">' . get_lang('Plugins') . '</a></li>';
     echo '<li><a href="#tabs-2">' . get_lang('DashboardPlugins') . '</a></li>';
     echo '<li><a href="#tabs-3">' . get_lang('ConfigureExtensions') . '</a></li>';
     echo '</ul>';
     echo '<div id="tabs-1">';
     handle_plugins();
     echo '</div>';
     echo '<div id="tabs-2">';
     DashboardManager::handle_dashboard_plugins();
     echo '</div>';
     echo '<div id="tabs-3">';
     handle_extensions();
     echo '</div>';
     echo '</div>';
     break;
 case 'Stylesheets':
     // Displaying the extensions: Stylesheets.
     handle_stylesheets();
     break;
 case 'Search':
     handle_search();
     break;
 case 'Templates':
     handle_templates();
function caGetDashboardWidgetHTML($po_request, $pn_column)
{
    $o_dashboard_manager = DashboardManager::load($po_request);
    $va_widget_list = $o_dashboard_manager->getWidgetsForColumn($pn_column);
    foreach ($va_widget_list as $vn_i => $va_widget_info) {
        print "<div class='portlet' id='dashboardWidget_{$pn_column}_{$vn_i}'>";
        print caNavLink($po_request, '<img src="' . $po_request->getThemeUrlPath() . '/graphics/spacer.gif" width="16" height="16" border="0" title="' . _t("remove widget from dashboard") . '">', 'dashboardRemoveWidget', '', 'Dashboard', 'removeWidget', array('widget' => $va_widget_info['widget'], 'widget_id' => $va_widget_info['widget_id']));
        if ($o_dashboard_manager->widgetHasSettings($va_widget_info['widget'])) {
            print "<a href='#' class='dashboardWidgetSettingsButton' onclick='jQuery(\"#content_" . $va_widget_info['widget_id'] . "\").load(\"" . caNavUrl($po_request, '', 'Dashboard', 'getSettingsForm') . "\", { widget_id: \"" . $va_widget_info['widget_id'] . "\" }); return false;'><img src='" . $po_request->getThemeUrlPath() . "/graphics/spacer.gif' width='16' height='16' border='0' title='" . _t("Modify settings for this widget") . "'></a>";
        }
        print '<div class="portlet-header">' . WidgetManager::getWidgetTitle($va_widget_info['widget']) . '</div>';
        print '<div class="portlet-content" id="content_' . $va_widget_info['widget_id'] . '">' . $o_dashboard_manager->renderWidget($va_widget_info['widget'], $va_widget_info['widget_id'], $va_widget_info['settings']) . '</div>';
        print '</div>';
    }
}
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     $this->opo_dashboard_manager = DashboardManager::load($po_request);
 }