2 include_once $gfplugins.'webcalendar/www/includes/init.php';
4 if ( $allow_view_other != 'Y' ) {
6 etranslate("You are not authorized");
11 $updating_public = false;
12 if ( $is_admin && ! empty ( $public ) && $public_access == "Y" ) {
13 $updating_public = true;
14 $layer_user = "__public__";
19 load_user_layers ( $layer_user, 1 );
21 $INC = array('js/edit_layer.php');
26 if ( $updating_public )
27 echo translate($PUBLIC_ACCESS_FULLNAME) . " ";
29 if ( ! empty ( $layers[$id]['cal_layeruser'] ) )
30 etranslate("Edit Layer");
32 etranslate("Add Layer");
33 ?> <img src="help.gif" alt="<?php etranslate("Help")?>" class="help" onclick="window.open ( 'help_layers.php', 'cal_help', 'dependent,menubar,scrollbars,height=400,width=400,innerHeight=420,outerWidth=420' );" /></h2>
35 <form action="edit_layer_handler.php" method="post" onsubmit="return valid_form(this);" name="prefform">
37 <?php if ( $updating_public ) { ?>
38 <input type="hidden" name="public" value="1" />
41 <table style="border-width:0px;">
43 if ( $single_user == "N" ) {
44 $userlist = get_my_users ();
45 if ($nonuser_enabled == "Y" ) {
46 $nonusers = get_nonuser_cals ();
47 $userlist = ($nonuser_at_top == "Y") ? array_merge($nonusers, $userlist) : array_merge($userlist, $nonusers);
52 for ( $i = 0; $i < count ( $userlist ); $i++ ) {
53 if ( $userlist[$i]['cal_login'] != $layer_user ) {
55 $users .= "<option value=\"" . $userlist[$i]['cal_login'] . "\"";
56 if ( ! empty ( $layers[$id]['cal_layeruser'] ) ) {
57 if ( $layers[$id]['cal_layeruser'] == $userlist[$i]['cal_login'] )
58 $users .= " selected=\"selected\"";
60 $users .= ">" . $userlist[$i]['cal_fullname'] . "</option>\n";
68 print "<tr><td style=\"vertical-align:top;\">\n<label for=\"layeruser\">" .
69 translate("Source") . ":</label></td><td>\n";
70 print "<select name=\"layeruser\" id=\"layeruser\" size=\"1\">$users\n";
77 <label for="layercolor"><?php etranslate("Color")?>:</label></td><td>
78 <input type="text" name="layercolor" id="layercolor" size="7" maxlength="7" value="<?php echo empty ( $layers[$id]['cal_color'] ) ? "" : $layers[$id]['cal_color']; ?>" />
79 <input type="button" onclick="selectColor('layercolor')" value="<?php etranslate("Select")?>..." />
81 <tr><td style="font-weight:bold;">
82 <?php etranslate("Duplicates")?>:</td><td>
83 <label><input type="checkbox" name="dups" value="Y"<?php
84 if (! empty ($layers[$id]['cal_dups']) && $layers[$id]['cal_dups'] == 'Y')
85 echo " checked=\"checked\"";
86 ?> /> <?php etranslate("Show layer events that are the same as your own")?></label>
89 <input type="submit" value="<?php etranslate("Save")?>" />
92 // If a layer already exists put a 'Delete Layer' link
93 if ( ! empty ( $layers[$id]['cal_layeruser'] ) ) { ?>
95 <br /><a title="<?php etranslate("Delete layer")?>" href="del_layer.php?id=<?php echo $id; if ( $updating_public ) echo "&public=1"; ?>" onclick="return confirm('<?php etranslate("Are you sure you want to delete this layer?")?>');"><?php etranslate("Delete layer")?></a><br />
97 <?php } // end 'Delete Layer' link ?>
100 <?php if ( ! empty ( $layers[$id]['cal_layeruser'] ) )
101 echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
105 <?php print_trailer(); ?>