本文整理汇总了PHP中Mage_Core_Model_Website::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Website::getName方法的具体用法?PHP Mage_Core_Model_Website::getName怎么用?PHP Mage_Core_Model_Website::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Website
的用法示例。
在下文中一共展示了Mage_Core_Model_Website::getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLoad
public function testLoad()
{
/* Test loading by id */
$this->assertEquals(1, $this->_model->getId());
$this->assertEquals('base', $this->_model->getCode());
$this->assertEquals('Main Website', $this->_model->getName());
/* Test loading by code */
$this->_model->load('admin');
$this->assertEquals(0, $this->_model->getId());
$this->assertEquals('admin', $this->_model->getCode());
$this->assertEquals('Admin', $this->_model->getName());
}
示例2: _addWebsiteFieldset
/**
* Method add website fieldset to the form.
* @param Mage_Core_Model_Website $website
*/
private function _addWebsiteFieldset($website, $form)
{
$prefixWeb = 'website-' . $website->getCode();
/* make fieldset */
$layoutFieldset = $form->addFieldset($prefixWeb . '_fieldset', array('legend' => Mage::helper('mturbo')->__($website->getName() . ' settings'), 'class' => 'fieldset'));
/* add extra user control */
$layoutFieldset->addType('html_element', Artio_MTurbo_Helper_Data::FORM_HTML);
$layoutFieldset->addType('widget_button', Artio_MTurbo_Helper_Data::FORM_WIDGET_BUTTON);
/* indicator whether website is enabled */
$layoutFieldset->addField($prefixWeb . '-enabled', 'select', array('name' => $prefixWeb . '-enabled', 'label' => Mage::helper('mturbo')->__('Enable website') . ':', 'value' => '1', 'options' => array(0 => Mage::helper('mturbo')->__('No'), 1 => Mage::helper('mturbo')->__('Yes'))));
/* add field for turbopath */
$layoutFieldset->addField($prefixWeb . '-base_dir', 'text', array('name' => $prefixWeb . '-base_dir', 'value' => Mage::getBaseDir(), 'label' => Mage::helper('mturbo')->__('Base directory') . ':'));
/* add field for server name */
$layoutFieldset->addField($prefixWeb . '-server_name', 'text', array('name' => $prefixWeb . '-server_name', 'value' => Mage::helper('mturbo/website')->getServerName($website->getDefaultStore()->getCode()), 'label' => Mage::helper('mturbo')->__('Server name') . ':'));
/* every store has one select determines whether enabled is */
foreach ($website->getStores() as $store) {
if ($store->getIsActive()) {
$layoutFieldset->addField($prefixWeb . '-store-' . $store->getCode(), 'select', array('name' => $prefixWeb . '-store-' . $store->getCode(), 'label' => $store->getGroup()->getName() . '<br />' . $store->getName(), 'value' => '1', 'options' => array(0 => Mage::helper('mturbo')->__('No'), 1 => Mage::helper('mturbo')->__('Yes'))));
}
}
}
示例3: _addWebsiteFieldset
/**
* Method add website fieldset to the form.
* @param Mage_Core_Model_Website $website
*/
private function _addWebsiteFieldset($website)
{
$prefixWeb = 'website-' . $website->getCode();
/* make fieldset */
$layoutFieldset = $this->form->addFieldset($prefixWeb . '_fieldset', array('legend' => $this->getMyHelper()->__($website->getName() . ' settings'), 'class' => 'fieldset'));
/* add extra user control */
$layoutFieldset->addType('html_element', Artio_MTurbo_Helper_Data::FORM_HTML);
$layoutFieldset->addType('widget_button', Artio_MTurbo_Helper_Data::FORM_WIDGET_BUTTON);
/* indicator whether website is enabled */
$layoutFieldset->addField($prefixWeb . '-enabled', 'select', array('name' => $prefixWeb . '-enabled', 'label' => $this->getMyHelper()->__('Enable website') . ':', 'options' => array(0 => $this->getMyHelper()->__('No'), 1 => $this->getMyHelper()->__('Yes'))));
/* add field for base dir */
$layoutFieldset->addField($prefixWeb . '-base_dir', 'text', array('name' => $prefixWeb . '-base_dir', 'label' => $this->getMyHelper()->__('Base directory') . ':'));
/* add field for server name */
$layoutFieldset->addField($prefixWeb . '-server_name', 'text', array('name' => $prefixWeb . '-server_name', 'label' => $this->getMyHelper()->__('Server name') . ':'));
$layoutFieldset->addField($prefixWeb . '_dec1', 'html_element', array('label' => '<h4>' . $this->getMyHelper()->__('Enable/Disable Storeview') . '</h4>', 'code' => '<div style="height:10px;border-bottom:1px solid #808080"></div>'));
/* every store has one select determines whether enabled is */
foreach ($website->getStores() as $store) {
if ($store->getIsActive()) {
$layoutFieldset->addField($prefixWeb . '-store-' . $store->getCode(), 'select', array('name' => $prefixWeb . '-store-' . $store->getCode(), 'label' => $store->getGroup()->getName() . '<br />' . $store->getName(), 'options' => array(0 => $this->getMyHelper()->__('No'), 1 => $this->getMyHelper()->__('Yes'))));
}
}
$layoutFieldset->addField($prefixWeb . '_dec2', 'html_element', array('label' => '<h4>' . $this->getMyHelper()->__('Htaccess settings') . '</h4>', 'code' => '<div style="height:10px;border-bottom:1px solid #808080"></div>'));
/* get htaccess state and set color by it */
$htaccess = Mage::getModel('mturbo/htaccess')->setWebsiteCode($website->getCode());
$state = '';
$pathToHtaccess = $htaccess->getPathToBaseHtaccess();
$color = Mage::helper('mturbo/functions')->get_file_state($pathToHtaccess, $state, 'ew') ? 'green' : 'red';
$layoutFieldset->addField($prefixWeb . '_dec3', 'html_element', array('label' => $this->getMyHelper()->__('File .htaccess path'), 'code' => '<span>' . $pathToHtaccess . '</span>'));
$edit = $htaccess->isEditedByMTurbo() ? 'yes' : 'no';
$layoutFieldset->addField($prefixWeb . '_dec5', 'html_element', array('label' => $this->getMyHelper()->__('Edited by MTurbo'), 'code' => '<span><b>' . $this->getMyHelper()->__($edit) . '</b></span>'));
$layoutFieldset->addField($prefixWeb . '_dec4', 'html_element', array('label' => $this->getMyHelper()->__('File .htaccess state'), 'code' => '<span style="color:' . $color . '">' . $this->getMyHelper()->__($state) . '</span>'));
/* button 'rebuild' show only if htaccess is ready */
if ($color == 'green') {
$layoutFieldset->addField($prefixWeb . '_htaccess_button', 'widget_button', array('name' => $prefixWeb . '_htaccess_button', 'label' => $this->getMyHelper()->__('Rebuild .htaccess for this website'), 'onclick' => "setLocation('" . Mage::helper('adminhtml')->getUrl('*/*/htaccessbuild', array('websitecode' => $website->getCode())) . "')"));
}
$layoutFieldset->addField($prefixWeb . '_urllist_button', 'widget_button', array('name' => $prefixWeb . '_urllist_button', 'label' => $this->getMyHelper()->__('Generate URL list for this website'), 'onclick' => "setLocation('" . Mage::helper('adminhtml')->getUrl('*/*/generateurllist', array('websitecode' => $website->getCode())) . "')"));
}
示例4: updateDataFields
/**
* update data fields
*
* @param $email
* @param Mage_Core_Model_Website $website
* @param $storeName
*/
public function updateDataFields($email, Mage_Core_Model_Website $website, $storeName)
{
$data = array();
if ($store_name = $website->getConfig(Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_CUSTOMER_STORE_NAME)) {
$data[] = array('Key' => $store_name, 'Value' => $storeName);
}
if ($website_name = $website->getConfig(Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_CUSTOMER_WEBSITE_NAME)) {
$data[] = array('Key' => $website_name, 'Value' => $website->getName());
}
if (!empty($data)) {
//update data fields
$client = $this->getWebsiteApiClient($website);
$client->updateContactDatafieldsByEmail($email, $data);
}
}
示例5: formatWebsiteName
/**
* @param Mage_Core_Model_Website $website
* @return string
*/
public function formatWebsiteName(Mage_Core_Model_Website $website)
{
return $website->getName();
}