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


PHP phutil_tag_div函数代码示例

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


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

示例1: buildCommentForm

 private function buildCommentForm(PhamePost $post)
 {
     $viewer = $this->getViewer();
     $draft = PhabricatorDraft::newFromUserAndKey($viewer, $post->getPHID());
     $box = id(new PhabricatorApplicationTransactionCommentView())->setUser($viewer)->setObjectPHID($post->getPHID())->setDraft($draft)->setHeaderText(pht('Add Comment'))->setAction($this->getApplicationURI('post/comment/' . $post->getID() . '/'))->setSubmitButtonName(pht('Add Comment'));
     return phutil_tag_div('phui-document-view-pro-box', $box);
 }
开发者ID:miaokuan,项目名称:phabricator,代码行数:7,代码来源:PhamePostViewController.php

示例2: renderExample

 public function renderExample()
 {
     $view = id(new AphrontMultiColumnView())->setFluidLayout(true)->setBorder(true);
     /* Action Panels */
     $panel1 = id(new PHUIActionPanelView())->setFontIcon('fa-book')->setHeader(pht('Read Documentation'))->setHref('#')->setSubHeader(pht('Reading is a common way to learn about things.'))->setStatus(pht('Carrots help you see better.'))->setState(PHUIActionPanelView::STATE_NONE);
     $view->addColumn($panel1);
     $panel2 = id(new PHUIActionPanelView())->setFontIcon('fa-server')->setHeader(pht('Launch Instance'))->setHref('#')->setSubHeader(pht("Maybe this is what you're likely here for."))->setStatus(pht('You have no instances.'))->setState(PHUIActionPanelView::STATE_ERROR);
     $view->addColumn($panel2);
     $panel3 = id(new PHUIActionPanelView())->setFontIcon('fa-group')->setHeader(pht('Code with Friends'))->setHref('#')->setSubHeader(pht('Writing code is much more fun with friends!'))->setStatus(pht('You need more friends.'))->setState(PHUIActionPanelView::STATE_WARN);
     $view->addColumn($panel3);
     $panel4 = id(new PHUIActionPanelView())->setFontIcon('fa-cloud-download')->setHeader(pht('Download Data'))->setHref('#')->setSubHeader(pht('Need a backup of all your kitten memes?'))->setStatus(pht('Building Download'))->setState(PHUIActionPanelView::STATE_PROGRESS);
     $view->addColumn($panel4);
     $view2 = id(new AphrontMultiColumnView())->setFluidLayout(true)->setBorder(true);
     /* Action Panels */
     $panel1 = id(new PHUIActionPanelView())->setFontIcon('fa-credit-card')->setHeader(pht('Account Balance'))->setHref('#')->setSubHeader(pht('You were last billed $2,245.12 on Dec 12, 2014.'))->setStatus(pht('Account in good standing.'))->setState(PHUIActionPanelView::STATE_SUCCESS);
     $view2->addColumn($panel1);
     $panel2 = id(new PHUIActionPanelView())->setBigText('148')->setHeader(pht('Instance Users'))->setHref('#')->setSubHeader(pht('You currently have 140 active and 8 inactive accounts'));
     $view2->addColumn($panel2);
     $panel3 = id(new PHUIActionPanelView())->setBigText('March 12')->setHeader(pht('Next Maintenance Window'))->setHref('#')->setSubHeader(pht('At 6:00 am PST, Phacility will conduct weekly maintenence.'))->setStatus(pht('Very Important!'))->setState(PHUIActionPanelView::STATE_ERROR);
     $view2->addColumn($panel3);
     $panel4 = id(new PHUIActionPanelView())->setBigText('1,113,377')->setHeader(pht('Lines of Code'))->setHref('#')->setSubHeader(pht('Your team has reviewed lots of code!'));
     $view2->addColumn($panel4);
     $view = phutil_tag_div('mlb', $view);
     return phutil_tag_div('ml', array($view, $view2));
 }
开发者ID:fengshao0907,项目名称:phabricator,代码行数:25,代码来源:PHUIActionPanelExample.php

示例3: processRequest

 public function processRequest()
 {
     require_celerity_resource('phabricator-profile-css');
     $viewer = $this->getRequest()->getUser();
     $user = id(new PhabricatorPeopleQuery())->setViewer($viewer)->withUsernames(array($this->username))->needProfileImage(true)->executeOne();
     if (!$user) {
         return new Aphront404Response();
     }
     $query = new PhabricatorFeedQuery();
     $query->setFilterPHIDs(array($user->getPHID()));
     $query->setLimit(100);
     $query->setViewer($viewer);
     $stories = $query->execute();
     $builder = new PhabricatorFeedBuilder($stories);
     $builder->setUser($viewer);
     $builder->setShowHovercards(true);
     $builder->setNoDataString(pht('To begin on such a grand journey, requires but just a single step.'));
     $view = $builder->buildView();
     $feed = phutil_tag_div('phabricator-project-feed', $view->render());
     $name = $user->getUsername();
     $nav = $this->buildIconNavView($user);
     $nav->selectFilter("{$name}/feed/");
     $nav->appendChild($feed);
     return $this->buildApplicationPage($nav, array('title' => pht('Feed')));
 }
开发者ID:hrb518,项目名称:phabricator,代码行数:25,代码来源:PhabricatorPeopleFeedController.php

示例4: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $user = $request->getUser();
     $id = $request->getURIData('id');
     if ($id) {
         $post = id(new PhamePostQuery())->setViewer($user)->withIDs(array($id))->requireCapabilities(array(PhabricatorPolicyCapability::CAN_EDIT))->executeOne();
         if (!$post) {
             return new Aphront404Response();
         }
         $cancel_uri = $this->getApplicationURI('/post/view/' . $id . '/');
         $submit_button = pht('Save Changes');
         $page_title = pht('Edit Post');
     } else {
         $blog = id(new PhameBlogQuery())->setViewer($user)->withIDs(array($request->getInt('blog')))->requireCapabilities(array(PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_JOIN))->executeOne();
         if (!$blog) {
             return new Aphront404Response();
         }
         $post = PhamePost::initializePost($user, $blog);
         $cancel_uri = $this->getApplicationURI('/blog/view/' . $blog->getID() . '/');
         $submit_button = pht('Save Draft');
         $page_title = pht('Create Post');
     }
     $title = $post->getTitle();
     $phame_title = $post->getPhameTitle();
     $body = $post->getBody();
     $comments_widget = $post->getCommentsWidget();
     $e_title = true;
     $e_phame_title = true;
     $validation_exception = null;
     if ($request->isFormPost()) {
         $title = $request->getStr('title');
         $phame_title = $request->getStr('phame_title');
         $phame_title = PhabricatorSlug::normalize($phame_title);
         $body = $request->getStr('body');
         $comments_widget = $request->getStr('comments_widget');
         $xactions = array(id(new PhamePostTransaction())->setTransactionType(PhamePostTransaction::TYPE_TITLE)->setNewValue($title), id(new PhamePostTransaction())->setTransactionType(PhamePostTransaction::TYPE_PHAME_TITLE)->setNewValue($phame_title), id(new PhamePostTransaction())->setTransactionType(PhamePostTransaction::TYPE_BODY)->setNewValue($body), id(new PhamePostTransaction())->setTransactionType(PhamePostTransaction::TYPE_COMMENTS_WIDGET)->setNewValue($comments_widget));
         $editor = id(new PhamePostEditor())->setActor($user)->setContentSourceFromRequest($request)->setContinueOnNoEffect(true);
         try {
             $editor->applyTransactions($post, $xactions);
             $uri = $this->getApplicationURI('/post/view/' . $post->getID() . '/');
             return id(new AphrontRedirectResponse())->setURI($uri);
         } catch (PhabricatorApplicationTransactionValidationException $ex) {
             $validation_exception = $ex;
             $e_title = $validation_exception->getShortMessage(PhamePostTransaction::TYPE_TITLE);
             $e_phame_title = $validation_exception->getShortMessage(PhamePostTransaction::TYPE_PHAME_TITLE);
         }
     }
     $handle = id(new PhabricatorHandleQuery())->setViewer($user)->withPHIDs(array($post->getBlogPHID()))->executeOne();
     $form = id(new AphrontFormView())->setUser($user)->addHiddenInput('blog', $request->getInt('blog'))->appendChild(id(new AphrontFormMarkupControl())->setLabel(pht('Blog'))->setValue($handle->renderLink()))->appendChild(id(new AphrontFormTextControl())->setLabel(pht('Title'))->setName('title')->setValue($title)->setID('post-title')->setError($e_title))->appendChild(id(new AphrontFormTextControl())->setLabel(pht('Phame Title'))->setName('phame_title')->setValue(rtrim($phame_title, '/'))->setID('post-phame-title')->setCaption(pht('Up to 64 alphanumeric characters ' . 'with underscores for spaces. ' . 'Formatting is enforced.'))->setError($e_phame_title))->appendChild(id(new PhabricatorRemarkupControl())->setLabel(pht('Body'))->setName('body')->setValue($body)->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL)->setID('post-body')->setUser($user)->setDisableMacros(true))->appendChild(id(new AphrontFormSelectControl())->setLabel(pht('Comments Widget'))->setName('comments_widget')->setvalue($comments_widget)->setOptions($post->getCommentsWidgetOptionsForSelect()))->appendChild(id(new AphrontFormSubmitControl())->addCancelButton($cancel_uri)->setValue($submit_button));
     $loading = phutil_tag_div('aphront-panel-preview-loading-text', pht('Loading preview...'));
     $preview_panel = phutil_tag_div('aphront-panel-preview', array(phutil_tag_div('phame-post-preview-header', pht('Post Preview')), phutil_tag('div', array('id' => 'post-preview'), $loading)));
     require_celerity_resource('phame-css');
     Javelin::initBehavior('phame-post-preview', array('preview' => 'post-preview', 'body' => 'post-body', 'title' => 'post-title', 'phame_title' => 'post-phame-title', 'uri' => '/phame/post/preview/'));
     $form_box = id(new PHUIObjectBoxView())->setHeaderText($page_title)->setValidationException($validation_exception)->setForm($form);
     $crumbs = $this->buildApplicationCrumbs();
     $crumbs->addTextCrumb($page_title, $this->getApplicationURI('/post/view/' . $id . '/'));
     $nav = $this->renderSideNavFilterView(null);
     $nav->appendChild(array($crumbs, $form_box, $preview_panel));
     return $this->buildApplicationPage($nav, array('title' => $page_title));
 }
