Пример #1
0
 function import()
 {
     FCP_Admin::addSubMenu('log');
     $import_model = $this->getModel('import');
     $free_log_info = $import_model->free_log_info();
     $count_imported_rows = $import_model->count_imported_rows();
     $view = $this->getView('log_import', 'html');
     $view->free_log_info = $free_log_info;
     $view->count_imported_rows = $count_imported_rows;
     $view->display();
 }
Пример #2
0
 function apply()
 {
     $app = JFactory::getApplication();
     $config_id = $app->getUserState(LAFC_COMPONENT . "_current_config", 0);
     $config_model = $this->getModel('config');
     $config_model->getOneById($config_id);
     $config_count = $config_model->countConfig();
     $config_model->getPostData('config_field');
     // get the field data from the post data
     if ($config_model->store('config_field')) {
         $jinput = JFactory::getApplication()->input;
         $task = $jinput->get('task', '', 'STRING');
         // 'save_field' or 'apply_field'
         // Check White List if field = file attachment!
         if (empty($config_model->_data->config_data->white_list) and $config_model->_data->config_data->all_fields[$config_model->_data->field_index]->field_type == LAFC_FIELD_ATTACHMENT) {
             $app->enqueueMessage(JText::_('COM_FLEXICONTACT_NO_WHITE_LIST'), 'notice');
         }
         if ($task == 'apply') {
             $this->setRedirect(LAFC_COMPONENT_LINK . "&controller=field&task=edit&cid[]=" . $config_model->_data->field_index);
         } else {
             $this->setRedirect(LAFC_COMPONENT_LINK . "&controller=field&task=display");
         }
     } else {
         FCP_Admin::addSubMenu('config');
         $view = $this->getView('config_field', 'html');
         $view->config_data = $config_model->_data;
         $view->config_count = $config_count;
         $view->new_flag = $config_model->_data->new_flag;
         $view->field = $config_model->_data->config_data->all_fields[$config_model->_data->field_index];
         $view->field_index = $config_model->_data->field_index;
         $view->display();
     }
 }
 function apply()
 {
     $jinput = JFactory::getApplication()->input;
     $config_id = $jinput->get('config_id', 0, 'INT');
     // for a new config, this is the chosen "base config"
     $task = $jinput->get('task', '', 'STRING');
     // 'save' or 'apply'
     $config_model = $this->getModel('config');
     $config_model->getOneById($config_id);
     // Get the current (or new) config
     $config_model->getPostData('config_edit');
     $config_count = $config_model->countConfig();
     if ($config_model->_data->new_flag) {
         $config_model->_data->id = 0;
     }
     // Force a new record to be created
     $stored = $config_model->store('config_edit');
     // The view specifies validation in the store function
     if ($stored) {
         $stored_config_id = $config_model->_data->id;
         // Get the stored config id
         $app = JFactory::getApplication();
         $app->setUserState(LAFC_COMPONENT . "_current_config", $stored_config_id);
         // make it the new current config
         if ($task == 'apply') {
             $this->setRedirect(LAFC_COMPONENT_LINK . "&controller=multiconfig&task=edit&cid[]=" . $config_model->_data->id, JText::_('COM_FLEXICONTACT_SAVED'));
         } else {
             $this->setRedirect(LAFC_COMPONENT_LINK . "&controller=multiconfig&task=display", JText::_('COM_FLEXICONTACT_SAVED'));
         }
     } else {
         FCP_Admin::addSubMenu('config');
         $view = $this->getView('config_edit', 'html');
         $view->config_data = $config_model->_data;
         $view->config_count = $config_count;
         $view->copy_flag = $config_model->_data->copy_flag;
         $view->new_flag = $config_model->_data->new_flag;
         if ($config_model->_data->new_flag == 1) {
             $config_model->_data->id = $config_id;
             // restore the user's "base config" selection
             $config_names = $config_model->getListNames();
             $view->config_names = $config_names;
             $view->new_flag = $config_model->_data->new_flag;
         }
         $view->display();
     }
 }
Пример #4
0
 function help()
 {
     FCP_Admin::addSubMenu('help');
     $app = JFactory::getApplication();
     $config_id = $app->getUserState(LAFC_COMPONENT . "_current_config", 0);
     $config_model = $this->getModel('config');
     $config_names = $config_model->getListNames();
     // Multiple configurations?
     $config_data = $config_model->getOneById($config_id);
     // gets the default config if $config_id = 0
     FCP_Admin::environment_check();
     $view = $this->getView('help', 'html');
     $view->config_id = $config_id;
     $view->config_data = $config_data;
     $view->config_names = $config_names;
     $view->display();
 }