Simpla Admin – opening tabs from URLs

simpla.jquery.configuration.js - line 50 onwards
url_tab = unescape(self.document.location.hash);
if(url_tab != '') {
url_tab = url_tab.substring(5); // #tab- = 5
if($('ul.content-box-tabs li a[href=#' + url_tab + ']').length > 0) {
$('ul.content-box-tabs li a[href=#' + url_tab + ']').addClass('current');
$('.content-box-content div#' + url_tab).show();
} else {
$('ul.content-box-tabs li a.default-tab').addClass('current'); // Add the class "current" to the default tab
$('.content-box-content div.default-tab').show(); // Show the div with class "default-tab"

This will take index.html#tab-id-of-tab and open the tab with the id of ‘id-of-tab’. the ‘tab-‘ part at the start is so the browser doesn’t scroll down to the tab which is opened by itself.

Uploadify & PHP Sessions

Secured sites need the following parameter passed across;

session_id: <?= session_id() ?>

And somewhere in the code it should pick this up out of the $_REQUEST variable and set it … basically the problem lies in flash (what uploadify uses) not using the same session data as your browser, thus in flash’s eyes you seem logged out and it can’t do much in the way of sending files to where they need to go.

jQuery Tricks with Facebox

To use focus() and datepicker(..) properly with facebox, these need to be added in using the reveal.facebox(…) event AND use the #facebox tag as well (facebox does a copy of the content to put in it’s popup window and you can’t have two boxes focused at the same time now can we?!)

$(function() {
 $(document).bind('reveal.facebox', function() {
 $('#facebox #new_date').datepicker({dateFormat: 'dd/mm/yy'});
 $('#facebox #new_date').focus();

Thanks goes to for this trick! 🙂