Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
bibliossimo
opacce
Commits
211c0f05
Commit
211c0f05
authored
Dec 20, 2017
by
Laurent
Browse files
dev #56107 ckeditor kiosk: do not display title if not set, do not add div id
parent
4f910277
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
12 deletions
+37
-12
library/ZendAfi/View/Helper/Accueil/Base.php
library/ZendAfi/View/Helper/Accueil/Base.php
+10
-5
library/ZendAfi/View/Helper/Accueil/Kiosque.php
library/ZendAfi/View/Helper/Accueil/Kiosque.php
+5
-3
library/ZendAfi/View/Helper/Article/ReplaceWidgets.php
library/ZendAfi/View/Helper/Article/ReplaceWidgets.php
+3
-3
tests/application/modules/opac/controllers/CmsControllerTest.php
...pplication/modules/opac/controllers/CmsControllerTest.php
+19
-1
No files found.
library/ZendAfi/View/Helper/Accueil/Base.php
View file @
211c0f05
...
...
@@ -219,13 +219,13 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac
}
public
function
getBoite
(
$show_admin_buttons
=
true
)
{
public
function
getBoite
()
{
if
(
!
$this
->
isBoiteVisible
())
return
''
;
$closure
=
function
()
use
(
$show_admin_buttons
)
{
$closure
=
function
()
{
$template
=
$this
->
getTemplate
();
$html_array
=
$this
->
getHtml
(
$show_admin_buttons
);
$html_array
=
$this
->
getHtml
();
return
$this
->
getBoiteFromTemplate
(
$template
,
$html_array
);
};
...
...
@@ -289,12 +289,17 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac
else
$html
=
$html_array
[
"TITRE"
]
.
BR
.
$html_array
[
"CONTENU"
];
return
'<div id="'
.
$this
->
_getBoxId
()
.
'" class="boite '
.
strtolower
(
$this
->
type_module
)
.
'">'
.
$html
.
'</div>'
;
return
$this
->
_tag
(
'div'
,
$html
,
array_filter
([
'id'
=>
$this
->
_getBoxId
(),
'class'
=>
'boite '
.
strtolower
(
$this
->
type_module
)]));
}
public
function
_getBoxId
()
{
return
'boite_'
.
$this
->
id_module
;
return
$this
->
id_module
?
(
'boite_'
.
$this
->
id_module
)
:
null
;
}
...
...
library/ZendAfi/View/Helper/Accueil/Kiosque.php
View file @
211c0f05
...
...
@@ -62,7 +62,7 @@ class ZendAfi_View_Helper_Accueil_Kiosque extends ZendAfi_View_Helper_Accueil_Ba
}
public
function
getHtml
(
$show_admin_buttons
=
true
)
{
public
function
getHtml
()
{
$this
->
titre
=
$this
->
getTitre
();
$this
->
rss_interne
=
$this
->
getRss
();
...
...
@@ -71,7 +71,7 @@ class ZendAfi_View_Helper_Accueil_Kiosque extends ZendAfi_View_Helper_Accueil_Ba
:
$this
->
getKiosqueIFrame
();
$this
->
contenu
=
$this
->
contenu
;
return
$this
->
getHtmlArray
(
$show_admin_buttons
);
return
$this
->
getHtmlArray
();
}
...
...
@@ -238,12 +238,14 @@ class ZendAfi_View_Helper_Accueil_Kiosque extends ZendAfi_View_Helper_Accueil_Ba
public
function
getTitre
()
{
if
(
!
$titre
=
$this
->
preferences
[
'titre'
])
return
''
;
$tris
=
[
'0'
=>
'alpha_titre'
,
'1'
=>
'date_creation desc'
,
'2'
=>
'nb_visu desc'
,
'3'
=>
'annee desc'
];
$titre
=
$this
->
preferences
[
'titre'
];
$this
->
preferences
[
'titre'
]
=
str_replace
([
'/'
,
'%2F'
],
' '
,
$this
->
preferences
[
'titre'
]);
$url_options
=
array_merge
([
'controller'
=>
'recherche'
,
...
...
library/ZendAfi/View/Helper/Article/ReplaceWidgets.php
View file @
211c0f05
...
...
@@ -21,7 +21,6 @@
class
ZendAfi_View_Helper_Article_ReplaceWidgets
extends
ZendAfi_View_Helper_BaseHelper
{
public
function
article_ReplaceWidgets
(
$content
)
{
return
preg_replace_callback
(
'|(?P<allimg><img[^>]+data-code="(?P<code>\w+)"[^>]+data-form="(?P<form>[^"]+)[^>]*>)|'
,
...
...
@@ -34,14 +33,15 @@ class ZendAfi_View_Helper_Article_ReplaceWidgets extends ZendAfi_View_Helper_Bas
);
}
protected
function
_renderWidget
(
$code
,
$form
)
{
$prefs
=
[];
parse_str
(
html_entity_decode
(
$form
),
$prefs
);
$params
=
[
'type_module'
=>
$code
,
'preferences'
=>
$prefs
];
'preferences'
=>
$prefs
];
$helper
=
ZendAfi_View_Helper_Accueil_Base
::
getModuleHelperFromParams
(
null
,
$params
,
$this
->
view
);
return
$helper
->
getBoite
(
false
);
return
$helper
->
setFonctionAdminHelper
(
null
)
->
getBoite
();
}
}
?>
\ No newline at end of file
tests/application/modules/opac/controllers/CmsControllerTest.php
View file @
211c0f05
...
...
@@ -1716,7 +1716,7 @@ class CmsControllerWithArticleWithWallKioskTest extends CmsControllerWithArticle
$this
->
fixture
(
'Class_Article'
,
[
'id'
=>
55
,
'titre'
=>
'Mes dvds'
,
'contenu'
=>
'<img class="bokeh_kiosk" data-code="KIOSQUE" data-form="titre=
Boite%20kiosque
&style_liste=mur&styles_reload=0&op_speed=100&op_largeur_img=120&op_hauteur_img=150&profil_redirect=&id_catalogue=0&id_panier=&aleatoire=1&tri=1&nb_notices=20&nb_analyse=50&only_img=1&boite=&rss_avis=0">'
]);
'contenu'
=>
'<img class="bokeh_kiosk" data-code="KIOSQUE" data-form="titre=&style_liste=mur&styles_reload=0&op_speed=100&op_largeur_img=120&op_hauteur_img=150&profil_redirect=&id_catalogue=0&id_panier=&aleatoire=1&tri=1&nb_notices=20&nb_analyse=50&only_img=1&boite=&rss_avis=0">'
]);
$this
->
dispatch
(
'/cms/articleview/id/55'
,
true
);
}
...
...
@@ -1738,6 +1738,18 @@ class CmsControllerWithArticleWithWallKioskTest extends CmsControllerWithArticle
public
function
adminButtonShouldNotBeenShow
()
{
$this
->
assertNotXPath
(
'//a[contains(@href,"widget/edit-widget")]'
,
$this
->
_response
->
getBody
());
}
/** @test */
public
function
kioskShouldNotDisplayTitleLink
()
{
$this
->
assertNotXPath
(
'//div[contains(@class, "boite kiosque")]/div/a'
);
}
/** @test */
public
function
widgetDivShouldNotHaveAnId
()
{
$this
->
assertXPath
(
'//div[contains(@class, "boite kiosque")][not(@id)]'
);
}
}
...
...
@@ -1760,4 +1772,10 @@ class CmsControllerWithArticleWithCubeKioskTest extends CmsControllerWithArticle
$this
->
assertXPath
(
'//iframe[contains(@src, "style_liste/cube")]'
);;
}
/** @test */
public
function
kioskShouldDisplayTitleLink
()
{
$this
->
assertXPathContentContains
(
'//div[contains(@class, "boite kiosque")]/div/a'
,
'Boite kiosque'
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment