Skip to content

Updated phpdocs #2796

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 1 commit into from
Dec 15, 2022
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
6 changes: 4 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ public function __construct()
) . '\')) editForm.submit(\'' . $this->getUrl('*/*/delete') . '\'); return false;');
}

/**
* @return string
*/
public function getHeaderText()
{
if (Mage::registry('api_user')->getId()) {
return Mage::helper('adminhtml')->__("Edit User '%s'", $this->escapeHtml(Mage::registry('api_user')->getUsername()));
} else {
return Mage::helper('adminhtml')->__('New User');
}
return Mage::helper('adminhtml')->__('New User');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public function __construct()
}
}

/**
* @return string
*/
public function getHeaderText()
{
if (Mage::registry('entity_attribute')->getId()) {
Expand All @@ -76,16 +79,21 @@ public function getHeaderText()
$frontendLabel = $frontendLabel[0];
}
return Mage::helper('catalog')->__('Edit Product Attribute "%s"', $this->escapeHtml($frontendLabel));
} else {
return Mage::helper('catalog')->__('New Product Attribute');
}
return Mage::helper('catalog')->__('New Product Attribute');
}

/**
* @return string
*/
public function getValidationUrl()
{
return $this->getUrl('*/*/validate', ['_current' => true]);
}

/**
* @return string
*/
public function getSaveUrl()
{
return $this->getUrl('*/' . $this->_controller . '/save', ['_current' => true, 'back' => null]);
Expand Down
6 changes: 4 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ public function __construct()
$this->_updateButton('delete', 'label', Mage::helper('catalog')->__('Delete Search'));
}

/**
* @return string
*/
public function getHeaderText()
{
if (Mage::registry('current_catalog_search')->getId()) {
return Mage::helper('catalog')->__("Edit Search '%s'", $this->escapeHtml(Mage::registry('current_catalog_search')->getQueryText()));
} else {
return Mage::helper('catalog')->__('New Search');
}
return Mage::helper('catalog')->__('New Search');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public function getHeaderText()
{
if (Mage::registry('checkout_agreement')->getId()) {
return Mage::helper('checkout')->__('Edit Terms and Conditions');
} else {
return Mage::helper('checkout')->__('New Terms and Conditions');
}
return Mage::helper('checkout')->__('New Terms and Conditions');
}
}
3 changes: 1 addition & 2 deletions app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ public function getHeaderText()
{
if (Mage::registry('cms_block')->getId()) {
return Mage::helper('cms')->__("Edit Block '%s'", $this->escapeHtml(Mage::registry('cms_block')->getTitle()));
} else {
return Mage::helper('cms')->__('New Block');
}
return Mage::helper('cms')->__('New Block');
}
}
7 changes: 2 additions & 5 deletions app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ public function getHeaderText()
{
if (Mage::registry('cms_page')->getId()) {
return Mage::helper('cms')->__("Edit Page '%s'", $this->escapeHtml(Mage::registry('cms_page')->getTitle()));
} else {
return Mage::helper('cms')->__('New Page');
}
return Mage::helper('cms')->__('New Page');
}

/**
Expand Down Expand Up @@ -97,9 +96,7 @@ protected function _getSaveAndContinueUrl()
}

/**
* Prepare layout
*
* @return Mage_Core_Block_Abstract
* @inheritDoc
*/
protected function _prepareLayout()
{
Expand Down
18 changes: 16 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Customer/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public function __construct()
}
}

/**
* @return string
*/
public function getCreateOrderUrl()
{
return $this->getUrl('*/sales_order_create/start', ['customer_id' => $this->getCustomerId()]);
Expand All @@ -68,13 +71,15 @@ public function getCustomerId()
return Mage::registry('current_customer')->getId();
}

/**
* @return string
*/
public function getHeaderText()
{
if (Mage::registry('current_customer')->getId()) {
return $this->escapeHtml(Mage::registry('current_customer')->getName());
} else {
return Mage::helper('customer')->__('New Customer');
}
return Mage::helper('customer')->__('New Customer');
}

/**
Expand All @@ -89,11 +94,17 @@ public function getFormHtml()
return $html;
}

/**
* @return string
*/
public function getValidationUrl()
{
return $this->getUrl('*/*/validate', ['_current' => true]);
}

