• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP id函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: execute

 public function execute(PhutilArgumentParser $args)
 {
     $console = PhutilConsole::getConsole();
     $ids = $args->getArg('id');
     if (!$ids) {
         throw new PhutilArgumentUsageException(pht("Use the '%s' flag to specify one or more SMS messages to show.", '--id'));
     }
     $messages = id(new PhabricatorSMS())->loadAllWhere('id IN (%Ld)', $ids);
     if ($ids) {
         $ids = array_fuse($ids);
         $missing = array_diff_key($ids, $messages);
         if ($missing) {
             throw new PhutilArgumentUsageException(pht('Some specified SMS messages do not exist: %s', implode(', ', array_keys($missing))));
         }
     }
     $last_key = last_key($messages);
     foreach ($messages as $message_key => $message) {
         $info = array();
         $info[] = pht('PROPERTIES');
         $info[] = pht('ID: %d', $message->getID());
         $info[] = pht('Status: %s', $message->getSendStatus());
         $info[] = pht('To: %s', $message->getToNumber());
         $info[] = pht('From: %s', $message->getFromNumber());
         $info[] = null;
         $info[] = pht('BODY');
         $info[] = $message->getBody();
         $info[] = null;
         $console->writeOut('%s', implode("\n", $info));
         if ($message_key != $last_key) {
             $console->writeOut("\n%s\n\n", str_repeat('-', 80));
         }
     }
 }
开发者ID:pugong,项目名称:phabricator,代码行数:33,代码来源:PhabricatorSMSManagementShowOutboundWorkflow.php


示例2: buildPanels

 private function buildPanels()
 {
     $panel_specs = id(new PhutilSymbolLoader())->setAncestorClass('PhabricatorSettingsPanel')->setConcreteOnly(true)->selectAndLoadSymbols();
     $panels = array();
     foreach ($panel_specs as $spec) {
         $class = newv($spec['name'], array());
         $panels[] = $class->buildPanels();
     }
     $panels = array_mergev($panels);
     $panels = mpull($panels, null, 'getPanelKey');
     $result = array();
     foreach ($panels as $key => $panel) {
         $panel->setUser($this->user);
         if (!$panel->isEnabled()) {
             continue;
         }
         if (!$this->isSelf()) {
             if (!$panel->isEditableByAdministrators()) {
                 continue;
             }
         }
         if (!empty($result[$key])) {
             throw new Exception(pht("Two settings panels share the same panel key ('%s'): %s, %s.", $key, get_class($panel), get_class($result[$key])));
         }
         $result[$key] = $panel;
     }
     $result = msort($result, 'getPanelSortKey');
     if (!$result) {
         throw new Exception(pht('No settings panels are available.'));
     }
     return $result;
 }
开发者ID:hrb518,项目名称:phabricator,代码行数:32,代码来源:PhabricatorSettingsMainController.php


示例3: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $viewer = $request->getViewer();
     $books = id(new DivinerBookQuery())->setViewer($viewer)->execute();
     $crumbs = $this->buildApplicationCrumbs();
     $crumbs->setBorder(true);
     $crumbs->addTextCrumb(pht('Books'));
     $query_button = id(new PHUIButtonView())->setTag('a')->setHref($this->getApplicationURI('query/'))->setText(pht('Advanced Search'))->setIcon('fa-search');
     $header = id(new PHUIHeaderView())->setHeader(pht('Documentation Books'))->addActionLink($query_button);
     $document = new PHUIDocumentViewPro();
     $document->setHeader($header);
     $document->addClass('diviner-view');
     if ($books) {
         $books = msort($books, 'getTitle');
         $list = array();
         foreach ($books as $book) {
             $item = id(new DivinerBookItemView())->setTitle($book->getTitle())->setHref('/book/' . $book->getName() . '/')->setSubtitle($book->getPreface());
             $list[] = $item;
         }
         $list = id(new PHUIBoxView())->addPadding(PHUI::PADDING_MEDIUM_TOP)->appendChild($list);
         $document->appendChild($list);
     } else {
         $text = pht("(NOTE) **Looking for Phabricator documentation?** " . "If you're looking for help and information about Phabricator, " . "you can [[https://secure.phabricator.com/diviner/ | " . "browse the public Phabricator documentation]] on the live site.\n\n" . "Diviner is the documentation generator used to build the " . "Phabricator documentation.\n\n" . "You haven't generated any Diviner documentation books yet, so " . "there's nothing to show here. If you'd like to generate your own " . "local copy of the Phabricator documentation and have it appear " . "here, run this command:\n\n" . "  %s\n\n", 'phabricator/ $ ./bin/diviner generate');
         $text = new PHUIRemarkupView($viewer, $text);
         $document->appendChild($text);
     }
     return $this->newPage()->setTitle(pht('Documentation Books'))->setCrumbs($crumbs)->appendChild(array($document));
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:28,代码来源:DivinerMainController.php


示例4: execute

 protected function execute(ConduitAPIRequest $request)
 {
     $diff = null;
     $revision_id = $request->getValue('revision_id');
     $revision = id(new DifferentialRevision())->load($revision_id);
     if (!$revision) {
         throw new ConduitException('ERR_BAD_REVISION');
     }
     $revision->loadRelationships();
     $reviewer_phids = array_values($revision->getReviewers());
     $diffs = $revision->loadDiffs();
     $diff_dicts = array();
     foreach ($diffs as $diff) {
         $diff->attachChangesets($diff->loadChangesets());
         // TODO: We could batch this to improve performance.
         foreach ($diff->getChangesets() as $changeset) {
             $changeset->attachHunks($changeset->loadHunks());
         }
         $diff_dicts[] = $diff->getDiffDict();
     }
     $commit_dicts = array();
     $commit_phids = $revision->loadCommitPHIDs();
     $handles = id(new PhabricatorObjectHandleData($commit_phids))->loadHandles();
     foreach ($commit_phids as $commit_phid) {
         $commit_dicts[] = array('fullname' => $handles[$commit_phid]->getFullName(), 'dateCommitted' => $handles[$commit_phid]->getTimestamp());
     }
     $auxiliary_fields = $this->loadAuxiliaryFields($revision);
     $dict = array('id' => $revision->getID(), 'phid' => $revision->getPHID(), 'authorPHID' => $revision->getAuthorPHID(), 'uri' => PhabricatorEnv::getURI('/D' . $revision->getID()), 'title' => $revision->getTitle(), 'status' => $revision->getStatus(), 'statusName' => ArcanistDifferentialRevisionStatus::getNameForRevisionStatus($revision->getStatus()), 'summary' => $revision->getSummary(), 'testPlan' => $revision->getTestPlan(), 'lineCount' => $revision->getLineCount(), 'reviewerPHIDs' => $reviewer_phids, 'diffs' => $diff_dicts, 'commits' => $commit_dicts, 'auxiliary' => $auxiliary_fields);
     return $dict;
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:30,代码来源:ConduitAPI_differential_getrevision_Method.php


示例5: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $viewer = $request->getViewer();
     $id = $request->getURIData('id');
     if (!$request->isFormPost()) {
         return new Aphront400Response();
     }
     $question = id(new PonderQuestionQuery())->setViewer($viewer)->withIDs(array($id))->executeOne();
     if (!$question) {
         return new Aphront404Response();
     }
     $is_preview = $request->isPreviewRequest();
     //    $draft = PhabricatorDraft::buildFromRequest($request);
     $qid = $question->getID();
     $view_uri = "/Q{$qid}";
     $xactions = array();
     $xactions[] = id(new PonderQuestionTransaction())->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)->attachComment(id(new PonderQuestionTransactionComment())->setContent($request->getStr('comment')));
     $editor = id(new PonderQuestionEditor())->setActor($viewer)->setContinueOnNoEffect($request->isContinueRequest())->setContentSourceFromRequest($request)->setIsPreview($is_preview);
     try {
         $xactions = $editor->applyTransactions($question, $xactions);
     } catch (PhabricatorApplicationTransactionNoEffectException $ex) {
         return id(new PhabricatorApplicationTransactionNoEffectResponse())->setCancelURI($view_uri)->setException($ex);
     }
     //    if ($draft) {
     //      $draft->replaceOrDelete();
     //    }
     if ($request->isAjax() && $is_preview) {
         return id(new PhabricatorApplicationTransactionResponse())->setViewer($viewer)->setTransactions($xactions)->setIsPreview($is_preview);
     } else {
         return id(new AphrontRedirectResponse())->setURI($view_uri);
     }
 }
开发者ID:pugong,项目名称:phabricator,代码行数:32,代码来源:PonderQuestionCommentController.php


示例6: buildApplicationCrumbs

 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $can_create = $this->hasApplicationCapability(HarbormasterManagePlansCapability::CAPABILITY);
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('New Build Plan'))->setHref($this->getApplicationURI('plan/edit/'))->setDisabled(!$can_create)->setWorkflow(!$can_create)->setIcon('fa-plus-square'));
     return $crumbs;
 }
开发者ID:fengshao0907,项目名称:phabricator,代码行数:7,代码来源:HarbormasterPlanListController.php


示例7: renderItemCommonProperties

 private function renderItemCommonProperties(PhabricatorUser $viewer, NuanceItem $item, PHUIPropertyListView $view)
 {
     $complaint = $item->getNuanceProperty('complaint');
     $complaint = PhabricatorMarkupEngine::renderOneObject(id(new PhabricatorMarkupOneOff())->setContent($complaint), 'default', $viewer);
     $view->addSectionHeader(pht('Complaint'), 'fa-exclamation-circle');
     $view->addTextContent($complaint);
 }
开发者ID:pugong,项目名称:phabricator,代码行数:7,代码来源:NuancePhabricatorFormSourceDefinition.php


示例8: buildChartForm

 private function buildChartForm()
 {
     $request = $this->getRequest();
     $user = $request->getUser();
     $table = new PhabricatorFactRaw();
     $conn_r = $table->establishConnection('r');
     $table_name = $table->getTableName();
     $facts = queryfx_all($conn_r, 'SELECT DISTINCT factType from %T', $table_name);
     $specs = PhabricatorFactSpec::newSpecsForFactTypes(PhabricatorFactEngine::loadAllEngines(), ipull($facts, 'factType'));
     $options = array();
     foreach ($specs as $spec) {
         if ($spec->getUnit() == PhabricatorFactSpec::UNIT_COUNT) {
             $options[$spec->getType()] = $spec->getName();
         }
     }
     if (!$options) {
         return id(new AphrontErrorView())->setSeverity(AphrontErrorView::SEVERITY_NOTICE)->setTitle(pht('No Chartable Facts'))->appendChild('<p>' . pht('There are no facts that can be plotted yet.') . '</p>');
     }
     $form = id(new AphrontFormView())->setUser($user)->appendChild(id(new AphrontFormSelectControl())->setLabel('Y-Axis')->setName('y1')->setOptions($options))->appendChild(id(new AphrontFormSubmitControl())->setValue('Plot Chart'));
     $panel = new AphrontPanelView();
     $panel->appendChild($form);
     $panel->setWidth(AphrontPanelView::WIDTH_FORM);
     $panel->setHeader('Plot Chart');
     return $panel;
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:25,代码来源:PhabricatorFactHomeController.php


示例9: processRequest

 public function processRequest()
 {
     $request = $this->getRequest();
     $viewer = $request->getUser();
     $provider_config = id(new PhortunePaymentProviderConfigQuery())->setViewer($viewer)->withIDs(array($this->id))->requireCapabilities(array(PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT))->executeOne();
     if (!$provider_config) {
         return new Aphront404Response();
     }
     $merchant = $provider_config->getMerchant();
     $merchant_id = $merchant->getID();
     $cancel_uri = $this->getApplicationURI("merchant/{$merchant_id}/");
     $provider = $provider_config->buildProvider();
     if ($request->isFormPost()) {
         $new_status = !$provider_config->getIsEnabled();
         $xactions = array();
         $xactions[] = id(new PhortunePaymentProviderConfigTransaction())->setTransactionType(PhortunePaymentProviderConfigTransaction::TYPE_ENABLE)->setNewValue($new_status);
         $editor = id(new PhortunePaymentProviderConfigEditor())->setActor($viewer)->setContentSourceFromRequest($request)->setContinueOnNoEffect(true)->setContinueOnMissingFields(true);
         $editor->applyTransactions($provider_config, $xactions);
         return id(new AphrontRedirectResponse())->setURI($cancel_uri);
     }
     if ($provider_config->getIsEnabled()) {
         $title = pht('Disable Provider?');
         $body = pht('If you disable this payment provider, users will no longer be able ' . 'to use it to make new payments.');
         $button = pht('Disable Provider');
     } else {
         $title = pht('Enable Provider?');
         $body = pht('If you enable this payment provider, users will be able to use it to ' . 'make new payments.');
         $button = pht('Enable Provider');
     }
     return $this->newDialog()->setTitle($title)->appendParagraph($body)->addSubmitButton($button)->addCancelButton($cancel_uri);
 }
开发者ID:hrb518,项目名称:phabricator,代码行数:31,代码来源:PhortuneProviderDisableController.php


示例10: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $request = $this->getRequest();
     $user = $request->getUser();
     if ($request->isFormPost()) {
         $log = PhabricatorUserLog::initializeNewLog($user, $user->getPHID(), PhabricatorUserLog::ACTION_LOGOUT);
         $log->save();
         // Destroy the user's session in the database so logout works even if
         // their cookies have some issues. We'll detect cookie issues when they
         // try to login again and tell them to clear any junk.
         $phsid = $request->getCookie(PhabricatorCookies::COOKIE_SESSION);
         if (strlen($phsid)) {
             $session = id(new PhabricatorAuthSessionQuery())->setViewer($user)->withSessionKeys(array($phsid))->executeOne();
             if ($session) {
                 $session->delete();
             }
         }
         $request->clearCookie(PhabricatorCookies::COOKIE_SESSION);
         return id(new AphrontRedirectResponse())->setURI('/auth/loggedout/');
     }
     if ($user->getPHID()) {
         $dialog = id(new AphrontDialogView())->setUser($user)->setTitle(pht('Log out of Phabricator?'))->appendChild(pht('Are you sure you want to log out?'))->addSubmitButton(pht('Logout'))->addCancelButton('/');
         return id(new AphrontDialogResponse())->setDialog($dialog);
     }
     return id(new AphrontRedirectResponse())->setURI('/');
 }
