english/administrator/components/com_menus/models/item.php
/**
	 * Method to change the published state of one or more records.
	 *
	 * @param	array	$pks	A list of the primary keys to change.
	 * @param	int		$value	The value of the published state.
	 *
	 * @return	boolean	True on success.
	 * @since	1.6
	 */
Method to change the published state of one or more records.
@param       array   $pks    A list of the primary keys to change.
@param       int             $value  The value of the published state.

@return      boolean True on success.
Method to change the published state of one or more records . @param array $pks A list of the primary keys to change . @param int $value The value of the published state . @return boolean True on success .
function publish(&$pks, $value = 1)
	{
		$table		= $this->getTable();
		$pks		= (array) $pks;
		if ($value != 1) {
			foreach ($pks as $i => $pk)
			{
				if ($table->load($pk) && $table->home && $table->language == '*') {
					JError::raiseWarning(403, JText::_('JLIB_DATABASE_ERROR_MENU_UNPUBLISH_DEFAULT_HOME'));
					unset($pks[$i]);
					break;
				}
			}
		}
		$this->cleanCache();
		return parent::publish($pks,$value);
	}
function publish ( & $ pks , $ value = 1 ) { $ table = $ this -> getTable ( ) ; $ pks = ( array ) $ pks ; if ( $ value != 1 ) { foreach ( $ pks as $ i => $ pk ) { if ( $ table -> load ( $ pk ) && $ table -> home && $ table -> language == '*' ) { JError :: raiseWarning ( 403 , JText :: _ ( 'JLIB_DATABASE_ERROR_MENU_UNPUBLISH_DEFAULT_HOME' ) ) ; unset ( $ pks [ $ i ] ) ; break ; } } } $ this -> cleanCache ( ) ; return parent :: publish ( $ pks , $ value ) ; }
Method to change the published state of one or more records.
Method to change the published state of one or more records .
// Initialise variables. // Default menu item existence checks. // Prune items that you can't change. // Clean the cache