/**
* @inheritDoc
*/
protected function _prepareLayout()
{
if (!Mage::registry('current_customer')->isReadonly()) {
Expand All @@ -107,6 +118,9 @@ protected function _prepareLayout()
return parent::_prepareLayout();
}

/**
* @return string
*/
protected function _getSaveAndContinueUrl()
{
return $this->getUrl('*/*/save', [
Expand Down
13 changes: 11 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public function __construct()
}
}

/**
* @return string
* @throws Exception
*/
public function getDeleteUrl()
{
if (!Mage::getSingleton('adminhtml/url')->useSecretKey()) {
Expand All @@ -55,15 +59,20 @@ public function getDeleteUrl()
}
}

/**
* @return string
*/
public function getHeaderText()
{
if (!is_null(Mage::registry('current_group')->getId())) {
return Mage::helper('customer')->__('Edit Customer Group "%s"', $this->escapeHtml(Mage::registry('current_group')->getCustomerGroupCode()));
} else {
return Mage::helper('customer')->__('New Customer Group');
}
return Mage::helper('customer')->__('New Customer Group');
}

/**
* @return string
*/
public function getHeaderCssClass()
{
return 'icon-head head-customer-groups';
Expand Down
9 changes: 9 additions & 0 deletions app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,26 @@ public function __construct()
$this->setTemplate('newsletter/template/list.phtml');
}

/**
* @inheritDoc
*/
protected function _prepareLayout()
{
$this->setChild('grid', $this->getLayout()->createBlock('adminhtml/newsletter_template_grid', 'newsletter.template.grid'));
return parent::_prepareLayout();
}

/**
* @return string
*/
public function getCreateUrl()
{
return $this->getUrl('*/*/new');
}

/**
* @return string
*/
public function getHeaderText()
{
return Mage::helper('newsletter')->__('Newsletter Templates');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ public function getModel()
}

/**
* Preparing block layout
*
* @return $this
* @inheritDoc
*/
protected function _prepareLayout()
{
Expand Down Expand Up @@ -254,7 +252,6 @@ public function getHeaderText()
if ($this->getEditMode()) {
return Mage::helper('newsletter')->__('Edit Newsletter Template');
}

return Mage::helper('newsletter')->__('New Newsletter Template');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ public function getHeaderText()
{
if (Mage::registry('permissions_block')->getId()) {
return Mage::helper('adminhtml')->__("Edit Block '%s'", $this->escapeHtml(Mage::registry('permissions_block')->getBlockName()));
} else {
return Mage::helper('adminhtml')->__('New block');
}
return Mage::helper('adminhtml')->__('New block');
}
}
6 changes: 4 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ public function __construct()
) . '\')) editForm.submit(\'' . $this->getUrl('*/*/delete') . '\'); return false;');
}

/**
* @return string
*/
public function getHeaderText()
{
if (Mage::registry('permissions_user')->getId()) {
return Mage::helper('adminhtml')->__("Edit User '%s'", $this->escapeHtml(Mage::registry('permissions_user')->getUsername()));
} else {
return Mage::helper('adminhtml')->__('New User');
}
return Mage::helper('adminhtml')->__('New User');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public function getHeaderText()
{
if (Mage::registry('permissions_variable')->getId()) {
return Mage::helper('adminhtml')->__("Edit Variable '%s'", $this->escapeHtml(Mage::registry('permissions_variable')->getVariableName()));
} else {
return Mage::helper('adminhtml')->__('New Variable');
}
return Mage::helper('adminhtml')->__('New Variable');
}
}
3 changes: 3 additions & 0 deletions app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public function __construct()
$this->_updateButton('delete', 'label', Mage::helper('poll')->__('Delete Answer'));
}

/**
* @return string
*/
public function getHeaderText()
{
return Mage::helper('poll')->__("Edit Answer '%s'", $this->escapeHtml(Mage::registry('answer_data')->getAnswerTitle()));
Expand Down
6 changes: 4 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Poll/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ public function __construct()
$this->setValidationUrl($this->getUrl('*/*/validate', ['id' => $this->getRequest()->getParam($this->_objectId)]));
}

/**
* @return string
*/
public function getHeaderText()
{
if (Mage::registry('poll_data') && Mage::registry('poll_data')->getId()) {
return Mage::helper('poll')->__("Edit Poll '%s'", $this->escapeHtml(Mage::registry('poll_data')->getPollTitle()));
} else {
return Mage::helper('poll')->__('New Poll');
}
return Mage::helper('poll')->__('New Poll');
}
}
3 changes: 1 addition & 2 deletions app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ public function getHeaderText()
$rule = Mage::registry('current_promo_catalog_rule');
if ($rule->getRuleId()) {
return Mage::helper('catalogrule')->__("Edit Rule '%s'", $this->escapeHtml($rule->getName()));
} else {
return Mage::helper('catalogrule')->__('New Rule');
}
return Mage::helper('catalogrule')->__('New Rule');
}
}
3 changes: 1 addition & 2 deletions app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ public function getHeaderText()
$rule = Mage::registry('current_promo_quote_rule');
if ($rule->getRuleId()) {
return Mage::helper('salesrule')->__("Edit Rule '%s'", $this->escapeHtml($rule->getName()));
} else {
return Mage::helper('salesrule')->__('New Rule');
}
return Mage::helper('salesrule')->__('New Rule');
}

/**
Expand Down
6 changes: 4 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Rating/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ public function __construct()
}
}

/**
* @return string
*/
public function getHeaderText()
{
if (Mage::registry('rating_data') && Mage::registry('rating_data')->getId()) {
return Mage::helper('rating')->__("Edit Rating", $this->escapeHtml(Mage::registry('rating_data')->getRatingCode()));
} else {
return Mage::helper('rating')->__('New Rating');
}
return Mage::helper('rating')->__('New Rating');
}
}
3 changes: 3 additions & 0 deletions app/code/core/Mage/Adminhtml/Block/Review/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ public function __construct()
';
}

/**
* @return string
*/
public function getHeaderText()
{
return Mage::helper('review')->__('Add New Review');
Expand Down
6 changes: 4 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Review/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ public function __construct()
';
}

/**
* @return string
*/
public function getHeaderText()
{
if (Mage::registry('review_data') && Mage::registry('review_data')->getId()) {
return Mage::helper('review')->__("Edit Review '%s'", $this->escapeHtml(Mage::registry('review_data')->getTitle()));
} else {
return Mage::helper('review')->__('New Review');
}
return Mage::helper('review')->__('New Review');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ public function __construct()
$this->setId('sales_order_create_billing_method');
}

/**
* @return string
*/
public function getHeaderText()
{
return Mage::helper('sales')->__('Payment Method');
}

/**
* @return string
*/
public function getHeaderCssClass()
{
return 'head-payment-method';
Expand Down
Loading