Skip to content

Commit

Permalink
Import Magento Release 1.7.0.0-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeSaferite committed Mar 31, 2012
1 parent e56274a commit 1ea33f8
Show file tree
Hide file tree
Showing 619 changed files with 36,037 additions and 3,239 deletions.
10 changes: 10 additions & 0 deletions .htaccess
Expand Up @@ -122,6 +122,16 @@

#RewriteBase /magento/

############################################
## uncomment next line to enable light API calls processing

# RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]

############################################
## rewrite API2 calls to api.php (by now it is REST only)

RewriteRule ^api/rest api.php?type=rest [QSA,L]

############################################
## workaround for HTTP authorization
## in CGI environment
Expand Down
566 changes: 566 additions & 0 deletions RELEASE_NOTES.txt

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions api.php
@@ -0,0 +1,88 @@
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage_Api2
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

if (version_compare(phpversion(), '5.2.0', '<')) {
echo 'It looks like you have an invalid PHP version. Magento supports PHP 5.2.0 or newer';
exit;
}
error_reporting(E_ALL | E_STRICT);

$mageFilename = getcwd() . '/app/Mage.php';

if (!file_exists($mageFilename)) {
echo 'Mage file not found';
exit;
}
require $mageFilename;

if (!Mage::isInstalled()) {
echo 'Application is not installed yet, please complete install wizard first.';
exit;
}

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
Mage::setIsDeveloperMode(true);
}

#ini_set('display_errors', 1);

// emulate index.php entry point for correct URLs generation in API
Mage::register('custom_entry_point', true);
Mage::$headersSentThrowsException = false;
Mage::init('admin');
Mage::app()->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
Mage::app()->loadAreaPart(Mage_Core_Model_App_Area::AREA_ADMINHTML, Mage_Core_Model_App_Area::PART_EVENTS);

// query parameter "type" is set by .htaccess rewrite rule
$apiAlias = Mage::app()->getRequest()->getParam('type');

// check request could be processed by API2
if (in_array($apiAlias, Mage_Api2_Model_Server::getApiTypes())) {
/** @var $server Mage_Api2_Model_Server */
$server = Mage::getSingleton('api2/server');

$server->run();
} else {
/* @var $server Mage_Api_Model_Server */
$server = Mage::getSingleton('api/server');
$adapterCode = $server->getAdapterCodeByAlias($apiAlias);

// if no adapters found in aliases - find it by default, by code
if (null === $adapterCode) {
$adapterCode = $apiAlias;
}
try {
$server->initialize($adapterCode);
$server->run();

Mage::app()->getResponse()->sendResponse();
} catch (Exception $e) {
Mage::logException($e);

echo $e->getMessage();
exit;
}
}
11 changes: 6 additions & 5 deletions app/Mage.php
Expand Up @@ -171,7 +171,7 @@ public static function getVersionInfo()
'minor' => '7',
'revision' => '0',
'patch' => '0',
'stability' => 'beta',
'stability' => 'rc',
'number' => '1',
);
}
Expand Down Expand Up @@ -373,6 +373,7 @@ public static function getStoreConfigFlag($path, $store = null)
* Get base URL path by type
*
* @param string $type
* @param null|bool $secure
* @return string
*/
public static function getBaseUrl($type = Mage_Core_Model_Store::URL_TYPE_LINK, $secure = null)
Expand Down Expand Up @@ -434,17 +435,16 @@ public static function addObserver($eventName, $callback, $data = array(), $obse
* Dispatch event
*
* Calls all observer callbacks registered for this event
* and multiobservers matching event name pattern
* and multiple observers matching event name pattern
*
* @param string $name
* @param array $args
* @param array $data
* @return Mage_Core_Model_App
*/
public static function dispatchEvent($name, array $data = array())
{
Varien_Profiler::start('DISPATCH EVENT:'.$name);
$result = self::app()->dispatchEvent($name, $data);
#$result = self::registry('events')->dispatch($name, $data);
Varien_Profiler::stop('DISPATCH EVENT:'.$name);
return $result;
}
Expand All @@ -455,7 +455,7 @@ public static function dispatchEvent($name, array $data = array())
* @link Mage_Core_Model_Config::getModelInstance
* @param string $modelClass
* @param array|object $arguments
* @return Mage_Core_Model_Abstract
* @return Mage_Core_Model_Abstract|false
*/
public static function getModel($modelClass = '', $arguments = array())
{
Expand Down Expand Up @@ -584,6 +584,7 @@ public static function exception($module = 'Mage_Core', $message = '', $code = 0
*
* @param string $message
* @param string $messageStorage
* @throws Mage_Core_Exception
*/
public static function throwException($message, $messageStorage = null)
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/User.php
Expand Up @@ -61,7 +61,7 @@
class Mage_Admin_Model_User extends Mage_Core_Model_Abstract
{
/**
* Configuration pathes for email templates and identities
* Configuration paths for email templates and identities
*/
const XML_PATH_FORGOT_EMAIL_TEMPLATE = 'admin/emails/forgot_email_template';
const XML_PATH_FORGOT_EMAIL_IDENTITY = 'admin/emails/forgot_email_identity';
Expand Down
90 changes: 90 additions & 0 deletions app/code/core/Mage/AdminNotification/Model/Inbox.php
Expand Up @@ -117,4 +117,94 @@ public function parse(array $data)
{
return $this->getResource()->parse($this, $data);
}

/**
* Add new message
*
* @param int $severity
* @param string $title
* @param string|array $description
* @param string $url
* @param bool $isInternal
* @return Mage_AdminNotification_Model_Inbox
*/
public function add($severity, $title, $description, $url = '', $isInternal = true)
{
if (!$this->getSeverities($severity)) {
Mage::throwException($this->__('Wrong message type'));
}
if (is_array($description)) {
$description = '<ul><li>' . implode('</li><li>', $description) . '</li></ul>';
}
$date = date('Y-m-d H:i:s');
$this->parse(array(array(
'severity' => $severity,
'date_added' => $date,
'title' => $title,
'description' => $description,
'url' => $url,
'internal' => $isInternal
)));
return $this;
}

/**
* Add critical severity message
*
* @param string $title
* @param string|array $description
* @param string $url
* @param bool $isInternal
* @return Mage_AdminNotification_Model_Inbox
*/
public function addCritical($title, $description, $url = '', $isInternal = true)
{
$this->add(self::SEVERITY_CRITICAL, $title, $description, $url, $isInternal);
return $this;
}

/**
* Add major severity message
*
* @param string $title
* @param string|array $description
* @param string $url
* @param bool $isInternal
* @return Mage_AdminNotification_Model_Inbox
*/
public function addMajor($title, $description, $url = '', $isInternal = true)
{
$this->add(self::SEVERITY_MAJOR, $title, $description, $url, $isInternal);
return $this;
}

/**
* Add minor severity message
*
* @param string $title
* @param string|array $description
* @param string $url
* @param bool $isInternal
* @return Mage_AdminNotification_Model_Inbox
*/
public function addMinor($title, $description, $url = '', $isInternal = true)
{
$this->add(self::SEVERITY_MINOR, $title, $description, $url, $isInternal);
return $this;
}

/**
* Add notice
*
* @param string $title
* @param string|array $description
* @param string $url
* @param bool $isInternal
* @return Mage_AdminNotification_Model_Inbox
*/
public function addNotice($title, $description, $url = '', $isInternal = true)
{
$this->add(self::SEVERITY_NOTICE, $title, $description, $url, $isInternal);
return $this;
}
}
Expand Up @@ -44,7 +44,7 @@ protected function _prepareLayout()
$this->getLayout()->createBlock('adminhtml/widget_button')
->setData(array(
'label' => Mage::helper('catalog')->__('Save Attribute Set'),
'onclick' => 'addSet.submit();',
'onclick' => 'if (addSet.submit()) disableElements(\'save\');',
'class' => 'save'
)));
$this->setChild('back_button',
Expand Down
Expand Up @@ -142,4 +142,14 @@ public function canUseQtyDecimals()
{
return $this->getProduct()->getTypeInstance()->canUseQtyDecimals();
}

/**
* Check if product type is virtual
*
* @return boolean
*/
public function isVirtual()
{
return $this->getProduct()->getTypeInstance()->isVirtual();
}
}
Expand Up @@ -87,14 +87,15 @@ protected function _prepareForm()
));

