当前位置: 首页>>代码示例>>PHP>>正文


PHP require_celerity_resource函数代码示例

本文整理汇总了PHP中require_celerity_resource函数的典型用法代码示例。如果您正苦于以下问题:PHP require_celerity_resource函数的具体用法?PHP require_celerity_resource怎么用?PHP require_celerity_resource使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了require_celerity_resource函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getTagContent

 protected function getTagContent()
 {
     require_celerity_resource('phui-two-column-view-css');
     $main = phutil_tag('div', array('class' => 'phui-main-column'), $this->mainColumn);
     $side = phutil_tag('div', array('class' => 'phui-side-column'), $this->sideColumn);
     return phutil_tag_div('phui-two-column-row', array($main, $side));
 }
开发者ID:patelhardik,项目名称:phabricator,代码行数:7,代码来源:PHUITwoColumnView.php

示例2: render

 public function render()
 {
     require_celerity_resource('differential-core-view-css');
     require_celerity_resource('differential-revision-detail-css');
     $revision = $this->revision;
     $rows = array();
     foreach ($this->auxiliaryFields as $field) {
         $value = $field->renderValueForRevisionView();
         if (strlen($value)) {
             $label = $field->renderLabelForRevisionView();
             $rows[] = '<tr>' . '<th>' . $label . '</th>' . '<td>' . $value . '</td>' . '</tr>';
         }
     }
     $properties = '<table class="differential-revision-properties">' . implode("\n", $rows) . '</table>';
     $actions = array();
     foreach ($this->actions as $action) {
         $obj = new AphrontHeadsupActionView();
         $obj->setName($action['name']);
         $obj->setURI(idx($action, 'href'));
         $obj->setWorkflow(idx($action, 'sigil') == 'workflow');
         $obj->setClass(idx($action, 'class'));
         $obj->setInstant(idx($action, 'instant'));
         $obj->setUser($this->user);
         $actions[] = $obj;
     }
     $action_list = new AphrontHeadsupActionListView();
     $action_list->setActions($actions);
     return '<div class="differential-revision-detail differential-panel">' . $action_list->render() . '<div class="differential-keyboard-shortcuts">' . id(new AphrontKeyboardShortcutsAvailableView())->render() . '</div>' . '<div class="differential-revision-detail-core">' . '<h1>' . '<span class="aphront-headsup-object-name">' . phutil_escape_html('D' . $revision->getID()) . '</span>' . ' ' . phutil_escape_html($revision->getTitle()) . '</h1>' . $properties . '</div>' . '<div style="clear: both;"></div>' . '</div>';
 }
开发者ID:netcomtec,项目名称:phabricator,代码行数:29,代码来源:DifferentialRevisionDetailView.php

示例3: processRequest

 public function processRequest()
 {
     $request = $this->getRequest();
     $user = $request->getUser();
     $timer = id(new PhabricatorTimer())->load($this->id);
     if (!$timer) {
         return new Aphront404Response();
     }
     require_celerity_resource('phabricator-countdown-css');
     $chrome_visible = $request->getBool('chrome', true);
     $chrome_new = $chrome_visible ? false : null;
     $chrome_link = phutil_render_tag('a', array('href' => $request->getRequestURI()->alter('chrome', $chrome_new), 'class' => 'phabricator-timer-chrome-link'), $chrome_visible ? 'Disable Chrome' : 'Enable Chrome');
     $content = '<div class="phabricator-timer">
     <h1 class="phabricator-timer-header">' . phutil_escape_html($timer->getTitle()) . ' &middot; ' . phabricator_datetime($timer->getDatePoint(), $user) . '</h1>
     <div class="phabricator-timer-pane">
       <table class="phabricator-timer-table">
         <tr>
           <th>Days</th>
           <th>Hours</th>
           <th>Minutes</th>
           <th>Seconds</th>
         </tr>
         <tr>
           <td id="phabricator-timer-days"></td>
           <td id="phabricator-timer-hours"></td>
           <td id="phabricator-timer-minutes"></td>
           <td id="phabricator-timer-seconds"></td>
       </table>
     </div>' . $chrome_link . '</div>';
     Javelin::initBehavior('countdown-timer', array('timestamp' => $timer->getDatepoint()));
     $panel = $content;
     return $this->buildStandardPageResponse($panel, array('title' => 'Countdown: ' . $timer->getTitle(), 'chrome' => $chrome_visible));
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:33,代码来源:PhabricatorCountdownViewController.php

示例4: renderInput

 protected function renderInput()
 {
     $drop_id = celerity_generate_unique_node_id();
     Javelin::initBehavior('conpherence-drag-and-drop-photo', array('target' => $drop_id, 'form_pane' => 'conpherence-form', 'upload_uri' => '/file/dropupload/', 'activated_class' => 'conpherence-dialogue-upload-photo'));
     require_celerity_resource('conpherence-update-css');
     return phutil_tag('div', array('id' => $drop_id, 'class' => 'conpherence-dialogue-drag-photo'), pht('Drag and drop an image here to upload it.'));
 }
开发者ID:pugong,项目名称:phabricator,代码行数:7,代码来源:ConpherenceFormDragAndDropUploadControl.php

示例5: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $id = $request->getURIData('class');
     $classes = id(new PhutilSymbolLoader())->setAncestorClass('PhabricatorUIExample')->loadObjects();
     $classes = msort($classes, 'getName');
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI($this->getApplicationURI('view/')));
     foreach ($classes as $class => $obj) {
         $name = $obj->getName();
         $nav->addFilter($class, $name);
     }
     $selected = $nav->selectFilter($id, head_key($classes));
     $example = $classes[$selected];
     $example->setRequest($this->getRequest());
     $result = $example->renderExample();
     if ($result instanceof AphrontResponse) {
         // This allows examples to generate dialogs, etc., for demonstration.
         return $result;
     }
     require_celerity_resource('phabricator-ui-example-css');
     $crumbs = $this->buildApplicationCrumbs();
     $crumbs->addTextCrumb($example->getName());
     $note = id(new PHUIInfoView())->setTitle(pht('%s (%s)', $example->getName(), get_class($example)))->appendChild($example->getDescription())->setSeverity(PHUIInfoView::SEVERITY_NODATA);
     $nav->appendChild(array($crumbs, $note, $result));
     return $this->buildApplicationPage($nav, array('title' => $example->getName()));
 }
开发者ID:JohnnyEstilles,项目名称:phabricator,代码行数:26,代码来源:PhabricatorUIExampleRenderController.php

示例6: render

 public final function render()
 {
     require_celerity_resource('aphront-error-view-css');
     $errors = $this->errors;
     if ($errors) {
         $list = array();
         foreach ($errors as $error) {
             $list[] = phutil_render_tag('li', array(), phutil_escape_html($error));
         }
         $list = '<ul>' . implode("\n", $list) . '</ul>';
     } else {
         $list = null;
     }
     $title = $this->title;
     if (strlen($title)) {
         $title = '<h1>' . phutil_escape_html($title) . '</h1>';
     } else {
         $title = null;
     }
     $this->severity = nonempty($this->severity, self::SEVERITY_ERROR);
     $this->width = nonempty($this->width, self::WIDTH_DEFAULT);
     $more_classes = array();
     $more_classes[] = 'aphront-error-severity-' . $this->severity;
     $more_classes[] = 'aphront-error-width-' . $this->width;
     $more_classes = implode(' ', $more_classes);
     return phutil_render_tag('div', array('id' => $this->id, 'class' => 'aphront-error-view ' . $more_classes), $title . $this->renderChildren() . $list);
 }
开发者ID:nguyennamtien,项目名称:phabricator,代码行数:27,代码来源:AphrontErrorView.php

示例7: render

 public function render()
 {
     $viewer = $this->getUser();
     if (!$viewer) {
         throw new PhutilInvalidStateException('setUser');
     }
     require_celerity_resource('conpherence-transaction-css');
     $transaction = $this->getConpherenceTransaction();
     switch ($transaction->getTransactionType()) {
         case ConpherenceTransaction::TYPE_DATE_MARKER:
             return javelin_tag('div', array('class' => 'conpherence-transaction-view date-marker', 'sigil' => 'conpherence-transaction-view', 'meta' => array('id' => $transaction->getID() + 0.5)), array(phutil_tag('span', array('class' => 'date'), phabricator_format_local_time($transaction->getDateCreated(), $viewer, 'M jS, Y'))));
             break;
     }
     $info = $this->renderTransactionInfo();
     $actions = $this->renderTransactionActions();
     $image = $this->renderTransactionImage();
     $content = $this->renderTransactionContent();
     $classes = implode(' ', $this->classes);
     $transaction_dom_id = null;
     if ($this->getFullDisplay()) {
         $transaction_dom_id = 'anchor-' . $transaction->getID();
     }
     $header = phutil_tag_div('conpherence-transaction-header grouped', array($actions, $info));
     return javelin_tag('div', array('class' => 'conpherence-transaction-view ' . $classes, 'id' => $transaction_dom_id, 'sigil' => 'conpherence-transaction-view', 'meta' => array('id' => $transaction->getID())), array($image, phutil_tag_div('conpherence-transaction-detail grouped', array($header, $content))));
 }
开发者ID:endlessm,项目名称:phabricator,代码行数:25,代码来源:ConpherenceTransactionView.php

示例8: render

 public function render()
 {
     if (empty($this->user)) {
         throw new Exception("Call setUser() before render()!");
     }
     $days = $this->getDatesInMonth();
     require_celerity_resource('aphront-calendar-view-css');
     $first = reset($days);
     $empty = $first->format('w');
     $markup = array();
     for ($ii = 0; $ii < $empty; $ii++) {
         $markup[] = null;
     }
     foreach ($days as $day) {
         $markup[] = '<div class="aphront-calendar-day-of-month">' . $day->format('j') . '</div>';
     }
     $table = array();
     $rows = array_chunk($markup, 7);
     foreach ($rows as $row) {
         $table[] = '<tr>';
         while (count($row) < 7) {
             $row[] = null;
         }
         foreach ($row as $cell) {
             $table[] = '<td>' . $cell . '</td>';
         }
         $table[] = '</tr>';
     }
     $table = '<table class="aphront-calendar-view">' . '<tr class="aphront-calendar-month-year-header">' . '<th colspan="7">' . $first->format('F Y') . '</th>' . '</tr>' . '<tr class="aphront-calendar-day-of-week-header">' . '<th>Sun</th>' . '<th>Mon</th>' . '<th>Tue</th>' . '<th>Wed</th>' . '<th>Thu</th>' . '<th>Fri</th>' . '<th>Sat</th>' . '</tr>' . implode("\n", $table) . '</table>';
     return $table;
 }
开发者ID:hwang36,项目名称:phabricator,代码行数:31,代码来源:AphrontCalendarMonthView.php

示例9: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $viewer = $request->getViewer();
     $id = $request->getURIData('id');
     $paste = id(new PhabricatorPasteQuery())->setViewer($viewer)->withIDs(array($id))->needContent(true)->executeOne();
     if (!$paste) {
         return new Aphront404Response();
     }
     $file = id(new PhabricatorFileQuery())->setViewer($viewer)->withPHIDs(array($paste->getFilePHID()))->executeOne();
     if (!$file) {
         return new Aphront400Response();
     }
     $forks = id(new PhabricatorPasteQuery())->setViewer($viewer)->withParentPHIDs(array($paste->getPHID()))->execute();
     $fork_phids = mpull($forks, 'getPHID');
     $header = $this->buildHeaderView($paste);
     $actions = $this->buildActionView($viewer, $paste, $file);
     $properties = $this->buildPropertyView($paste, $fork_phids, $actions);
     $object_box = id(new PHUIObjectBoxView())->setHeader($header)->addPropertyList($properties);
     $source_code = $this->buildSourceCodeView($paste, null, $this->highlightMap);
     require_celerity_resource('paste-css');
     $source_code = phutil_tag('div', array('class' => 'container-of-paste'), $source_code);
     $crumbs = $this->buildApplicationCrumbs($this->buildSideNavView())->addTextCrumb('P' . $paste->getID(), '/P' . $paste->getID());
     $timeline = $this->buildTransactionTimeline($paste, new PhabricatorPasteTransactionQuery());
     $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
     $add_comment_header = $is_serious ? pht('Add Comment') : pht('Eat Paste');
     $draft = PhabricatorDraft::newFromUserAndKey($viewer, $paste->getPHID());
     $add_comment_form = id(new PhabricatorApplicationTransactionCommentView())->setUser($viewer)->setObjectPHID($paste->getPHID())->setDraft($draft)->setHeaderText($add_comment_header)->setAction($this->getApplicationURI('/comment/' . $paste->getID() . '/'))->setSubmitButtonName(pht('Add Comment'));
     return $this->buildApplicationPage(array($crumbs, $object_box, $source_code, $timeline, $add_comment_form), array('title' => $paste->getFullName(), 'pageObjects' => array($paste->getPHID())));
 }
开发者ID:Robert-Xie,项目名称:phabricator,代码行数:29,代码来源:PhabricatorPasteViewController.php

示例10: render

 public function render()
 {
     $view = new AphrontNullView();
     $view->appendChild($this->items);
     require_celerity_resource('aphront-side-nav-view-css');
     return '<table class="aphront-side-nav-view">' . '<tr>' . '<th class="aphront-side-nav-navigation">' . $view->render() . '</th>' . '<td class="aphront-side-nav-content">' . $this->renderChildren() . '</td>' . '</tr>' . '</table>';
 }
开发者ID:nguyennamtien,项目名称:phabricator,代码行数:7,代码来源:AphrontSideNavView.php

示例11: processRequest

 public function processRequest()
 {
     $drequest = $this->diffusionRequest;
     $content = array();
     $diff_query = DiffusionDiffQuery::newFromDiffusionRequest($drequest);
     $changeset = $diff_query->loadChangeset();
     if (!$changeset) {
         // TODO: Refine this.
         return new Aphront404Response();
     }
     $callsign = $drequest->getRepository()->getCallsign();
     $changesets = array(0 => $changeset);
     $changeset_view = new DifferentialChangesetListView();
     $changeset_view->setChangesets($changesets);
     $changeset_view->setVisibleChangesets($changesets);
     $changeset_view->setRenderingReferences(array(0 => $diff_query->getRenderingReference()));
     $raw_params = array('action' => 'browse', 'params' => array('view' => 'raw'));
     $right_uri = $drequest->generateURI($raw_params);
     $raw_params['params']['before'] = $drequest->getRawCommit();
     $left_uri = $drequest->generateURI($raw_params);
     $changeset_view->setRawFileURIs($left_uri, $right_uri);
     $changeset_view->setRenderURI('/diffusion/' . $callsign . '/diff/');
     $changeset_view->setWhitespace(DifferentialChangesetParser::WHITESPACE_SHOW_ALL);
     $changeset_view->setUser($this->getRequest()->getUser());
     $content[] = $this->buildCrumbs(array('branch' => true, 'path' => true, 'view' => 'change'));
     // TODO: This is pretty awkward, unify the CSS between Diffusion and
     // Differential better.
     require_celerity_resource('differential-core-view-css');
     $content[] = '<div class="differential-primary-pane">' . $changeset_view->render() . '</div>';
     $nav = $this->buildSideNav('change', true);
     $nav->appendChild($content);
     return $this->buildStandardPageResponse($nav, array('title' => 'Change'));
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:33,代码来源:DiffusionChangeController.php

示例12: render

 public function render()
 {
     require_celerity_resource('ponder-core-view-css');
     require_celerity_resource('ponder-feed-view-css');
     $user = $this->user;
     $qoffset = $this->questionoffset;
     $aoffset = $this->answeroffset;
     $questions = $this->questions;
     $answers = $this->answers;
     $handles = $this->handles;
     $uri = $this->uri;
     $qparam = $this->qparam;
     $aparam = $this->aparam;
     $pagesize = $this->pagesize;
     // display questions
     $question_panel = id(new AphrontPanelView())->setHeader("Your Questions")->addClass("ponder-panel");
     $question_panel->addButton(phutil_render_tag('a', array('href' => "/ponder/question/ask/", 'class' => 'green button'), "Ask a question"));
     $qpagebuttons = id(new AphrontPagerView())->setPageSize($pagesize)->setOffset($qoffset)->setURI($uri->alter($aparam, $aoffset), $qparam);
     $questions = $qpagebuttons->sliceResults($questions);
     foreach ($questions as $question) {
         $cur = id(new PonderQuestionSummaryView())->setUser($user)->setQuestion($question)->setHandles($handles);
         $question_panel->appendChild($cur);
     }
     $question_panel->appendChild($qpagebuttons);
     // display answers
     $answer_panel = id(new AphrontPanelView())->setHeader("Your Answers")->addClass("ponder-panel")->appendChild(phutil_render_tag('a', array('id' => 'answers'), ""));
     $apagebuttons = id(new AphrontPagerView())->setPageSize($pagesize)->setOffset($aoffset)->setURI($uri->alter($qparam, $qoffset)->setFragment("answers"), $aparam);
     $answers = $apagebuttons->sliceResults($answers);
     foreach ($answers as $answer) {
         $cur = id(new PonderAnswerSummaryView())->setUser($user)->setAnswer($answer)->setHandles($handles);
         $answer_panel->appendChild($cur);
     }
     $answer_panel->appendChild($apagebuttons);
     return $question_panel->render() . $answer_panel->render();
 }
开发者ID:neoxen,项目名称:phabricator,代码行数:35,代码来源:PonderUserProfileView.php

示例13: render

 public function render()
 {
     $handle = $this->handle;
     $type_name = nonempty($handle->getTypeName(), 'Document');
     require_celerity_resource('phabricator-search-results-css');
     $link = phutil_render_tag('a', array('href' => $handle->getURI()), PhabricatorEnv::getProductionURI($handle->getURI()));
     $img = $handle->getImageURI();
     if ($img) {
         $img = phutil_render_tag('div', array('class' => 'result-image', 'style' => "background-image: url('{$img}');"), '');
     }
     switch ($handle->getType()) {
         case PhabricatorPHIDConstants::PHID_TYPE_CMIT:
             $object_name = $handle->getName();
             if ($this->object) {
                 $data = $this->object->getCommitData();
                 $summary = $data->getSummary();
                 if (strlen($summary)) {
                     $object_name = $handle->getName() . ': ' . $data->getSummary();
                 }
             }
             break;
         default:
             $object_name = $handle->getFullName();
             break;
     }
     return '<div class="phabricator-search-result">' . $img . '<div class="result-desc">' . phutil_render_tag('a', array('class' => 'result-name', 'href' => $handle->getURI()), $this->emboldenQuery($object_name)) . '<div class="result-type">' . $type_name . ' &middot; ' . $link . '</div>' . '</div>' . '<div style="clear: both;"></div>' . '</div>';
 }
开发者ID:ramons03,项目名称:phabricator,代码行数:27,代码来源:PhabricatorSearchResultView.php

示例14: processRequest

 public function processRequest()
 {
     $classes = id(new PhutilSymbolLoader())->setAncestorClass('PhabricatorUIExample')->selectAndLoadSymbols();
     $classes = ipull($classes, 'name', 'name');
     $selected = null;
     foreach ($classes as $class => $ignored) {
         $classes[$class] = newv($class, array());
         if ($this->class == $classes[$class]->getName()) {
             $selected = $class;
         }
     }
     if (!$selected) {
         reset($classes);
         $selected = key($classes);
     }
     $nav = new AphrontSideNavView();
     foreach ($classes as $class => $obj) {
         $name = $obj->getName();
         $nav->addNavItem(phutil_render_tag('a', array('href' => '/uiexample/view/' . $name . '/', 'class' => $selected == $class ? 'aphront-side-nav-selected' : null), phutil_escape_html($obj->getName())));
     }
     require_celerity_resource('phabricator-ui-example-css');
     $example = $classes[$selected];
     $example->setRequest($this->getRequest());
     $nav->appendChild('<div class="phabricator-ui-example-header">' . '<h1 class="phabricator-ui-example-name">' . phutil_escape_html($example->getName()) . ' (' . get_class($example) . ')' . '</h1>' . '<p class="phabricator-ui-example-description">' . $example->getDescription() . '</p>' . '</div>');
     $nav->appendChild($example->renderExample());
     return $this->buildStandardPageResponse($nav, array('title' => 'UI Example'));
 }
开发者ID:nguyennamtien,项目名称:phabricator,代码行数:27,代码来源:PhabricatorUIExampleRenderController.php

示例15: getTagContent

 protected function getTagContent()
 {
     if ($this->previewURI === null) {
         throw new PhutilInvalidStateException('setPreviewURI');
     }
     if ($this->controlID === null) {
         throw new PhutilInvalidStateException('setControlID');
     }
     $preview_id = celerity_generate_unique_node_id();
     require_celerity_resource('phui-remarkup-preview-css');
     Javelin::initBehavior('remarkup-preview', array('previewID' => $preview_id, 'controlID' => $this->controlID, 'uri' => $this->previewURI));
     $loading = phutil_tag('div', array('class' => 'phui-preview-loading-text'), nonempty($this->loadingText, pht('Loading preview...')));
     $preview = phutil_tag('div', array('id' => $preview_id, 'class' => 'phabricator-remarkup phui-preview-body'), $loading);
     if (!$this->previewType) {
         $header = null;
         if ($this->header) {
             $header = phutil_tag('div', array('class' => 'phui-preview-header'), $this->header);
         }
         $content = array($header, $preview);
     } else {
         if ($this->previewType == self::DOCUMENT) {
             $header = id(new PHUIHeaderView())->setHeader(pht('%s (Preview)', $this->header));
             $content = id(new PHUIDocumentViewPro())->setHeader($header)->appendChild($preview);
         }
     }
     return id(new PHUIObjectBoxView())->appendChild($content)->setCollapsed(true);
 }
开发者ID:pugong,项目名称:phabricator,代码行数:27,代码来源:PHUIRemarkupPreviewPanel.php


注:本文中的require_celerity_resource函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。