[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_tags/src/Controller/ -> TagController.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_tags
   6   *
   7   * @copyright   (C) 2013 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\Tags\Administrator\Controller;
  12  
  13  use Joomla\CMS\MVC\Controller\FormController;
  14  use Joomla\CMS\Versioning\VersionableControllerTrait;
  15  
  16  // phpcs:disable PSR1.Files.SideEffects
  17  \defined('_JEXEC') or die;
  18  // phpcs:enable PSR1.Files.SideEffects
  19  
  20  /**
  21   * The Tag Controller
  22   *
  23   * @since  3.1
  24   */
  25  class TagController extends FormController
  26  {
  27      use VersionableControllerTrait;
  28  
  29      /**
  30       * Method to check if you can add a new record.
  31       *
  32       * @param   array  $data  An array of input data.
  33       *
  34       * @return  boolean
  35       *
  36       * @since   3.1
  37       */
  38      protected function allowAdd($data = array())
  39      {
  40          return $this->app->getIdentity()->authorise('core.create', 'com_tags');
  41      }
  42  
  43      /**
  44       * Method to check if you can edit a record.
  45       *
  46       * @param   array   $data  An array of input data.
  47       * @param   string  $key   The name of the key for the primary key.
  48       *
  49       * @return  boolean
  50       *
  51       * @since   3.1
  52       */
  53      protected function allowEdit($data = array(), $key = 'id')
  54      {
  55          // Since there is no asset tracking and no categories, revert to the component permissions.
  56          return parent::allowEdit($data, $key);
  57      }
  58  
  59      /**
  60       * Method to run batch operations.
  61       *
  62       * @param   object  $model  The model.
  63       *
  64       * @return  boolean  True if successful, false otherwise and internal error is set.
  65       *
  66       * @since   3.1
  67       */
  68      public function batch($model = null)
  69      {
  70          $this->checkToken();
  71  
  72          // Set the model
  73          $model = $this->getModel('Tag');
  74  
  75          // Preset the redirect
  76          $this->setRedirect('index.php?option=com_tags&view=tags');
  77  
  78          return parent::batch($model);
  79      }
  80  }


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