CloneSet197


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
28250.989class_member
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
128121
administrator/components/com_categories/controllers/category.php
228121
administrator/components/com_menus/controllers/item.php
Clone Instance
1
Line Count
28
Source Line
121
Source File
administrator/components/com_categories/controllers/category.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);
              }


Clone Instance
2
Line Count
28
Source Line
121
Source File
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('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);
              }


Clone AbstractionParameter Count: 5Parameter Bindings

/**
         * 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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#49065760]]
'Item' 
12[[#49065760]]
'Category' 
21[[#490656c0]]
'com_menus.edit.item.id' 
22[[#490656c0]]
'com_categories.edit.category.id' 
31[[#49065640]]
'index.php?option=com_menus&view=items' 
32[[#49065640]]
'index.php?option=com_categories&view=categories' 
41[[#490655e0]]
'com_menus.edit.item.data' 
42[[#490655e0]]
'com_categories.edit.category.data' 
51[[#49065560]]
'com_menus.edit.item.type' 
52[[#49065560]]
'com_categories.edit.category.type'