throw new AccessDeniedException(get_string('cantdeleteview', 'view'));
}
$collectionnote = '';
$collection = $view->get_collection();
if ($collection) {
    $collectionnote = get_string('deleteviewconfirmnote2', 'view', $collection->get_url(), $collection->get('name'));
}
$institution = $view->get('institution');
View::set_nav($groupid, $institution);
if ($groupid) {
    $goto = 'groupviews.php?group=' . $groupid;
} else {
    if ($institution) {
        $goto = 'institutionviews.php?institution=' . $institution;
    } else {
        $query = get_querystring();
        // remove the id
        $query = preg_replace('/id=([0-9]+)\\&/', '', $query);
        $goto = 'index.php?' . $query;
    }
}
define('TITLE', get_string('deletespecifiedview', 'view', $view->get('title')));
$form = pieform(array('name' => 'deleteview', 'autofocus' => false, 'method' => 'post', 'renderer' => 'div', 'elements' => array('submit' => array('type' => 'submitcancel', 'value' => array(get_string('yes'), get_string('no')), 'goto' => get_config('wwwroot') . 'view/' . $goto))));
$smarty = smarty();
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign_by_ref('view', $view);
$smarty->assign('form', $form);
$smarty->assign('collectionnote', $collectionnote);
$smarty->display('view/delete.tpl');
function deleteview_submit(Pieform $form, $values)
{
Beispiel #2
0
                 //sti til XSL
                 $xsl_url = 'xsl/boklistesru.xsl';
                 //henter XML-data
                 $xml_data = file_get_contents($xml_url) or exit("Feil");
                 //fjerner namespace
                 $xml_data = str_replace("<record xmlns=\"http://www.loc.gov/MARC21/slim\">", "<record>", $xml_data);
                 //oppretter DOM-dok med XML-data
                 $xml = new DOMDocument();
                 $xml->loadXML($xml_data);
                 //teller antallet <recordData>-noder (antall søketreff)
                 $nodeList = $xml->getElementsByTagName('recordData');
                 $hits = $nodeList->length;
                 // Sjekk om sidetallet er satt. Hvis ikke: sett det til 1
                 $page = !empty($_GET['page']) ? $_GET['page'] : 1;
                 //parametere til XSL
                 $params = array(array('namespace' => '', 'name' => 'url_ext', 'value' => "{$geoId}&place={$place}&bib=" . $_GET['bib']), array('namespace' => '', 'name' => 'sortBy', 'value' => $sortBy), array('namespace' => '', 'name' => 'order', 'value' => $order), array('namespace' => '', 'name' => 'page', 'value' => $page), array('namespace' => '', 'name' => 'perPage', 'value' => $config['mainPerPage']), array('namespace' => '', 'name' => 'limit', 'value' => $config['main_limit']), array('namespace' => '', 'name' => 'querystring', 'value' => get_querystring($_SERVER['QUERY_STRING'])), array('namespace' => '', 'name' => 'target', 'value' => "local"));
                 //transformerer til HTML
                 echo transformToHTML($xml, $xsl_url, $params);
             } else {
                 echo "Something is wrong\n";
             }
         }
         //lagrer tid etter søk, differanse er tid løpt
         $time = microtime();
         $time = explode(' ', $time);
         $finish = $time[1] + $time[0];
         $searchTime = round($finish - $search_start, 4);
         $search_time = "Søket tok {$searchTime} sekunder.";
     }
     echo '</div>';
 } else {
$js = <<<EOF
addLoadEvent(function () {
    p = {$pagination['javascript']}
EOF;
if ($offset > 0) {
    $js .= <<<EOF
    if (\$('myviews')) {
        getFirstElementByTagAndClassName('a', null, 'myviews').focus();
    }
EOF;
} else {
    $js .= <<<EOF
    if (\$('searchresultsheading')) {
        addElementClass('searchresultsheading', 'hidefocus');
        setNodeAttribute('searchresultsheading', 'tabIndex', -1);
        \$('searchresultsheading').focus();
    }
EOF;
}
$js .= '});';
$createviewform = pieform(create_view_form());
$smarty = smarty(array('paginator'));
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('views', $data->data);
$smarty->assign('pagination', $pagination['html']);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('query', param_variable('query', null));
$smarty->assign('querystring', get_querystring());
$smarty->assign('searchform', $searchform);
$smarty->assign('createviewform', $createviewform);
$smarty->display('view/index.tpl');
     foreach ($_POST["varr"] as $varr) {
         $fileName = get_filename($productt, $varr, $expp, $model, $timee, $regionn, $freqq, $myAggPath, $dailyPath, $aggvar);
         $localPath = get_localPath($productt, $Files, $model, $expp);
         $varLongName = get_varLongName($varr, $productt);
         $varQuery .= "&data-path={$localPath}/{$fileName}&variable={$varLongName}&variable-name={$varr}";
     }
     if ($domainn != "fulldomain") {
         $csvString = get_csv($varQuery, $pointLat, $pointLong);
         $html .= "<a href='{$csvString}' target='_blank'><input type='button' class='btn btn-large ptn-primary pull-right' value='Get CSV of All Variables' name='submit' onclick='' /></a><br><br>";
     }
     foreach ($_POST["varr"] as $varr) {
         $urlPath = get_urlPath($productt, $Files);
         $urlDir = get_urlDir($productt, $varr, $model, $expp, $freqq, $aggvar, $myAggPath, $dailyPath, $monthlyPath);
         $fileName = get_filename($productt, $varr, $expp, $model, $timee, $regionn, $freqq, $myAggPath, $dailyPath, $aggvar);
         $service = get_service($productt, $Files);
         $querystring = get_querystring($productt, $varr, $domainn, $NELat, $SWLat, $SWLong, $NELong, $pointLat, $pointLong, $extensionn);
         $localPath = get_localPath($productt, $Files, $model, $expp);
         if ($freqq == 'daily') {
             $opendapPath = $opendapdailyPath;
         } elseif ($freqq == 'monthly') {
             $opendapPath = $opendapmonthlyPath;
         }
         $varLongName = get_varLongName($varr, $productt);
         $varQuery = "&data-path={$localPath}/{$fileName}&variable={$varLongName}&variable-name={$varr}";
         $html .= varRow($urlPath, $urlDir, $fileName, $service, $querystring, $varr, $productt, $domainn, $pointLat, $pointLong, $localPath, $opendapPath, $varQuery);
         $html .= "<br>";
     }
     //var
     $html .= "</td></tr>";
 }
 //freqq