Code Duplication    Length = 10-13 lines in 2 locations

htdocs/xoops_lib/Xoops/Core/Kernel/Handlers/XoopsBlockHandler.php 1 location

@@ 131-140 (lines=10) @@
128
     *
129
     * @return array array of blocks matching the conditions
130
     **/
131
    public function getNameList(CriteriaElement $criteria = null)
132
    {
133
        $blocks = $this->getObjects($criteria, true);
134
        $ret = array();
135
        foreach (array_keys($blocks) as $i) {
136
            $name = (!$blocks[$i]->isCustom()) ? $blocks[$i]->getVar('name') : $blocks[$i]->getVar('title');
137
            $ret[$i] = $name;
138
        }
139
        return $ret;
140
    }
141
142
    /**
143
     * get all the blocks that match the supplied parameters

htdocs/xoops_lib/Xoops/Core/Kernel/Handlers/XoopsModuleHandler.php 1 location

@@ 295-307 (lines=13) @@
292
     *
293
     * @return array
294
     */
295
    public function getNameList(CriteriaElement $criteria = null, $dirname_as_key = false)
296
    {
297
        $ret = array();
298
        $modules = $this->getObjectsArray($criteria, true);
299
        foreach (array_keys($modules) as $i) {
300
            if (!$dirname_as_key) {
301
                $ret[$i] = $modules[$i]->getVar('name');
302
            } else {
303
                $ret[$modules[$i]->getVar('dirname')] = $modules[$i]->getVar('name');
304
            }
305
        }
306
        return $ret;
307
    }
308
}
309