コード例 #1
0
ファイル: listzones.php プロジェクト: jubinpatel/horde
// Create the Pager UI
$pager_vars = Horde_Variables::getDefaultVariables();
$pager_vars->set('page', $page);
$perpage = $prefs->getValue('domains_perpage');
$pager = new Horde_Core_Ui_Pager('page', $pager_vars, array('num' => count($beatnik->domains), 'url' => 'listzones.php', 'page_count' => 10, 'perpage' => $perpage));
// Limit the domain list to the current page
$domains = array_slice($beatnik->domains, $page * $perpage, $perpage);
// Hide fields that the user does not want to see
$fields = Beatnik::getRecFields('soa');
foreach ($fields as $field_id => $field) {
    if ($field['type'] == 'hidden' || $field['infoset'] != 'basic' && !$_SESSION['beatnik']['expertmode']) {
        unset($fields[$field_id]);
    }
}
// Add javascript navigation and striping
$page_output->addScriptFile('beatnik.js');
$page_output->addScriptFile('stripe.js', 'horde');
// Initialization complete.  Render the page.
Beatnik::notifyCommits();
$page_output->header();
require BEATNIK_TEMPLATES . '/menu.inc';
require BEATNIK_TEMPLATES . '/listzones/header.inc';
foreach ($domains as $domain) {
    $autourl = Horde::url('autogenerate.php')->add(array('rectype' => 'soa', 'curdomain' => $domain['zonename']));
    $deleteurl = Horde::url('delete.php')->add(array('rectype' => 'soa', 'curdomain' => $domain['zonename']));
    $viewurl = Horde::url('viewzone.php')->add('curdomain', $domain['zonename']);
    $editurl = Horde::url('editrec.php')->add(array('curdomain' => $domain['zonename'], 'id' => $domain['id'], 'rectype' => 'soa'));
    require BEATNIK_TEMPLATES . '/listzones/row.inc';
}
require BEATNIK_TEMPLATES . '/listzones/footer.inc';
$page_output->footer();