Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe MenusModelItem
+ Graphe d'héritage de MenusModelItem:

Fonctions membres publiques

 getForm ($data=array(), $loadData=true)
 
 getHelp ()
 
 getItem ($pk=null)
 
 getModules ()
 
 getViewLevels ()
 
 getTable ($type='Menu', $prefix='MenusTable', $config=array())
 
 rebuild ()
 
 save ($data)
 
 saveorder ($idArray=null, $lftArray=null)
 
 setHome (&$pks, $value=1)
 
 publish (&$pks, $value=1)
 

Champs de données

 $typeAlias = 'com_menus.item'
 

Fonctions membres protégées

 canDelete ($record)
 
 canEditState ($record)
 
 batchCopy ($value, $pks, $contexts)
 
 batchMove ($value, $pks, $contexts)
 
 canSave ($data=array(), $key='id')
 
 loadFormData ()
 
 getReorderConditions ($table)
 
 populateState ()
 
 getMenuType ($menutype)
 
 getMenuTypeId ($menutype)
 
 preprocessForm (JForm $form, $data, $group='content')
 
 generateNewTitle ($parentId, $alias, $title)
 
 cleanCache ($group=null, $clientId=0)
 

Attributs protégés

 $associationsContext = 'com_menus.item'
 
 $text_prefix = 'COM_MENUS_ITEM'
 
 $helpKey = 'JHELP_MENUS_MENU_ITEM_MANAGER_EDIT'
 
 $helpURL
 
 $helpLocal = false
 
 $batch_copymove = 'menu_id'
 
 $batch_commands
 

Description détaillée

Menu Item Model for Menus.

Depuis
1.6

Documentation des fonctions membres

◆ batchCopy()

batchCopy (   $value,
  $pks,
  $contexts 
)
protected

Batch copy menu items to a new menu or parent.

Paramètres
integer$valueThe new menu or sub-item.
array$pksAn array of row IDs.
array$contextsAn array of item contexts.
Renvoie
mixed An array of new IDs on success, boolean false on failure.
Depuis
1.6

Références $count, $db, $menuType, $parts, $query, $title, $user, $value, et null.

◆ batchMove()

batchMove (   $value,
  $pks,
  $contexts 
)
protected

Batch move menu items to a new menu or parent.

Paramètres
integer$valueThe new menu or sub-item.
array$pksAn array of row IDs.
array$contextsAn array of item contexts.
Renvoie
boolean True on success.
Depuis
1.6

Références $db, $menuType, $parts, $query, $user, et $value.

◆ canDelete()

canDelete (   $record)
protected

Method to test whether a record can be deleted.

Paramètres
object$recordA record object.
Renvoie
boolean True if allowed to delete the record. Defaults to the permission set in the component.
Depuis
1.6

◆ canEditState()

canEditState (   $record)
protected

Method to test whether the state of a record can be edited.

Paramètres
object$recordA record object.
Renvoie
boolean True if allowed to change the state of the record. Defaults to the permission for the component.
Depuis
3.6

◆ canSave()

canSave (   $data = array(),
  $key = 'id' 
)
protected

Method to check if you can save a record.

Paramètres
array$dataAn array of input data.
string$keyThe name of the key for the primary key.
Renvoie
boolean
Depuis
1.6

Références option.

◆ cleanCache()

cleanCache (   $group = null,
  $clientId = 0 
)
protected

Custom clean the cache

Paramètres
string$groupCache group name.
integer$clientIdApplication client id.
Renvoie
void
Depuis
1.6

◆ generateNewTitle()

generateNewTitle (   $parentId,
  $alias,
  $title 
)
protected

Method to change the title & alias.

Paramètres
integer$parentIdThe id of the parent.
string$aliasThe alias.
string$titleThe title.
Renvoie
array Contains the modified title and alias.
Depuis
1.6

Références $title.

◆ getForm()

getForm (   $data = array(),
  $loadData = true 
)

Method to get the row form.

Paramètres
array$dataData for the form.
boolean$loadDataTrue if the form is to load its own data (default case), false if not.
Renvoie
mixed A JForm object on success, false on failure
Depuis
1.6

Références $action, $clientId, $data, $form, et $item.

◆ getHelp()

getHelp ( )

Get the necessary data to load an item help screen.

Renvoie
object An object with key, url, and local properties for loading the item help screen.
Depuis
1.6

◆ getItem()

getItem (   $pk = null)

Method to get a menu item.

Paramètres
integer$pkAn optional id of the object to get, otherwise the id from the model state is used.
Renvoie
mixed Menu item data object on success, false on failure.
Depuis
1.6

Références $component, $lang, $link, $type, MenusHelper\getAssociations(), MenusHelper\getLinkKey(), JPATH_ADMINISTRATOR, et null.

◆ getMenuType()

getMenuType (   $menutype)
protected

Loads the menutype object by a given menutype string

Paramètres
string$menutypeThe given menutype
Renvoie
stdClass
Depuis
3.7.0

◆ getMenuTypeId()

