<?php

namespace IPS\Content\ShareServices;


class _Vkontakte
{
    /**
     * @brief    URL to the content item
     */
    protected $url        = NULL;
    
    /**
     * @brief    Title of the content item
     */
    protected $title    = NULL;

    /**
     * Constructor
     *
     * @param    \IPS\Http\Url    $url    URL to the content [optional - if omitted, some services will figure out on their own]
     * @param    string            $title    Default text for the content, usually the title [optional - if omitted, some services will figure out on their own]
     * @return    void
     */
    public function __construct( \IPS\Http\Url $url=NULL, $title=NULL )
    {
        $this->url        = $url;
        $this->title    = $title;
    }

    /**
     * Add any additional form elements to the configuration form. These must be setting keys that the service configuration form can save as a setting.
     *
     * @param    \IPS\Helpers\Form    $form    Configuration form for this service
     * @return    void
     */
    public static function modifyForm( \IPS\Helpers\Form &$form )
    {
    }

    static function canAutoshare() {}

    /**
     * Return the HTML code to show the share link
     *
     * @return    string
     */
    public function __toString()
    {
        return '<a href="https://vk.com/share.php?url='.$this->url.'&title='.$this->title.'" class="cShareLink cShareLink_vk" style="background-color:#56789C;" target="_blank" data-controller="core.front.core.sharelink" data-role="shareLink" _title="Поделиться в Вконтакте" data-ipstooltip="">
                <i class="fa fa-vk"></i>
                </a>';
    }
}