CloneSet42


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
79240.994root
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1791
libraries/joomla/form/fields/modulelayouts.php
2761
libraries/joomla/html/parameter/element/modulelayouts.php
Clone Instance
1
Line Count
79
Source Line
1
Source File
libraries/joomla/form/fields/modulelayouts.php

<?php
/**
 * @version             $Id: modulelayouts.php 12287 2009-06-22 05:04:14Z eddieajau $
 * @copyright   Copyright (C) 2005 - 2009 Open Source Matters, Inc. All rights reserved.
 * @copyright   Copyright (C) 2008 - 2009 JXtended, LLC. All rights reserved.
 * @license             GNU General Public License version 2 or later; see LICENSE.txt
 */

defined( "JPATH_BASE") or exit;

require_once dirname( __FILE__)
             .                 DS
             .                    'list.php';

/**
 * Form Field to display a list of the layouts for a module view from the module or default template overrides.
 *
 * @package             Joomla.Framework
 * @subpackage  Form
 * @since               1.6
 */
class JFormFieldModuleLayouts extends JFormFieldList {

        /**
         * @var         string
         */
        protected $_name=  'ModuleLayouts';

        /**
         * Method to get a list of options for a list input.
         *
         * @return      array           An array of JHtml options.
         */
        protected

                  function _getOptions() {

                global $mainframe;

                $options=         array();
                $path1=           NULL;
                $path2=           NULL;

                // Load template entries for each menuid
                $db=                     & JFactory::getDBO();
                $query=           'SELECT template'
                                  . ' FROM #__templates_menu'
                                  . ' WHERE client_id = 0 AND menuid = 0';
                $db->setQuery($query);
                $template=        $db->loadResult();

                if ($module=  $this->_element->attributes('module'))
                {
                        $module=  preg_replace('#\\W#','', $module);
                        $path1=   JPATH_SITE
                                  .          DS
                                  .             'modules'
                                  .                       DS
                                  .                          $module
                                  .                                  DS
                                  .                                     'tmpl';
                        $path2=   JPATH_SITE
                                  .          DS
                                  .             'templates'
                                  .                         DS
                                  .                            $template
                                  .                                      DS
                                  .                                         'html'
                                  .                                                DS
                                  .                                                   $module;
                        $options[]=       JHTML::_('select.option', '', '');
                      }
                if ($path1
                    &&        $path2) {
                        jimport('joomla.filesystem.file');
                        $path1=  JPath::clean($path1);
                        $path2=  JPath::clean($path2);

                        $files=   JFolder::files($path1, '^[^_]*\\.php$');
                        foreach ($files as $file) {
                                $options[]=       JHTML::_('select.option', JFile::stripExt($file));
                              }

                        if (is_dir($path2)
                            &&                $files=  JFolder::files($path2, '^[^_]*\\.php$')) {
                                $options[]=       JHTML::_('select.optgroup', JText::_('JOption_From_Default'));
                                foreach ($files as $file) {
                                        $options[]=       JHTML::_('select.option', JFile::stripExt($file));
                                      }
                              }
                      }
                // Merge any additional options in the XML definition.
                $options=  array_merge(parent::_getOptions(), $options);
                return $options;
              }
      }
?>


Clone Instance
2
Line Count
76
Source Line
1
Source File
libraries/joomla/html/parameter/element/modulelayouts.php

<?php
/**
 * @version             $Id: assetgroups.php 12193 2009-06-20 00:43:52Z eddieajau $
 * @copyright   Copyright (C) 2005 - 2009 Open Source Matters, Inc. All rights reserved.
 * @license             GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access
defined( "JPATH_BASE") or exit;

require_once dirname( __FILE__)
             .                 DS
             .                    'list.php';

/**
 * Parameter to display a list of the layouts for a module from the module or default template overrides.
 *
 * @package             Joomla.Framework
 * @subpackage  Parameter
 */
class JElementModuleLayouts extends JElementList {

        /**
         * @var         string
         */
        protected $_name=  'ModuleLayouts';

        /**
         * Get the options for the list.
         */
        protected

