Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Member Functions
Reset Class Reference
Inheritance diagram for Reset:
Field Template RendererInterface Template AbstractBlock DataObject BlockInterface

Public Member Functions

 __construct (\Magento\Backend\Block\Template\Context $context, array $data=[])
 
 getRobotsDefaultCustomInstructions ()
 
 getButtonHtml ()
 
 render (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 
- Public Member Functions inherited from Field
 render (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 
- Public Member Functions inherited from Template
 __construct (\Magento\Backend\Block\Template\Context $context, array $data=[])
 
 getFormKey ()
 
 isOutputEnabled ($moduleName=null)
 
 getAuthorization ()
 
 getToolbar ()
 
- Public Member Functions inherited from Template
 __construct (Template\Context $context, array $data=[])
 
 setTemplateContext ($templateContext)
 
 getTemplate ()
 
 setTemplate ($template)
 
 getTemplateFile ($template=null)
 
 getArea ()
 
 assign ($key, $value=null)
 
 fetchView ($fileName)
 
 getBaseUrl ()
 
 getObjectData (\Magento\Framework\DataObject $object, $key)
 
 getCacheKeyInfo ()
 
- Public Member Functions inherited from AbstractBlock
 __construct (\Magento\Framework\View\Element\Context $context, array $data=[])
 
 getJsLayout ()
 
 getRequest ()
 
 getParentBlock ()
 
 setLayout (\Magento\Framework\View\LayoutInterface $layout)
 
 getLayout ()
 
 setNameInLayout ($name)
 
 getChildNames ()
 
 setAttribute ($name, $value=null)
 
 setChild ($alias, $block)
 
 addChild ($alias, $block, $data=[])
 
 unsetChild ($alias)
 
 unsetCallChild ($alias, $callback, $result, $params)
 
 unsetChildren ()
 
 getChildBlock ($alias)
 
 getChildHtml ($alias='', $useCache=true)
 
 getChildChildHtml ($alias, $childChildAlias='', $useCache=true)
 
 getBlockHtml ($name)
 
 insert ($element, $siblingName=0, $after=true, $alias='')
 
 append ($element, $alias='')
 
 getGroupChildNames ($groupName)
 
 getChildData ($alias, $key='')
 
 getUiId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null)
 
 getJsId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null)
 
 getUrl ($route='', $params=[])
 
 getViewFileUrl ($fileId, array $params=[])
 
 formatDate ( $date=null, $format=\IntlDateFormatter::SHORT, $showTime=false, $timezone=null)
 
 formatTime ( $time=null, $format=\IntlDateFormatter::SHORT, $showDate=false)
 
 getModuleName ()
 
 escapeHtml ($data, $allowedTags=null)
 
 escapeJs ($string)
 
 escapeHtmlAttr ($string, $escapeSingleQuote=true)
 
 escapeCss ($string)
 
 stripTags ($data, $allowableTags=null, $allowHtmlEntities=false)
 
 escapeUrl ($string)
 
 escapeXssInUrl ($data)
 
 escapeQuote ($data, $addSlashes=false)
 
 escapeJsQuote ($data, $quote='\'')
 
 getNameInLayout ()
 
 getCacheKeyInfo ()
 
 getCacheKey ()
 
 getVar ($name, $module=null)
 
 isScopePrivate ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Public Member Functions inherited from BlockInterface
 toHtml ()
 