getMenuTypeId (   $menutype)
protected

Loads the menutype ID by a given menutype string

Paramètres
string$menutypeThe given menutype
Renvoie
integer
Depuis
3.6

Références $menu.

◆ getModules()

getModules ( )

Get the list of modules not in trash.

Renvoie
mixed An array of module records (id, title, position), or false on error.
Depuis
1.6

Join on the module-to-menu mapping table. We are only interested if the module is displayed on ALL or THIS menu item (or the inverse ID number). sqlsrv changes for modulelink to menu manager

Références $db, et $query.

◆ getReorderConditions()

getReorderConditions (   $table)
protected

A protected method to get the where clause for the reorder. This ensures that the row will be moved relative to a row with the same menutype.

Paramètres
JTableMenu$tableinstance.
Renvoie
array An array of conditions to add to add to ordering queries.
Depuis
1.6

◆ getTable()

getTable (   $type = 'Menu',
  $prefix = 'MenusTable',
  $config = array() 
)

Returns a Table object, always creating it

Paramètres
string$typeThe table type to instantiate.
string$prefixA prefix for the table class name. Optional.
array$configConfiguration array for model. Optional.
Renvoie
JTable|JTableNested A database object.
Depuis
1.6

Références $config, $prefix, et $type.

◆ getViewLevels()

getViewLevels ( )

Get the list of all view levels

Renvoie
array|boolean An array of all view levels (id, title).
Depuis
3.4

Références $db, et $query.

◆ loadFormData()

loadFormData ( )
protected

Method to get the data that should be injected in the form.

Renvoie
mixed The data for the form.
Depuis
1.6

Références $data, $filters, et null.

◆ populateState()

populateState ( )
protected

Auto-populate the model state.

Note. Calling getState in this method will result in recursion.

Renvoie
void
Depuis
1.6

Note: a new menu item will have no field type. The field is required so the user has to change it.

Références $app, $clientId, $link, $menuType, $params, $type, et null.

◆ preprocessForm()

preprocessForm ( JForm  $form,
  $data,
  $group = 'content' 
)
protected

Method to preprocess the form.

Paramètres
JForm$formA JForm object.
mixed$dataThe data expected for the form.
string$groupThe name of the plugin group to import.
Renvoie
void
Depuis
1.6
Exceptions
Exceptionif there is an error in the form event.

Références $base, $clientId, $data, $field, $fields, $form, $language, $layout, $link, $option, $path, $type, $view, elseif, JPATH_ADMINISTRATOR, null, et true.

◆ publish()

publish ( $pks,
  $value = 1 
)

Method to change the published state of one or more records.

Paramètres
array$pksA list of the primary keys to change.
integer$valueThe value of the published state.
Renvoie
boolean True on success.
Depuis
1.6

Références $i, $value, et JError\raiseWarning().

◆ rebuild()

rebuild ( )

Method rebuild the entire nested set tree.

Renvoie
boolean|JException Boolean true on success, boolean false or JException instance on error
Depuis
1.6

Références $db, $item, $items, $params, $query, et JError\raiseWarning().

◆ save()

save (   $data)

Method to save the form data.

Paramètres
array$dataThe form data.
Renvoie
boolean True on success.
Depuis
1.6

Références $base, $context, $data, $db, $dispatcher, $id, $key, $menuType, $name, $option, $query, $title, elseif, JEventDispatcher\getInstance(), json_encode, option, JError\raiseNotice(), et ArrayHelper\toInteger().

◆ saveorder()

saveorder (   $idArray = null,
  $lftArray = null 
)

Method to save the reordered nested set tree. First we save the new order values in the lft values of the changed ids. Then we invoke the table rebuild to implement the new ordering.

Paramètres
array$idArrayRows identifiers to be reordered
array$lftArraylft values of rows to be reordered
Renvoie
boolean false on failure or error, true otherwise.
Depuis
1.6

◆ setHome()

setHome ( $pks,
  $value = 1 
)

Method to change the home state of one or more items.

Paramètres
array$pksA list of the primary keys to change.
integer$valueThe value of the home state.
Renvoie
boolean True on success.
Depuis
1.6

Références $i, $value, elseif, JError\raiseNotice(), et JError\raiseWarning().

Documentation des champs

◆ $associationsContext

$associationsContext = 'com_menus.item'
protected

◆ $batch_commands

$batch_commands
protected
Valeur initiale :
= array(
'assetgroup_id' => 'batchAccess',
'language_id' => 'batchLanguage'
)

◆ $batch_copymove

$batch_copymove = 'menu_id'
protected

◆ $helpKey

$helpKey = 'JHELP_MENUS_MENU_ITEM_MANAGER_EDIT'
protected

◆ $helpLocal

$helpLocal = false
protected

◆ $helpURL

$helpURL
protected

◆ $text_prefix

$text_prefix = 'COM_MENUS_ITEM'
protected

◆ $typeAlias

$typeAlias = 'com_menus.item'

La documentation de cette classe a été générée à partir du fichier suivant :