當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GridField_FormAction::Field方法代碼示例

本文整理匯總了PHP中GridField_FormAction::Field方法的典型用法代碼示例。如果您正苦於以下問題:PHP GridField_FormAction::Field方法的具體用法?PHP GridField_FormAction::Field怎麽用?PHP GridField_FormAction::Field使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GridField_FormAction的用法示例。


在下文中一共展示了GridField_FormAction::Field方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getHTMLFragments

 /**
  * Place the export button in a <p> tag below the field
  */
 public function getHTMLFragments($gridField)
 {
     $button = new GridField_FormAction($gridField, 'export', _t('TableListField.CSVEXPORT', 'Export to CSV'), 'export', null);
     $button->setAttribute('data-icon', 'download-csv');
     $button->addExtraClass('no-ajax');
     return array($this->targetFragment => '<p class="grid-csv-button">' . $button->Field() . '</p>');
 }
開發者ID:jareddreyer,項目名稱:catalogue,代碼行數:10,代碼來源:GridFieldExportButton.php

示例2: getHTMLFragments

 public function getHTMLFragments($gridField)
 {
     $button = new GridField_FormAction($gridField, 'syncwithyoutube', _t('GridFieldSyncYoutubeVideos.CTA', 'Sync with Youtube'), 'syncwithyoutube', null);
     $button->setAttribute('data-icon', 'accept');
     $button->addExtraClass('no-ajax');
     return array($this->targetFragment => '<p class="grid-csv-button">' . $button->Field() . '<br><br></p>');
 }
開發者ID:helpfulrobot,項目名稱:level51-silverstripe-youtubesync,代碼行數:7,代碼來源:GridFieldSyncYoutubeVideos.php

示例3: getHTMLFragments

 /**
  * Place the print button in a <p> tag below the field
  *
  * @param GridField
  *
  * @return array
  */
 public function getHTMLFragments($gridField)
 {
     $button = new GridField_FormAction($gridField, 'print', _t('TableListField.Print', 'Print'), 'print', null);
     $button->setAttribute('data-icon', 'grid_print');
     $button->addExtraClass('gridfield-button-print');
     return array($this->targetFragment => '<p class="grid-print-button">' . $button->Field() . '</p>');
 }
開發者ID:jareddreyer,項目名稱:catalogue,代碼行數:14,代碼來源:GridFieldPrintButton.php

示例4: getHTMLFragments

 /**
  * Place the export button in a <p> tag below the field
  */
 public function getHTMLFragments($gridField)
 {
     $btnLabel = _t('Hail', 'Fetch {type}', ['type' => singleton($gridField->getModelClass())->i18n_plural_name()]);
     $button = new GridField_FormAction($gridField, 'fetchhail', $btnLabel, 'fetchhail', null);
     $button->setAttribute('data-icon', 'fetchHail');
     // $button->addExtraClass('ss-ui-action-constructive');
     return array($this->targetFragment => $button->Field());
 }
開發者ID:firebrandhq,項目名稱:silverstripe-hail,代碼行數:11,代碼來源:GridFieldHailFetchButton.php

示例5: getHTMLFragments

 /**
  * Returns a map where the keys are fragment names and the values are
  * pieces of HTML to add to these fragments.
  *
  * Here are 4 built-in fragments: 'header', 'footer', 'before', and
  * 'after', but components may also specify fragments of their own.
  *
  * To specify a new fragment, specify a new fragment by including the
  * text "$DefineFragment(fragmentname)" in the HTML that you return.
  *
  * Fragment names should only contain alphanumerics, -, and _.
  *
  * If you attempt to return HTML for a fragment that doesn't exist, an
  * exception will be thrown when the {@link GridField} is rendered.
  *
  * @param GridField $gridField
  * @return array
  */
 public function getHTMLFragments($gridField)
 {
     $button = new GridField_FormAction($gridField, $this->actionName, $this->buttonText, $this->actionName, null);
     $button->addExtraClass('multiselect-button');
     if (!empty($this->buttonConfig['icon'])) {
         $button->setAttribute('data-icon', $this->buttonConfig['icon']);
     }
     if (!empty($this->buttonConfig['class'])) {
         $button->addExtraClass($this->buttonConfig['class']);
     }
     if (!empty($this->buttonConfig['confirm'])) {
         $button->setAttribute('data-confirm', $this->buttonConfig['confirm']);
     }
     return array($this->targetFragment => $button->Field());
 }
開發者ID:markguinn,項目名稱:silverstripe-gridfieldmultiselect,代碼行數:33,代碼來源:GridFieldApplyToMultipleRows.php

