Skip to content

Commit

Permalink
[Backport] Remove documentation hints, ref #1536 (#2815)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel authored Dec 18, 2022
1 parent 7226af8 commit 4d1869e
Show file tree
Hide file tree
Showing 36 changed files with 59 additions and 190 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Do not use 20.x.x if you need IE support.
- removed module `Mage_PageCache` [#2258](https://github.com/OpenMage/magento-lts/pull/2258)
- removed lib/flex containing unused ActionScript "file uploader" files [#2271](https://github.com/OpenMage/magento-lts/pull/2271)
- enabled website level config cache [#2355](https://github.com/OpenMage/magento-lts/pull/2355)
- make overrides of Mage_Core_Model_Resource_Db_Abstract::delete respect parent api [#1257](https://github.com/OpenMage/magento-lts/pull/1257)

For full list of changes, you can [compare tags](https://github.com/OpenMage/magento-lts/compare/1.9.4.x...20.0).

Expand Down
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 @@ -62,8 +62,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 {
$fieldset->addField('store_ids', 'hidden', [
Expand Down
80 changes: 32 additions & 48 deletions app/code/core/Mage/Adminhtml/Block/Store/Switcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
*/
class Mage_Adminhtml_Block_Store_Switcher extends Mage_Adminhtml_Block_Template
{
/**
* Key in config for store switcher hint
*/
public const XPATH_HINT_KEY = 'store_switcher';

/**
* @var array
*/
Expand All @@ -45,13 +40,6 @@ class Mage_Adminhtml_Block_Store_Switcher extends Mage_Adminhtml_Block_Template
*/
protected $_storeVarName = 'store';

/**
* Url for store switcher hint
*
* @var string
*/
protected $_hintUrl;

/**
* @var bool
*/
Expand All @@ -67,6 +55,8 @@ public function __construct()
}

/**
* @return Mage_Core_Model_Resource_Website_Collection
* @throws Mage_Core_Exception
* @deprecated
*/
public function getWebsiteCollection()
Expand Down Expand Up @@ -100,6 +90,8 @@ public function getWebsites()
}

/**
* @param Mage_Core_Model_Website|int|string $website
* @return Mage_Core_Model_Resource_Store_Group_Collection
* @deprecated
*/
public function getGroupCollection($website)
Expand All @@ -113,7 +105,7 @@ public function getGroupCollection($website)
/**
* Get store groups for specified website
*
* @param Mage_Core_Model_Website $website
* @param Mage_Core_Model_Website|int|string|null $website
* @return array
*/
public function getStoreGroups($website)
Expand All @@ -125,6 +117,8 @@ public function getStoreGroups($website)
}

/**
* @param Mage_Core_Model_Store_Group|int|string $group
* @return Mage_Core_Model_Resource_Store_Collection
* @deprecated
*/
public function getStoreCollection($group)
Expand All @@ -143,7 +137,7 @@ public function getStoreCollection($group)
/**
* Get store views for specified store group
*
* @param Mage_Core_Model_Store_Group $group
* @param Mage_Core_Model_Store_Group|int|string|null $group
* @return array
*/
public function getStores($group)
Expand All @@ -162,6 +156,9 @@ public function getStores($group)
return $stores;
}

/**
* @return string
*/
public function getSwitchUrl()
{
if ($url = $this->getData('switch_url')) {
Expand All @@ -170,33 +167,54 @@ public function getSwitchUrl()
return $this->getUrl('*/*/*', ['_current' => true, $this->_storeVarName => null]);
}

/**
* @param string $varName
* @return $this
*/
public function setStoreVarName($varName)
{
$this->_storeVarName = $varName;
return $this;
}

/**
* @return mixed
* @throws Exception
*/
public function getStoreId()
{
return $this->getRequest()->getParam($this->_storeVarName);
}

/**
* @param array $storeIds
* @return $this
*/
public function setStoreIds($storeIds)
{
$this->_storeIds = $storeIds;
return $this;
}

/**
* @return array
*/
public function getStoreIds()
{
return $this->_storeIds;
}

/**
* @return bool
*/
public function isShow()
{
return !Mage::app()->isSingleStoreMode();
}

/**
* @return string
*/
protected function _toHtml()
{
if (!Mage::app()->isSingleStoreMode()) {
Expand All @@ -218,38 +236,4 @@ public function hasDefaultOption($hasDefaultOption = null)
}
return $this->_hasDefaultOption;
}

/**
* Return url for store switcher hint
*
* @return string
*/
public function getHintUrl()
{
if ($this->_hintUrl === null) {
$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 @@ -60,14 +60,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 @@ -60,14 +60,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 @@ -106,14 +106,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 @@ -125,8 +125,6 @@ public function initTabs()
}
}

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

return $this;
}

Expand Down
42 changes: 15 additions & 27 deletions app/code/core/Mage/Adminhtml/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ class Mage_Adminhtml_Helper_Data extends Mage_Adminhtml_Helper_Help_Mapping

protected $_moduleName = 'Mage_Adminhtml';

/**
* @var string
* @deprecated
*/
protected $_pageHelpUrl;

/**
Expand All @@ -44,6 +48,7 @@ class Mage_Adminhtml_Helper_Data extends Mage_Adminhtml_Helper_Help_Mapping
* @param null|string $url
* @param null|string $suffix
* @return mixed
* @deprecated
*/
public function getPageHelpUrl($url = null, $suffix = null)
{
Expand All @@ -59,37 +64,11 @@ public function getPageHelpUrl($url = null, $suffix = null)
* @param null|string $url
* @param null|string $suffix
* @return $this
* @deprecated
*/
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;
}

Expand All @@ -98,18 +77,27 @@ public function setPageHelpUrl($url = null, $suffix = null)
*
* @param string $suffix
* @return $this
* @deprecated
*/
public function addPageHelpUrl($suffix)
{
$this->_pageHelpUrl = $this->getPageHelpUrl(null, $suffix);
return $this;
}

/**
* @param string $route
* @param array $params
* @return string
*/
public static function getUrl($route = '', $params = [])
{
return Mage::getModel('adminhtml/url')->getUrl($route, $params);
}

/**
* @return false|int
*/
public function getCurrentUserId()
{
if (Mage::getSingleton('admin/session')->getUser()) {
Expand Down
6 changes: 3 additions & 3 deletions app/code/core/Mage/Adminhtml/Model/Email/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public function getSystemConfigPathsWhereUsedAsDefault()
if (!$templateCode) {
return [];
}
$paths = [];

$paths = [];
$configSections = Mage::getSingleton('adminhtml/config')->getSections();

// find nodes which are using $templateCode value
Expand Down Expand Up @@ -76,13 +76,13 @@ public function getSystemConfigPathsWhereUsedCurrently()
if (!$templateId) {
return [];
}
$paths = [];

$paths = [];
$configSections = Mage::getSingleton('adminhtml/config')->getSections();

// look for node entries in all system.xml that use source_model=adminhtml/system_config_source_email_template
// they are will be templates, what we try find
$sysCfgNodes = $configSections->xpath(self::XML_PATH_TEMPLATE_EMAIL);
$sysCfgNodes = $configSections->xpath(self::XML_PATH_TEMPLATE_EMAIL);
if (!is_array($sysCfgNodes)) {
return [];
}
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 @@ -219,12 +219,6 @@
</input_types>
</validator_data>
</general>
<hints>
<store_switcher>
<url><![CDATA[https://web.archive.org/web/20170529192915/http://docs.magento.com/m1/ce/user_guide/configuration/scope.html]]></url>
<enabled>1</enabled>
</store_switcher>
</hints>
<help>
<target_version>ce</target_version>
</help>
Expand Down
1 change: 1 addition & 0 deletions app/code/core/Mage/Core/Model/Resource/Db/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ public function forsedSave(Mage_Core_Model_Abstract $object)
*
* @param Mage_Core_Model_Abstract $object
* @return $this
* @throws Exception
*/
public function delete(Mage_Core_Model_Abstract $object)
{
Expand Down
1 change: 1 addition & 0 deletions app/code/core/Mage/Page/Block/Html/Head.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function addCssIe($name, $params = "", $referenceName = "*", $before = nu
* @param string $referenceName
* @param bool $before
* @return $this
* @deprecated
*/
public function addJsIe($name, $params = "", $referenceName = "*", $before = null)
{
Expand Down
1 change: 1 addition & 0 deletions app/code/core/Mage/Wishlist/Model/Item/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* @method string getCode()
* @method int getProductId()
* @method $this setProductId(int $value)
* @method int getWishlistItemId()
* @method $this setWishlistItemId(int $value)
* @method $this setValue(string $sBuyRequest)
*/
Expand Down
Loading

0 comments on commit 4d1869e

Please sign in to comment.