| Current Path : /home/bijouxly/old/modules/mod_linelabox/ |
| Current File : /home/bijouxly/old/modules/mod_linelabox/ajax.php |
<?php
/**
* @module Linelabox
* @copyright Copyright (C) 2010 - 2012 Linelab.org. All rights reserved.
* @license Commercial Licence
*/
// Set flag that this is a parent file
define( '_JEXEC', 1 );
define('DS', DIRECTORY_SEPARATOR);
$dirs = explode(DS, dirname(__FILE__));
define('JPATH_BASE', realpath(dirname(__FILE__).DS.'..'.DS.'..') );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
// Mark afterLoad in the profiler.
JDEBUG ? $_PROFILER->mark('afterLoad') : null;
// Instantiate the application.
$app = JFactory::getApplication('site');
// Initialise the application.
$app->initialise();
/*
// Mark afterIntialise in the profiler.
JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
// Route the application.
$app->route();
// Mark afterRoute in the profiler.
JDEBUG ? $_PROFILER->mark('afterRoute') : null;
// Dispatch the application.
$app->dispatch();
// Mark afterDispatch in the profiler.
JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
// Render the application.
$app->render();
// Mark afterRender in the profiler.
JDEBUG ? $_PROFILER->mark('afterRender') : null;
*/
$user =& JFactory::getUser();
if (in_array(8, $user->get('groups'))) {
$db = JFactory::getDBO();
$query = "SELECT params FROM #__modules WHERE module='mod_linelabox'";
if (!$db->setQuery($query)) {
exit;
}
$params = json_decode($db->loadResult());
foreach ($params as $key=>$param) {
//echo "$key ";
switch ($key) {
case 'grid':
case 'boxnone':
case 'dboxnone':
case 'boxslida':
case 'boxrate':
$params->$key = JRequest::getVar($key, '0', 'post', 'string');
break;
case 'box1bg_shadow':
case 'box2bg_shadow':
case 'box3bg_shadow':
case 'box5bg_shadow':
case 'box6bg_shadow':
case 'box7bg_shadow':
case 'box10bg_shadow':
$params->$key = JRequest::getVar($key, '0px 0px', 'post', 'string');
//echo "$key: ".$params->$key."<br />";
break;
case 'box1br_radius':
case 'box2br_radius':
case 'box3br_radius':
case 'box4br_radius':
case 'box5br_radius':
case 'box6br_radius':
case 'box7br_radius':
case 'box10br_radius':
$params->$key = JRequest::getVar($key, '0px 0px 0px 0px', 'post', 'string');
//echo "$key: ".$params->$key."<br />";
break;
default:
$params->$key = JRequest::getVar($key, $param, 'post', 'string');
break;
}
}
$query = "UPDATE #__modules SET params='".$db->escape(json_encode($params))."' WHERE module='mod_linelabox' LIMIT 1";
$db->setQuery($query);
$db->query();
}
?>