$value) {
$this->{$key} = $value;
}
$this->label_comments = __('Comments', 'f13-github');
$this->label_created = __('Created', 'f13-github');
$this->label_description = __('Description', 'f13-github');
$this->label_download_file = __('Download file', 'f13-github');
$this->label_files = __('Files', 'f13-github');
$this->label_gist_created_by = __('Gist created by', 'f13-github');
$this->label_last_edited = __('Last edited', 'f13-github');
$this->label_na = __('N/A', 'f13-github');
$this->label_view_on_github = __('View on GitHub', 'f13-github');
}
public function shortcode()
{
$v = '
';
$v .= '';
$v .= '
';
$v .= $this->label_created.': ' . date("F d, Y - h:ia", strtotime($this->data['created_at'])).'
';
$v .= $this->label_last_edited.': ' . date("F d, Y - h:ia", strtotime($this->data['updated_at'])).'
';
$v .= '
';
$v .= '
';
$v .= ''.$this->label_description.': ';
if ($this->data['description'] != '')
{
$v .= htmlentities($this->data['description']);
}
else
{
$v .= $this->label_na;
}
$v .= '
';
$v .= '
';
$v .= '
';
$v .= ''.$this->label_files.' (' . count($this->data['files']) . ')';
$v .= '
';
foreach ($this->data['files'] as &$eachFile)
{
$v .= '
';
$v .= $eachFile['filename'] . ' (' . round($eachFile['size'] / 1024, 2) . 'kb)
'.$this->label_download_file.'';
$v .= '
';
$v .= nl2br(htmlentities($eachFile['content']));
$v .= '
';
}
$v .= '
';
$v .= $this->label_comments.':
' . $this->data['comments'] . '';
$v .= '
';
$v .= '';
return $v;
}
}