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


PHP javelin_render_tag函数代码示例

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


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

示例1: render

 public function render()
 {
     $rows = array();
     $any_hidden = false;
     foreach ($this->rows as $row) {
         $style = idx($row, 'style');
         switch ($style) {
             case 'section':
                 $cells = phutil_render_tag('th', array('colspan' => 2), idx($row, 'name'));
                 break;
             default:
                 $name = phutil_render_tag('th', array(), idx($row, 'name'));
                 $value = phutil_render_tag('td', array(), idx($row, 'value'));
                 $cells = $name . $value;
                 break;
         }
         $show = idx($row, 'show');
         $rows[] = javelin_render_tag('tr', array('style' => $show ? null : 'display: none', 'sigil' => $show ? null : 'differential-results-row-toggle', 'class' => 'differential-results-row-' . $style), $cells);
         if (!$show) {
             $any_hidden = true;
         }
     }
     if ($any_hidden) {
         $show_more = javelin_render_tag('a', array('href' => '#', 'mustcapture' => true), $this->showMoreString);
         $hide_more = javelin_render_tag('a', array('href' => '#', 'mustcapture' => true), 'Hide');
         $rows[] = javelin_render_tag('tr', array('class' => 'differential-results-row-show', 'sigil' => 'differential-results-row-show'), '<th colspan="2">' . $show_more . '</td>');
         $rows[] = javelin_render_tag('tr', array('class' => 'differential-results-row-show', 'sigil' => 'differential-results-row-hide', 'style' => 'display: none'), '<th colspan="2">' . $hide_more . '</th>');
         Javelin::initBehavior('differential-show-field-details');
     }
     require_celerity_resource('differential-results-table-css');
     return javelin_render_tag('table', array('class' => 'differential-results-table', 'sigil' => 'differential-results-table'), implode("\n", $rows));
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:32,代码来源:DifferentialResultsTableView.php

示例2: render

 public function render()
 {
     if (!$this->user) {
         throw new Exception("Call setUser() before rendering!");
     }
     $task = $this->task;
     $handles = $this->handles;
     require_celerity_resource('maniphest-task-summary-css');
     $pri_class = self::getPriorityClass($task->getPriority());
     $status_map = ManiphestTaskStatus::getTaskStatusMap();
     $batch = null;
     if ($this->showBatchControls) {
         $batch = '<td class="maniphest-task-batch">' . javelin_render_tag('input', array('type' => 'checkbox', 'name' => 'batch[]', 'value' => $task->getID(), 'sigil' => 'maniphest-batch'), null) . '</td>';
     }
     $projects_view = new ManiphestTaskProjectsView();
     $projects_view->setHandles(array_select_keys($this->handles, $task->getProjectPHIDs()));
     $control_class = null;
     $control_sigil = null;
     if ($this->showSubpriorityControls) {
         $control_class = 'maniphest-active-handle';
         $control_sigil = 'maniphest-task-handle';
     }
     $handle = javelin_render_tag('td', array('class' => 'maniphest-task-handle ' . $pri_class . ' ' . $control_class, 'sigil' => $control_sigil), '');
     return javelin_render_tag('table', array('class' => 'maniphest-task-summary', 'sigil' => 'maniphest-task', 'meta' => array('taskID' => $task->getID())), '<tr>' . $handle . $batch . '<td class="maniphest-task-number">' . 'T' . $task->getID() . '</td>' . '<td class="maniphest-task-status">' . idx($status_map, $task->getStatus(), 'Unknown') . '</td>' . '<td class="maniphest-task-owner">' . ($task->getOwnerPHID() ? $handles[$task->getOwnerPHID()]->renderLink() : '<em>None</em>') . '</td>' . '<td class="maniphest-task-name">' . phutil_render_tag('a', array('href' => '/T' . $task->getID()), phutil_escape_html($task->getTitle())) . '</td>' . '<td class="maniphest-task-projects">' . $projects_view->render() . '</td>' . '<td class="maniphest-task-updated">' . phabricator_date($task->getDateModified(), $this->user) . '</td>' . '</tr>');
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:25,代码来源:ManiphestTaskSummaryView.php

示例3: render

 public function render()
 {
     require_celerity_resource('differential-changeset-view-css');
     require_celerity_resource('syntax-highlighting-css');
     if ($this->revisionID) {
         $edit = true;
     } else {
         $edit = false;
     }
     $changeset = $this->changeset;
     $class = 'differential-changeset';
     if (!$edit) {
         $class .= ' differential-changeset-immutable';
     }
     $buttons = null;
     if ($this->buttons) {
         $buttons = '<div class="differential-changeset-buttons">' . implode('', $this->buttons) . '</div>';
     }
     $id = $this->getID();
     if ($this->symbolIndex) {
         Javelin::initBehavior('repository-crossreference', array('container' => $id) + $this->symbolIndex);
     }
     $display_filename = $changeset->getDisplayFilename();
     $output = javelin_render_tag('div', array('sigil' => 'differential-changeset', 'meta' => array('left' => $this->changeset->getID(), 'right' => $this->changeset->getID()), 'class' => $class, 'id' => $id), phutil_render_tag('a', array('name' => $changeset->getAnchorName()), '') . $buttons . '<h1>' . phutil_escape_html($display_filename) . '</h1>' . '<div style="clear: both;"></div>' . $this->renderChildren());
     return $output;
 }
开发者ID:netcomtec,项目名称:phabricator,代码行数:26,代码来源:DifferentialChangesetDetailView.php

示例4: processRequest

 public function processRequest()
 {
     $request = $this->getRequest();
     $user = $request->getUser();
     $pager = new AphrontPagerView();
     $pager->setOffset($request->getInt('page'));
     $pager->setURI($request->getRequestURI(), 'page');
     $timers = id(new PhabricatorTimer())->loadAllWhere('1 = 1 ORDER BY id DESC LIMIT %d, %d', $pager->getOffset(), $pager->getPageSize() + 1);
     $timers = $pager->sliceResults($timers);
     $phids = mpull($timers, 'getAuthorPHID');
     $handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
     $rows = array();
     foreach ($timers as $timer) {
         $edit_button = null;
         $delete_button = null;
         if ($user->getIsAdmin() || $user->getPHID() == $timer->getAuthorPHID()) {
             $edit_button = phutil_render_tag('a', array('class' => 'small button grey', 'href' => '/countdown/edit/' . $timer->getID() . '/'), 'Edit');
             $delete_button = javelin_render_tag('a', array('class' => 'small button grey', 'href' => '/countdown/delete/' . $timer->getID() . '/', 'sigil' => 'workflow'), 'Delete');
         }
         $rows[] = array(phutil_escape_html($timer->getID()), $handles[$timer->getAuthorPHID()]->renderLink(), phutil_render_tag('a', array('href' => '/countdown/' . $timer->getID() . '/'), phutil_escape_html($timer->getTitle())), phabricator_datetime($timer->getDatepoint(), $user), $edit_button, $delete_button);
     }
     $table = new AphrontTableView($rows);
     $table->setHeaders(array('ID', 'Author', 'Title', 'End Date', '', ''));
     $table->setColumnClasses(array(null, null, 'wide pri', null, 'action', 'action'));
     $panel = id(new AphrontPanelView())->appendChild($table)->setHeader('Timers')->setCreateButton('Create Timer', '/countdown/edit/')->appendChild($pager);
     return $this->buildStandardPageResponse($panel, array('title' => 'Countdown'));
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:27,代码来源:PhabricatorCountdownListController.php

示例5: 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');
     $container = celerity_generate_unique_node_id();
     $content = '<div class="phabricator-timer" id="' . $container . '">
     <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>' . javelin_render_tag('td', array('sigil' => 'phabricator-timer-days'), '') . javelin_render_tag('td', array('sigil' => 'phabricator-timer-hours'), '') . javelin_render_tag('td', array('sigil' => 'phabricator-timer-minutes'), '') . javelin_render_tag('td', array('sigil' => 'phabricator-timer-seconds'), '') . '</tr>
       </table>
     </div>' . $chrome_link . '</div>';
     Javelin::initBehavior('countdown-timer', array('timestamp' => $timer->getDatepoint(), 'container' => $container));
     $panel = $content;
     return $this->buildStandardPageResponse($panel, array('title' => 'Countdown: ' . $timer->getTitle(), 'chrome' => $chrome_visible));
 }
开发者ID:neoxen,项目名称:phabricator,代码行数:30,代码来源:PhabricatorCountdownViewController.php

示例6: render

 public function render()
 {
     $rows = array();
     $rowc = array();
     // TODO: Experiment with path stack rendering.
     // TODO: Copy Away and Move Away are rendered junkily still.
     foreach ($this->pathChanges as $id => $change) {
         $path = $change->getPath();
         $hash = substr(md5($path), 0, 8);
         if ($change->getFileType() == DifferentialChangeType::FILE_DIRECTORY) {
             $path .= '/';
         }
         if (isset($this->renderingReferences[$id])) {
             $path_column = javelin_render_tag('a', array('href' => '#' . $hash, 'meta' => array('id' => 'diff-' . $hash, 'ref' => $this->renderingReferences[$id]), 'sigil' => 'differential-load'), phutil_escape_html($path));
         } else {
             $path_column = phutil_escape_html($path);
         }
         $rows[] = array($this->linkHistory($change->getPath()), $this->linkBrowse($change->getPath()), $this->linkChange($change->getChangeType(), $change->getFileType(), $change->getPath()), $path_column);
         $row_class = null;
         foreach ($this->ownersPaths as $owners_path) {
             $owners_path = $owners_path->getPath();
             if (strncmp('/' . $path, $owners_path, strlen($owners_path)) == 0) {
                 $row_class = 'highlighted';
                 break;
             }
         }
         $rowc[] = $row_class;
     }
     $view = new AphrontTableView($rows);
     $view->setHeaders(array('History', 'Browse', 'Change', 'Path'));
     $view->setColumnClasses(array('', '', '', 'wide'));
     $view->setRowClasses($rowc);
     $view->setNoDataString('This change has not been fully parsed yet.');
     return $view->render();
 }
开发者ID:rudimk,项目名称:phabricator,代码行数:35,代码来源:DiffusionCommitChangeTableView.php

示例7: processRequest

 public function processRequest()
 {
     $request = $this->getRequest();
     $pager = new AphrontPagerView();
     $pager->setOffset($request->getInt('page'));
     $macro_table = new PhabricatorFileImageMacro();
     $macros = $macro_table->loadAllWhere('1 = 1 ORDER BY id DESC LIMIT %d, %d', $pager->getOffset(), $pager->getPageSize());
     // Get an exact count since the size here is reasonably going to be a few
     // thousand at most in any reasonable case.
     $count = queryfx_one($macro_table->establishConnection('r'), 'SELECT COUNT(*) N FROM %T', $macro_table->getTableName());
     $count = $count['N'];
     $pager->setCount($count);
     $pager->setURI($request->getRequestURI(), 'page');
     $rows = array();
     foreach ($macros as $macro) {
         $src = PhabricatorFileURI::getViewURIForPHID($macro->getFilePHID());
         $rows[] = array(phutil_render_tag('a', array('href' => '/file/macro/edit/' . $macro->getID() . '/'), phutil_escape_html($macro->getName())), phutil_render_tag('a', array('href' => $src, 'target' => '_blank'), phutil_render_tag('img', array('src' => $src))), javelin_render_tag('a', array('href' => '/file/macro/delete/' . $macro->getID() . '/', 'sigil' => 'workflow', 'class' => 'grey small button'), 'Delete'));
     }
     $table = new AphrontTableView($rows);
     $table->setHeaders(array('Name', 'Image', ''));
     $table->setColumnClasses(array('pri', 'wide thumb', 'action'));
     $panel = new AphrontPanelView();
     $panel->appendChild($table);
     $panel->setHeader('Image Macros');
     $panel->setCreateButton('New Image Macro', '/file/macro/edit/');
     $panel->appendChild($pager);
     return $this->buildStandardPageResponse($panel, array('title' => 'Image Macros', 'tab' => 'macros'));
 }
开发者ID:nguyennamtien,项目名称:phabricator,代码行数:28,代码来源:PhabricatorFileMacroListController.php

示例8: phabricator_render_form

function phabricator_render_form(PhabricatorUser $user, $attributes, $content)
{
    if (strcasecmp(idx($attributes, 'method'), 'POST') == 0 && !preg_match('#^(https?:|//)#', idx($attributes, 'action'))) {
        $content = phutil_render_tag('input', array('type' => 'hidden', 'name' => AphrontRequest::getCSRFTokenName(), 'value' => $user->getCSRFToken())) . phutil_render_tag('input', array('type' => 'hidden', 'name' => '__form__', 'value' => true)) . $content;
    }
    return javelin_render_tag('form', $attributes, $content);
}
开发者ID:nexeck,项目名称:phabricator,代码行数:7,代码来源:markup.php

示例9: render

 public function render()
 {
     $icon = null;
     if ($this->icon) {
         $icon = phutil_render_tag('span', array('class' => 'phabricator-action-view-icon autosprite ' . 'action-' . $this->icon), '');
     }
     if ($this->href) {
         if ($this->renderAsForm) {
             if (!$this->user) {
                 throw new Exception('Call setUser() when rendering an action as a form.');
             }
             $item = javelin_render_tag('button', array('class' => 'phabricator-action-view-item'), phutil_escape_html($this->name));
             $item = phabricator_render_form($this->user, array('action' => $this->href, 'method' => 'POST', 'sigil' => $this->workflow ? 'workflow' : null), $item);
         } else {
             $item = javelin_render_tag('a', array('href' => $this->href, 'class' => 'phabricator-action-view-item', 'sigil' => $this->workflow ? 'workflow' : null), phutil_escape_html($this->name));
         }
     } else {
         $item = phutil_render_tag('span', array('class' => 'phabricator-action-view-item'), phutil_escape_html($this->name));
     }
     $classes = array();
     $classes[] = 'phabricator-action-view';
     if ($this->disabled) {
         $classes[] = 'phabricator-action-view-disabled';
     }
     return phutil_render_tag('li', array('class' => implode(' ', $classes)), $icon . $item);
 }
开发者ID:rudimk,项目名称:phabricator,代码行数:26,代码来源:PhabricatorActionView.php

示例10: renderNotificationMenu

 private function renderNotificationMenu()
 {
     $user = $this->user;
     require_celerity_resource('phabricator-notification-css');
     require_celerity_resource('phabricator-notification-menu-css');
     $indicator_id = celerity_generate_unique_node_id();
     $dropdown_id = celerity_generate_unique_node_id();
     $menu_id = celerity_generate_unique_node_id();
     $notification_count = id(new PhabricatorFeedStoryNotification())->countUnread($user);
     $classes = array('phabricator-main-menu-alert-indicator');
     if ($notification_count) {
         $classes[] = 'phabricator-main-menu-alert-indicator-unread';
     }
     $notification_indicator = javelin_render_tag('span', array('id' => $indicator_id, 'class' => implode(' ', $classes)), $notification_count);
     $classes = array();
     $classes[] = 'phabricator-main-menu-alert-item';
     $classes[] = 'phabricator-main-menu-alert-item-notification';
     $classes[] = 'autosprite';
     $classes[] = 'main-menu-item-icon-notifications';
     $notification_icon = javelin_render_tag('a', array('href' => '/notification/', 'class' => implode(' ', $classes), 'id' => $menu_id), $notification_indicator);
     $notification_menu = javelin_render_tag('div', array('class' => 'phabricator-main-menu-alert'), $notification_icon);
     Javelin::initBehavior('aphlict-dropdown', array('menuID' => $menu_id, 'indicatorID' => $indicator_id, 'dropdownID' => $dropdown_id));
     $notification_dropdown = javelin_render_tag('div', array('id' => $dropdown_id, 'class' => 'phabricator-notification-menu', 'sigil' => 'phabricator-notification-menu', 'style' => 'display: none;'), '');
     return array($notification_menu, $notification_dropdown);
 }
开发者ID:neoxen,项目名称:phabricator,代码行数:25,代码来源:PhabricatorMainMenuView.php

示例11: render

 public function render()
 {
     require_celerity_resource('aphront-form-view-css');
     Javelin::initBehavior('aphront-form-disable-on-submit');
     $layout = id(new AphrontFormLayoutView())->setBackgroundShading(true)->setPadded(true)->appendChild($this->renderDataInputs())->appendChild($this->renderChildren());
     return javelin_render_tag('form', array('action' => $this->action, 'method' => $this->method, 'enctype' => $this->encType, 'sigil' => $this->workflow ? 'workflow' : null, 'id' => $this->id), $layout->render());
 }
开发者ID:nguyennamtien,项目名称:phabricator,代码行数:7,代码来源:AphrontFormView.php

示例12: renderExample

 public function renderExample()
 {
     require_celerity_resource('phabricator-notification-css');
     Javelin::initBehavior('phabricator-notification-example');
     $content = javelin_render_tag('a', array('sigil' => 'notification-example', 'class' => 'button green'), 'Show Notification');
     $content = '<div style="padding: 1em 3em;">' . $content . '</content>';
     return $content;
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:8,代码来源:PhabricatorUINotificationExample.php

示例13: processRequest

 public function processRequest()
 {
     $request = $this->getRequest();
     $user = $request->getUser();
     $package = id(new PhabricatorOwnersPackage())->load($this->id);
     if (!$package) {
         return new Aphront404Response();
     }
     $paths = $package->loadPaths();
     $owners = $package->loadOwners();
     $phids = array();
     foreach ($paths as $path) {
         $phids[$path->getRepositoryPHID()] = true;
     }
     foreach ($owners as $owner) {
         $phids[$owner->getUserPHID()] = true;
     }
     $phids = array_keys($phids);
     $handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
     $rows = array();
     $rows[] = array('Name', phutil_escape_html($package->getName()));
     $rows[] = array('Description', phutil_escape_html($package->getDescription()));
     $primary_owner = null;
     $primary_phid = $package->getPrimaryOwnerPHID();
     if ($primary_phid && isset($handles[$primary_phid])) {
         $primary_owner = '<strong>' . $handles[$primary_phid]->renderLink() . '</strong>';
     }
     $rows[] = array('Primary Owner', $primary_owner);
     $owner_links = array();
     foreach ($owners as $owner) {
         $owner_links[] = $handles[$owner->getUserPHID()]->renderLink();
     }
     $owner_links = implode('<br />', $owner_links);
     $rows[] = array('Owners', $owner_links);
     $rows[] = array('Auditing', $package->getAuditingEnabled() ? 'Enabled' : 'Disabled');
     $rows[] = array('Related Commits', phutil_render_tag('a', array('href' => '/owners/related/view/all/?phid=' . $package->getPHID()), phutil_escape_html('Related Commits')));
     $path_links = array();
     foreach ($paths as $path) {
         $callsign = $handles[$path->getRepositoryPHID()]->getName();
         $repo = phutil_escape_html('r' . $callsign);
         $path_link = phutil_render_tag('a', array('href' => '/diffusion/' . $callsign . '/browse/:' . $path->getPath()), phutil_escape_html($path->getPath()));
         $path_links[] = $repo . ' ' . $path_link;
     }
     $path_links = implode('<br />', $path_links);
     $rows[] = array('Paths', $path_links);
     $table = new AphrontTableView($rows);
     $table->setColumnClasses(array('header', 'wide'));
     $panel = new AphrontPanelView();
     $panel->setHeader('Package Details for "' . phutil_escape_html($package->getName()) . '"');
     $panel->addButton(javelin_render_tag('a', array('href' => '/owners/delete/' . $package->getID() . '/', 'class' => 'button grey', 'sigil' => 'workflow'), 'Delete Package'));
     $panel->addButton(phutil_render_tag('a', array('href' => '/owners/edit/' . $package->getID() . '/', 'class' => 'button'), 'Edit Package'));
     $panel->appendChild($table);
     $nav = new AphrontSideNavView();
     $nav->appendChild($panel);
     $nav->addNavItem(phutil_render_tag('a', array('href' => '/owners/package/' . $package->getID() . '/', 'class' => 'aphront-side-nav-selected'), 'Package Details'));
     return $this->buildStandardPageResponse($nav, array('title' => "Package '" . $package->getName() . "'"));
 }
开发者ID:netcomtec,项目名称:phabricator,代码行数:57,代码来源:PhabricatorOwnersDetailController.php

示例14: render

 public function render()
 {
     $marker = null;
     if ($this->navigationMarker) {
         $marker = javelin_render_tag('legend', array('class' => 'phabricator-anchor-navigation-marker', 'sigil' => 'marker', 'meta' => array('anchor' => $this->anchorName)), '');
     }
     $anchor = phutil_render_tag('a', array('name' => $this->anchorName, 'id' => $this->anchorName, 'class' => 'phabricator-anchor-view'), '');
     return $marker . $anchor;
 }
开发者ID:neoxen,项目名称:phabricator,代码行数:9,代码来源:PhabricatorAnchorView.php

示例15: render

 public function render()
 {
     $some = $this->some;
     $link = null;
     if ($this->more && $this->more != $this->some) {
         Javelin::initBehavior('aphront-more');
         $link = ' ' . javelin_render_tag('a', array('sigil' => 'aphront-more-view-show-more', 'mustcapture' => true, 'href' => '#', 'meta' => array('more' => $this->more)), "(Show More…)");
     }
     return javelin_render_tag('div', array('sigil' => 'aphront-more-view'), $some . $link);
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:10,代码来源:AphrontMoreView.php


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