test
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Robert Friend
    #193128

    Hi, this is the code today. Its the button showing in the top right corner in the ja appolio template.

    Since its not a module position I need a code fix for this problem. I want it to swich to a loggout button same style for logged in users.

    <button class="btn btn-primary off-canvas-toggle" type="button" data-nav="#t3-off-canvas-login" data-pos="right" data-effect="<?php echo $this->getParam('addon_offcanvas_effect', 'off-canvas-effect-3') ?>">
    <?php echo JText::_('Registrer deg');?>
    </button>

    Wall Crasher Developer
    #516230

    Hi mrleira,

    Please BACKUP your files and try with this one.
    templatesja_appoliotplsblocksoff-canvas-login.php

    <?php
    /**
    * @package T3 Blank
    * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
    * @license GNU General Public License version 2 or later; see LICENSE.txt
    */

    defined('_JEXEC') or die;
    ?>
    <?php
    if (!$this->getParam('addon_offcanvas_enable')) return ;

    $user = JFactory::getUser();
    ?>
    <div class="action hidden-xs">
    <?php if(!$user->guest) : ?>

    <?php
    if(!class_exists('ModLoginHelper', false)){
    require_once JPATH_ROOT . '/modules/mod_login/helper.php';
    }

    $type = ModLoginHelper::getType();
    $return = ModLoginHelper::getReturnURL(new JRegistry, $type);
    ?>
    <form action="<?php echo JRoute::_('index.php', true); ?>" method="post">

    <button class="btn btn-primary off-canvas-toggle" type="submit">
    <?php echo JText::_('JLOGOUT'); ?>
    </button>

    <input type="hidden" name="option" value="com_users" />
    <input type="hidden" name="task" value="user.logout" />
    <input type="hidden" name="return" value="<?php echo $return; ?>" />
    <?php echo JHtml::_('form.token'); ?>
    </form>

    <?php else: ?>
    <button class="btn btn-primary off-canvas-toggle" type="button" data-nav="#t3-off-canvas-login" data-pos="right" data-effect="<?php echo $this->getParam('addon_offcanvas_effect', 'off-canvas-effect-3') ?>">
    <?php echo JText::_('TPL_TRY_DISCOVER_FREE');?>
    </button>
    <?php endif ?>
    </div>

    <!-- OFF-CANVAS ACTION -->
    <div id="t3-off-canvas-login" class="t3-off-canvas">

    <div class="t3-off-canvas-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    </div>

    <div class="t3-off-canvas-body">
    <jdoc:include type="modules" name="<?php $this->_p('action') ?>" style="T3Xhtml" />
    </div>

    </div>
    <!-- //OFF-CANVAS ACTION -->

    Hope it helps,

    Regards

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  Wall Crasher 11 years ago.

We moved to new unified forum. Please post all new support queries in our New Forum