Changeset 762 for trunk/include/functions.inc.php
- Timestamp:
- Apr 11, 2005, 10:31:50 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r755 r762 640 640 return $array; 641 641 } 642 643 /** 644 * instantiate number list for days in a template block 645 * 646 * @param string blockname 647 * @param string selection 648 */ 649 function get_day_list($blockname, $selection) 650 { 651 global $template; 652 653 $template->assign_block_vars( 654 $blockname, array('SELECTED' => '', 'VALUE' => 0, 'OPTION' => '--')); 655 656 for ($i = 1; $i <= 31; $i++) 657 { 658 $selected = ''; 659 if ($i == (int)$selection) 660 { 661 $selected = 'selected="selected"'; 662 } 663 $template->assign_block_vars( 664 $blockname, array('SELECTED' => $selected, 665 'VALUE' => $i, 666 'OPTION' => str_pad($i, 2, '0', STR_PAD_LEFT))); 667 } 668 } 669 670 /** 671 * instantiate month list in a template block 672 * 673 * @param string blockname 674 * @param string selection 675 */ 676 function get_month_list($blockname, $selection) 677 { 678 global $template, $lang; 679 680 $template->assign_block_vars( 681 $blockname, array('SELECTED' => '', 682 'VALUE' => 0, 683 'OPTION' => '------------')); 684 685 for ($i = 1; $i <= 12; $i++) 686 { 687 $selected = ''; 688 if ($i == (int)$selection) 689 { 690 $selected = 'selected="selected"'; 691 } 692 $template->assign_block_vars( 693 $blockname, array('SELECTED' => $selected, 694 'VALUE' => $i, 695 'OPTION' => $lang['month'][$i])); 696 } 697 } 642 698 ?>
Note: See TracChangeset
for help on using the changeset viewer.