开发者ID:hrb518,项目名称:phabricator,代码行数:60,代码来源:PhamePostEditController.php

示例5: processRequest

 public function processRequest()
 {
     $request = $this->getRequest();
     $user = $request->getUser();
     $query = id(new PhabricatorNotificationQuery())->setViewer($user)->withUserPHIDs(array($user->getPHID()))->setLimit(15);
     $stories = $query->execute();
     $clear_ui_class = 'phabricator-notification-clear-all';
     $clear_uri = id(new PhutilURI('/notification/clear/'));
     if ($stories) {
         $builder = new PhabricatorNotificationBuilder($stories);
         $notifications_view = $builder->buildView();
         $content = $notifications_view->render();
         $clear_uri->setQueryParam('chronoKey', head($stories)->getChronologicalKey());
     } else {
         $content = phutil_tag_div('phabricator-notification no-notifications', pht('You have no notifications.'));
         $clear_ui_class .= ' disabled';
     }
     $clear_ui = javelin_tag('a', array('sigil' => 'workflow', 'href' => (string) $clear_uri, 'class' => $clear_ui_class), pht('Mark All Read'));
     $notifications_link = phutil_tag('a', array('href' => '/notification/'), pht('Notifications'));
     if (PhabricatorEnv::getEnvConfig('notification.enabled')) {
         $connection_status = new PhabricatorNotificationStatusView();
     } else {
         $connection_status = phutil_tag('a', array('href' => PhabricatorEnv::getDoclink('Notifications User Guide: Setup and Configuration')), pht('Notification Server not enabled.'));
     }
     $connection_ui = phutil_tag('div', array('class' => 'phabricator-notification-footer'), $connection_status);
     $header = phutil_tag('div', array('class' => 'phabricator-notification-header'), array($notifications_link, $clear_ui));
     $content = hsprintf('%s%s%s', $header, $content, $connection_ui);
     $unread_count = id(new PhabricatorFeedStoryNotification())->countUnread($user);
     $json = array('content' => $content, 'number' => (int) $unread_count);
     return id(new AphrontAjaxResponse())->setContent($json);
 }
开发者ID:hrb518,项目名称:phabricator,代码行数:31,代码来源:PhabricatorNotificationPanelController.php