开发者ID:hrb518,项目名称:phabricator,代码行数:26,代码来源:PhabricatorLogoutController.php


示例11: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $viewer = $request->getViewer();
     $book_name = $request->getURIData('book');
     $book = id(new DivinerBookQuery())->setViewer($viewer)->requireCapabilities(array(PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT))->needProjectPHIDs(true)->withNames(array($book_name))->executeOne();
     if (!$book) {
         return new Aphront404Response();
     }
     $view_uri = '/book/' . $book->getName() . '/';
     if ($request->isFormPost()) {
         $v_projects = $request->getArr('projectPHIDs');
         $v_view = $request->getStr('viewPolicy');
         $v_edit = $request->getStr('editPolicy');
         $xactions = array();
         $xactions[] = id(new DivinerLiveBookTransaction())->setTransactionType(PhabricatorTransactions::TYPE_EDGE)->setMetadataValue('edge:type', PhabricatorProjectObjectHasProjectEdgeType::EDGECONST)->setNewValue(array('=' => array_fuse($v_projects)));
         $xactions[] = id(new DivinerLiveBookTransaction())->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)->setNewValue($v_view);
         $xactions[] = id(new DivinerLiveBookTransaction())->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY)->setNewValue($v_edit);
         id(new DivinerLiveBookEditor())->setContinueOnNoEffect(true)->setContentSourceFromRequest($request)->setActor($viewer)->applyTransactions($book, $xactions);
         return id(new AphrontRedirectResponse())->setURI($view_uri);
     }
     $crumbs = $this->buildApplicationCrumbs();
     $crumbs->addTextCrumb(pht('Edit Basics'));
     $title = pht('Edit %s', $book->getTitle());
     $policies = id(new PhabricatorPolicyQuery())->setViewer($viewer)->setObject($book)->execute();
     $view_capability = PhabricatorPolicyCapability::CAN_VIEW;
     $edit_capability = PhabricatorPolicyCapability::CAN_EDIT;
     $form = id(new AphrontFormView())->setUser($viewer)->appendControl(id(new AphrontFormTokenizerControl())->setDatasource(new PhabricatorProjectDatasource())->setName('projectPHIDs')->setLabel(pht('Projects'))->setValue($book->getProjectPHIDs()))->appendControl(id(new AphrontFormTokenizerControl())->setDatasource(new DiffusionRepositoryDatasource())->setName('repositoryPHIDs')->setLabel(pht('Repository'))->setDisableBehavior(true)->setLimit(1)->setValue($book->getRepositoryPHID() ? array($book->getRepositoryPHID()) : null))->appendChild(id(new AphrontFormPolicyControl())->setName('viewPolicy')->setPolicyObject($book)->setCapability($view_capability)->setPolicies($policies)->setCaption($book->describeAutomaticCapability($view_capability)))->appendChild(id(new AphrontFormPolicyControl())->setName('editPolicy')->setPolicyObject($book)->setCapability($edit_capability)->setPolicies($policies)->setCaption($book->describeAutomaticCapability($edit_capability)))->appendChild(id(new AphrontFormSubmitControl())->setValue(pht('Save'))->addCancelButton($view_uri));
     $object_box = id(new PHUIObjectBoxView())->setHeaderText($title)->setForm($form);
     $timeline = $this->buildTransactionTimeline($book, new DivinerLiveBookTransactionQuery());
     $timeline->setShouldTerminate(true);
     return $this->buildApplicationPage(array($crumbs, $object_box, $timeline), array('title' => $title));
 }
