├── .travis.yml ├── README.md ├── composer.json ├── modman ├── screenshot.png └── src ├── app ├── code │ └── community │ │ └── IntegerNet │ │ └── AttributeOptionPager │ │ ├── Block │ │ └── Adminhtml │ │ │ └── Pager.php │ │ ├── Helper │ │ └── Data.php │ │ ├── Model │ │ ├── Observer.php │ │ ├── Pager.php │ │ └── Toolbar.php │ │ ├── Test │ │ └── Block │ │ │ ├── Tab.php │ │ │ └── Tab │ │ │ ├── expectations │ │ │ └── loadCollection.yaml │ │ │ └── providers │ │ │ └── loadCollection.yaml │ │ └── etc │ │ └── config.xml ├── design │ └── adminhtml │ │ └── default │ │ └── default │ │ ├── layout │ │ └── integernet_attributeoptionpager.xml │ │ └── template │ │ └── integernet_attributeoptionpager │ │ └── pager.phtml └── etc │ └── modules │ └── IntegerNet_AttributeOptionPager.xml └── skin └── adminhtml └── default └── default └── integernet_attributeoptionpager ├── bkg_toolbar.gif └── style.css /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | php: 3 | - 5.3 4 | - 5.4 5 | - 5.5 6 | - 5.6 7 | - hhvm 8 | matrix: 9 | allow_failures: 10 | - php: 5.3 11 | - php: 5.6 12 | - php: hhvm 13 | env: 14 | - MAGENTO_VERSION=magento-ce-1.9.1.0 15 | - MAGENTO_VERSION=magento-ce-1.9.0.1 16 | - MAGENTO_VERSION=magento-ce-1.8.1.0 17 | - MAGENTO_VERSION=magento-ce-1.8.0.0 18 | - MAGENTO_VERSION=magento-ce-1.7.0.2 19 | - MAGENTO_VERSION=magento-ce-1.6.2.0 20 | script: 21 | - curl -sSL https://raw.githubusercontent.com/AOEpeople/MageTestStand/master/setup.sh | bash 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | IntegerNet_AttributeOptionPager 2 | ===================== 3 | Adds pagination to the attribute option form, useful for product attributes with very big numbers of options. 4 | 5 | Facts 6 | ----- 7 | [![Build Status](https://travis-ci.org/integer-net/IntegerNet_AttributeOptionPager.svg?branch=master)](https://travis-ci.org/integer-net/IntegerNet_AttributeOptionPager) 8 | 9 | - version: 0.2.0 10 | - extension key: integer-net/attribute-option-pager 11 | - [extension on GitHub](https://github.com/integer-net/IntegerNet_AttributeOptionPager) 12 | - [direct download link](https://github.com/integer-net/IntegerNet_AttributeOptionPager/archive/master.zip) 13 | - No class rewrites 14 | 15 | Description 16 | ----------- 17 | This Magento extension adds pagination to the attribute option form, useful for product attributes with very big numbers of options. This prevents browser crashs due to long running JavaScipt and huge DOM. It is compatible with [Jarlssen_FasterAttributeOptionEdit](https://github.com/Jarlssen/Jarlssen_FasterAttributeOptionEdit) - both modules together make editing attribute options most efficient. 18 | 19 | ![Screenshot](https://raw.githubusercontent.com/integer-net/IntegerNet_AttributeOptionPager/master/screenshot.png) 20 | 21 | Requirements 22 | ------------ 23 | - PHP >= 5.3.0 24 | 25 | Compatibility 26 | ------------- 27 | - Magento CE >= 1.6 or EE >= 1.11 28 | 29 | Manual Installation 30 | ------------------------- 31 | 1. Copy all files in `src` into your document root. 32 | 2. Clear configuration, layout and block cache 33 | 34 | Uninstallation 35 | -------------- 36 | 1. Remove all extension files from your Magento installation 37 | 38 | Support 39 | ------- 40 | If you have any issues with this extension, open an issue on [GitHub](https://github.com/integer-net/IntegerNet_AttributeOptionPager/issues). 41 | 42 | Contribution 43 | ------------ 44 | Any contribution is highly appreciated. The best way to contribute code is to open a [pull request on GitHub](https://help.github.com/articles/using-pull-requests). 45 | 46 | Developer 47 | --------- 48 | Fabian Schmengler, [integer_net GmbH](http://www.integer-net.de) 49 | 50 | Twitter: [@fschmengler](https://twitter.com/fschmengler) [@integer_net](https://twitter.com/integer_net) 51 | 52 | Licence 53 | ------- 54 | [OSL - Open Software Licence 3.0](http://opensource.org/licenses/osl-3.0.php) 55 | 56 | Copyright 57 | --------- 58 | © 2015 integer_net GmbH 59 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "integer-net/attribute-option-pager", 3 | "type": "magento-module", 4 | "license": "OSL-3.0", 5 | "homepage": "https://github.com/integer-net/IntegerNet_AttributeOptionPager", 6 | "description": "Pagination for Attribute Option Form", 7 | "keywords": ["magento", "adminhtml", "widget"], 8 | "authors": [ 9 | { 10 | "name": "integer_net GmbH", 11 | "email": "info@integer-net.de", 12 | "homepage": "http://www.integer-net.de/", 13 | "role": "Company" 14 | }, 15 | { 16 | "name": "Fabian Schmengler", 17 | "email": "fs@integer-net.de", 18 | "homepage": "http://www.integer-net.de/", 19 | "role": "Developer" 20 | } 21 | ], 22 | "require": { 23 | "magento-hackathon/magento-composer-installer": "*" 24 | }, 25 | "suggest": { 26 | "jarlssen/fasterattributeoptionedit" : "Lazy loading of form fields to reduce JavaScript load." 27 | } 28 | } -------------------------------------------------------------------------------- /modman: -------------------------------------------------------------------------------- 1 | src/app/code/community/IntegerNet/AttributeOptionPager app/code/community/IntegerNet/AttributeOptionPager 2 | src/app/design/adminhtml/default/default/template/integernet_attributeoptionpager app/design/adminhtml/default/default/template/integernet_attributeoptionpager 3 | src/app/design/adminhtml/default/default/layout/integernet_attributeoptionpager.xml app/design/adminhtml/default/default/layout/integernet_attributeoptionpager.xml 4 | src/app/etc/modules/IntegerNet_AttributeOptionPager.xml app/etc/modules/IntegerNet_AttributeOptionPager.xml 5 | src/skin/adminhtml/default/default/integernet_attributeoptionpager skin/adminhtml/default/default/integernet_attributeoptionpager -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/integer-net/IntegerNet_AttributeOptionPager/9287f76540ab1602320474bf47c9c9bb30192874/screenshot.png -------------------------------------------------------------------------------- /src/app/code/community/IntegerNet/AttributeOptionPager/Block/Adminhtml/Pager.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | 11 | /** 12 | * Pagination block 13 | */ 14 | class IntegerNet_AttributeOptionPager_Block_Adminhtml_Pager extends Mage_Page_Block_Html_Pager 15 | { 16 | protected $_pageVarName = 'page'; 17 | 18 | protected function _construct() 19 | { 20 | parent::_construct(); 21 | $this->setTemplate('integernet_attributeoptionpager/pager.phtml'); 22 | } 23 | 24 | /** 25 | * Set collection without manipulating or initializing frame. This would result in inconsistencies 26 | * because the collection is already loaded. 27 | * Instead, use limit that already has been applied on collection. 28 | * 29 | * @param Varien_Data_Collection $collection 30 | * @return $this|Mage_Page_Block_Html_Pager 31 | */ 32 | public function setCollection($collection) 33 | { 34 | $this->_collection = $collection; 35 | $this->setLimit($collection->getPageSize()); 36 | return $this; 37 | } 38 | 39 | public function getPagerUrl($params = array()) 40 | { 41 | $params['active_tab'] = 'labels'; 42 | return parent::getPagerUrl($params); 43 | } 44 | 45 | 46 | } -------------------------------------------------------------------------------- /src/app/code/community/IntegerNet/AttributeOptionPager/Helper/Data.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | 11 | /** 12 | * Default module helper 13 | */ 14 | class IntegerNet_AttributeOptionPager_Helper_Data extends Mage_Core_Helper_Abstract 15 | { 16 | /** 17 | * Returns true if given option collection has store filter applied to select values per store. 18 | * 19 | * If so, the pagination must not be applied 20 | * 21 | * @see IntegerNet_AttributeOptionPager_Model_Observer::setPageOnCollection() 22 | * @see Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection::setStoreFilter() 23 | * 24 | * @param Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection $collection 25 | * @return bool 26 | * @throws Zend_Db_Select_Exception 27 | */ 28 | public function isOptionCollectionStoreFiltered( 29 | Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection $collection) 30 | { 31 | $joins = $collection->getSelect()->getPart(Zend_Db_Select::FROM); 32 | return array_key_exists('tsv', $joins) || array_key_exists('tdv', $joins); 33 | } 34 | } -------------------------------------------------------------------------------- /src/app/code/community/IntegerNet/AttributeOptionPager/Model/Observer.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | 11 | /** 12 | * Module observer 13 | */ 14 | class IntegerNet_AttributeOptionPager_Model_Observer 15 | { 16 | 17 | /** 18 | * @var IntegerNet_AttributeOptionPager_Model_Pager 19 | */ 20 | protected $_pager; 21 | /** 22 | * @var IntegerNet_AttributeOptionPager_Model_Toolbar 23 | */ 24 | protected $_toolbar; 25 | /** 26 | * @var IntegerNet_AttributeOptionPager_Helper_Data 27 | */ 28 | protected $_helper; 29 | 30 | protected function _init() 31 | { 32 | $this->_pager = Mage::getModel('integernet_attributeoptionpager/pager'); 33 | $this->_toolbar = Mage::getModel('integernet_attributeoptionpager/toolbar'); 34 | $this->_helper = Mage::helper('integernet_attributeoptionpager'); 35 | } 36 | /** 37 | * Read pagination settings from query parameters 38 | * 39 | * @event controller_action_predispatch_adminhtml_catalog_product_attribute_edit 40 | * @area adminhtml 41 | * @param Varien_Event_Observer $observer 42 | * @return $this 43 | */ 44 | public function fetchPaginationParams(Varien_Event_Observer $observer) 45 | { 46 | $this->_init(); 47 | $this->_pager->setPageFromRequest($observer->getControllerAction()->getRequest()); 48 | return $this; 49 | } 50 | /** 51 | * Sets LIMIT for attribute option collection based on pagination settings 52 | * 53 | * @event core_collection_abstract_load_before 54 | * @area adminhtml 55 | * @param Varien_Event_Observer $observer 56 | * @return $this 57 | */ 58 | public function setPageOnCollection(Varien_Event_Observer $observer) 59 | { 60 | if (! $this->_pager) { 61 | return $this; 62 | } 63 | $collection = $observer->getCollection(); 64 | if ($collection instanceof Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection 65 | && !$this->_helper->isOptionCollectionStoreFiltered($collection) 66 | ) { 67 | $this->_pager->prepareCollection($collection); 68 | $this->_toolbar->prepareBlock($collection); 69 | } 70 | return $this; 71 | } 72 | 73 | /** 74 | * Revert item order in loaded collection if flag is set. This is used to maintain the 75 | * descending order WITHIN the page, that Magento needs. 76 | * 77 | * @event core_collection_abstract_load_after 78 | * @area adminhtml 79 | * @param Varien_Event_Observer $observer 80 | * @throws Exception 81 | */ 82 | public function revertLoadedCollection(Varien_Event_Observer $observer) 83 | { 84 | if (! $this->_pager) { 85 | return $this; 86 | } 87 | /** @var Mage_Core_Model_Resource_Db_Collection_Abstract $collection */ 88 | $collection = $observer->getCollection(); 89 | if ($collection->getFlag(IntegerNet_AttributeOptionPager_Model_Pager::FLAG_REVERT_COLLECTION)) { 90 | $items = $collection->getItems(); 91 | foreach ($collection as $key => $item) { 92 | $collection->removeItemByKey($key); 93 | } 94 | foreach (array_reverse($items) as $item) { 95 | $collection->addItem($item); 96 | } 97 | } 98 | } 99 | 100 | /** 101 | * Adds pagination toolbar to attribute option tab 102 | * 103 | * @event core_block_abstract_to_html_after 104 | * @area adminhtml 105 | * @param Varien_Event_Observer $observer 106 | * @return $this 107 | */ 108 | public function addPaginationToBlock(Varien_Event_Observer $observer) 109 | { 110 | if (! $this->_pager) { 111 | return $this; 112 | } 113 | $block = $observer->getBlock(); 114 | if ($block instanceof Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options) { 115 | $html = $observer->getTransport()->getHtml(); 116 | //TODO inject toolbar at top and bottom of #matage-options-panel > .box with DOM 117 | $paginationHtml = $this->_toolbar->getBlock()->toHtml(); 118 | $html = $paginationHtml . '
' . $html . $paginationHtml; 119 | $observer->getTransport()->setHtml($html); 120 | } 121 | 122 | return $this; 123 | } 124 | 125 | } -------------------------------------------------------------------------------- /src/app/code/community/IntegerNet/AttributeOptionPager/Model/Pager.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | 11 | /** 12 | * Sets page based on request 13 | */ 14 | class IntegerNet_AttributeOptionPager_Model_Pager 15 | { 16 | const XML_PAGE_SIZE = 'catalog_attributes/pagination/page_size'; 17 | const FLAG_REVERT_COLLECTION = 'integernet_revert_collection'; 18 | 19 | protected $_currentPage = 1; 20 | protected $_pageSize = null; 21 | 22 | public function __construct() 23 | { 24 | $this->_pageSize = Mage::getStoreConfig(IntegerNet_AttributeOptionPager_Model_Pager::XML_PAGE_SIZE); 25 | } 26 | 27 | /** 28 | * Read settings 29 | * 30 | * @param Mage_Core_Controller_Request_Http $request 31 | * @return $this 32 | */ 33 | public function setPageFromRequest(Mage_Core_Controller_Request_Http $request) 34 | { 35 | $this->_currentPage = max(1, $request->getParam('page')); 36 | $limit = $request->getParam('limit', null); 37 | if ($limit !== null) { 38 | $this->_pageSize = (int)$limit; 39 | } 40 | return $this; 41 | } 42 | 43 | /** 44 | * Set collection parameters 45 | * 46 | * @param Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection $collection 47 | * @return Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection 48 | */ 49 | public function prepareCollection(Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection $collection) 50 | { 51 | if ($this->_pageSize && $this->_currentPage) { 52 | $collection 53 | ->setPageSize($this->_pageSize) 54 | ->setCurPage($this->_currentPage) 55 | ->setOrder('main_table.sort_order', Zend_Db_Select::SQL_ASC); 56 | if (array_key_exists('sort_alpha_value', $collection->getSelect()->getPart(Zend_Db_Select::FROM))) { 57 | $collection->addOrder('sort_alpha_value.value', Zend_Db_Select::SQL_ASC); 58 | } 59 | $collection->setFlag(self::FLAG_REVERT_COLLECTION, true); 60 | } 61 | return $collection; 62 | } 63 | } -------------------------------------------------------------------------------- /src/app/code/community/IntegerNet/AttributeOptionPager/Model/Toolbar.php: -------------------------------------------------------------------------------- 1 | getBlock() 22 | ->setCollection($collection) 23 | ->setAvailableLimit(array('20' => '20', '50' => '50', '100' => '100', '250' => '250', '1000' => '1000')); 24 | return $this; 25 | } 26 | 27 | /** 28 | * @return Mage_Page_Block_Html_Pager 29 | */ 30 | public function getBlock() 31 | { 32 | if (is_null($this->_block)) { 33 | $this->_block = Mage::app()->getLayout()->getBlock(self::BLOCK_TOOLBAR); 34 | } 35 | return $this->_block; 36 | } 37 | } -------------------------------------------------------------------------------- /src/app/code/community/IntegerNet/AttributeOptionPager/Test/Block/Tab.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | 11 | require_once Mage::getModuleDir('controllers', 'Mage_Adminhtml') . '/Catalog/Product/AttributeController.php'; 12 | 13 | /** 14 | * Class IntegerNet_AttributeOptionPager_Test_Block_Tab 15 | * 16 | * @group IntegerNet_AttributeOptionPager 17 | */ 18 | class IntegerNet_AttributeOptionPager_Test_Block_Tab extends EcomDev_PHPUnit_Test_Case 19 | { 20 | const TEST_ATTRIBUTE_CODE = '__test_attribute'; 21 | 22 | /** 23 | * @var Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options 24 | */ 25 | protected $_block; 26 | 27 | protected function setUp() 28 | { 29 | parent::setUp(); 30 | $this->_removeAttribute(); 31 | $this->_addAttribute(); 32 | $this->_block = $this->app()->getLayout() 33 | ->createBlock('adminhtml/catalog_product_attribute_edit_tab_options'); 34 | $this->app()->addEventArea('adminhtml'); 35 | } 36 | protected function tearDown() 37 | { 38 | $this->_removeAttribute(); 39 | parent::tearDown(); 40 | } 41 | 42 | /** 43 | * Fixture: Create test attribute 44 | * 45 | * @return $this 46 | */ 47 | protected function _addAttribute() 48 | { 49 | /** @var Mage_Catalog_Model_Resource_Setup $setup */ 50 | $setup = Mage::getResourceModel('catalog/setup', 'catalog_setup'); 51 | $setup->startSetup(); 52 | $setup->addAttribute(Mage_Catalog_Model_Product::ENTITY, self::TEST_ATTRIBUTE_CODE, array( 53 | 'type' => 'int', 54 | 'label' => 'TEST', 55 | 'input' => 'select', 56 | 'required' => false, 57 | 'user_defined' => true, 58 | 'searchable' => false, 59 | 'filterable' => false, 60 | 'comparable' => false, 61 | 'visible_in_advanced_search' => false, 62 | 'apply_to' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, 63 | 'option' => array( 64 | 'values' => range(101, 199) 65 | ), 66 | )); 67 | $setup->endSetup(); 68 | return $this; 69 | } 70 | 71 | /** 72 | * Fixture: Remove test attribute 73 | * 74 | * @return $this 75 | */ 76 | protected function _removeAttribute() 77 | { 78 | /** @var Mage_Catalog_Model_Resource_Setup $setup */ 79 | $setup = Mage::getResourceModel('catalog/setup', 'catalog_setup'); 80 | $setup->removeAttribute(Mage_Catalog_Model_Product::ENTITY, self::TEST_ATTRIBUTE_CODE); 81 | return $this; 82 | } 83 | 84 | /** 85 | * Test loading of collection with pagination request 86 | * 87 | * @test 88 | * @dataProvider dataProvider 89 | * @loadExpectation 90 | * @registry entity_attribute 91 | * @singleton integernet_attributeoptionpager/observer 92 | * @param int $requestPage 93 | * @param $requestPageSize 94 | * @param $configPageSize 95 | * @throws Mage_Core_Exception 96 | */ 97 | public function loadCollection($requestPage, $requestPageSize, $configPageSize) 98 | { 99 | $this->_mockToolbar(); 100 | $this->app()->getStore('admin')->setConfig( 101 | IntegerNet_AttributeOptionPager_Model_Pager::XML_PAGE_SIZE, $configPageSize); 102 | 103 | $this->_registerEntityAttribute(); 104 | $this->_triggerPredispatchObserver($requestPage, $requestPageSize); 105 | 106 | $actualOptionValues = array_map( 107 | function ($value) { 108 | return $value['store0']; 109 | }, 110 | $this->_block->getOptionValues()); 111 | $expectedOptionValues = $this->expected('page-%s-size-%d', $requestPage, $requestPageSize ?: $configPageSize) 112 | ->getOptions(); 113 | $this->assertEquals($expectedOptionValues, $actualOptionValues); 114 | } 115 | 116 | /** 117 | * To emulate the request we trigger the predispatch observer with our page parameter manually 118 | * 119 | * @param $requestPage 120 | * @return $this 121 | */ 122 | protected function _triggerPredispatchObserver($requestPage, $requestPageSize) 123 | { 124 | $request = new Mage_Core_Controller_Request_Http(); 125 | $response = new Mage_Core_Controller_Response_Http(); 126 | $request->setParam('page', $requestPage); 127 | $request->setParam('limit', $requestPageSize); 128 | $controller = new Mage_Adminhtml_Catalog_Product_AttributeController($request, $response); 129 | $observer = $this->generateObserver(array('controller_action' => $controller), 130 | 'controller_action_predispatch_adminhtml_catalog_product_attribute_edit'); 131 | Mage::getSingleton('integernet_attributeoptionpager/observer')->fetchPaginationParams($observer); 132 | return $this; 133 | } 134 | 135 | /** 136 | * Mock toolbar (layout is not loaded) 137 | */ 138 | protected function _mockToolbar() 139 | { 140 | $toolbarMock = $this->mockModel('integernet_attributeoptionpager/toolbar', array('prepareBlock')); 141 | $toolbarMock->expects($this->once()) 142 | ->method('prepareBlock')->with( 143 | $this->isInstanceOf('Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection')) 144 | ->will($this->returnSelf()); 145 | $this->replaceByMock('model', 'integernet_attributeoptionpager/toolbar', $toolbarMock); 146 | } 147 | 148 | /** 149 | * Registers test attribute for tab block (would be done in controller action otherwise) 150 | * 151 | * @throws Mage_Core_Exception 152 | */ 153 | protected function _registerEntityAttribute() 154 | { 155 | $attribute = Mage::getModel('eav/entity_attribute') 156 | ->loadByCode(Mage_Catalog_Model_Product::ENTITY, self::TEST_ATTRIBUTE_CODE); 157 | Mage::register('entity_attribute', $attribute); 158 | } 159 | } -------------------------------------------------------------------------------- /src/app/code/community/IntegerNet/AttributeOptionPager/Test/Block/Tab/expectations/loadCollection.yaml: -------------------------------------------------------------------------------- 1 | page-1-size-1000: 2 | options: [199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101] 3 | page--size-10: 4 | options: [110, 109, 108, 107, 106, 105, 104, 103, 102, 101] 5 | page-1-size-10: 6 | options: [110, 109, 108, 107, 106, 105, 104, 103, 102, 101] 7 | page-2-size-10: 8 | options: [120, 119, 118, 117, 116, 115, 114, 113, 112, 111] 9 | page-10-size-10: 10 | options: [199, 198, 197, 196, 195, 194, 193, 192, 191] 11 | page-11-size-10: 12 | options: [199, 198, 197, 196, 195, 194, 193, 192, 191] 13 | page-0-size-10: 14 | options: [110, 109, 108, 107, 106, 105, 104, 103, 102, 101] 15 | page-2-size-0: 16 | options: [199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101] 17 | page-2-size-20: 18 | options: [140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121] 19 | page-1-size-90: 20 | options: [190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101] 21 | -------------------------------------------------------------------------------- /src/app/code/community/IntegerNet/AttributeOptionPager/Test/Block/Tab/providers/loadCollection.yaml: -------------------------------------------------------------------------------- 1 | no_page_specified: 2 | requestPage: "" 3 | requestPageSize: null 4 | configPageSize: 10 5 | page_one: 6 | requestPage: 1 7 | requestPageSize: null 8 | configPageSize: 10 9 | page_two: 10 | requestPage: 2 11 | requestPageSize: null 12 | configPageSize: 10 13 | last_page: 14 | requestPage: 10 15 | requestPageSize: null 16 | configPageSize: 10 17 | last_page_plus_one: 18 | requestPage: 11 19 | requestPageSize: null 20 | configPageSize: 10 21 | page_zero: 22 | requestPage: 0 23 | requestPageSize: null 24 | configPageSize: 10 25 | not_configured: 26 | requestPage: 2 27 | requestPageSize: null 28 | configPageSize: "" 29 | request_page_size_20: 30 | requestPage: 2 31 | requestPageSize: 20 32 | configPageSize: 10 33 | request_page_size_100: 34 | requestPage: 1 35 | requestPageSize: 90 36 | configPageSize: 10 37 | request_page_size_1000: 38 | requestPage: 1 39 | requestPageSize: 1000 40 | configPageSize: 10 41 | -------------------------------------------------------------------------------- /src/app/code/community/IntegerNet/AttributeOptionPager/etc/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 0.1.0 16 | 17 | 18 | 19 | 20 | 21 | IntegerNet_AttributeOptionPager_Block 22 | 23 | 24 | 25 | 26 | IntegerNet_AttributeOptionPager_Helper 27 | 28 | 29 | 30 | 31 | IntegerNet_AttributeOptionPager_Model 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | singleton 41 | integernet_attributeoptionpager/observer 42 | fetchPaginationParams 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | singleton 51 | integernet_attributeoptionpager/observer 52 | setPageOnCollection 53 | 54 | 55 | 56 | 57 | 58 | 59 | singleton 60 | integernet_attributeoptionpager/observer 61 | revertLoadedCollection 62 | 63 | 64 | 65 | 66 | 67 | 68 | singleton 69 | integernet_attributeoptionpager/observer 70 | addPaginationToBlock 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | integernet_attributeoptionpager.xml 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 1000 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /src/app/design/adminhtml/default/default/layout/integernet_attributeoptionpager.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | integernet_attributeoptionpager/style.css 16 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/app/design/adminhtml/default/default/template/integernet_attributeoptionpager/pager.phtml: -------------------------------------------------------------------------------- 1 | 27 | 34 | getCollection()->getSize()): ?> 35 | 36 | getUseContainer()): ?> 37 |
38 | 39 | 40 | getShowAmounts()): ?> 41 |

