This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 549
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bc632e
commit 92a1142
Showing
416 changed files
with
8,314 additions
and
22,993 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?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 [email protected] 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.magento.com for more information. | ||
* | ||
* @category Mage | ||
* @package Mage_Admin | ||
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* Class Mage_Admin_Model_Block | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Mage_Admin_Model_Block extends Mage_Core_Model_Abstract | ||
{ | ||
/** | ||
* Initialize variable model | ||
*/ | ||
protected function _construct() | ||
{ | ||
$this->_init('admin/block'); | ||
} | ||
|
||
/** | ||
* @return array|bool | ||
* @throws Exception | ||
* @throws Zend_Validate_Exception | ||
*/ | ||
public function validate() | ||
{ | ||
$errors = array(); | ||
|
||
if (!Zend_Validate::is($this->getBlockName(), 'NotEmpty')) { | ||
$errors[] = Mage::helper('adminhtml')->__('Block Name is required field.'); | ||
} | ||
if (!Zend_Validate::is($this->getBlockName(), 'Regex', array('/^[-_a-zA-Z0-9\/]*$/'))) { | ||
$errors[] = Mage::helper('adminhtml')->__('Block Name is incorrect.'); | ||
} | ||
|
||
if (!in_array($this->getIsAllowed(), array('0', '1'))) { | ||
$errors[] = Mage::helper('adminhtml')->__('Is Allowed is required field.'); | ||
} | ||
|
||
if (empty($errors)) { | ||
return true; | ||
} | ||
return $errors; | ||
} | ||
|
||
/** | ||
* Check is block with such type allowed for parsinf via blockDirective method | ||
* | ||
* @param $type | ||
* @return int | ||
*/ | ||
public function isTypeAllowed($type) | ||
{ | ||
/** @var Mage_Admin_Model_Resource_Block_Collection $collection */ | ||
$collection = Mage::getResourceModel('admin/block_collection'); | ||
$collection->addFieldToFilter('block_name', array('eq' => $type)) | ||
->addFieldToFilter('is_allowed', array('eq' => 1)); | ||
return $collection->load()->count(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?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 [email protected] 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.magento.com for more information. | ||
* | ||
* @category Mage | ||
* @package Mage_Admin | ||
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* Class Mage_Admin_Model_Resource_Block | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Mage_Admin_Model_Resource_Block extends Mage_Core_Model_Resource_Db_Abstract | ||
{ | ||
/** | ||
* Define main table | ||
* | ||
*/ | ||
protected function _construct() | ||
{ | ||
$this->_init('admin/permission_block', 'block_id'); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
app/code/core/Mage/Admin/Model/Resource/Block/Collection.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?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 [email protected] 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.magento.com for more information. | ||
* | ||
* @category Mage | ||
* @package Mage_Admin | ||
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* Admin permissions block collection | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Mage_Admin_Model_Resource_Block_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract | ||
{ | ||
/** | ||
* Define resource model | ||
* | ||
*/ | ||
protected function _construct() | ||
{ | ||
$this->_init('admin/block'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?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 [email protected] 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.magento.com for more information. | ||
* | ||
* @category Mage | ||
* @package Mage_Admin | ||
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* Resource model for manipulate system variables | ||
* | ||
* @category Mage | ||
* @package Mage_Admin | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Mage_Admin_Model_Resource_Variable extends Mage_Core_Model_Resource_Db_Abstract | ||
{ | ||
/** | ||
* Define main table | ||
*/ | ||
protected function _construct() | ||
{ | ||
$this->_init('admin/permission_variable', 'variable_id'); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
app/code/core/Mage/Admin/Model/Resource/Variable/Collection.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?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 [email protected] 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.magento.com for more information. | ||
* | ||
* @category Mage | ||
* @package Mage_Admin | ||
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* Admin permissions variable collection | ||
* | ||
* @category Mage | ||
* @package Mage_Admin | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Mage_Admin_Model_Resource_Variable_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract | ||
{ | ||
/** | ||
* Define resource model | ||
* | ||
*/ | ||
protected function _construct() | ||
{ | ||
$this->_init('admin/variable'); | ||
} | ||
} |
Oops, something went wrong.