plugins/finder/categories/categories.php
public function onFinderChangeState($context, $pks, $value)
	{
		// We only want to handle categories here.
		if ($context == 'com_categories.category')
		{
			/*
			 * The category published state is tied to the parent category
			 * published state so we need to look up all published states
			 * before we change anything.
			 */
			foreach ($pks as $pk)
			{
				$query = clone $this->getStateQuery();
				$query->where('a.id = ' . (int) $pk);

				$this->db->setQuery($query);
				$item = $this->db->loadObject();

				// Translate the state.
				$state = null;

				if ($item->parent_id != 1)
				{
					$state = $item->cat_state;
				}

				$temp = $this->translateState($value, $state);

				// Update the item.
				$this->change($pk, 'state', $temp);

				// Reindex the item.
				$this->reindex($pk);
			}
		}

		// Handle when the plugin is disabled.
		if ($context == 'com_plugins.plugin' && $value === 0)
		{
			$this->pluginDisable($pks);
		}
	}
public function onFinderChangeState($context, $pks, $value)
	{
		// We only want to handle categories here.
		if ($context == 'com_categories.category')
		{
			/*
			 * The category published state is tied to the parent category
			 * published state so we need to look up all published states
			 * before we change anything.
			 */
			foreach ($pks as $pk)
			{
				$query = clone $this->getStateQuery();
				$query->where('a.id = ' . (int) $pk);

				$this->db->setQuery($query);
				$item = $this->db->loadObject();

				// Translate the state.
				$state = null;

				if ($item->parent_id != 1)
				{
					$state = $item->cat_state;
				}

				$temp = $this->translateState($value, $state);

				// Update the item.
				$this->change($pk, 'state', $temp);

				// Reindex the item.
				$this->reindex($pk);
			}
		}

		// Handle when the plugin is disabled.
		if ($context == 'com_plugins.plugin' && $value === 0)
		{
			$this->pluginDisable($pks);
		}
	}
public function onFinderChangeState ( $ context , $ pks , $ value ) { // We only want to handle categories here. if ( $ context == 'com_categories.category' ) { /*
			 * The category published state is tied to the parent category
			 * published state so we need to look up all published states
			 * before we change anything.
			 */ foreach ( $ pks as $ pk ) { $ query = clone $ this -> getStateQuery ( ) ; $ query -> where ( 'a.id = ' . ( int ) $ pk ) ; $ this -> db -> setQuery ( $ query ) ; $ item = $ this -> db -> loadObject ( ) ; // Translate the state. $ state = null ; if ( $ item -> parent_id != 1 ) { $ state = $ item -> cat_state ; } $ temp = $ this -> translateState ( $ value , $ state ) ; // Update the item. $ this -> change ( $ pk , 'state' , $ temp ) ; // Reindex the item. $ this -> reindex ( $ pk ) ; } } // Handle when the plugin is disabled. if ( $ context == 'com_plugins.plugin' && $ value === 0 ) { $ this -> pluginDisable ( $ pks ) ; } }
Method to update the link information for items that have been changed
from outside the edit screen. This is fired when the item is published,
unpublished, archived, or unarchived from the list view.

@param   string   $context  The context for the category passed to the plugin.
@param   array    $pks      An array of primary key ids of the category that has changed state.
@param   integer  $value    The value of the state that the category has been changed to.

@return  void

@since   2.5
Method to update the link information for items that have been changed from outside the edit screen . This is fired when the item is published unpublished archived or unarchived from the list view .