API15

JHTMLGrid/state: Difference between revisions

From Joomla! Documentation

m removing red link to edit, no existant pages
m preparing for archive only
 
Line 68: Line 68:


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=state
  category=state
  category=JHTMLGrid
  category=JHTMLGrid
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 00:52, 25 March 2017

[<! removed edit link to red link >]

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

Syntax

state($filter_state='*', $published='Published', $unpublished='Unpublished', $archived=NULL, $trashed=NULL)
Parameter Name Default Value Description
$filter_state '*'
$published 'Published'
$unpublished 'Unpublished'
$archived NULL
$trashed NULL

Defined in

libraries/joomla/html/html/grid.php

Importing

jimport( 'joomla.html.html.grid' );

Source Body

function state( $filter_state='*', $published='Published', $unpublished='Unpublished', $archived=NULL, $trashed=NULL )
{
        $state[] = JHTML::_('select.option',  '', '- '. JText::_( 'Select State' ) .' -' );
        //Jinx : Why is this used ?
        //$state[] = JHTML::_('select.option',  '*', JText::_( 'Any' ) );
        $state[] = JHTML::_('select.option',  'P', JText::_( $published ) );
        $state[] = JHTML::_('select.option',  'U', JText::_( $unpublished ) );

        if ($archived) {
                $state[] = JHTML::_('select.option',  'A', JText::_( $archived ) );
        }

        if ($trashed) {
                $state[] = JHTML::_('select.option',  'T', JText::_( $trashed ) );
        }

        return JHTML::_('select.genericlist',   $state, 'filter_state', 'class="inputbox" size="1" onchange="submitform( );"', 'value', 'text', $filter_state );
}

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

Examples

Code Examples