示例#1
0
 /**
  * Method to save the configuration
  **/
 public function save()
 {
     // Test if this is really a post request
     $method = JInput::getMethod();
     if ($method == 'GET') {
         JError::raiseError(500, JText::_('COM_COMMUNITY_ACCESS_NOT_ALLOWED'));
         return;
     }
     $mainframe = JFactory::getApplication();
     $model =& $this->getModel('Network');
     // Try to save network configurations
     if ($model->save()) {
         $message = JText::_('COM_COMMUNITY_NETWORK_CONFIGURATION_UPDATED');
         $mainframe->redirect('index.php?option=com_community&view=network', $message, 'message');
     } else {
         JError::raiseWarning(100, JText::_('COM_COMMUNITY_CONFIGURATION_NETWORK_SAVE_FAIL'));
     }
 }