src/Util/ContentItem.php
public function addLtiLinkItem($url, $title=false, $text=false,
        $icon=false, $fa_icon=false, $custom=false,
        $points=false, $activityId=false, $additionalParams = array())
    {
            global $CFG;
        $params = array(
            'url' => $url,
            'title' => $title,
            'text' => $text,
            'icon' => $icon,
            'fa_icon' => $fa_icon,
            'custom' => $custom,
            'points' => $points,
            'activityId' => $activityId,
        );
        // package the parameter list into an array for the helper function
        if (! empty($additionalParams['placementTarget']))
            $params['placementTarget'] = $additionalParams['placementTarget'];
        if (! empty($additionalParams['placementWidth']))
            $params['placementWidth'] = $additionalParams['placementWidth'];
        if (! empty($additionalParams['placementHeight']))
            $params['placementHeight'] = $additionalParams['placementHeight'];

        $this->addLtiLinkItemExtended($params);
    }
public function addLtiLinkItem($url, $title=false, $text=false,
        $icon=false, $fa_icon=false, $custom=false,
        $points=false, $activityId=false, $additionalParams = array())
    {
            global $CFG;
        $params = array(
            'url' => $url,
            'title' => $title,
            'text' => $text,
            'icon' => $icon,
            'fa_icon' => $fa_icon,
            'custom' => $custom,
            'points' => $points,
            'activityId' => $activityId,
        );
        // package the parameter list into an array for the helper function
        if (! empty($additionalParams['placementTarget']))
            $params['placementTarget'] = $additionalParams['placementTarget'];
        if (! empty($additionalParams['placementWidth']))
            $params['placementWidth'] = $additionalParams['placementWidth'];
        if (! empty($additionalParams['placementHeight']))
            $params['placementHeight'] = $additionalParams['placementHeight'];

        $this->addLtiLinkItemExtended($params);
    }
public function addLtiLinkItem ( $ url , $ title = false , $ text = false , $ icon = false , $ fa_icon = false , $ custom = false , $ points = false , $ activityId = false , $ additionalParams = array ( ) ) { global $ CFG ; $ params = array ( 'url' => $ url , 'title' => $ title , 'text' => $ text , 'icon' => $ icon , 'fa_icon' => $ fa_icon , 'custom' => $ custom , 'points' => $ points , 'activityId' => $ activityId , ) ; // package the parameter list into an array for the helper function if ( ! empty ( $ additionalParams [ 'placementTarget' ] ) ) $ params [ 'placementTarget' ] = $ additionalParams [ 'placementTarget' ] ; if ( ! empty ( $ additionalParams [ 'placementWidth' ] ) ) $ params [ 'placementWidth' ] = $ additionalParams [ 'placementWidth' ] ; if ( ! empty ( $ additionalParams [ 'placementHeight' ] ) ) $ params [ 'placementHeight' ] = $ additionalParams [ 'placementHeight' ] ; $ this -> addLtiLinkItemExtended ( $ params ) ; }
addLtiLinkItem - Add an LTI Link Content Item

@param $url The launch URL of the tool that is about to be placed
@param $title A plain text title of the content-item.
@param $text A plain text description of the content-item.
@param $icon An image URL of an icon
@param $fa_icon The class name of a FontAwesome icon
@param $custom An optional array of custom key / value pairs
@param $points The number of points if this is an assignment
@param $activityId The activity for the item
addLtiLinkItem - Add an LTI Link Content Item