public static function getActionsFromData($data, $xpath = "/access/section[@name='component']/")
	{
		// If the data to load isn't already an XML element or string return false.
		if (!($data instanceof SimpleXMLElement) && !is_string($data))
		{
			return false;
		}

		// Attempt to load the XML if a string.
		if (is_string($data))
		{
			$data = self::getXml($data, false);

			// Make sure the XML loaded correctly.
			if (!$data)
			{
				return false;
			}
		}

		// Initialise the actions array
		$actions = array();

		// Get the elements from the xpath
		$elements = $data->xpath($xpath . 'action[@name][@title][@description]');

		// If there some elements, analyse them
		if (!empty($elements))
		{
			foreach ($elements as $action)
			{
				// Add the action to the actions array
				$actions[] = (object) array(
					'name'        => (string) $action['name'],
					'title'       => (string) $action['title'],
					'description' => (string) $action['description']
				);
			}
		}

		// Finally return the actions array
		return $actions;
	}
public static function getActionsFromData($data, $xpath = "/access/section[@name='component']/")
	{
		// If the data to load isn't already an XML element or string return false.
		if (!($data instanceof SimpleXMLElement) && !is_string($data))
		{
			return false;
		}

		// Attempt to load the XML if a string.
		if (is_string($data))
		{
			$data = self::getXml($data, false);

			// Make sure the XML loaded correctly.
			if (!$data)
			{
				return false;
			}
		}

		// Initialise the actions array
		$actions = array();

		// Get the elements from the xpath
		$elements = $data->xpath($xpath . 'action[@name][@title][@description]');

		// If there some elements, analyse them
		if (!empty($elements))
		{
			foreach ($elements as $action)
			{
				// Add the action to the actions array
				$actions[] = (object) array(
					'name'        => (string) $action['name'],
					'title'       => (string) $action['title'],
					'description' => (string) $action['description']
				);
			}
		}

		// Finally return the actions array
		return $actions;
	}
public static function getActionsFromData ( $ data , $ xpath = "/access/section[@name='component']/" ) { // If the data to load isn't already an XML element or string return false. if ( ! ( $ data instanceof SimpleXMLElement ) && ! is_string ( $ data ) ) { return false ; } // Attempt to load the XML if a string. if ( is_string ( $ data ) ) { $ data = self :: getXml ( $ data , false ) ; // Make sure the XML loaded correctly. if ( ! $ data ) { return false ; } } // Initialise the actions array $ actions = array ( ) ; // Get the elements from the xpath $ elements = $ data -> xpath ( $ xpath . 'action[@name][@title][@description]' ) ; // If there some elements, analyse them if ( ! empty ( $ elements ) ) { foreach ( $ elements as $ action ) { // Add the action to the actions array $ actions [ ] = ( object ) array ( 'name' => ( string ) $ action [ 'name' ] , 'title' => ( string ) $ action [ 'title' ] , 'description' => ( string ) $ action [ 'description' ] ) ; } } // Finally return the actions array return $ actions ; }
Method to return a list of actions from a string or from an xml for which permissions can be set.

@param   string|SimpleXMLElement  $data   The XML string or an XML element.
@param   string                   $xpath  An optional xpath to search for the fields.
@return  boolean|array   False if case of error or the list of actions available.
Method to return a list of actions from a string or from an xml for which permissions can be set .