开发者ID:pugong,项目名称:phabricator,代码行数:32,代码来源:DivinerBookEditController.php


示例12: processRequest

 public function processRequest()
 {
     $request = $this->getRequest();
     $viewer = $request->getUser();
     // Load the project we're looking at, based on the project ID in the URL.
     $project = id(new PhabricatorProjectQuery())->setViewer($viewer)->withIDs(array($this->projectID))->executeOne();
     if (!$project) {
         return new Aphront404Response();
     }
     $error_box = false;
     $burndown_chart = false;
     $burndown_table = false;
     $tasks_table = false;
     $events_table = false;
     try {
         $data = new BurndownData($project, $viewer);
         $burndown_chart = $data->buildBurnDownChart();
         $burndown_table = $data->buildBurnDownTable();
         $tasks_table = $data->buildTasksTable();
         $events_table = $data->buildEventTable();
     } catch (BurndownException $e) {
         $error_box = id(new PHUIInfoView())->setTitle(pht('Burndown could not be rendered for this project'))->setErrors(array($e->getMessage()));
     }
     $crumbs = $this->buildApplicationCrumbs();
     $crumbs->addTextCrumb($project->getName(), '/project/view/' . $project->getID());
     $crumbs->addTextCrumb(pht('Burndown'));
     return $this->buildApplicationPage(array($crumbs, $error_box, $burndown_chart, $burndown_table, $tasks_table, $events_table), array('title' => array(pht('Burndown'), $project->getName()), 'device' => true));
 }
开发者ID:yangming85,项目名称:phabricator-sprint,代码行数:28,代码来源:BurndownController.php


示例13: processRequest

 public function processRequest()
 {
     $request = $this->getRequest();
     $user = $request->getUser();
     $xaction = id(new PhabricatorObjectQuery())->withPHIDs(array($this->phid))->setViewer($user)->executeOne();
     if (!$xaction) {
         return new Aphront404Response();
     }
     if (!$xaction->getComment()) {
         // You can't view history of a transaction with no comments.
         return new Aphront404Response();
     }
     if ($xaction->getComment()->getIsRemoved()) {
         // You can't view history of a transaction with a removed comment.
         return new Aphront400Response();
     }
     $comments = id(new PhabricatorApplicationTransactionTemplatedCommentQuery())->setViewer($user)->setTemplate($xaction->getApplicationTransactionCommentObject())->withTransactionPHIDs(array($xaction->getPHID()))->execute();
     if (!$comments) {
         return new Aphront404Response();
     }
     $comments = msort($comments, 'getCommentVersion');
     $xactions = array();
     foreach ($comments as $comment) {
         $xactions[] = id(clone $xaction)->makeEphemeral()->setCommentVersion($comment->getCommentVersion())->setContentSource($comment->getContentSource())->setDateCreated($comment->getDateCreated())->attachComment($comment);
     }
     $obj_phid = $xaction->getObjectPHID();
     $obj_handle = id(new PhabricatorHandleQuery())->setViewer($user)->withPHIDs(array($obj_phid))->executeOne();
     $view = id(new PhabricatorApplicationTransactionView())->setUser($user)->setObjectPHID($obj_phid)->setTransactions($xactions)->setShowEditActions(false)->setHideCommentOptions(true);
     $dialog = id(new AphrontDialogView())->setUser($user)->setWidth(AphrontDialogView::WIDTH_FULL)->setFlush(true)->setTitle(pht('Comment History'));
     $dialog->appendChild($view);
     $dialog->addCancelButton($obj_handle->getURI());
     return id(new AphrontDialogResponse())->setDialog($dialog);
 }