- Public Member Functions inherited from RendererInterface
 render (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 

Data Fields

const XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS = 'design/search_engine_robots/default_custom_instructions'
 
- Data Fields inherited from Template
const XML_PATH_TEMPLATE_ALLOW_SYMLINK = 'dev/template/allow_symlink'
 
- Data Fields inherited from AbstractBlock
const CACHE_GROUP = \Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER
 
const CACHE_KEY_PREFIX = 'BLOCK_'
 

Protected Member Functions

 _construct ()
 
 _getElementHtml (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 
- Protected Member Functions inherited from Field
 _getElementHtml (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 
 _renderValue (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 
 _renderInheritCheckbox (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 
 _isInheritCheckboxRequired (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 
 _getInheritCheckboxLabel (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 
 _renderScopeLabel (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 
 _renderHint (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 
 _decorateRowHtml (\Magento\Framework\Data\Form\Element\AbstractElement $element, $html)
 
- Protected Member Functions inherited from Template
 _toHtml ()
 
- Protected Member Functions inherited from Template
 _construct ()
 
 _toHtml ()
 
 getRootDirectory ()
 
 getMediaDirectory ()
 
- Protected Member Functions inherited from AbstractBlock
 _construct ()
 
 _prepareLayout ()
 
 _beforeToHtml ()
 
 _afterToHtml ($html)
 
 _toHtml ()
 
 _getNotFoundUrl ($route='', $params=['_direct'=> 'core/index/notFound'])
 
 getCacheTags ()
 
 getCacheLifetime ()
 
 _loadCache ()
 
 _saveCache ($data)
 
 _getSidPlaceholder ($cacheKey=null)
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractBlock
static extractModuleName ($className)
 
- Protected Attributes inherited from Template
 $_authorization
 
 $mathRandom
 
 $_backendSession
 
 $formKey
 
 $nameBuilder
 
- Protected Attributes inherited from Template
 $_viewVars = []
 
 $_baseUrl
 
 $_jsUrl
 
 $_allowSymlinks
 
 $_filesystem
 
 $_template
 
 $templateEnginePool
 
 $_storeManager
 
 $_appState
 
 $directory
 
 $templateContext
 
 $pageConfig
 
 $resolver
 
 $validator
 
- Protected Attributes inherited from AbstractBlock
 $_design
 
 $_session
 
 $_sidResolver
 
 $_nameInLayout
 
 $_layout
 
 $jsLayout = []
 
 $_request
 
 $_urlBuilder
 
 $_eventManager
 
 $_frontController
 
 $_assetRepo
 
 $_viewConfig
 
 $_cacheState
 
 $_logger
 
 $_escaper
 
 $filterManager
 
 $_localeDate
 
 $inlineTranslation
 
 $_isScopePrivate = false
 
 $_scopeConfig
 
 $_cache
 
- Protected Attributes inherited from DataObject
 $_data = []
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

"Reset to Defaults" button renderer

Deprecated:
100.1.6
Author
Magento Core Team core@.nosp@m.mage.nosp@m.ntoco.nosp@m.mmer.nosp@m.ce.co.nosp@m.m

Definition at line 17 of file Reset.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Backend\Block\Template\Context  $context,
array  $data = [] 
)
Parameters
\Magento\Backend\Block\Template\Context$context
array$data

Definition at line 28 of file Reset.php.

31  {
32  parent::__construct($context, $data);
33  }

Member Function Documentation

◆ _construct()

_construct ( )
protected

Set template

Returns
void

Definition at line 40 of file Reset.php.

41  {
42  parent::_construct();
43  $this->setTemplate('Magento_Config::page/system/config/robots/reset.phtml');
44  }

◆ _getElementHtml()

_getElementHtml ( \Magento\Framework\Data\Form\Element\AbstractElement  $element)
protected

Return element html

Parameters
\Magento\Framework\Data\Form\Element\AbstractElement$element
Returns
string @SuppressWarnings(PHPMD.UnusedFormalParameter)

Definition at line 99 of file Reset.php.

100  {
101  return $this->_toHtml();
102  }

◆ getButtonHtml()

getButtonHtml ( )

Generate button html

Returns
string

Definition at line 64 of file Reset.php.

65  {
66  $button = $this->getLayout()->createBlock(
67  \Magento\Backend\Block\Widget\Button::class
68  )->setData(
69  [
70  'id' => 'reset_to_default_button',
71  'label' => __('Reset to Default'),
72  'onclick' => 'javascript:resetRobotsToDefault(); return false;',
73  ]
74  );
75 
76  return $button->toHtml();
77  }
__()
Definition: __.php:13

◆ getRobotsDefaultCustomInstructions()

getRobotsDefaultCustomInstructions ( )

Get robots.txt custom instruction default value

Returns
string

Definition at line 51 of file Reset.php.

52  {
53  return trim((string)$this->_scopeConfig->getValue(
54  self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS,
55  ScopeConfigInterface::SCOPE_TYPE_DEFAULT
56  ));
57  }

◆ render()

Render button

Parameters
\Magento\Framework\Data\Form\Element\AbstractElement$element
Returns
string

Definition at line 85 of file Reset.php.

86  {
87  // Remove scope label
88  $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
89  return parent::render($element);
90  }
$element
Definition: element.phtml:12

Field Documentation

◆ XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS

const XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS = 'design/search_engine_robots/default_custom_instructions'

Pasge robots default instructions

Definition at line 22 of file Reset.php.


The documentation for this class was generated from the following file: