1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 11:22:40 +01:00
phorge-phorge/src/applications/feed/view/PhabricatorFeedStoryView.php
vrana ef85f49adc Delete license headers from files
Summary:
This commit doesn't change license of any file. It just makes the license implicit (inherited from LICENSE file in the root directory).

We are removing the headers for these reasons:

- It wastes space in editors, less code is visible in editor upon opening a file.
- It brings noise to diff of the first change of any file every year.
- It confuses Git file copy detection when creating small files.
- We don't have an explicit license header in other files (JS, CSS, images, documentation).
- Using license header in every file is not obligatory: http://www.apache.org/dev/apply-license.html#new.

This change is approved by Alma Chao (Lead Open Source and IP Counsel at Facebook).

Test Plan: Verified that the license survived only in LICENSE file and that it didn't modify externals.

Reviewers: epriestley, davidrecordon

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2035

Differential Revision: https://secure.phabricator.com/D3886
2012-11-05 11:16:51 -08:00

90 lines
1.8 KiB
PHP

<?php
final class PhabricatorFeedStoryView extends PhabricatorFeedView {
private $title;
private $image;
private $phid;
private $epoch;
private $viewer;
private $oneLine;
public function setViewer(PhabricatorUser $viewer) {
$this->viewer = $viewer;
return $this;
}
public function setTitle($title) {
$this->title = $title;
return $this;
}
public function setEpoch($epoch) {
$this->epoch = $epoch;
return $this;
}
public function setImage($image) {
$this->image = $image;
return $this;
}
public function setOneLineStory($one_line) {
$this->oneLine = $one_line;
return $this;
}
public function render() {
$head = phutil_render_tag(
'div',
array(
'class' => 'phabricator-feed-story-head',
),
nonempty($this->title, 'Untitled Story'));
$body = null;
$foot = null;
$image_style = null;
if (!$this->oneLine) {
$body = phutil_render_tag(
'div',
array(
'class' => 'phabricator-feed-story-body',
),
$this->renderChildren());
if ($this->epoch) {
$foot = phabricator_datetime($this->epoch, $this->viewer);
} else {
$foot = '';
}
$foot = phutil_render_tag(
'div',
array(
'class' => 'phabricator-feed-story-foot',
),
$foot);
if ($this->image) {
$image_style = 'background-image: url('.$this->image.')';
}
}
require_celerity_resource('phabricator-feed-css');
return phutil_render_tag(
'div',
array(
'class' => $this->oneLine
? 'phabricator-feed-story phabricator-feed-story-one-line'
: 'phabricator-feed-story',
'style' => $image_style,
),
$head.$body.$foot);
}
}