Example #1
0
function display_page_content()
{
    $array_name = requestIdParam();
    $value = getRequestVarAtIndex(3);
    $_SESSION['blaster'][$array_name] = $value;
    print_r($_SESSION['blaster']);
}
Example #2
0
function display_page_content()
{
    $section_name = requestIdParam();
    $section = Sections::FindByName($section_name);
    $item_name = getRequestVarAtIndex(3);
    $item = Items::FindByName($item_name);
    $gallery = $item->getGallery();
    ?>

		<h1><?php 
    echo $item->display_name;
    ?>
</h1>
<?php 
    $next_item = $item->findNext($section);
    $prev_item = $item->findPrev($section);
    if ($prev_item) {
        echo "\t\t\t\t<a href=\"" . get_link("portfolio/item/{$section_name}/" . $prev_item->name) . "\">previous</a>\n";
    }
    if ($next_item) {
        echo "\t\t\t\t<a href=\"" . get_link("portfolio/item/{$section_name}/" . $next_item->name) . "\">next</a>\n";
    }
    echo $item->content;
    foreach ($gallery->get_photos() as $photo) {
        echo "<img src=\"/" . $photo->getPublicUrl() . "\" /><br />";
    }
}
Example #3
0
function display_page_content()
{
    $section_name = requestIdParam();
    $section = Sections::FindByName($section_name);
    $items = $section->findItems();
    ?>
		
		<div id="right">
			<h3>Item Thumbnail</h3>
		</div>
		<div id="center">
			<h3>All the <?php 
    echo $section->display_name;
    ?>
</h3>
			<?php 
    echo $section->content;
    ?>
		<?php 
    echo "<ul>\r\n";
    foreach ($items as $item) {
        echo "\t\t\t<li><a href=\"" . get_link("portfolio/item/{$section_name}/" . $item->name) . "\">{$item->display_name}</a></li>\r\n";
    }
    echo "\t\t</ul>\r\n";
    ?>
		</div>
		<?php 
}
Example #4
0
function display_page_content()
{
    $the_email = requestIdParam();
    $the_list = getRequestVarAtIndex(3);
    $list = NLLists::FindById($the_list);
    $email = NLEmails::FindByEmail($the_email);
    $email->detach($list);
}
Example #5
0
function display_page_content()
{
    $gallery_slug = requestIdParam();
    $gallery = Galleries::FindBySlug($gallery_slug);
    foreach ($gallery->get_photos() as $photo) {
        echo "<a href='{$photo->getPublicUrl()}' title='{$photo->caption}'>Photo</a>";
    }
}
Example #6
0
function display_page_content()
{
    if (!requestIdParam()) {
        $documents = Documents::FindAll("DESC");
    } else {
        $documents = Documents::FindByFiletype(requestIdParam());
    }
    ?>
	
	<div id="edit-header" class="documentnav">
		<div class="nav-left column">
    		<h1>Choose a Document to Edit</h1>
		</div>
		<div class="nav-right column">
            <a href="<?php 
    echo get_link("admin/add_document");
    ?>
" class="hcd_button">Add a New Document</a>
		</div>
		<div class="clearleft"></div>
	</div>
	
	<p class="announce">Documents are defined as downloadable files or forms. PDFs, DOCs, and the like are acceptable. You may use this feature to make high resolution images downloadable as well. If the image is too large to upload, and you get an error, you may want to compress the image with StuffIt (.sit), WinZip (.zip), or ZipIt (.zip).</p>
	
<?php 
    if (count($documents) > 0) {
        ?>
			
	<div id="table-header" class="documents">
		<strong class="item-link">Document Name</strong>
		<span class="item-filename">Filename</span>
		<span class="item-viewlink">View file in new window</span>
	</div>
	
		<?php 
        //$filetypes = Documents::FindUniqueFiletypes();
        if (isset($filetypes) && count($filetypes) > 1) {
            echo "<ul class=\"menu tabs\">\n\t\t<li>Show Only: </li>\n";
            foreach ($filetypes as $type) {
                echo "\t\t<li><a href=\"" . get_link("admin/list_documents/" . $type->file_type) . "\">{$type->file_type}</a></li>\n";
            }
            echo "\t\t<li><a class=\"hcd_button\" href=\"" . get_link("admin/list_documents/") . "\">Show All</a></li>\n\t</ul>\n ";
        }
        ?>
	
	<ul id="listitems" class="managelist">
		<?php 
        foreach ($documents as $document) {
            echo "\t\t<li>\n\t\t\t<span class=\"item-link\"><a href=\"" . get_link("/admin/edit_document/{$document->id}") . "\">{$document->name} <small>EDIT</small></a></span>\n\t\t\t<span class=\"item-filename\">{$document->filename}</span>\n\t\t\t<span class=\"item-viewlink\"><a href=\"" . $document->getPublicUrl() . "\" target=\"_blank\">View file</a></span>\n\t\t</li>\n";
        }
        ?>
	
	</ul>
<?php 
    } else {
        echo "\t\t<h3 class=\"empty-list\">There are no documents to edit. <a class=\"short\" href=\"" . get_link("admin/add_document") . "\">Add one if you like</a>.</h3>";
    }
}
Example #7
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 
}
Example #8
0
function display_page_content()
{
    $array_name = requestIdParam();
    if (strstr(getRequestVarAtIndex(3), ",")) {
        $value = array_slice(explode(",", getRequestVarAtIndex(3)), 0, -1);
    } else {
        $value = getRequestVarAtIndex(3);
    }
    $_SESSION['blaster'][$array_name] = $value;
    //print_r($_SESSION['blaster']);
}
Example #9
0
function display_page_content()
{
    $hash = requestIdParam();
    $email = getRequestVarAtIndex(3);
    $query = "SELECT * FROM mailblast WHERE hash = '{$hash}';";
    if ($result = mysql_query($query, MyActiveRecord::Connection())) {
        echo str_replace("{{-email-}}", $email, mysql_result($result, 0, 'content'));
    } else {
        redirect("/");
    }
}
Example #10
0
function display_page_content()
{
    $item_id = requestIdParam();
    $query = "SELECT thumbnail FROM items \n\t            WHERE id = {$item_id}";
    $result = mysql_Query($query, MyActiveRecord::Connection());
    $data = @mysql_fetch_array($result);
    if (!empty($data["thumbnail"])) {
        // Output the MIME header
        header("Content-Type: image/jpeg");
        // Output the image
        echo $data["thumbnail"];
    }
}
Example #11
0
function display_page_content()
{
    $imageId = requestIdParam();
    $query = "SELECT * FROM images WHERE id = {$imageId}";
    $result = mysql_Query($query, MyActiveRecord::Connection());
    $data = @mysql_fetch_array($result);
    if (!empty($data["thumbnail"])) {
        // Output the MIME header
        header("Content-Type: {$data['mime_type']}");
        set_image_cache_headers("imgthumb_" . $imageId);
        // Output the image
        echo $data["thumbnail"];
    }
}
Example #12
0
function display_page_content()
{
    $photo_id = requestIdParam();
    $photo = Photos::FindById($photo_id);
    $next_photo = $photo->get_next_photo();
    $prev_photo = $photo->get_previous_photo();
    if ($prev_photo->id != $photo->id) {
        echo "<a href='" . get_link("/galleries/photo/{$prev_photo->id}") . "'>Previous</a>";
    }
    echo "<img src='{$photo->getPublicUrl()}' />";
    if ($next_photo->id != $photo->id) {
        echo "<a href='" . get_link("/galleries/photo/{$next_photo->id}") . "'>Next</a>";
    }
}
Example #13
0
function display_page_content()
{
    $connection = MyActiveRecord::Connection();
    $imageId = mysql_real_escape_string(requestIdParam());
    // TODO: use a parameterized query instead of an escaped string
    $query = "SELECT * FROM images WHERE id = {$imageId}";
    $result = mysql_Query($query, $connection);
    $data = @mysql_fetch_array($result);
    if (!empty($data["original"])) {
        // Output the MIME header
        header("Content-Type: {$data['mime_type']}");
        set_image_cache_headers("img_" . $imageId);
        // Output the image
        echo $data["original"];
    }
}
Example #14
0
function display_page_content()
{
    $removed_id = requestIdParam();
    $ongoing_events = $_SESSION['blaster']['ongoing_events'];
    $new_array = array();
    foreach ($ongoing_events as $event) {
        if ($event != $removed_id) {
            $new_array[] = $event;
        }
    }
    if (count($new_array)) {
        $_SESSION['blaster']['ongoing_events'] = $new_array;
    } else {
        $_SESSION['blaster']['ongoing_events'] = "";
    }
    print_r($_SESSION['blaster']);
}
Example #15
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 
}
Example #16
0
function display_page_content()
{
    echo "<hr />\r\n";
    $upcoming_event_num = requestIdParam();
    if ($upcoming_event_num) {
        $upcoming = Events::FindUpcoming($upcoming_event_num);
        $upcoming_csv = "";
        ?>
		
			<p><span class="hint">Click the [<u>X</u>] to remove an event from list</span></p>
			<h2>Upcoming Events that will be included in this email:</h2>
			<table cellpadding="3" cellspacing="0" border="0">
				<tbody>

	<?php 
        foreach ($upcoming as $event) {
            echo "<tr>\n\t\t\t\t\t<td>[<a href=\"javascript;:\" class=\"remove_uevent\" title=\"{$event->id}\">X</a>]&nbsp;</td>\n\t\t\t\t\t<td>" . $event->getDateStart("date") . "&nbsp;</td>\n\t\t\t\t\t<td><b>{$event->title}</b>&nbsp;</td>\n\t\t\t\t</tr>";
            $upcoming_csv .= $event->id . ",";
        }
    }
    ?>
		
				</tbody>
			</table>
	<?php 
    $ongoing_event_num = getRequestVarAtIndex(3);
    if ($ongoing_event_num) {
        $ongoing = Events::FindOngoing($ongoing_event_num);
        $ongoing_csv = "";
        ?>
	
			<h2 style="padding-top: 1em;">Ongoing Events that will be included in this email:</h2>
			<table cellpadding="3" cellspacing="0" border="0">
				<tbody>
	<?php 
        foreach ($ongoing as $event) {
            echo "<tr>\n\t\t\t\t\t<td>[<a href=\"javascript;:\" class=\"remove_oevent\" title=\"{$event->id}\">X</a>]&nbsp;</td>\n\t\t\t\t\t<td>" . $event->getDateStart("date") . " &ndash; " . $event->getDateEnd("date") . "&nbsp;</td>\n\t\t\t\t\t<td><b>{$event->title}</b>&nbsp;</td>\n\t\t\t\t</tr>";
            $ongoing_csv .= $event->id . ",";
        }
    }
    ?>
				
				</tbody>
			</table>

		
	<script type="text/javascript">
		$().ready(function() {
			$('#session_add').load('<?php 
    echo BASEHREF;
    ?>
blaster/session_add/upcoming_events/<?php 
    echo $upcoming_csv;
    ?>
', function() {
				$('#session_add').load('<?php 
    echo BASEHREF;
    ?>
blaster/session_add/ongoing_events/<?php 
    echo $ongoing_csv;
    ?>
');
			});
			
			$("a.remove_uevent").click(function() {
				var event_id = $(this).attr('title');
				$("#session_add").load('<?php 
    echo BASEHREF;
    ?>
blaster/remove_uevent/'+event_id);
				$(this).parent().parent().css({ "background-color" : "#999"});
				return false;
			});
			
			
			$("a.remove_oevent").click(function() {
				var event_id = $(this).attr('title');
				$("#session_add").load('<?php 
    echo BASEHREF;
    ?>
blaster/remove_oevent/'+event_id);
				$(this).parent().parent().css({ "background-color" : "#999"});
				return false;
			});

		});
	</script>
<?php 
}
Example #17
0
function initialize_page()
{
    $image_id = requestIdParam();
    $image = Images::FindById($image_id);
    $post_action = isset($_POST['submit']) ? $_POST['submit'] : "";
    if ($post_action == "Save Image" || $post_action == "Save and Return to List") {
        $success = '';
        if (isset($_POST['delete'])) {
            $image->delete(true);
            setFlash("<h3>Image deleted</h3>");
            redirect("/admin/list_images");
        } else {
            $old_name = $image->name;
            $image->title = cleanupSpecialChars($_POST['title']);
            $image->description = cleanupSpecialChars($_POST['description']);
            if (ALLOW_SHORT_PAGE_NAMES) {
                $image->name = $_POST['name'] == "" ? slug($_POST['title']) : slug($_POST['name']);
            } else {
                $image->name = slug($_POST['title']);
            }
            //$image->save();
            $updateQuery = "UPDATE images SET title='{$image->title}', name='{$image->name}', description='{$image->description}' WHERE id='{$image->id}';";
            if (mysql_Query($updateQuery, MyActiveRecord::Connection())) {
                if ($old_name != $image->name) {
                    Pages::UpdateImageReferences($old_name, $image->name);
                }
                $success .= "Image changes saved / ";
            } else {
                die($updateQuery);
                setFlash("<h3>FAILURE &ndash; Please notify HCd of this error: " . mysql_error() . "</h3>");
            }
            // Replace an existing image with a new one
            if (is_uploaded_file($_FILES["new_image"]["tmp_name"])) {
                $mimeType = $_FILES["new_image"]["type"];
                $filetype = getFileExtension($_FILES["new_image"]["name"]);
                //list($width) = getimagesize($_FILES["new_image"]["tmp_name"]);
                $max_width = 0;
                $max_height = 0;
                if (defined("MAX_IMAGE_WIDTH")) {
                    $max_width = MAX_IMAGE_WIDTH;
                }
                if (defined("MAX_IMAGE_HEIGHT")) {
                    $max_height = MAX_IMAGE_HEIGHT;
                }
                resizeToMultipleMaxDimensions($_FILES["new_image"]["tmp_name"], $max_width, $max_height, $filetype);
                // Open the uploaded file
                $file = fopen($_FILES["new_image"]["tmp_name"], "r");
                // Read in the uploaded file
                $fileContents = fread($file, filesize($_FILES["new_image"]["tmp_name"]));
                // Escape special characters in the file
                $fileContents = AddSlashes($fileContents);
                $updateQuery2 = "UPDATE images SET original='{$fileContents}', mime_type='{$mimeType}' WHERE id='{$image->id}';";
                if (mysql_Query($updateQuery2, MyActiveRecord::Connection())) {
                    $success .= "Image replaced / ";
                } else {
                    setFlash("FAILURE &ndash; Please notify HCd of this error: " . mysql_error() . "</h3>");
                    //die( $updateQuery2 );
                }
            }
        }
        if ($post_action == "Save and Return to List") {
            redirect("/admin/list_images");
        }
        setFlash("<h3>" . substr($success, 0, -3) . "</h3>");
    }
}
Example #18
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 
}
Example #19
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 
}
Example #20
0
function display_page_content()
{
    $list = NLLists::FindById(requestIdParam());
    $emails = $list->findEmails();
    $subscribers = count($emails);
    ?>

	<script type="text/javascript">
		$().ready(function() {
			$("a.email_del").click(function() {
				var email = $(this).attr('title');
				var list = $(this).attr('name');
				var answer = confirm("Do you want to delete "+email+" from the list?");
				if (answer) {
					$("#loadme").load('<?php 
    echo BASEHREF;
    ?>
blaster/remove_email/'+email+'/'+list);
					$(this).parent().fadeOut();
					return false;
				} else {
					return false;
				}
			});
		});
	</script>
	
	<div id="loadme" style="display:none"></div>
	
	<div id="edit-header" class="maillistnav">
		<div class="nav-left column">
    		<h1>Edit a List: <?php 
    echo $list->display_name;
    ?>
</h1>
		</div>
		<div class="nav-right column">
            <a href="<?php 
    echo get_link("admin/list_lists");
    ?>
" class="hcd_button">Back to Mailing Lists</a> 
		</div>
		<div class="clearleft"></div>
	</div>
	
	<form method="POST" id="edit_maillist">
																
		<p><label for="description">Description of List (displayed, if the list is public, when a user manages their subscription preferences):</label><br />
		<?php 
    textArea("description", $list->description, 98, 10);
    ?>
		
		</p>
		
		<p>&nbsp;</p>
		
		<p><label for="emails">New Emails:</label>
    		<span class="hint">This field requires a single email OR a comma-delimited list of emails (i.e. &ldquo;blah@blah.org, blag@blag.net&rdquo; etc...)</span></p><p>
    		<textarea class="mceNoEditor" name="emails" id="emails" rows="8" style="width: 98%;"></textarea>
		
		</p>
		
		<p><label for="public">Public List:</label>
		<?php 
    checkBoxField("public", $list->public, "1");
    ?>
		
		</p>
		
		<p><input type="submit" class="submitbutton" name="submit" value="Edit List" /></p>
		
		<div id="edit-footer" class="maillistnav">
    		
    		<p><label for="subscribers">Current Subscribers (<?php 
    echo $subscribers;
    ?>
 subscribers):</label>
    		<span class="hint">Click the X to remove email from list.</span>
    		</p>
    		
    		<table width="100%" cellpadding="3" cellspacing="0" border="0">
    			<tbody>
    				<tr>
<?php 
    $count = 0;
    $tabs = "\t\t\t\t\t\t\t\t\t";
    foreach ($emails as $email) {
        echo $tabs . "\t<td><div>{$email->email}&nbsp;[<a class=\"email_del\" title=\"{$email->email}\" name=\"{$list->id}\" href=\"javascript:;\">X</a>]</div></td>\n";
        $count++;
        if ($count == 3) {
            echo $tabs . "</tr><tr>\n";
            $count = 0;
        }
    }
    ?>

    				</tr>
    			</tbody>
    		</table>
        </div>
        
	</form>
<?php 
}
Example #21
0
function display_page_content()
{
    $areas = Areas::FindAll();
    $alias_id = requestIdParam();
    $alias = Alias::FindById($alias_id);
    ?>

	<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) {
				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>Edit 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", $alias->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", $alias->path, "required: true");
    ?>
		</p>
			
		<div id="edit-footer" class="aliasnav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Alias" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
				<p><label for="delete">Delete this alias?</label>
					<input name="delete" class="boxes" type="checkbox" value="<?php 
    echo $alias->id;
    ?>
" />
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this alias from the database</span>
				</p>
			</div>
		</div>
		
	</form>
<?php 
}
Example #22
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 
}
Example #23
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 
}
Example #24
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 
}
Example #25
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 
}
Example #26
0
function display_page_content()
{
    $useremail = requestIDparam();
    if ($useremail == "deleted") {
        $useremail = "";
    }
    if (!$_POST) {
        $lists = NLLists::FindPublic();
        $list_count = count($lists);
        $welcome_message = 'Subscribe to our mailing list';
        if ($list_count > 1) {
            $welcome_message .= "s";
        }
        if (requestIdParam() == "deleted") {
            echo '<div class="feedback feedback__alert"><p class="">That email has been removed</p></div>';
        }
        ?>
		
		<div class="subscriber">
			<script type="text/javascript">
				//<![CDATA[										
					$().ready(function() {
						$("#lists_form").validate({
							rules: {
								email: { required: true, email: true },
								"list[]": "required"
							},
							messages: {
								email: "Please enter a valid email address",
								"list[]": "Almost forgot! Select at least one list to subscribe to." 
							}
						});
					});
				//]]>
			</script>
			
			<h1 class="subscriber--title"><?php 
        echo $welcome_message;
        ?>
</h1>
			
			<form class="form form__subscribe-new" method="POST">
				
				<span class="form--input-group"><label for="email">Your Email</label>
                <input type="email" id="email" name="email" class="form--input" maxlength="128" required="required" value="<?php 
        echo $useremail;
        ?>
"></span>
				
				<div class="subscriber--lists">
<?php 
        foreach ($lists as $list) {
            if ($list->public) {
                echo '<div class="subscriber--list-wrapper"><p class="subscriber--list"><label for="' . $list->name . '" class="check"><input type="checkbox" name="selected_list[]" id="' . $list->name . '" value="' . $list->id . '"> ' . $list->display_name . '</label></p>';
                echo '<div class="subscriber--list--description">' . $list->description . '</div></div>';
            }
        }
        ?>
                
                </div>
                <p><input type="submit" class="button primary-action" name="submit" value="Save Subscription Settings"></p>

			</form>
		</div>

<?php 
    } else {
        // There is a POST. Display a Success page
        $useremail = $_POST['email'];
        $nlemail = NLEmails::FindByEmail($useremail);
        $thislists = $nlemail->getNLlists();
        ?>
		
		<div class="subscriber subscriber--feedback">
			<h1 class="subscriber--title">Thanks!</h1>
			<h3 class="subscriber--subtitle"><?php 
        echo $useremail;
        ?>
 is now subscribed to:</h3>
<?php 
        foreach ($thislists as $list) {
            echo '<h4 class="successfully_subscribed">' . $list->display_name . '</h4>';
        }
        ?>

			<p>&nbsp;</p>
			<p>Go to the <a href="<?php 
        echo get_link("users/manage/" . $useremail);
        ?>
">Manage Subscriptions</a> page to manage your subscriptions or provide additional information.</p>
		</div>
<?php 
    }
}
Example #27
0
function display_page_content()
{
    // We use the old way to get all entries, because the FindAll function forces an exclusion date
    $the_blog = Blogs::FindById(BLOG_DEFAULT_ID);
    $entries = $the_blog->getEntries(false, false);
    $categories = Categories::FindAll();
    $year_month = $year = $month = $extraheader = "";
    $default_open = "opened";
    $thiscategory_id = requestIdParam();
    $thiscategory = Categories::FindById($thiscategory_id);
    if (is_object($thiscategory)) {
        $default_open = "";
        $extraheader = "from &ldquo;" . $thiscategory->display_name . "&rdquo;";
        $entries = $thiscategory->getEntries(false, false);
    }
    ?>
	
	<div id="edit-header" class="entrynav">		
		<div class="nav-left column">
			<h1>Edit <?php 
    echo ucwords(BLOG_STATIC_AREA);
    ?>
 Entries <?php 
    echo $extraheader . ' :: <a href="' . get_link(BLOG_STATIC_AREA) . '" title="Click to View All Entries">View Entries</a>';
    ?>
</h1>
		</div>
		<div class="nav-right column">
			<a class="hcd_button" href="<?php 
    echo get_link("/admin/edit_entry/add");
    ?>
">Add an Entry</a>
			<a class="hcd_button" href="<?php 
    echo get_link("/admin/list_categories/");
    ?>
">Edit Categories</a>
			<a class="hcd_button" href="<?php 
    echo get_link("/admin/add_category/");
    ?>
">Add a Category</a>
		</div>
		<div class="clearleft"></div>
	</div>
	
	<ul id="sort-list" class="menu tabs">
		<li><a class="<?php 
    echo $default_open;
    ?>
" href="<?php 
    echo get_link("admin/list_entries/");
    ?>
">All Categories</a></li><?php 
    foreach ($categories as $category) {
        $posts = $category->getEntries(false, false);
        if (count($posts) > 0) {
            $openclass = $category->id == $thiscategory_id ? "opened" : "";
            echo "<li><a class=\"{$openclass}\" href=\"" . get_link("admin/list_entries/" . $category->id) . "\">{$category->display_name}</a></li>";
        }
    }
    ?>
	
	</ul>
	<div class="clearleft"></div>
	
<?php 
    if (count($entries) > 0) {
        ?>
	<div id="table-header" class="entries">
		<strong class="item-link">Entry Name</strong>
		<span class="item-public">Public</span>
		<span class="item-created">Publication Date</span>
		<span class="item-revised">Author</span>
	</div>
	
	<ul id="listitems" class="managelist">
	<?php 
        foreach ($entries as $entry) {
            $blogyear_month = parseDate($entry->date, "Y-m");
            $blogyear = parseDate($entry->date, "Y");
            $blogmonth = parseDate($entry->date, "F");
            if ($blogyear_month != $year_month) {
                echo "\t\t<li class=\"monthname\">{$blogmonth} {$blogyear}</li>";
                $year_month = $blogyear_month;
                $year = $blogyear;
                $month = $blogmonth;
            }
            $public = $entry->public ? "" : "<span class=\"red\">(not public)</span>";
            echo "\t\t<li>\n\t\t\t\t<a class=\"item-link\" href=\"" . get_link("/admin/edit_entry/{$entry->id}") . "\">{$entry->title}</a>\n\t\t\t\t<span class=\"item-public\">{$public}</span>\n\t\t\t\t<span class=\"item-created\">" . formatDateTimeView($entry->date) . "</span>\n\t\t\t\t<span class=\"item-revised\">" . $entry->get_author() . "</span>\n\t\t\t</li>\n";
        }
        ?>

	</ul>
<?php 
    } else {
        echo "\t\t<h3 class=\"empty-list\">There are no " . BLOG_STATIC_AREA . " entries to edit. <a class=\"short\" href=\"" . get_link("admin/add_entry") . "\">Add one if you like</a>.</h3>";
    }
}
Example #28
0
function display_page_content()
{
    $imageId = requestIdParam();
    echo "<img src=\"" . get_link("images/thumbnail/" . $imageId) . "\" width=\"180\" alt=\"Preview thumbnail\" />";
}
Example #29
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 
}
Example #30
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 
}