Skip to content
Snippets Groups Projects
Commit 7ae0b2f5 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #16180 add flag data-logged="true" / "false" on body element

parent d31c468e
Branches
Tags
3 merge requests!529Hotline 6.56,!419Dev #15884 ccbs la boucle skin,!402Dev #15884 ccbs la boucle skin
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; 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
*/
////////////////////////////////////////////////////////////////////////////////////////////
// OPAC3 : Surcharge de la class Zend_View
......@@ -24,14 +24,14 @@
class ZendAfi_Controller_Action_Helper_View extends Zend_View {
use Trait_Translator;
protected static $instance;
private $ouverture_boite; // Html du haut de la boite
private $fermeture_boite; // Html du bas de la boite
protected $_titles = [''];
protected
protected
$_is_popup = false;
......@@ -45,13 +45,16 @@ class ZendAfi_Controller_Action_Helper_View extends Zend_View {
$this->setEscape('htmlentities');
$this->doctype('HTML5');
}
public function setModuleControllerActionNames($module, $controller, $action) {
$this->bodyParam = sprintf('class="%s_%s profil_%d"',
$controller, $action, Class_Profil::getCurrentProfil()->getId());
$this->bodyParam = sprintf('class="%s_%s profil_%d" data-logged="%s"',
$controller,
$action,
Class_Profil::getCurrentProfil()->getId(),
Class_Users::getIdentity() ? 'true' : 'false');
}
......
......@@ -123,4 +123,23 @@ class IndexControllerWithInvitedLevelRestrictionForProfilTest extends AbstractCo
$this->_response->getBody());
}
}
class IndexControllerWithLoggedUserTest extends AbstractControllerTestCase {
public function setUp() {
parent::setUp();
ZendAfi_Auth::getInstance()->logUser($this->fixture('Class_Users',
['id' => 1,
'login' => 'tom',
'password' => 'ok']));
$this->dispatch('index/index', true);
}
/** @test */
public function bodyShouldHaveDataLoggedTrue() {
$this->assertXPath('//body[@data-logged="true"]');
}
}
?>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment