| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 28 | 2 | 5 | 0.989 | class_member |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 28 | 121 | administrator/components/com_categories/controllers/category.php |
| 2 | 28 | 121 | administrator/components/com_menus/controllers/item.php |
| ||||
/**
* Method to cancel an edit
*
* Checks the item in, sets item ID in the session to null, and then redirects to the list page.
*
* @return void
*/
public
function cancel() {
JRequest::checkToken() or jExit(JText::_('JInvalid_Token'));
// Initialize variables.
$app= &JFactory::getApplication();
$model= &$this->getModel('Category');
// Get the previous row id.
$previousId= (int) $app->getUserState('com_categories.edit.category.id');
// If rows ids do not match, checkin previous row.
if ($model->checkin($previousId))
{
// Redirect to the list screen.
$this->setRedirect(JRoute::_('index.php?option=com_categories&view=categories', FALSE));
}
else
{
// Check-in failed
$message= JText::sprintf('JError_Checkin_failed', $model->getError());
$this->setRedirect('index.php?option=com_categories&view=categories', $message, 'error');
}
// Clear the row edit information from the session.
$app->setUserState('com_categories.edit.category.id', NULL);
$app->setUserState('com_categories.edit.category.data', NULL);
$app->setUserState('com_categories.edit.category.type', NULL);
}
|
| ||||
/**
* Method to cancel an edit
*
* Checks the item in, sets item ID in the session to null, and then redirects to the list page.
*
* @return void
*/
public
function cancel() {
JRequest::checkToken() or jExit(JText::_('JInvalid_Token'));
// Initialize variables.
$app= &JFactory::getApplication();
$model= &$this->getModel('Item');
// Get the previous row id.
$previousId= (int) $app->getUserState('com_menus.edit.item.id');
// If rows ids do not match, checkin previous row.
if ($model->checkin($previousId))
{
// Redirect to the list screen.
$this->setRedirect(JRoute::_('index.php?option=com_menus&view=items', FALSE));
}
else
{
// Check-in failed
$message= JText::sprintf('JError_Checkin_failed', $model->getError());
$this->setRedirect('index.php?option=com_menus&view=items', $message, 'error');
}
// Clear the row edit information from the session.
$app->setUserState('com_menus.edit.item.id', NULL);
$app->setUserState('com_menus.edit.item.data', NULL);
$app->setUserState('com_menus.edit.item.type', NULL);
}
|
| |||
/**
* Method to cancel an edit
*
* Checks the item in, sets item ID in the session to null, and then redirects to the list page.
*
* @return void
*/
public
function cancel() {
JRequest::checkToken() or jExit(JText::_('JInvalid_Token'));
// Initialize variables.
$app= &JFactory::getApplication();
$model= &$this->getModel( [[#variable49065760]]);
// Get the previous row id.
$previousId= (int) $app->getUserState( [[#variable490656c0]]);
// If rows ids do not match, checkin previous row.
if ($model->checkin($previousId)) {
// Redirect to the list screen.
$this->setRedirect(JRoute::_( [[#variable49065640]],FALSE));
}
else {
// Check-in failed
$message=JText::sprintf('JError_Checkin_failed',$model->getError());
$this->setRedirect( [[#variable49065640]],$message,'error');
}
// Clear the row edit information from the session.
$app->setUserState( [[#variable490656c0]],NULL);
$app->setUserState( [[#variable490655e0]],NULL);
$app->setUserState( [[#variable49065560]],NULL);
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#49065760]] | 'Item' |
| 1 | 2 | [[#49065760]] | 'Category' |
| 2 | 1 | [[#490656c0]] | 'com_menus.edit.item.id' |
| 2 | 2 | [[#490656c0]] | 'com_categories.edit.category.id' |
| 3 | 1 | [[#49065640]] | 'index.php?option=com_menus&view=items' |
| 3 | 2 | [[#49065640]] | 'index.php?option=com_categories&view=categories' |
| 4 | 1 | [[#490655e0]] | 'com_menus.edit.item.data' |
| 4 | 2 | [[#490655e0]] | 'com_categories.edit.category.data' |
| 5 | 1 | [[#49065560]] | 'com_menus.edit.item.type' |
| 5 | 2 | [[#49065560]] | 'com_categories.edit.category.type' |