|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * Magento |
| 4 | + * |
| 5 | + * NOTICE OF LICENSE |
| 6 | + * |
| 7 | + * This source file is subject to the Open Software License (OSL 3.0) |
| 8 | + * that is bundled with this package in the file LICENSE.txt. |
| 9 | + * It is also available through the world-wide-web at this URL: |
| 10 | + * http://opensource.org/licenses/osl-3.0.php |
| 11 | + * If you did not receive a copy of the license and are unable to |
| 12 | + * obtain it through the world-wide-web, please send an email |
| 13 | + * to [email protected] so we can send you a copy immediately. |
| 14 | + * |
| 15 | + * DISCLAIMER |
| 16 | + * |
| 17 | + * Do not edit or add to this file if you wish to upgrade Magento to newer |
| 18 | + * versions in the future. If you wish to customize Magento for your |
| 19 | + * needs please refer to http://www.magento.com for more information. |
| 20 | + * |
| 21 | + * @category Mage |
| 22 | + * @package Mage_Catalog |
| 23 | + * @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com) |
| 24 | + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
| 25 | + */ |
| 26 | + |
| 27 | +/** |
| 28 | + * Catalog category robots attribute source |
| 29 | + * |
| 30 | + * @category Mage |
| 31 | + * @package Mage_Catalog |
| 32 | + * @author Magento Core Team <[email protected]> |
| 33 | + */ |
| 34 | +class Mage_Catalog_Model_Category_Attribute_Source_Robots extends Mage_Eav_Model_Entity_Attribute_Source_Abstract |
| 35 | +{ |
| 36 | + /** |
| 37 | + * @return array |
| 38 | + */ |
| 39 | + public function getAllOptions() |
| 40 | + { |
| 41 | + return array( |
| 42 | + Mage_Catalog_Model_Category::META_ROBOTS_INDEX_FOLLOW => |
| 43 | + array( |
| 44 | + 'value' => Mage_Catalog_Model_Category::META_ROBOTS_INDEX_FOLLOW, |
| 45 | + 'label' => Mage::helper('cms')->__('INDEX,FOLLOW') |
| 46 | + ), |
| 47 | + Mage_Catalog_Model_Category::META_ROBOTS_INDEX_NOFOLLOW => |
| 48 | + array( |
| 49 | + 'value' => Mage_Catalog_Model_Category::META_ROBOTS_INDEX_NOFOLLOW, |
| 50 | + 'label' => Mage::helper('cms')->__('INDEX,NOFOLLOW') |
| 51 | + ), |
| 52 | + Mage_Catalog_Model_Category::META_ROBOTS_NOINDEX_FOLLOW => |
| 53 | + array( |
| 54 | + 'value' => Mage_Catalog_Model_Category::META_ROBOTS_NOINDEX_FOLLOW, |
| 55 | + 'label' => Mage::helper('cms')->__('NOINDEX,FOLLOW') |
| 56 | + ), |
| 57 | + Mage_Catalog_Model_Category::META_ROBOTS_NOINDEX_NOFOLLOW => |
| 58 | + array( |
| 59 | + 'value' => Mage_Catalog_Model_Category::META_ROBOTS_NOINDEX_NOFOLLOW, |
| 60 | + 'label' => Mage::helper('cms')->__('NOINDEX,NOFOLLOW') |
| 61 | + ), |
| 62 | + Mage_Catalog_Model_Category::META_ROBOTS_INDEX_FOLLOW_NOARCHIVE => |
| 63 | + array( |
| 64 | + 'value' => Mage_Catalog_Model_Category::META_ROBOTS_INDEX_FOLLOW_NOARCHIVE, |
| 65 | + 'label' => Mage::helper('cms')->__('INDEX,FOLLOW,NOARCHIVE') |
| 66 | + ), |
| 67 | + Mage_Catalog_Model_Category::META_ROBOTS_INDEX_NOFOLLOW_NOARCHIVE => |
| 68 | + array( |
| 69 | + 'value' => Mage_Catalog_Model_Category::META_ROBOTS_INDEX_NOFOLLOW_NOARCHIVE, |
| 70 | + 'label' => Mage::helper('cms')->__('INDEX,NOFOLLOW,NOARCHIVE') |
| 71 | + ), |
| 72 | + Mage_Catalog_Model_Category::META_ROBOTS_NOINDEX_NOFOLLOW_NOARCHIVE => |
| 73 | + array( |
| 74 | + 'value' => Mage_Catalog_Model_Category::META_ROBOTS_NOINDEX_NOFOLLOW_NOARCHIVE, |
| 75 | + 'label' => Mage::helper('cms')->__('NOINDEX,NOFOLLOW,NOARCHIVE') |
| 76 | + ), |
| 77 | + ); |
| 78 | + } |
| 79 | + |
| 80 | + /** |
| 81 | + * @param int $key |
| 82 | + * @return string |
| 83 | + */ |
| 84 | + public function getOptionLabel($key) { |
| 85 | + $options = $this->getAllOptions(); |
| 86 | + |
| 87 | + return $options[$key]['label']; |
| 88 | + } |
| 89 | +} |
0 commit comments