english/administrator/components/com_weblinks/models/weblink.php
/**
	 * Prepare and sanitise the table prior to saving.
	 *
	 * @since	1.6
	 */
Prepare and sanitise the table prior to saving.
Prepare and sanitise the table prior to saving .
protected function prepareTable(&$table)
	{
		jimport('joomla.filter.output');
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		$table->title		= htmlspecialchars_decode($table->title, ENT_QUOTES);
		$table->alias		= JApplication::stringURLSafe($table->alias);
		if (empty($table->alias)) {
			$table->alias = JApplication::stringURLSafe($table->title);
		}
		if (empty($table->id)) {
			if (empty($table->ordering)) {
				$db = JFactory::getDbo();
				$db->setQuery('SELECT MAX(ordering) FROM #__weblinks');
				$max = $db->loadResult();
				$table->ordering = $max+1;
			}
		}
		else {
		}
	}
protected function prepareTable ( & $ table ) { jimport ( 'joomla.filter.output' ) ; $ date = JFactory :: getDate ( ) ; $ user = JFactory :: getUser ( ) ; $ table -> title = htmlspecialchars_decode ( $ table -> title , ENT_QUOTES ) ; $ table -> alias = JApplication :: stringURLSafe ( $ table -> alias ) ; if ( empty ( $ table -> alias ) ) { $ table -> alias = JApplication :: stringURLSafe ( $ table -> title ) ; } if ( empty ( $ table -> id ) ) { if ( empty ( $ table -> ordering ) ) { $ db = JFactory :: getDbo ( ) ; $ db -> setQuery ( 'SELECT MAX(ordering) FROM #__weblinks' ) ; $ max = $ db -> loadResult ( ) ; $ table -> ordering = $ max + 1 ; } } else { } }
Prepare and sanitise the table prior to saving.
Prepare and sanitise the table prior to saving .
// Set the values // Set ordering to the last item if not set // Set the values