Skip to content

Remove the documentation Hint "(?)" functionality #1536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ protected function _prepareForm()
'required' => true,
'name' => 'store_ids[]',
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(),
'value' => Mage::registry('poll_data')->getStoreIds(),
'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml()
'value' => Mage::registry('poll_data')->getStoreIds()
));
}
else {
Expand Down
39 changes: 0 additions & 39 deletions app/code/core/Mage/Adminhtml/Block/Store/Switcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
*/
class Mage_Adminhtml_Block_Store_Switcher extends Mage_Adminhtml_Block_Template
{
/**
* Key in config for store switcher hint
*/
const XPATH_HINT_KEY = 'store_switcher';

/**
* @var array
*/
Expand Down Expand Up @@ -223,38 +218,4 @@ public function hasDefaultOption($hasDefaultOption = null)
}
return $this->_hasDefaultOption;
}

/**
* Return url for store switcher hint
*
* @return string
*/
public function getHintUrl()
{
if (null === $this->_hintUrl) {
$this->_hintUrl = Mage::helper('core/hint')->getHintByCode(self::XPATH_HINT_KEY);
}
return $this->_hintUrl;
}

/**
* Return store switcher hint html
*
* @return string
*/
public function getHintHtml()
{
$html = '';
$url = $this->getHintUrl();
if ($url) {
$html = '<a'
. ' href="'. $this->escapeUrl($url) . '"'
. ' onclick="this.target=\'_blank\'"'
. ' title="' . Mage::helper('core')->quoteEscape($this->__('What is this?')) . '"'
. ' class="link-store-scope">'
. $this->__('What is this?')
. '</a>';
}
return $html;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,4 @@ public function render(Varien_Data_Form_Element_Abstract $element)
$this->_element = $element;
return $this->toHtml();
}

/**
* Return html for store switcher hint
*
* @return string
*/
public function getHintHtml()
{
return Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,4 @@ public function render(Varien_Data_Form_Element_Abstract $element)
$this->_element = $element;
return $this->toHtml();
}

/**
* Return html for store switcher hint
*
* @return string
*/
public function getHintHtml()
{
return Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml();
}
}
10 changes: 0 additions & 10 deletions app/code/core/Mage/Adminhtml/Block/System/Config/Switcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,4 @@ public function getStoreSelectOptions()

return $options;
}

/**
* Return store switcher hint html
*
* @return mixed
*/
public function getHintHtml()
{
return Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml();
}
}
2 changes: 0 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ public function initTabs()
}
}

Mage::helper('adminhtml')->addPageHelpUrl('/section/' . $current);

return $this;
}

Expand Down
69 changes: 0 additions & 69 deletions app/code/core/Mage/Adminhtml/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,75 +39,6 @@ class Mage_Adminhtml_Helper_Data extends Mage_Adminhtml_Helper_Help_Mapping
const XML_PATH_CUSTOM_ADMIN_PATH = 'default/admin/url/custom_path';
const XML_PATH_ADMINHTML_SECURITY_USE_FORM_KEY = 'admin/security/use_form_key';

protected $_pageHelpUrl;

/**
* Get mapped help pages url
*
* @param null|string $url
* @param null|string $suffix
* @return mixed
*/
public function getPageHelpUrl($url = null, $suffix = null)
{
if (!$this->_pageHelpUrl) {
$this->setPageHelpUrl($url, $suffix);
}
return $this->_pageHelpUrl;
}

/**
* Set help page url
*
* @param null|string $url
* @param null|string $suffix
* @return $this
*/
public function setPageHelpUrl($url = null, $suffix = null)
{
if (is_null($url)) {
$request = Mage::app()->getRequest();
$frontModule = $request->getControllerModule();
if (!$frontModule) {
$frontName = $request->getModuleName();
$router = Mage::app()->getFrontController()->getRouterByFrontName($frontName);

$frontModule = $router->getModuleByFrontName($frontName);
if (is_array($frontModule)) {
$frontModule = $frontModule[0];
}
}
$url = "http://merch.docs.magento.com/{$this->getHelpTargetVersion()}/user_guide/";

$moduleName = $frontModule;
$controllerName = $request->getControllerName();
$actionName = $request->getActionName() . (!is_null($suffix) ? $suffix : '');

if ($mappingUrl = $this->findInMapping($moduleName, $controllerName, $actionName)) {
$url .= $mappingUrl;
} else {
$url = 'http://magento.com/help/documentation';
}

$this->_pageHelpUrl = $url;
}
$this->_pageHelpUrl = $url;

return $this;
}

/**
* Add suffix for help page url
*
* @param string $suffix
* @return $this
*/
public function addPageHelpUrl($suffix)
{
$this->_pageHelpUrl = $this->getPageHelpUrl(null, $suffix);
return $this;
}

