Ignore:
Timestamp:
Apr 11, 2005, 10:31:50 PM (20 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/include/functions.inc.php

    r755 r762  
    640640  return $array;
    641641}
     642
     643/**
     644 * instantiate number list for days in a template block
     645 *
     646 * @param string blockname
     647 * @param string selection
     648 */
     649function 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 */
     676function 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}
    642698?>
Note: See TracChangeset for help on using the changeset viewer.