开发者ID:fengshao0907,项目名称:phabricator,代码行数:33,代码来源:PhabricatorApplicationTransactionCommentHistoryController.php


示例14: willFilterPage

 protected function willFilterPage(array $page)
 {
     if ($this->needSecrets) {
         $secret_ids = mpull($page, 'getSecretID');
         $secret_ids = array_filter($secret_ids);
         $secrets = array();
         if ($secret_ids) {
             $secret_objects = id(new PassphraseSecret())->loadAllWhere('id IN (%Ld)', $secret_ids);
             foreach ($secret_objects as $secret) {
                 $secret_data = $secret->getSecretData();
                 $secrets[$secret->getID()] = new PhutilOpaqueEnvelope($secret_data);
             }
         }
         foreach ($page as $key => $credential) {
             $secret_id = $credential->getSecretID();
             if (!$secret_id) {
                 $credential->attachSecret(null);
             } else {
                 if (isset($secrets[$secret_id])) {
                     $credential->attachSecret($secrets[$secret_id]);
                 } else {
                     unset($page[$key]);
                 }
             }
         }
     }
     return $page;
 }
开发者ID:barcelonascience,项目名称:phabricator,代码行数:28,代码来源:PassphraseCredentialQuery.php


示例15: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $viewer = $this->getViewer();
     $configs = id(new PhabricatorAuthProviderConfigQuery())->setViewer($viewer)->execute();
     $list = new PHUIObjectItemListView();
     $can_manage = $this->hasApplicationCapability(AuthManageProvidersCapability::CAPABILITY);
     foreach ($configs as $config) {
         $item = new PHUIObjectItemView();
         $id = $config->getID();
         $edit_uri = $this->getApplicationURI('config/edit/' . $id . '/');
         $enable_uri = $this->getApplicationURI('config/enable/' . $id . '/');
         $disable_uri = $this->getApplicationURI('config/disable/' . $id . '/');
         $provider = $config->getProvider();
         if ($provider) {
             $name = $provider->getProviderName();
         } else {
             $name = $config->getProviderType() . ' (' . $config->getProviderClass() . ')';
         }
         $item->setHeader($name);
         if ($provider) {
             $item->setHref($edit_uri);
         } else {
             $item->addAttribute(pht('Provider Implementation Missing!'));
         }
         $domain = null;
         if ($provider) {
             $domain = $provider->getProviderDomain();
             if ($domain !== 'self') {
                 $item->addAttribute($domain);
             }
         }
         if ($config->getShouldAllowRegistration()) {
             $item->addAttribute(pht('Allows Registration'));
         } else {
             $item->addAttribute(pht('Does Not Allow Registration'));
         }
         if ($config->getIsEnabled()) {
             $item->setStatusIcon('fa-check-circle green');
             $item->addAction(id(new PHUIListItemView())->setIcon('fa-times')->setHref($disable_uri)->setDisabled(!$can_manage)->addSigil('workflow'));
         } else {
             $item->setStatusIcon('fa-ban red');
             $item->addIcon('fa-ban grey', pht('Disabled'));
             $item->addAction(id(new PHUIListItemView())->setIcon('fa-plus')->setHref($enable_uri)->setDisabled(!$can_manage)->addSigil('workflow'));
         }
         $list->addItem($item);
     }
     $list->setNoDataString(pht('%s You have not added authentication providers yet. Use "%s" to add ' . 'a provider, which will let users register new Phabricator accounts ' . 'and log in.', phutil_tag('strong', array(), pht('No Providers Configured:')), phutil_tag('a', array('href' => $this->getApplicationURI('config/new/')), pht('Add Authentication Provider'))));
     $crumbs = $this->buildApplicationCrumbs();
     $crumbs->addTextCrumb(pht('Auth Providers'));
     $crumbs->setBorder(true);
     $guidance_context = new PhabricatorAuthProvidersGuidanceContext();
     $guidance = id(new PhabricatorGuidanceEngine())->setViewer($viewer)->setGuidanceContext($guidance_context)->newInfoView();
     $button = id(new PHUIButtonView())->setTag('a')->setColor(PHUIButtonView::SIMPLE)->setHref($this->getApplicationURI('config/new/'))->setIcon('fa-plus')->setDisabled(!$can_manage)->setText(pht('Add Provider'));
     $list->setFlush(true);
     $list = id(new PHUIObjectBoxView())->setHeaderText(pht('Providers'))->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)->appendChild($list);
     $title = pht('Auth Providers');
     $header = id(new PHUIHeaderView())->setHeader($title)->setHeaderIcon('fa-key')->addActionLink($button);
     $view = id(new PHUITwoColumnView())->setHeader($header)->setFooter(array($guidance, $list));
     return $this->newPage()->setTitle($title)->setCrumbs($crumbs)->appendChild($view);
 }
