Форуми / Cotonti / Extensions / Support / Sidepanel plugin always redirects to itself at login

foxhound
#38217 22.10.2013 18:46

In my first post I linked you to the source, you can use that in case you need more. I can only paste here my edits I have made but posting all js files is not needed I guess?

In the footer I have the following: 

<!-- sidebar stuff -->
	<!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> -->
	<script type="text/javascript" src="inc/jquery.hoverIntent.min.js"></script>
	<script type="text/javascript" src="inc/jquery.mb.flipText.js"></script>
	<script type="text/javascript" src="inc/mbExtruder.js"></script>
	<script type="text/javascript">

		$(function(){
			if (self.location.href == top.location.href){}
			$("#extruderRight").buildMbExtruder({
				position:"right",
				width:300,
				extruderOpacity:.8,
				textOrientation:"tb",
				onExtOpen:function(){},
				onExtContentLoad:function(){},
				onExtClose:function(){}
			});
		});
	</script>
<!-- <div id="extruderRight" class="{title:'User Control Panel ', url:'parts/extruderRight.html'}"></div> -->
<div id="extruderRight" class="{title:'User Control Panel', url:'index.php?e=sidepanel'}"></div>

 

Than I have my sidepanel setup php file: 

<?php
/* ====================
[BEGIN_COT_EXT]
Code=sidepanel
Name=sidepanel
Category=User control panel
Description= A sidepanel you can use as a user control area.
Version=1.0
Date=2013-10-22
Author=
Copyright=
Notes=
Auth_guests=RW
Lock_guests=12345A
Auth_members=RW
Lock_members=12345A
[END_COT_EXT]
==================== */

/**
 * Sidepanel Plugin for Cotonti CMF
 *
 * @package sidepanel
 * @version 1.0
 * @author
 * @copyright (c)
 * @license BSD
 */
?>

 

Than my sidepanel.php: 

<?php

/* ====================
  [BEGIN_COT_EXT]
  Hooks=standalone
  [END_COT_EXT]
  ==================== */

/**
 * Sidepanel Plugin for Cotonti CMF
 *
 * @package sidepanel
 * @version 1.0
 * 
 * @copyright (c)
 * @license BSD
 */
defined('COT_CODE') or die('Wrong URL');

$tplfile = cot_import('tpl', 'G', 'TXT');
$mskin = cot_tplfile(array('sidepanel', $tplfile), 'plug');
$t = new XTemplate($mskin);

?>

 

And I have this is my sidepanel.tpl 

<!-- BEGIN: MAIN -->
<!--
  ~ /*******************************************************************************
  ~  jquery.mb.components
  ~  file: extruderRight.html
  ~
  ~  Copyright (c) 2001-2013. Matteo Bicocchi (Pupunzi);
  ~  Open lab srl, Firenze - Italy
  ~  email: matteo@open-lab.com
  ~  site: 	http://pupunzi.com
  ~  blog:	http://pupunzi.open-lab.com
  ~ 	http://open-lab.com
  ~
  ~  Licences: MIT, GPL
  ~  http://www.opensource.org/licenses/mit-license.php
  ~  http://www.gnu.org/licenses/gpl.html
  ~
  ~  last modified: 04/01/13 17.13
  ~  ******************************************************************************/
  -->

<div class="voice {}"><span class="label"><a class="label" href="http://www.open-lab.com">Open Lab</a></span></div>
<div id="tw" class="voice {panel:'parts/extr.tw.html'}"><a class="label" href="http://twproject.com" target="_blank">teamwork</a></div>
<div class="voice {panel:'parts/extr.mti.html'}"><span class="label">Morethanicons</span></div>
<!-- IF {PHP.usr.isadmin} -->
	<div class="voice {panel:'parts/extr.network.html'}"><span class="label">Only admins can see this</span></div>
<!-- ENDIF -->
<div class="voice {disabled:true}"><span class="label">Microsoft Internet Explorer</span></div>
<div class="voice {}"><a class="label" href="http://firefox.com" target="_blank">get FireFox</a></div>
<div class="voice {}"><a class="label" href="http://www.google.com/chrome" target="_blank">get Chrome</a></div>
<div class="voice {}"><a class="label" href="http://www.apple.com/safari/" target="_blank">get Safari</a></div>
<div class="voice {}"><a class="label" href="http://www.opera.com/" target="_blank">get Opera</a></div>

<script type="text/javascript"></script>

<!-- END: MAIN -->


In the tpl I made one if statement purely for testing. Since it works my plugin actually works, except for tht redirect to its standalone page after succesfull login.
Please bare in mind, I do not really understand so much about making plugins, I am always reading and trying till I drop ;)

<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />