<commit_before><?php
/**
 * For playing videos from community video services like YouTube or Vimeo
 */
class Vpc_Advanced_CommunityVideo_Component extends Vpc_Abstract
{
    public static function getSettings()
    {
        $ret = array_merge(parent::getSettings(), array(
            'componentName' => trlVps('Community Video'),
            'componentIcon' => new Vps_Asset('film'),
            'ownModel'     => 'Vpc_Advanced_CommunityVideo_Model'
        ));
        $ret['assets']['dep'][] = 'SwfObject';
        return $ret;
    }

    public function getTemplateVars()
    {
        $ret = parent::getTemplateVars();

        $url = $this->getRow()->url;
        $urlParts = parse_url($url);

        if (preg_match('/youtube\.com$/i', $urlParts['host'])) {
            $url = str_replace('/watch?v=', '/v/', $url);
        } else if (preg_match('/vimeo\.com$/i', $urlParts['host'])) {
            $clipId = substr($urlParts['path'], 1);
            $url = 'http://vimeo.com/moogaloop.swf?clip_id='.$clipId.'&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1';
        }

        $ret['flashUrl'] = $url;
        return $ret;
    }

    public function hasContent()
    {
        if ($this->getRow()->url) return true;
        return false;<commit_msg>fix fuer communityVideo comp: fehlende if abfragen<commit_after><?php
/**
 * For playing videos from community video services like YouTube or Vimeo
 */
class Vpc_Advanced_CommunityVideo_Component extends Vpc_Abstract
{
    public static function getSettings()
    {
        $ret = array_merge(parent::getSettings(), array(
            'componentName' => trlVps('Community Video'),
            'componentIcon' => new Vps_Asset('film'),
            'ownModel'     => 'Vpc_Advanced_CommunityVideo_Model'
        ));
        $ret['assets']['dep'][] = 'SwfObject';
        return $ret;
    }

    public function getTemplateVars()
    {
        $ret = parent::getTemplateVars();

        $url = $this->getRow()->url;
        if (!empty($url)) {
            $urlParts = parse_url($url);

            if ($urlParts && !empty($urlParts['host'])) {
                if (preg_match('/youtube\.com$/i', $urlParts['host'])) {
                    $url = str_replace('/watch?v=', '/v/', $url);
                } else if (preg_match('/vimeo\.com$/i', $urlParts['host'])) {
                    $clipId = substr($urlParts['path'], 1);
                    $url = 'http://vimeo.com/moogaloop.swf?clip_id='.$clipId.'&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1';
                }
            }
        }

        $ret['flashUrl'] = $url;
        return $ret;
    }

    public function hasContent()
    {
        if ($this->getRow()->url) return true;
        return false;
{'fraction_non_alphanumeric': 0.16480748470672904, 'fraction_numerical': 0.0035984166966534724, 'mean_word_length': 2.4363411619283064, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7378982', 'n_tokens_mistral': 882, 'n_tokens_neox': 848, 'n_words': 156}