开发者ID:NeoArmageddon,项目名称:phabricator,代码行数:60,代码来源:PhabricatorAuthListController.php


示例16: render

 public function render()
 {
     $leases = $this->leases;
     $viewer = $this->getUser();
     $view = new PHUIObjectItemListView();
     foreach ($leases as $lease) {
         $item = id(new PHUIObjectItemView())->setUser($viewer)->setHeader($lease->getLeaseName())->setHref('/drydock/lease/' . $lease->getID() . '/');
         if ($lease->hasAttachedResource()) {
             $resource = $lease->getResource();
             $resource_href = '/drydock/resource/' . $resource->getID() . '/';
             $resource_name = $resource->getName();
             $item->addAttribute(phutil_tag('a', array('href' => $resource_href), $resource_name));
         }
         $status = DrydockLeaseStatus::getNameForStatus($lease->getStatus());
         $item->addAttribute($status);
         $item->setEpoch($lease->getDateCreated());
         // TODO: Tailor this for clarity.
         if ($lease->isActivating()) {
             $item->setStatusIcon('fa-dot-circle-o yellow');
         } else {
             if ($lease->isActive()) {
                 $item->setStatusIcon('fa-dot-circle-o green');
             } else {
                 $item->setStatusIcon('fa-dot-circle-o red');
             }
         }
         $view->addItem($item);
     }
     return $view;
 }
开发者ID:kwoun1982,项目名称:phabricator,代码行数:30,代码来源:DrydockLeaseListView.php


示例17: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $viewer = $request->getViewer();
     $id = $request->getURIData('id');
     $initiative = id(new FundInitiativeQuery())->setViewer($viewer)->withIDs(array($id))->requireCapabilities(array(PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT))->executeOne();
     if (!$initiative) {
         return new Aphront404Response();
     }
     $initiative_uri = '/' . $initiative->getMonogram();
     $is_close = !$initiative->isClosed();
     if ($request->isFormPost()) {
         $type_status = FundInitiativeTransaction::TYPE_STATUS;
         if ($is_close) {
             $new_status = FundInitiative::STATUS_CLOSED;
         } else {
             $new_status = FundInitiative::STATUS_OPEN;
         }
         $xaction = id(new FundInitiativeTransaction())->setTransactionType($type_status)->setNewValue($new_status);
         $editor = id(new FundInitiativeEditor())->setActor($viewer)->setContentSourceFromRequest($request)->setContinueOnMissingFields(true);
         $editor->applyTransactions($initiative, array($xaction));
         return id(new AphrontRedirectResponse())->setURI($initiative_uri);
     }
     if ($is_close) {
         $title = pht('Close Initiative?');
         $body = pht('Really close this initiative? Users will no longer be able to ' . 'back it.');
         $button_text = pht('Close Initiative');
     } else {
         $title = pht('Reopen Initiative?');
         $body = pht('Really reopen this initiative?');
         $button_text = pht('Reopen Initiative');
     }
     return $this->newDialog()->setTitle($title)->appendParagraph($body)->addCancelButton($initiative_uri)->addSubmitButton($button_text);
 }
开发者ID:pugong,项目名称:phabricator,代码行数:33,代码来源:FundInitiativeCloseController.php


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