示例6: getHTMLFragments

 public function getHTMLFragments($gridField)
 {
     $button = new GridField_FormAction($gridField, 'updateDefaultCategoryTags', 'Update All Categories', 'updateDefaultCategoryTags', null);
     $button->setAttribute('data-icon', 'chain--plus');
     return array($this->targetFragment => $button->Field());
 }
開發者ID:OpenStackweb,項目名稱:openstack-org,代碼行數:6,代碼來源:GridFieldUpdateDefaultCategoryTags.php

示例7: getHTMLFragments

 /**
  * Place the export button in a <p> tag below the field
  */
 public function getHTMLFragments($gridField)
 {
     $button = new GridField_FormAction($gridField, 'fake_locations', _t('DevToolkitFakeLocationsButton.TITLE', 'Add fake locations'), 'fake_locations', null);
     $button->addExtraClass('no-ajax');
     return array($this->targetFragment => '<p class="grid-dump-button">' . $button->Field() . '</p>');
 }
開發者ID:lekoala,項目名稱:silverstripe-devtoolkit,代碼行數:9,代碼來源:DevToolkitAdminExtension.php

示例8: getHTMLFragments

 /**
  * @param $gridField
  * @return array
  */
 public function getHTMLFragments($gridField)
 {
     $button = new GridField_FormAction($gridField, 'ResetState', 'Reset Grid', 'ResetState', null);
     return array($this->targetFragment => $button->Field());
 }
開發者ID:helpfulrobot,項目名稱:littlegiant-silverstripe-persistentgridfield,代碼行數:9,代碼來源:ResetGridStateButton.php

示例9: getHTMLFragments

 /**
  * Adds the form fields for the batch actions
  * 
  * @param GridField $gridField GridField to get HTML fragments for
  * 
  * @return array
  */
 public function getHTMLFragments($gridField)
 {
     Requirements::css('silvercart/admin/css/SilvercartGridFieldBatchController.css');
     Requirements::javascript('silvercart/admin/javascript/SilvercartGridFieldBatchController.js');
     $source = array('' => 'Bitte wählen');
     $targetBatchActionObjects = $this->getTargetBatchActionObjects();
     foreach ($targetBatchActionObjects as $targetBatchAction => $targetBatchActionObject) {
         $source[$targetBatchAction] = $targetBatchActionObject->getTitle();
         $targetBatchActionObject->RequireJavascript();
     }
     $dropdown = new DropdownField($this->getDropdownName(), $this->getDropdownName(), $source);
     $dropdown->addExtraClass('grid-batch-action-selector');
     $button = new GridField_FormAction($gridField, 'execute_batch_action', _t('Silvercart.EXECUTE', 'Execute'), 'handleBatchAction', null);
     $button->setAttribute('data-icon', 'navigation');
     $button->addExtraClass('gridfield-button-batch');
     return array($this->targetFragment => '<div class="grid-batch-action-button"><div class="field dropdown plain">' . $dropdown->Field() . '</div><div class="grid-batch-action-callback-target"></div>' . $button->Field() . '</div>');
 }
開發者ID:silvercart,項目名稱:silvercart,代碼行數:24,代碼來源:SilvercartGridFieldBatchController.php

示例10: getHTMLFragments

 /**
  * Place the export button in a <p> tag below the field
  */
 public function getHTMLFragments($gridField)
 {
     $button = new GridField_FormAction($gridField, 'addapikey', _t('GridFieldAddApiKeyButton.CREATE_API_KEY', 'Create API Key'), 'addapikey', null);
     $button->setAttribute('data-icon', 'add');
     return array($this->targetFragment => $button->Field());
 }
開發者ID:sminnee,項目名稱:silverstripe-apikey,代碼行數:9,代碼來源:GridFieldAddApiKeyButton.php

示例11: getHTMLFragments

 /**
  * Place the export button in a <p> tag below the field
  */
 public function getHTMLFragments($gridField)
 {
     $button = new GridField_FormAction($gridField, $this->actionName, $this->getBtnTitle(), $this->actionName, null);
     $button->setAttribute('data-icon', 'download-csv');
     $button->addExtraClass('no-ajax');
     return array($this->targetFragment => '<p class="grid-csv-button">' . $button->Field() . '</p>');
 }
開發者ID:helpfulrobot,項目名稱:lekoala-silverstripe-form-extras,代碼行數:10,代碼來源:GridFieldExportFilteredButton.php


注:本文中的GridField_FormAction::Field方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。