} } } $form = new CForm(); $form->SetMethod('get'); $cmbConfig = new CComboBox('config', $config, 'submit()'); $cmbConfig->AddItem(0, S_SCREENS); $cmbConfig->AddItem(1, S_SLIDESHOWS); $form->AddItem($cmbConfig); $form->AddItem(new CButton("form", 0 == $config ? S_CREATE_SCREEN : S_SLIDESHOW)); show_table_header(0 == $config ? S_CONFIGURATION_OF_SCREENS_BIG : S_CONFIGURATION_OF_SLIDESHOWS_BIG, $form); echo SBR; $row_count = 0; if (0 == $config) { if (isset($_REQUEST["form"])) { insert_screen_form(); } else { $numrows = new CSpan(null, 'info'); $numrows->addOption('name', 'numrows'); $header = get_table_header(array(S_SCREENS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows)); show_table_header($header); $table = new CTableInfo(S_NO_SCREENS_DEFINED); $table->SetHeader(array(make_sorting_link(S_NAME, 's.name'), make_sorting_link(S_DIMENSION_COLS_ROWS, 'size'), S_SCREEN)); $result = DBselect('SELECT s.screenid,s.name,s.hsize,s.vsize,(s.hsize*s.vsize) as s_size ' . ' FROM screens s ' . ' WHERE ' . DBin_node('s.screenid') . order_by('s.name,s_size', 's.screenid')); while ($row = DBfetch($result)) { if (!screen_accessible($row["screenid"], PERM_READ_WRITE)) { continue; } $table->AddRow(array(new CLink($row["name"], "?config=0&form=update&screenid=" . $row["screenid"], 'action'), $row["hsize"] . " x " . $row["vsize"], new CLink(S_EDIT, "screenedit.php?screenid=" . $row["screenid"]))); $row_count++; }
if ($_REQUEST['go'] != 'none' && isset($go_result) && $go_result) { $url = new CUrl(); $path = $url->getPath(); insert_js('cookie.eraseArray("' . $path . '")'); } $form = new CForm(null, 'get'); $form->addItem(new CButton("form", S_CREATE_SCREEN)); $form->addItem(new CButton('form', S_IMPORT_SCREEN)); $screen_wdgt = new CWidget(); $screen_wdgt->addPageHeader(S_CONFIGURATION_OF_SCREENS_BIG, $form); if (isset($_REQUEST['form'])) { if ($_REQUEST['form'] == S_IMPORT_SCREEN) { $screen_wdgt->addItem(import_screen_form($rules)); } else { if ($_REQUEST['form'] == S_CREATE_SCREEN || $_REQUEST['form'] == 'update') { $screen_wdgt->addItem(insert_screen_form()); } } } else { $form = new CForm(); $form->setName('frm_screens'); $numrows = new CDiv(); $numrows->setAttribute('name', 'numrows'); $screen_wdgt->addHeader(S_SCREENS_BIG); $screen_wdgt->addHeader($numrows); $table = new CTableInfo(S_NO_SCREENS_DEFINED); $table->setHeader(array(new CCheckBox('all_screens', NULL, "checkAll('" . $form->getName() . "','all_screens','screens');"), make_sorting_header(S_NAME, 'name'), S_DIMENSION_COLS_ROWS, S_SCREEN)); $sortfield = getPageSortField('name'); $sortorder = getPageSortOrder(); $options = array('editable' => 1, 'output' => API_OUTPUT_EXTEND, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'limit' => $config['search_limit'] + 1); $screens = CScreen::get($options);