Actions

API16

Difference between revisions of "JAccess/getActions"

From Joomla! Documentation

< API16:JAccess
(New page: ===Description=== Method to return a list of actions for which permissions can be set given a component and section. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowik...)
 
m (removing red link to edit, no existant pages)
 
Line 3: Line 3:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JAccess/getActions|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JAccess/getActions}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 59: Line 59:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JAccess/getActions|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JAccess/getActions}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 74: Line 74:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API16]]

Latest revision as of 20:56, 12 May 2013

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Method to return a list of actions for which permissions can be set given a component and section.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

static getActions($component, $section= 'component')
Parameter Name Default Value Description
$component The component from which to retrieve the actions.
$section 'component' The name of the section within the component from which to retrieve the actions.

Returns

array List of actions available for the given component and section.

Defined in

libraries/joomla/access/access.php

Importing

jimport( 'joomla.access.access' );

Source Body

public static function getActions($component, $section = 'component')
{
        $actions = array();
 
        if (is_file(JPATH_ADMINISTRATOR.'/components/'.$component.'/access.xml')) {
                $xml = simplexml_load_file(JPATH_ADMINISTRATOR.'/components/'.$component.'/access.xml');
 
                foreach ($xml->children() as $child) {
                        if ($section == (string) $child['name']) {
                                foreach ($child->children() as $action) {
                                        $actions[] = (object) array('name' => (string) $action['name'], 'title' => (string) $action['title'], 'description' => (string) $action['description']);
                                }
 
                                break;
                        }
                }
        }
 
        return $actions;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />