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


PHP GridField::Link方法代碼示例

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


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

示例1: getHTMLFragments

 /**
  * @param GridField $field
  */
 public function getHTMLFragments($field)
 {
     VersionedGridFieldExtensions::include_requirements();
     $field->addExtraClass('ss-versioned-gridfield-orderable');
     $field->setAttribute('data-url-reorder', $field->Link('reorder'));
     $field->setAttribute('data-url-movetopage', $field->Link('movetopage'));
 }
開發者ID:phil-quinn,項目名稱:silverstripe-versioneddataobjects,代碼行數:10,代碼來源:VersionedGridFieldOrderableRows.php

示例2: getColumnContent

 /**
  * @param GridField $gridField
  * @param DataObject $record
  * @param string $columnName
  *
  * @return string - the HTML for the column 
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     // No permission checks, handled through GridFieldDetailForm,
     // which can make the form readonly if no edit permissions are available.
     $data = new ArrayData(array('Link' => Controller::join_links($gridField->Link('item'), $record->ID, 'edit')));
     return $data->renderWith('GridFieldEditButton');
 }
開發者ID:jakedaleweb,項目名稱:AtomCodeChallenge,代碼行數:14,代碼來源:GridFieldEditButton.php

示例3: getColumnContent

 /**
  *
  * @param GridField $gridField
  * @param DataObject $record
  * @param string $columnName
  * @return string - the HTML for the column 
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     $data = new ArrayData(array('Link' => Controller::join_links($gridField->Link('item'), $record->ID, 'refresh')));
     $templatePath = dirname(dirname(__FILE__)) . '/templates/GridFieldRefreshButton.ss';
     $templatePath = str_replace(BASE_PATH, '', $templatePath);
     return $data->renderWith('../' . $templatePath);
 }
開發者ID:richardsjoqvist,項目名稱:silverstripe-blocks,代碼行數:14,代碼來源:FeedBlock_GridFieldRefreshButton.php

示例4: Link

 /**
  * Return a Link to this field, if the list is an instance of StatefulGridFieldList the session key for the state is appended to the url
  * @param {string} $action Action to append to the url
  * @return {string} Relative link to this form field
  */
 public function Link($action = null)
 {
     if ($this->list instanceof StatefulGridFieldList) {
         return Controller::join_links(parent::Link($action), '?' . strtolower($this->name) . '_skey=' . $this->state->getSessionKey());
     }
     return parent::Link($action);
 }
開發者ID:helpfulrobot,項目名稱:webbuilders-group-silverstripe-statefulunsavedlist,代碼行數:12,代碼來源:StatefulGridField.php

示例5: getColumnContent

 /**
  *
  * @param GridField $gridField
  * @param DataObject $record
  * @param string $columnName
  * @return string - the HTML for the column 
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     if (!$record->canEdit()) {
         return;
     }
     $data = new ArrayData(array('Link' => Controller::join_links($gridField->Link('item'), $record->ID, 'edit')));
     return $data->renderWith('GridFieldEditButton');
 }
開發者ID:prostart,項目名稱:cobblestonepath,代碼行數:15,代碼來源:GridFieldEditButton.php

示例6: getColumnContent

 /**
  * @param GridField $gridField
  * @param DataObject $record
  * @param string $columnName
  *
  * @return string - the HTML for the column
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     if (!$record instanceof Member || !$record->canMasquerade()) {
         return;
     }
     // No permission checks, handled through GridFieldDetailForm,
     // which can make the form readonly if no edit permissions are available.
     $data = new ArrayData(array('Link' => Controller::join_links($gridField->Link('item'), $record->ID, 'masquerade')));
     return $data->renderWith('GridFieldMasqueradeButton');
 }
開發者ID:dhensby,項目名稱:silverstripe-masquerade,代碼行數:17,代碼來源:GridFieldMasqueradeButton.php

示例7: getHTMLFragments

 /**
  * @param GridField $field
  */
 public function getHTMLFragments($field)
 {
     self::include_requirements();
     // set ajax urls / vars
     $field->addExtraClass('ss-gridfield-blockenhancements');
     //		$field->setAttribute('data-url-area-assignment', $field->Link('area_assignment'));
     $field->setAttribute('data-url-blocktype-assignment', $field->Link('blocktype_assignment'));
     //		$field->setAttribute('data-block-area-none-title', Config::inst()->get(get_class(), 'unassigned_area_description'));
     // add no-chozen to dropdown
     //        $field->getConfig()->getComponentByType('GridFieldAddNewMultiClass')->
     //        $field->getConfig()->getComponentByType('GridFieldDetailForm')->setAttribute('data-project-dir', project());
 }
開發者ID:micschk,項目名稱:silverstripe-block_enhancements,代碼行數:15,代碼來源:GF_BlockEnhancements.php

示例8: getColumnContent

 /**
  *
  * @param \GridField $gridField
  * @param \DataObject $record
  * @param string $columnName
  * @return string|null - the HTML for the column
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     if (!$record instanceof \Payment) {
         return null;
     }
     \Requirements::css('omnipay-ui/css/omnipay-ui-cms.css');
     \Requirements::javascript('omnipay-ui/javascript/omnipay-ui-cms.js');
     if (preg_match('/Pending(Capture|Void|Refund)/', $record->Status)) {
         return \SSViewer::execute_template('PaymentPendingIndicator', \ArrayData::create(array('StatusLink' => \Controller::join_links($gridField->Link('checkPaymentPending')), 'PaymentID' => $record->ID, 'Timeout' => 2000)));
     }
     return null;
 }
開發者ID:bummzack,項目名稱:silverstripe-omnipay-ui,代碼行數:19,代碼來源:GridFieldPaymentStatusIndicator.php

示例9: cacheKey

 /**
  * Generate a cache key unique to this gridfield
  */
 protected function cacheKey()
 {
     return md5($this->gridField->Link());
 }
開發者ID:burnbright,項目名稱:silverstripe-importexport,代碼行數:7,代碼來源:GridFieldImporter_Request.php

示例10: Link

 public function Link($action = null)
 {
     return Controller::join_links($this->grid->Link(), 'add-existing-search', $action);
 }
開發者ID:helpfulrobot,項目名稱:ajshort-silverstripe-gridfieldextensions,代碼行數:4,代碼來源:GridFieldAddExistingSearchHandler.php

示例11: getAttributes

 /**
  * @return array
  */
 public function getAttributes()
 {
     // Store state in session, and pass ID to client side.
     $state = array('grid' => $this->getNameFromParent(), 'actionName' => $this->actionName, 'args' => $this->args);
     // Ensure $id doesn't contain only numeric characters
     $id = 'gf_' . substr(md5(serialize($state)), 0, 8);
     Session::set($id, $state);
     $actionData['StateID'] = $id;
     return array_merge(parent::getAttributes(), array('name' => 'action_gridFieldAlterAction' . '?' . http_build_query($actionData), 'data-url' => $this->gridField->Link()));
 }
開發者ID:miamollie,項目名稱:echoAerial,代碼行數:13,代碼來源:GridField.php

示例12: Link

 public function Link($action = null)
 {
     return Controller::join_links($this->gridField->Link('item'), $this->record->ID ? $this->record->ID : 'new', $action);
 }
開發者ID:8secs,項目名稱:cocina,代碼行數:4,代碼來源:GridFieldDetailForm.php

示例13: getHTMLFragments

 /**
  * HTML to be embedded into the GridField.
  * 
  * @param GridField $gridField
  *
  * @return array
  */
 public function getHTMLFragments($gridField)
 {
     // permission check
     if (!singleton($gridField->getModelClass())->canEdit()) {
         return array();
     }
     // check BulkManager exists
     $bulkManager = $gridField->getConfig()->getComponentsByType('GridFieldBulkManager');
     // upload management buttons
     $finishButton = FormAction::create('Finish', _t('GRIDFIELD_BULK_UPLOAD.FINISH_BTN_LABEL', 'Finish'))->addExtraClass('bulkUploadFinishButton')->setAttribute('data-icon', 'accept')->setUseButtonTag(true);
     $clearErrorButton = FormAction::create('ClearError', _t('GRIDFIELD_BULK_UPLOAD.CLEAR_ERROR_BTN_LABEL', 'Clear errors'))->addExtraClass('bulkUploadClearErrorButton')->setAttribute('data-icon', 'arrow-circle-double')->setUseButtonTag(true);
     if (count($bulkManager)) {
         $cancelButton = FormAction::create('Cancel', _t('GRIDFIELD_BULK_UPLOAD.CANCEL_BTN_LABEL', 'Cancel'))->addExtraClass('bulkUploadCancelButton ss-ui-action-destructive')->setAttribute('data-icon', 'decline')->setAttribute('data-url', $gridField->Link('bulkupload/cancel'))->setUseButtonTag(true);
         $bulkManager_config = $bulkManager->first()->getConfig();
         $bulkManager_actions = $bulkManager_config['actions'];
         if (array_key_exists('bulkedit', $bulkManager_actions)) {
             $editAllButton = FormAction::create('EditAll', _t('GRIDFIELD_BULK_UPLOAD.EDIT_ALL_BTN_LABEL', 'Edit all'))->addExtraClass('bulkUploadEditButton')->setAttribute('data-icon', 'pencil')->setAttribute('data-url', $gridField->Link('bulkupload/edit'))->setUseButtonTag(true);
         } else {
             $editAllButton = '';
         }
     } else {
         $cancelButton = '';
         $editAllButton = '';
     }
     // get uploadField + inject extra buttons
     $uploadField = $this->bulkUploadField($gridField);
     $uploadField->FinishButton = $finishButton;
     $uploadField->CancelButton = $cancelButton;
     $uploadField->EditAllButton = $editAllButton;
     $uploadField->ClearErrorButton = $clearErrorButton;
     $data = ArrayData::create(array('Colspan' => count($gridField->getColumns()), 'UploadField' => $uploadField->Field()));
     Requirements::css(BULKEDITTOOLS_UPLOAD_PATH . '/css/GridFieldBulkUpload.css');
     Requirements::javascript(BULKEDITTOOLS_UPLOAD_PATH . '/javascript/GridFieldBulkUpload.js');
     Requirements::javascript(BULKEDITTOOLS_UPLOAD_PATH . '/javascript/GridFieldBulkUpload_downloadtemplate.js');
     Requirements::add_i18n_javascript(BULKEDITTOOLS_PATH . '/lang/js');
     return array('header' => $data->renderWith('GridFieldBulkUpload'));
 }
