/** * Returns YUI3 configuration extension for custom option modules * @param array $args Not used * @return string JS code declaring YUI3 modules */ public static function modules($args) { $importINI = eZINI::instance('sqliimport.ini'); $modules = $importINI->variable('OptionsGUISettings', 'YUI3Modules'); if (count($modules)) { $js = 'YUI3_config = YUI3_config || { modules: {}}' . chr(10); $tpl = SQLIImportUtils::templateInit(); foreach ($modules as $name => $path) { $path = eZURLOperator::eZDesign($tpl, $path, 'ezdesign'); $js .= 'YUI3_config.modules.' . $name . ' = { fullpath: "' . $path . '" };' . chr(10); } return $js; } return ''; }
<?php /** * SQLi Import import alteration view * @copyright Copyright (C) 2010 - SQLi Agency. All rights reserved * @licence http://www.gnu.org/licenses/gpl-2.0.txt GNU GPLv2 * @author Jerome Vieilledent * @version @@@VERSION@@@ * @package sqliimport */ $Module = $Params['Module']; $Result = array(); $tpl = SQLIImportUtils::templateInit(); try { $user = eZUser::currentUser(); $userID = $user->attribute('contentobject_id'); $userLogin = $user->attribute('login'); $action = $Params['Action']; $importID = $Params['ImportID']; $import = SQLIImportItem::fetch($importID); if (!$import instanceof SQLIImportItem) { throw new SQLIImportBaseException(SQLIImportUtils::translate('extension/sqliimport/error', "No import item found with ID #%importID", null, array('%importID' => $importID))); } // Check if user has access to handler alteration $aLimitation = array('SQLIImport_Type' => $import->attribute('handler')); $hasAccess = SQLIImportUtils::hasAccessToLimitation($Module->currentModule(), 'manageimports', $aLimitation); if (!$hasAccess) { return $Module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel'); } switch ($action) { case 'cancel':