                  function _getOptions( &$node) {

                global $mainframe;

                $options=         array();
                $path1=           NULL;
                $path2=           NULL;

                // Load template entries for each menuid
                $db=                     & JFactory::getDBO();
                $query=           'SELECT template'
                                  . ' FROM #__templates_menu'
                                  . ' WHERE client_id = 0 AND menuid = 0';
                $db->setQuery($query);
                $template=        $db->loadResult();

                if ($module=  $node->attributes('module'))
                {
                        $module=  preg_replace('#\\W#','', $module);
                        $path1=   JPATH_SITE
                                  .          DS
                                  .             'modules'
                                  .                       DS
                                  .                          $module
                                  .                                  DS
                                  .                                     'tmpl';
                        $path2=   JPATH_SITE
                                  .          DS
                                  .             'templates'
                                  .                         DS
                                  .                            $template
                                  .                                      DS
                                  .                                         'html'
                                  .                                                DS
                                  .                                                   $module;
                        $options[]=       JHTML::_('select.option', '', '');
                      }
                if ($path1
                    &&        $path2) {
                        jimport('joomla.filesystem.file');
                        $path1=  JPath::clean($path1);
                        $path2=  JPath::clean($path2);

                        $files=   JFolder::files($path1, '^[^_]*\\.php$');
                        foreach ($files as $file) {
                                $options[]=       JHTML::_('select.option', JFile::stripExt($file));
                              }

                        if (is_dir($path2)
                            &&                $files=  JFolder::files($path2, '^[^_]*\\.php$')) {
                                $options[]=       JHTML::_('select.optgroup', JText::_('JOption_From_Default'));
                                foreach ($files as $file) {
                                        $options[]=       JHTML::_('select.option', JFile::stripExt($file));
                                      }
                              }
                      }
                // Merge any additional options in the XML definition.
                $options=  array_merge(parent::_getOptions(), $options);
                return $options;
              }
      }
?>


Clone AbstractionParameter Count: 4Parameter Bindings

<?php
/**
 * @version             $Id: modulelayouts.php 12287 2009-06-22 05:04:14Z eddieajau $
 * @copyright   Copyright (C) 2005 - 2009 Open Source Matters, Inc. All rights reserved.
 * @copyright   Copyright (C) 2008 - 2009 JXtended, LLC. All rights reserved.
 * @license             GNU General Public License version 2 or later; see LICENSE.txt
 */
/**
 * @version             $Id: assetgroups.php 12193 2009-06-20 00:43:52Z eddieajau $
 * @copyright   Copyright (C) 2005 - 2009 Open Source Matters, Inc. All rights reserved.
 * @license             GNU General Public License version 2 or later; see LICENSE.txt
 */
// No direct access
defined( "JPATH_BASE") or exit;
require_once dirname( __FILE__)
             . DS
             . 'list.php';

/**
 * Form Field to display a list of the layouts for a module view from the module or default template overrides.
 *
 * @package             Joomla.Framework
 * @subpackage  Form
 * @since               1.6
 */
/**
 * Parameter to display a list of the layouts for a module from the module or default template overrides.
 *
 * @package             Joomla.Framework
 * @subpackage  Parameter
 */
class [[#variable512539e0]]extends [[#variable51253960]]{
  /**
           * @var         string
           */
  protected $_name='ModuleLayouts';
  /**
           * Method to get a list of options for a list input.
           *
           * @return      array           An array of JHtml options.
           */
  /**
           * Get the options for the list.
           */
  protected

           function _getOptions( [[#variable512538e0]]) {
             global $mainframe;
             $options=array();
             $path1=NULL;
             $path2=NULL;
             // Load template entries for each menuid
             $db= &JFactory::getDBO();
             $query='SELECT template'
                    . ' FROM #__templates_menu'
                    . ' WHERE client_id = 0 AND menuid = 0';
             $db->setQuery($query);
             $template=$db->loadResult();
             if ($module= [[#variable51253880]]->attributes('module')) {
               $module=preg_replace('#\\W#','',$module);
               $path1=JPATH_SITE
                      . DS
                      . 'modules'
                      . DS
                      . $module
                      . DS
                      . 'tmpl';
               $path2=JPATH_SITE
                      . DS
                      . 'templates'
                      . DS
                      . $template
                      . DS
                      . 'html'
                      . DS
                      . $module;
               $options[]=JHTML::_('select.option','','');
             }
             if ($path1
                 && $path2) {
               jimport('joomla.filesystem.file');
               $path1=JPath::clean($path1);
               $path2=JPath::clean($path2);
               $files=JFolder::files($path1,'^[^_]*\\.php$');
               foreach ($files as $file) {
                 $options[]=JHTML::_('select.option',JFile::stripExt($file));
               }
               if (is_dir($path2)
                   && $files=JFolder::files($path2,'^[^_]*\\.php$')) {
                 $options[]=JHTML::_('select.optgroup',JText::_('JOption_From_Default'));
                 foreach ($files as $file) {
                   $options[]=JHTML::_('select.option',JFile::stripExt($file));
                 }
               }
             }
             // Merge any additional options in the XML definition.
             $options=array_merge(parent::_getOptions(),$options);
             return $options;
           }
}
?>
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#512539e0]]
JFormFieldModuleLayouts 
12[[#512539e0]]
JElementModuleLayouts 
21[[#51253960]]
JFormFieldList 
22[[#51253960]]
JElementList 
31[[#512538e0]]
32[[#512538e0]]
&$node 
41[[#51253880]]
$this->_element 
42[[#51253880]]
$node