Created
October 24, 2011 01:34
-
-
Save imknight/1308188 to your computer and use it in GitHub Desktop.
Create a dropdown filter on item listing page [FUELCMS]
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
$config['modules']['operation_queue'] = array( | |
'module_name' => 'Queue Management', | |
'module_uri' => 'operation/queue', | |
'model_name' => 'queue_model', | |
'model_location' => 'operation', | |
'permission' => 'operation/queue', | |
'nav_selected' => 'operation/queue', | |
'default_col' => 'date_added', | |
'display_field' => 'id', | |
'filters' => array('date_added' => array('default' => date('Y-m-d',time()), 'label' => 'Queue Day', 'type' => 'select')), | |
'instructions' => lang('module_instructions_queue') | |
); |
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
$route[FUEL_ROUTE.'operation/queue'] = OPERATION_FOLDER.'/queue'; | |
$route[FUEL_ROUTE.'operation/queue/(.+)'] = OPERATION_FOLDER.'/queue/$1'; |
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
//must be include module controller | |
require_once(FUEL_PATH.'/controllers/module.php'); | |
class Queue extends Module { | |
function __construct() | |
{ | |
parent::__construct(); | |
} | |
function items() | |
{ | |
//you can self define the value here, or call in the module class and pull a series of value here | |
$queue_day['']='All'; | |
$queue_day['today']='Today'; | |
$queue_day['tomorrow']='Tomorrow'; | |
if (!empty($this->filters['date_added'])) $this->filters['date_added']['options'] = $queue_day; | |
parent::items(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment