Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationHacks and Mods (Moderators: scott, DanO, Marty)Ability to change calendars from the calendar view?
Pages: 1 [2]   Go Down
Print
Author Topic: Ability to change calendars from the calendar view?  (Read 1156 times)
0 Members and 1 Guest are viewing this topic.
tw1000
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #15 on: February 06, 2003, 06:27:00 PM »

Thanks, it was the upper / lower case issue I did not understand

------------------

Logged
Bartman
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #16 on: November 06, 2003, 12:44:00 PM »

Thanks everyone.  This is exactly what I was looking for.

------------------

Logged
k9barry
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #17 on: November 25, 2003, 12:30:00 AM »

Using DanO's code to add the calendars to the default.html as below:

--------------------------------------------------------------------------------

<!-- ADDED for link to each calendar -->        <TABLE BORDER="0" CLASS="thinborder" WIDTH="100" BGCOLOR="<%=$COMMAND_BGCOLOR%>">   <% $cal_db = new DBFile($main::calendars_db); %>   <% $calendars = $cal_db->getRecords( {} ); %>   <% foreach $cal ( sort {$a->{name} cmp $b->{name}} @$calendars)         {         #do whatever you wanted to do with each calendar here.         #you can use $calendar->{key}, $calendar->{name}, and $calendar->{description} to access their names, keys, and descriptions.         %>         <TR><TD BGCOLOR="<%=(($in{'calendar'} eq $cal->{key})?$_COMMAND_OPTION_SELECTED_BGCOLOR:$_COMMAND_OPTION_BGCOLOR)%>"><B><a href="<%= $CGI_URL %>?calendar=<%= $cal->{key} %>" CLASS="commandtext"><%= $cal->{name}  %></A></B></TD></TR>         <% } %>        </TABLE>        <BR><!-- END Added -->

--------------------------------------------------------------------------------

How do I limit the calendars to only show the calendars the user had view "VIEW" permissions?

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #18 on: November 25, 2003, 12:21:00 PM »

** How do I limit the calendars to only show the calendars the user had view "VIEW" permissions? **

To modify the code I supplied, after the line:

#do whatever you wanted to do with each calendar here.

ADD

next unless ($User->hasPermission($cal->{'key'},"VIEW"));


--- To complete the code in the previous messages by Keith G:

* The problem I found was the "u" in user needed to be capitalized and that got it to work. *

CORRECTED CODE

<% foreach $cal ( sort {$a->{name} cmp $b->{name}} @$calendars)
{
next unless ($User->hasPermission($cal->{'key'},"VIEW"));
%>
<option value="<%= $CGI_URL %>?calendar=<%= $cal->{key} %>"><%= $cal->{name} %></option>

Dan O.


[This message has been edited by DanO (edited November 25, 2003).]

Logged
wderzawiec
New Member
*

Karma: 0
Offline Offline

Posts: 15

Web site coordinator


WWW
« Reply #19 on: June 03, 2006, 08:42:00 PM »

Just found this code for drop-down menu and it was very very helpful.  Thanks to all.

------------------

Logged
Pages: 1 [2]   Go Up
Print
Jump to: