Description of task: Implement all three of ApplestoOranges's CSS for Bar Graphs
implementations in a Joomla! v 1.5 plugin:
# Basic CSS Bar Graph;
# Complex CSS Bar Graph;
# Vertical CSS Bar Graph.
So far this is the beginning of the code i am creating:
Code: Select all
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
$mainframe->registerEvent( 'onPrepareContent', 'plgProGraph' );
function plgProGraph( &$row, &$params, $page=0 ) {
$plugin =& JPluginHelper::getPlugin('content', 'prograph');
$pluginParams = new JParameter( $plugin->params );
$gpattern = '/{graph="(.*)"}(.*){\/graph}/'; // Pattern for the graph syntax
$bpattern = '/{bar="(.*)"}/'; // Pattern for the individual bars
// check whether plugin has been unpublished
if ( PGIsEnabled($pluginParams) == 0 )
{
$disabletext = '' //Change to give option in bacckend for this message / formatting
$row->text = preg_replace( $gpattern, $disabletext, $row->text );
}
// find all instances of plugin and put in $matches
preg_match_all( $gpattern, $row->text, $plugins );
// Number of plugins
$pluginsnum = count( $plugins[0] );
if ( !($pluginsnum == 0) )
{
for ( $loop=0; $loop < $pluginsnum; )
$loop = $loop + 1;
preg_match_all( $bpattern, $plugins[1][$loop], $bars );
$barsnum = count( $bars[0] );
if ( !($barsnum == 0))
{
$replace = PGSetupGrapg(
}
function PGIsEnabled( $params )
{
if ( $params->get( 'enabled', 1 ) )
{
return 1;
}
}
The php manual entries are very difficult for me to understand so it would be great if somebody would explain the output of this command:
Code: Select all
$gpattern = '/{graph="(.*)"}(.*){\/graph}/'; // Pattern for the graph syntax
preg_match_all( $gpattern, $row->text, $plugins );
Would it give me a 3 dimensional array.
If nobody can answer this then i have thought out a way around it...
Also is there a way to place a logo in the module configuration panel?
Or put in tables or text formatting??
Thanks for any help
It's greatly appreciated