示例6: render

 public function render()
 {
     if ($this->header !== null) {
         $header = phutil_tag('h1', array(), $this->header);
     } else {
         $header = null;
     }
     if ($this->caption !== null) {
         $caption = phutil_tag_div('aphront-panel-view-caption', $this->caption);
     } else {
         $caption = null;
     }
     $buttons = null;
     if ($this->buttons) {
         $buttons = phutil_tag_div('aphront-panel-view-buttons', phutil_implode_html(' ', $this->buttons));
     }
     $header_elements = phutil_tag_div('aphront-panel-header', array($buttons, $header, $caption));
     $table = phutil_implode_html('', $this->renderChildren());
     require_celerity_resource('aphront-panel-view-css');
     $classes = $this->classes;
     $classes[] = 'aphront-panel-view';
     if ($this->width) {
         $classes[] = 'aphront-panel-width-' . $this->width;
     }
     return phutil_tag('div', array('class' => implode(' ', $classes), 'id' => $this->id), array($header_elements, $table));
 }
开发者ID:denghp,项目名称:phabricator,代码行数:26,代码来源:AphrontPanelView.php

示例7: getTagContent

 protected function getTagContent()
 {
     require_celerity_resource('diviner-shared-css');
     $header = id(new PHUIHeaderView())->setBleedHeader(true)->addClass('diviner-section-header')->setHeader($this->header);
     $content = phutil_tag_div('diviner-section-content', $this->content);
     return array($header, $content);
 }
开发者ID:pugong,项目名称:phabricator,代码行数:7,代码来源:DivinerSectionView.php

示例8: renderResultList

 protected function renderResultList(array $notifications, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($notifications, 'PhabricatorFeedStory');
     $viewer = $this->requireViewer();
     $image = id(new PHUIIconView())->setIconFont('fa-eye-slash');
     $button = id(new PHUIButtonView())->setTag('a')->addSigil('workflow')->setColor(PHUIButtonView::SIMPLE)->setIcon($image)->setText(pht('Mark All Read'));
     switch ($query->getQueryKey()) {
         case 'unread':
             $header = pht('Unread Notifications');
             $no_data = pht('You have no unread notifications.');
             break;
         default:
             $header = pht('Notifications');
             $no_data = pht('You have no notifications.');
             break;
     }
     $clear_uri = id(new PhutilURI('/notification/clear/'));
     if ($notifications) {
         $builder = id(new PhabricatorNotificationBuilder($notifications))->setUser($viewer);
         $view = $builder->buildView();
         $clear_uri->setQueryParam('chronoKey', head($notifications)->getChronologicalKey());
     } else {
         $view = phutil_tag_div('phabricator-notification no-notifications', $no_data);
         $button->setDisabled(true);
     }
     $button->setHref((string) $clear_uri);
     $view = id(new PHUIBoxView())->addPadding(PHUI::PADDING_MEDIUM)->addClass('phabricator-notification-list')->appendChild($view);
     $result = new PhabricatorApplicationSearchResultView();
     $result->addAction($button);
     $result->setContent($view);
     return $result;
 }
开发者ID:patelhardik,项目名称:phabricator,代码行数:32,代码来源:PhabricatorNotificationSearchEngine.php

