sh404sef plugin

mxmauro 18 Jun, 2013
Hi,

I'm building a sh404sef plugin but the form's action value is not processed with JRoute::_. Can this be fixed?

Below I put a copy of the whole code. Improvements and bug reports are welcome.

WARNING: The functionallity is not fully tested on all scenarios. And it runs on Joomla 3 (2.5 not tested, menu parameters retrieval may be handled in other way)

You can save the content into a file named "com_chronoforms.php" and upload it into "components/com_chronoforms/sef_ext" folder (create sef_ext if it does not exists).

<?php
/**
 * sh404SEF support for com_chronoforms v4 component.
 * Author : Mauro H. Leggieri
 * contact : mxmauro[-at-]mauroleggieri.com.ar
 *
 * This is a sh404SEF native plugin file for Chronoforms component (http://www.chronoengine.com)
 * Plugin version 1.0 - June 2013
 *
 */

defined('_JEXEC') or die('Direct Access to this location is not allowed.');

jimport( 'joomla.html.parameter' );

// ------------------  standard plugin initialize function - don't change ---------------------------
global $sh_LANG, $sefConfig;
$shLangName = '';
$shLangIso = '';
$title = array();
$shItemidString = '';
$dosef = shInitializePlugin($lang, $shLangName, $shLangIso, $option);
if ($dosef == false)
	return;

// ------------------  standard plugin initialize function - don't change ---------------------------

// ------------------  load language file - adjust as needed ----------------------------------------

// ------------------  load language file - adjust as needed ----------------------------------------

$task = isset($task) ? @$task : null; // var_dump( $task );
$chronoform = isset($chronoform) ? @$chronoform : null;  // var_dump( $chronoform );
$event = isset($event) ? @$event : null;  // var_dump( $event );
$view = isset($view) ? @$view : null;   // var_dump( $view );
$Itemid = isset($Itemid) ? @$Itemid : null;  // var_dump( $Itemid );

if (!isset($chronoform)) {
	error_log(print_r($Itemid, true));
	if (!isset($Itemid))
		return;
	$menu = JSite::getMenu();
	$menuparams = NULL;
	$menuitem = $menu->getItem($Itemid);
	if (empty($menuitem->params))
		return;
	$chronoform = $menuitem->params->get('formname');
	$event = $menuitem->params->get('event');
	if (empty($chronoform))
		return;
	if (empty($event))
		$event = null;
}

$title[] = $chronoform;
if (isset($view)) {
	if ($view == 'form')
		$view = null;
}
if (isset($view))
	$title[] = $view;
$title[] = $event;
if (isset($task))
	$title[] = $task;

shRemoveFromGETVarsList('chronoform');
shRemoveFromGETVarsList('view');
shRemoveFromGETVarsList('event');
shRemoveFromGETVarsList('task');
shRemoveFromGETVarsList('option');
shRemoveFromGETVarsList('lang');
shRemoveFromGETVarsList('Itemid');

// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef)
{
	$string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, (isset($limit) ? @$limit : null),
		(isset($limitstart) ? @$limitstart : null), (isset($shLangName) ? @$shLangName : null));
}
// ------------------  standard plugin finalize function - don't change ---------------------------

?>
GreyHead 19 Jun, 2013
Hi mxmauro,

Thank you.

Max has never added a JRouter file in ChronoForms - maybe in a future version?

Bob

PS A few years back I built an sh404SEF plug-in for v1 of sh404SEF and an old version of ChronoForms. I never updated it after Yannick sold the component as there were no 'how to write a plug-in' documents available for the newer version.
mxmauro 05 Jul, 2013
Hi Grey,

Sorry for the late response. It is my contribution to this great component.

:)
This topic is locked and no more replies can be posted.