本文整理汇总了PHP中search::destroy_global_env方法的典型用法代码示例。如果您正苦于以下问题:PHP search::destroy_global_env方法的具体用法?PHP search::destroy_global_env怎么用?PHP search::destroy_global_env使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类search
的用法示例。
在下文中一共展示了search::destroy_global_env方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_datas
public function get_datas()
{
//on commence par récupérer l'identifiant retourné par le sélecteur...
if ($this->parameters['selector'] != "") {
for ($i = 0; $i < count($this->selectors); $i++) {
if ($this->selectors[$i]['name'] == $this->parameters['selector']) {
$selector = new $this->parameters['selector']($this->selectors[$i]['id']);
break;
}
}
$values = $selector->get_value();
$searcher = new search(false);
$current_search = $searcher->serialize_search();
$searcher->destroy_global_env();
global $search;
$search = array();
$search[] = "d_" . $values['cp'];
$op = "op_0_d_" . $values['cp'];
$field = "field_0_d_" . $values['cp'];
global ${$op}, ${$field};
${$op} = "EQ";
${$field} = $values['cp_val'];
$table = $searcher->make_search();
$query = "select notice_id from " . $table;
$result = pmb_mysql_query($query);
$records = array();
if (pmb_mysql_num_rows($result)) {
while ($row = pmb_mysql_fetch_object($result)) {
$records[] = $row->notice_id;
}
}
$searcher->unserialize_search($current_search);
$records = $this->filter_datas("notices", $records);
if ($this->parameters['nb_max_elements'] > 0) {
$records = array_slice($records, 0, $this->parameters['nb_max_elements']);
}
$return = array('title' => 'Liste de Notices', 'records' => $records);
return $return;
}
return false;
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:41,代码来源:cms_module_common_datasource_records_by_cp_val.class.php
示例2: array
function get_link()
{
global $dbh, $onglet_persopac, $launch_search;
global $opac_view_filter_class;
//$myQuery = pmb_mysql_query("SELECT * FROM search_persopac order by search_name ", $dbh);
$myQuery = pmb_mysql_query("SELECT search_persopac.*, group_concat(id_categ_empr) as categ_restrict FROM search_persopac left join search_persopac_empr_categ on id_search_persopac = search_id group by search_id order by search_name ", $dbh);
$this->search_persopac_list = array();
$link = "";
if (pmb_mysql_num_rows($myQuery)) {
$i = 0;
//on récupère la catégorie du lecteur...
if ($_SESSION['id_empr_session']) {
$req = "select empr_categ from empr where id_empr = " . $_SESSION['id_empr_session'];
$res = pmb_mysql_query($req);
if (pmb_mysql_num_rows($res)) {
$empr_categ = pmb_mysql_result($res, 0, 0);
} else {
$empr_categ = 0;
}
} else {
$empr_categ = 0;
}
while ($r = pmb_mysql_fetch_object($myQuery)) {
if ($opac_view_filter_class) {
if (!$opac_view_filter_class->is_selected("search_perso", $r->search_id)) {
continue;
}
}
$empr_categ_restrict = $r->categ_restrict != '' ? explode(",", $r->categ_restrict) : array();
if (count($empr_categ_restrict) == 0 || in_array($empr_categ, $empr_categ_restrict)) {
$name = translation::get_text($r->search_id, "search_persopac", "search_name", $r->search_name);
$shortname = translation::get_text($r->search_id, "search_persopac", "search_shortname", $r->search_shortname);
if ($r->search_directlink) {
if ($shortname) {
$libelle = $shortname;
} else {
$libelle = $name;
}
$my_search = new search();
$backup_search = $my_search->serialize_search();
$my_search->unserialize_search($r->search_query);
$forms_search .= "\n" . $my_search->make_hidden_search_form("./index.php?search_type_asked=extended_search&onglet_persopac=" . $r->search_id . "&limitsearch=" . $r->search_limitsearch, "search_form" . $r->search_id) . "\n";
$my_search->destroy_global_env();
$my_search->unserialize_search($backup_search);
if ($onglet_persopac == $r->search_id) {
$li_id = " id='current' ";
if (!$r->search_limitsearch || !$launch_search) {
$lien = $libelle;
} else {
$lien = "<a href=\"javascript:document.forms['search_form" . $r->search_id . "'].submit();\">" . $libelle . "</a>";
}
} else {
$li_id = "";
$lien = "<a href=\"javascript:document.forms['search_form" . $r->search_id . "'].submit();\">" . $libelle . "</a>";
}
$link .= "\n\t\t\t\t\t\t<li {$li_id} >\n\t\t\t\t\t\t\t{$lien}\t\n\t\t\t\t\t\t</li>";
}
$this->search_persopac_list[$i] = new stdClass();
$this->search_persopac_list[$i]->id = $r->search_id;
$this->search_persopac_list[$i]->name = $name;
$this->search_persopac_list[$i]->shortname = $shortname;
$this->search_persopac_list[$i]->query = $r->search_query;
$this->search_persopac_list[$i]->human = $r->search_human;
$this->search_persopac_list[$i]->directlink = $r->search_directlink;
$this->search_persopac_list[$i]->limitsearch = $r->search_limitsearch;
$i++;
}
}
}
$this->directlink_user = $link;
$this->directlink_user_form = $forms_search;
return true;
}
示例3: generateEntitySearch
function generateEntitySearch($entity_search)
{
global $search;
$search = $ent_search = array();
foreach ($entity_search->descriptors as $desc) {
if (count($desc->search_infos) > 1) {
array_unshift($ent_search, $desc->search_infos);
} else {
array_push($ent_search, $desc->search_infos);
}
}
if (count($ent_search) > 0) {
$n = 0;
for ($i = 0; $i < count($ent_search); $i++) {
for ($j = 0; $j < count($ent_search[$i]); $j++) {
$search[$n] = "f_" . $ent_search[$i][$j]['id'];
$op = "op_" . $n . "_" . $search[$n];
global ${$op};
${$op} = $ent_search[$i][$j]['op'];
$field = "field_" . $n . "_" . $search[$n];
global ${$field};
${$field}[0] = $ent_search[$i][$j]['value'];
if (count($ent_search[$i][$j]['var']) > 0) {
$fieldvar = "fieldvar_" . $n . "_" . $search[$n];
global ${$fieldvar};
for ($k = 0; $k < count($ent_search[$i][$j]['var']); $k++) {
${$fieldvar}[$ent_search[$i][$j]['var'][$k]['name']][0] = $ent_search[$i][$j]['var'][$k]['value'];
}
}
$inter = "inter_" . $n . "_" . $search[$n];
global ${$inter};
if ($n > 0) {
${$inter} = $i > 0 ? "or" : "and";
}
$n++;
}
}
$entity_search = search::serialize_search();
search::destroy_global_env();
} else {
$entity_search = "";
}
return $entity_search;
}
示例4: make_human_query
function make_human_query()
{
//Récupération de la valeur de saisie
$valeur_ = "field_" . $this->n_ligne . "_s_" . $this->id;
global ${$valeur_};
$valeur = ${$valeur_};
$litteral = array();
//on stocke l'environnement courant
$current_search = search::serialize_search();
//on le détruit
search::destroy_global_env();
//et on se met dans le contexte de la requete OpenURL
$this->s = new search("search_openurl");
$this->s->unserialize_search($valeur[0]);
global $search;
//on génère une human_query
$litteral[0] = $this->s->make_human_query();
//et on détruit le contexte d'OpenURL pour revenir en mode normal
search::destroy_global_env();
search::unserialize_search($current_search);
return $litteral;
}