Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
https://joomla.stackexchange.com/q/26382/12352
Created
7 years ago
Diff never expires
Clear
Export
Share
Explain
10 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
41 lines
Copy
6 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
39 lines
Copy
class BookstoreRouter extends JComponentRouterView
class BookstoreRouter extends JComponentRouterView
{
{
public function __construct($app = null, $menu = null)
public function __construct($app = null, $menu = null)
{
{
$books = new JComponentRouterViewconfiguration('books');
$books = new JComponentRouterViewconfiguration('books');
Copy
Copied
Copy
Copied
$books->setNestable();
$this->registerView($books);
$this->registerView($books);
$book = new JComponentRouterViewconfiguration('book');
$book = new JComponentRouterViewconfiguration('book');
$book->setKey('id')->setParent($books);
$book->setKey('id')->setParent($books);
$this->registerView($book);
$this->registerView($book);
parent::__construct($app, $menu);
parent::__construct($app, $menu);
$this->attachRule(new JComponentRouterRulesMenu($this));
$this->attachRule(new JComponentRouterRulesMenu($this));
$this->attachRule(new JComponentRouterRulesStandard($this));
$this->attachRule(new JComponentRouterRulesStandard($this));
$this->attachRule(new JComponentRouterRulesNomenu($this));
$this->attachRule(new JComponentRouterRulesNomenu($this));
}
}
public function getBookSegment($id, $query)
public function getBookSegment($id, $query)
{
{
Copy
Copied
Copy
Copied
if (
!
strpos($
id
, ':')
)
if (
strpos($
query['id']
, ':')
=== false)
{
{
$db = JFactory::getDbo();
$db = JFactory::getDbo();
$dbquery = $db->getQuery(true);
$dbquery = $db->getQuery(true);
Copy
Copied
Copy
Copied
$dbquery->select($
dbquery->qn
('alias'))
$dbquery->select($
db->quoteName
('alias'))
->from($
dbquery->qn
('#__bookstore_books'))
->from($
db->quoteName
('#__bookstore_books'))
->where('id = ' . $
dbquery->q
($id));
->where('id = ' . $
db->quote
($id));
$db->setQuery($dbquery);
$db->setQuery($dbquery);
$id .= ':' . $db->loadResult();
$id .= ':' . $db->loadResult();
}
}
Copy
Copied
Copy
Copied
return array((int)
$id => $id);
return array((int)
$id => $id);
}
}
public function getBookId($segment, $query)
public function getBookId($segment, $query)
{
{
Copy
Copied
Copy
Copied
return (int)
$segment;
return (int)
$segment;
}
}
}
}
Saved diffs
Original text
Open file
class BookstoreRouter extends JComponentRouterView { public function __construct($app = null, $menu = null) { $books = new JComponentRouterViewconfiguration('books'); $books->setNestable(); $this->registerView($books); $book = new JComponentRouterViewconfiguration('book'); $book->setKey('id')->setParent($books); $this->registerView($book); parent::__construct($app, $menu); $this->attachRule(new JComponentRouterRulesMenu($this)); $this->attachRule(new JComponentRouterRulesStandard($this)); $this->attachRule(new JComponentRouterRulesNomenu($this)); } public function getBookSegment($id, $query) { if (!strpos($id, ':')) { $db = JFactory::getDbo(); $dbquery = $db->getQuery(true); $dbquery->select($dbquery->qn('alias')) ->from($dbquery->qn('#__bookstore_books')) ->where('id = ' . $dbquery->q($id)); $db->setQuery($dbquery); $id .= ':' . $db->loadResult(); } return array((int) $id => $id); } public function getBookId($segment, $query) { return (int) $segment; } }
Changed text
Open file
class BookstoreRouter extends JComponentRouterView { public function __construct($app = null, $menu = null) { $books = new JComponentRouterViewconfiguration('books'); $this->registerView($books); $book = new JComponentRouterViewconfiguration('book'); $book->setKey('id')->setParent($books); $this->registerView($book); parent::__construct($app, $menu); $this->attachRule(new JComponentRouterRulesMenu($this)); $this->attachRule(new JComponentRouterRulesStandard($this)); $this->attachRule(new JComponentRouterRulesNomenu($this)); } public function getBookSegment($id, $query) { if (strpos($query['id'], ':') === false) { $db = JFactory::getDbo(); $dbquery = $db->getQuery(true); $dbquery->select($db->quoteName('alias')) ->from($db->quoteName('#__bookstore_books')) ->where('id = ' . $db->quote($id)); $db->setQuery($dbquery); $id .= ':' . $db->loadResult(); } return array((int)$id => $id); } public function getBookId($segment, $query) { return (int)$segment; } }
Find difference