msg); } function process($source_id, $pmb_user_id) { global $opac_url_base,$opac_biblio_name,$charset; $plop = $opac_biblio_name; $source = new mobile_source($this, $source_id, $this->msg); $param = $source->config; $param['opacUrl'] = $opac_url_base; $param['connectorDriver'] = "pmb"; $param['biblioName'] = ($charset!= "UTF-8" ? utf8_encode($opac_biblio_name) : $opac_biblio_name); echo json_encode($param); return; } } class mobile_source extends connecteur_out_source { var $onglets = array(); function mobile_source($connector, $id, $msg) { global $include_path; parent::connecteur_out_source($connector, $id, $msg); //Onglets dispo dans l'appli $xml = new XMLtabs($include_path."/mobile/tabs.xml"); $xml->analyser(); $this->onglets = $xml->table; } function get_config_form() { global $charset, $dbh, $pmb_url_base; $result = parent::get_config_form(); //on attributs/initialise certaines valeurs par défaut if(!$this->config['activeTabs']) $this->config['activeTabs'] = array(); if(!$this->config['shelf_nbResultsByPage']) $this->config['shelf_nbResultsByPage'] = 20; if(!$this->config['search_nbResultsByPage']) $this->config['search_nbResultsByPage'] = 20; if(!$this->config['bulletinsList_nbResultsByPage']) $this->config['bulletinsList_nbResultsByPage'] = 10; if(!$this->config['analysisList_nbResultsByPage']) $this->config['analysisList_nbResultsByPage'] = 10; //Adresse d'utilisation $result .= "

"; if ($this->id) { $result .= "".$pmb_url_base."ws/connector_out.php?source_id=".$this->id.""; } else { $result .= $this->msg["mobile_service_endpoint_unrecorded"]; } $result .= "
"; //Connecteur dédié $connecteurs = new connecteurs_out(); foreach($connecteurs->connectors as $conn) { if( $conn->name == 'JSON-RPC') $sources = $conn->sources; } //on génère l'affichage du sélecteur $proxyIsInList = false; if(sizeof($sources) == 0) { $selectWS = $this->msg['mobile_admin_error_proxy']; } else { $selectWS=""; } //maintenant l'entrée manuelle... $writeWS = ""; $result .= "
 

".$this->msg['mobile_admin_pickWSInList_yes']."    ".$this->msg['mobile_admin_pickWSInList_no']."  

"; $result .="
 
"; //Onglets dispo dans l'appli $result.="

"; $i=0; foreach ($this->onglets as $onglet =>$value){ $result.=" "; $i++; } $result.="
".$this->msg['mobile_admin_form_tabs_label']." ".$this->msg['mobile_admin_form_tabs_valid']." ".$this->msg['mobile_admin_firstTab']." ".$this->msg['mobile_admin_form_tabs_desc']."
".$value['label']." ".$this->msg['mobile_admin_form_tabs_yes']."  config['activeTabs'][$onglet] == 1 ? " checked " : " "). //on active les options en fonction "onchange='checkParam(\"$onglet\",false);' />  ".$this->msg['mobile_admin_form_tabs_no']."  config['activeTabs'][$onglet] == 0 ? " checked " : " "). //on désactive les options en fonction "onchange='checkParam(\"$onglet\",false);' /> config['firstTab'] === $onglet ? " checked" : ($i==0 ? " checked" : ""))."'/> ".$value['desc']."
 
"; //param pour l'onglet 'Accueil' $form_infoPage="
 

"; $requete = "select id_infopage as id, title_infopage as title from infopages where valid_infopage = 1 order by title DESC"; $res = mysql_query($requete); if(mysql_num_rows($res)){ $form_infoPage.= " "; }else{ $form_infoPage.=$this->msg['mobile_admin_error_infopage']; } $form_infoPage.= "
 
"; $result.= gen_plus("form_infoPage",$this->msg['mobile_admin_form_infoPagesTitle'],$form_infoPage). "
 
"; //param pour l'onglet 'Etagère coup de coeur' $form_shelf.="
 

"; $etageres = etagere::get_etagere_list(); $etagere_valid = false; $select = " "; if($etagere_valid == true){ $form_shelf .= $select; }else{ $form_shelf.=$this->msg['mobile_admin_error_etageres']; } $form_shelf .= "
 

 
"; $result .= gen_plus("form_shelf",$this->msg['mobile_admin_form_shelfTitle'],$form_shelf). "
 
"; //param pour l'onglet 'Recherche Simple' $form_search = "
 

 

".$this->msg['mobile_admin_form_search_allowSearchByTypeDoc_yes']." config["allowTypDocFilter"] == 1 ? " checked " : " ")." />  ".$this->msg['mobile_admin_form_search_allowSearchByTypeDoc_no']." config["allowTypDocFilter"] == 0 ? " checked " : " ")."/>
 
"; $result .= gen_plus("form_search",$this->msg['mobile_admin_form_searchTitle'],$form_search). "
 
"; //param pour Mon Compte $form_myAccount = "
 
 
"; $result .= gen_plus("form_myAccount",$this->msg['mobile_admin_form_myAccountTitle'],$form_myAccount). "
 
"; //param pour Pret Autonome $form_selfCheck = "
 

".$this->msg['mobile_admin_form_selfCheck_allowCheckIn_yes']." config["allowCheckIn"] == 1 ? " checked " : " ")." />  ".$this->msg['mobile_admin_form_selfCheck_allowCheckIn_no']." config["allowCheckIn"] == 0 ? " checked " : " ")."/>
 
"; $result .= gen_plus("form_selfCheck",$this->msg['mobile_admin_form_selfCheckTitle'],$form_selfCheck). "
 
"; //param d'affichage général $param_gen = "
 

 

 
"; $result .= gen_plus("paramGen",$this->msg['mobile_admin_form_paramsGen'],$param_gen). "
 
"; $result.=" "; return $result; } function update_config_from_form() { global $dbh; global $proxyUrl,$appTitle,$firstTab,$firstInfoPage,$heartShelf,$search_nbResultsByPage,$shelf_nbResultsByPage; global $allowTypDocFilter,$allowCheckIn; global $bulletinsList_nbResultsByPage,$analysisList_nbResultsByPage; global $onglets; parent::update_config_from_form(); //les trucs faciles $this->config['proxyUrl'] = $proxyUrl; $this->config['firstInfoPage'] = (isset($firstInfoPage) ? $firstInfoPage :''); $this->config['heartShelf'] = (isset($heartShelf) ? $heartShelf :''); $this->config['search_nbResultsByPage'] = $search_nbResultsByPage; $this->config['shelf_nbResultsByPage'] = $shelf_nbResultsByPage; if($allowTypDocFilter == 1){ $this->config['allowTypDocFilter'] = true; }else $this->config['allowTypDocFilter'] = false; if($allowCheckIn == 1){ $this->config['allowCheckIn'] = true; }else $this->config['allowCheckIn'] = false; //le tableau des onglets activés ou non $this->config['activeTabs']=array(); foreach($this->onglets as $ongletName => $value){ global $$ongletName; if(isset($$ongletName)){ $this->config['activeTabs'][$ongletName]=$$ongletName; }else{ $this->config['activeTabs'][$ongletName]=0; } } if(isset($firstTab)) $this->config['firstTab'] = $firstTab; else{ foreach($this->onglets as $ongletName => $value){ if($this->config['activeTabs'][$ongletName] != 1) $this->config['firstTab'] = $ongletName; break; } } $this->config['bulletinsList_nbResultsByPage'] = $bulletinsList_nbResultsByPage; $this->config['analysisList_nbResultsByPage'] = $analysisList_nbResultsByPage; return; } } ?>