本文整理汇总了PHP中celerity_get_resource_uri函数的典型用法代码示例。如果您正苦于以下问题:PHP celerity_get_resource_uri函数的具体用法?PHP celerity_get_resource_uri怎么用?PHP celerity_get_resource_uri使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了celerity_get_resource_uri函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHead
protected function getHead()
{
$framebust = null;
if (!$this->getFrameable()) {
$framebust = '(top == self) || top.location.replace(self.location.href);';
}
$viewport_tag = null;
if ($this->getDeviceReady()) {
$viewport_tag = phutil_tag('meta', array('name' => 'viewport', 'content' => 'width=device-width, ' . 'initial-scale=1, ' . 'maximum-scale=1'));
}
$mask_icon = phutil_tag('link', array('rel' => 'mask-icon', 'color' => '#3D4B67', 'href' => celerity_get_resource_uri('/rsrc/favicons/mask-icon.svg')));
$icon_tag_76 = phutil_tag('link', array('rel' => 'apple-touch-icon', 'href' => celerity_get_resource_uri('/rsrc/favicons/apple-touch-icon-76x76.png')));
$icon_tag_120 = phutil_tag('link', array('rel' => 'apple-touch-icon', 'sizes' => '120x120', 'href' => celerity_get_resource_uri('/rsrc/favicons/apple-touch-icon-120x120.png')));
$icon_tag_152 = phutil_tag('link', array('rel' => 'apple-touch-icon', 'sizes' => '152x152', 'href' => celerity_get_resource_uri('/rsrc/favicons/apple-touch-icon-152x152.png')));
$favicon_tag = phutil_tag('link', array('id' => 'favicon', 'rel' => 'shortcut icon', 'href' => celerity_get_resource_uri('/rsrc/favicons/favicon.ico')));
$referrer_tag = phutil_tag('meta', array('name' => 'referrer', 'content' => 'never'));
$response = CelerityAPI::getStaticResourceResponse();
if ($this->getRequest()) {
$viewer = $this->getRequest()->getViewer();
if ($viewer) {
$postprocessor_key = $viewer->getUserSetting(PhabricatorAccessibilitySetting::SETTINGKEY);
if (strlen($postprocessor_key)) {
$response->setPostProcessorKey($postprocessor_key);
}
}
}
$developer = PhabricatorEnv::getEnvConfig('phabricator.developer-mode');
return hsprintf('%s%s%s%s%s%s%s%s%s', $viewport_tag, $mask_icon, $icon_tag_76, $icon_tag_120, $icon_tag_152, $favicon_tag, $referrer_tag, CelerityStaticResourceResponse::renderInlineScript($framebust . jsprintf('window.__DEV__=%d;', $developer ? 1 : 0)), $response->renderResourcesOfType('css'));
}
示例2: getHead
protected function getHead()
{
$framebust = null;
if (!$this->getFrameable()) {
$framebust = '(top == self) || top.location.replace(self.location.href);';
}
$viewport_tag = null;
if ($this->getDeviceReady()) {
$viewport_tag = phutil_tag('meta', array('name' => 'viewport', 'content' => 'width=device-width, ' . 'initial-scale=1, ' . 'maximum-scale=1'));
}
$icon_tag_76 = phutil_tag('link', array('rel' => 'apple-touch-icon', 'href' => celerity_get_resource_uri('/rsrc/favicons/apple-touch-icon-76x76.png')));
$icon_tag_120 = phutil_tag('link', array('rel' => 'apple-touch-icon', 'sizes' => '120x120', 'href' => celerity_get_resource_uri('/rsrc/favicons/apple-touch-icon-120x120.png')));
$icon_tag_152 = phutil_tag('link', array('rel' => 'apple-touch-icon', 'sizes' => '152x152', 'href' => celerity_get_resource_uri('/rsrc/favicons/apple-touch-icon-152x152.png')));
$apple_tag = phutil_tag('meta', array('name' => 'apple-mobile-web-app-status-bar-style', 'content' => 'black-translucent'));
$referrer_tag = phutil_tag('meta', array('name' => 'referrer', 'content' => 'never'));
$response = CelerityAPI::getStaticResourceResponse();
if ($this->getRequest()) {
$viewer = $this->getRequest()->getViewer();
if ($viewer) {
$postprocessor_key = $viewer->getPreference(PhabricatorUserPreferences::PREFERENCE_RESOURCE_POSTPROCESSOR);
if (strlen($postprocessor_key)) {
$response->setPostProcessorKey($postprocessor_key);
}
}
}
$developer = PhabricatorEnv::getEnvConfig('phabricator.developer-mode');
return hsprintf('%s%s%s%s%s%s%s%s', $viewport_tag, $icon_tag_76, $icon_tag_120, $icon_tag_152, $apple_tag, $referrer_tag, CelerityStaticResourceResponse::renderInlineScript($framebust . jsprintf('window.__DEV__=%d;', $developer ? 1 : 0)), $response->renderResourcesOfType('css'));
}
示例3: render
public function render()
{
if (!$this->mock) {
throw new Exception('Call setMock() before render()!');
}
$mock = $this->mock;
require_celerity_resource('javelin-behavior-pholio-mock-view');
$images = array();
$panel_id = celerity_generate_unique_node_id();
$viewport_id = celerity_generate_unique_node_id();
$ids = mpull($mock->getImages(), 'getID');
if ($this->imageID && isset($ids[$this->imageID])) {
$selected_id = $this->imageID;
} else {
$selected_id = head_key($ids);
}
// TODO: We could maybe do a better job with tailoring this, which is the
// image shown on the review stage.
$nonimage_uri = celerity_get_resource_uri('rsrc/image/icon/fatcow/thumbnails/default.p100.png');
$engine = id(new PhabricatorMarkupEngine())->setViewer($this->getUser());
foreach ($mock->getAllImages() as $image) {
$engine->addObject($image, 'default');
}
$engine->process();
$current_set = 0;
foreach ($mock->getAllImages() as $image) {
$file = $image->getFile();
$metadata = $file->getMetadata();
$x = idx($metadata, PhabricatorFile::METADATA_IMAGE_WIDTH);
$y = idx($metadata, PhabricatorFile::METADATA_IMAGE_HEIGHT);
$is_obs = (bool) $image->getIsObsolete();
if (!$is_obs) {
$current_set++;
}
$history_uri = '/pholio/image/history/' . $image->getID() . '/';
$images[] = array('id' => $image->getID(), 'fullURI' => $file->getBestURI(), 'stageURI' => $file->isViewableImage() ? $file->getBestURI() : $nonimage_uri, 'pageURI' => $this->getImagePageURI($image, $mock), 'downloadURI' => $file->getDownloadURI(), 'historyURI' => $history_uri, 'width' => $x, 'height' => $y, 'title' => $image->getName(), 'descriptionMarkup' => $engine->getOutput($image, 'default'), 'isObsolete' => (bool) $image->getIsObsolete(), 'isImage' => $file->isViewableImage(), 'isViewable' => $file->isViewableInBrowser());
}
$navsequence = array();
foreach ($mock->getImages() as $image) {
$navsequence[] = $image->getID();
}
$full_icon = array(javelin_tag('span', array('aural' => true), pht('View Raw File')), id(new PHUIIconView())->setIconFont('fa-file-image-o'));
$download_icon = array(javelin_tag('span', array('aural' => true), pht('Download File')), id(new PHUIIconView())->setIconFont('fa-download'));
$login_uri = id(new PhutilURI('/login/'))->setQueryParam('next', (string) $this->getRequestURI());
$config = array('mockID' => $mock->getID(), 'panelID' => $panel_id, 'viewportID' => $viewport_id, 'commentFormID' => $this->getCommentFormID(), 'images' => $images, 'selectedID' => $selected_id, 'loggedIn' => $this->getUser()->isLoggedIn(), 'logInLink' => (string) $login_uri, 'navsequence' => $navsequence, 'fullIcon' => hsprintf('%s', $full_icon), 'downloadIcon' => hsprintf('%s', $download_icon), 'currentSetSize' => $current_set);
Javelin::initBehavior('pholio-mock-view', $config);
$mockview = '';
$mock_wrapper = javelin_tag('div', array('id' => $viewport_id, 'sigil' => 'mock-viewport', 'class' => 'pholio-mock-image-viewport'), '');
$image_header = javelin_tag('div', array('id' => 'mock-image-header', 'class' => 'pholio-mock-image-header'), '');
$mock_wrapper = javelin_tag('div', array('id' => $panel_id, 'sigil' => 'mock-panel touchable', 'class' => 'pholio-mock-image-panel'), array($image_header, $mock_wrapper));
$inline_comments_holder = javelin_tag('div', array('id' => 'mock-image-description', 'sigil' => 'mock-image-description', 'class' => 'mock-image-description'), '');
$mockview[] = phutil_tag('div', array('class' => 'pholio-mock-image-container', 'id' => 'pholio-mock-image-container'), array($mock_wrapper, $inline_comments_holder));
return $mockview;
}
示例4: getFaviconURI
private function getFaviconURI($type = null)
{
switch ($type) {
case 'message':
return celerity_get_resource_uri('/rsrc/favicons/favicon-message.ico');
case 'mention':
return celerity_get_resource_uri('/rsrc/favicons/favicon-mention.ico');
default:
return celerity_get_resource_uri('/rsrc/favicons/favicon.ico');
}
}
示例5: getHead
protected function getHead()
{
$framebust = null;
if (!$this->getFrameable()) {
$framebust = '(top == self) || top.location.replace(self.location.href);';
}
$viewport_tag = null;
if ($this->getDeviceReady()) {
$viewport_tag = phutil_tag('meta', array('name' => 'viewport', 'content' => 'width=device-width, ' . 'initial-scale=1, ' . 'maximum-scale=1'));
}
$icon_tag = phutil_tag('link', array('rel' => 'apple-touch-icon', 'href' => celerity_get_resource_uri('/rsrc/image/apple-touch-icon.png')));
$apple_tag = phutil_tag('meta', array('name' => 'apple-mobile-web-app-status-bar-style', 'content' => 'black-translucent'));
$referrer_tag = phutil_tag('meta', array('name' => 'referrer', 'content' => 'never'));
$response = CelerityAPI::getStaticResourceResponse();
$developer = PhabricatorEnv::getEnvConfig('phabricator.developer-mode');
return hsprintf('%s%s%s%s%s%s', $viewport_tag, $icon_tag, $apple_tag, $referrer_tag, CelerityStaticResourceResponse::renderInlineScript($framebust . jsprintf('window.__DEV__=%d;', $developer ? 1 : 0)), $response->renderResourcesOfType('css'));
}
示例6: renderExample
public function renderExample()
{
$image = celerity_get_resource_uri('/rsrc/image/examples/hero.png');
$display_height = 100;
$display_width = 200;
$mask1 = id(new PHUIImageMaskView())->addClass('ml')->setImage($image)->setDisplayHeight($display_height)->setDisplayWidth($display_width)->centerViewOnPoint(265, 185, 30, 140);
$mask2 = id(new PHUIImageMaskView())->addClass('ml')->setImage($image)->setDisplayHeight($display_height)->setDisplayWidth($display_width)->centerViewOnPoint(18, 18, 40, 80);
$mask3 = id(new PHUIImageMaskView())->addClass('ml')->setImage($image)->setDisplayHeight($display_height)->setDisplayWidth($display_width)->centerViewOnPoint(265, 185, 30, 140)->withMask(true);
$mask4 = id(new PHUIImageMaskView())->addClass('ml')->setImage($image)->setDisplayHeight($display_height)->setDisplayWidth($display_width)->centerViewOnPoint(18, 18, 40, 80)->withMask(true);
$mask5 = id(new PHUIImageMaskView())->addClass('ml')->setImage($image)->setDisplayHeight($display_height)->setDisplayWidth($display_width)->centerViewOnPoint(254, 272, 60, 240)->withMask(true);
$box1 = id(new PHUIObjectBoxView())->setHeaderText(pht('Center is in the middle'))->appendChild($mask1);
$box2 = id(new PHUIObjectBoxView())->setHeaderText(pht('Center is on an edge'))->appendChild($mask2);
$box3 = id(new PHUIObjectBoxView())->setHeaderText(pht('Center Masked'))->appendChild($mask3);
$box4 = id(new PHUIObjectBoxView())->setHeaderText(pht('Edge Masked'))->appendChild($mask4);
$box5 = id(new PHUIObjectBoxView())->setHeaderText(pht('Wide Masked'))->appendChild($mask5);
return phutil_tag('div', array(), array($box1, $box2, $box3, $box4, $box5));
}
示例7: renderExample
public function renderExample()
{
$request = $this->getRequest();
$user = $request->getUser();
/* Basic Story */
$text = hsprintf('<strong><a>harding (Tom Harding)</a></strong> closed <a>' . 'D12: New spacer classes for blog views</a>.');
$story1 = id(new PHUIFeedStoryView())->setTitle($text)->setImage(celerity_get_resource_uri('/rsrc/image/people/harding.png'))->setImageHref('http://en.wikipedia.org/wiki/Warren_G._Harding')->setEpoch(1)->setAppIcon('fa-star')->setUser($user);
/* Text Story, useful in Blogs, Ponders, Status */
$tokens = array('like-1', 'like-2', 'heart-1', 'heart-2');
$tokenview = array();
foreach ($tokens as $token) {
$tokenview[] = id(new PHUIIconView())->setSpriteSheet(PHUIIconView::SPRITE_TOKENS)->setSpriteIcon($token);
}
$text = hsprintf('<strong><a>lincoln (Honest Abe)</a></strong> wrote a ' . 'new blog post.');
$story2 = id(new PHUIFeedStoryView())->setTitle($text)->setImage(celerity_get_resource_uri('/rsrc/image/people/lincoln.png'))->setImageHref('http://en.wikipedia.org/wiki/Abraham_Lincoln')->setEpoch(strtotime('November 19, 1863'))->setAppIcon('fa-star')->setUser($user)->setTokenBar($tokenview)->setPontification('Four score and seven years ago our fathers brought ' . 'forth on this continent, a new nation, conceived in Liberty, and ' . 'dedicated to the proposition that all men are created equal. ' . 'Now we are engaged in a great civil war, testing whether that ' . 'nation, or any nation so conceived and so dedicated, can long ' . 'endure. We are met on a great battle-field of that war. We have ' . 'come to dedicate a portion of that field, as a final resting ' . 'place for those who here gave their lives that that nation might ' . 'live. It is altogether fitting and proper that we should do this.', 'Gettysburg Address');
/* Action Story, let's give people tokens! */
$text = hsprintf('<strong><a>harding (Tom Harding)</a></strong> awarded ' . '<a>M10: Workboards</a> a token.');
$action1 = id(new PHUIIconView())->setIcon('fa-trophy bluegrey')->setHref('#');
$token = id(new PHUIIconView())->setSpriteSheet(PHUIIconView::SPRITE_TOKENS)->setSpriteIcon('like-1');
$story3 = id(new PHUIFeedStoryView())->setTitle($text)->setImage(celerity_get_resource_uri('/rsrc/image/people/harding.png'))->setImageHref('http://en.wikipedia.org/wiki/Warren_G._Harding')->appendChild($token)->setEpoch(1)->addAction($action1)->setAppIcon('fa-trophy')->setUser($user);
/* Image Story, used in Pholio, Macro */
$text = hsprintf('<strong><a>wgharding (Warren Harding)</a></strong> ' . 'asked a new question.');
$action1 = id(new PHUIIconView())->setIcon('fa-chevron-up bluegrey')->setHref('#');
$action2 = id(new PHUIIconView())->setIcon('fa-chevron-down bluegrey')->setHref('#');
$story4 = id(new PHUIFeedStoryView())->setTitle($text)->setImage(celerity_get_resource_uri('/rsrc/image/people/harding.png'))->setImageHref('http://en.wikipedia.org/wiki/Warren_G._Harding')->setEpoch(1)->setAppIcon('fa-cogs')->setPontification('Why does inline-block add space under my spans and anchors?')->addAction($action1)->addAction($action2)->setUser($user);
/* Text Story, useful in Blogs, Ponders, Status */
$text = hsprintf('<strong><a>lincoln (Honest Abe)</a></strong> updated ' . 'his status.');
$story5 = id(new PHUIFeedStoryView())->setTitle($text)->setImage(celerity_get_resource_uri('/rsrc/image/people/lincoln.png'))->setImageHref('http://en.wikipedia.org/wiki/Abraham_Lincoln')->setEpoch(strtotime('November 19, 1863'))->setAppIcon('fa-rocket')->setUser($user)->setPontification('If we ever create a lightweight status app ' . 'this story would be how that would be displayed.');
/* Basic "One Line" Story */
$text = hsprintf('<strong><a>harding (Tom Harding)</a></strong> updated <a>' . 'D12: New spacer classes for blog views</a>.');
$story6 = id(new PHUIFeedStoryView())->setTitle($text)->setImage(celerity_get_resource_uri('/rsrc/image/people/harding.png'))->setImageHref('http://en.wikipedia.org/wiki/Warren_G._Harding')->setEpoch(1)->setAppIcon('fa-wifi')->setUser($user);
$head1 = id(new PHUIHeaderView())->setHeader(pht('Basic Story'));
$head2 = id(new PHUIHeaderView())->setHeader(pht('Title / Text Story'));
$head3 = id(new PHUIHeaderView())->setHeader(pht('Token Story'));
$head4 = id(new PHUIHeaderView())->setHeader(pht('Action Story'));
$head5 = id(new PHUIHeaderView())->setHeader(pht('Status Story'));
$head6 = id(new PHUIHeaderView())->setHeader(pht('One Line Story'));
$wrap1 = array(id(new PHUIBoxView())->appendChild($story1)->addMargin(PHUI::MARGIN_MEDIUM)->addPadding(PHUI::PADDING_SMALL));
$wrap2 = array(id(new PHUIBoxView())->appendChild($story2)->addMargin(PHUI::MARGIN_MEDIUM)->addPadding(PHUI::PADDING_SMALL));
$wrap3 = array(id(new PHUIBoxView())->appendChild($story3)->addMargin(PHUI::MARGIN_MEDIUM)->addPadding(PHUI::PADDING_SMALL));
$wrap4 = array(id(new PHUIBoxView())->appendChild($story4)->addMargin(PHUI::MARGIN_MEDIUM)->addPadding(PHUI::PADDING_SMALL));
$wrap5 = array(id(new PHUIBoxView())->appendChild($story5)->addMargin(PHUI::MARGIN_MEDIUM)->addPadding(PHUI::PADDING_SMALL));
$wrap6 = array(id(new PHUIBoxView())->appendChild($story6)->addMargin(PHUI::MARGIN_MEDIUM)->addPadding(PHUI::PADDING_SMALL));
return phutil_tag('div', array(), array($head1, $wrap1, $head2, $wrap2, $head3, $wrap3, $head4, $wrap4, $head5, $wrap5, $head6, $wrap6));
}
示例8: renderInput
protected function renderInput()
{
require_celerity_resource('phabricator-flag-css');
$colors = PhabricatorFlagColor::getColorNameMap();
$value_map = array_fuse($this->getValue());
$file_map = array(PhabricatorFlagColor::COLOR_RED => 'red', PhabricatorFlagColor::COLOR_ORANGE => 'orange', PhabricatorFlagColor::COLOR_YELLOW => 'yellow', PhabricatorFlagColor::COLOR_GREEN => 'green', PhabricatorFlagColor::COLOR_BLUE => 'blue', PhabricatorFlagColor::COLOR_PINK => 'pink', PhabricatorFlagColor::COLOR_PURPLE => 'purple', PhabricatorFlagColor::COLOR_CHECKERED => 'finish');
$out = array();
foreach ($colors as $const => $name) {
// TODO: This should probably be a sprite sheet.
$partial = $file_map[$const];
$uri = '/rsrc/image/icon/fatcow/flag_' . $partial . '.png';
$uri = celerity_get_resource_uri($uri);
$icon = id(new PHUIIconView())->setImage($uri);
$input = phutil_tag('input', array('type' => 'checkbox', 'name' => $this->getName() . '[]', 'value' => $const, 'checked' => isset($value_map[$const]) ? 'checked' : null, 'class' => 'phabricator-flag-select-checkbox'));
$label = phutil_tag('label', array('class' => 'phabricator-flag-select-label'), array($icon, $input));
$out[] = $label;
}
return $out;
}
示例9: renderExample
public function renderExample()
{
$request = $this->getRequest();
$user = $request->getUser();
$elements = array();
$diff_handle = $this->createBasicDummyHandle('D123', DifferentialRevisionPHIDType::TYPECONST, pht('Introduce cooler Differential Revisions'));
$panel = $this->createPanel(pht('Differential Hovercard'));
$panel->appendChild(id(new PhabricatorHovercardView())->setObjectHandle($diff_handle)->addField(pht('Author'), $user->getUsername())->addField(pht('Updated'), phabricator_datetime(time(), $user))->addAction(pht('Subscribe'), '/dev/random')->setUser($user));
$elements[] = $panel;
$task_handle = $this->createBasicDummyHandle('T123', ManiphestTaskPHIDType::TYPECONST, pht('Improve Mobile Experience for Phabricator'));
$tag = id(new PHUITagView())->setType(PHUITagView::TYPE_STATE)->setName(pht('Closed, Resolved'));
$panel = $this->createPanel(pht('Maniphest Hovercard'));
$panel->appendChild(id(new PhabricatorHovercardView())->setObjectHandle($task_handle)->setUser($user)->addField(pht('Assigned to'), $user->getUsername())->addField(pht('Dependent Tasks'), 'T123, T124, T125')->addAction(pht('Subscribe'), '/dev/random')->addAction(pht('Create Subtask'), '/dev/urandom')->addTag($tag));
$elements[] = $panel;
$user_handle = $this->createBasicDummyHandle('gwashington', PhabricatorPeopleUserPHIDType::TYPECONST, 'George Washington');
$user_handle->setImageURI(celerity_get_resource_uri('/rsrc/image/people/washington.png'));
$panel = $this->createPanel(pht('Whatevery Hovercard'));
$panel->appendChild(id(new PhabricatorHovercardView())->setObjectHandle($user_handle)->addField(pht('Status'), pht('Available'))->addField(pht('Member since'), '30. February 1750')->addAction(pht('Send a Message'), '/dev/null')->setUser($user));
$elements[] = $panel;
return phutil_implode_html('', $elements);
}
示例10: renderExample
public function renderExample()
{
$header1 = id(new PHUIHeaderView())->setHeader(pht('Conpherence'));
$header2 = id(new PHUIHeaderView())->setHeader(pht('Diffusion'));
$header3 = id(new PHUIHeaderView())->setHeader(pht('Backend Ops Projects'));
$header4 = id(new PHUIHeaderView())->setHeader(pht('Revamp Liberty'))->setSubHeader(pht('For great justice'))->setImage(celerity_get_resource_uri('/rsrc/image/people/washington.png'));
$header5 = id(new PHUIHeaderView())->setHeader(pht('Phacility Redesign'))->setSubHeader(pht('Move them pixels'))->setImage(celerity_get_resource_uri('/rsrc/image/people/harding.png'));
$header6 = id(new PHUIHeaderView())->setHeader(pht('Python Phlux'))->setSubHeader(pht('No. Sleep. Till Brooklyn.'))->setImage(celerity_get_resource_uri('/rsrc/image/people/taft.png'));
$column1 = id(new PHUIInfoPanelView())->setHeader($header1)->setColumns(3)->addInfoBlock(3, 'Needs Triage')->addInfoBlock(5, 'Unbreak Now')->addInfoBlock(0, 'High')->addInfoBlock(0, 'Normal')->addInfoBlock(12, 'Low')->addInfoBlock(123, 'Wishlist');
$column2 = id(new PHUIInfoPanelView())->setHeader($header2)->setColumns(3)->addInfoBlock(3, 'Needs Triage')->addInfoBlock(5, 'Unbreak Now')->addInfoBlock(0, 'High')->addInfoBlock(0, 'Normal')->addInfoBlock(12, 'Low')->addInfoBlock(123, 'Wishlist');
$column3 = id(new PHUIInfoPanelView())->setHeader($header3)->setColumns(3)->addInfoBlock(3, 'Needs Triage')->addInfoBlock(5, 'Unbreak Now')->addInfoBlock(0, 'High')->addInfoBlock(0, 'Normal')->addInfoBlock(12, 'Low')->addInfoBlock(123, 'Wishlist');
$column4 = id(new PHUIInfoPanelView())->setHeader($header4)->setColumns(3)->setProgress(90)->addInfoBlock(3, 'Needs Triage')->addInfoBlock(5, 'Unbreak Now')->addInfoBlock(0, 'High')->addInfoBlock(0, 'Normal')->addInfoBlock(0, 'Wishlist');
$column5 = id(new PHUIInfoPanelView())->setHeader($header5)->setColumns(2)->setProgress(25)->addInfoBlock(3, 'Needs Triage')->addInfoBlock(5, 'Unbreak Now')->addInfoBlock(0, 'High')->addInfoBlock(0, 'Normal');
$column6 = id(new PHUIInfoPanelView())->setHeader($header6)->setColumns(2)->setProgress(50)->addInfoBlock(3, 'Needs Triage')->addInfoBlock(5, 'Unbreak Now')->addInfoBlock(0, 'High')->addInfoBlock(0, 'Normal');
$layout1 = id(new AphrontMultiColumnView())->addColumn($column1)->addColumn($column2)->addColumn($column3)->setFluidLayout(true);
$layout2 = id(new AphrontMultiColumnView())->addColumn($column4)->addColumn($column5)->addColumn($column6)->setFluidLayout(true);
$head1 = id(new PHUIHeaderView())->setHeader(pht('Flagged'));
$head2 = id(new PHUIHeaderView())->setHeader(pht('Sprints'));
$wrap1 = id(new PHUIBoxView())->appendChild($layout1)->addMargin(PHUI::MARGIN_LARGE_BOTTOM);
$wrap2 = id(new PHUIBoxView())->appendChild($layout2)->addMargin(PHUI::MARGIN_LARGE_BOTTOM);
return phutil_tag('div', array(), array($head1, $wrap1, $head2, $wrap2));
}
示例11: buildDefaultTransformation
private function buildDefaultTransformation(PhabricatorFile $file)
{
static $regexps = array('@application/zip@' => 'zip', '@image/@' => 'image', '@application/pdf@' => 'pdf', '@.*@' => 'default');
$type = $file->getMimeType();
$prefix = 'default';
foreach ($regexps as $regexp => $implied_prefix) {
if (preg_match($regexp, $type)) {
$prefix = $implied_prefix;
break;
}
}
switch ($this->transform) {
case 'thumb-160x120':
$suffix = '160x120';
break;
case 'thumb-60x45':
$suffix = '60x45';
break;
default:
throw new Exception("Unsupported transformation type!");
}
$path = celerity_get_resource_uri("/rsrc/image/icon/fatcow/thumbnails/{$prefix}{$suffix}.png");
return id(new AphrontRedirectResponse())->setURI($path);
}
示例12: getIconURI
public function getIconURI()
{
return celerity_get_resource_uri('/rsrc/image/app/app_differential.png');
}
示例13: getDefaultProfileImageURI
public static function getDefaultProfileImageURI()
{
return celerity_get_resource_uri('/rsrc/image/avatar.png');
}
示例14: willRenderPage
protected function willRenderPage()
{
parent::willRenderPage();
if (!$this->getRequest()) {
throw new Exception(pht('You must set the %s to render a %s.', 'Request', __CLASS__));
}
$console = $this->getConsole();
require_celerity_resource('phabricator-core-css');
require_celerity_resource('phabricator-zindex-css');
require_celerity_resource('phui-button-css');
require_celerity_resource('phui-spacing-css');
require_celerity_resource('phui-form-css');
require_celerity_resource('phabricator-standard-page-view');
require_celerity_resource('conpherence-durable-column-view');
require_celerity_resource('font-lato');
require_celerity_resource('font-roboto-slab');
Javelin::initBehavior('workflow', array());
$request = $this->getRequest();
$user = null;
if ($request) {
$user = $request->getUser();
}
if ($user) {
$default_img_uri = celerity_get_resource_uri('rsrc/image/icon/fatcow/document_black.png');
$download_form = phabricator_form($user, array('action' => '#', 'method' => 'POST', 'class' => 'lightbox-download-form', 'sigil' => 'download'), phutil_tag('button', array(), pht('Download')));
Javelin::initBehavior('lightbox-attachments', array('defaultImageUri' => $default_img_uri, 'downloadForm' => $download_form));
}
Javelin::initBehavior('aphront-form-disable-on-submit');
Javelin::initBehavior('toggle-class', array());
Javelin::initBehavior('history-install');
Javelin::initBehavior('phabricator-gesture');
$current_token = null;
if ($user) {
$current_token = $user->getCSRFToken();
}
Javelin::initBehavior('refresh-csrf', array('tokenName' => AphrontRequest::getCSRFTokenName(), 'header' => AphrontRequest::getCSRFHeaderName(), 'current' => $current_token));
Javelin::initBehavior('device');
Javelin::initBehavior('high-security-warning', $this->getHighSecurityWarningConfig());
if ($console) {
require_celerity_resource('aphront-dark-console-css');
$headers = array();
if (DarkConsoleXHProfPluginAPI::isProfilerStarted()) {
$headers[DarkConsoleXHProfPluginAPI::getProfilerHeader()] = 'page';
}
if (DarkConsoleServicesPlugin::isQueryAnalyzerRequested()) {
$headers[DarkConsoleServicesPlugin::getQueryAnalyzerHeader()] = true;
}
Javelin::initBehavior('dark-console', $this->getConsoleConfig());
// Change this to initBehavior when there is some behavior to initialize
require_celerity_resource('javelin-behavior-error-log');
}
if ($user) {
$viewer = $user;
} else {
$viewer = new PhabricatorUser();
}
$menu = id(new PhabricatorMainMenuView())->setUser($viewer);
if ($this->getController()) {
$menu->setController($this->getController());
}
if ($this->getApplicationMenu()) {
$menu->setApplicationMenu($this->getApplicationMenu());
}
$this->menuContent = $menu->render();
}
示例15: postLink
private function postLink($account, $jira_key)
{
$provider = $this->getProvider();
$object = $this->getStoryObject();
$publisher = $this->getPublisher();
$icon_uri = celerity_get_resource_uri('rsrc/favicons/favicon-16x16.png');
$provider->newJIRAFuture($account, 'rest/api/2/issue/' . $jira_key . '/remotelink', 'POST', array('globalId' => $object->getPHID(), 'application' => array('type' => 'com.phacility.phabricator', 'name' => 'Phabricator'), 'relationship' => 'implemented in', 'object' => array('url' => $publisher->getObjectURI($object), 'title' => $publisher->getObjectTitle($object), 'icon' => array('url16x16' => $icon_uri, 'title' => 'Phabricator'), 'status' => array('resolved' => $publisher->isObjectClosed($object)))))->resolveJSON();
}