示例9: renderExample

 public function renderExample()
 {
     $view = id(new AphrontMultiColumnView())->setFluidLayout(true);
     /* Action Panels */
     $panel1 = id(new PHUIActionPanelView())->setIcon('fa-book')->setHeader(pht('Read Documentation'))->setHref('#')->setSubHeader(pht('Reading is a common way to learn about things.'))->setState(PHUIActionPanelView::COLOR_BLUE);
     $view->addColumn($panel1);
     $panel2 = id(new PHUIActionPanelView())->setIcon('fa-server')->setHeader(pht('Launch Instance'))->setHref('#')->setSubHeader(pht("Maybe this is what you're likely here for."))->setState(PHUIActionPanelView::COLOR_RED);
     $view->addColumn($panel2);
     $panel3 = id(new PHUIActionPanelView())->setIcon('fa-group')->setHeader(pht('Code with Friends'))->setHref('#')->setSubHeader(pht('Writing code is much more fun with friends!'))->setState(PHUIActionPanelView::COLOR_YELLOW);
     $view->addColumn($panel3);
     $panel4 = id(new PHUIActionPanelView())->setIcon('fa-cloud-download')->setHeader(pht('Download Data'))->setHref('#')->setSubHeader(pht('Need a backup of all your kitten memes?'))->setState(PHUIActionPanelView::COLOR_PINK);
     $view->addColumn($panel4);
     $view2 = id(new AphrontMultiColumnView())->setFluidLayout(true);
     /* Action Panels */
     $panel1 = id(new PHUIActionPanelView())->setIcon('fa-credit-card')->setHeader(pht('Account Balance'))->setHref('#')->setSubHeader(pht('You were last billed $2,245.12 on Dec 12, 2014.'))->setState(PHUIActionPanelView::COLOR_GREEN);
     $view2->addColumn($panel1);
     $panel2 = id(new PHUIActionPanelView())->setBigText(true)->setHeader(pht('Instance Users'))->setHref('#')->setSubHeader(pht('148'));
     $view2->addColumn($panel2);
     $panel3 = id(new PHUIActionPanelView())->setBigText(true)->setHeader(pht('Next Maintenance Window'))->setHref('#')->setSubHeader(pht('March 12'))->setState(PHUIActionPanelView::COLOR_ORANGE);
     $view2->addColumn($panel3);
     $panel4 = id(new PHUIActionPanelView())->setBigText(true)->setHeader(pht('Lines of Code'))->setHref('#')->setSubHeader(pht('1,113,377'))->setState(PHUIActionPanelView::COLOR_INDIGO);
     $view2->addColumn($panel4);
     $view = phutil_tag_div('mlb', $view);
     return phutil_tag_div('ml', array($view, $view2));
 }
开发者ID:truSense,项目名称:phabricator,代码行数:25,代码来源:PHUIActionPanelExample.php

示例10: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $viewer = $this->getViewer();
     $username = $request->getURIData('username');
     $user = id(new PhabricatorPeopleQuery())->setViewer($viewer)->withUsernames(array($username))->needBadges(true)->needProfileImage(true)->needAvailability(true)->executeOne();
     if (!$user) {
         return new Aphront404Response();
     }
     $this->setUser($user);
     $profile = $user->loadUserProfile();
     $picture = $user->getProfileImageURI();
     $profile_icon = PhabricatorPeopleIconSet::getIconIcon($profile->getIcon());
     $profile_icon = id(new PHUIIconView())->setIcon($profile_icon);
     $profile_title = $profile->getDisplayTitle();
     $header = id(new PHUIHeaderView())->setHeader($user->getFullName())->setSubheader(array($profile_icon, $profile_title))->setImage($picture)->setProfileHeader(true);
     $can_edit = PhabricatorPolicyFilter::hasCapability($viewer, $user, PhabricatorPolicyCapability::CAN_EDIT);
     if ($can_edit) {
         $id = $user->getID();
         $header->setImageEditURL($this->getApplicationURI("picture/{$id}/"));
     }
     $properties = $this->buildPropertyView($user);
     $name = $user->getUsername();
     $feed = $this->buildPeopleFeed($user, $viewer);
     $feed = phutil_tag_div('project-view-feed', $feed);
     $projects = $this->buildProjectsView($user);
     $badges = $this->buildBadgesView($user);
     $columns = id(new PHUITwoColumnView())->addClass('project-view-badges')->setMainColumn(array($properties, $feed))->setSideColumn(array($projects, $badges));
     $nav = $this->getProfileMenu();
     $nav->selectFilter(PhabricatorPeopleProfilePanelEngine::PANEL_PROFILE);
     $crumbs = $this->buildApplicationCrumbs();
     $crumbs->setBorder(true);
     require_celerity_resource('project-view-css');
     $home = phutil_tag('div', array('class' => 'project-view-home'), array($header, $columns));
     return $this->newPage()->setTitle($user->getUsername())->setNavigation($nav)->setCrumbs($crumbs)->appendChild(array($home));
 }
开发者ID:kalsolio,项目名称:phabricator,代码行数:35,代码来源:PhabricatorPeopleProfileViewController.php

