Changeset 8626


Ignore:
Timestamp:
Jan 12, 2011, 2:41:55 PM (10 years ago)
Author:
plg
Message:

feature 2103 added: week may start on sunday/monday in the monthly calendar

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r8126 r8626  
    247247        'CONF_PAGE_BANNER' => htmlspecialchars($conf['page_banner']),
    248248        'CONF_GALLERY_URL' => $conf['gallery_url'],
     249        'week_starts_on_options' => array(
     250          'sunday' => $lang['day'][0],
     251          'monday' => $lang['day'][1],
     252          ),
     253        'week_starts_on_options_selected' => $conf['week_starts_on'],
    249254        ));
    250255
  • trunk/admin/themes/default/template/configuration.tpl

    r8128 r8626  
    8686        <span class="property">{'Email admins when a new user registers'|@translate}</span>
    8787        <input type="checkbox" name="email_admin_on_new_user" {if ($main.email_admin_on_new_user)}checked="checked"{/if}>
     88      </label>
     89    </li>
     90
     91    <li>
     92      <label>
     93        <span class="property">
     94          {'Week starts on'|@translate}
     95          {html_options name="week_starts_on" options=$main.week_starts_on_options selected=$main.week_starts_on_options_selected}
     96        </span>
    8897      </label>
    8998    </li>
  • trunk/include/calendar_monthly.class.php

    r6363 r8626  
    331331function build_month_calendar(&$tpl_var)
    332332{
    333   global $page;
     333  global $page, $lang, $conf;
    334334
    335335  $query='SELECT '.pwg_db_get_dayofmonth($this->date_field).' as period,
     
    369369    $items[$day]['height'] = $row['height'];
    370370    $items[$day]['dow'] = $row['dow'];
    371   }
    372 
    373   global $lang, $conf;
     371
     372    if ('sunday' == $conf['week_starts_on'])
     373    {
     374      $items[$day]['dow']++;
     375    }
     376  }
    374377
    375378  if ( !empty($items)
     
    396399      $first_day_dow -= 1;
    397400    }
    398     array_push( $wday_labels, array_shift($wday_labels) );
     401
     402    if ('monday' == $conf['week_starts_on'])
     403    {
     404      array_push( $wday_labels, array_shift($wday_labels) );
     405    }
    399406    // END - pass now in week starting Monday
    400407
  • trunk/install/config.sql

    r6411 r8626  
    5252    'Information displayed on picture page'
    5353  );
     54INSERT INTO piwigo_config (param,value,comment) VALUES ('week_starts_on','monday','Monday may not be the first day of the week');
  • trunk/language/en_UK/admin.lang.php

    r8422 r8626  
    800800$lang['with no album'] = 'with no album';
    801801$lang['with no tag'] = 'with no tag';
     802$lang['Week starts on'] = 'Week starts on';
    802803?>
  • trunk/language/fr_FR/admin.lang.php

    r8498 r8626  
    804804$lang['with no album'] = 'sans album';
    805805$lang['with no tag'] = 'sans tag';
     806$lang['Week starts on'] = 'La semaine commence le';
    806807?>
Note: See TracChangeset for help on using the changeset viewer.