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
e1383284
Commit
e1383284
authored
Dec 19, 2017
by
efalcy
Browse files
dev #56107 : unshow admin buttons when kiosk is displayed inside article
parent
eaaf6f43
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
15 deletions
+25
-15
library/ZendAfi/View/Helper/Accueil/Base.php
library/ZendAfi/View/Helper/Accueil/Base.php
+8
-5
library/ZendAfi/View/Helper/Accueil/Kiosque.php
library/ZendAfi/View/Helper/Accueil/Kiosque.php
+2
-2
library/ZendAfi/View/Helper/Article/ReplaceWidgets.php
library/ZendAfi/View/Helper/Article/ReplaceWidgets.php
+1
-4
tests/application/modules/opac/controllers/CmsControllerTest.php
...pplication/modules/opac/controllers/CmsControllerTest.php
+14
-4
No files found.
library/ZendAfi/View/Helper/Accueil/Base.php
View file @
e1383284
...
...
@@ -112,10 +112,13 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac
//---------------------------------------------------------------------
// Rend le html_array à mettre dans une boite
//---------------------------------------------------------------------
protected
function
getHtmlArray
()
protected
function
getHtmlArray
(
$show_admin
=
true
)
{
$content
=
$show_admin
?
$this
->
getFonctionAdmin
()
.
$this
->
contenu
:
$this
->
contenu
;
return
[
"TITRE"
=>
$this
->
titre
,
"CONTENU"
=>
$
this
->
getFonctionAdmin
()
.
$this
->
contenu
,
"CONTENU"
=>
$
content
,
"MESSAGE"
=>
$this
->
message
,
"RSS"
=>
$this
->
rss_interne
,
"TYPE_MODULE"
=>
strtolower
(
$this
->
type_module
)];
...
...
@@ -216,13 +219,13 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac
}
public
function
getBoite
()
{
public
function
getBoite
(
$show_admin_buttons
=
true
)
{
if
(
!
$this
->
isBoiteVisible
())
return
''
;
$closure
=
function
()
{
$closure
=
function
()
use
(
$show_admin_buttons
)
{
$template
=
$this
->
getTemplate
();
$html_array
=
$this
->
getHtml
();
$html_array
=
$this
->
getHtml
(
$show_admin_buttons
);
return
$this
->
getBoiteFromTemplate
(
$template
,
$html_array
);
};
...
...
library/ZendAfi/View/Helper/Accueil/Kiosque.php
View file @
e1383284
...
...
@@ -62,7 +62,7 @@ class ZendAfi_View_Helper_Accueil_Kiosque extends ZendAfi_View_Helper_Accueil_Ba
}
public
function
getHtml
()
{
public
function
getHtml
(
$show_admin_buttons
=
true
)
{
$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
();
return
$this
->
getHtmlArray
(
$show_admin_buttons
);
}
...
...
library/ZendAfi/View/Helper/Article/ReplaceWidgets.php
View file @
e1383284
...
...
@@ -23,7 +23,6 @@
class
ZendAfi_View_Helper_Article_ReplaceWidgets
extends
ZendAfi_View_Helper_BaseHelper
{
public
function
article_ReplaceWidgets
(
$content
)
{
// '|<div[^>]+data-code="(?P<code>\w+)"[^>]+data-form="(?P<form>\w+)"[^>]*>[^<]+</div>|',
return
preg_replace_callback
(
'|(?P<alldiv><div[^>]+data-code="(?P<code>\w+)"[^>]+data-form="(?P<form>[^"]+)[^>]*>[^<]+</div>)|'
,
function
(
$matches
)
{
...
...
@@ -41,10 +40,8 @@ class ZendAfi_View_Helper_Article_ReplaceWidgets extends ZendAfi_View_Helper_Bas
parse_str
(
html_entity_decode
(
$form
),
$prefs
);
$params
=
[
'type_module'
=>
$code
,
'preferences'
=>
$prefs
];
xdebug_break
();
$helper
=
ZendAfi_View_Helper_Accueil_Base
::
getModuleHelperFromParams
(
null
,
$params
,
$this
->
view
);
return
$helper
->
getBoite
();
//Class_Systeme_ModulesAccueil::moduleByCode($code)
return
$helper
->
getBoite
(
false
);
}
}
?>
\ No newline at end of file
tests/application/modules/opac/controllers/CmsControllerTest.php
View file @
e1383284
...
...
@@ -733,7 +733,7 @@ class CmsControllerArticleViewByDateWithRadioSummarySelectedTest extends Abstrac
/** @test */
public
function
articleTextLaFeteDeLaBananeShouldNotContainsFullArticle
()
{
$this
->
assertNotXpathContentContains
(
'//article'
,
' Une fête qui glisse !'
);
$this
->
assertNotXpathContentContains
(
'//article'
,
' Une fête qui glisse !'
,
$this
->
_response
->
getBody
()
);
}
...
...
@@ -916,7 +916,7 @@ class CmsControllerViewNoticeMetasTest extends CmsControllerWithFeteDeLaFriteTes
/** @test */
public
function
pageShouldContainImageMeta
()
{
$this
->
assertXPath
(
'//meta[@property="og:image"][@content="'
.
Class_Url
::
siteUrl
()
.
'/userfiles/image/foo.jpg"]'
);
$this
->
assertXPath
(
'//meta[@property="og:image"][@content="'
.
Class_Url
::
siteUrl
()
.
'/userfiles/image/foo.jpg"]'
,
$this
->
_response
->
getBody
()
);
}
}
...
...
@@ -965,8 +965,8 @@ class CmsControllerArticleViewOnPortalTest extends CmsControllerWithFeteDeLaFrit
/** @test **/
public
function
articleInfoShouldContainsEventBibLinkToBibViewBonlieu
()
{
$this
->
assertNotXPath
(
'//dl[@class="article_info"]/dd[@class="event_bib_link"]'
);
public
function
articleInfoShould
Not
ContainsEventBibLinkToBibViewBonlieu
()
{
$this
->
assertNotXPath
(
'//dl[@class="article_info"]/dd[@class="event_bib_link"]'
,
$this
->
_response
->
getBody
()
);
}
/** @test */
...
...
@@ -1678,6 +1678,10 @@ class CmsControllerDispatchViewSummaryTest extends AbstractControllerTestCase {
class
CmsControllerWithArticleWithKioskTest
extends
AbstractControllerTestCase
{
protected
$_storm_default_to_volatile
=
true
;
protected
function
_loginHook
(
$account
)
{
$account
->
ROLE_LEVEL
=
ZendAfi_Acl_AdminControllerRoles
::
ADMIN_PORTAIL
;
$account
->
PSEUDO
=
"admin"
;
}
public
function
setUp
()
{
parent
::
setUp
();
...
...
@@ -1725,4 +1729,10 @@ class CmsControllerWithArticleWithKioskTest extends AbstractControllerTestCase {
}
/** @test */
public
function
adminButtonShouldNotBeenShow
()
{
$this
->
assertNotXPath
(
'//a[contains(@href,"widget/edit-widget")]'
,
$this
->
_response
->
getBody
());
}
}
\ 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