示例11: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $viewer = $request->getViewer();
     $engine = new PhabricatorSetupEngine();
     $response = $engine->execute();
     if ($response) {
         return $response;
     }
     $issues = $engine->getIssues();
     $unresolved_count = count($engine->getUnresolvedIssues());
     if ($issues) {
         require_celerity_resource('phabricator-notification-menu-css');
         $items = array();
         foreach ($issues as $issue) {
             $classes = array();
             $classes[] = 'phabricator-notification';
             if ($issue->getIsIgnored()) {
                 $classes[] = 'phabricator-notification-read';
             } else {
                 $classes[] = 'phabricator-notification-unread';
             }
             $uri = '/config/issue/' . $issue->getIssueKey() . '/';
             $title = $issue->getName();
             $summary = $issue->getSummary();
             $items[] = javelin_tag('div', array('class' => implode(' ', $classes), 'sigil' => 'notification', 'meta' => array('href' => $uri)), $title);
         }
         $content = phutil_tag_div('setup-issue-menu', $items);
     } else {
         $content = phutil_tag_div('phabricator-notification no-notifications', pht('You have no unresolved setup issues.'));
     }
     $content = hsprintf('<div class="phabricator-notification-header">%s</div>' . '%s', phutil_tag('a', array('href' => '/config/issue/'), pht('Unresolved Setup Issues')), $content);
     $json = array('content' => $content, 'number' => (int) $unresolved_count);
     return id(new AphrontAjaxResponse())->setContent($json);
 }
开发者ID:NeoArmageddon,项目名称:phabricator,代码行数:34,代码来源:PhabricatorConfigIssuePanelController.php

示例12: 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