示例19: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $viewer = $request->getViewer();
     $accounts = id(new PhortuneAccountQuery())->setViewer($viewer)->withMemberPHIDs(array($viewer->getPHID()))->requireCapabilities(array(PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT))->execute();
     $merchants = id(new PhortuneMerchantQuery())->setViewer($viewer)->withMemberPHIDs(array($viewer->getPHID()))->execute();
     $title = pht('Accounts');
     $crumbs = $this->buildApplicationCrumbs();
     $crumbs->addTextCrumb(pht('Accounts'));
     $crumbs->setBorder(true);
     $payment_list = id(new PHUIObjectItemListView())->setUser($viewer)->setNoDataString(pht('You are not a member of any payment accounts. Payment ' . 'accounts are used to make purchases.'));
     foreach ($accounts as $account) {
         $item = id(new PHUIObjectItemView())->setSubhead(pht('Account %d', $account->getID()))->setHeader($account->getName())->setHref($this->getApplicationURI($account->getID() . '/'))->setObject($account)->setIcon('fa-credit-card');
         $payment_list->addItem($item);
     }
     $payment_header = id(new PHUIHeaderView())->setHeader(pht('Payment Accounts'))->addActionLink(id(new PHUIButtonView())->setTag('a')->setHref($this->getApplicationURI('account/edit/'))->setIcon('fa-plus')->setText(pht('Create Account')));
     $payment_box = id(new PHUIObjectBoxView())->setHeader($payment_header)->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)->setObjectList($payment_list);
     $merchant_list = id(new PHUIObjectItemListView())->setUser($viewer)->setNoDataString(pht('You do not control any merchant accounts. Merchant accounts are ' . 'used to receive payments.'));
     foreach ($merchants as $merchant) {
         $item = id(new PHUIObjectItemView())->setSubhead(pht('Merchant %d', $merchant->getID()))->setHeader($merchant->getName())->setHref($this->getApplicationURI('/merchant/' . $merchant->getID() . '/'))->setObject($merchant)->setIcon('fa-bank');
         $merchant_list->addItem($item);
     }
     $merchant_header = id(new PHUIHeaderView())->setHeader(pht('Merchant Accounts'))->addActionLink(id(new PHUIButtonView())->setTag('a')->setHref($this->getApplicationURI('merchant/'))->setIcon('fa-list')->setText(pht('View All Merchants')));
     $merchant_box = id(new PHUIObjectBoxView())->setHeader($merchant_header)->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)->setObjectList($merchant_list);
     $header = id(new PHUIHeaderView())->setHeader(pht('Accounts'));
     $view = id(new PHUITwoColumnView())->setHeader($header)->setFooter(array($payment_box, $merchant_box));
     return $this->newPage()->setTitle($title)->setCrumbs($crumbs)->appendChild($view);
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:27,代码来源:PhortuneAccountListController.php


示例20: buildCustomEditFields

    protected function buildCustomEditFields($object)
    {
        $paths_help = pht(<<<EOTEXT
When updating the paths for a package, pass a list of dictionaries like
this as the `value` for the transaction:

```lang=json, name="Example Paths Value"
[
  {
    "repositoryPHID": "PHID-REPO-1234",
    "path": "/path/to/directory/",
    "excluded": false
  },
  {
    "repositoryPHID": "PHID-REPO-1234",
    "path": "/another/example/path/",
    "excluded": false
  }
]
```

This transaction will set the paths to the list you provide, overwriting any
previous paths.

Generally, you will call `owners.search` first to get a list of current paths
(which are provided in the same format), make changes, then update them by
applying a transaction of this type.
EOTEXT
);
        return array(id(new PhabricatorTextEditField())->setKey('name')->setLabel(pht('Name'))->setDescription(pht('Name of the package.'))->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_NAME)->setIsRequired(true)->setValue($object->getName()), id(new PhabricatorDatasourceEditField())->setKey('owners')->setLabel(pht('Owners'))->setDescription(pht('Users and projects which own the package.'))->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_OWNERS)->setDatasource(new PhabricatorProjectOrUserDatasource())->setIsCopyable(true)->setValue($object->getOwnerPHIDs()), id(new PhabricatorSelectEditField())->setKey('auditing')->setLabel(pht('Auditing'))->setDescription(pht('Automatically trigger audits for commits affecting files in ' . 'this package.'))->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_AUDITING)->setIsCopyable(true)->setValue($object->getAuditingEnabled())->setOptions(array('' => pht('Disabled'), '1' => pht('Enabled'))), id(new PhabricatorRemarkupEditField())->setKey('description')->setLabel(pht('Description'))->setDescription(pht('Human-readable description of the package.'))->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_DESCRIPTION)->setValue($object->getDescription()), id(new PhabricatorSelectEditField())->setKey('status')->setLabel(pht('Status'))->setDescription(pht('Archive or enable the package.'))->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_STATUS)->setIsCond 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP id2nodeid函数代码示例发布时间:2022-05-15
下一篇:
PHP iconv_system函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap