Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Showing
with 1011 additions and 1793 deletions
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Admin_AjaxController extends Zend_Controller_Action {
public function preDispatch() {
$this->getHelper('ViewRenderer')->setNoRender();
}
public function listesuggestionAction() {
$autorite = $this->_getParam('type_autorite');
$id_champ = $this->_getParam('id_champ');
$mode_recherche = $this->_getParam('mode');
$recherche = $this->_getParam('valeur');
$limite_resultat = 100;
if (!$authority = $this->getAuthorityFor($autorite)) {
print('mauvais code rubrique');
return;
}
$params = [$recherche, $mode_recherche, $limite_resultat];
if ('thesaurus' == $autorite)
$params[] = $id_champ;
if (!$liste = call_user_func_array([$authority, 'getListeSuggestion'], $params)) {
echo '';
return;
}
foreach($liste as $item) {
echo '<div class="tag_liste" clef="'.$item[0].'" onclick="selectSuggest(\''.$id_champ.'\',this)">'.$item[1].'</div>';
}
}
protected function getAuthorityFor($code) {
$authorities = ['auteur' => new Class_Auteur(),
'matiere' => new Class_Matiere(),
'interet' => new Class_CodifCentreInteret(),
'dewey' => new Class_CodifDewey(),
'pcdm4' => new Class_CodifPcdm4(),
'thesaurus' => new Class_CodifThesaurus(),
'tag' => new Class_TagNotice()];
if (isset($authorities[$code]))
return $authorities[$code];
}
}
?>
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* *
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software * along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
class Admin_AmberController extends Zend_Controller_Action { class Admin_AmberController extends Zend_Controller_Action {
use Trait_StaticFileWriter; use Trait_StaticFileWriter;
...@@ -51,7 +51,7 @@ class Admin_AmberController extends Zend_Controller_Action { ...@@ -51,7 +51,7 @@ class Admin_AmberController extends Zend_Controller_Action {
$commit_path .= 'src/'; $commit_path .= 'src/';
$commit_path .= $commit_subpath.'/'.$filename; $commit_path .= $commit_subpath.'/'.$filename;
$this->_writeContents($commit_path, $contents); $this->_writeContents($commit_path, $contents);
return $this; return $this;
......
This diff is collapsed.
This diff is collapsed.