Ejemplo n.º 1
0
function display_page_content()
{
    $accnt_id = requestIdParam();
    $account = Paypal_Config::FindById($accnt_id);
    ?>

<script type="text/javascript">
	$().ready(function() {
		$("#edit_paypal").validate({
			rules: {
					email: { required: true, email: true }
				},
			messages: {
					email: "Please enter a valid email address"
				}
		});
	});
</script>

<form id="edit_paypal" method="POST">

	<h1>Edit Account "<?php 
    echo $account->account_name;
    ?>
"</h1>
	
	<p class="announce">There is one PayPal account associated with <a href="<?php 
    echo BASEHREF;
    ?>
admin/list_products">products</a> on your site. To change the email associated with products and your PayPal account, edit it here. If you need more than one account &ndash; say, for different types of products &ndash; then let us know, and we can add that functionality.</p>
	<p>&nbsp;</p>
	
	<p><label for="email">Email:</label>
	<?php 
    textField("email", $account->email, "required: true");
    ?>
</p>
	
	<p><label for="email">Success URL:</label>
	<?php 
    textField("success_url", $account->success_url);
    ?>
<br />
	<span class="hint">Optional address to send people to when they successfully complete a checkout</span></p>
	
	<p><label for="email">Cancel URL:</label>
	<?php 
    textField("cancel_url", $account->cancel_url);
    ?>
<br />
	<span class="hint">Optional address to send people to when they decline or cancel a checkout</span></p>
		
	<input type="submit" class="submitbutton" name="submit" value="Save" />
</form>
<?php 
}
Ejemplo n.º 2
0
function display_page_content()
{
    $users = Users::FindAll();
    ?>

					<script type="text/javascript">
						loadTinyMce("blog_description");
						
						$().ready(function() {
							$("#add_blog").validate({
									rules: {
											name: "required",
											user: "******"
										},
									messages: {
											name: "Please enter a name for this blog<br/>",
											user: "******"
										}
								});
						});
						
						$().ready(function() {
							
						});
					</script>
					<form method="POST" id="add_blog">
						<h1>Add Blog</h1>
						<p>Instructions: <span class="hint">Name the Blog first, then use the <b>Add Entry</b> page to edit and add photos to the blog.</span></p>
						
						<p><label for="name">Display Name:</label>
						<span class="hint">This is the Proper Name of the blog.</span><br />
						<?php 
    textField("name", "", "required: true");
    ?>
</p>
						
						<p><label for="name">Select User:</label>
						<span class="hint">This is the User associated with the blog.</span><br />
						<?php 
    echo "\t\t\t\t\t\t<select name='user_id' id='user_id'>\n\t\t\t<option>Select User</option>\n";
    foreach ($users as $user) {
        echo "\t\t\t\t\t\t\t<option value='{$user->id}'>{$user->email}</option>\n";
    }
    echo "\t\t\t\t\t\t</select>";
    ?>
						</p>
						
						<p><input type="submit" class="submitbutton" name="submit" value="Add" /><br />
						
						<div id="error_container"></div>
					</form>
<?php 
}
Ejemplo n.º 3
0
function display_page_content()
{
    ?>

	<script type="text/javascript">
		$().ready(function() {
			$("#add_gallery").validate({
				rules: {
					name: "required"
				},
				messages: {
					name: "Please enter a name for this gallery<br/>"
				}
			});
		});
	</script>
	
	<div id="edit-header" class="documentnav">
		<h1>Add Gallery</h1>
	</div>
	
	<form method="POST" id="add_gallery">
		
		<p class="announce"><strong>Instructions:</strong> Name the Gallery first, then use the <a href="<?php 
    echo get_link("admin/list_galleries");
    ?>
">List Galleries</a> page to edit and add photos to the gallery.</p>
		<p>&nbsp;</p>
		
		<p class="display_name">
			<label for="name">Display Name:</label>
			<span class="hint">This is the Proper Name of the gallery.</span><br />
			<?php 
    textField("name", "", "required: true");
    ?>
		</p>
		
		<div id="edit-footer" class="gallerynav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Add Gallery" /> <br />
				</p>
				
			</div>
			<div class="column half last"></div>
		</div>
		
	</form>
<?php 
}
Ejemplo n.º 4
0
function display_page_content()
{
    ?>

	<script type="text/javascript">
		//<![CDATA[
		$().ready(function() 
			{
			$('#subject_add').click(function() {
				$('#session_add').load('<?php 
    echo BASEHREF;
    ?>
blaster/subject_add/subject_line/true', function() { 
					$("#subject_added").slideDown();
					$("#subject_removed").slideUp();
				});
				return false;
			});
			$('#subject_remove').click(function() {
				$('#session_add').load('<?php 
    echo BASEHREF;
    ?>
blaster/subject_add/subject_line/false', function() { 
					$("#subject_removed").slideDown();
					$("#subject_added").slideUp();
				});
				return false;
			});
		});
	</script>
			
	<p><label for="subject_line">Subject line of the Email Blast:</label>
    	<?php 
    textField("subject_line", "", "");
    ?>
	</p>
	
	<p>
    	<a href="#" id="subject_add" class="submitbutton smaller">Add Subject</a>
    	<a href="#" id="subject_remove" class="submitbutton smaller">Remove Subject</a>
	</p>
	
	<div id="subject_added" class="blast_notice" style="display:none">Subject Line Added</div>	
	<div id="subject_removed" class="blast_notice" style="display:none">Subject Line Removed</div>	
	
	<?php 
}
Ejemplo n.º 5
0
function display_page_content()
{
    ?>

	<script type="text/javascript">
		//<![CDATA[
		$().ready(function() 
			{
			$('#events_add').click(function() {
				$('#event_include').load('<?php 
    echo BASEHREF;
    ?>
blaster/event_include/'+$('#up_event_number').val()+'/'+$('#on_event_number').val(), function() { 
					$("#event_include").slideDown();
				});
				return false;
			});
		});
	</script>
			
	<p><label class="inline" for="up_event_number">Number of Upcoming Events you wish to attach:</label>
	<?php 
    textField("up_event_number", "", "");
    ?>
	</p>
	
	<p><label class="inline" for="on_event_number">Number of Ongoing Events you wish to attach:</label>
	<?php 
    textField("on_event_number", "", "");
    ?>
	</p>
	<p>
	<a href="#" id="events_add" class="submitbutton smaller">Add Events</a>&nbsp; &nbsp;<span class="hint">Change the numbers above and click &ldquo;Preview Events&rdquo; again to refresh the list below.</span>
	</p>
	
	<div id="event_include"></div>	
	
	<?php 
}
function offerChoices () {
#----------------------------------------------------------------------
  global $chosenId, $chosenConfirm;

  adminHeadline( 'Change Person' );

  echo "<p style='width:45em'>Choose 'Fix' if you want to replace a person's information in the database. It will modify the Persons table accordingly and the Results table if the person's name is different. This should be used to fix mistakes in the database.</p>\n";

  echo "<p style='width:45em'>Choose 'Update' if the person's name or country has been changed. It will add a new entry in the Persons table and make it the current information for that person (subId=1) but it will not modify the Results table so previous results keep the old name.</p>\n";

  echo "<hr />";

  echo "<form method='POST'>\n";
  echo "<table class='prereg'>\n";
  textField( 'id', 'WCA Id', $chosenId, 11 );

  if( ! $chosenConfirm ) {
    echo "<tr><td>&nbsp;</td><td style='text-align:center'>";
    echo "<input type='submit' id='confirm' name='confirm' value='Confirm' style='background-color:#9F3;font-weight:bold' /> ";
    echo "</td></tr></table></form>";
    return;
  }

  $persons = dbQuery( "SELECT * FROM Persons WHERE id='$chosenId' AND subId=1" );
  if( count( $persons ) == 0 ){
    noticeBox(false, 'Unknown WCA Id '.$chosenId);
    return;
  }

  $person = array_shift( $persons );
  extract( $person );

  #--- Name
  textField( 'name', 'Name', $name, 50 );

  #--- Country
  $countries = dbQuery( "SELECT * FROM Countries" );
  $fieldC = '';
  foreach( $countries as $country ){
    $cId   = $country['id'  ];
    $cName = $country['name'];
    if( $cId == $countryId )
      $fieldC .= "  <option value=\"$cId\" selected='selected' >$cName</option>\n";
    else
      $fieldC .= "  <option value=\"$cId\">$cName</option>\n";
  }
  echo "  <tr><td width='30%'><label for='countryId'><b>Country</b></label></td>\n";
  echo "      <td><select id='countryId' name='countryId'>\n";
  echo $fieldC;
  echo "      </select></td></tr>\n";

  #--- Gender
  if( $gender == 'm' )
    $fieldG = "Male : <input type='radio' id='gender' name='gender' value='m' checked='checked' /> Female : <input type='radio' id='gender' name='gender' value='f' />";
  else if( $gender == 'f' )
    $fieldG = "Male : <input type='radio' id='gender' name='gender' value='m' /> Female : <input type='radio' id='gender' name='gender' value='f' checked='checked' />";
  else
    $fieldG = "Male : <input type='radio' id='gender' name='gender' value='m' /> Female : <input type='radio' id='gender' name='gender' value='f' />";
  echo "  <tr><td width='30%'><label for='gender'><b>Gender</b></label></td><td>$fieldG</td></tr>\n";

  #--- DoB
  echo "  <tr><td><b>Date of birth</b></td><td>";
  echo numberSelect( "day", "Day", 1, 31, $day );
  echo numberSelect( "month", "Month", 1, 12, $month );
  echo numberSelect( "year", "Year", date("Y"), date("Y")-100, $year );
  echo "</td></tr>\n";  

  #--- Submit
  echo "<tr><td>&nbsp;</td><td style='text-align:center'>";
  echo "<input type='submit' id='update' name='update' value='Update' style='background-color:#9F3;font-weight:bold' /> ";
?>
  <script>
    (function() {
      $('#update').click(function(e) {
        if(!confirm("Are you sure that you want to \"update\", not \"fix\", the competitor's data? (see information above)")) {
          e.preventDefault();
        }
      });
    })();
  </script>
<?php
  echo "<input type='submit' id='fix' name='fix' value='Fix' style='background-color:#9F3;font-weight:bold' /> ";
  echo "</td></tr></table></form>";

}
Ejemplo n.º 7
0
function display_page_content()
{
    $gallery = Galleries::FindById(requestIdParam());
    $photos = $gallery->get_photos();
    $user = Users::GetCurrentUser();
    ?>

	<script type="text/javascript">
		$().ready(function() {
			$("#edit_gallery").validate({
				errorLabelContainer: $("#error_container"),
				rules: {
					name: "required"
				},
				messages: {
					name: "Please enter a name for this gallery<br/>"
				}
			});
		});
		
		$().ready(function() {
			$("#photo_list_order").sortable({
				stop: function() {
					$("#photo_list_order li input[type=hidden]").each(function(i) {
						$(this).val(i+1);
					});
				}
			});
		});
	</script>
	
	<div id="edit-header" class="documentnav">
		<h1>Edit Gallery</h1>
	</div>

<?php 
    // DEBUG block. Run some tests. NOT PERFECT but should help point in the right direction.
    if (HCd_debug()) {
        echo '<div class="debug-block">';
        // Check the folder path to see if it exists
        if (is_dir(SERVER_DOCUMENTS_ROOT)) {
            echo '<span class="debug-feedback passed">&ldquo;' . SERVER_DOCUMENTS_ROOT . '&rdquo; exists</span>';
            $permmode = substr(sprintf('%o', fileperms(SERVER_DOCUMENTS_ROOT)), -4);
            if ($permmode == '0777' || $permmode == '0775') {
                echo '<span class="debug-feedback passed">The folder permission is <strong>' . $permmode . '</strong></span>';
            } else {
                echo '<span class="debug-feedback failed">The folder permission is <strong>' . $permmode . '</strong></span>';
            }
            if (is_dir(SERVER_DOCUMENTS_ROOT . "gallery_photos")) {
                echo '<span class="debug-feedback passed">&ldquo;' . SERVER_DOCUMENTS_ROOT . 'gallery_photos&rdquo; exists</span>';
                $permmode2 = substr(sprintf('%o', fileperms(SERVER_DOCUMENTS_ROOT . "gallery_photos")), -4);
                if ($permmode2 == '0777' || $permmode2 == '0775') {
                    echo '<span class="debug-feedback passed">The folder permission is <strong>' . $permmode2 . '</strong></span>';
                } else {
                    echo '<span class="debug-feedback failed">The folder permission is <strong>' . $permmode2 . '</strong></span>';
                }
            } else {
                echo '<span class="debug-feedback failed">&ldquo;' . SERVER_DOCUMENTS_ROOT . 'gallery_photos&rdquo; does NOT exist or can not be seen</span>';
            }
        } else {
            echo '<span class="debug-feedback failed">&ldquo;' . SERVER_DOCUMENTS_ROOT . '&rdquo; does NOT exist</span>';
        }
        $test_file = SERVER_INCLUDES_ROOT . "www/lib/admin_images/hcdlogo_24.png";
        if (is_file($test_file)) {
            $test_imagecreatefromjpeg = @imagecreatefrompng($test_file);
            if ($test_imagecreatefromjpeg !== false) {
                echo '<span class="debug-feedback passed">&ldquo;@imagecreatefrompng&rdquo; works</span>';
            } else {
                echo '<span class="debug-feedback failed">&ldquo;@imagecreatefrompng&rdquo; returns false</span>';
            }
        } else {
            echo '<span class="debug-feedback failed">Test file does not exist. &ldquo;imagecreatefrompng&rdquo; test cannot run. </span>';
            echo '<span class="debug-feedback failed">Test file path: &ldquo;' . $test_file . '&rdquo;</span>';
        }
        echo '</div>';
    }
    ?>
	
	<form method="POST" id="edit_gallery" enctype="multipart/form-data">
		<p><span class="hint">If a text box is underlined in red, it is a required field</span></p>
		<a name="top"></a>
		
		<p class="display_name">
			<label for="name">Gallery Display Name:</label> <span class="hint">This is the Proper Name of the gallery.</span><br />
			<?php 
    textField("name", $gallery->name, "required: true");
    ?>
		</p>
		
		<p class="announce">
			<strong>Note:</strong> While the server will attempt to upload very large images and resize them, doing so may take a very long time. Please try to resize images to reasonable dimensions (about 800 pixels wide) before uploading. We recommend the Adobe Photoshop &ldquo;Save for Web&rdquo; feature, which makes the image file size very small (In Photoshop, under File > Save for Web. Use JPEG file type and a compression of about 60%. Click Progressive as well).<br />
		<br />
		The server will attempt to resize an image to a maximum dimension of: <strong><?php 
    echo MAX_GALLERY_IMAGE_WIDTH;
    ?>
 pixels wide by <?php 
    echo MAX_GALLERY_IMAGE_HEIGHT;
    ?>
 pixels tall</strong>. This is best for viewing images for the web. </p>
		<p>&nbsp;</p>
			
<!-- Start the Show/Hide for editing photos and changing order -->
		<div id="gallery-options" class="clearfix">
			
			<a name="editgal"></a>
			<ul id="gallery-options-nav" class="menu tabs">
				<li><a href="#gallery_sort" class="openclose opened">Change Photo Order</a></li>
				<li><a href="#add_edit_images" class="openclose">Add / Edit Photos and Captions</a></li>
			</ul>
		
			<div id="gallery_sort" class="dropslide">
				<h2>Click and Drag the image to change the order of the display in the Gallery</h2>
				<div id="sortable_container">
<?php 
    if (count($photos) > 0) {
        echo "\t\t\t\t<ol id=\"photo_list_order\">\n";
        foreach ($photos as $photo) {
            echo "\t\t\t\t\n\t<li><img class=\"changeorderThumb\" src=\"{$photo->getPublicUrl()}\" /><input type=\"hidden\" name=\"photos_display_order[" . $photo->id . "]\" value=\"" . $photo->display_order . "\" /></li>\n";
        }
        echo "\t\t\t\t</ol>\n";
    } else {
        echo "\n\n\n\n<h3>There are no photos to put in order. Go ahead and add some.</h3>\n";
    }
    ?>
								
				</div>
				<div class="clearleft"></div>
			</div>
			
			<div id="add_edit_images" class="dropslide" style="display: none;">
				<div id="add_image_wrap">
					<h2>Add an Additional Gallery Image</h2>
					<p><span class="hint">Images for your site would be best displayed at <?php 
    echo MAX_GALLERY_IMAGE_WIDTH;
    ?>
 pixels wide. If an image is larger, the system will attempt to resize it. Images that are too large might require more memory than the system can handle, and an error may result.</span></p>
					<p><label for="new_photo">Add an additional image:</label>
						<input type="file" name="new_photo" id="new_photo" value="" />
					</p>
					<p><label for="new_photo_caption">Caption for new image:</label>
						<?php 
    textField("new_photo_caption", "", "");
    ?>
					</p>
					<p><input type="submit" class="submitbutton" name="submit" value="Add Image to Gallery" /></p>
				</div>
				
				<p>&nbsp;</p>
				<h2>Edit Existing Gallery Photos (delete photos or edit captions. Click Save when done)</label></h2>
				<p><span class="hint"><strong>Image size:</strong> The CSS control for the images designates that they display here (for ease of use) at 50% their actual size. Dont&rsquo;t worry if they appear smaller than on the front-end.<!--[if IE 6]><br /><b>IE 6 Users: The CSS can only force the image to be 240 pixels wide, which for some images, may be larger than normal, resulting in pixellation. </b><![endif]--></span></p>				                                                                                                                                                  
	<?php 
    if (count($photos) > 0) {
        echo "<ul id=\"add_photo_list\">\n";
        foreach ($photos as $photo) {
            echo "<li><img src=\"{$photo->getPublicUrl()}\" />\n";
            echo "<div><input type=\"checkbox\" name=\"deleted_photos[]\" value=\"{$photo->id}\"/>&nbsp;DELETE</div>";
            textField("captions[{$photo->id}]", "{$photo->caption}", "");
            echo "</li>\n";
        }
        echo "</ul>\n";
    } else {
        echo "<h3>There are no photos to edit. Go ahead and add some.</h3>\n";
    }
    ?>
								
				<p><a href="#top">Back to the Top of the Page</a></p>
			</div>
		
		</div>
<!-- End the Show/Hide -->
			
		
		<div id="edit-footer" class="gallerynav clearfix">
			<div id="error_container"></div>
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Edit Gallery" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Edit and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
				
			<?php 
    if ($user->has_role() && !in_array($gallery->id, explode(",", PROTECTED_ADMIN_GALLERIES))) {
        ?>
				
				<p><label for="delete">Delete this Gallery?</label>
				<input name="delete" class="boxes" type="checkbox" value="<?php 
        echo $gallery->id;
        ?>
" />
				<span class="hint">Check the box and click &ldquo;Edit&rdquo; to delete from the database</span></p>
			<?php 
    } else {
        ?>
			
			    <p>This gallery is being used by a template, so it can not be deleted. Please edit its name or contents only. </p>
			<?php 
    }
    ?>
			
			</div>
		</div>
	
	</form>
<?php 
}
Ejemplo n.º 8
0
function display_page_content()
{
    $add_area = requestIdParam() == "add" ? true : false;
    if ($add_area) {
        $area = $is_global = $area_id = $areadisplayname = $areaseotitle = $areaname = $areapublic = $areatemplate = null;
    } else {
        $area_id = requestIdParam();
        $area = Areas::FindById($area_id);
        $is_global = $area->id == 1 ? true : false;
        $areaid = $area->id;
        $areadisplayname = $area->display_name;
        $areaseotitle = $area->seo_title;
        $areaname = $area->name;
        $areapublic = $area->public;
        $areatemplate = $area->template;
    }
    ?>

<div id="edit-header" class="areanav">
	<div class="nav-left column">
		<h1>
    		<?php 
    if ($add_area) {
        echo 'Add Area';
    } else {
        echo 'Edit Area : ';
        echo '<a href="' . $area->get_url() . '" title="View ' . $area->get_url() . '">View Area</a>';
    }
    ?>
        </h1>
	</div>
	<div class="nav-right column"><?php 
    quick_link();
    ?>
</div>
	<div class="clearleft"></div>
</div>

<?php 
    // Start the form
    ?>
<form method="POST" id="js-validate">

	<p class="display_name">
		<label for="display_name">Display Name:</label> 
		<?php 
    textField("display_name", $areadisplayname, "required: true");
    ?>
<br />
		<span class="hint">This is the Proper Name of the area; how it will display in the navigation.</span>
	</p>
		
<?php 
    // If not Index, not a Portfolio Area, and not the Blog area
    if ($is_global != 1 && !strstr($areaname, "_portfolio") && $area_id != 3) {
        if (ALLOW_SHORT_PAGE_NAMES) {
            ?>
	<p>
		<label for="name">Short Name</label> 
		<?php 
            textField("name", $areaname);
            ?>
<br />
		<span class="hint">This is the short name of the page, which gets used in the URL. No spaces, commas, or quotes please.</span>
	</p>
<?php 
        }
    } else {
        hiddenField("name", $areaname);
    }
    if (!$add_area) {
        echo '<p class="page-url">Area URL: <span class="page-url">http://' . SITE_URL . '/<mark>' . ltrim($area->get_url(), "/") . '</mark></span></p>';
    }
    ?>
    
	<div class="column half">
    <?php 
    if (!$is_global) {
        ?>
		<p>
			<label for="public">Public:</label>&nbsp; <?php 
        checkBoxField("public", $areapublic);
        ?>
<br />
			<span class="hint">This determines whether or not the Area will appear in the navigation as a &ldquo;Public&rdquo; link. You may place new pages inside this Area and make them &ldquo;public&rdquo;, but they will still not be visible until the Area is also Public. </span>
		</p>
	<?php 
    } else {
        echo '<p><input type="hidden" name="public" value="1"></p>';
    }
    ?>
	
    </div>
	<div class="column half last">
		<p>
			<label for="seo_title">SEO Title:</label>
			<?php 
    textField("seo_title", $areaseotitle);
    ?>
<br />
			<span class="hint">This title is used in title meta tags (good for SEO). Might also show when a user hovers their mouse over a link. Best to be as short as possible.</span>
		</p>
	</div>
	<div class="clearleft"></div>

    <?php 
    // Template
    ?>
	<p><label for="template">Template:</label>
		<select id="template" name="template">
		<?php 
    $templates = list_available_templates();
    foreach ($templates as $template) {
        $thistemplate = $template == $areatemplate ? ' selected="selected"' : '';
        echo '<option value="' . $template . '"' . $thistemplate . '>' . ucwords($template) . '</option>';
    }
    ?>
		</select><br />
		<span class="hint">When a Page inside this Area uses the template &ldquo;inherit&rdquo;, the Page will inherit this Area&rsquo;s template selection. So, changing this Template may change the display of all Pages within this Area. </span>
	</p>
		
	
	<div id="edit-footer" class="areanav clearfix">
		<div class="column half">
			<p>
				<input type="submit" class="submitbutton" name="submit" value="Save Area" /> <br />
				<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
			</p>
		</div>
		<div class="column half last">
		<?php 
    $user = Users::GetCurrentUser();
    if ($user->has_role() && !in_array($area_id, explode(",", PROTECTED_ADMIN_AREAS)) && requestIdParam() != "add") {
        ?>
		
			<p>
				<label for="delete">Delete this Area?</label>
				<input name="delete" class="boxes" type="checkbox" value="<?php 
        echo $area_id;
        ?>
" />
				<span class="hint">Check the box and then click &ldquo;Edit&rdquo; above to delete from the database. This will move any pages contained within this area to the Global Area, so they do not become Orphans.</span></p>
		<?php 
    } elseif (requestIdParam() != "add") {
        ?>
			
			<p class="red">This area is being protected, it can not be deleted.</p>
		<?php 
    }
    ?>
		</div>
	</div>
		
</form>
	
<script type="text/javascript">
	$().ready(function() {
		$("#js-validate").validate({
			rules : {
				display_name: "required"
			},
			messages: {
				display_name: "Please enter a name you would like to be displayed for this area"
			}
		});
	});

</script>
<?php 
}
Ejemplo n.º 9
0
function buildFormFromTable($db, $table, $prevTable, $submitURL, $data = "", $extras = "", $fillDataFromID = 0, $from = "")
{
    //
    // $formText = buildFormFromTable($db, $table, ...)
    //
    // Builds an html form for the specified table. The form will
    // include pull-downs for foreign table links. If anything fails,
    // $formText will comprise an informative message rather than
    // an actual table. You can include default values in 'd'.
    //
    // If d[id] is set, then this will be treated as an update rather
    // than an insert. The other values in d will over ride those from
    // the existing record, so be sure to unset those (or set them ="")
    // if you want to start with defaults from the db.
    //
    // if $fillDataFromID != 0, then it is sort of like an update- default
    // values will be pulled from the db from the specified id. Again, values
    // in d that are set and !="" will override those from the db, so be
    // sure to unset them if you want all defaults pulled from the db.
    //
    // Note that all the form fields are named "d[tableName][fieldName]".
    // Obviously, your function that processes the form data will need
    // to know this.
    // Eg:
    //
    //
    // Also, note that this function assumes that a new table form can be
    // displayed by submitting the form with "$table" set to the new table name.
    //
    $maxSelectLength = 30;
    //
    // GET FOREIGN TABLE LINKS
    //
    if (!($res = mysql_query('SELECT * FROM xLinks WHERE fromTable="' . $table . '"', $db))) {
        $formText = "MySQL error nr " . mysql_errno($db) . ": " . mysql_error($db);
        return $formText;
    }
    while ($row = mysql_fetch_array($res)) {
        $xlinks[$row['fromColumn']][-1] = "select from " . $row['toTable'];
        $xlinksTable[$row['fromColumn']] = $row['toTable'];
        // *** IS THERE A WAY TO SELECT JUST THE FIRST THREE COLUMNS?
        $res2 = mysql_query('SELECT * FROM ' . $row['toTable'], $db) or trigger_error("MySQL error nr " . mysql_errno($db) . ": " . mysql_error($db));
        while ($row2 = mysql_fetch_row($res2)) {
            // This will be a 2d array- the 2nd dim is a hash with the item ID # as the key.
            if (strlen($row2[1]) > $maxSelectLength) {
                $row2[1] = substr($row2[1], 0, $maxSelectLength) . "...";
            }
            $xlinks[$row['fromColumn']][$row2[0]] = "(" . $row2[0] . ") " . $row2[1];
            // We decide if we should show the third field based on it's length. If it's too long,
            // then it's probably not worth showing, unless the second field is empty.
            if (mysql_field_len($res2, 2) < 100 | strlen($row2[1]) == 0) {
                if (strlen($row2[2]) > $maxSelectLength) {
                    $row2[2] = substr($row2[2], 0, $maxSelectLength) . "...";
                }
                $xlinks[$row['fromColumn']][$row2[0]] .= " " . $row2[2];
            }
        }
    }
    $d = $data[$table];
    unset($data[$table]);
    // If the fillDataFromID var is set to a real ID, then try to fill in the data from this entry.
    // This will be like an update except that we'll zero out the ID later so that it becomes a new entry.
    if (isset($fillDataFromID) && $fillDataFromID != 0) {
        $d['id'] = $fillDataFromID;
    }
    // If the 'id' field is set and non-zero, then this is an update form.
    // Get the old data for fill-in the defaults.
    if (isset($d['id']) && $d['id'] != 0) {
        if (!($res = mysql_query("SELECT * FROM {$table} WHERE id=" . $d['id'], $db))) {
            $formText = "MySQL error nr " . mysql_errno($db) . ": " . mysql_error($db);
            return $formText;
        }
        // We no longer overwrite defaults sent in via $data
        while ($row = mysql_fetch_array($res)) {
            foreach ($row as $field => $value) {
                if (!isset($d[$field]) || $d[$field] == "") {
                    $d[$field] = $value;
                }
            }
            // end foreach
        }
        // end while
        // Zero the ID if we're cloning rather than updating
        if (isset($fillDataFromID) && $fillDataFromID != 0) {
            $d['id'] = 0;
        }
    }
    // end if
    //
    // BUILD HTML FORM
    //
    if (!($res = mysql_query("SHOW FIELDS FROM {$table}", $db))) {
        $formText = "MySQL error nr " . mysql_errno($db) . ": " . mysql_error($db);
        return $formText;
    }
    $formText = "";
    if ($d['id'] != 0) {
        $pos = strpos($submitURL, '?');
        if ($pos === false) {
            $formTopText = "<form method=POST name=\"" . $table . "_form\" action=\"{$submitURL}?updateId2=" . $d['id'] . "\">\n";
        } else {
            $formTopText = "<form method=POST name=\"" . $table . "_form\" action=\"{$submitURL}&updateId2=" . $d['id'] . "\">\n";
        }
    } else {
        $formTopText = "<form method=POST name=\"" . $table . "_form\" action=\"{$submitURL}\">\n";
    }
    //$formTopText = "<form method=POST name=\"".$table."_form\" action=\"http://snarp.stanford.edu/info.php\">\n";
    $formTopText .= "<table border=0 cellspacing=2 cellpadding=2>\n";
    $formTopText .= "<input type=hidden name=\"table\" value=\"{$table}\">\n";
    if (is_array($extras)) {
        foreach ($extras as $name => $value) {
            $formTopText .= "<input type=hidden name=\"{$name}\" value=\"{$value}\">\n";
        }
    }
    if (is_array($data)) {
        foreach ($data as $otherTableName => $otherTableArray) {
            foreach ($otherTableArray as $name => $value) {
                $formTopText .= "<input type=hidden name=\"d[{$otherTableName}][{$name}]\" value=\"{$value}\">\n";
            }
        }
    }
    if (isset($prevTable) && is_array($prevTable)) {
        foreach ($prevTable as $key => $val) {
            $formTopText .= "<input type=hidden name=prevTable[{$key}] value=\"{$val}\">\n";
        }
        array_push($prevTable, $table);
    } else {
        $prevTable = array($table);
    }
    while ($row = mysql_fetch_array($res)) {
        $name = $row['Field'];
        //mysql_field_name($fields, $i);
        $typeStr = $row['Type'];
        //mysql_field_type($fields, $i);
        if ($name == 'id') {
            if ($d[$name] != 0) {
                $formTopText .= textField("Updating row " . $name . ":", "d[{$table}][{$name}]", $d[$name], 6, 0);
                // Since it will be disabled, we can't count on it being submitted with
                // the form. So, we add a hidden field.
                $formTopText .= "<input type=hidden name=\"d[{$table}][{$name}]\" value=\"{$d[$name]}\">\n";
            }
            //else $formTopText .= textField($name.":", "junk", "<auto>", 6, 0);
        } elseif ($typeStr == 'date') {
            if (!isset($d[$name])) {
                $d[$name] = date("Y-m-d");
            }
            $formText .= textField(translateField($db, $table, $name) . " (YYYY-MM-DD):", "d[{$table}][{$name}]", $d[$name], 10);
        } elseif ($typeStr == 'datetime') {
            //      if(!isset($d[$name])) $d[$name] = date("Y-m-d H:00:00");
            if ($name == 'end') {
                $d[$name] = date("Y-m-d H:59:00");
            } else {
                $d[$name] = date("Y-m-d H:00:00");
            }
            $formText .= textField($name . " (YYYY-MM-DD HH:MM:SS):", "d[{$table}][{$name}]", $d[$name], 19);
        } elseif ($typeStr == 'text') {
            $formText .= textBox($name . ":", "d[{$table}][{$name}]", $d[$name], 10);
        } elseif (strncasecmp($typeStr, 'enum', 4) == 0) {
            $vals = explode("','", "'," . substr($typeStr, 5, -1) . ",'");
            $vals = array_slice($vals, 1, -1);
            $formText .= radioField($name . ":", "d[{$table}][{$name}]", $vals, $d[$name]);
        } elseif ($name == 'password') {
            $formText .= pwdField($name . ":", "d[{$table}][{$name}]", $d[$name], 16);
        } else {
            if (isset($xlinks[$name])) {
                if (!isset($d[$name]) || $d[$name] == '') {
                    $d[$name] = -1;
                }
                $newLink = "";
                foreach ($prevTable as $key => $val) {
                    $newLink .= "&prevTable[{$key}]={$val}";
                }
                // We put these at the beginning of formText so that all the pull-downs
                // appear at the top of the page.
                $formTopText .= selectField(translateField($db, $table, $name) . ":", "d[{$table}][{$name}]", $xlinks[$name], $d[$name], " <input type=submit name=\"" . $xlinksTable[$name] . "\" value=New>");
            } else {
                list($type, $size, $extra) = preg_split('(\\(|\\))', $typeStr);
                if ($size > 40) {
                    $formText .= textBox(translateField($db, $table, $name) . ":", "d[{$table}][{$name}]", $d[$name], round($size / 40));
                } else {
                    $formText .= textField(translateField($db, $table, $name) . ":", "d[{$table}][{$name}]", $d[$name], $size);
                }
            }
        }
    }
    $formText .= "</table><br><br>\n";
    $formText .= "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type=submit name=\"{$table}\" value=Submit>\n";
    $formText .= "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type=submit name=cancel value=Cancel>\n";
    if ($from == "buildSession3") {
        $formText .= "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type=submit name=index value='Back to Main Index'>\n";
    }
    $formText .= "</form>\n";
    return $formTopText . $formText;
}
Ejemplo n.º 10
0
function display_page_content()
{
    ?>

						<script type="text/javascript">
							$().ready(function() {
								$("#add_venue").validate({
										rules : {
											name: "required",
											description: "required"
										},
										messages: {
											name: "Please a name for this list",
											description: "Please enter a description for this list"
										}
									});
							});
						</script>
						
						<form method="POST" enctype="multipart/form-data" id="add_venue">
							<h1>Add a New List</h1>
							
							<p><label for="name">Name:</label><br />
								<?php 
    textField("name", "", "required: true");
    ?>
							
							</p>				
							
							<p>
								<label for="template">Template:</label>
								<select id="template" name="template">
									<?php 
    $templates = list_mail_templates();
    foreach ($templates as $template) {
        $text = $template;
        $selected_string = "";
        if ($text == "default") {
            $selected_string = " selected";
        }
        echo "<option value=\"{$template}\"{$selected_string}>{$text}</option>";
    }
    ?>
									
								</select>
							</p>
							
							<p><label for="public">Public List:</label>
							<?php 
    checkBoxField("public", 0, "1");
    ?>
							
							</p>
														
							<p><label for="description">Description of List:</label><br />
								<?php 
    textArea("description", "", 98, 10);
    ?>
							
							</p>
							
							<p><label for="emails">Emails:</label>
								<span class="hint">This field requires a comma delimited list of emails ie blah@blah.org, blag@blag.net, etc.</span></p>
								<textarea class="mceNoEditor" name="emails" id="emails" rows="8" style="width: 98%;"></textarea>
							
							</p>
														
							<input type="submit" class="submitbutton" name="submit" value="Add New List" />
						</form>
<?php 
}
Ejemplo n.º 11
0
function display_page_content()
{
    $page_id = requestIdParam();
    $page = Pages::FindById($page_id);
    // get all the areas
    $areas = Areas::FindAll();
    $page_areas = $page->getAreas();
    // I know MOST pages dont use the error_container anymore, but this one should! If the user uses any of the drop downs before they pick an Area, the page will not submit and the user will not be able to see the error.
    ?>

	<script type="text/javascript">
	//<![CDATA[
		$().ready(function() {
			$("#edit_page").validate({
				errorLabelContainer: $("#error_container"),
<?php 
    if (SUB_PAGES) {
        ?>
	
				rules: {
					display_name: "required"
				},
				messages: {
					display_name: "Please enter a display name for this page"
				}
<?php 
    } else {
        ?>
	
				rules: {
					display_name: "required",
					"selected_areas[]": "required"
				},
				messages: {
					display_name: "Please enter a display name for this page",
					"selected_areas[]": "You unchecked an area and forgot to choose a new one! Select at least one area to include the page in. If you need to hide it, make it not public." 
				}
<?php 
    }
    ?>
	
			});
		});
	//]]>
	</script>
	
	<div id="edit-header" class="areanav">
		<div class="nav-left column">
			<h1>Edit Page : <a href="<?php 
    $page->the_url();
    ?>
" title="View <?php 
    $page->the_url();
    ?>
">View Page</a></h1>
		</div>
		<div class="nav-right column">
			<?php 
    quick_link();
    ?>
			
		</div>
		<div class="clearleft"></div>
	</div>
	
	<form method="POST" id="edit_page">
		<p><span class="hint">If a text box is underlined in red, it is a required field</span></p>
		
		<p class="display_name">
			<label for="display_name">Display Name:</label><span class="hint">This is the Proper Name of the page; how it will display in the navigation.</span><br />
			<?php 
    textField("display_name", $page->display_name, "required: true");
    ?>
		</p>
	<?php 
    if (ALLOW_SHORT_PAGE_NAMES) {
        ?>
		
		<p>
			<label for="name">Short Name:</label><span class="hint">This is the short name of the page, which gets used in the link. No spaces, commas, or quotes please.</span><br />
			<?php 
        textField("name", $page->name);
        ?>
		</p>
	<?php 
    } else {
        hiddenField("name", $page->name);
        ?>
	    <p class="page-url">Page URL: <span class="page-url"><?php 
        echo 'http://' . SITE_URL . BASEHREF . "<mark>" . ltrim($page->get_url(), "/") . "</mark>";
        ?>
</span></p>
	<?php 
    }
    ?>
		
		<p>
			<label for="name">Public:</label>&nbsp; <?php 
    checkBoxField("public", $page->public);
    ?>
			<span class="hint">This determines whether or not this page will be visible to the public.</span>
		</p>
		
		<p>
			<label for="page_content">Content:</label><br />
			<?php 
    textArea("page_content", $page->content, 98, EDIT_WINDOW_HEIGHT);
    ?>
		</p>
		
<?php 
    require_once snippetPath("admin-insert_configs");
    // We decided to hide templates from everyone except ourselves
    $thisuser = Users::GetCurrentUser();
    if ($thisuser->id == "1") {
        ?>
	
		<p>
			<label for="template">Template:</label>
			<select id="template" name="template">
				<?php 
        $templates = list_available_templates();
        $templates[] = "";
        foreach ($templates as $template) {
            $text = $template;
            if ($text == "") {
                $text = "(inherit)";
            }
            echo "<option value=\"{$template}\"";
            if ($template == $page->template) {
                echo " selected=\"selected\"";
            }
            echo ">{$text}</option>\r\n";
        }
        ?>
				
			</select>
		</p>
<?php 
    } else {
        hiddenField("template", $page->template);
    }
    ?>
				
		<div id="edit-footer" class="pagenav clearfix">
			<div id="error_container"></div>
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Page" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
<?php 
    $user = Users::GetCurrentUser();
    if ($user->has_role() && !in_array($page->id, explode(",", PROTECTED_ADMIN_PAGES))) {
        ?>
	
				<p>
					<label for="delete">Delete this page?</label>
					<input name="delete" class="boxes" type="checkbox" value="<?php 
        echo $page->id;
        ?>
" />
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this page from the database</span>
				</p>
	<?php 
    } else {
        ?>
		
				<p class="red">This page is being protected, it can not be deleted.</p>
	<?php 
    }
    ?>
	
			</div>
		</div>
		
	</form>
<?php 
}
Ejemplo n.º 12
0
function display_page_content()
{
    $image_id = getRequestVarAtIndex(2);
    $image = Images::FindById($image_id);
    //$imagenum = $image->howManyReferencing();
    ?>

	<div id="edit-header" class="imagenav">
		<h1>Edit Image</h1>
	</div>
	
	<form method="POST" id="edit_image" enctype="multipart/form-data">
		<input type="hidden" name="MAX_FILE_SIZE" value="8400000">
		
		<?php 
    //<p><strong>Number of references: <?php echo $imagenum </strong></p>
    ?>
		
		<img src="<?php 
    echo get_link('images/view/' . $image->id);
    ?>
" alt="<?php 
    echo $image->get_title();
    ?>
" />
		<p><span class="hint">The CSS will restrict the display width of this image to a max of 360 pixels wide. Don&rsquo;t worry if it appears smaller than normal. <!--[if IE 6]><br /><b>IE 6 Users: The CSS can only force the image to be 240 pixels high, which for some images, may be larger than normal, resulting in pixellation. </b><![endif]--></span></p>
		
		<!--<p>
			<label for="new_image">Select a new image to replace the current one:</label>
			<input type="file" name="new_image" id="new_image" value="" class="required: true" />
		</p>-->
		
		<p class="display_name">
			<label for="title">Title:</label>
			<?php 
    textField("title", $image->get_title(), "required: true");
    ?>
<br />
			<span class="hint">The Proper &ndash; or Pretty &ndash; name. Spaces, commas and quotes are acceptable. </span>
		</p>
		
		<?php 
    if (ALLOW_SHORT_PAGE_NAMES) {
        ?>
		<p>
			<label for="name">Short Name: </label> 
			<span class="hint">This will be used by the database only and in links. No spaces, commas or quotes please. </span><br />
			<?php 
        textField("name", $image->name, "");
        ?>
		</p>
		<?php 
    }
    ?>
		
		<p>
			<label for="description">Caption:</label>
			<?php 
    textField("description", esc_html($image->description), "");
    ?>
<br />
			<span class="hint">A caption may or may not be used on the front-end display. This field can be left blank.</span>
		</p>
		
		<p><strong>A Trick:</strong> If the caption starts with &ldquo;http://&rdquo;, the system will treat the image as a link (called a &ldquo;hot-link&rdquo;). In this case, the title will become the text for the link, displayed under the image, and the image will be clickable (the cursor will turn into a hand when passed over the image). The image can still be placed to float right or left, or not float at all. </p>
		<p>If you are linking to your own page, use the full URL= <em>http://<?php 
    echo SITE_URL;
    ?>
/thearea/thepage</em>. </p>
		
		
		<div id="edit-footer" class="imagenav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Image" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
			<?php 
    $user = Users::GetCurrentUser();
    if ($user->has_role()) {
        ?>
				
				<p>
					<label for="delete">Delete this image?</label>
					<input name="delete" class="boxes" type="checkbox" value='<?php 
        echo $image->id;
        ?>
' />
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this image from the database</span>
				</p>
			<?php 
    }
    ?>
			
			</div>
		</div>
	
    </form>
    
    <script type="text/javascript">
		$().ready(function() {
			$("#edit_image").validate({
				rules : {
					title: "required",
					image: "required"
				},
				messages: {
						title: "Please enter a title for this image<br/>",
						image: "Please select a file<br/>"
					}
			});
		});
	</script>
    
<?php 
}
Ejemplo n.º 13
0
function display_page_content()
{
    $siteurl = explode('.', SITE_URL);
    ?>

	<script type="text/javascript">
		$().ready(function() {
			$("#add_user").validate({
				rules : {
					display_name: "required",
					email: "required",
					password: "******"
				},
				messages: {
					display_name : "Please enter a display name for this user",
					email: "Please enter an email for this user",
					password: "******"
				}
			});
		});
	</script>
	
	<div id="edit-header" class="usernav">
		<h1>Add User</h1>
	</div>
	
	<form method="POST" id="add_user">
		<p class="display_name">
			<label for="title">Display Name:</label>
			<?php 
    textField("display_name", '', "required: true");
    ?>
<br />
			<span class="hint">This is a proper name or nickname for the user &mdash; how they will display on the site.</span>
		</p>
		
		<p><label for="email">Email:</label>
		    <input type="email" id="email" name="email" value="" placeholder="you@<?php 
    echo $siteurl[1] . '.' . $siteurl[2];
    ?>
 or similar" autocorrect="off" autocapitalize="off" class="required: true" /><br />
			<span class="hint">The user will use this email address as their login information.</span>
        </p>
		
		<p><label for="password">Password:</label>
		    <input type="password" id="password" name="password" value="" placeholder="At least 6 characters, please" autocomplete="off" autocorrect="off" autocapitalize="off" class="required: true" /><br />
			<span class="hint">If you wish to reset a user&rsquo;s password, enter the new password here. If you leave this field blank, no changes will be made.</span><br /> Passwords do not have to contain fancy characters or numbers, but should not contain spaces &mdash; instead, we recommend a long phrase that you will remember easily. (Example: "elvislivesinmemphis". The longer the better)
		</p>
		
		<p class="announce">An &ldquo;Admin&rdquo; has Master Access &ndash; they can edit all features of the site. <b>If this box is not checked, the user is considered a Non-admin. Non-admins may NOT delete content, edit PayPal accounts or create new users.</b> They will be able to create or edit content, upload new images and documents, and create new galleries.</p>
    	<p>&nbsp;</p>
    	<h2>Privileges:</h2>
    	<hr noshade />
    	<p><label for="is_admin">Admin?</label>
    	<?php 
    checkBoxField("is_admin", 0);
    ?>
</p>
				
		<div id="edit-footer" class="usernav clearfix">
    		<div class="column half">
    	
    			<p>
    				<input type="submit" class="submitbutton" name="submit" value="Add User" /> <br />
    				<input type="submit" class="submitbuttonsmall" name="submit" value="Add and Send New User Email" />
    			</p>
    			
    		</div>
    		<div class="column half last"></div>
    	</div>
		
	</form>

<?php 
}
Ejemplo n.º 14
0
function display_page_content()
{
    $product_id = requestIdParam();
    $product = Product::FindById($product_id);
    $account = Paypal_Config::GetAccount();
    ?>
										
	<script type="text/javascript">		
		$().ready(function() {
			$("#edit_product").validate({
				rules: {
						display_name: "required",
						price: "required"
					},
				messages: {
						display_name: "Please enter a name that should be displayed for this product",
						price: "Please enter a price for this product"
					}
			});
		});
	</script>
	
	<div id="edit-header" class="productnav">
		<h1>Edit Product</h1>
	</div>
	
	<form method="POST" id="edit_product" enctype="multipart/form-data">
		<?php 
    hiddenField("accountId", $account->id);
    ?>
		
		<p><span class="hint">If a text box is underlined in red, it is a required field</span></p>
		
		<p class="display_name">
		    <label for="display_name">Display Name:</label>
		    <span class="hint">This is the Proper Name of the product.</span><br />
			<?php 
    textField("display_name", $product->display_name, "required: true");
    ?>
		</p>
		
		<p><label for="price">Price:</label><span class="hint">This is the price of the product.</span><br />
		<?php 
    textField("price", $product->price, "required: true");
    ?>
</p>
		
		<p><?php 
    $product->displayThumbnail();
    ?>
<br />
		    <label for="id_image">Select a new image to use:</label><input type="file" name="image" id="id_image" value="" />
		</p>
		
		<p><label for="product_description">Description:</label><br />
		<?php 
    textArea("product_description", $product->description, 98, 30);
    ?>
		</p>
			
		<p><input type="submit" class="submitbutton" name="submit" value="Save Product" /></p>
	
	
    	<div id="edit-footer" class="productnav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Edit Product" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Edit and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
	<?php 
    $thisuser = Users::GetCurrentUser();
    if ($thisuser->has_role()) {
        ?>
		
        		<p>
        		    <label for="delete">Delete this product? <input name="delete" id="delete" class="boxes" type="checkbox" value="<?php 
        echo $product->id;
        ?>
"></label>
            		<span class="hint">Check the box and then click &ldquo;Edit&rdquo; above to delete this product from the database</span>
                </p>
	<?php 
    }
    ?>
    			
			</div>
		</div>
		
	</form>
<?php 
}
Ejemplo n.º 15
0
function display_page_content()
{
    $users = Users::FindAll();
    $cur_user = Users::GetCurrentUser();
    $blog = Blogs::FindByUser($cur_user->id);
    ?>

					<script type="text/javascript">
						loadTinyMce("blog_description");
						
						$().ready(function() {
							$("#add_blog").validate({
									rules: {
											name: "required"
										},
									messages: {
											name: "Please enter a name for this blog"
										}
								});
						});
					</script>
					
					<form method="POST" id="add_blog">
						<h1>Edit Blog User</h1>
						<p>Instructions: <span class="hint">Name the Blog first, then use the <b>Add Entry</b> page to add info to it.</span></p>
						
						<p><label for="name">Display Name:</label>
						<span class="hint">This is the Proper Name of the blog.</span><br />
						<?php 
    textField("name", $blog->name, "required: true");
    ?>
</p>
						
					<?php 
    if ($cur_user->has_role()) {
        ?>
						<p><label for="name">User:</label>
						<span class="hint">This is the User associated with the blog.</span><br />
						<?php 
        echo "\t\t\t\t\t\t<select name='user_id' id='user_id'>";
        foreach ($users as $user) {
            if ($user->id == $blog->user_id) {
                $selected = "selected";
            } else {
                $selected = "";
            }
            echo "\t\t\t\t\t\t\t<option {$selected} value='{$user->id}'>{$user->email}</option>\n";
        }
        echo "\t\t\t\t\t\t</select>";
        ?>
						</p>
					<?php 
    } else {
        ?>
						<p><label for="name">User:</label> <?php 
        foreach ($users as $user) {
            if ($user->id == $blog->user_id) {
                echo $user->email;
            }
        }
        ?>
</p>
					<?php 
    }
    ?>
	
						<p><input type="submit" class="submitbutton" name="submit" value="Edit" /><br />
						
						<p id="delete"><label for="delete">Delete this blog?</label>
						<input name='delete' class='boxes' type='checkbox' />
						<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this blog from the database</span></p>
					</form>
<?php 
}
Ejemplo n.º 16
0
function display_page_content()
{
    // get all the sections
    $sections = Sections::FindPublicSections();
    ?>

	<script type="text/javascript">
		$().ready(function() {
			$("#add_area").validate({
				rules : {
					display_name: "required"
				},
				messages: {
					display_name: "Please enter a name you would like to be displayed for this area"
				}
			});
		});
	
	</script>
	
	<div id="edit-header" class="portareanav">
		<h1>Add Portfolio Area</h1>
	</div>
	
	<form method="POST" id="add_area">
		<p><span class="hint">If a text box is underlined in red, it is a required field</span></p>
		
		<p class="display_name">
			<label for="display_name">Display Name:</label>
			<?php 
    textField("display_name", "", "required: true");
    ?>
			<span class="hint">This is the Proper Name of the area; how it will display in the navigation. Keep it simple, but use capitals and spaces, please. </span>
		</p>
        
        <p>
			<label for="seo_title">Title:</label>
			<?php 
    textField("seo_title");
    ?>
<br />
			<span class="hint">This title is used in title meta tags (good for SEO). Might also show when a user hovers their mouse over a link. </span>
		</p>
        
		<p><label for="area_content">Portfolio Area Description (optional):</label>
			<?php 
    textArea("area_content", "", 98, EDIT_WINDOW_HEIGHT);
    ?>
		
		</p>
<?php 
    require_once snippetPath("admin-insert_configs");
    ?>
		
		<div id="edit-footer" class="portareanav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Add New Area" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Add and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
				<p>To ensure that a new Portfolio Area does not become public without any Sections inside of it, a new Area will automatically be set to <strong>Not Public</strong>. Add some Sections and edit this Portfolio Area later to make it public and visible. </p>
			</div>
		</div>
		
	</form>
<?php 
}
Ejemplo n.º 17
0
function display_page_content()
{
    // Double check that the proper columns exist
    $video_id = find_db_column('photos', 'video_id');
    if (!$video_id) {
        echo '<h2 class="system-warning"><span>HCd&gt;CMS says:</span> The Photos table does not have a column called "video_id"</h2>';
    }
    $add_video = requestIdParam() == "add" ? true : false;
    if ($add_video) {
        $video = $videotitle = $videoservice = $videoembed = $videowidth = $videoheight = $videoposter = $attached_item = null;
    } else {
        $video_id = requestIdParam();
        $video = Videos::FindById($video_id);
        $videotitle = $video->get_title();
        $videoservice = $video->service;
        $videoembed = $video->embed;
        $videowidth = $video->width;
        $videoheight = $video->height;
        if ($video_id) {
            $possibleposter = Photos::FindVideoPoster($video_id);
            $videoposter = !empty($possibleposter) ? $possibleposter : null;
        }
    }
    ?>

	<script type="text/javascript">
		$().ready(function() {
			$("#edit_video").validate({
				rules : {
					title: "required", 
					embed: "required"
				},
				messages: {
					title: "Please enter a title for this video", 
					embed: "Please enter an embed code for this video"
				}
			});
		});
	</script>
	
	<div id="edit-header" class="videonav">
		<h1><?php 
    if ($add_video) {
        echo 'Add';
    } else {
        echo 'Edit';
    }
    ?>
 Video</h1>
	</div>
	
	<form method="POST" id="edit_video" enctype="multipart/form-data">
		
		<p class="display_name">
			<label for="title">Video Display Name:</label>
			<?php 
    textField("title", $videotitle, "required: true");
    ?>
<br />
			<span class="hint">This name should match the name you use on the embedding service source (YouTube or Vimeo), but it does not have to.</span>
		</p>
		
		<div class="column half">
    		<p><label for="service">Hosting Service:</label>
    			<select id="service" name="service">
    				<option value="youtube"<?php 
    if (!empty($video)) {
        if ($video->service == 'youtube') {
            echo ' selected';
        }
    }
    ?>
>YouTube</option>
    				<option value="vimeo"<?php 
    if (!empty($video)) {
        if ($video->service == 'vimeo') {
            echo ' selected';
        }
    }
    ?>
>Vimeo</option>
    			</select><br />
    			<span class="hint">Only two are supported at this time &mdash; YouTube is the default service.</span>
    		</p>
    		<p>
    			<label for="embed">Unique ID:</label>
    			<?php 
    textField("embed", $videoembed, "required: true");
    ?>
<br />
    			<span class="hint">The unique identifier is a random string of numbers and letters associated with the file. <br />
    			YouTube example: http://www.youtube.com/embed/<mark>tVUCsnMK18E</mark> <br />
    			Vimeo example: http://player.vimeo.com/video/<mark>72632269</mark> <br />
    			In both cases, we are only interested in the text highlighted.</span>
    		</p>
		</div>
		
		<div class="column half last">
    		<div class="column half">
        		<p>
        		    <label for="width">Video Width:</label>
        		    <?php 
    textField("width", $videowidth);
    ?>
        		</p>
    		</div>
    		<div class="column half last">
        		<p>
        		    <label for="height">Video Height:</label>
        		    <?php 
    textField("height", $videoheight);
    ?>
        		</p>
    		</div>
    		<div class="clearit"></div>
    		<p class="hint">With responsive design, the width may be set to 100% by the templates, so that number may not always be used</p>
    		
    		<?php 
    if ($video_id) {
        ?>
    		<!-- Video poster image -->
    		<p><label for="new_poster">Add/Edit a Poster image:</label>
				<input type="file" name="new_poster" id="new_poster" value="" />
			</p>
			<p class="hint">A poster image may be used by your site to display a link to a pop up video player. </p>
			<?php 
        if (!is_null($videoposter)) {
            echo '<h3>Existing Poster Image</h3>';
            echo '<p><img src="' . $videoposter->getPublicUrl() . '" style="max-width:100%;" alt=""></p>';
        }
        ?>
			<?php 
    }
    ?>
			
		</div>
		<div class="clearleft"></div>
		
<?php 
    // Show an attached Item if there is one.
    if (is_object($video)) {
        $attached_gallery = $video->getGallery();
        $attached_item = is_object($attached_gallery) ? $attached_gallery->get_item() : null;
    }
    if (is_object($attached_item)) {
        $section = array_shift($attached_item->getSections());
        echo '<h2>This video is attached to this Portfolio Item:</h2>';
        echo '<ol id="video_list" class="managelist">';
        echo '<li><a href="' . get_link("admin/portfolio_edit/" . $section->name . "/" . $attached_item->id) . '">' . $attached_item->get_title() . ' <small>EDIT</small></a></li>';
        echo '</ol>';
    }
    ?>
		
		<div id="edit-footer" class="videonav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Video" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
<?php 
    $user = Users::GetCurrentUser();
    if ($user->has_role() && requestIdParam() != "add") {
        ?>
	
				<p><label for="delete">Delete this video?</label>
					<input name="delete" class="boxes" type="checkbox" value="<?php 
        echo $video->id;
        ?>
" />
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this video from the database</span>
				</p>
<?php 
    }
    ?>
			</div>
		</div>
	
	</form>
<?php 
}
Ejemplo n.º 18
0
function display_page_content()
{
    $portareas = Areas::FindPortAreas(false);
    $sections = Sections::FindAll();
    ?>

	<script type="text/javascript">		
		$().ready(function() {
			$("#add_item").validate({
				errorLabelContainer: $("#error_container"),
				rules: {
						thumbnail: "required",
						display_name: "required",
						"selected_sections[]": "required"
					},
				messages: {
						thumbnail: "<br />Please Select a Thumbnail. You may change it later if need be",
						display_name: "Please enter a name that should be displayed for this item",
						"selected_sections[]": "Almost forgot! Select at least one section to include this item in" 
					}
			});
		});
	</script>
	
	<div id="edit-header" class="itemnav">
		<h1>Add Item</h1>
	</div>
	
	<form method="POST" id="add_item" enctype="multipart/form-data">
		<p><span class="hint">If a text box is underlined in red, it is a required field</span></p>
		
<?php 
    if (count($sections) < 1) {
        echo "<h3>There are no sections yet! Please <a class=\"short\" href=\"" . get_link("admin/portfolio_add_section") . "\">add one</a> first.</h3>";
    } else {
        ?>
		
<p class="display_name">
			<label for="display_name">Display Name:</label>
			<?php 
        textField("display_name", '', "required: true");
        ?>
		</p>
		
<?php 
        if (PORTFOLIOTHUMB_IMAGE) {
            ?>
		<div id="thumbnail" class="column half">
			
			<p><label for="thumbnail">Thumbnail:</label></p>
			<p>
				&nbsp;Select an image to use as a thumbnail:<br />
			    &nbsp;<input type="file" name="thumbnail" id="id_thumbnail" value="" class="" />
			</p>
		</div>
		<div class="column half last">
<?php 
        } else {
            ?>
	
		<div>
<?php 
        }
        ?>
		
<?php 
        if (ITEM_SKU) {
            ?>
			<p>
				<label for="item_sku">Item Sku (unique ID):</label>
				<?php 
            textField("item_sku");
            ?>
			</p>

<?php 
        }
        if (ITEM_PRICE) {
            ?>
			<p>
				<label for="item_price">Item Price:</label>
				<?php 
            textField("item_price");
            ?>
			</p>

<?php 
        }
        if (ITEM_TAXONOMY) {
            require_once snippetPath("item-taxonomy");
        }
        ?>
			
			<p><label for="name">Public:</label><?php 
        checkBoxField("public");
        ?>
&nbsp; <span class="hint">Visible or not visible to the public? If you are working on an item that is not yet ready, leave this off until it is complete.</span></p>
	
		</div>
		<div class="clearleft"></div>

		<p>
			<label for="item_content">Item Description:</label><br />
			<?php 
        textArea("item_content", '', 98, EDIT_WINDOW_HEIGHT);
        ?>
		</p>
<?php 
        require_once snippetPath("admin-insert_configs");
        ?>
		
		
		<div id="gallery-options" class="clearfix">
				
			<a name="editgal"></a>
			<ul id="gallery-options-nav" class="menu tabs">
				<li><a href="#section_selector" class="openclose opened">Edit Sections this Item is in</a></li>
			</ul>
			
			<div id="section_selector" class="dropslide">
				<h2><legend>Select a Section to include this Item in:</legend></h2>
				<fieldset>
<?php 
        foreach ($portareas as $area) {
            echo "<p><strong>" . $area->get_title() . ":</strong><br />";
            $sections = $area->getSections(true);
            foreach ($sections as $section) {
                echo "\t\t\t\t\t\t<label for='selected_sections[]'>{$section->display_name}&nbsp;";
                echo "<input name='selected_sections[]' class='boxes' type='checkbox' value='{$section->id}' /></label>\n";
            }
            echo "</p>\n";
        }
        ?>
							
					<p><span class="hint">Any item can be in more than one Section. If no sections are selected, this page will not be viewable by the public and it will appear under &ldquo;Orphaned Items&rdquo;.</span></p>
				</fieldset>
			</div><!-- #section_selector -->
		</div>
		
		<p>&nbsp;</p>
		
		<div id="edit-footer" class="itemnav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Add Item" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Add and Return to List" />
				</p>
				
			</div>
			<div class="column half last">&nbsp;</div>
		</div>

	</form>
<?php 
    }
    // end count($sections)
}
Ejemplo n.º 19
0
function display_page_content()
{
    $user_id = requestIdParam();
    $user = Users::FindById($user_id);
    $thisuser = Users::GetCurrentUser();
    /*<style>
    	.passmask { position: relative; }
    	.hideshow { text-transform: uppercase; font-size: .75em; color: #0c2347; padding-right: .5em; position: absolute; top: .2em; right: 7%;padding: .9em; }
    	</style>
    	
        	<p><label for="password">Password:</label>
        	    <fieldset class="passmask">
            	    <input type="password" class="js-hide-show-password" id="password" name="password" value="" placeholder="To reset a password, enter at least 6 characters" autocomplete="off" autocorrect="off" autocapitalize="off" />
                </fieldset><br />
    			Passwords do not have to contain fancy characters or numbers, but should not contain spaces &mdash; instead, we recommend a long phrase that you will remember easily. (Example: "elvislivesinmemphis". The longer the better)
    		</p>*/
    ?>

	<div id="edit-header" class="usernav">
		<h1>Edit User</h1>
	</div>
	
	<form method="POST" id="edit_user">
		
		<p class="display_name">
			<label for="title">Display Name:</label>
			<?php 
    textField("display_name", $user->display_name, "required: true");
    ?>
<br />
			<span class="hint">This is a proper name or nickname for the user &mdash; how they will display on the site.</span>
		</p>
	
    	<p><label for="email">Email:</label>
    	    <input type="email" id="email" name="email" value="<?php 
    echo $user->email;
    ?>
" autocorrect="off" autocapitalize="off" class="required: true" /><br />
        	<span class="hint">A user will use this email address as their login information.</span>
    	</p>
	
    	<p><label for="password">Password:</label>
    	    <input type="password" id="password" name="password" value="" placeholder="To reset a password, enter at least 6 characters" autocomplete="off" autocorrect="off" autocapitalize="off" /><br />
			Passwords do not have to contain fancy characters or numbers, but should not contain spaces &mdash; instead, we recommend a long phrase that you will remember easily. (Example: "elvislivesinmemphis". The longer the better)
		</p>

<?php 
    $thisuser = Users::GetCurrentUser();
    if ($thisuser->has_role()) {
        ?>
	
	
    	<p class="announce">An &ldquo;Admin&rdquo; has Master Access &ndash; they can edit all features of the site. <b>If this box is not checked, the user is considered a Non-admin. Non-admins may NOT delete content, edit PayPal accounts or create new users.</b> They will be able to create or edit content, upload new images and documents, and create new galleries.</p>
    	<p>&nbsp;</p>
    	<h2>Privileges:</h2>
    	<hr noshade />
    	<p><label for="is_admin">Admin?</label>
    	<?php 
        checkBoxField("is_admin", $user->is_admin);
        ?>
</p>
	
<?php 
    }
    ?>

        <div id="edit-footer" class="usernav clearfix">
    		<div class="column half">
    			<p>
    				<input type="submit" class="submitbutton" name="submit" value="Edit User" /> <br />
    				<input type="submit" class="submitbuttonsmall" name="submit" value="Edit and Return to List" />
    			</p>
    		</div>
    		<div class="column half last">
    			
    		<?php 
    if ($thisuser->has_role()) {
        ?>
    			
    			<p><label for="delete">Delete this User?</label>
        		<input name="delete" class="boxes" type="checkbox" value="<?php 
        echo $user->id;
        ?>
" />
        		<span class="hint">Check the box and click &ldquo;Edit&rdquo; to delete this user from the database</span></p>
    		<?php 
    }
    ?>
    		
    		</div>
    	</div>
    		
    </form>
    
    <script type="text/javascript">
		$().ready(function() {
			$("#edit_user").validate({
					rules : {
						display_name: "required",
						email: "required"
					},
					messages: {
							display_name: "Please enter an email for this user",
							email: "Please enter an email for this user"
						}
				});
		});
		
		/* From PolarB.com and the great Luke Wroblewski
		 * Throws an error in browsers because prior to jQuery 1.9, changing the type of an input is not allowed (IE6/7/8 would error).
		 * Need to use jQuery 2.0 or 1.9 Migrate to get this to work 
		!function(){$(document).ready(function(){$(".js-hide-show-password").each(function(){var $input=$(this),$hideShowLink=$('<span class="hideshow js-hide-show-link">Show</span>');$hideShowLink.click(function(e){e.preventDefault();var inputType=$input.attr("type");"text"==inputType?($input.attr("type","password"),$hideShowLink.text("Show")):($input.attr("type","text"),$hideShowLink.text("Hide")),$input.focus()}),$input.parent().append($hideShowLink)})})}(); */
	</script>
	
<?php 
}
Ejemplo n.º 20
0
function display_page_content()
{
    $types = EventTypes::FindAll();
    ?>

<script type="text/javascript">
	$().ready(function() {
		$("#add_color").validate({
			rules : {
				name: "required",
				color: "required"
			},
			messages: {
					name: "Please enter an name for this event type.",
					color: "Please select a color."
				}
		});
		$("#color_picker table td").click(function() {
			var thecolor = $(this).attr('bgcolor');
			$('.colorselected').css("background-color",thecolor);
			$('input.thecolor').val(thecolor);
		});
	});
</script>

<div id="edit-header" class="eventtype">
	<h1>Add Event Type</h1>
</div>
	
<form method="POST" id="add_color">
	
	<div class="column half">
		<p class="display_name">
            <label for="name">Name: </label>
    		<?php 
    textField("name", "", "required: true");
    ?>
		</p>
    </div>
    <div class="column half last">
		<p>
    		<label for="colorselected">Color: </label>
    		<span class="colorselected">&nbsp;</span>
		</p>
	</div>
	<div class="clearleft"></div>
	
	<p><label for="color">Select New Color from Array: </label>
		<input class="thecolor" type="hidden" name="color" value="white" />
		<?php 
    require_once snippetPath("color-picker");
    ?>
	</p>
	
	<p>&nbsp;</p>
	
	<h2>Other Event Types for comparison</h2>
	<div id="table-header" class="eventlist">
		<strong class="item-link">Click Name to Edit</strong>
		<span class="item-filename">Color Preview</span>
	</div>
	<ul id="listitems" class="managelist">
<?php 
    foreach ($types as $thetype) {
        echo "\t\t\t\t\t\t<li><a class=\"item-link\" href=\"" . get_link("/admin/edit_type/{$thetype->id}") . "\">{$thetype->name}</a> <span class=\"colorpreview\" style=\"background-color: {$thetype->color}; color: {$thetype->text_color};\">{$thetype->name}</span></li>\n";
    }
    ?>
	
	</ul>
	
	<div id="edit-footer" class="eventtypenav clearfix">
		<div class="column half">
	
			<p>
				<input type="submit" class="submitbutton" name="submit" value="Add Type" /> <br />
				<input type="submit" class="submitbuttonsmall" name="submit" value="Add and Return to List" />
			</p>
			
		</div>
		<div class="column half last"></div>
	</div>
	
</form>
<?php 
}
Ejemplo n.º 21
0
function display_page_content()
{
    $document_id = requestIdParam();
    $document = Documents::FindById($document_id);
    ?>

	<script type="text/javascript">
		$().ready(function() {
			$("#edit_document").validate({
				rules : {
					name: "required"
				},
				messages: {
					name: "Please enter a name for this document"
				}
			});
		});
	</script>
	
	<div id="edit-header" class="documentnav">
		<h1>Edit Document</h1>
	</div>
	
	<form method="POST" enctype="multipart/form-data" id="edit_document">
		<input type="hidden" name="MAX_FILE_SIZE" value="15800000">
		
		<p class="display_name">
			<label for="name">Name:</label>
			<?php 
    textField("name", $document->name, "required: true");
    ?>
<br />
			<span class="hint">This is a more descriptive name for the file that will be displayed as the link when you insert it into a page. The name can start with the words &ldquo;Click here to download&hellip;&rdquo; in order t be most clear on the front-end display, but that is up to you.</span>
		</p>
		
		<p>
			<label for="filename">File Name (uneditable):</label>
			<?php 
    echo $document->filename;
    ?>
<br />
			<span class="hint">This is the physical name of the file that was uploaded.</span>
		</p>
		
		<p>
			<label for="file">Replace with a new document:</label>
			<?php 
    fileField('file');
    ?>
		</p>
		
		
		<div id="edit-footer" class="documentnav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Document" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
<?php 
    $user = Users::GetCurrentUser();
    if ($user->has_role()) {
        ?>
	
				<p><label for="delete">Delete this document?</label>
					<input name="delete" class="boxes" type="checkbox" value="<?php 
        echo $document->id;
        ?>
" />
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this document from the database</span>
				</p>
<?php 
    }
    ?>
			</div>
		</div>
	
	</form>
<?php 
}
Ejemplo n.º 22
0
function display_page_content()
{
    $event_id = getRequestVarAtIndex(4);
    $event = Events::FindById($event_id);
    $event_types = EventTypes::FindAll();
    $event_periods = EventPeriods::FindAll();
    $year = getRequestVarAtIndex(2);
    $month = getRequestVarAtIndex(3);
    $recurrences = Recurrence::FindForEvent($event_id);
    $days = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
    $user = Users::GetCurrentUser();
    ?>

<script type="text/javascript">
	//<![CDATA[
	$().ready(function() {
		setupDateFields("<?php 
    echo $event->eventperiod_id;
    ?>
");
		
		$.datepicker.setDefaults({
            showButtonPanel: true,
			showOtherMonths: true,
			selectOtherMonths: true
        });
        
        $( "#date_start" ).datepicker();
		$( "#time_start" ).timepicker({timeFormat: 'hh:mm:ss tt',stepMinute: 5});
		$( "#date_end" ).datepicker();
		$( "#time_end" ).timepicker({timeFormat: 'hh:mm:ss tt',stepMinute: 5});
		$( "#not_date" ).datepicker();
		
		$("a#notdate_add").click(function() {
			var date = $("input[name='not_date']").val();
			if (date != "") {
				$("input[name='not_date']").val('');
				var all_dates_vis = $("span#notdates").html();
				$("span#notdates").html("<label for=\"notdates[]\">"+date+"&nbsp;<a href=\"javascript:;\" onClick=\"$(this).parent().remove();\">X</a><input type=\"hidden\" name=\"notdates[]\" value=\""+date+"\" /></label>"+all_dates_vis);
			}
		});
		
		$("#eventperiod_id").change(function() { 
			var selected = $(this).val();
			setupDateFields(selected);
		});

		$("#edit_event").validate({
			rules: {
				title: "required",
				date_start: "required",
			},
			messages: {
				title: "Please enter a title for this event",
				date_start: "Please at least a start date for this event",
			}
		});
	});
	//]]>
</script>

<div id="edit-header" class="event">
	<h1>Edit Event</h1>
</div>

<div id="calendar_div"></div>

<form method="POST" id="edit_event">
	
	<p class="display_name">
        <label for="title">Title</label>
    	<?php 
    textField("title", $event->title, "required: true");
    ?>
	</p>
    
    <?php 
    if (ALLOW_EVENT_TYPES && count($event_types) > 1) {
        ?>
	<p>
	    <label for="eventtype_id">Event Type</label>
    	<select name="eventtype_id" id="eventtype_id">
		<?php 
        foreach ($event_types as $event_type) {
            echo "<option value='{$event_type->id}' ";
            if ($event_type->id == $event->eventtype_id) {
                echo " selected ";
            }
            echo ">{$event_type->name}</option>\r\n";
        }
        ?>
    	</select>
	</p>
    <?php 
    }
    ?>
    
	<div id="eventdateselects" class="dropslide">
		<p><label for="eventperiod_id">Event Period:</label>
    		<select name="eventperiod_id" id="eventperiod_id">
			<?php 
    foreach ($event_periods as $event_period) {
        echo "<option value='{$event_period->id}' ";
        if ($event_period->id == $event->eventperiod_id) {
            echo " selected ";
        }
        echo ">{$event_period->name}</option>\r\n";
    }
    ?>
    		</select>
		</p>
	
		<p>
		    <label for="date_start">Start Date / Time</label>
    		<input type="text" name="date_start" id="date_start" style="width: 6.5em;" value="<?php 
    echo $event->getDateStart("date");
    ?>
" class="required: true" />&nbsp;
    		<input type="text" name="time_start" id="time_start" style="width: 6.5em;" value="<?php 
    echo $event->getDateStart("time");
    ?>
" />&nbsp;&nbsp; 
		
    		<label for="date_start">End Date / Time</label>
    		<input type="text" name="date_end" id="date_end" style="width: 6.5em;" value="<?php 
    echo $event->getDateEnd("date");
    ?>
" />&nbsp;
    		<input type="text" name="time_end" id="time_end" style="width: 6.5em;" value="<?php 
    echo $event->getDateEnd("time");
    ?>
" />
        </p>
		
		<div id="recurrence_rules" <?php 
    if ($event->eventperiod_id != 3) {
        echo "style=\"display: none; \"";
    }
    ?>
>
			<p><label for="not_date">Exclusion Date(s)</label>
				<input type="text" name="not_date" id="not_date" style="width: 6.5em;"/>&nbsp;<a href="javascript:;" id="notdate_add">Add to list&rarr;</a> 
				<span id="notdates">
				<?php 
    foreach (explode(",", $event->getNotDates()) as $date) {
        if ($date != "") {
            echo "<label for=\"{$date}\">{$date} &nbsp;<a href=\"javascript:;\" onClick=\"\$(this).parent().remove();\">&times;</a><input type=\"hidden\" name=\"notdates[]\" value=\"{$date}\" /></label>";
        }
    }
    ?>
				</span>
			</p>
	
			<label>Recurrence Rules</label>
			<table>
				<tbody>
					<tr>
						<th>&nbsp;</th>
						<th>Sunday</th>
						<th>Monday</th>
						<th>Tuesday</th>
						<th>Wednesday</th>
						<th>Thursday</th>
						<th>Friday</th>
						<th>Saturday</th>
					</tr>
					<tr>
						<td>Every</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag($recurrences, $day, 0);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>First</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag($recurrences, $day, 1);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>Second</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag($recurrences, $day, 2);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>Third</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag($recurrences, $day, 3);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>Fourth</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag($recurrences, $day, 4);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>Last</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag($recurrences, $day, 5);
        echo "</td>";
    }
    ?>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
	
    <p>
        <label for="name">Event Description</label><br />
        <?php 
    textArea("description", $event->description, 98, EDIT_WINDOW_HEIGHT);
    ?>
    </p>
	
	<?php 
    require_once snippetPath("admin-insert_configs");
    ?>
	
	<div id="edit-footer" class="eventnav clearfix">
		<div class="column half">
			<p>
				<input type="submit" class="submitbutton" name="submit" value="Edit Event" /> <br />
				<input type="submit" class="submitbuttonsmall" name="submit" value="Edit and Return to List" />
			</p>
		</div>
		<div class="column half last">
			
		<?php 
    if ($user->has_role()) {
        ?>
			
			<p><label for="delete">Delete this Event? <input name="delete" id="delete" class="boxes" type="checkbox" value="<?php 
        echo $event->id;
        ?>
"></label>
    		<span class="hint">Check the box and click &ldquo;Save&rdquo; to delete this event from the database</span></p>
		<?php 
    }
    ?>
		
		</div>
	</div>
	
</form>
<?php 
}
Ejemplo n.º 23
0
function display_page_content()
{
    ?>

	<script type="text/javascript">
		function in_array (needle, haystack, argStrict) {
		  	var key = '', strict = !!argStrict; 
		    if (strict) {
		        for (key in haystack) {
		            if (haystack[key] === needle) {
		                return true;            
		            }
		        }
		    } else {
		        for (key in haystack) {
		            if (haystack[key] == needle) {
		            	return true;
		            }
		        }
		    }
		    return false;
		}
		$().ready(function() {
			var area = new Array(<?php 
    $array = "";
    foreach ($areas as $area) {
        $array .= "\"{$area->name}\", ";
    }
    echo substr($array, 0, -6);
    ?>
);
			jQuery.validator.addMethod("is_area", function(value, element) {
				console.log(in_array(value, area, false));
				return this.optional(element) || !in_array(value, area, false); 
			});
			
			$("#edit_alias").validate({
				rules : {
					alias: {
						required: true,
						is_area: true
					},
					path: "required"
				},
				messages: {
					alias: "Please enter an alias, or make sure this is not also the name of an existing Area",
					path: "Please enter an path for this alias"
				}
			});
		});
	</script>
	
	<div id="edit-header" class="aliasnav">
		<h1>Add Alias</h1>
	</div>
	
	<form method="POST" id="edit_alias">
		<p>When a user uses the Alias Path below in their browser, the HCd system will redirect them to the specified path below. Please make sure the page/event/blog entry exists or the system will not let you create the Alias. Also, the alias should not have the same name as an existing Area in the system (the system will warn you if it does). </p>
		
		<p class="display_name">
			<label for="alias">Alias:</label>
			<?php 
    textField("alias", '', "required: true");
    ?>
			<span class="hint">Enter only the address that will go after your site root, <em><?php 
    echo SITE_URL;
    ?>
</em>. If this matches an existing Area in the system, a warning will appear.</span>
		</p>
		
		<p>
			<label for="path">Path: </label>
			<?php 
    textField("path", '', "required: true");
    ?>
		</p>
			
		<div id="edit-footer" class="aliasnav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Add Alias" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Add and Return to List" />
				</p>
				
			</div>
			<div class="column half last"></div>
		</div>
	
	</form>
<?php 
}
Ejemplo n.º 24
0
function display_page_content()
{
    $areas = Areas::FindPortAreas();
    // get all Portfolio Areas, public or not
    $user = Users::GetCurrentUser();
    ?>

	<div id="edit-header" class="sectionnav">
		<h1>Add Portfolio Section</h1>
	</div>
	
	<form method="POST" id="add_section">
		<p><span class="hint">If a text box is underlined in red, it is a required field</span></p>
		
		<p class="display_name">
			<label for="display_name">Display Name:</label>
			<?php 
    textField("display_name", "", "required: true");
    ?>
<br />
			<span class="hint">This is the Proper Name of the section; how it will display in the navigation. Keep it simple, but use capitals and spaces, please.</span>
		</p>

		<?php 
    if (ALLOW_SHORT_PAGE_NAMES) {
        ?>
					
		<p>
			<label for="name">Name</label>
			<?php 
        textField("name", "", "required: true");
        ?>
<br />
			<span class="hint">This is the short name of the section for the link and the database. No spaces, commas, or quotes, please.</span>
		</p>
		<?php 
    }
    ?>
		
	<?php 
    if ($user->email == "*****@*****.**") {
        ?>
		<p><label for="template">Template:</label>
			<select id="template" name="template">
			<?php 
        $templates = list_available_templates();
        foreach ($templates as $template) {
            $text = $template;
            echo "<option value=\"{$template}\">{$text}</option>";
        }
        ?>
			
			</select></p>
	<?php 
    } else {
        hiddenField("template", "portfolio");
    }
    ?>
		
		<p>
			<label for="public">Public?</label><input type="checkbox" name="public" class="boxes"/><br />
			<span class="hint">This determines whether or not the Section will appear in the navigation as a &ldquo;Public&rdquo; link. If this Section is not public, then no items within it &ndash; Public or not &ndash; will be visible. A nice way to create a new Section and make sure it works well is to make the Section NOT Public, and all the items within it Public, so one click can turn it all on when it is ready. </span>
		</p>
		
		<p>
			<label for="content">Section Description:</label>
			<?php 
    textArea("section_content", "", 98, EDIT_WINDOW_HEIGHT);
    ?>
		
		</p>
<?php 
    require_once snippetPath("admin-insert_configs");
    ?>
		
		
<?php 
    require_once snippetPath("admin-portfolio-area");
    ?>
	

	
		<div id="edit-footer" class="sectionnav clearfix">
			<div id="error_container"></div>
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Add New Section" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Add and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
				<p>To ensure that a new Section does not become public without any Items inside of it, a new section will automatically be set to <strong>Not Public</strong>. Add some Items and edit this Section later to make it public and visible. </p>
			</div>
		</div>
	</form>
	
	<script type="text/javascript">
		$().ready(function() {
			errorLabelContainer: $("#error_container"),
<?php 
    if (ALLOW_SHORT_PAGE_NAMES) {
        ?>
					
			
			$("#add_section").validate({
					rules : {
						name: "required",
						display_name: "required",
						"selected_areas[]": "required"
					},
					messages: {
							name: "Please enter a name for this Section",
							display_name: "Please enter a display name for this Section",
							"selected_areas[]": "Almost forgot! Select at least one area to include the page in" 
						}
				});
		});
<?php 
    } else {
        ?>
					
		
			$("#add_section").validate({
					rules : {
						display_name: "required",
						"selected_areas[]": "required"
					},
					messages: {
							display_name: "Please enter a display name for this Section",
							"selected_areas[]": "Almost forgot! Select at least one area to include the page in" 
						}
				});
<?php 
    }
    ?>

		});					
	</script>
	
