Skip to content

Instantly share code, notes, and snippets.

View ChrisFrench's full-sized avatar

Chris French ChrisFrench

  • Hellosign / Dropbox
  • San Diego, CA
View GitHub Profile
@ChrisFrench
ChrisFrench / addingmenuitemsviaphptienda.php
Created November 1, 2012 00:33
Adding items to the menu in Tienda or any other Dioscouri Library App
function onBeforeDisplayAdminComponentTienda() {
DSC::load('DSCMenu', 'library.menu');
$url = 'index.php?option=com_tienda&view=campaigns';
$bar = DSCMenu::getInstance('submenu');
$bar -> addEntry('Campaigns', $url);
$bar = DSCMenu::getInstance('leftmenu_campaign');
@ChrisFrench
ChrisFrench / gist:3173236
Created July 24, 2012 23:03
Trying to get Jform working
<?php
if(version_compare(JVERSION,'1.6.0','ge')) {
//I had to add a new XML file because the plugin XML for some reason fails to load. try to fix this later to only core plugin.
$path = JPATH_SITE.'/plugins/'.$row->folder.'/'.$row->element.'/jform/'.$row->element.'.xml';
//ok we get a jForm Object from the new file
$form = JForm::getInstance("paymentplugin", $path);
//we now need the data, so lets use the rows params and put them in an object.
$registry = new JRegistry;
$registry->loadString($row->params);
//for some reason the above method for me is returning NULL, which is just stupid. if you echo $row->params and copy it and put it below it loads
@ChrisFrench
ChrisFrench / gist:3021913
Created June 30, 2012 02:36
Creating a Pie Chart - HighRoller
<?php
$chartdata = array();
$chartdata[] = array( 'fivestar' , 15 );
$chartdata[] = array( 'fourstar' , 5 );
$chartdata[] = array( 'threestar' , 25 );
$chartdata[] = array( 'twostar' , 35 );
$chartdata[] = array( 'onestar' , 25 );
// HIGHROLLER PIE CHART