public static function getUrl($route='', $params=array())
{
return Mage::getModel('adminhtml/url')->getUrl($route, $params);
Expand Down
6 changes: 0 additions & 6 deletions app/code/core/Mage/Adminhtml/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,6 @@
</input_types>
</validator_data>
</general>
<hints>
<store_switcher>
<url><![CDATA[http://merch.docs.magento.com/ce/user_guide/configuration/scope.html]]></url>
<enabled>1</enabled>
</store_switcher>
</hints>
<help>
<target_version>ce</target_version>
</help>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
</ul>
<?php endif; ?>
<div class="store-scope">
<?php echo $this->getHintHtml() ?>
<div class="tree-store-scope">
<?php foreach ($this->getWebsiteCollection() as $_website): ?>
<div class="website-name">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
?>
<p class="switcher"><label for="store_switcher"><?php echo $this->__('View Statistics For:') ?></label>
<?php echo $this->getHintHtml() ?>
<select name="store_switcher" id="store_switcher" class="left-col-block" onchange="return switchStore(this);">
<option value=""><?php echo $this->__('All Websites') ?></option>
<?php foreach ($this->getWebsiteCollection() as $_website): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
<?php endforeach; ?>
<?php endforeach; ?>
</select>
<?php echo $this->getHintHtml() ?>
<script type="text/javascript">
//<![CDATA[
Event.observe($('store_switcher'), 'change', function(event) {
Expand Down
4 changes: 0 additions & 4 deletions app/design/adminhtml/default/default/template/page/menu.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,4 @@
<!-- menu start -->
<?php echo $this->getMenuLevel($this->getMenuArray()); ?>
<!-- menu end -->

<a id="page-help-link" href="<?php echo Mage::helper('adminhtml')->getPageHelpUrl() ?>"><?php echo $this->__('Get help for this page') ?></a>
<script type="text/javascript">$('page-help-link').target = 'magento_page_help'</script>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<?php endforeach; ?>
<?php endforeach; ?>
</select>
<?php echo $this->getHintHtml() ?>
</p>
<script type="text/javascript">
function switchStore(obj){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<?php endforeach; ?>
<?php endforeach; ?>
</select>
<?php echo $this->getHintHtml() ?>
</p>
<script type="text/javascript">
function switchStore(obj){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
?>
<?php /* @var $this Mage_Adminhtml_Block_Sales_Order_Create_Store_Select */ ?>
<div class="store-scope">
<?php echo $this->getHintHtml() ?>
<div class="tree-store-scope">
<?php foreach ($this->getWebsiteCollection() as $_website): ?>
<?php $showWebsite=false; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
<?php endforeach; ?>
<?php endforeach; ?>
</select>
<?php echo $this->getHintHtml() ?>
</p>
<script type="text/javascript">
function switchStore(obj) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
<?php endforeach; ?>
<?php endforeach; ?>
</select>
<?php echo $this->getHintHtml() ?>
</p>
</div>
<script type="text/javascript">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<div class="fieldset <?php echo $_element->getClass() ?>" id="<?php echo $_element->getHtmlId() ?>">
<?php endif; ?>
<div class="store-scope">
<?php echo $this->getHintHtml() ?>
<div class="tree-store-scope">
<?php if ($_element->getComment()): ?>
<p class="comment"><?php echo $this->escapeHtml($_element->getComment()) ?></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ $_class = $_element->getFieldsetHtmlClass();
<td class="<?php echo $_element->hasValueClass() ? $_element->getValueClass() : 'value' ?><?php echo $_class ? " {$_class}-value" : ''?>">
<div class="store-scope">
<?php echo trim($_element->getElementHtml()) ?>
<?php echo $this->getHintHtml() ?>
</div>
<?php if ($_note): ?>
<p class="note<?php echo $_class ? " {$_class}-note" : ''?>" id="note_<?php echo $_element->getId()?>"><span><?php echo $_note ?></span></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
/* @var $this Mage_Core_Block_Template */ ?>
<div class="switcher">
<label for="store_switcher"><?php echo $this->__('Current Configuration Scope:') ?></label>
<?php echo $this->getHintHtml() ?>
<select id="store_switcher" class="system-config-store-switcher" onchange="location.href=this.options[this.selectedIndex].getAttribute('url')">
<?php foreach ($this->getStoreSelectOptions() as $_value => $_option): ?>
<?php if (isset($_option['is_group'])): ?>
Expand Down
1 change: 0 additions & 1 deletion app/locale/en_US/Mage_Adminhtml.csv
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,6 @@
"General Information","General Information"
"General Section","General Section"
"Get Image Base64","Get Image Base64"
"Get help for this page","Get help for this page"
"Give the verifier code to application administrator","Give the verifier code to application administrator"
"Global Attribute","Global Attribute"
"Global Record Search","Global Record Search"
Expand Down