id] = $instance; } $templates = vchamilo_get_available_templates(false); if (empty($templates)) { $url = api_get_path(WEB_PLUGIN_PATH).'vchamilo/views/manage.php?what=snapshotinstance'; $url = Display::url($url, $url); Display::addFlash( Display::return_message('You need to create a snapshot of master first here:'.$url, 'info', false) ); } $table = new HTML_Table(array('class' => 'data_table')); $column = 0; $row = 0; // $table->set_additional_parameters($parameters); $headers = array( '', $plugininstance->get_lang('sitename'), $plugininstance->get_lang('institution'), $plugininstance->get_lang('dbhost').' - '.get_lang('Database'), $plugininstance->get_lang('coursefolder'), $plugininstance->get_lang('enabled'), $plugininstance->get_lang('lastcron'), '', ); $attrs = array('center' => 'left'); $table->addRow($headers, $attrs, 'th'); $i = 0; foreach ($instances as $instance) { $checkbox = ''; //$sitelink = ''.$instance->sitename.''; $sitelink = $instance->sitename; if ($instance->visible) { $status = ' '; } else { $status = ' '; } $cmd = ' '; $cmd .= ' '; if (!$instance->visible) { $cmd .= ' '; } else { $cmd .= ' '; } $crondate = ($instance->lastcron) ? date('r', $instance->lastcron) : ''; $data = array( $checkbox, $sitelink.' ('.Display::url($instance->root_web, $instance->root_web).')', $instance->institution, $instance->db_host.' - '.$instance->main_database, $instance->slug, $status, $crondate, $cmd, ); $attrs = array('center' => 'left'); $table->addRow($data, $attrs, 'td'); $i++; } $items = [ [ 'url' => $thisurl.'?what=newinstance', 'content' => $plugininstance->get_lang('newinstance') ], [ 'url' => $thisurl.'?what=instance®isteronly=1', 'content' => $plugininstance->get_lang('registerinstance') ], [ 'url' => $thisurl.'?what=snapshotinstance&vid=0', 'content' => $plugininstance->get_lang('snapshotmaster') ], [ 'url' => $thisurl.'?what=clearcache&vid=0', 'content' => $plugininstance->get_lang('clearmastercache') ], [ 'url' => api_get_path(WEB_PLUGIN_PATH).'vchamilo/views/syncparams.php', 'content' => $plugininstance->get_lang('sync_settings') ], [ 'url' => api_get_path(WEB_CODE_PATH).'admin/configure_plugin.php?name=vchamilo', 'content' => get_lang('Settings') ] ]; $content = Display::page_header('VChamilo Instances'); $content .= Display::actions($items); $content .= '
'; if (empty($templates)) { $content = ''; } $tpl = new Template(get_lang('VChamilo'), true, true, false, true, false); $tpl->assign('content', $content); $tpl->display_one_col_template();