42 | getLastPageNum()>1): ?> 43 | __('Items %s to %s of %s total', $this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?> 44 | 45 | __('%s Item(s)', $this->getTotalNum()) ?> 46 | 47 |

48 | 49 | 50 | getShowPerPage()): ?> 51 |
52 | 53 | __('per page') ?> 60 |
61 | 62 | 63 | getLastPageNum()>1): ?> 64 |
65 | __('Page:') ?> 66 |
    67 | isFirstPage()): ?> 68 |
  1. 69 | 70 | getAnchorTextForPrevious()): ?> 71 | <?php echo $this->__('Previous') ?> 72 | 73 | getAnchorTextForPrevious() ?> 74 | 75 | 76 |
  2. 77 | 78 | 79 | canShowFirst()): ?> 80 |
  3. 1
  4. 81 | 82 | 83 | canShowPreviousJump()): ?> 84 |
  5. ...
  6. 85 | 86 | 87 | getFramePages() as $_page): ?> 88 | isPageCurrent($_page)): ?> 89 |
  7. 90 | 91 |
  8. 92 | 93 | 94 | 95 | 96 | canShowNextJump()): ?> 97 |
  9. ...
  10. 98 | 99 | 100 | canShowLast()): ?> 101 |
  11. getLastPageNum() ?>
  12. 102 | 103 | 104 | isLastPage()): ?> 105 |
  13. 106 | 107 | getAnchorTextForNext()): ?> 108 | <?php echo $this->__('Next') ?> 109 | 110 | getAnchorTextForNext() ?> 111 | 112 | 113 |
  14. 114 | 115 |
