id] = $instance; } $templates = Virtual::getAvailableTemplates(); 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( '', $plugin->get_lang('sitename'), $plugin->get_lang('dbhost').' - '.get_lang('Database'), $plugin->get_lang('coursefolder'), $plugin->get_lang('enabled'), $plugin->get_lang('lastcron'), '' ); $attrs = array('center' => 'left'); $table->addRow($headers, $attrs, 'th'); $i = 0; foreach ($instances as $instance) { $checkbox = ''; $sitelink = $instance->sitename; if ($instance->visible) { $status = ' '.Display::returnFontAwesomeIcon('toggle-on', 2).''; } else { $status = ' '.Display::returnFontAwesomeIcon('toggle-off', 2).''; } $cmd = '  '.Display::returnFontAwesomeIcon('pencil', 2).''; $cmd .= '  '.Display::returnFontAwesomeIcon('camera', 2).''; $cmd .= '  '.Display::returnFontAwesomeIcon('wrench', 2).' '; if (!$instance->visible) { $cmd .= '  '.Display::returnFontAwesomeIcon('remove', 2).' '; } else { $cmd .= '  '.Display::returnFontAwesomeIcon('remove', 2).' '; } $crondate = $instance->lastcron ? date('r', $instance->lastcron) : ''; $data = array( $checkbox, $sitelink.' '.$instance->institution.' ('.Display::url($instance->root_web, $instance->root_web, array('target' => '_blank')).')', $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' => $plugin->get_lang('newinstance'), ], [ 'url' => $thisurl.'?what=import', 'content' => $plugin->get_lang('ImportInstance'), ], [ 'url' => $thisurl.'?what=snapshotinstance&vid=0', 'content' => $plugin->get_lang('snapshotmaster'), ], [ 'url' => $thisurl.'?what=clearcache&vid=0', 'content' => $plugin->get_lang('clearmastercache'), ], [ 'url' => api_get_path(WEB_PLUGIN_PATH).'vchamilo/views/syncparams.php', 'content' => $plugin->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 .= '
'; $content .= $table->toHtml(); $selectionoptions = array(''); $selectionoptions[] = ''; $selectionoptions[] = ''; $selectionoptions[] = ''; $selectionoptions[] = ''; $selectionoptions[] = ''; $selectionaction = ''; $content .= '
'.$plugin->get_lang('selectall').' - '.$plugin->get_lang('selectnone').' -   - '.$plugin->get_lang('withselection').' '.$selectionaction.'
'; $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();