示例13: render

 public function render()
 {
     $question = $this->question;
     $viewer = $this->getViewer();
     $authors = mpull($question->getAnswers(), null, 'getAuthorPHID');
     if (isset($authors[$viewer->getPHID()])) {
         $view = id(new PHUIInfoView())->setSeverity(PHUIInfoView::SEVERITY_NOTICE)->setTitle(pht('Already Answered'))->appendChild(pht('You have already answered this question. You can not answer ' . 'twice, but you can edit your existing answer.'));
         return phutil_tag_div('ponder-add-answer-view', $view);
     }
     $info_panel = null;
     if ($question->getStatus() != PonderQuestionStatus::STATUS_OPEN) {
         $info_panel = id(new PHUIInfoView())->setSeverity(PHUIInfoView::SEVERITY_NOTICE)->appendChild(pht('This question has been marked as closed,
          but you can still leave a new answer.'));
     }
     $box_style = null;
     $header = id(new PHUIHeaderView())->setHeader(pht('New Answer'))->addClass('ponder-add-answer-header');
     $form = new AphrontFormView();
     $form->setViewer($viewer)->setAction($this->actionURI)->setWorkflow(true)->addHiddenInput('question_id', $question->getID())->appendChild(id(new PhabricatorRemarkupControl())->setName('answer')->setLabel(pht('Answer'))->setError(true)->setID('answer-content')->setViewer($viewer))->appendChild(id(new AphrontFormSubmitControl())->setValue(pht('Add Answer')));
     if (!$viewer->isLoggedIn()) {
         $login_href = id(new PhutilURI('/auth/start/'))->setQueryParam('next', '/Q' . $question->getID());
         $form = id(new PHUIFormLayoutView())->addClass('login-to-participate')->appendChild(id(new PHUIButtonView())->setTag('a')->setText(pht('Login to Answer'))->setHref((string) $login_href));
     }
     $box = id(new PHUIObjectBoxView())->appendChild($form)->setHeaderText('Answer')->addClass('ponder-add-answer-view');
     if ($info_panel) {
         $box->setInfoView($info_panel);
     }
     return array($header, $box);
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:28,代码来源:PonderAddAnswerView.php

示例14: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $viewer = $request->getViewer();
     $blogs = id(new PhameBlogQuery())->setViewer($viewer)->withStatuses(array(PhameBlog::STATUS_ACTIVE))->needProfileImage(true)->execute();
     $post_list = null;
     if ($blogs) {
         $blog_phids = mpull($blogs, 'getPHID');
         $pager = id(new AphrontCursorPagerView())->readFromRequest($request);
         $posts = id(new PhamePostQuery())->setViewer($viewer)->withBlogPHIDs($blog_phids)->withVisibility(array(PhameConstants::VISIBILITY_PUBLISHED))->setOrder('datePublished')->executeWithCursorPager($pager);
         if ($posts) {
             $post_list = id(new PhamePostListView())->setPosts($posts)->setViewer($viewer)->showBlog(true);
         } else {
             $post_list = id(new PHUIBigInfoView())->setIcon('fa-star')->setTitle('No Visible Posts')->setDescription(pht('There aren\'t any visible blog posts.'));
         }
     } else {
         $create_button = id(new PHUIButtonView())->setTag('a')->setText(pht('Create a Blog'))->setHref('/phame/blog/edit/')->setColor(PHUIButtonView::GREEN);
         $post_list = id(new PHUIBigInfoView())->setIcon('fa-star')->setTitle('Welcome to Phame')->setDescription(pht('There aren\'t any visible blog posts.'))->addAction($create_button);
     }
     $view_all = id(new PHUIButtonView())->setTag('a')->setText(pht('View All'))->setHref($this->getApplicationURI('post/'))->setIcon('fa-list-ul');
     $title = pht('Recent Posts');
     $header = id(new PHUIHeaderView())->setHeader($title)->addActionLink($view_all);
     $crumbs = $this->buildApplicationCrumbs();
     $crumbs->setBorder(true);
     $crumbs->addTextCrumb(pht('Recent Posts'), $this->getApplicationURI('post/'));
     $page = id(new PHUIDocumentViewPro())->setHeader($header)->appendChild($post_list);
     $blog_list = id(new PhameBlogListView())->setBlogs($blogs)->setViewer($viewer);
     $draft_list = null;
     if ($viewer->isLoggedIn() && $blogs) {
         $drafts = id(new PhamePostQuery())->setViewer($viewer)->withBloggerPHIDs(array($viewer->getPHID()))->withBlogPHIDs(mpull($blogs, 'getPHID'))->withVisibility(array(PhameConstants::VISIBILITY_DRAFT))->setLimit(5)->execute();
         $draft_list = id(new PhameDraftListView())->setPosts($drafts)->setBlogs($blogs)->setViewer($viewer);
     }
     $phame_view = id(new PHUITwoColumnView())->setMainColumn(array($page))->setSideColumn(array($blog_list, $draft_list))->addClass('phame-home-container');
     $phame_home = phutil_tag_div('phame-home-view', $phame_view);
     return $this->newPage()->setTitle($title)->setCrumbs($crumbs)->appendChild(array($phame_home));
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:35,代码来源:PhameHomeController.php

示例15: getTagContent

 protected function getTagContent()
 {
     require_celerity_resource('phui-document-view-css');
     require_celerity_resource('phui-document-view-pro-css');
     Javelin::initBehavior('phabricator-reveal-content');
     $classes = array();
     $classes[] = 'phui-document-view';
     $classes[] = 'phui-document-view-pro';
     $book = null;
     if ($this->bookname) {
         $book = pht('%s (%s)', $this->bookname, $this->bookdescription);
     }
     $main_content = $this->renderChildren();
     if ($book) {
         $this->header->setSubheader($book);
     }
     $table_of_contents = null;
     if ($this->toc) {
         $toc = array();
         $toc_id = celerity_generate_unique_node_id();
         $toc[] = id(new PHUIButtonView())->setTag('a')->setIconFont('fa-align-left')->setColor(PHUIButtonView::SIMPLE)->addClass('phui-document-toc')->addSigil('jx-toggle-class')->setMetaData(array('map' => array($toc_id => 'phui-document-toc-open')));
         $toc[] = phutil_tag('div', array('class' => 'phui-list-sidenav phui-document-toc-list'), $this->toc);
         $table_of_contents = phutil_tag('div', array('class' => 'phui-document-toc-container', 'id' => $toc_id), $toc);
     }
     $content_inner = phutil_tag('div', array('class' => 'phui-document-inner'), array($table_of_contents, $this->header, $main_content));
     $content = phutil_tag('div', array('class' => 'phui-document-content'), $content_inner);
     $view = phutil_tag('div', array('class' => implode(' ', $classes)), $content);
     $list = null;
     if ($this->propertyList) {
         $list = phutil_tag_div('phui-document-properties', $this->propertyList);
     }
     return array($view, $list);
 }
开发者ID:Escalation,项目名称:phabricator,代码行数:33,代码来源:PHUIDocumentViewPro.php


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