CloneSet134


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
30260.968class_member
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
130132
administrator/components/com_templates/models/cssedit.php
231119
administrator/components/com_templates/models/source.php
Clone Instance
1
Line Count
30
Source Line
132
Source File
administrator/components/com_templates/models/cssedit.php

        /**
         * Method to store the Template
         *
         * @access      public
         * @return      boolean True on success
         * @since       1.6
         */
        function store($filecontent) {

                // Set FTP credentials, if given
                jimport('joomla.client.helper');
                JClientHelper::setCredentialsFromRequest('ftp');
                $ftp=  JClientHelper::getCredentials('ftp');

                $file=  $this->_client->path
                        .                    DS
                        .                       'templates'
                        .                                   DS
                        .                                      $this->_template
                        .                                                       DS
                        .                                                          'css'
                        .                                                                DS
                        .                                                                   $this->_filename;
                // Try to make the css file writeable
                if (!$ftp['enabled']
                    &&                  JPath::isOwner($file)
                    &&                                           !JPath::setPermissions($file, '0755')) {
                        $this->setError(JText::_('Could not make the css file writable'));
                        return FALSE;
                      }
                jimport('joomla.filesystem.file');
                $return=  JFile::write($file, $filecontent);
                // Try to make the css file unwriteable
                if (!$ftp['enabled']
                    &&                  JPath::isOwner($file)
                    &&                                           !JPath::setPermissions($file, '0555')) {
                        $this->setError(JText::_('Could not make the css file unwritable'));
                        return FALSE;
                      }
                if (!$return)
                {
                        $this->setError(JText::_('Operation Failed')
                                        .                            ': '
                                        .                                 JText::sprintf('Failed to open file for writing.', $file));
                        return FALSE;
                      }
                return TRUE;
              }


Clone Instance
2
Line Count
31
Source Line
119
Source File
administrator/components/com_templates/models/source.php

        /**
         * Method to store the Template
         *
         * @access      public
         * @return      boolean True on success
         * @since       1.6
         */
        function store($filecontent) {

                // Set FTP credentials, if given
                jimport('joomla.client.helper');
                JClientHelper::setCredentialsFromRequest('ftp');
                $ftp=  JClientHelper::getCredentials('ftp');

                $file=  $this->_client->path
                        .                    DS
                        .                       'templates'
                        .                                   DS
                        .                                      $this->_template
                        .                                                       DS
                        .                                                          'index.php';
                // Try to make the template file writeable
                if (!$ftp['enabled']
                    &&                  JPath::isOwner($file)
                    &&                                           !JPath::setPermissions($file, '0755')) {
                        $this->setError(JText::_('Could not make the template file writable'));
                        return FALSE;
                      }
                jimport('joomla.filesystem.file');
                $return=  JFile::write($file, $filecontent);
                // Try to make the template file unwriteable
                if (!$ftp['enabled']
                    &&                  JPath::isOwner($file)
                    &&                                           !JPath::setPermissions($file, '0555')) {
                        $this->setError(JText::_('Could not make the template file unwritable'));
                        return FALSE;
                      }
                if (!$return)
                {
                        $this->setError(JText::_('Operation Failed')
                                        .                            ': '
                                        .                                 JText::sprintf('Failed to open file for writing.', $file));
                        return FALSE;
                      }
                return TRUE;
              }


Clone AbstractionParameter Count: 6Parameter Bindings

/**
         * Method to store the Template
         *
         * @access      public
         * @return      boolean True on success
         * @since       1.6
         */
function store($filecontent) {
  // Set FTP credentials, if given
  jimport('joomla.client.helper');
  JClientHelper::setCredentialsFromRequest('ftp');
  $ftp=JClientHelper::getCredentials('ftp');
  $file= [[#variable23393fe0]]
        . DS
        .  [[#variable23393f60]]
        . DS
        .  [[#variable23393ec0]]
        . DS
        .  [[#variable23393e20]];
  // Try to make the css file writeable
  // Try to make the template file writeable
  if (!$ftp['enabled']
      && JPath::isOwner($file)
      && !JPath::setPermissions($file,'0755')) {
    $this->setError(JText::_( [[#variable23393d60]]));
    return FALSE;
  }
  jimport('joomla.filesystem.file');
  $return=JFile::write($file,$filecontent);
  // Try to make the css file unwriteable
  // Try to make the template file unwriteable
  if (!$ftp['enabled']
      && JPath::isOwner($file)
      && !JPath::setPermissions($file,'0555')) {
    $this->setError(JText::_( [[#variable23393ce0]]));
    return FALSE;
  }
  if (!$return) {
    $this->setError(JText::_('Operation Failed')
                    . ': '
                    . JText::sprintf('Failed to open file for writing.',$file));
    return FALSE;
  }
  return TRUE;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#23393fe0]]
$this->_client->path
. DS
. 'templates' 
12[[#23393fe0]]
$this->_client->path 
21[[#23393f60]]
$this->_template 
22[[#23393f60]]
'templates' 
31[[#23393ec0]]
'css' 
32[[#23393ec0]]
$this->_template 
41[[#23393e20]]
$this->_filename 
42[[#23393e20]]
'index.php' 
51[[#23393d60]]
'Could not make the css file writable' 
52[[#23393d60]]
'Could not make the template file writable' 
61[[#23393ce0]]
'Could not make the css file unwritable' 
62[[#23393ce0]]
'Could not make the template file unwritable'