Skip to content
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

Mage_Cms - DOC block update #694

Merged
merged 4 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 3 additions & 3 deletions app/code/core/Mage/Cms/Block/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/


/**
* Cms block content block
*
* @method int getBlockId()
*
* @category Mage
* @package Mage_Cms
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Cms_Block_Block extends Mage_Core_Block_Abstract
{

/**
* Initialize cache
*
Expand Down Expand Up @@ -63,7 +63,7 @@ protected function _toHtml()
->setStoreId(Mage::app()->getStore()->getId())
->load($blockId);
if ($block->getIsActive()) {
/* @var $helper Mage_Cms_Helper_Data */
/* @var Mage_Cms_Helper_Data $helper */
$helper = Mage::helper('cms');
$processor = $helper->getBlockTemplateProcessor();
$html = $processor->filter($block->getContent());
Expand Down
9 changes: 4 additions & 5 deletions app/code/core/Mage/Cms/Block/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/


/**
* Cms page content block
*
* @method int getPageId()
*
* @category Mage
* @package Mage_Cms
* @author Magento Core Team <core@magentocommerce.com>
Expand Down Expand Up @@ -56,9 +57,7 @@ public function getPage()
}

/**
* Prepare global layout
*
* @return $this
* @inheritDoc
*/
protected function _prepareLayout()
{
Expand Down Expand Up @@ -120,7 +119,7 @@ protected function _prepareLayout()
*/
protected function _toHtml()
{
/* @var $helper Mage_Cms_Helper_Data */
/* @var Mage_Cms_Helper_Data $helper */
$helper = Mage::helper('cms');
$processor = $helper->getPageTemplateProcessor();
$html = $processor->filter($this->getPage()->getContent());
Expand Down
5 changes: 4 additions & 1 deletion app/code/core/Mage/Cms/Block/Widget/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
* @category Mage
* @package Mage_Cms
* @author Magento Core Team <core@magentocommerce.com>
*
* @method int getBlockId()
* @method $this setText(string $value)
*/
class Mage_Cms_Block_Widget_Block extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface
{
Expand Down Expand Up @@ -78,7 +81,7 @@ protected function _beforeToHtml()
->setStoreId(Mage::app()->getStore()->getId())
->load($blockId);
if ($block->getIsActive()) {
/* @var $helper Mage_Cms_Helper_Data */
/* @var Mage_Cms_Helper_Data $helper */
$helper = Mage::helper('cms');
$processor = $helper->getBlockTemplateProcessor();
$this->setText($processor->filter($block->getContent()));
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Cms/Block/Widget/Page/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Mage_Cms_Block_Widget_Page_Link
/**
* Prepared href attribute
*
* @var string
* @var string|null
*/
protected $_href;

Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Cms/Controller/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/


/**
* Cms Controller Router
*
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Cms/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Mage_Cms_Helper_Data extends Mage_Core_Helper_Abstract
/**
* Retrieve Template processor for Page Content
*
* @return Varien_Filter_Template
* @return Mage_Core_Model_Abstract
*/
public function getPageTemplateProcessor()
{
Expand All @@ -52,7 +52,7 @@ public function getPageTemplateProcessor()
/**
* Retrieve Template processor for Block Content
*
* @return Varien_Filter_Template
* @return Mage_Core_Model_Abstract
*/
sreichel marked this conversation as resolved.
Show resolved Hide resolved
public function getBlockTemplateProcessor()
{
Expand Down
13 changes: 6 additions & 7 deletions app/code/core/Mage/Cms/Helper/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Mage_Cms_Helper_Page extends Mage_Core_Helper_Abstract
* Call from controller action
*
* @param Mage_Core_Controller_Front_Action $action
* @param integer $pageId
* @param string $pageId
* @return boolean
*/
public function renderPage(Mage_Core_Controller_Front_Action $action, $pageId = null)
Expand All @@ -55,14 +55,13 @@ public function renderPage(Mage_Core_Controller_Front_Action $action, $pageId =
/**
* Renders CMS page
*
* @param Mage_Core_Controller_Front_Action $action
* @param integer $pageId
* @param Mage_Core_Controller_Varien_Action $action
* @param string $pageId
* @param bool $renderLayout
* @return boolean
*/
protected function _renderPage(Mage_Core_Controller_Varien_Action $action, $pageId = null, $renderLayout = true)
{

$page = Mage::getSingleton('cms/page');
if (!is_null($pageId) && $pageId!==$page->getId()) {
$delimeterPosition = strrpos($pageId, '|');
Expand Down Expand Up @@ -146,8 +145,8 @@ protected function _renderPage(Mage_Core_Controller_Varien_Action $action, $pag
* Also takes third parameter which allows not run renderLayout method.
*
* @param Mage_Core_Controller_Varien_Action $action
* @param $pageId
* @param $renderLayout
* @param string $pageId
* @param bool $renderLayout
* @return bool
*/
public function renderPageExtended(Mage_Core_Controller_Varien_Action $action, $pageId = null, $renderLayout = true)
Expand All @@ -159,7 +158,7 @@ public function renderPageExtended(Mage_Core_Controller_Varien_Action $action, $
* Retrieve page direct URL
*
* @param string $pageId
* @return string
* @return string|null
*/
public function getPageUrl($pageId = null)
{
Expand Down
14 changes: 7 additions & 7 deletions app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
*/
class Mage_Cms_Helper_Wysiwyg_Images extends Mage_Core_Helper_Abstract
{

/**
* Current directory path
* @var string
* @var string|false
*/
protected $_currentPath;

Expand All @@ -51,14 +50,15 @@ class Mage_Cms_Helper_Wysiwyg_Images extends Mage_Core_Helper_Abstract

/**
* Image Storage root directory
* @var string
* @var string|false
*/
protected $_storageRoot;

/**
* Set a specified store ID value
*
* @param <type> $store
* @param int $store
* @return $this
*/
public function setStoreId($store)
{
Expand Down Expand Up @@ -207,7 +207,7 @@ public function getImageHtmlDeclaration($filename, $renderAsTag = false)
* Try to create target directory if it doesn't exist
*
* @throws Mage_Core_Exception
* @return string
* @return string|false
*/
public function getCurrentPath()
{
Expand Down Expand Up @@ -251,7 +251,7 @@ public function getCurrentUrl()
/**
* Storage model singleton
*
* @return Mage_Cms_Model_Page_Wysiwyg_Images_Storage
* @return Mage_Cms_Model_Wysiwyg_Images_Storage
*/
public function getStorage()
{
Expand All @@ -273,7 +273,7 @@ public function idEncode($string)
* Revert opration to idEncode
*
* @param string $string
* @return string
* @return string|false
*/
public function idDecode($string)
{
Expand Down
15 changes: 9 additions & 6 deletions app/code/core/Mage/Cms/Model/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,20 @@
* @method Mage_Cms_Model_Resource_Block _getResource()
* @method Mage_Cms_Model_Resource_Block getResource()
* @method string getTitle()
* @method Mage_Cms_Model_Block setTitle(string $value)
* @method $this setTitle(string $value)
* @method string getIdentifier()
* @method Mage_Cms_Model_Block setIdentifier(string $value)
* @method $this setIdentifier(string $value)
* @method string getContent()
* @method Mage_Cms_Model_Block setContent(string $value)
* @method $this setContent(string $value)
* @method string getCreationTime()
* @method Mage_Cms_Model_Block setCreationTime(string $value)
* @method $this setCreationTime(string $value)
* @method string getUpdateTime()
* @method Mage_Cms_Model_Block setUpdateTime(string $value)
* @method $this setUpdateTime(string $value)
* @method int getIsActive()
* @method Mage_Cms_Model_Block setIsActive(int $value)
* @method $this setIsActive(int $value)
* @method $this setStoreId(int $storeId)
* @method int getStoreId()
* @method int getBlockId()
*
* @category Mage
* @package Mage_Cms
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Cms/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Mage_Cms_Model_Observer
/**
* Modify No Route Forward object
*
* @param Varien_Event_Observer $observer
* @param Varien_Event_Observer|Mage_Core_Helper_Object_Observer_Controller_Action $observer
* @return $this
*/
public function noRoute(Varien_Event_Observer $observer)
Expand Down
47 changes: 24 additions & 23 deletions app/code/core/Mage/Cms/Model/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,44 @@
* @method Mage_Cms_Model_Resource_Page _getResource()
* @method Mage_Cms_Model_Resource_Page getResource()
* @method string getTitle()
* @method Mage_Cms_Model_Page setTitle(string $value)
* @method $this setTitle(string $value)
* @method string getRootTemplate()
* @method Mage_Cms_Model_Page setRootTemplate(string $value)
* @method $this setRootTemplate(string $value)
* @method string getMetaKeywords()
* @method Mage_Cms_Model_Page setMetaKeywords(string $value)
* @method $this setMetaKeywords(string $value)
* @method string getMetaDescription()
* @method Mage_Cms_Model_Page setMetaDescription(string $value)
* @method $this setMetaDescription(string $value)
* @method string getIdentifier()
* @method Mage_Cms_Model_Page setIdentifier(string $value)
* @method $this setIdentifier(string $value)
* @method string getContentHeading()
* @method Mage_Cms_Model_Page setContentHeading(string $value)
* @method $this setContentHeading(string $value)
* @method string getContent()
* @method Mage_Cms_Model_Page setContent(string $value)
* @method $this setContent(string $value)
* @method string getCreationTime()
* @method Mage_Cms_Model_Page setCreationTime(string $value)
* @method $this setCreationTime(string $value)
* @method string getUpdateTime()
* @method Mage_Cms_Model_Page setUpdateTime(string $value)
* @method $this setUpdateTime(string $value)
* @method int getIsActive()
* @method Mage_Cms_Model_Page setIsActive(int $value)
* @method $this setIsActive(int $value)
* @method int getSortOrder()
* @method Mage_Cms_Model_Page setSortOrder(int $value)
* @method $this setSortOrder(int $value)
* @method string getLayoutUpdateXml()
* @method Mage_Cms_Model_Page setLayoutUpdateXml(string $value)
* @method $this setLayoutUpdateXml(string $value)
* @method string getCustomTheme()
* @method Mage_Cms_Model_Page setCustomTheme(string $value)
* @method $this setCustomTheme(string $value)
* @method string getCustomRootTemplate()
* @method Mage_Cms_Model_Page setCustomRootTemplate(string $value)
* @method $this setCustomRootTemplate(string $value)
* @method string getCustomLayoutUpdateXml()
* @method Mage_Cms_Model_Page setCustomLayoutUpdateXml(string $value)
* @method $this setCustomLayoutUpdateXml(string $value)
* @method string getCustomThemeFrom()
* @method Mage_Cms_Model_Page setCustomThemeFrom(string $value)
* @method $this setCustomThemeFrom(string $value)
* @method string getCustomThemeTo()
* @method Mage_Cms_Model_Page setCustomThemeTo(string $value)
* @method $this setCustomThemeTo(string $value)
* @method $this setStoreId(int $value)
* @method bool hasCreationTime()
* @method bool hasStores()
* @method string getStoreId()
* @method array getStores()
*
* @category Mage
* @package Mage_Cms
Expand Down Expand Up @@ -99,11 +104,7 @@ protected function _construct()
}

/**
* Load object data
*
* @param mixed $id
* @param string $field
* @return $this
* @inheritDoc
*/
public function load($id, $field=null)
{
Expand All @@ -129,7 +130,7 @@ public function noRoutePage()
*
* @param string $identifier
* @param int $storeId
* @return int
* @return string
*/
public function checkIdentifier($identifier, $storeId)
{
Expand Down
22 changes: 4 additions & 18 deletions app/code/core/Mage/Cms/Model/Resource/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ protected function _construct()
}

/**
* Process block data before deleting
*
* @param Mage_Core_Model_Abstract $object
* @return Mage_Cms_Model_Resource_Page
* @inheritDoc
*/
protected function _beforeDelete(Mage_Core_Model_Abstract $object)
{
Expand Down Expand Up @@ -80,10 +77,7 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object)
}

/**
* Perform operations after object save
*
* @param Mage_Core_Model_Abstract $object
* @return $this
* @inheritDoc
*/
protected function _afterSave(Mage_Core_Model_Abstract $object)
{
Expand Down Expand Up @@ -121,12 +115,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object)
}

/**
* Load an object using 'identifier' field if there's no field specified and value is not numeric
*
* @param Mage_Core_Model_Abstract $object
* @param mixed $value
* @param string $field
* @return $this
* @inheritDoc
*/
public function load(Mage_Core_Model_Abstract $object, $value, $field = null)
{
Expand All @@ -138,10 +127,7 @@ public function load(Mage_Core_Model_Abstract $object, $value, $field = null)
}

/**
* Perform operations after object load
*
* @param Mage_Core_Model_Abstract $object
* @return $this
* @inheritDoc
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
Expand Down
Loading