public function getDefaultSetting()
{
$repodir = $this->user . '/' . $this->repo;
$href = "https://github.com/{$repodir}";
$api = "/repos/{$repodir}#";
switch ($this->type) {
case self::WATCH:
return ["href" => $href, "data-icon" => "octicon-eye", "data-count-api" => "{$api}subscribers_count", "data-count-href" => "/{$repodir}/watchers", "label" => Yii::t('kvsocial', 'Watch')];
case self::STAR:
return ["href" => $href, "data-icon" => "octicon-star", "data-count-api" => "{$api}stargazers_count", "data-count-href" => "/{$repodir}/stargazers", "label" => Yii::t('kvsocial', 'Star')];
case self::FORK:
return ["href" => $href . '/fork', "data-icon" => "octicon-git-branch", "data-count-api" => "{$api}forks_count", "data-count-href" => "{$href}/{$repodir}/network", "label" => Yii::t('kvsocial', 'Fork')];
case self::ISSUE:
return ["href" => $href . "/issues", "data-icon" => "octicon-issue-opened", "data-count-api" => "{$api}open_issues_count", "label" => Yii::t('kvsocial', 'Issue')];
case self::DOWNLOAD:
return ["href" => $href . "/archive/master.zip", "data-icon" => "octicon-cloud-download", "label" => Yii::t('kvsocial', 'Download')];
case self::FOLLOW:
return ["href" => "https://github.com/{$this->user}", "data-icon" => "octicon-mark-github", "data-count-api" => "/users/{$this->user}#followers", "data-count-href" => "/{$this->user}/followers", "label" => Yii::t('kvsocial', 'Follow') . " @{$this->user}"];
default:
return [];
}
}