開發者ID:sumitnis,項目名稱:GridFieldBulkEditingTools,代碼行數:44,代碼來源:GridFieldBulkUpload.php

示例14: getAttributes

 /**
  * @return array
  */
 public function getAttributes()
 {
     $state = array('grid' => $this->getNameFromParent(), 'actionName' => $this->actionName, 'args' => $this->args);
     $id = 'gf_' . substr(md5(serialize($state)), 0, 8);
     Session::set($id, $state);
     $actionData['StateID'] = $id;
     return array_merge(parent::getAttributes(), array('name' => 'action_gridFieldAlterAction?' . http_build_query($actionData), 'data-url' => $this->gridField->Link()));
 }
開發者ID:maent45,項目名稱:redefine_renos,代碼行數:11,代碼來源:GridField.php

示例15: getHTMLFragments

 /**
  * @param GridField $gridField
  *
  * @return array
  */
 public function getHTMLFragments($gridField)
 {
     Requirements::css(BULKEDITTOOLS_MANAGER_PATH . '/css/GridFieldBulkManager.css');
     Requirements::javascript(BULKEDITTOOLS_MANAGER_PATH . '/javascript/GridFieldBulkManager.js');
     Requirements::add_i18n_javascript(BULKEDITTOOLS_PATH . '/lang/js');
     if (!count($this->config['actions'])) {
         user_error('Trying to use GridFieldBulkManager without any bulk action.', E_USER_ERROR);
     }
     $actionsListSource = array();
     $actionsConfig = array();
     foreach ($this->config['actions'] as $action => $actionData) {
         $actionsListSource[$action] = $actionData['label'];
         $actionsConfig[$action] = $actionData['config'];
     }
     reset($this->config['actions']);
     $firstAction = key($this->config['actions']);
     $dropDownActionsList = DropdownField::create('bulkActionName', '')->setSource($actionsListSource)->setAttribute('class', 'bulkActionName no-change-track')->setAttribute('id', '');
     $templateData = array('Menu' => $dropDownActionsList->FieldHolder(), 'Button' => array('Label' => _t('GRIDFIELD_BULK_MANAGER.ACTION_BTN_LABEL', 'Go'), 'DataURL' => $gridField->Link('bulkAction'), 'Icon' => $this->config['actions'][$firstAction]['config']['icon'], 'DataConfig' => htmlspecialchars(json_encode($actionsConfig), ENT_QUOTES, 'UTF-8')), 'Select' => array('Label' => _t('GRIDFIELD_BULK_MANAGER.SELECT_ALL_LABEL', 'Select all')), 'Colspan' => count($gridField->getColumns()) - 1);
     $templateData = new ArrayData($templateData);
     return array('header' => $templateData->renderWith('BulkManagerButtons'));
 }
開發者ID:pschiffe,項目名稱:GridFieldBulkEditingTools,代碼行數:26,代碼來源:GridFieldBulkManager.php


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