function display($tpl = null) { // ******************** // Initialise variables // ******************** $app = JFactory::getApplication(); $jinput = $app->input; $option = $jinput->get('option', '', 'cmd'); $view = $jinput->get('view', '', 'cmd'); $task = $jinput->get('task', '', 'cmd'); $cparams = JComponentHelper::getParams('com_flexicontent'); $user = JFactory::getUser(); $db = JFactory::getDBO(); $document = JFactory::getDocument(); $session = JFactory::getSession(); // Get model $model = $this->getModel(); // Some flags $has_zlib = function_exists("zlib_encode"); //version_compare(PHP_VERSION, '5.4.0', '>='); // Get session information $conf = $session->get('csvimport_config', "", 'flexicontent'); $conf = unserialize($conf ? $has_zlib ? zlib_decode(base64_decode($conf)) : base64_decode($conf) : ""); $lineno = $session->get('csvimport_lineno', 999999, 'flexicontent'); $session->set('csvimport_parse_log', null, 'flexicontent'); // This is the flag if CSV file has been parsed (import form already submitted), thus to display the imported data // ************************** // Add css and js to document // ************************** $document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/flexicontentbackend.css', FLEXI_VHASH); $document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/j3x.css', FLEXI_VHASH); // Add JS frameworks flexicontent_html::loadFramework('select2'); $prettycheckable_added = flexicontent_html::loadFramework('prettyCheckable'); flexicontent_html::loadFramework('flexi-lib'); // Add js function to overload the joomla submitform validation JHTML::_('behavior.formvalidation'); // load default validation JS to make sure it is overriden $document->addScriptVersion(JURI::root(true) . '/components/com_flexicontent/assets/js/admin.js', FLEXI_VHASH); $document->addScriptVersion(JURI::root(true) . '/components/com_flexicontent/assets/js/validate.js', FLEXI_VHASH); // ***************************** // Get user's global permissions // ***************************** $perms = FlexicontentHelperPerm::getPerm(); // ************************ // Create Submenu & Toolbar // ************************ // Create Submenu (and also check access to current view) FLEXISubmenu('CanImport'); // Create document/toolbar titles $doc_title = JText::_('FLEXI_IMPORT'); $site_title = $document->getTitle(); JToolBarHelper::title($doc_title, 'import'); $document->setTitle($doc_title . ' - ' . $site_title); // Create the toolbar $toolbar = JToolBar::getInstance('toolbar'); if (!empty($conf)) { if ($task != 'processcsv') { $ctrl_task = 'import.processcsv'; $import_btn_title = empty($lineno) ? 'FLEXI_IMPORT_START_TASK' : 'FLEXI_IMPORT_CONTINUE_TASK'; JToolBarHelper::custom($ctrl_task, 'save.png', 'save.png', $import_btn_title, $list_check = false); } $ctrl_task = 'import.clearcsv'; JToolBarHelper::custom($ctrl_task, 'cancel.png', 'cancel.png', 'FLEXI_IMPORT_CLEAR_TASK', $list_check = false); } else { $ctrl_task = 'import.initcsv'; JToolBarHelper::custom($ctrl_task, 'import.png', 'import.png', 'FLEXI_IMPORT_PREPARE_TASK', $list_check = false); $ctrl_task = 'import.testcsv'; JToolBarHelper::custom($ctrl_task, 'test.png', 'test.png', 'FLEXI_IMPORT_TEST_FILE_FORMAT', $list_check = false); } //JToolBarHelper::Back(); if ($perms->CanConfig) { JToolBarHelper::divider(); JToolBarHelper::spacer(); $session = JFactory::getSession(); $fc_screen_width = (int) $session->get('fc_screen_width', 0, 'flexicontent'); $_width = $fc_screen_width && $fc_screen_width - 84 > 940 ? $fc_screen_width - 84 > 1400 ? 1400 : $fc_screen_width - 84 : 940; $fc_screen_height = (int) $session->get('fc_screen_height', 0, 'flexicontent'); $_height = $fc_screen_height && $fc_screen_height - 128 > 550 ? $fc_screen_height - 128 > 1000 ? 1000 : $fc_screen_height - 128 : 550; JToolBarHelper::preferences('com_flexicontent', $_height, $_width, 'Configuration'); } // Get types $types = flexicontent_html::getTypesList($_type_ids = false, $_check_perms = false, $_published = true); // Get Languages $languages = FLEXIUtilities::getLanguages('code'); // Get categories global $globalcats; $categories = $globalcats; // ************************************ // Decide layout to load: 'import*.php' // ************************************ $this->setLayout('import'); $this->sidebar = FLEXI_J30GE ? JHtmlSidebar::render() : null; // Execute the import task, load the log-like AJAX-based layout (import_process.php), to display results including any warnings if (!empty($conf) && $task == 'processcsv') { $this->assignRef('conf', $conf); parent::display('process'); return; } else { if (!empty($conf)) { $this->assignRef('conf', $conf); $this->assignRef('cparams', $cparams); $this->assignRef('types', $types); $this->assignRef('languages', $languages); $this->assignRef('categories', $globalcats); parent::display('list'); return; } } // Session config is empty, means import form has not been submited, display the form // We will display import form which is not 'default.php', it is 'import.php' // else ... // Check is session table DATA column is not mediumtext (16MBs, it can be 64 KBs ('text') in some sites that were not properly upgraded) $tblname = 'session'; $dbprefix = $app->getCfg('dbprefix'); $dbname = $app->getCfg('db'); $db->setQuery("SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '" . $dbname . "' AND TABLE_NAME = '" . $dbprefix . $tblname . "'"); $jession_coltypes = $db->loadAssocList('COLUMN_NAME'); $_dataColType = strtolower($jession_coltypes['data']['DATA_TYPE']); $_dataCol_wrongSize = $_dataColType != 'mediumtext' && $_dataColType != 'longtext'; // If data type is "text" it is safe to assume that it can be converted to "mediumtext", // since "text" means that session table is not memory storage, // plus it is already stored externally aka operation will be quick ? /*if ($_dataCol_wrongSize && $_dataColType == 'text') { $db->setQuery("ALTER TABLE `#__session` MODIFY `data` MEDIUMTEXT"); $db->execute(); $_dataCol_wrongSize = false; }*/ if ($_dataCol_wrongSize) { $app->enqueueMessage("Joomla DB table: <b>'session'</b> has a <b>'data'</b> column with type: <b>'" . $_dataColType . "'</b>, instead of expected type <b>'mediumtext'</b>. Trying to import large data files may fail", "notice"); } $formvals = array(); // Retrieve Basic configuration $formvals['type_id'] = $model->getState('type_id'); $formvals['language'] = $model->getState('language'); $formvals['state'] = $model->getState('state'); $formvals['access'] = $model->getState('access'); // Main and secondary categories, tags $formvals['maincat'] = $model->getState('maincat'); $formvals['maincat_col'] = $model->getState('maincat_col'); $formvals['seccats'] = $model->getState('seccats'); $formvals['seccats_col'] = $model->getState('seccats_col'); $formvals['tags_col'] = $model->getState('tags_col'); // Publication: Author/modifier $formvals['created_by_col'] = $model->getState('created_by_col'); $formvals['modified_by_col'] = $model->getState('modified_by_col'); // Publication: META data $formvals['metadesc_col'] = $model->getState('metadesc_col'); $formvals['metakey_col'] = $model->getState('metakey_col'); // Publication: dates $formvals['modified_col'] = $model->getState('modified_col'); $formvals['created_col'] = $model->getState('modified_col'); $formvals['publish_up_col'] = $model->getState('publish_up_col'); $formvals['publish_down_col'] = $model->getState('publish_down_col'); // Advanced configuration $formvals['ignore_unused_cols'] = $model->getState('ignore_unused_cols'); $formvals['id_col'] = $model->getState('id_col'); $formvals['items_per_step'] = $model->getState('items_per_step'); // CSV file format $formvals['mval_separator'] = $model->getState('mval_separator'); $formvals['mprop_separator'] = $model->getState('mprop_separator'); $formvals['field_separator'] = $model->getState('field_separator'); $formvals['enclosure_char'] = $model->getState('enclosure_char'); $formvals['record_separator'] = $model->getState('record_separator'); $formvals['debug_records'] = $model->getState('debug_records'); // ****************** // Create form fields // ****************** $lists['type_id'] = flexicontent_html::buildtypesselect($types, 'type_id', $formvals['type_id'], true, 'class="required use_select2_lib"', 'type_id'); $actions_allowed = array('core.create'); // Creating categorories tree for item assignment, we use the 'create' privelege // build the main category select list $attribs = 'class="use_select2_lib required"'; $fieldname = 'maincat'; $lists['maincat'] = flexicontent_cats::buildcatselect($categories, $fieldname, $formvals['maincat'], 2, $attribs, false, true, $actions_allowed); // build the secondary categories select list $class = "use_select2_lib"; $attribs = 'multiple="multiple" size="10" class="' . $class . '"'; $fieldname = 'seccats[]'; $lists['seccats'] = flexicontent_cats::buildcatselect($categories, $fieldname, $formvals['seccats'], false, $attribs, false, true, $actions_allowed, $require_all = true); // build languages list // Retrieve author configuration $authorparams = flexicontent_db::getUserConfig($user->id); $allowed_langs = $authorparams->get('langs_allowed', null); $allowed_langs = !$allowed_langs ? null : FLEXIUtilities::paramToArray($allowed_langs); // We will not use the default getInput() function of J1.6+ since we want to create a radio selection field with flags // we could also create a new class and override getInput() method but maybe this is an overkill, we may do it in the future $lists['languages'] = flexicontent_html::buildlanguageslist('language', ' style="vertical-align:top;" onchange="var m=jQuery(\'#fc_import_about_langcol\'); this.value ? m.hide(600) : m.show(600);"', $formvals['language'], 6, $allowed_langs, $published_only = true, $disable_langs = null, $add_all = true, $conf = array('required' => true)) . ' <span class="fc-mssg-inline fc-note fc-nobgimage" id="fc_import_about_langcol" style="display:none;"> ' . JText::_('FLEXI_USE_LANGUAGE_COLUMN_TIP') . ' </span>'; $lists['states'] = flexicontent_html::buildstateslist('state', ' style="vertical-align:top;" onchange="var m=jQuery(\'#fc_import_about_statecol\'); this.value ? m.hide(600) : m.show(600);"', $formvals['state'], 2) . '<span class="fc-mssg-inline fc-note fc-nobgimage" id="fc_import_about_statecol" style="display:none;"> ' . JText::_('FLEXI_USE_STATE_COLUMN_TIP') . ' </span>'; // build access level filter $access_levels = JHtml::_('access.assetgroups'); array_unshift($access_levels, JHtml::_('select.option', '0', "Use 'access' column")); array_unshift($access_levels, JHtml::_('select.option', '', 'FLEXI_SELECT_ACCESS_LEVEL')); $fieldname = 'access'; // make multivalue $elementid = 'access'; $attribs = 'class="required use_select2_lib"'; $lists['access'] = JHTML::_('select.genericlist', $access_levels, $fieldname, $attribs, 'value', 'text', $formvals['access'], $elementid, $translate = true); // Ignore warnings because component may not be installed $warnHandlers = JERROR::getErrorHandling(E_WARNING); JERROR::setErrorHandling(E_WARNING, 'ignore'); // Reset the warning handler(s) foreach ($warnHandlers as $mode) { JERROR::setErrorHandling(E_WARNING, $mode); } // ******************************************************************************** // Get field names (from the header line (row 0), and remove it form the data array // ******************************************************************************** $file_field_types_list = '"image","file"'; $q = 'SELECT id, name, label, field_type FROM #__flexicontent_fields AS fi' . ' WHERE fi.field_type IN (' . $file_field_types_list . ')'; $db->setQuery($q); $file_fields = $db->loadObjectList('name'); //assign data to template $this->assignRef('model', $model); $this->assignRef('lists', $lists); $this->assignRef('user', $user); $this->assignRef('cparams', $cparams); $this->assignRef('file_fields', $file_fields); $this->assignRef('formvals', $formvals); parent::display($tpl); }
function _displayCopyMove($tpl = null, $cid = array(), $behaviour = 'copy/move') { global $globalcats; $app = JFactory::getApplication(); // Initialise variables $user = JFactory::getUser(); $document = JFactory::getDocument(); // Add css to document $document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/flexicontentbackend.css', FLEXI_VERSION); $document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/j3x.css', FLEXI_VERSION); // Add js to document JHTML::_('behavior.tooltip'); flexicontent_html::loadFramework('select2'); $document->addScriptVersion(JURI::base(true) . '/components/com_flexicontent/assets/js/copymove.js', FLEXI_VERSION); // Add js function to overload the joomla submitform validation JHTML::_('behavior.formvalidation'); // load default validation JS to make sure it is overriden $document->addScriptVersion(JURI::root(true) . '/components/com_flexicontent/assets/js/admin.js', FLEXI_VERSION); $document->addScriptVersion(JURI::root(true) . '/components/com_flexicontent/assets/js/validate.js', FLEXI_VERSION); // Create document/toolbar titles if ($behaviour == 'translate') { $doc_title = JText::_('FLEXI_TRANSLATE_ITEM'); } else { $doc_title = JText::_('FLEXI_BATCH'); } $site_title = $document->getTitle(); JToolBarHelper::title($doc_title, 'itemadd'); $document->setTitle($doc_title . ' - ' . $site_title); // Create the toolbar JToolBarHelper::save('items.copymove'); JToolBarHelper::cancel('items.cancel'); //Get data from the model $rows = $this->get('Data'); $itemCats = $this->get('ItemCats'); $categories = $globalcats; // build the main category select list $lists['maincat'] = flexicontent_cats::buildcatselect($categories, 'maincat', '', JText::_('FLEXI_DO_NOT_CHANGE'), 'class="use_select2_lib" size="10"', false, false); // build the secondary categories select list $lists['seccats'] = flexicontent_cats::buildcatselect($categories, 'seccats[]', '', 0, 'class="use_select2_lib" multiple="multiple" size="10"', false, false); // build language selection $lists['language'] = flexicontent_html::buildlanguageslist('language', '', '', $type = $behaviour != 'translate' ? JText::_('FLEXI_NOCHANGE_LANGUAGE') : 7, $allowed_langs = null, $published_only = true, $disable_langs = null, $add_all = true, array('required' => 1)); // build state selection $selected_state = 0; // use unpublished as default state of new items, (instead of '' which means do not change) $lists['state'] = flexicontent_html::buildstateslist('state', 'class="use_select2_lib"', $selected_state); // build types selection $types = flexicontent_html::getTypesList(); $lists['type_id'] = flexicontent_html::buildtypesselect($types, 'type_id', '', JText::_('FLEXI_DO_NOT_CHANGE'), 'class="use_select2_lib" size="1" style="vertical-align:top;"', 'type_id'); // build access level filter $levels = JHtml::_('access.assetgroups'); array_unshift($levels, JHtml::_('select.option', '', 'FLEXI_DO_NOT_CHANGE')); $fieldname = $elementid = 'access'; $attribs = 'class="use_select2_lib"'; $lists['access'] = JHTML::_('select.genericlist', $levels, $fieldname, $attribs, 'value', 'text', $value = '', $elementid, $translate = true); //assign data to template $this->assignRef('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('itemCats', $itemCats); $this->assignRef('cid', $cid); $this->assignRef('user', $user); $this->assignRef('behaviour', $behaviour); parent::display($tpl); }
<?php echo flexicontent_html::buildlanguageslist('language', '', $this->rows[0]->lang, $type = $copy_behaviour != 'translate' ? 5 : 4); ?> </td> </tr> <?php } ?> <tr valign="top"> <td class="key"><label class="fckey"><?php echo JText::_('FLEXI_STATE'); ?> </label></td> <td> <?php echo flexicontent_html::buildstateslist('state', '', ''); ?> </td> </tr> </table> </fieldset> </td> <td valign="top" width="33%"> <fieldset> <legend><?php echo JText::_('FLEXI_COPY_MOVE_DESTINATION'); ?> </legend> <table> <tr valign="top"> <td class="key"><label class="fckey"><?php
function display($tpl = null) { $mainframe = JFactory::getApplication(); //initialise variables $user = JFactory::getUser(); $db = JFactory::getDBO(); $document = JFactory::getDocument(); $option = JRequest::getCmd('option'); $context = 'com_flexicontent'; $task = JRequest::getVar('task', ''); $cid = JRequest::getVar('cid', array()); $cparams = JComponentHelper::getParams('com_flexicontent'); $this->setLayout('import'); //initialise variables $user = JFactory::getUser(); $document = JFactory::getDocument(); $context = 'com_flexicontent'; $has_zlib = version_compare(PHP_VERSION, '5.4.0', '>='); FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools'); JHTML::_('behavior.tooltip'); //add css to document $document->addStyleSheet(JURI::base() . 'components/com_flexicontent/assets/css/flexicontentbackend.css'); if (FLEXI_J30GE) { $document->addStyleSheet(JURI::base() . 'components/com_flexicontent/assets/css/j3x.css'); } else { if (FLEXI_J16GE) { $document->addStyleSheet(JURI::base() . 'components/com_flexicontent/assets/css/j25.css'); } else { $document->addStyleSheet(JURI::base() . 'components/com_flexicontent/assets/css/j15.css'); } } // Get filter vars $filter_order = $mainframe->getUserStateFromRequest($context . '.import.filter_order', 'filter_order', '', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($context . '.import.filter_order_Dir', 'filter_order_Dir', '', 'word'); // Get session information $session = JFactory::getSession(); $conf = $session->get('csvimport_config', "", 'flexicontent'); $conf = unserialize($conf ? $has_zlib ? zlib_decode(base64_decode($conf)) : base64_decode($conf) : ""); $lineno = $session->get('csvimport_lineno', 999999, 'flexicontent'); $session->set('csvimport_parse_log', null, 'flexicontent'); // Get User's Global Permissions $perms = FlexicontentHelperPerm::getPerm(); // Create Submenu (and also check access to current view) FLEXISubmenu('CanImport'); // Create document/toolbar titles $doc_title = JText::_('FLEXI_IMPORT'); $site_title = $document->getTitle(); JToolBarHelper::title($doc_title, 'import'); $document->setTitle($doc_title . ' - ' . $site_title); // Create the toolbar $toolbar = JToolBar::getInstance('toolbar'); if (!empty($conf)) { if ($task != 'processcsv') { $ctrl_task = FLEXI_J16GE ? 'import.processcsv' : 'processcsv'; $import_btn_title = empty($lineno) ? 'FLEXI_IMPORT_START_TASK' : 'FLEXI_IMPORT_CONTINUE_TASK'; JToolBarHelper::custom($ctrl_task, 'save.png', 'save.png', $import_btn_title, $list_check = false); } $ctrl_task = FLEXI_J16GE ? 'import.clearcsv' : 'clearcsv'; JToolBarHelper::custom($ctrl_task, 'cancel.png', 'cancel.png', 'FLEXI_IMPORT_CLEAR_TASK', $list_check = false); } else { $ctrl_task = FLEXI_J16GE ? 'import.initcsv' : 'initcsv'; JToolBarHelper::custom($ctrl_task, 'import.png', 'import.png', 'FLEXI_IMPORT_PREPARE_TASK', $list_check = false); $ctrl_task = FLEXI_J16GE ? 'import.testcsv' : 'testcsv'; JToolBarHelper::custom($ctrl_task, 'test.png', 'test.png', 'FLEXI_IMPORT_TEST_FILE_FORMAT', $list_check = false); } //JToolBarHelper::Back(); if ($perms->CanConfig) { JToolBarHelper::divider(); JToolBarHelper::spacer(); $session = JFactory::getSession(); $fc_screen_width = (int) $session->get('fc_screen_width', 0, 'flexicontent'); $_width = $fc_screen_width && $fc_screen_width - 84 > 940 ? $fc_screen_width - 84 > 1400 ? 1400 : $fc_screen_width - 84 : 940; $fc_screen_height = (int) $session->get('fc_screen_height', 0, 'flexicontent'); $_height = $fc_screen_height && $fc_screen_height - 128 > 550 ? $fc_screen_height - 128 > 1000 ? 1000 : $fc_screen_height - 128 : 550; JToolBarHelper::preferences('com_flexicontent', $_height, $_width, 'Configuration'); } if (!empty($conf) && $task == 'processcsv') { $this->assignRef('conf', $conf); parent::display('process'); return; } // Get types $query = 'SELECT id, name' . ' FROM #__flexicontent_types' . ' WHERE published = 1' . ' ORDER BY name ASC'; $db->setQuery($query); $types = $db->loadObjectList('id'); // Get Languages $languages = FLEXI_FISH || FLEXI_J16GE ? FLEXIUtilities::getLanguages('code') : array(); // Get categories global $globalcats; $categories = $globalcats; if (!empty($conf)) { $this->assignRef('conf', $conf); $this->assignRef('cparams', $cparams); $this->assignRef('types', $types); $this->assignRef('languages', $languages); $this->assignRef('categories', $globalcats); parent::display('list'); return; } // ****************** // Create form fields // ****************** $lists['type_id'] = flexicontent_html::buildtypesselect($types, 'type_id', '', true, 'class="fcfield_selectval" size="1"', 'type_id'); $actions_allowed = array('core.create'); // Creating categorories tree for item assignment, we use the 'create' privelege // build the secondary categories select list $class = "fcfield_selectmulval"; $attribs = 'multiple="multiple" size="10" class="' . $class . '"'; $fieldname = FLEXI_J16GE ? 'seccats[]' : 'seccats[]'; $lists['seccats'] = flexicontent_cats::buildcatselect($categories, $fieldname, '', false, $attribs, false, true, $actions_allowed, $require_all = true); // build the main category select list $attribs = 'class="fcfield_selectval"'; $fieldname = FLEXI_J16GE ? 'maincat' : 'maincat'; $lists['maincat'] = flexicontent_cats::buildcatselect($categories, $fieldname, '', 2, $attribs, false, true, $actions_allowed); /* // build the main category select list $lists['maincat'] = flexicontent_cats::buildcatselect($categories, 'maincat', '', 0, 'class="inputbox" size="10"', false, false); // build the secondary categories select list $lists['seccats'] = flexicontent_cats::buildcatselect($categories, 'seccats[]', '', 0, 'class="inputbox" multiple="multiple" size="10"', false, false); */ //build languages list // Retrieve author configuration $db->setQuery('SELECT author_basicparams FROM #__flexicontent_authors_ext WHERE user_id = ' . $user->id); if ($authorparams = $db->loadResult()) { $authorparams = FLEXI_J16GE ? new JRegistry($authorparams) : new JParameter($authorparams); } $allowed_langs = !$authorparams ? null : $authorparams->get('langs_allowed', null); $allowed_langs = !$allowed_langs ? null : FLEXIUtilities::paramToArray($allowed_langs); // We will not use the default getInput() function of J1.6+ since we want to create a radio selection field with flags // we could also create a new class and override getInput() method but maybe this is an overkill, we may do it in the future if (FLEXI_FISH || FLEXI_J16GE) { $default_lang = $cparams->get('import_lang', '*'); $lists['languages'] = flexicontent_html::buildlanguageslist('language', '', $default_lang, 6, $allowed_langs, $published_only = true); } else { $default_lang = flexicontent_html::getSiteDefaultLang(); $_langs[] = JHTML::_('select.option', $default_lang, JText::_('Default') . ' (' . flexicontent_html::getSiteDefaultLang() . ')'); $lists['languages'] = JHTML::_('select.radiolist', $_langs, 'language', $class = '', 'value', 'text', $default_lang); } $default_state = $cparams->get('import_state', 1); $lists['states'] = flexicontent_html::buildstateslist('state', '', $default_state, 2); // Ignore warnings because component may not be installed $warnHandlers = JERROR::getErrorHandling(E_WARNING); JERROR::setErrorHandling(E_WARNING, 'ignore'); if (FLEXI_J30GE) { // J3.0+ adds an warning about component not installed, commented out ... till time ... $fleximport_comp_enabled = false; //JComponentHelper::isEnabled('com_fleximport'); } else { $fleximport_comp = JComponentHelper::getComponent('com_fleximport', true); $fleximport_comp_enabled = $fleximport_comp && $fleximport_comp->enabled; } // Reset the warning handler(s) foreach ($warnHandlers as $mode) { JERROR::setErrorHandling(E_WARNING, $mode); } if ($fleximport_comp_enabled) { $fleximport = JText::sprintf('FLEXI_FLEXIMPORT_INSTALLED', JText::_('FLEXI_FLEXIMPORT_INFOS')); } else { $fleximport = JText::sprintf('FLEXI_FLEXIMPORT_NOT_INSTALLED', JText::_('FLEXI_FLEXIMPORT_INFOS')); } // ******************************************************************************** // Get field names (from the header line (row 0), and remove it form the data array // ******************************************************************************** $file_field_types_list = '"image","file"'; $q = 'SELECT id, name, label, field_type FROM #__flexicontent_fields AS fi' . ' WHERE fi.field_type IN (' . $file_field_types_list . ')'; $db->setQuery($q); $file_fields = $db->loadObjectList('name'); //assign data to template $this->assignRef('lists', $lists); $this->assignRef('cid', $cid); $this->assignRef('user', $user); $this->assignRef('fleximport', $fleximport); $this->assignRef('cparams', $cparams); $this->assignRef('file_fields', $file_fields); parent::display($tpl); }