Code Duplication    Length = 20-21 lines in 2 locations

main/inc/lib/icalcreator/iCalcreator.class.php 2 locations

@@ 1934-1954 (lines=21) @@
1931
     * @since 2.4.8 - 2008-10-22
1932
     * @return string
1933
     */
1934
    function createCategories() {
1935
        if( empty( $this->categories )) return FALSE;
1936
        $output = null;
1937
        foreach( $this->categories as $category ) {
1938
            if( empty( $category['value'] )) {
1939
                if ( $this->getConfig( 'allowEmpty' ))
1940
                    $output .= $this->_createElement( 'CATEGORIES' );
1941
                continue;
1942
            }
1943
            $attributes = $this->_createParams( $category['params'], array( 'LANGUAGE' ));
1944
            if( is_array( $category['value'] )) {
1945
                foreach( $category['value'] as $cix => $categoryPart )
1946
                    $category['value'][$cix] = $this->_strrep( $categoryPart );
1947
                $content  = implode( ',', $category['value'] );
1948
            }
1949
            else
1950
                $content  = $this->_strrep( $category['value'] );
1951
            $output    .= $this->_createElement( 'CATEGORIES', $attributes, $content );
1952
        }
1953
        return $output;
1954
    }
1955
    /**
1956
     * set calendar component property categories
1957
     *
@@ 3321-3340 (lines=20) @@
3318
     * @since 2.4.8 - 2008-10-23
3319
     * @return string
3320
     */
3321
    function createResources() {
3322
        if( empty( $this->resources )) return FALSE;
3323
        $output = null;
3324
        foreach( $this->resources as $resource ) {
3325
            if( empty( $resource['value'] )) {
3326
                if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'RESOURCES' );
3327
                continue;
3328
            }
3329
            $attributes  = $this->_createParams( $resource['params'], array( 'ALTREP', 'LANGUAGE' ));
3330
            if( is_array( $resource['value'] )) {
3331
                foreach( $resource['value'] as $rix => $resourcePart )
3332
                    $resource['value'][$rix] = $this->_strrep( $resourcePart );
3333
                $content   = implode( ',', $resource['value'] );
3334
            }
3335
            else
3336
                $content   = $this->_strrep( $resource['value'] );
3337
            $output     .= $this->_createElement( 'RESOURCES', $attributes, $content );
3338
        }
3339
        return $output;
3340
    }
3341
    /**
3342
     * set calendar component property recources
3343
     *