<?php 
}
Ejemplo n.º 25
0
function display_page_content()
{
    // get all the areas
    $areas = Areas::FindAll();
    // I know MOST pages dont use the error_container anymore, but this one should! If the user uses any of the drop downs before they pick an Area, the page will not submit and the user will not be able to see the error.
    ?>

	<script type="text/javascript">
	//<![CDATA[
	    $().ready(function() {
			$("#add_page").validate({
				errorLabelContainer: $("#error_container"),
<?php 
    if (SUB_PAGES) {
        ?>
	
				rules: {
					display_name: "required"
				},
				messages: {
					display_name: "Please enter a display name for this page"
				}
<?php 
    } else {
        ?>

				rules: {
					display_name: "required",
					"selected_areas[]": "required"
				},
				messages: {
					display_name: "Please enter a display name for this page",
					"selected_areas[]": "Almost forgot! Select at least one area to include the page in" 
				}
<?php 
    }
    ?>
			});
		});
	//]]>
	</script>

	<div id="edit-header" class="pagenav">
		<div class="nav-left column">
			<h1>Add Page</h1>
		</div>
		<div class="nav-right column">
			<?php 
    quick_link();
    ?>
			
		</div>
		<div class="clearleft"></div>
	</div>

	<form method="POST" id="add_page">
		<p><span class="hint">If a text box is underlined in red, it is a required field</span></p>
		
		<p class="display_name">
			<label for="display_name">Display Name:</label>
			<span class="hint">This is the Proper Name of the page; how it will display in the navigation.</span><br />
			<?php 
    textField("display_name", "", "required: true");
    ?>
		</p>
	
		<?php 
    if (ALLOW_SHORT_PAGE_NAMES) {
        ?>
		<p>
			<label for="name">Short Name:</label>
			<span class="hint">This is the short name of the page, which gets used in the link. No spaces, commas, or quotes please.</span><br />
			<?php 
        textField("name", "");
        ?>
		</p>
		<?php 
    }
    ?>
		
		<p>
			<label for="name">Public:</label>&nbsp; <?php 
    checkBoxField("public");
    ?>
			<span class="hint">This determines whether or not the page will be visible to the public.</span>
		</p>
		
		<p>
			<label for="page_content">Content:</label><br />
			<?php 
    textArea("page_content", "", 98, EDIT_WINDOW_HEIGHT);
    ?>
		</p>
	
<?php 
    require_once snippetPath("admin-insert_configs");
    // We decided to hide templates from everyone except ourselves
    $thisuser = Users::GetCurrentUser();
    if ($thisuser->id == "1") {
        ?>

		<p><label for="template">Template:</label>
			<select id="template" name="template">
				<?php 
        $templates = list_available_templates();
        $templates[] = "";
        foreach ($templates as $template) {
            $text = $template;
            if ($text == "") {
                $text = "(inherit)";
            }
            echo "<option value=\"{$template}\">{$text}</option>\r\n";
        }
        ?>
				
			</select>
		</p>
<?php 
    }
    ?>
	
		<div id="edit-footer" class="pagenav clearfix">
			<div id="error_container"></div>
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Add Page" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Add and Return to List" />
				</p>
				
			</div>
			<div class="column half last"></div>
		</div>
		
	</form>
<?php 
}
Ejemplo n.º 26
0
function display_page_content()
{
    // Double check that the proper columns exist
    $add_testimonial = requestIdParam() == "add" ? true : false;
    if ($add_testimonial) {
        $testimonial = $testimonialtitle = $testimonialcontent = $testimonialatt = $testimonialfeat = null;
    } else {
        $testimonial_id = requestIdParam();
        $testimonial = Testimonials::FindById($testimonial_id);
        $testimonialtitle = $testimonial->get_title();
        $testimonialcontent = $testimonial->content;
        $testimonialatt = $testimonial->attribution;
        $testimonialfeat = $testimonial->is_featured;
    }
    ?>

	<script type="text/javascript">
		$().ready(function() {
			$("#edit_testimonial").validate({
				rules : {
					title: "required" 
				},
				messages: {
					title: "Please enter a title for this testimonial" 
				}
			});
		});
	</script>
	
	<div id="edit-header" class="testimonialnav">
		<h1><?php 
    if ($add_testimonial) {
        echo 'Add';
    } else {
        echo 'Edit';
    }
    ?>
 Testimonial</h1>
	</div>
	
	<form method="POST" id="edit_testimonial">
		
		<p class="display_name">
			<label for="title">Testimonial Display Name:</label>
			<?php 
    textField("display_name", $testimonialtitle, "required: true");
    ?>
<br />
			<span class="hint">This name will be used in the admin only &mdash; it will not display on the front-end</span>
		</p>
		
		<p>
			<label for="content">Testimonial Content:</label> <span class="hint">Quotes will get added when displayed, so please do not add quotes here.</span><br />
			<?php 
    textArea("content", $testimonialcontent, 98, EDIT_WINDOW_HEIGHT / 2);
    ?>
		</p>
		
		<p>
			<label for="attribution">Testimonial attribution:</label>
			<?php 
    textField("attribution", $testimonialatt);
    ?>
<br />
			<span class="hint">Optional. A &ldquo;credit&rdquo; for the testimonial quote.</span>
		</p>
        
        <p>
            <label for="featured">
                <input type="checkbox" name="featured" id="featured"<?php 
    if ($testimonialfeat) {
        ?>
 checked="checked"<?php 
    }
    ?>
>
                Feature this Testimonial
            </label>
            <span class="hint">Optionally show this testimonial in special places as dictated by the site design.</span>
        </p>
        
		<div id="edit-footer" class="testimonialnav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Testimonial" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
<?php 
    $user = Users::GetCurrentUser();
    if ($user->has_role() && requestIdParam() != "add") {
        ?>
	
				<p><label for="delete">Delete this testimonial? <input name="delete" id="delete" class="boxes" type="checkbox" value="<?php 
        echo $testimonial->id;
        ?>
" /></label>
					
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; to delete this testimonial from the database. Warning: if this testimonial is removed but still being used in content, an error will be displayed.</span>
				</p>
<?php 
    }
    ?>
			</div>
		</div>
	
	</form>
<?php 
}
Ejemplo n.º 27
0
function display_page_content()
{
    $types = EventTypes::FindAll();
    $type_id = requestIdParam();
    $type = EventTypes::FindById($type_id);
    $user = Users::GetCurrentUser();
    ?>

<script type="text/javascript">
	$().ready(function() {
		$("#edit_type").validate({
			rules : {
				name: "required"
			},
			messages: {
					name: "Please enter an name for this event type.<br/>"
				}
		});
		$("#color_picker table td").click(function() {
			var thecolor = $(this).attr('bgcolor');
			$('.colorselected').css("background-color",thecolor);
			$('input.thecolor').val(thecolor);
		});
	});
</script>

<div id="edit-header" class="eventtype">
	<h1>Edit Event Type</h1>
</div>

<form method="POST" id="edit_type">
	
	<div class="column half">
		<p class="display_name">
            <label for="name">Name: </label>
    		<?php 
    textField("name", $type->name, "required: true");
    ?>
		</p>
    </div>
    <div class="column half last">
		<p>
    		<label for="colorselected">Color: </label>
    		<span class="colorselected" style="background-color:<?php 
    echo $type->color;
    ?>
">&nbsp;</span>
		</p>
	</div>
	<div class="clearleft"></div>
	
	<p><label for="new_color">Select New Color:</label> <span class="hint">Click any color below to select it, then click the Save button below.</span>
		<input class="thecolor" type="hidden" name="color" value="<?php 
    echo $type->color;
    ?>
" />
		<?php 
    require_once snippetPath("color-picker");
    ?>
	</p>
	
	<p>&nbsp;</p>
	
	<h2>Other Event Types for comparison</h2>
	<div id="table-header" class="eventlist">
		<strong class="item-link">Click Name to Edit</strong>
		<span class="item-filename">Color Preview</span>
	</div>
	<ul id="listitems" class="managelist">
<?php 
    foreach ($types as $thetype) {
        echo "\t\t\t\t\t\t<li><a class=\"item-link\" href=\"" . get_link("/admin/edit_type/{$thetype->id}") . "\">{$thetype->name}</a> <span class=\"colorpreview\" style=\"background-color: {$thetype->color}; color: {$thetype->text_color};\">{$thetype->name}</span></li>\n";
    }
    ?>
	
	</ul>
	
	<div id="edit-footer" class="eventtypenav clearfix">
		<div class="column half">
	
			<p>
				<input type="submit" class="submitbutton" name="submit" value="Save Type" /> <br />
				<input type="submit" class="submitbuttonsmall" name="submit" value="Edit and Return to List" />
			</p>
			
		</div>
		<div class="column half last">
			
		<?php 
    if ($user->has_role() && $type->id != 1) {
        ?>
			
			<p><label for="delete">Delete this Event Type?</label>
    		<input name="delete" class="boxes" type="checkbox" value="<?php 
        echo $type->id;
        ?>
" />
    		<span class="hint">Check the box and click &ldquo;Save&rdquo; to delete this type from the database</span></p>
		<?php 
    }
    ?>
		
		</div>
	</div>
	
</form>
<?php 
}
Ejemplo n.º 28
0
function display_page_content()
{
    $portareas = Areas::FindPortAreas(false);
    $item_id = getRequestVaratIndex(3);
    $item = Items::FindById($item_id);
    $next_item = $prev_item = "";
    $sectionname = getRequestVaratIndex(2);
    if ($sectionname != "orphan_section") {
        // Problem is, there could be two sections with the same name in different Areas. So, loop through the Sections attached to this item
        $item_sections = $item->getSections();
        foreach ($item_sections as $thissect) {
            if ($thissect->name == $sectionname) {
                $a_section = Sections::FindById($thissect->id);
                $thisarea = $a_section->thePortfolioArea();
                $next_item = $item->findNext($a_section, "");
                $prev_item = $item->findPrev($a_section, "");
                break;
            }
        }
    }
    $user = Users::GetCurrentUser();
    // If a gallery gets detached or this item doesn't have one, don't create an error.
    $gallery = $item->getGallery();
    if (is_object($gallery)) {
        $photos = $gallery->get_photos();
        $photocount = count($photos) == 0 ? "None" : count($photos);
        // Sometimes the following statement throws errors. Check it out if this page behaves funny.
        if (ITEM_VIDEOS) {
            $gallery_items = $gallery->get_photos_and_videos();
            $photocount = count($gallery_items) == 0 ? "None" : count($gallery_items);
            $itemvideos = $item->findVideos($gallery, 'display_order DESC');
            $vidcount = count($itemvideos) == 0 ? "None" : count($itemvideos);
        }
    } else {
        $gallery = false;
        $photos = $itemvideos = $gallery_items = null;
        $photocount = 0;
        $vidcount = "None";
    }
    if (ITEM_DOCUMENTS) {
        $itemdocuments = $item->findDocuments('display_order DESC');
        $doccount = count($itemdocuments) == 0 ? "None" : count($itemdocuments);
    }
    ?>

	<script type="text/javascript">
	//<![CDATA[
		$().ready(function() {
			
			$("#edit_item").validate({
				errorLabelContainer: "#error_container",
				rules: {
						display_name: "required",
						"selected_sections[]": "required",
					},
				messages: {
						display_name: "Please enter a name that should be displayed for this item",
						"selected_sections[]": "Almost forgot! Select at least one section to include this item in", 
					}
			});
			
			$("#photo_list_order").sortable({
				stop: function() {
					$("#photo_list_order li input.displayorder").each(function(i) {
						$(this).val(i+1);
					});
				}
			});
			
			$("#document_list").sortable({
				stop: function() {
					$("#document_list li input[type=hidden]").each(function(i) {
						$(this).val(i+1);
					});
				}
			});
		});
	//]]>
	</script>

	<div id="edit-header" class="itemnav threecolumnnav">
		<div class="nav-left column">
			<h1>Edit Item<?php 
    if ($sectionname != "orphan_section") {
        ?>
 : <a href="<?php 
        $item->the_url($thisarea, $a_section);
        ?>
" title="View &ldquo;<?php 
        $item->the_title();
        ?>
&rdquo;">View Item</a><?php 
    }
    ?>
</h1>
		</div>
		<div class="nav-center column">
			<?php 
    if ($prev_item != "") {
        ?>
<a href="<?php 
        echo get_link("/admin/portfolio_edit/" . $a_section->name . "/" . $prev_item->id);
        ?>
" title="<?php 
        $prev_item->the_title();
        ?>
">&larr; Previous Item</a><?php 
    }
    ?>
		</div>
		<div class="nav-right column">
			<?php 
    if ($next_item != "") {
        ?>
<a href="<?php 
        echo get_link("/admin/portfolio_edit/" . $a_section->name . "/" . $next_item->id);
        ?>
" title="<?php 
        $next_item->the_title();
        ?>
">Next Item &rarr;</a><?php 
    }
    ?>
			
		</div>
		<div class="clearleft"></div>
	</div>


<?php 
    // NEW! Debug messages.
    if (HCd_debug()) {
        echo '<div class="debug-block">';
        if (!$gallery) {
            echo '<span class="debug-feedback failed">$gallery is false! Was never created or got detached...</span>';
        }
        // Check the folder path to see if it exists
        if (is_dir(SERVER_DOCUMENTS_ROOT)) {
            echo '<span class="debug-feedback passed">&ldquo;' . SERVER_DOCUMENTS_ROOT . '&rdquo; is a writeable folder</span>';
            echo '<span class="debug-feedback passed">The folder permission is <strong>' . substr(sprintf('%o', fileperms(SERVER_DOCUMENTS_ROOT)), -4) . '</strong></span>';
            if (is_dir(SERVER_DOCUMENTS_ROOT . "gallery_photos")) {
                echo '<span class="debug-feedback passed">&ldquo;' . SERVER_DOCUMENTS_ROOT . 'gallery_photos&rdquo; is a writeable folder</span>';
                echo '<span class="debug-feedback passed">The folder permission is <strong>' . substr(sprintf('%o', fileperms(SERVER_DOCUMENTS_ROOT . "gallery_photos")), -4) . '</strong></span>';
            } else {
                echo '<span class="debug-feedback failed">&ldquo;' . SERVER_DOCUMENTS_ROOT . 'gallery_photos&rdquo; is NOT a writeable folder</span>';
            }
        } else {
            echo '<span class="debug-feedback failed">&ldquo;' . SERVER_DOCUMENTS_ROOT . '&rdquo; is NOT a writeable folder</span>';
        }
        echo '</div>';
    }
    ?>


	<form method="POST" id="edit_item" enctype="multipart/form-data">
		
		<p><span class="hint">If a text box is underlined in red, it is a required field</span></p>
		
		<p class="display_name">
			<label for="display_name">Display Name:</label>
			<?php 
    textField("display_name", $item->display_name, "required: true");
    ?>
		</p>
		
<?php 
    if (PORTFOLIOTHUMB_IMAGE) {
        ?>
		<div id="thumbnail" class="column half">
			
			<p><label for="thumbnail">Thumbnail:</label></p>
			<p>
				<img src="<?php 
        echo get_link("portfolio/thumbnail/{$item->id}");
        ?>
" />
			    &nbsp;Select a new image to use as a thumbnail:<br />
			    &nbsp;<input type="file" name="thumbnail" id="id_thumbnail" value="" class="" />
			</p>
		</div>
		<div class="column half last">
<?php 
    } else {
        ?>
	
		<div>
<?php 
    }
    ?>
		
<?php 
    if (ITEM_SKU) {
        ?>
			<p>
				<label for="item_sku">Item Sku (unique ID):</label>
				<?php 
        textField("item_sku", $item->sku);
        ?>
			</p>

<?php 
    }
    if (ITEM_PRICE) {
        ?>
			<p>
				<label for="item_price">Item Price:</label>
				<?php 
        textField("item_price", $item->price);
        ?>
			</p>

<?php 
    }
    if (ITEM_TAXONOMY) {
        require_once snippetPath("item-taxonomy");
    }
    ?>
			
			<p><label for="public">Public:</label><?php 
    checkBoxField("public", $item->public);
    ?>
&nbsp; <span class="hint">Visible or not visible to the public? If you are working on an item that is not yet ready, leave this off until it is complete.</span></p>
	
		</div>
		<div class="clearleft"></div>

		<p>
			<label for="item_content">Item Description:</label><br />
			<?php 
    textArea("item_content", $item->content, 98, EDIT_WINDOW_HEIGHT);
    ?>
		</p>
		
		
<?php 
    require_once snippetPath("admin-insert_configs");
    ?>
						
						
<!-- Start the Show/Hide for editing photos and changing order -->
		<div id="gallery-options">
			
			<a name="editgal"></a>
			<ul id="gallery-options-nav" class="menu tabs">
				<li><a href="#section_selector" class="openclose">Edit Sections this Item is in</a></li>
				<li><a href="#gallery_sort" class="openclose opened">Change Media Order <span>(<?php 
    echo $photocount;
    ?>
)</span></a></li>
				<li><a href="#add_edit_images" class="openclose">Add / Edit Photos and Captions</a></li>
				<?php 
    if (ITEM_VIDEOS) {
        ?>
				<li><a href="#add_videos" class="openclose">Add / Edit Videos <span>(<?php 
        echo $vidcount;
        ?>
)</span></a></li>
				<?php 
    }
    if (ITEM_DOCUMENTS) {
        ?>
				<li><a href="#add_edit_documents" class="openclose">Add / Edit Documents <span>(<?php 
        echo $doccount;
        ?>
)</span></a></li>
				<?php 
    }
    ?>
				
			</ul>
			
			
			<!-- Select a Section -->
			<div id="section_selector" class="dropslide" style="display:none;">
				<h2><legend>Select a Section to include this Item in:</legend></h2>
				<fieldset>
	<?php 
    foreach ($portareas as $area) {
        echo "<p><strong>" . $area->get_title() . ":</strong><br />";
        $sections = $area->getSections(true);
        foreach ($sections as $section) {
            $checked = $labelchecked = "";
            if (isset($item_sections)) {
                foreach ($item_sections as $item_section) {
                    if ($item_section->id == $section->id) {
                        $checked = "checked='checked'";
                        $labelchecked = " class='selected'";
                    }
                }
            }
            echo "\t\t\t\t\t<label for='selected_sections[]'{$labelchecked}>{$section->display_name}&nbsp;<input id=\"selected_areas[]\" name='selected_sections[]' class='boxes' {$checked} type='checkbox' value='{$section->id}' /></label>\n";
        }
        echo "</p>\n";
    }
    ?>
									
					<p><span class="hint">Any item can be in more than one Section. If no sections are selected, this item will not be viewable by the public and it will appear under &ldquo;Orphaned Items&rdquo;.</span></p>
				</fieldset>
				<div class="clearleft"></div>
			</div><!-- #section_selector -->
			
			
			<!-- Sort gallery order of the items. Could be mixed images AND videos. -->
			<div id="gallery_sort" class="dropslide">
				<h2>Click and Drag the image to change the order of the display in the Gallery <!--<small>(ID= <?php 
    echo $gallery->id;
    ?>
)</small>--></h2>
				<div id="sortable_container">
<?php 
    if (ITEM_VIDEOS && !is_null($gallery_items)) {
        // There could be videos AND photos in this gallery
        if (count($gallery_items) > 0) {
            echo "\t\t\t\t<ol id=\"photo_list_order\">\n";
            foreach ($gallery_items as $galitem) {
                if ($galitem->type == 'photo') {
                    // Treat as a photo
                    echo "\t\t\t\t\t<li><img class=\"changeorderThumb\" src=\"{$galitem->getPublicUrl()}\" />\n        \t\t\t\t\t\t<input type=\"hidden\" name=\"galitem_display_order[" . $galitem->id . "]\" class=\"displayorder\" value=\"" . $galitem->display_order . "\" />\n        \t\t\t\t\t\t<input type=\"hidden\" name=\"galitem_type[" . $galitem->id . "]\" value=\"" . $galitem->type . "\" /></li>\n";
                } else {
                    // Treat as a video
                    echo "\t\t\t\t\t<li><div class=\"changeorderThumb videoThumb\">Video: " . $galitem->get_title() . "</div>\n        \t\t\t\t\t\t<input type=\"hidden\" name=\"galitem_display_order[" . $galitem->id . "]\" class=\"displayorder\" value=\"" . $galitem->display_order . "\" />\n        \t\t\t\t\t\t<input type=\"hidden\" name=\"galitem_type[" . $galitem->id . "]\" value=\"" . $galitem->type . "\" /></li>\n";
                }
            }
            echo "\t\t\t\t</ol>\n";
        } else {
            echo "<h3 class=\"empty-list\">There are no photos or videos to put in order. Go ahead and add some.</h3>\n";
        }
    } elseif (is_object($gallery)) {
        if (count($photos) > 0) {
            echo "\t\t\t\t<ol id=\"photo_list_order\">\n";
            foreach ($photos as $photo) {
                echo "\t\t\t\t\t<li><img class=\"changeorderThumb\" src=\"{$photo->getPublicUrl()}\" />\n    \t\t\t\t\t\t<input type=\"hidden\" name=\"photos_display_order[" . $photo->id . "]\" class=\"displayorder\" value=\"" . $photo->display_order . "\" /></li>\n";
            }
            echo "\t\t\t\t</ol>\n";
        } else {
            echo "<h3 class=\"empty-list\">There are no photos to put in order. Go ahead and add some.</h3>\n";
        }
    } else {
        echo "<h3 class=\"empty-list\">Whoops, there is no Gallery! Save this item to create a new one.</h3>\n";
    }
    ?>
								
				</div>
				<div class="clearleft"></div>
			</div><!-- #gallery_sort -->
			
			
			<!-- Upload a new image or edit captions / delete images -->
			<div id="add_edit_images" class="dropslide" style="display:none;">
				<div id="add_image_wrap">
					<h2>Add an Additional Image</h2>
					<p><span class="hint">Images for your site would be best displayed at <?php 
    echo MAX_PORTFOLIO_IMAGE_WIDTH;
    ?>
 pixels wide. If an image is larger, the system will attempt to resize it. Images that are too large might require more memory than the system can handle, and an error may result.</span></p>
					<p><label for="new_photo">Add an additional image:</label>
						<input type="file" name="new_photo" id="new_photo" value="" />
					</p>
					<p><label for="new_photo_caption">Caption for new image:</label>
						<?php 
    textField("new_photo_caption", "", "");
    ?>
					</p>
					<p><input type="submit" class="submitbutton" name="submit" value="Add Image" /></p>
				</div>
				<p>&nbsp;</p>
				<h2>Edit Existing Photos (delete photos or edit captions. Click Save when done)</label></h2>
				<p><span class="hint"><b>Image size:</b> The CSS control for the images designates that they display here (for ease of use) at 50% their actual size. Dont&rsquo;t worry if they appear smaller than on the front-end.<!--[if IE 6]><br /><b>IE 6 Users: The CSS can only force the image to be 240 pixels wide, which for some images, may be larger than normal, resulting in pixellation. </b><![endif]--></span></p>
				<ul id="add_photo_list">                                                                                                                                                    
<?php 
    if (is_object($gallery)) {
        if (count($photos) > 0) {
            foreach ($photos as $photo) {
                echo "\t\t\t\t<li><img src=\"{$photo->getPublicUrl()}\" />\n";
                echo "\t\t\t\t\t<div><input type=\"checkbox\" name=\"deleted_photos[]\" value=\"{$photo->id}\"/>&nbsp;DELETE</div>";
                textField("captions[{$photo->id}]", "{$photo->caption}", "");
                echo "\n\t\t\t\t</li>\n";
            }
        } else {
            echo "\t\t\t\t<h3 class=\"empty-list\">There are no photos to edit. Go ahead and add some.</h3>\n";
        }
    }
    ?>
    				
				</ul>
				<p class="clear:left;"><a href="#top">Back to the Top of the Page</a></p>
			</div>
		</div><!-- #add_edit_images -->
		
		
		<!-- Item Videos -->
		<?php 
    if (ITEM_VIDEOS) {
        ?>
		<div id="add_videos" class="dropslide" style="display:none;">
			<div id="add_video_wrap">
			    <h2>Add a new Video</h2>
			    <p><span class="hint">Video can be &ldquo;attached&rdquo; to an item. They will still be available to pages via the &ldquo;Insert Videos&rdquo; drop down menu. Once uploaded here, they must be further edited or deleted in the <a href="<?php 
        echo get_link("admin/list_videos");
        ?>
">Videos section</a>. </span></p>
			    
			    <!-- Add a new video -->
			    <p>
        			<label for="newvideo">Video Title:</label>
        			<?php 
        textField("newvideo", '');
        ?>
<br />
        		</p>
        		
        		<div class="column half">
            		<div class="column half">
                		<p>
                		    <label for="vidwidth">Width:</label>
                		    <?php 
        textField("vidwidth", '');
        ?>
                		</p>
            		</div>
            		<div class="column half last">
                		<p>
                		    <label for="vidheight">Height:</label>
                		    <?php 
        textField("vidheight", '');
        ?>
                		</p>
            		</div>
            		<div class="clearit"></div>
            		
            		<p><label for="vidservice">Hosting Service:</label>
            			<select id="vidservice" name="vidservice">
            				<option value="youtube">YouTube</option>
            				<option value="vimeo">Vimeo</option>
            			</select><br />
            		</p>
        		</div>
        		<div class="column half last">
            		<p>
            			<label for="vidembed">Unique ID:</label>
            			<?php 
        textField("vidembed", '');
        ?>
<br />
            			<span class="hint">The unique identifier is a random string of numbers and letters associated with the file. <br />
            			YouTube example: http://www.youtube.com/embed/<mark>tVUCsnMK18E</mark> <br />
            			Vimeo example: http://player.vimeo.com/video/<mark>72632269</mark> <br />
            			In both cases, we are only interested in the text highlighted.</span>
            		</p>
        		</div>
        		<div class="clearit"></div>
        		<p><input type="submit" class="submitbutton" name="submit" value="Add or Edit Video" /></p>
            </div>
			<p>&nbsp;</p>
            
            <!-- Edit Videos that are already attached -->
			<h2>Edit Attached Videos</h2>
			<p class="hint">Edit titles or embed codes and click Save Videos. Reorder by dragging and dropping the thumbnails in the gallery. Click Save when done. To delete or do more serious editing, please visit <a href="<?php 
        echo get_link("admin/list_videos");
        ?>
">the Video&rsquo;s edit page</a> instead. </p>
			
			<ol id="video_list" class="managelist"> 
        		<?php 
        foreach ($itemvideos as $thevid) {
            echo '<li><span class="item-link">';
            textField("vidnames[{$thevid->id}]", $thevid->get_title(), "");
            echo '</span>
    				<span class="item-public">';
            textField("vidcodes[{$thevid->id}]", $thevid->embed, "");
            echo '</span>
    				<span class="item-revised"><label for="removevideo"><input name="removevideo" class="boxes" type="checkbox" value="' . $thevid->id . '"> Remove Video?</label></span>
    				<span class="item-created"><a href="' . get_link("admin/edit_video/" . $thevid->id) . '">Edit Video</a></span>
				</li>';
        }
        ?>
    		
    		</ol>
        </div>
		<?php 
    }
    // end if ITEM_VIDEOS
    ?>
		
		
		<?php 
    if (ITEM_DOCUMENTS) {
        ?>
		<div id="add_edit_documents" class="dropslide" style="display:none;">
			<div id="add_document_wrap">
				<h2>Add, Delete or Reorder Documents</h2>
				<p><span class="hint">Documents can be &ldquo;attached&rdquo; to an item. They will still be available to pages via the &ldquo;Insert Document&rdquo; drop down menu. </span></p>
				<p><label for="new_document">Add a document:</label>
					<input type="file" name="new_document" id="new_document" value="" />
				</p>
				<p><label for="new_document_title">Title for document (Optional. If empty, one will be created from the name of the document):</label>
					<?php 
        textField("new_document_title", "", "");
        ?>
				
				</p>
				<p><input type="submit" class="submitbutton" name="submit" value="Add Document" /></p>
			</div>
			<p>&nbsp;</p>

			<h2>Edit Attached Documents</h2>
			<p class="hint">Delete documents or edit titles. Reorder by dragging and dropping. Click Save when done. NOTE: The filename may or may not be used in your template when this item is displayed. <strong>Filenames should not contain a period unless it precedes the filetype extension</strong>. </p>
			
			<div id="sortable_container">
				<ol id="document_list" class="managelist">                                                                                                                                                    
<?php 
        if ($doccount > 0) {
            foreach ($itemdocuments as $doc) {
                echo "\t\t\t\t\t<li>\n";
                hiddenField("document_display_order[{$doc->id}]", $doc->display_order);
                echo "\n\t\t\t\t\t\t<span class=\"item-link\">";
                textField("docname[{$doc->id}]", $doc->name, "");
                echo "</span>\n\t\t\t\t\t\t\t<span class=\"item-public\">File type: {$doc->file_type}</span>\n\t\t\t\t\t\t\t<span class=\"item-revised\"><a href=\"" . $doc->getPublicUrl() . "\" title=\"" . $doc->get_title() . "\">View Document</a></span>\n\t\t\t\t\t\t\t<span class=\"item-created\"><input type=\"checkbox\" name=\"deleted_documents[]\" value=\"{$doc->id}\"/>&nbsp;DELETE</span>\n\t\t\t\t\t\t</li>\n";
            }
        } else {
            echo "\t\t\t\t\t<h3 class=\"empty-list\">There are no documents to edit.</h3>\n";
        }
        ?>
							
				</ol>
			</div>	
			<p class="clear:left;"><a href="#top">Back to the Top of the Page</a></p>
		</div><!-- #add_edit_documents -->
		<?php 
    }
    // end if ITEM_DOCUMENTS
    ?>

		<div id="edit-footer" class="itemnav clearfix">
			<div id="error_container"></div>
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Item" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
				
			<?php 
    if ($user->has_role()) {
        ?>
				
				<p><label for="delete">Delete this item? <input name="delete" id="delete" class="boxes" type="checkbox" value="<?php 
        echo $item->id;
        ?>
" /></label>
				<span class="hint">Check this box and then click &ldquo;Save&rdquo; to delete from the database</span></p>
			<?php 
    }
    ?>
			
			</div>
		</div>
		
	</form>
<?php 
}
Ejemplo n.º 29
0
function display_page_content()
{
    if (requestIdParam() == "add") {
        $chunk = $chunkslug = $chunkdescription = $chunkcontent = null;
        $chunkhtml = 0;
    } else {
        $chunk_id = requestIdParam();
        $chunk = Chunks::FindById($chunk_id);
        $chunkslug = $chunk->slug;
        $chunkdescription = $chunk->description;
        $chunkhtml = $chunk->full_html;
        $chunkcontent = $chunk->content;
    }
    $user = Users::GetCurrentUser();
    ?>

	<script type="text/javascript">
		$().ready(function() {
			$("#edit_chunk").validate({
				rules : {
					slug: "required", 
					content: "required"
				},
				messages: {
					slug: "Please enter a title for this video", 
					content: "Please enter some content for this chunk"
				}
			});
			<?php 
    if ($chunkhtml) {
        echo 'loadTinyMce("chunk_content");';
    }
    ?>
			
		});
	</script>
	
	<div id="edit-header" class="chunknav">
		<h1>Edit Chunk</h1>
	</div>
	
	<form method="POST" id="edit_chunk">
		<div class="column half">
    		
<?php 
    if ($user->email == '*****@*****.**') {
        ?>
    		
    		<p class="display_name">
    			<label for="slug">Chunk Slug:</label>
    			<?php 
        textField("slug", $chunkslug, "required: true");
        ?>
    		</p>
    		
    		<p>
    			<label for="full_html">Full Html?:</label>&nbsp; <?php 
        checkBoxField("full_html", $chunkhtml);
        ?>
 <br>
    			<span class="hint">Do we need to allow full HTML capabilities on the content field? Checked for &ldquo;Yes&rdquo;, not checked for &ldquo;No&rdquo;.</span>
    		</p>
    		
    		<p>
    			<label for="description">Chunk Description:</label>
    			<?php 
        textField("description", $chunkdescription);
        ?>
    		</p>

<?php 
    } else {
        ?>

            <h2><?php 
        echo $chunkslug;
        ?>
</h2>
    		
    		<p><strong><?php 
        echo $chunkdescription;
        ?>
</strong></p>

<?php 
    }
    ?>

    		<div class="clearit"></div>
		</div>
		<div class="column half last">
    		
    		<p>
    			<label for="chunk_content">Content:</label>
    			<?php 
    textArea("chunk_content", $chunkcontent, 98, 18);
    ?>
    		</p>
    		
		</div>
		<div class="clearleft"></div>
		
		
		<div id="edit-footer" class="chunknav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Chunk" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
<?php 
    if ($user->email == '*****@*****.**') {
        ?>
	
				<p><label for="delete">Delete this chunk?</label>
					<input name="delete" class="boxes" type="checkbox" value="<?php 
        echo $chunk->id;
        ?>
" />
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this chunk from the database</span>
				</p>
<?php 
    }
    ?>
			</div>
		</div>
	
	</form>
<?php 
}
Ejemplo n.º 30
0
function display_page_content()
{
    $event_types = EventTypes::FindAll();
    $event_periods = EventPeriods::FindAll();
    $days = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
    ?>

<script type="text/javascript">
	//<![CDATA[	
	$().ready(function() {
		setupDateFields("1");
		
		$.datepicker.setDefaults({
            showButtonPanel: true,
			showOtherMonths: true,
			selectOtherMonths: true
        });
        
        $( "#date_start" ).datepicker();
		$( "#time_start" ).timepicker({timeFormat: 'hh:mm:ss tt',stepMinute: 5});
		$( "#date_end" ).datepicker();
		$( "#time_end" ).timepicker({timeFormat: 'hh:mm:ss tt',stepMinute: 5});
		$( "#not_date" ).datepicker();
		
		$("a#notdate_add").click(function() {
			var date = $("input[name='not_date']").val();
			if (date != "") {
				$("input[name='not_date']").val('');
				var all_dates_vis = $("span#notdates").html();
				$("span#notdates").html("<label for=\"notdates[]\">"+date+"&nbsp;<a href=\"javascript:;\" onClick=\"$(this).parent().remove();\">X</a><input type=\"hidden\" name=\"notdates[]\" value=\""+date+"\" /></label>"+all_dates_vis);
			}
		});
		
		$("#eventperiod_id").change(function() {
			var selected = $(this).val();
			setupDateFields(selected);
		});
		
		$("#add_event").validate({
			rules: {
					title: "required",
					date_start: "required",
				},
			messages: {
					title: "Please enter a title for this event",
					date_start: "Please enter at least a start date for this event",
				}
		});	
	});
	//]]>
</script>

<div id="edit-header" class="event">
	<h1>Add Event</h1>
</div>

<div id="calendar_div"></div>

<form method="POST" id="add_event">
	
	<input type="hidden" name="calendar_id" value="1" />
	
	<p class="display_name">
        <label for="title">Title</label>
    	<?php 
    textField('title', '', 'required: true');
    ?>
	</p>
	
	<?php 
    if (ALLOW_EVENT_TYPES && count($event_types) > 1) {
        ?>
	<p>
	    <label for="eventtype_id">Event Type</label>
		<select name="eventtype_id" id="eventtype_id">
		<?php 
        foreach ($event_types as $event_type) {
            echo "<option value=\"{$event_type->id}\">{$event_type->name}</option>\r\n";
        }
        ?>
			
		</select>
	</p>
	<?php 
    }
    ?>
	
	<div id="eventdateselects" class="dropslide">
		<p><label for="eventperiod_id">Event Period:</label>
    		<select name="eventperiod_id" id="eventperiod_id">
			<?php 
    foreach ($event_periods as $event_period) {
        echo "<option value=\"{$event_period->id}\">{$event_period->name}</option>\r\n";
    }
    ?>
    		</select>
		</p>
		
		<p>
		    <label for="date_start">Start Date / Time</label>
    		<input type="text" name="date_start" id="date_start" style="width: 6.5em;" value="" class="required: true" />&nbsp;
    		<input type="text" name="time_start" id="time_start" style="width: 6.5em;" value="" />&nbsp;&nbsp; 
    		
    		<label for="date_start">End Date / Time</label>
    		<input type="text" name="date_end" id="date_end" style="width: 6.5em;" value="" />&nbsp;
    		<input type="text" name="time_end" id="time_end" style="width: 6.5em;" value="" />
		</p>
		
		<div id="recurrence_rules" style="display:none;">
			<p><label for="date_start">Exclusion Date(s)</label>
				<input type="text" name="not_date" id="not_date" style="width: 6.5em;"/>&nbsp;<a href="javascript:;" id="notdate_add">Add to list&rarr;</a> 
				<span id="notdates"></span>
			</p>
			
			<label>Recurrence Rules</label>
			<table>
				<tbody>
					<tr>
						<th>&nbsp;</th>
						<th>Sunday</th>
						<th>Monday</th>
						<th>Tuesday</th>
						<th>Wednesday</th>
						<th>Thursday</th>
						<th>Friday</th>
						<th>Saturday</th>
					</tr>
					<tr>
						<td>Every</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag(null, $day, 0);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>First</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag(null, $day, 1);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>Second</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag(null, $day, 2);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>Third</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag(null, $day, 3);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>Fourth</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag(null, $day, 4);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>Last</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag(null, $day, 5);
        echo "</td>";
    }
    ?>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
	
	<p><label for="name">Event Description</label><br />
	<?php 
    textArea("description", "", 98, EDIT_WINDOW_HEIGHT);
    ?>
	</p>
	
	<?php 
    require_once snippetPath("admin-insert_configs");
    ?>
	
	<div id="edit-footer" class="eventtypenav clearfix">
		<div class="column half">
			<p>
				<input type="submit" class="submitbutton" name="submit" value="Add Event and add another" /> <br />
				<input type="submit" class="submitbuttonsmall" name="submit" value="Add and Return to List" />
			</p>
		</div>
		<div class="column half last"></div>
	</div>
	
</form>
<?php 
}