116 | 117 |
118 | 119 |
120 | 121 | 122 | getUseContainer()): ?> 123 |
124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /src/app/etc/modules/IntegerNet_AttributeOptionPager.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | true 16 | community 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/skin/adminhtml/default/default/integernet_attributeoptionpager/bkg_toolbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/integer-net/IntegerNet_AttributeOptionPager/9287f76540ab1602320474bf47c9c9bb30192874/src/skin/adminhtml/default/default/integernet_attributeoptionpager/bkg_toolbar.gif -------------------------------------------------------------------------------- /src/skin/adminhtml/default/default/integernet_attributeoptionpager/style.css: -------------------------------------------------------------------------------- 1 | /* Pager */ 2 | .pager { font-size:11px; background:#fff url(bkg_toolbar.gif) 0 100% repeat-x; padding:4px 8px; border-top:1px solid #e2e2e2; text-align:center; } 3 | .pager .amount { float:left; margin:0; } 4 | .pager .limiter { float:right; } 5 | .pager .limiter label { vertical-align:middle; } 6 | .pager .limiter select { padding:0; margin:0 0 1px; vertical-align:middle; } 7 | .pager .pages { margin:0 140px; } 8 | .pager .pages ol { display:inline; } 9 | .pager .pages li { display:inline; margin:0 2px; } 10 | .pager .pages .current {} --------------------------------------------------------------------------------