english/administrator/components/com_menus/models/item.php
/**
	 * Method to change the title & alias.
	 *
	 * @param	int     The value of the menu Parent Id.
	 * @param   sting   The value of the menu Alias.
	 * @param   sting   The value of the menu Title.
	 * @return	array   Contains title and alias.
	 * @since	1.6
	 */
Method to change the title & alias.
@param       int     The value of the menu Parent Id.
@param   sting   The value of the menu Alias.
@param   sting   The value of the menu Title.
@return      array   Contains title and alias.
Method to change the title & alias . @param int The value of the menu Parent Id . @param sting The value of the menu Alias . @param sting The value of the menu Title . @return array Contains title and alias .
function generateNewTitle(&$parent_id, &$alias, &$title)
	{
		$MenuTable = JTable::getInstance('Menu','JTable');
		while($MenuTable->load(array('alias'=>$alias,'parent_id'=>$parent_id))){
			$m = null;
			if (preg_match('#-(\d+)$#', $alias, $m)) {
				$alias = preg_replace('#-(\d+)$#', '-'.($m[1] + 1).'', $alias);
			} else {
				$alias .= '-2';
			}
			if (preg_match('#\((\d+)\)$#', $title, $m)) {
				$title = preg_replace('#\(\d+\)$#', '('.($m[1] + 1).')', $title);
			} else {
				$title .= ' (2)';
			}
		}
		return array($title ,$alias);
	}
function generateNewTitle ( & $ parent_id , & $ alias , & $ title ) { $ MenuTable = JTable :: getInstance ( 'Menu' , 'JTable' ) ; while ( $ MenuTable -> load ( array ( 'alias' => $ alias , 'parent_id' => $ parent_id ) ) ) { $ m = null ; if ( preg_match ( '#-(\d+)$#' , $ alias , $ m ) ) { $ alias = preg_replace ( '#-(\d+)$#' , '-' . ( $ m [ 1 ] + 1 ) . '' , $ alias ) ; } else { $ alias .= '-2' ; } if ( preg_match ( '#\((\d+)\)$#' , $ title , $ m ) ) { $ title = preg_replace ( '#\(\d+\)$#' , '(' . ( $ m [ 1 ] + 1 ) . ')' , $ title ) ; } else { $ title .= ' (2)' ; } } return array ( $ title , $ alias ) ; }
Method to change the title & alias.
Method to change the title & alias .
// Alter the title & alias