Changeset 762 for trunk/search.php


Ignore:
Timestamp:
Apr 11, 2005, 10:31:50 PM (19 years ago)
Author:
plg
Message:
  • functions get_day_list and get_month_list moved from search.php to include/functions.inc.php : these functions are now also used in admin/element_set_global.php
  • elements batch management improved : ability to set the number of elements to display per line, ability to set {author, name, creation date} fields, ability to add and remove keywords, ability to take selected elements out of caddie
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/search.php

    r688 r762  
    134134}
    135135//----------------------------------------------------- template initialization
    136 /**
    137  * instantiate number list for days in a template block
    138  *
    139  * @param string blockname
    140  * @param string selection
    141  */
    142 function get_day_list($blockname, $selection)
    143 {
    144   global $template;
    145  
    146   $template->assign_block_vars(
    147     $blockname, array('SELECTED' => '', 'VALUE' => 0, 'OPTION' => '--'));
    148  
    149   for ($i = 1; $i <= 31; $i++)
    150   {
    151     $selected = '';
    152     if ($i == (int)$selection)
    153     {
    154       $selected = 'selected="selected"';
    155     }
    156     $template->assign_block_vars(
    157       $blockname, array('SELECTED' => $selected,
    158                         'VALUE' => $i,
    159                         'OPTION' => str_pad($i, 2, '0', STR_PAD_LEFT)));
    160   }
    161 }
    162 
    163 /**
    164  * instantiate month list in a template block
    165  *
    166  * @param string blockname
    167  * @param string selection
    168  */
    169 function get_month_list($blockname, $selection)
    170 {
    171   global $template, $lang;
    172  
    173   $template->assign_block_vars(
    174     $blockname, array('SELECTED' => '',
    175                       'VALUE' => 0,
    176                       'OPTION' => '------------'));
    177 
    178   for ($i = 1; $i <= 12; $i++)
    179   {
    180     $selected = '';
    181     if ($i == (int)$selection)
    182     {
    183       $selected = 'selected="selected"';
    184     }
    185     $template->assign_block_vars(
    186       $blockname, array('SELECTED' => $selected,
    187                         'VALUE' => $i,
    188                         'OPTION' => $lang['month'][$i]));
    189   }
    190 }
    191136
    192137// start date
Note: See TracChangeset for help on using the changeset viewer.