[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_messages/src/Controller/ -> MessageController.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_messages
   6   *
   7   * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  namespace Joomla\Component\Messages\Administrator\Controller;
  12  
  13  use Joomla\CMS\Language\Text;
  14  use Joomla\CMS\MVC\Controller\FormController;
  15  
  16  // phpcs:disable PSR1.Files.SideEffects
  17  \defined('_JEXEC') or die;
  18  // phpcs:enable PSR1.Files.SideEffects
  19  
  20  /**
  21   * Messages Component Message Model
  22   *
  23   * @since  1.6
  24   */
  25  class MessageController extends FormController
  26  {
  27      /**
  28       * Method (override) to check if you can save a new or existing record.
  29       *
  30       * Adjusts for the primary key name and hands off to the parent class.
  31       *
  32       * @param   array   $data  An array of input data.
  33       * @param   string  $key   The name of the key for the primary key.
  34       *
  35       * @return  boolean
  36       *
  37       * @since   1.6
  38       */
  39      protected function allowSave($data, $key = 'message_id')
  40      {
  41          return parent::allowSave($data, $key);
  42      }
  43  
  44      /**
  45       * Reply to an existing message.
  46       *
  47       * This is a simple redirect to the compose form.
  48       *
  49       * @return  void
  50       *
  51       * @since   1.6
  52       */
  53      public function reply()
  54      {
  55          if ($replyId = $this->input->getInt('reply_id')) {
  56              $this->setRedirect('index.php?option=com_messages&view=message&layout=edit&reply_id=' . $replyId);
  57          } else {
  58              $this->setMessage(Text::_('COM_MESSAGES_INVALID_REPLY_ID'));
  59              $this->setRedirect('index.php?option=com_messages&view=messages');
  60          }
  61      }
  62  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer