Code Duplication    Length = 17-21 lines in 2 locations

lib/midcom/helper/datamanager2/widget/downloads.php 1 location

@@ 120-140 (lines=21) @@
117
        }
118
119
        // Create sortable
120
        if ($this->_type->sortable)
121
        {
122
            // Enable jQuery
123
            midcom::get()->head->enable_jquery();
124
125
            // Add the JavaScript file to aid in sorting, if requested for
126
            midcom::get()->head->add_jsfile(MIDCOM_STATIC_URL . '/midcom.helper.datamanager2/datamanager2.tablesorter.js');
127
128
            // Configuration options
129
            midcom::get()->head->add_jscript("
130
                jQuery(document).ready(function()
131
                {
132
                    jQuery('#{$this->_namespace}{$this->name}')
133
                        .create_tablesorter({
134
                            max_count: 0,
135
                            sortable_rows: true,
136
                            allow_delete: false
137
                        });
138
                });
139
            ");
140
        }
141
        // controls if required apc-settings for the progressbar are set
142
        if (   ini_get("apc.rfc1867") == 1
143
            && ini_get("apc.enabled") == 1)

lib/midcom/helper/datamanager2/widget/images.php 1 location

@@ 111-127 (lines=17) @@
108
        }
109
110
        // Create sortable
111
        if ($this->_type->sortable)
112
        {
113
            midcom::get()->head->enable_jquery();
114
            midcom::get()->head->add_jsfile(MIDCOM_STATIC_URL . '/midcom.helper.datamanager2/datamanager2.tablesorter.js');
115
            // Configuration options
116
            midcom::get()->head->add_jscript("
117
                jQuery(document).ready(function()
118
                {
119
                    jQuery('#{$this->_namespace}{$this->name}')
120
                        .create_tablesorter({
121
                            max_count: 0,
122
                            sortable_rows: true,
123
                            allow_delete: false
124
                        });
125
                });
126
            ");
127
        }
128
129
        midcom::get()->head->add_jscript($this->_get_filename_validation_script());
130
    }