public static function get_alias($params) { $a = array(); if(isset($params["CISOPARM"])){ $parm = explode(":",urldecode($params["CISOPARM"])); $cr = explode(" ",$parm[0]); if($cr[0] == "all"){ $catlist = &dmGetCollectionLIst(); for ($i = 0; $i < count($catlist); $i++){ $a[$i] = trim($catlist[$i]['alias']); } } else { for($i = 0; $i < count($cr)-1;$i++){ $a[$i] = (isset($cr[$i]))?trim($cr[$i]):0; } } } else if(isset($params["CISOROOT"])){ if($params["CISOROOT"] == "all"){ $a = ContentDM::all_collections(); } else { $cisostr = explode(',',urldecode($params["CISOROOT"])); for ($i = 0; $i < count($cisostr); $i++){ $a[$i] = (isset($cisostr[$i]))?trim($cisostr[$i]):0; } } } else { $a = ContentDM::all_collections(); } return($a); }
public static function from_params($params) { $search = new Search(); $alias = array_values(ContentDM::get_alias($params)); $search->maxrecs = 20; $search->sortby = array('title'); $search->searchstring = Search::generate_search_string($params); if (isset($params['document-types'])) { if (in_array('map', $params['document-types'])) { $search->search_alias = array('/p129401coll3'); } } $start = isset($params['CISOSTART']) ? $params['CISOSTART'] : "1,1"; $search->start = split(',', $start); $search->search_alias = $alias; return $search; }
public static function from_params($params) { Search::complexify_simple_search_params($params); $search = new Search(); $search->search_alias = array_values(ContentDM::get_alias($params)); $search->search_all = $params['CISOROOT'] == 'all' ? TRUE : FALSE; $search->maxrecs = 20; if (isset($params['document-types'])) { $search->set_document_types($params['document-types']); } if (isset($params['media-types'])) { $search->media_types = $params['media-types']; } else { if (isset($query_params['media-types%5B%5D'])) { $search->media_types = $params['media-types%5B%5D']; } } $search->set_search_string($params); $search->start = isset($params['CISOSTART']) ? $params['CISOSTART'] : '1'; return $search; }
function getAlias() { global $thisfile, $specifyCollection; return ContentDM::get_alias($_GET); }
die("You must specify the path to search in"); } $flags[$arg] = true; break; default: $colls[] = $arg; } } echo "\n\nPROCESSING PARAMS\n"; echo "\nFLAGS:\n" . json_encode($flags) . "\n\n"; # exit if no collections set and no --all flag if ($colls === [] && !($flags['--list-all'] || $flags['--list-missing'])) { echo "You must specify a collection to harvest, or use the flag --all. Use --help for more.\n"; exit; } $ingester = new ContentDM(); if ($flags['--cron-delete-multi']) { $ingester->cronDeleteMulti(); exit; } if ($flags['--cron-delete']) { if (!isset($index) || $index == null) { die("You must specify the index to delete"); } if (!isset($path) || $path == null) { die("You must specify the path to search in"); } $ingester->cronDelete($index, $path); exit; } //we need all collections at this point (regardless of the exit for --list-all)