diff --git a/application/modules/admin/views/scripts/catalogue/index.phtml b/application/modules/admin/views/scripts/catalogue/index.phtml index ab4b96bbb2b6509f75655bf8d1a1893165e89f09..aadfb9a8952ea8f1b3efdee3428c68c5ca87c694 100644 --- a/application/modules/admin/views/scripts/catalogue/index.phtml +++ b/application/modules/admin/views/scripts/catalogue/index.phtml @@ -1,5 +1,5 @@ <?php -Class_ScriptLoader::getInstance()->addSearchInput($this->_('Filtrer les domaines ')); +Class_ScriptLoader::getInstance()->addSearchInputToContent($this->_('Filtrer les domaines ')); if (Class_Users::getIdentity()->hasRightAccessDomaines()) { ?> <center> diff --git a/application/modules/admin/views/scripts/head.phtml b/application/modules/admin/views/scripts/head.phtml index 636dfee3a3d505fa1a47141925267641f787ed02..6d1cfe694597ea5327f8e8201a6dad07bf21df59 100644 --- a/application/modules/admin/views/scripts/head.phtml +++ b/application/modules/admin/views/scripts/head.phtml @@ -18,8 +18,7 @@ ->addOPACScript('subModal') ->addJQueryReady('initializePopups();') ->showNotifications() - ->loadPrettyPhoto() - ->addOPACPluginScript('search_input/search_input.js'); + ->loadPrettyPhoto(); Class_Admin_Skin::current()->renderScriptsOn($head_scripts); diff --git a/application/modules/admin/views/scripts/index/adminvar.phtml b/application/modules/admin/views/scripts/index/adminvar.phtml index cd753c7cc251e113e7fe0bf87b82b38d7b3108ac..9fc01fb75d202744cfa5eca2770f8efc5e08a526 100644 --- a/application/modules/admin/views/scripts/index/adminvar.phtml +++ b/application/modules/admin/views/scripts/index/adminvar.phtml @@ -1,5 +1,5 @@ <?php -Class_ScriptLoader::getInstance()->addSearchInput($this->_('Filtrer les variables')); +Class_ScriptLoader::getInstance()->addSearchInputToContent($this->_('Filtrer les variables')); ?> <table id="adminvars"> diff --git a/application/modules/admin/views/scripts/profil/index.phtml b/application/modules/admin/views/scripts/profil/index.phtml index c167f86694e6990cb7948812e67f6a57449bd69e..13571b5c572cd731b7a0808a306bbb9fc1dfd985 100644 --- a/application/modules/admin/views/scripts/profil/index.phtml +++ b/application/modules/admin/views/scripts/profil/index.phtml @@ -1,5 +1,5 @@ <?php -Class_ScriptLoader::getInstance()->addSearchInput($this->_('Filtrer les profils ')); +Class_ScriptLoader::getInstance()->addSearchInputToContent($this->_('Filtrer les profils ')); print($this->profileSelect('profil',$this->id_zone,$this->id_bib,'zb',0,true)); diff --git a/application/modules/admin/views/scripts/systeme/phpinfo.phtml b/application/modules/admin/views/scripts/systeme/phpinfo.phtml index 0618acd86d576802735e0cbd09a1dfe1307a0fb4..3c172f0ba24529a90016f811fd8d5a78cea7374a 100644 --- a/application/modules/admin/views/scripts/systeme/phpinfo.phtml +++ b/application/modules/admin/views/scripts/systeme/phpinfo.phtml @@ -1,5 +1,5 @@ <?php -Class_ScriptLoader::getInstance()->addSearchInput($this->_('Filtrer les informations système')); +Class_ScriptLoader::getInstance()->addSearchInputToContent($this->_('Filtrer les informations système')); ob_start(); phpinfo(INFO_MODULES); $info = ob_get_clean(); diff --git a/library/Class/ScriptLoader.php b/library/Class/ScriptLoader.php index 756afdf81eed6d41dfaeab791d3e78794a37d326..efdc029225f8f361dd8c69c394421317b23e8274 100644 --- a/library/Class/ScriptLoader.php +++ b/library/Class/ScriptLoader.php @@ -802,11 +802,31 @@ class Class_ScriptLoader { } - public function addSearchInput($label) { - return $this->addJQueryReady('$(".main > .modules").search_input(' - . json_encode(['id' => 'input_content_menu', - 'label' => $label . ' : ', - 'fixed_display' => 'table, thead, th , .form, .form *, center, center *, br, .bouton, a *, a, img, h1, h3, h3 + div , .error, h3 + div *, .soustitre, .soustitre *, tr *']) . ');'); + protected function _addSearchInput($node, $id, $label, $fixed_elements) { + $options = json_encode(['id' => $id, + 'label' => $label . ' : ', + 'fixed_display' => $fixed_elements]); + + $jquery = sprintf('$("%s").search_input(%s);', $node, $options); + + return $this->addOPACPluginScript('search_input/search_input.js') + ->addJQueryReady($jquery); + } + + + public function addSearchInputToContent($label) { + return $this->_addSearchInput('.main > .modules', + 'input_content_menu', + $label, + 'table, thead, th , .form, .form *, center, center *, br, .bouton, a *, a, img, h1, h3, h3 + div , .error, h3 + div *, .soustitre, .soustitre *, tr *'); + } + + + public function addSearchInputToLeftMenu($label) { + return $this->_addSearchInput('.main > .left', + 'input_search_menu', + $label, + '.menuGaucheAdmin tr, .titre, img, table, tbody, td'); } } diff --git a/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php b/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php index 5b8f89e926c89f59fb380db27a551ce381af99cc..d52d02c9d6842a570ce377a155ab1171789d39e5 100644 --- a/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php +++ b/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php @@ -316,9 +316,7 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdmin extends ZendAfi_View_Helper_Base public function menuGaucheAdmin() { Class_ScriptLoader::getInstance() - ->addJQueryReady('$(".main > .left").search_input(' . json_encode(['id' => 'input_search_menu', - 'label' => $this->_('Chercher dans le menu '), - 'fixed_display' => '.menuGaucheAdmin tr, .titre, img, table, tbody, td']) . ');'); + ->addSearchInputToLeftMenu($this->_('Chercher dans le menu ')); $this->user = Class_Users::getIdentity();