function executeModel($model, $params, $templatePath) { $modelParams = isset($params[$model]) ? $params[$model] : null; $filter = JFilterInput::getInstance(); $model = ucfirst($filter->clean($model, 'WORD')); if (empty($model)) { AriSexyLightboxHelper::executeErrorModel($params, $templatePath); return ; } else { $modelName = 'SexyLightbox' . $model . 'Model'; $modelPath = dirname(__FILE__) . DS . 'Models' . DS . 'class.' . $modelName . '.php'; if (!@file_exists($modelPath)) { AriSexyLightboxHelper::executeErrorModel($params, $templatePath); return ; } else { AriKernel::import('SexyLightbox.Models.' . $modelName); $modelClass = 'Ari' . $modelName; $oModel = new $modelClass(); $oModel->execute($modelParams, $params, $templatePath); } } }