Code Duplication    Length = 13-14 lines in 3 locations

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

@@ 2013-2026 (lines=14) @@
2010
     * @since 2.4.8 - 2008-10-22
2011
     * @return string
2012
     */
2013
    function createComment() {
2014
        if( empty( $this->comment )) return FALSE;
2015
        $output = null;
2016
        foreach( $this->comment as $commentPart ) {
2017
            if( empty( $commentPart['value'] )) {
2018
                if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'COMMENT' );
2019
                continue;
2020
            }
2021
            $attributes = $this->_createParams( $commentPart['params'], array( 'ALTREP', 'LANGUAGE' ));
2022
            $content    = $this->_strrep( $commentPart['value'] );
2023
            $output    .= $this->_createElement( 'COMMENT', $attributes, $content );
2024
        }
2025
        return $output;
2026
    }
2027
    /**
2028
     * set calendar component property comment
2029
     *
@@ 2105-2117 (lines=13) @@
2102
     * @since 2.4.8 - 2008-10-23
2103
     * @return string
2104
     */
2105
    function createContact() {
2106
        if( empty( $this->contact )) return FALSE;
2107
        $output = null;
2108
        foreach( $this->contact as $contact ) {
2109
            if( !empty( $contact['value'] )) {
2110
                $attributes = $this->_createParams( $contact['params'], array( 'ALTREP', 'LANGUAGE' ));
2111
                $content    = $this->_strrep( $contact['value'] );
2112
                $output    .= $this->_createElement( 'CONTACT', $attributes, $content );
2113
            }
2114
            elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'CONTACT' );
2115
        }
2116
        return $output;
2117
    }
2118
    /**
2119
     * set calendar component property contact
2120
     *
@@ 2182-2194 (lines=13) @@
2179
     * @since 2.4.8 - 2008-10-22
2180
     * @return string
2181
     */
2182
    function createDescription() {
2183
        if( empty( $this->description )) return FALSE;
2184
        $output       = null;
2185
        foreach( $this->description as $description ) {
2186
            if( !empty( $description['value'] )) {
2187
                $attributes = $this->_createParams( $description['params'], array( 'ALTREP', 'LANGUAGE' ));
2188
                $content    = $this->_strrep( $description['value'] );
2189
                $output    .= $this->_createElement( 'DESCRIPTION', $attributes, $content );
2190
            }
2191
            elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'DESCRIPTION' );
2192
        }
2193
        return $output;
2194
    }
2195
    /**
2196
     * set calendar component property description
2197
     *