if (!Mage::app()->isSingleStoreMode()) {
$fieldset->addField('store_id', 'select', array(
$field = $fieldset->addField('store_id', 'select', array(
'name' => 'store_id',
'label' => Mage::helper('catalog')->__('Store'),
'title' => Mage::helper('catalog')->__('Store'),
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(true, false),
'required' => true,
'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml()
));
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$field->setRenderer($renderer);
}
else {
$fieldset->addField('store_id', 'hidden', array(
Expand Down
Expand Up @@ -99,14 +99,15 @@ protected function _prepareForm()
));

if (!Mage::app()->isSingleStoreMode()) {
$fieldset->addField('store_id', 'multiselect', array(
$field = $fieldset->addField('store_id', 'multiselect', array(
'name' => 'stores[]',
'label' => Mage::helper('checkout')->__('Store View'),
'title' => Mage::helper('checkout')->__('Store View'),
'required' => true,
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml()
));
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$field->setRenderer($renderer);
}
else {
$fieldset->addField('store_id', 'hidden', array(
Expand Down
5 changes: 3 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php
Expand Up @@ -93,14 +93,15 @@ protected function _prepareForm()
* Check is single store mode
*/
if (!Mage::app()->isSingleStoreMode()) {
$fieldset->addField('store_id', 'multiselect', array(
$field =$fieldset->addField('store_id', 'multiselect', array(
'name' => 'stores[]',
'label' => Mage::helper('cms')->__('Store View'),
'title' => Mage::helper('cms')->__('Store View'),
'required' => true,
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml()
));
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$field->setRenderer($renderer);
}
else {
$fieldset->addField('store_id', 'hidden', array(
Expand Down
5 changes: 3 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Main.php
Expand Up @@ -85,15 +85,16 @@ protected function _prepareForm()
* Check is single store mode
*/
if (!Mage::app()->isSingleStoreMode()) {
$fieldset->addField('store_id', 'multiselect', array(
$field = $fieldset->addField('store_id', 'multiselect', array(
'name' => 'stores[]',
'label' => Mage::helper('cms')->__('Store View'),
'title' => Mage::helper('cms')->__('Store View'),
'required' => true,
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
'disabled' => $isElementDisabled,
'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml()
));
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$field->setRenderer($renderer);
}
else {
$fieldset->addField('store_id', 'hidden', array(
Expand Down
Expand Up @@ -110,9 +110,8 @@ function(v, elem){
. '</script>'
);
}
$form->getElement('website_id')->setAfterElementHtml(
Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml()
);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$form->getElement('website_id')->setRenderer($renderer);

// if (Mage::app()->isSingleStoreMode()) {
// $fieldset->removeField('website_id');
Expand Down

0 comments on commit 1ea33f8

Please sign in to comment.