Code Duplication    Length = 12-12 lines in 3 locations

class/files/classes/ClassFormElements.php 1 location

@@ 784-795 (lines=12) @@
781
                        $fieldNameDesc = substr($fieldElementName, strrpos($fieldElementName, ':'), strlen($fieldElementName));
782
                        $topicTableName = str_replace(': ', '', $fieldNameDesc);
783
                        $fieldsTopics = $this->getTableFields($fieldElementMid, $fieldElementTid);
784
                        foreach (array_keys($fieldsTopics) as $f) {
785
                            $fieldNameTopic = $fieldsTopics[$f]->getVar('field_name');
786
                            if ((0 == $f) && (1 == $table->getVar('table_autoincrement'))) {
787
                                $fieldIdTopic = $fieldNameTopic;
788
                            }
789
                            if (1 == $fieldsTopics[$f]->getVar('field_parent')) {
790
                                $fieldPidTopic = $fieldNameTopic;
791
                            }
792
                            if (1 == $fieldsTopics[$f]->getVar('field_main')) {
793
                                $fieldMainTopic = $fieldNameTopic;
794
                            }
795
                        }
796
                        $ret .= $this->getXoopsFormTopic($language, $moduleDirname, $topicTableName, $fieldIdTopic, $fieldPidTopic, $fieldMainTopic, $required);
797
                    } else {
798
                        $ret .= $this->getXoopsFormTable($language, $moduleDirname, $tableName, $fieldName, $fieldElement, $required);

class/files/include/IncludeNotifications.php 1 location

@@ 97-108 (lines=12) @@
94
        $tableSolename = $table->getVar('table_solename');
95
        $fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'));
96
        $fieldParent = 'cid';
97
        foreach (array_keys($fields) as $f) {
98
            $fieldName = $fields[$f]->getVar('field_name');
99
            if ((0 == $f) && (1 == $table->getVar('table_autoincrement'))) {
100
                $fieldId = $fieldName;
101
            }
102
            if (1 == $fields[$f]->getVar('field_parent')) {
103
                $fieldParent = $fieldName;
104
            }
105
            if (1 == $fields[$f]->getVar('field_main')) {
106
                $fieldMain = $fieldName;
107
            }
108
        }
109
        if (1 == $table->getVar('table_single')) {
110
            $tableSingle = 'single';
111
        } else {

class/files/include/IncludeSearch.php 1 location

@@ 127-138 (lines=12) @@
124
        $fieldId = '';
125
        $fieldSearch = null;
126
        $fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'));
127
        foreach (array_keys($fields) as $f) {
128
            $fieldName = $fields[$f]->getVar('field_name');
129
            if ((0 == $f) && (1 == $table->getVar('table_autoincrement'))) {
130
                $fieldId = $fieldName;
131
            }
132
            if (1 == $fields[$f]->getVar('field_main')) {
133
                $fieldMain = $fieldName;
134
            }
135
            if (1 == $fields[$f]->getVar('field_search')) {
136
                $fieldSearch = $fieldName;
137
            }
138
        }
139
        $img_search = 'blank.gif';
140
        $ret = <<<EOT
141
\n// search callback functions